• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
--- Error 1 of 1 ---
At <mod>\common\governments\ideological_governments.txt [republic_governments\merchant_republic_government\character_modifier\retinue_maintenence_cost] (Line 166, column 4):
Invalid node "retinue_maintenence_cost" in scope CharModifier (value is: 2)

this error is false alarm.

retinue_maintenence_cost is specifically a charmodifier in first place.

also I tested in-game and it does work.
 
flank_has_tactic is a valid condition inside flank scope (for example you can use it in normal events to check what the flank is doing, and you can use in the tactics definition files to make for example a tactic that only works after another one... I tested both, and both work.)
 
flank_has_tactic is a valid condition inside flank scope (for example you can use it in normal events to check what the flank is doing, and you can use in the tactics definition files to make for example a tactic that only works after another one... I tested both, and both work.)
Please post the error that Validator is giving you and ideally also a repro. The valdiator doesn't have the concept of a flank scope, though by the wiki flank/siege scopes are similar and validator does have siege scope and that already allows flank_has_tactic. So need to see exactly what error you are getting here to figure things out.
 
Ok, pasting some errors here directly, I am getting a ton of these and they are getting in the way.

Code:
--- Error 1 of 1 ---
At <mod>\common\buildings\03_cotc_DM_military_z_buildings.txt [castle\ca_capital_factory_q_1\custom_modifier_text] (Line 761, column 3):
Invalid node "custom_modifier_text" in scope NormalBuildingDef (value is: unlocks_battleship_retinue_tt)

custom_modifier_text is somewhat new, Paradox added it to add custom text to wonders, but it works seemly almost anywhere. I've seen it working fine in technology definition and building definition at least.

Code:
--- Error 1 of 1 ---
At <mod>\common\combat_tactics\melee_autogen_special.txt [boarding_encircled\trigger\OR\flank_has_tactic] (Line 1246, column 13):
Invalid node "flank_has_tactic" in scope BattleTrigger (value is: piercethrough_balanced)

This one is what I was talking about earlier.
 
So I was bothered I couldn't make a city a holy site...

So I went ahead, and moved the holy site definition from the county, to the city barony.

It worked, perfectly. Not only you can use holy sites on baronies, you can do it to non-temples, and it works just fine (At least so far...)

So this is false alarm:

--- Error 1 of 1 ---
At <mod>\common\landed_titles\landed_titles.txt [e_terran_confederation\k_terran_commonwealth\d_sol\c_sol\b_titan\holy_site] (Line 230, column 6):
Invalid node "holy_site" in scope BaronTitleDef (value is: astrist)
 
--- Error 1 of 1 ---
At <mod>\common\governments\special_governments.txt [feudal_governments\military_command\unit_modifier\key] (Line 183, column 13):
Invalid node "key" in scope <anon> (value is: military_command_levy)

--- Error 1 of 1 ---
At <mod>\common\governments\special_governments.txt [feudal_governments\military_base_government\unit_modifier\key] (Line 101, column 4):
Invalid node "key" in scope <anon> (value is: military_base_levy)


etc...

Basically, whatever modifiers work on religion definition files, seemly work on government too, can outright copy-paste and they will usually work fine.
 
Great update, checking if the "has_tactic" is correct made me find actual errors now :)

Now for the problems:

--- Error 1 of 1 ---
At <mod>\common\scripted_score_values\crisis_candidate_score.txt [personality_reasons\additive_exported_value_modifier] (Line 1174, column 5):
Invalid node "additive_exported_value_modifier" (value is: <a complex type>)
* called from <mod>\common\succession_voting\crisis_elections.txt [generic_election_rules\candidate_vote_score\personality_reasons] (Line 138, column 9)


--- Error 1 of 1 ---
At <mod>\common\council_positions\07_diplohawk.txt [diplohawk\selection\ai_diplomatic_ambition_score] (Line 16, column 3):
Invalid node "ai_diplomatic_ambition_score" in scope <anon> (value is: yes)

--- Error 1 of 1 ---
At <mod>\common\technology.txt [TECH_GROUP_ECONOMY\TECH_TERRAFORMING\8\custom_modifier_text] (Line 280, column 13):
Invalid node "custom_modifier_text" in scope TechLevelDef (value is: terraforming_4_tt)


--- Error 1 of 1 ---
At <mod>\common\scripted_score_values\crisis_scripted_score_values.txt [highest_prestige_piety_and_wealth\additive_exported_value_modifier] (Line 51, column 2):
Invalid node "additive_exported_value_modifier" (value is: <a complex type>)
* called from <mod>\common\landed_titles\landed_titles.txt [e_terran_confederation\gain_effect\if\if\e_terran_confederation\any_claimant\score_value\highest_prestige_piety_and_wealth] (Line 72, column 26)


As far as I know all those work fine.

it seems validator doesn't support additive_exported_value_modifier at all.
 
Great update, checking if the "has_tactic" is correct made me find actual errors now :)

Now for the problems:

--- Error 1 of 1 ---
At <mod>\common\scripted_score_values\crisis_candidate_score.txt [personality_reasons\additive_exported_value_modifier] (Line 1174, column 5):
Invalid node "additive_exported_value_modifier" (value is: <a complex type>)
* called from <mod>\common\succession_voting\crisis_elections.txt [generic_election_rules\candidate_vote_score\personality_reasons] (Line 138, column 9)


--- Error 1 of 1 ---
At <mod>\common\council_positions\07_diplohawk.txt [diplohawk\selection\ai_diplomatic_ambition_score] (Line 16, column 3):
Invalid node "ai_diplomatic_ambition_score" in scope <anon> (value is: yes)

--- Error 1 of 1 ---
At <mod>\common\technology.txt [TECH_GROUP_ECONOMY\TECH_TERRAFORMING\8\custom_modifier_text] (Line 280, column 13):
Invalid node "custom_modifier_text" in scope TechLevelDef (value is: terraforming_4_tt)


--- Error 1 of 1 ---
At <mod>\common\scripted_score_values\crisis_scripted_score_values.txt [highest_prestige_piety_and_wealth\additive_exported_value_modifier] (Line 51, column 2):
Invalid node "additive_exported_value_modifier" (value is: <a complex type>)
* called from <mod>\common\landed_titles\landed_titles.txt [e_terran_confederation\gain_effect\if\if\e_terran_confederation\any_claimant\score_value\highest_prestige_piety_and_wealth] (Line 72, column 26)


As far as I know all those work fine.

it seems validator doesn't support additive_exported_value_modifier at all.
Can you provide references about additive_exported_value_modifier, e.g. the wiki or changelogs or a paradox dev's post?

Same with ai_diplomatic_ambition_score

Re custom_modifier_text don't those go inside the "modifier" block? Or are you saying it can be either? If so, what's the denefit of doing tit this way over putting it in the modifier block?
 
Custom modifier text can go anywhere that accepts modifiers as far as I know.

As for documentation for additive_exported_value_modifier... there isn't any execept a very brief mention on changelog.

The person that most know how it works aside from Paradox Employees seemly is @Delnar_Ersike
 
Alright, examples of additive_exported_value_modifier.

Vanilla has 24 examples, all found in one file: common/scripted_score_values/01_scripted_score_values_papal_ai_behavior.txt. However, they're all basically the same code with only extremely minor variations between the 24. Here is a pair of them in ask_for_excommunication_chance:
Code:
#Influence over Cardinals.
additive_exported_value_modifier = {
    localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS
    factor = 2
    max = 45
    value = num_vassals_with_minor_title
    who = ROOT
    key = title_cardinal
}
additive_exported_value_modifier = {
    localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS
    factor = 2
    max = 45
    value = num_vassals_with_minor_title
    who = ROOT
    key = title_fraticelli_cardinal
}

The only official documentation on it is in the changelog:
Code:
- Added additive_exported_value_modifier, which lets you use an exportable value as a modifier. Example:
additive_exported_value_modifier = {
    trigger = { some triggers } # Uses current scope, *not* "who"
    localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS
    factor = 5 # What to multiply by
    max = 45 # The max value, optional
    min = 0 # The min value, optional
    value = num_vassals_with_minor_title # The export to use
    who = ROOT # Who to base it on
    key = title_cardinal # Optional key, as when using the export effect
}

The documentation is a bit confusing, but based on me messing around with this block, here's what I've found:
  • value can indeed be any quantity that you can export to a variable
  • key seems to only really work with num_vassals_with_minor_title
  • The triggers have to be directly inside the modifier inside of inside a trigger block
  • additive_exported_value_modifier will only work as part of an entry in scripted_score_values. It will not work if you just put it directly inside a weight, factor, ai_will_do, etc. block, you have to put it in a scripted score value, even if it ends up being the only entry in a given scripted score value.
Here are a few examples of it in HIP, where I've mainly used them in succession voting score modifiers.

Here's the scripted score modifier for an elector (ROOT) adjusting their score of a candidate (FROM) based on their age. The additive_exported_value_modifier stuff is at the very end, where the negative score that a candidate gets for being too old increases linearly depending on their age, starting from 50 for most electors and 40 for younger ones.
Code:
emf_succession_voting_candidate_age_score = {
    additive_modifier = {
        value = -30
        localisation_key = tooltip_feudal_elector_vote_baby
        NOT = { character = FROM }
        FROM = { NOT = { age = 6 } }
    }
    additive_modifier = {
        value = -15
        localisation_key = tooltip_feudal_elector_vote_child
        NOT = { character = FROM }
        FROM = {
            age = 6
            NOT = { age = 12 }
        }
    }
    additive_modifier = {
        value = -10
        localisation_key = tooltip_feudal_elector_vote_child
        NOT = { character = FROM }
        FROM = {
            age = 12
            NOT = { age = 16 }
        }
    }
    additive_modifier = { #Still too young for older rulers
        value = -10
        localisation_key = tooltip_feudal_elector_vote_youngster
        NOT = { character = FROM }
        age = 30
        FROM = {
            age = 16
            NOT = { age = 25 }
        }
    }
    additive_modifier = {
        value = -10
        localisation_key = tooltip_feudal_elector_vote_youngster
        NOT = { character = FROM }
        age = 40
        FROM = {
            age = 25
            NOT = { age = 35 }
        }
    }
    additive_exported_value_modifier = { #Or too old for younger rulers.
        NOT = { character = FROM }
        NOT = { age = 40 }
        FROM = {
            age = 40
            NOT = { age = 50 }
        }
        localisation_key = tooltip_feudal_elector_vote_oldtimer
        factor = -0.25
        value = age
        who = FROM
    }
    additive_exported_value_modifier = { #Or simply too old overall.
        NOT = { character = FROM }
        FROM = { age = 50 }
        localisation_key = tooltip_feudal_elector_vote_decrepit
        factor = -0.3
        min = -30
        value = age
        who = FROM
    }
}

Another example from election scoring: the elector (ROOT) has their score of the candidate (FROM) scale linearly depending on their prestige and their dynastic prestige, though the malus to score scales faster with negative prestige than the bonus does with positive prestige:
Code:
emf_succession_voting_candidate_prestige_score = {
    additive_exported_value_modifier = {
        NOT = { character = FROM }
        FROM = { prestige <= -20 }
        localisation_key = tooltip_feudal_elector_vote_prestige
        factor = 0.05
        value = prestige
        who = FROM
    }
    additive_exported_value_modifier = {
        NOT = { character = FROM }
        FROM = { prestige = 100 }
        localisation_key = tooltip_feudal_elector_vote_prestige
        factor = 0.01
        value = prestige
        who = FROM
    }
    additive_exported_value_modifier = {
        NOT = { character = FROM }
        FROM = { dynastic_prestige = 20 }
        localisation_key = tooltip_feudal_elector_vote_dynastic_prestige
        factor = 0.05
        max = 20
        value = dynastic_prestige
        who = FROM
    }
    additive_modifier = {
        value = -100
        localisation_key = tooltip_feudal_elector_vote_too_little_dynastic_prestige
        NOR = {
            character = FROM
            dynasty = FROM
            emf_is_parent_dynasty_of_ROOT_FROM = yes
            emf_is_cadet_dynasty_of_ROOT_FROM = yes
        }
        FROM = {
            trigger_if = {
                limit = { ROOT_FROMFROM = { tier = EMPEROR } }
                dynastic_prestige < 40
            }
            trigger_else_if = {
                limit = { ROOT_FROMFROM = { tier = KING } }
                dynastic_prestige < 20
            }
            trigger_else = {
                dynastic_prestige < 10
            }
        }
    }
}

An example of it outside of succession voting scoring stuff. In the following, HIP replaced the chance of impregnation from an event where two characters have sex to scale based on the two characters' fertilities instead of being based on just checking for the presence of fertility-increasing and/or fertility-decreasing traits. Here are the two scripted score modifiers being used (complete with my comments for why they are scripted score modifiers):
Code:
# additive_exported_value_modifier stuff needs to be present as a scripted score value for game to not bug out
emf_half_of_fertility_score_value = {
    additive_exported_value_modifier = {
        factor = 50
        value = fertility
        who = THIS
    }
}

# additive_exported_value_modifier stuff needs to be present as a scripted score value for game to not bug out
emf_FROM_fertility_score_value = {
    additive_exported_value_modifier = {
        factor = 100
        value = fertility
        who = FROM
    }
}
... and here is the effect in action:
Code:
custom_tooltip = {
    text = emf_ctt_can_cause_pregnancy_FROM
    if = {
        limit = {
            fertility > 0
            is_pregnant = no
            FROM = {
                fertility > 0
                is_pregnant = no
            }
        }
        random = {
            chance = 0
            emf_half_of_fertility_score_value = yes
            random = {
                chance = 0
                emf_FROM_fertility_score_value = yes
                impregnate_effect = yes
            }
        }
    }
}

The end result is that the chance of a pregnancy occuring ends up being the two characters' fertilities multiplied together and divided by two. For example, with two characters with 50% fertility, the first random block has a 25% chance of occurring (export 0.5 * 50 = 25 from THIS), and the second random block inside of it has a 50% chance of triggering (export 0.5 * 100 = 50 from FROM), giving an overall chance of 50% * 25% = 12.5%. If THIS has a fertility of, say, 40%, and FROM has a fertility of 60%, then the first random block's chance of firing is 0.4 * 50 = 20%, and the second one's chances of firing are 0.6 * 100 = 60%, giving an overall chance of 20% * 60% = 12%.
 
Custom modifier text can go anywhere that accepts modifiers as far as I know.

As for documentation for additive_exported_value_modifier... there isn't any execept a very brief mention on changelog.

The person that most know how it works aside from Paradox Employees seemly is @Delnar_Ersike
Right, I just wonder why not put it inside the modifier block? If there's no difference why not put it inside instead of adjacent? (validator does accept inside the modifier block; it should at least)
 
Is there any way to get the validator to ignore stuff regarding localization keys? i.e. the "... is not a valid LocalizationKey" and "... is not a valid Key or NamingInfo"?
 
  • 1Like
Reactions:
Is there any way to get the validator to ignore stuff regarding localization keys? i.e. the "... is not a valid LocalizationKey" and "... is not a valid Key or NamingInfo"?
Use validatorSettings.txt, and turn on `AddFlag = NoCheckKey` which you can find in the file.
 
  • 1
Reactions: