• 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.
This seems like a false positive to me:
Code:
--- Error 308 of 1915 ---
At <mod>\events\cm_charlemagne_story_events.txt [character_event\option\random_independent_ruler\add_alliance] (Line 4494, column 4):
Invalid node "add_alliance" in scope CharMaybeLimitCommand (value is: <a complex type>)

Code:
    random_independent_ruler = {
    ...
       opinion = { who = ROOT modifier = honored_alliance years = 10 }
       add_alliance = { who = ROOT years = 20 }
     }

Add_alliance is a valid command, and both ROOT and the random ruler scope to characters..
 
I guess I'm missing a bracket some where, but I have clue where to find the location.
Those are easy to pinpoint. Just enable error logging, run the game, then check error.log.

If there's a missing bracket, you'll find a long list of garbled output in the log. Check the first listed error for whichever file is generating the errors. It should show the line where it occured, and that's usually close to where the unmatched bracket is.
 
Last edited:
Those are easy to pinpoint. Just enable error logging, run the game, then check error.log.

If there's a missing bracket, you'll find a long list of garbled output in the log. Check the first listed error for whichever file is generating the errors. It should show the line where it occured, and that's usually close to where the unmatched bracket is.
Odd the error log isn't showing any problems, but the Validator is.
EDIT: I played for a little longer and finally got an error in the log
"
[persistent.cpp:37]: Error: "Unexpected token: , near line: 1
" in file: "" near line: 1
"
I think Rylock is right, I'll have to find the missing bracket the hard way.
 
Last edited:
[persistent.cpp:37]: Error: "Unexpected token: , near line: 1 " in file: "" near line: 1"
Might not be related.
Those pop up in the log if you run console events while in observe mode, etc.

I think Rylock is right, I'll have to find the missing bracket the hard way.
Or just get Notepad++ and use the search count function to pinpoint it. First make a backup of landed_titles.txt. Then use the search function to count the number of { and } in the file. If it doesn't match, there's an unclosed bracket.

To locate it, you can try deleting some of the kingdoms. Then check the count again. If it matches now, the missing bracket was in something that you just removed. If not, keep pruning until you find the right chunk of code..

Far faster than manually eyeing the code.
 
If you have shortcuts set up with notepad++ then you can use ctrl+b which jumps from the opening of a bracket to the closing of one and if it does a weird jump to somewhere it shouldn't then you know where the missing bracket should be
 
Might not be related.
Those pop up in the log if you run console events while in observe mode, etc.


Or just get Notepad++ and use the search count function to pinpoint it. First make a backup of landed_titles.txt. Then use the search function to count the number of { and } in the file. If it doesn't match, there's an unclosed bracket.

To locate it, you can try deleting some of the kingdoms. Then check the count again. If it matches now, the missing bracket was in something that you just removed. If not, keep pruning until you find the right chunk of code..

Far faster than manually eyeing the code.
Thank you, I have Notepad++ but I don't know it's functions.
 
Or just get Notepad++ and use the search count function to pinpoint it. First make a backup of landed_titles.txt. Then use the search function to count the number of { and } in the file. If it doesn't match, there's an unclosed bracket.

To locate it, you can try deleting some of the kingdoms. Then check the count again. If it matches now, the missing bracket was in something that you just removed. If not, keep pruning until you find the right chunk of code..

Far faster than manually eyeing the code.
I use Text Wrangler (on Mac). My method is to select JSON as the file type (reasonably close as far as bracketing & syntax). Then tell it to collapse all folds. canning down, a missing bracket will generally be quite obvious, as stuff that should be inside some bracket will show as a top-level fold. Especially if you've been consistent with indentation, the odd part will be indented, whereas top-level folds shouldn't be. So you open up the last last-level fold before the wrongly folded bit, and should see a similar type of thing. Keep doing this until the error is obvious. :)
 
It has been made known to us that having character ids with 10 or more digits can cause stability/CTD problems. Can a check/warning about characters with such large ids be added to the validator?
 
Code:
--- Error 1 of 1 ---
At <mod>\events\rip_dancing_plague_events.txt [character_event] (Line 42, column 1):
The event is set to be triggered only, but it is never called.
The event in question is called from the on_character_infection block of dancing_plague in common/diseases/00_disease.txt.
Code:
--- Error 1 of 1 ---
At <mod>\events\rip_flavor_events.txt [letter_event\immediate\if\FROM] (Line 9649, column 4):
No direct match found for FROM (is the casing correct?). However, other possible matches in scope CharCommand were found.
Left: [ThisChar] Right: [CharCommand] cannot be correct because of left: FROM points to <null>.
However, a Char was expected.
This scope has no FROM due to the fact that <mod>\common\on_actions\00_on_actions.txt [on_holding_building_start\events\RIP.30100] (Line 3463, column 3) has no scope.
Left: [ThisProv] Right: [ProvCommand] cannot be correct because of left: FROM points to <null>.
However, a Prov was expected.
This scope has no FROM due to the fact that <mod>\common\on_actions\00_on_actions.txt [on_holding_building_start\events\RIP.30100] (Line 3463, column 3) has no scope.
Left: [ThisTitle] Right: [TitleCommand] cannot be correct because of left: FROM points to <null>.
However, a Title was expected.
This scope has no FROM due to the fact that <mod>\common\on_actions\00_on_actions.txt [on_holding_building_start\events\RIP.30100] (Line 3463, column 3) has no scope.
Per the comment on on_holding_building_start in on_actions.txt, ROOT = builder, FROM = holding title
Code:
--- Error 1 of 1 ---
At <mod>\events\rip_flavor_events.txt [letter_event\option\set_pacified] (Line 8539, column 3):
Invalid node "set_pacified" in scope Option (value is: <a complex type>)
New effect clause, takes years = <int> inside its clause.
Code:
--- Error 1 of 3 ---
At <mod>\events\rip_hospital_events.txt [character_event\trigger\any_demesne_province\OR\hospital_has_building] (Line 761, column 5):
"library_1" is not a valid Building.
--- Error 2 of 3 ---
At <mod>\events\rip_hospital_events.txt [character_event\trigger\any_demesne_province\OR\hospital_has_building] (Line 762, column 5):
"pharmacology_laboratory_1" is not a valid Building.
--- Error 3 of 3 ---
At <mod>\events\rip_hospital_events.txt [character_event\trigger\any_demesne_province\OR\hospital_has_building] (Line 763, column 5):
"medical_academy_1" is not a valid Building.
All of these are valid hospital buildings:
Code:
 # Triggers are in Province scope. The From Scope contains the settlement holder (character)
 # start trigger is in title scope.

hospital = {

   hospital_building_1 = {
     potential = {

     }
     desc = hospital_building_1_desc
     trigger = {
       TECH_CULTURE = 1
       TECH_MISSIONARY = 1
       TECH_TEMPLE_CONSTRUCTION = 1
       #   owner = { any_realm_province = { owner = { character = ROOT } } }
     }
     gold_cost = 250
     build_time = 360
     ai_creation_factor = 5
     
     hospital_level = 1
     disease_defence = 0.05
     
     extra_tech_building_start = 10.0 # Never get at start of game
   }
   
   hospital_building_2 = {
     potential = {

     }
     desc = hospital_building_2_desc
     trigger = {
       TECH_TEMPLE_CONSTRUCTION = 2
       TECH_CULTURE = 2
       TECH_MISSIONARY = 2
     }
     gold_cost = 500
     build_time = 365
     upgrades_from = hospital_building_1
     ai_creation_factor = 20
     
     hospital_level = 1
     disease_defence = 0.1
     
     extra_tech_building_start = 10.0 # Never get at start of game
   }
   
   hospital_building_3 = {
     potential = {

     }
     desc = hospital_building_3_desc
     trigger = {
       TECH_TEMPLE_CONSTRUCTION = 3
       TECH_CULTURE = 3
       TECH_MISSIONARY = 3
     }
     gold_cost = 1000
     build_time = 730
     upgrades_from = hospital_building_2
     ai_creation_factor = 20
     
     hospital_level = 1
     disease_defence = 0.15
     
     extra_tech_building_start = 10.0 # Never get at start of game
   }
   
   hospital_building_4 = {
     potential = {

     }
     desc = hospital_building_4_desc
     trigger = { TECH_CONSTRUCTION = 5 }
     gold_cost = 2000
     build_time = 365
     upgrades_from = hospital_building_3
     ai_creation_factor = 90
     
     hospital_level = 1
     disease_defence = 0.2
     
     extra_tech_building_start = 10.0 # Never get at start of game
   }
   
   hospital_building_5 = {
     potential = {

     }
     desc = hospital_building_5_desc
     trigger = {
       TECH_TEMPLE_CONSTRUCTION = 5
       TECH_CULTURE = 5
       TECH_MISSIONARY = 5
     }
     gold_cost = 4000
     build_time = 1095
     upgrades_from = hospital_building_4
     ai_creation_factor = 89
     
     hospital_level = 1
     disease_defence = 0.25
     
     extra_tech_building_start = 10.0 # Never get at start of game
   }
   
   leper_colony_1 = {
     potential = {
       
     }
     prerequisites = { hospital_building_1 }
     desc = leper_colony_building_desc
     trigger = { TECH_CULTURE = 1 }
     gold_cost = 300
     build_time = 365
     ai_creation_factor = 5
     
     disease_defence = 0.1
     
     extra_tech_building_start = 10.0 # Never get at start of game
   }
   
   soup_kitchen_1 = {
     potential = {
       
     }
     prerequisites = { hospital_building_1 }
     desc = soup_kitchen_building_desc
     trigger = { TECH_CULTURE = 1 }
     gold_cost = 250
     build_time = 365
     ai_creation_factor = 5
     
     disease_defence = 0.04
     liege_piety = 0.10
     church_opinion = 2
     
     extra_tech_building_start = 10.0 # Never get at start of game
   }
   
   chapel_1 = {
     potential = {
       
     }
     prerequisites = { hospital_building_1 }
     desc = chapel_building_desc
     trigger = { TECH_MISSIONARY = 1 }
     gold_cost = 600
     build_time = 365
     ai_creation_factor = 5
     
     disease_defence = 0.02
     liege_piety = 0.1
     church_opinion = 2
     
     extra_tech_building_start = 10.0 # Never get at start of game
   }
   
   translation_house_1 = {
     potential = {
       
     }
     prerequisites = { hospital_building_2 }
     desc = translation_house_building_desc
     trigger = { TECH_TEMPLE_CONSTRUCTION = 1 }
     gold_cost = 400
     build_time = 365
     ai_creation_factor = 5
     
     liege_prestige = 0.25
     economy_techpoints = 0.04
     
     extra_tech_building_start = 10.0 # Never get at start of game
   }
   
   pilgrims_inn_1 = {
     potential = {
       
     }
     prerequisites = { hospital_building_1 }
     desc = pilgrims_inn_building_desc
     trigger = { TECH_MISSIONARY = 1 }
     gold_cost = 400
     build_time = 365
     ai_creation_factor = 5
     
     liege_prestige = 0.25
     liege_piety = 0.10
     
     extra_tech_building_start = 10.0 # Never get at start of game
   }
   
   library_1 = {
     potential = {
       
     }
     prerequisites = { hospital_building_1 }
     desc = library_building_desc
     trigger = { TECH_CONSTRUCTION = 3 }
     gold_cost = 450
     build_time = 365
     ai_creation_factor = 5
     
     tech_growth_modifier = 0.25
     culture_techpoints = 0.03
     
     extra_tech_building_start = 10.0 # Never get at start of game
   }
   
   pharmacology_laboratory_1 = {
     potential = {
       
     }
     prerequisites = { hospital_building_3 }
     desc = pharmacology_laboratory_building_desc
     trigger = { TECH_TEMPLE_CONSTRUCTION = 2 }
     gold_cost = 450
     build_time = 365
     ai_creation_factor = 5
     
     tech_growth_modifier = 0.25
     disease_defence = 0.02
     
     extra_tech_building_start = 10.0 # Never get at start of game
   }
   
   medical_academy_1 = {
     potential = {
       
     }
     prerequisites = {
       hospital_building_3
       library_1
     }
     desc = medical_academy_building_desc
     trigger = { TECH_TEMPLE_CONSTRUCTION = 2 }
     gold_cost = 500
     build_time = 365
     ai_creation_factor = 5
     
     disease_defence = 0.02
     culture_techpoints = 0.03
     economy_techpoints = 0.03
     military_techpoints = 0.03
     
     extra_tech_building_start = 10.0 # Never get at start of game
   }
   
   observatory_1 = {
     potential = {
       
     }
     prerequisites = {
       hospital_building_3
       pharmacology_laboratory_1
     }
     desc = observatory_building_desc
     trigger = { TECH_TEMPLE_CONSTRUCTION = 2 }
     gold_cost = 400
     build_time = 365
     ai_creation_factor = 5
     
     culture_techpoints = 0.03
     military_techpoints = 0.03
     
     extra_tech_building_start = 10.0 # Never get at start of game
   }
}
--- Error 1 of 3 ---
At <mod>\events\rip_hospital_events.txt [character_event\trigger\any_demesne_province\OR\hospital_has_building] (Line 761, column 5):
"library_1" is not a valid Building.
--- Error 2 of 3 ---
At <mod>\events\rip_hospital_events.txt [character_event\trigger\any_demesne_province\OR\hospital_has_building] (Line 762, column 5):
"pharmacology_laboratory_1" is not a valid Building.
--- Error 3 of 3 ---
At <mod>\events\rip_hospital_events.txt [character_event\trigger\any_demesne_province\OR\hospital_has_building] (Line 763, column 5):
"medical_academy_1" is not a valid Building.
 
Last edited:
--- Error 1 of 1 ---
At <mod>\events\republic_trade_events.txt [character_event\option\capital_scope\FROM\new_character\if\graphical_culture] (Line 1725, column 7):
Invalid node "graphical_culture" in scope CharIfClause (value is: volantene)
This is valid as an effect and takes a culture as a scope
Does this have any relation to set_graphical_culture?

--- Error 1 of 1 ---
At <mod>\common\laws\ze_council_power_laws.txt [laws\justice_voting_power_1\effect\hidden_tooltip\enable_council_voting_on_issue] (Line 962, column 5):
"ransom_all" is not a valid CouncilVotingTopic.
--- Error 1 of 1 ---
At <mod>\common\council_voting\01_pragmatist_pattern.txt [pragmatist_pattern_against\break_non_aggression_pact] (Line 1042, column 2):
Invalid node "break_non_aggression_pact" in scope CouncilVotingDef (value is: <a complex type>)

Council voting can now be scripted for targetted decisions. Note that in council_voting for targetted decisions the target character is in the FROMFROMFROM scope.
Can you link me the mod with these issues so its easier to test etc?

--- Error 1 of 1 ---
At <mod>\events\on_action_events.txt [character_event\option\hidden_tooltip\liege\any_courtier\clr_character_flag] (Line 18415, column 6):
Bad name courtier_@FROMFROM
I'm not sure what this means, dynamic flags using @root @From etc were added recently
Because I'm stupid -_-
Had "if (postFix.Length != 4)" instead of "if (postFix.Length % 4 != 0)"

It has been made known to us that having character ids with 10 or more digits can cause stability/CTD problems. Can a check/warning about characters with such large ids be added to the validator?
All char IDs would appear in history character db right?

Is the limit 10 digits or is it more like "must be less than 2 billion" or "must be less than 4 billion"?
 
Pretty sure the limit is 2 billionish.
 
Does this have any relation to set_graphical_culture?
I will have to double check when i can test it, that may be a mistake on my part.

Can you link me the mod with these issues so its easier to test etc?
I'll send a PM shortly.

All char IDs would appear in history character db right?

Is the limit 10 digits or is it more like "must be less than 2 billion" or "must be less than 4 billion"?
Indeed, We recently received some assistance from Divine who advised us to remove ids higher than a billion to avoid some stability issues, so I'm guessing that using this as a general rule would be safe.
 
Last edited:
Code:
--- Error 1 of 3 ---
At <mod>\common\on_actions\00_on_actions.txt [on_province_major_modifier\events\RIP.10030] (Line 2639, column 3):
"RIP.10030" is not a valid CharEventId, LetterEventId, DiploRespEventId, NarrativeEventId, or LongCharEventId.
--- Error 2 of 3 ---
At <mod>\common\on_actions\00_on_actions.txt [on_outbreak\events\RIP.4000] (Line 2633, column 3):
"RIP.4000" is not a valid CharEventId, LetterEventId, DiploRespEventId, NarrativeEventId, or LongCharEventId.
--- Error 3 of 3 ---
At <mod>\common\on_actions\00_on_actions.txt [on_outbreak\events\RIP.10000] (Line 2632, column 3):
"RIP.10000" is not a valid CharEventId, LetterEventId, DiploRespEventId, NarrativeEventId, or LongCharEventId.
These three events are province_events. These particular on_actions trigger for provinces.
Code:
--- Error 1 of 1 ---
At <mod>\events\rip_prosperity_events.txt [province_event\option\add_holding_slot] (Line 867, column 3):
Invalid node "add_holding_slot" in scope Option (value is: 1)
New effect in province scope. Takes an int. Probably should give a warning if it is anything other than 1.
Code:
--- Error 1 of 1 ---
At <mod>\events\rip_prosperity_events.txt [province_event\trigger\NOT\num_of_max_settlements] (Line 770, column 4):
Invalid node "num_of_max_settlements" in scope ProvTrigger (value is: 7)
New trigger in province scope, takes an int.
 
Last edited:
Looping static_effects crash the validator...

I can't really trim my files down, but it's kind of like this:
Code:
increase_brave = {
  if = {
     limit = { # Check to see if the variable has been set up.
       NOT = { has_character_flag = main_check }
     }
     brave_setup = yes
   }
   hidden_tooltip = {
     random_list = { # Modifies the variable by a random amount.
       10 = { }
       25 = { change_variable = { which = brave   value = 1 } }
       10 = { change_variable = { which = brave   value = 2 } }
       6 = { change_variable = { which = brave   value = 3 } }
       4 = { change_variable = { which = brave   value = 4 } }
       2 = { change_variable = { which = brave   value = 5 } }
       1 = { change_variable = { which = brave   value = 6 } }
     }
     set_brave = yes
   }
}

Code:
brave_setup = {
  if = {
     limit = {
       NOT = { has_character_flag = main_check }
     }
    set_character_flag = main_check
    hidden_tooltip = {
       random_list = { # Sets the initial random value for the 'brave' variable.
         5 = { set_variable = { which = brave  value = 0 } }
         # ...trimmed
         1 = { set_variable = { which = brave  value = 150 } }
       }
       if = { limit = { trait = honorable }  increase_brave = yes }  # This is where it runs the previous effect.
      if = { limit = { trait = hunter }  increase_brave = yes }
      if = { limit = { trait = shy }  decrease_brave = yes }
      if = { limit = { trait = temperate }  minor_increase_brave = yes }
       # ...and tons of other modifiers.
       set_brave = yes
     }
   }
}

Code:
set_brave = {
   if = {
     limit = {
       check_variable = { which = brave   value = 75 }
       NOT = { trait = brave }
     }
     add_trait = brave
     break = yes
   }
   if = {
     limit = {
       NOT = { check_variable = { which = brave   value = 35 } }
     }
     add_trait = craven
     break = yes
   }
   if = { limit = { trait = craven }   remove_trait = craven }
   if = { limit = { trait = brave }   remove_trait = brave }
}


Works fine in-game, but the validator doesn't seem to realise that the character flag gets set and instead thinks that it's an endless loop...?

If that's too hard to parse, then there should at least be some check that stops parsing if there's been too many loops. So it doesn't crash..
 
Last edited:
Code:
--- Error 1 of 1 ---
At common\laws\succession_laws.txt [gender_laws\agnatic_succession\default_selection\modifier] (Line 887, column 4):
Invalid node "modifier" in scope LawDefaultSelection (value is: <a complex type>)
default_selection in laws contain factors and modifiers.
Code:
--- Error 1 of 2 ---
At events\feast_events.txt [character_event\trigger\any_liege\any_vassal\NOT\is_friend] (Line 2470, column 6):
Invalid node "Item" in scope CharTrigger (value is: is_friend)
--- Error 2 of 2 ---
At events\feast_events.txt [character_event\trigger\any_liege\any_vassal\NOT\ROOT] (Line 2470, column 16):
Invalid node "Item" in scope CharTrigger (value is: ROOT)
Code:
        NOT = {
           is_friend ROOT
         }
This should have thrown a parsing error for lack of an =.
Code:
--- Error 1 of 1 ---
At events\game_rule_events.txt [character_event\trigger\any_demesne_title\NOT\ROOT\any_realm_title\any_dejure_liege] (Line 27, column 7):
Invalid node "any_dejure_liege" in scope TitleTriggerWithCount (value is: <a complex type>)
New trigger scope. Usage context:
Code:
    any_demesne_title = {
       higher_tier_than = COUNT
       is_titular = no
       is_landless_type_title = no
       NOT = {
         ROOT = {
           any_realm_title = {
             tier = COUNT
             any_dejure_liege = { title = PREVPREVPREV }
 
Last edited:
This should have thrown a parsing error for lack of an =.
Don't think this provides enough value for how hard it would be to add. The reason is that Validator first constructs a tree, then inspects the tree. Since lists of e.g. x = { 1 2 3 } are allowed, the Validator constructs a tree with those contents, and only when looking at the tree notices a problem. Here we could try to report a better error message but it would be far from trivial to do.

New trigger scope. Usage context:
Can you confirm it is dejure and not de_jure? Because there are currently things such as any_de_jure_liege_title and de_jure_liege.

In title trigger scope there is currently any_de_jure_liege_title which goes to another title scope, so I guess this scope should switch to character scope?
 
I searched the executable before reporting, so yes, it is as stated. Both seem to be title to title. Maybe @Divine can explain the difference, if any.