• 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.
Getting this error in Title validation, connected to modded province history files. v1.10 RC17.

Beginning validation...
Beginning Titles validation...

ec) EXCEPTION CONTEXT
ec) Validation Task: Titles
Validation Key: HistoryTitles
Validation Type: Audax.Validator.GroupValidator



ERROR
System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.ArgumentException: An item with the same key has already been added.
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Linq.ParallelEnumerable.ToDictionary[TSource,TKey,TElement](ParallelQuery`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
--- End of inner exception stack trace ---
at System.Linq.ParallelEnumerable.ToDictionary[TSource,TKey,TElement](ParallelQuery`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at System.Linq.ParallelEnumerable.ToDictionary[TSource,TKey,TElement](ParallelQuery`1 source, Func`2 keySelector, Func`2 elementSelector)
at Audax.Validator.Clausewitz.Ck2.TitleCapitalChecksConstraint.Run(ElementNode node)
at Audax.Validator.Clausewitz.Ck2.TitleCapitalChecksConstraint.RunOnElement(ElementNode node)
at Audax.Validator.TypeCore.ComplexConstraint.ComplexConstraintWorker.ValidateInstanceAsBase(ElementNode node, NodeFlags flags)
at Audax.Validator.TypeCore.ComplexConstraint.ValidateInstanceAsBase(ElementNode node, NodeFlags flags)
at Audax.Validator.TypeCore.InheritanceConstraint.Validate(ElementNode node, NodeFlags flags)
at Audax.Validator.TypeCore.ComplexConstraint.ComplexConstraintWorker.ValidateInstanceAsBase(ElementNode node, NodeFlags flags)
at Audax.Validator.TypeCore.ComplexConstraint.ComplexConstraintWorker.ElementValidate(ElementNode node)
at Audax.Validator.TypeCore.ComplexConstraint.ElementValidate(ElementNode node)
at Audax.Validator.TypeCore.PlaceholderConstraint.ElementValidate(ElementNode node)
at Audax.Validator.TypeCore.ChildConstraintSystem.ChildConstraint.Validate(ElementNode node, NodeFlags flags)
at Audax.Validator.TypeCore.ComplexConstraint.ComplexConstraintWorker.ValidateInstanceAsBase(ElementNode node, NodeFlags flags)
at Audax.Validator.TypeCore.ComplexConstraint.ComplexConstraintWorker.ElementValidate(ElementNode node)
at Audax.Validator.TypeCore.ComplexConstraint.ElementValidate(ElementNode node)
at Audax.Validator.TypeExtension.DeclarativeValidatorJob.DeclarativeValidatorWorker.Validate()
at Audax.Validator.TypeExtension.DeclarativeValidatorJob.ValidateOverride()
at Audax.Validator.ValidatorJobBase.Validate()
at Audax.Validator.GroupValidator.ValidateOverride()
at Audax.Validator.ValidatorJobBase.Validate()
at Audax.Validator.ValidatorJob.Validate()
at Audax.Validator.GameValidator.<>c__DisplayClass5.<Validate>b__3(ValidatorJob val)
at System.Threading.Tasks.Parallel.<>c__DisplayClassf`1.<ForWorker>b__c()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass11.<ExecuteSelfReplicating>b__10(Object param0)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body)
at Audax.Validator.GameValidator.Validate(Action onEachValidatorCompleteAction)
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> System.ArgumentException: An item with the same key has already been added.
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Linq.ParallelEnumerable.ToDictionary[TSource,TKey,TElement](ParallelQuery`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
--- End of inner exception stack trace ---
at System.Linq.ParallelEnumerable.ToDictionary[TSource,TKey,TElement](ParallelQuery`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at System.Linq.ParallelEnumerable.ToDictionary[TSource,TKey,TElement](ParallelQuery`1 source, Func`2 keySelector, Func`2 elementSelector)
at Audax.Validator.Clausewitz.Ck2.TitleCapitalChecksConstraint.Run(ElementNode node)
at Audax.Validator.Clausewitz.Ck2.TitleCapitalChecksConstraint.RunOnElement(ElementNode node)
at Audax.Validator.TypeCore.ComplexConstraint.ComplexConstraintWorker.ValidateInstanceAsBase(ElementNode node, NodeFlags flags)
at Audax.Validator.TypeCore.ComplexConstraint.ValidateInstanceAsBase(ElementNode node, NodeFlags flags)
at Audax.Validator.TypeCore.InheritanceConstraint.Validate(ElementNode node, NodeFlags flags)
at Audax.Validator.TypeCore.ComplexConstraint.ComplexConstraintWorker.ValidateInstanceAsBase(ElementNode node, NodeFlags flags)
at Audax.Validator.TypeCore.ComplexConstraint.ComplexConstraintWorker.ElementValidate(ElementNode node)
at Audax.Validator.TypeCore.ComplexConstraint.ElementValidate(ElementNode node)
at Audax.Validator.TypeCore.PlaceholderConstraint.ElementValidate(ElementNode node)
at Audax.Validator.TypeCore.ChildConstraintSystem.ChildConstraint.Validate(ElementNode node, NodeFlags flags)
at Audax.Validator.TypeCore.ComplexConstraint.ComplexConstraintWorker.ValidateInstanceAsBase(ElementNode node, NodeFlags flags)
at Audax.Validator.TypeCore.ComplexConstraint.ComplexConstraintWorker.ElementValidate(ElementNode node)
at Audax.Validator.TypeCore.ComplexConstraint.ElementValidate(ElementNode node)
at Audax.Validator.TypeExtension.DeclarativeValidatorJob.DeclarativeValidatorWorker.Validate()
at Audax.Validator.TypeExtension.DeclarativeValidatorJob.ValidateOverride()
at Audax.Validator.ValidatorJobBase.Validate()
at Audax.Validator.GroupValidator.ValidateOverride()
at Audax.Validator.ValidatorJobBase.Validate()
at Audax.Validator.ValidatorJob.Validate()
at Audax.Validator.GameValidator.<>c__DisplayClass5.<Validate>b__3(ValidatorJob val)
at System.Threading.Tasks.Parallel.<>c__DisplayClassf`1.<ForWorker>b__c()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass11.<ExecuteSelfReplicating>b__10(Object param0)
---> (Inner Exception #0) System.ArgumentException: An item with the same key has already been added.
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Linq.ParallelEnumerable.ToDictionary[TSource,TKey,TElement](ParallelQuery`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)<---
<---

If I yank out all but the first few hundred mod province history files, this error doesn’t occur. But as I move more files back in, some of them result in the error, and some don’t, with no obvious pattern.
 
Then screw him if he can't follow established naming conventions and call it GFX_event_narrative_frame_cool. It's a feature that I would find very useful, as I have changed numerous character events to narrative events without remembering to check borders. Make it turned off unless enabled in ValidatorSettings if you must, but please include it.
Anyone else find this useful? I'm inclined to leave it out but if enough people want it I can add it.

Is Validator counting custom_tooltip or hidden_tooltip as a scope change? Because I make PREVPREV to point to the allow starting scope (a title scope, since it's a settlement_decision).
from_potential is valid in trade_post_decisions..
It is counting custom_tooltip but the next version should fix it.

succ_law_title changes scope from character to title.
There is one case here: At common\cb_types\00_cb_types.txt [other_claim\can_use_title\OR\AND\NOT\succ_law_title] (Line 248, column 13):
that it seems to change Title -> Title. Can you comment on that? For now the Validator will allow it in both title and char.

Getting this error in Title validation, connected to modded province history files. v1.10 RC17.



If I yank out all but the first few hundred mod province history files, this error doesn’t occur. But as I move more files back in, some of them result in the error, and some don’t, with no obvious pattern.
Will be fixed in the next version, looks like a duplicate province ID somewhere.
 
There is one case here: At common\cb_types\00_cb_types.txt [other_claim\can_use_title\OR\AND\NOT\succ_law_title] (Line 248, column 13):
that it seems to change Title -> Title. Can you comment on that? For now the Validator will allow it in both title and char.

I'm inclined to think that's a bug. What's important in an other_claim CB is that the title in dispute does not have agnatic succession if the claimant is a woman, the succession law of any other titles held by the holder shouldn't matter. I'll report it and ask for a clarification.
 
Anyone else find this useful? I'm inclined to leave it out but if enough people want it I can add it.
I would like it as well, I have had numerous border bugs before like that simply because I say copy and pasted the wrong border name and had no idea what was going on, especially when making some province and character events etc where I only change the event type and not the content I always forget the border
 
At <mod>\common\combat_tactics\00_combat_tactics.txt [USE_CHOKEPOINT_TACTIC\trigger\calc_true_if] (Line 4034, column 3):
Invalid node "calc_true_if" in scope BattleTrigger (value is: <a complex type>)

This was caused by a calc_true_if = { stuff } inside of a trigger = { } in a combat_tactics file. calc_true_if returns a bool, not a complex value like the error message suggests. Also, when testing modding combat tactics the triggers accepted calc_true_if just fine.

At <mod>\common\combat_tactics\00_combat_tactics.txt [religious_fervour_tactic\trigger\leader\PREV] (Line 3959, column 4):
No direct match found for PREV (is the casing correct?). However, other possible matches in scope CharTrigger were found.
Left: [ThisChar] Right: [CharTrigger] cannot be correct because of left: PREV points to BattleTrigger.
However, a Char was expected.
Left: [ThisProv] Right: [ProvTrigger] cannot be correct because of left: PREV points to BattleTrigger.
However, a Prov was expected.
Left: [ThisTitle] Right: [TitleTrigger] cannot be correct because of left: PREV points to BattleTrigger.
However, a Title was expected.

This error and similar errors seem to be caused whenever I use a PREV scope inside of a trigger section in a combat tactics file. PREVPREV and PREVPREVPREV have the same problem. When I test my mod these work just fine.
 
@Meneth: There are a bunch of broken color commands in vanilla, especially in the French, German and Spanish localizations. Some are easy to fix, some aren't because more than just the ! is missing from the localization. (The localization got truncated before the end of color command.)

Edit: Oops, that was a very old message I was responding to. Disregard.
 
--- Error 1 of 1 ---
At <mod>\events\achievement_events.txt [narrative_event] (Line 47, column 1):
The event is set to be triggered only, but it is never called.
Validator still isn't recognizing the call from a unit_event:
Code:
namespace = chronicled_achievements

# Viking Raider
unit_event = {
   id = 700
   hide_window = yes
   
   ai = no
   
   is_triggered_only = yes
   
   trigger = {
     has_dlc = "Charlemagne"
     FROM = {
       culture_group = north_germanic
       OR = {
         religion = norse_pagan
         religion = norse_pagan_reformed
       }
     }
     loot = 1000
   }
   
   immediate = {
     FROM = {
       if = {
         limit = {
           NOT = { has_global_flag = achievement_viking_raider }
         }
         set_global_flag = achievement_viking_raider
         chronicle = {
           entry = CHRONICLE_ACHIEVEMENT_VIKING_RAIDER
           portrait = [From.GetID]
           picture = GFX_evt_viking_arriving_oldgods
         }
         narrative_event = {
           id = chronicled_achievements.1
         }
       }
     }
   }
}

narrative_event = {
   id = chronicled_achievements.1
   title = ACHIEVEMENT
   desc = EVTDESCca.1
   picture = GFX_evt_viking_arriving_oldgods
   border = GFX_event_narrative_frame_war
   
   is_triggered_only = yes
   hide_from = yes
   major = yes
   major_trigger = {
     ai = no
   }
   
   option = {
     name = EVTOPTAca.1
     trigger = {
       character = ROOT
     }
   }
   option = {
     name = EVTOPTBca.1
     trigger = {
       NOT = {
         character = ROOT
       }
     }
   }
   option = {
     name = EVTOPTCca.1
     trigger = {
       NOT = {
         character = ROOT
       }
       multiplayer = yes
     }
     custom_tooltip = {
       text = ca.100.tooltip
       hidden_tooltip = {
         ROOT = {
           letter_event = {
             id = chronicled_achievements.100
           }
         }
       }
     }
   }
   option = {
     name = EVTOPTDca.1
     trigger = {
       NOT = {
         character = ROOT
       }
       multiplayer = yes
     }
     custom_tooltip = {
       text = ca.101.tooltip
       hidden_tooltip = {
         ROOT = {
           letter_event = {
             id = chronicled_achievements.101
           }
         }
       }
     }
   }
}
 
--- Error 1 of 1 ---
At <mod>\common\objectives\00_plots.txt [plot_kill_character\target_potential\NOT\any_spouse\character] (Line 713, column 26):
"FROM" is not a valid MaybeEventTargetCharTitle, OpinionClauseDefinedTypes, CharacterId, or Yes.
MaybeEventTargetCharTitle: cannot be because ThisChar: cannot be because FROM points to <null>.
However, a Char was expected.
This is not a valid place to use FROM.
ThisTitle: cannot be because FROM points to <null>.
However, a Title was expected.
This is not a valid place to use FROM.
FROM is the plotter.
 
Now, on a HIP installation with several modules, I get this:

Code:
ec) EXCEPTION CONTEXT



ERROR
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.Collections.Generic.Dictionary`2.ValueCollection.Enumerator.MoveNext()
   at Audax.Validator.ContextValidatorSystem.EventTargets.EventTargetsManager.PostProcess()
   at Audax.Validator.ContextValidatorSystem.EventTargets.EventTargetPostProcessor.OnPostvalidation(Context c, Scope scope)
   at Audax.Validator.GameValidator.Validate(Action onEachValidatorCompleteAction)
Happened during Wars validation - but not when only Wars validation is selected.
 
--- Error 1 of 1 ---
At <mod>\events\Religious_Flavor_Events_1.txt [character_event\trigger\OR\OR\any_liege\any_war\custom_tooltip] (Line 1643, column 7):
Invalid node "custom_tooltip" in scope WarTrigger (value is: <a complex type>)
custom_tooltip works inside a war trigger.
 
@richvh The call from unit_event should be fixed, but right now unit events are skipped when checking. 1) How often do people use unit events 2) How exactly do they work?

Now, on a HIP installation with several modules, I get this:

Code:
ec) EXCEPTION CONTEXT



ERROR
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.Collections.Generic.Dictionary`2.ValueCollection.Enumerator.MoveNext()
   at Audax.Validator.ContextValidatorSystem.EventTargets.EventTargetsManager.PostProcess()
   at Audax.Validator.ContextValidatorSystem.EventTargets.EventTargetPostProcessor.OnPostvalidation(Context c, Scope scope)
   at Audax.Validator.GameValidator.Validate(Action onEachValidatorCompleteAction)
Happened during Wars validation - but not when only Wars validation is selected.
This should be fixed in the upcoming version, but if not, can you list the mods you're using/their download links?

This was caused by a calc_true_if = { stuff } inside of a trigger = { } in a combat_tactics file. calc_true_if returns a bool, not a complex value like the error message suggests. Also, when testing modding combat tactics the triggers accepted calc_true_if just fine.



This error and similar errors seem to be caused whenever I use a PREV scope inside of a trigger section in a combat tactics file. PREVPREV and PREVPREVPREV have the same problem. When I test my mod these work just fine.
Should be fixed in the about-to-be-released version, but if not can you post the mod link?
 
@richvh The call from unit_event should be fixed, but right now unit events are skipped when checking. 1) How often do people use unit events 2) How exactly do they work?
The one vanilla unit_event is called from on_entering_port. It starts in unit scope, with FROM being the owner.
The following commands are found in the executable and switch to unit scope from (presumably) character scope. Of these, only any_army is used in vanilla, where it is used in character scope:
  • any_army
  • random_army
  • any_fleet
  • random_fleet
  • any_unit
  • random_unit
Units can have (at least) the following values:
  • loot (a positive int or real, not sure which, suspect the latter)
  • set_can_toggle_looting (a boolean)
  • set_looting (a boolean)
 
Last edited:
--- Error 1 of 1 ---
At <mod>\events\job_lord_spiritual.txt [character_event\trigger\NOT\any_war\OR\custom_tooltip\hidden_tooltip] (Line 5510, column 7):
Invalid node "hidden_tooltip" in scope <anon> (value is: <a complex type>)
hidden_tooltip is accepted inside custom_tooltip in other contexts.
--- Error 1 of 2 ---
At <mod>\common\objectives\00_factions.txt [faction_overthrow\membership\modifier\NOT\liege\clan_title\ROOT\clan_title\clan_opinion] (Line 10042, column 9):
Invalid node "clan_opinion" in scope TitleTrigger (value is: <a complex type>)
--- Error 2 of 2 ---
At <mod>\common\objectives\00_factions.txt [faction_overthrow\allow\holder_scope\NOT\OR\blood_brother\holder_scope] (Line 9499, column 7):
Invalid node "holder_scope" in scope CharTrigger (value is: <a complex type>)
clan_opinion should be accepted in a title trigger scope. blood_brother should be treated as a clan_title, as the blood oath is between clans per the dev diaries.
 
Last edited:
I'm getting this in error.log:
[region.cpp:146]: Assert failed for 'none': false && "Region have multiple entries of the same province!"
[region.cpp:147]: Region 'custom_volcanic' have multiple entries for the province '0'
It would be very helpful if 1) Validator checked that no duchy used in a region has a county that is not associated with a province and 2) checked that no province was used more than once in a region.
 
I believe that units can also have troop and morale values set. At least, the game does not throw an invalid token error at me when I use it.
 
I'm getting this in error.log:

It would be very helpful if 1) Validator checked that no duchy used in a region has a county that is not associated with a province and 2) checked that no province was used more than once in a region.
Can you explain 1) more? For 2) is that geographical regions? And it could happen if you include both the duchy of a province in the "duchies" list and the province in the "provinces" list? Note that either or both of these may be somewhat complex to implement and thus possibly not done.

I believe that units can also have troop and morale values set. At least, the game does not throw an invalid token error at me when I use it.
If it turns out that this works in-game after testing, can you list the triggers/commands that you used that work?