• 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.
Is it possible to check for a potential error for when a flag variable is used in an event, but the flag variable was never set, so the Validator should report an error that the flag was not created?

I thought of this question when I found a bug in a vanilla CK2 event. The married_life_events.txt event file refers to a courtier with the sire_bastard character flag (has_character_flag = sire_bastard). Unfortunately, this flag was never set, so any options that use this flag do nothing. (Event# 30075 is missing the line “set_character_flag = sire_bastard”) This is one bug that your Validator could report if it was able to check to see if the flag variable was ever created.
 
Last edited:
Code:
Beginning initialization...
Warning: DynamicError not found: InvalidChildError
Warning: DynamicError not found: InvalidChildError
Warning: DynamicError not found: InvalidChildError
Warning: DynamicError not found: InvalidChildError
Warning: DynamicError not found: InvalidChildError
Warning: DynamicError not found: InvalidChildError
Warning: DynamicError not found: InvalidChildError

ec) EXCEPTION CONTEXT



ERROR
Audax.Validator.ItemNotFoundInScopeException: Item " %Name" was not found in this scope.
   bei Audax.Validator.Scope.Resolve[T](String name)
   bei Audax.Validator.GameValidator..ctor(CFilePath path, Boolean gamePathSet)
   bei Audax.Validator.ValidationManager.ParseGameFiles()
Since there were problems with initial loading, validation cannot continue.
I unzipped the newest RC version over my older version, and got this error when I opened validator. I removed and then unzipped the validator to a fresh location, and it still gives the error :(
 
Hmm, what's one of the ones it complains (and does it complain even in vanilla)? I'll take a look at it.
It complains in vanilla, yes:
--- Error 1 of 1 ---
At common\landed_titles\landed_titles.txt [e_britannia\k_ireland\d_munster\c_desmond] (Line 23431, Column 4):
The string c_desmond was not found in localization.
 
It complains in vanilla, yes:
--- Error 1 of 1 ---
At common\landed_titles\landed_titles.txt [e_britannia\k_ireland\d_munster\c_desmond] (Line 23431, Column 4):
The string c_desmond was not found in localization.

In the vanilla localization I see a c_desmond_adj, but not c_desmond. So is c_desmond unnecessary to be checked? I'm slightly confused.

Code:
Beginning initialization...
Warning: DynamicError not found: InvalidChildError
Warning: DynamicError not found: InvalidChildError
Warning: DynamicError not found: InvalidChildError
Warning: DynamicError not found: InvalidChildError
Warning: DynamicError not found: InvalidChildError
Warning: DynamicError not found: InvalidChildError
Warning: DynamicError not found: InvalidChildError

ec) EXCEPTION CONTEXT



ERROR
Audax.Validator.ItemNotFoundInScopeException: Item " %Name" was not found in this scope.
   bei Audax.Validator.Scope.Resolve[T](String name)
   bei Audax.Validator.GameValidator..ctor(CFilePath path, Boolean gamePathSet)
   bei Audax.Validator.ValidationManager.ParseGameFiles()
Since there were problems with initial loading, validation cannot continue.
I unzipped the newest RC version over my older version, and got this error when I opened validator. I removed and then unzipped the validator to a fresh location, and it still gives the error :(

I think this may have to do with me uploading RC 10 in a weird way as I had to fix a major issue at work. RC11 is coming within the hour, and that one will be distributed normally and should be fine.

Is it possible to check for a potential error for when a flag variable is used in an event, but the flag variable was never set, so the Validator should report an error that the flag was not created?

I thought of this question when I found a bug in a vanilla CK2 event. The married_life_events.txt event file refers to a courtier with the sire_bastard character flag (has_character_flag = sire_bastard). Unfortunately, this flag was never set, so any options that use this flag do nothing. (Event# 30075 is missing the line “set_character_flag = sire_bastard”) This is one bug that your Validator could report if it was able to check to see if the flag variable was ever created.

In the ValidatorSettings.txt file (see DidYouKnow.pdf for details), there is an option "AddFlag = TraceFlags"; if you uncomment this, the Validator will create a list of flags set and checked, and will have warnings when flags are set but never checked, or checked but never set. (The files will be accessible by scrolling to the bottom of the error list).
 
In the vanilla localization I see a c_desmond_adj, but not c_desmond. So is c_desmond unnecessary to be checked? I'm slightly confused.
Ah, when it comes to counties, they're typically named by province ID rather than the actual title name. You should check province history to see what ID is defined as c_desmond, then see if either c_desmond or PROV14 (in this case) are in localization.
 
Ah, when it comes to counties, they're typically named by province ID rather than the actual title name. You should check province history to see what ID is defined as c_desmond, then see if either c_desmond or PROV14 (in this case) are in localization.

Got it, thanks.

EDIT: Unfortunately, looking in province history is a bit complicated, so for now it won't check for c_XXX, but it will be done in the next RC after the one about to be released.

EDIT2: Actually this might be easier to check from province history, so maybe I'll do that.
 
Last edited:
I think that should be doable, yes. Are DLC dependencies ever important? If not, I'm a bit lazy about going and reading DLC files and unzipping them :/

They COULD be if we could figure out how to actually make yes. For example Better Looking Characters has a module that requires the mongol face DLC that could check for it, but afaik Shaytana doesn't use dependencies for it. So it probably has niche value as that is really the only scenario I can think of where a DLC is mandatory (as music DLC obv doesn't make a difference and the SoI dlc doesn't bring any content to the game, it just unlocks it technically so it not loading in wouldn't hurt a mod). This is really bugging me though that no one knows how to get dependencies to work :(
 
1.0 Release Candidate 11 is available: Download here

You can tweak a number of validation settings by copying a text file from the SettingsFiles folder into the game directory or mod directory, and naming it ValidatorSettings.txt. Then just open it and modify. This is where many of the former settings got moved to.

Also, comment ignore is here! Simply put
Code:
# Audax Validator "." Ignore_XXXX
in front of the node causing the error that you want to ignore. XXXX is an error code, found in Information/errorCodes.txt. So far only a few errors are supported, so tell me which ones you really want to be able to ignore. For more information, see DidYouKnow.pdf, in the dowload.
 
num_of_realm_counties is a valid trigger within character scope.

Currently you get a huge number of error messages if a single entry is out of place within a title history file. Could it be reduced to one per file?

It'd be nice if the Validator would remember "Show Mod Errors" between sessions.
It'd be nice if the Validator would remember its size and position between sessions. I don't like it starting maximized on my primary monitor.

Mercenary modifiers don't need localization, but the Validator gives an error message if it is lacking.
 
Any way we can make Validator ignore a specific file entirely?

Code:
--- Error 1 of 1 ---
--- Error 1 of 1 ---
Duplicate ID: k_bahrain
[1]: mod\CK2Plus\localisation\0_titles.csv (124, 1)
[2]: <mod>\localisation\tk.csv (84, 1)

Also the ability to hide this error type would be great as I am not too worried about conflicting localizations with my compatibility mod
 
Last edited:
In the ValidatorSettings.txt file (see DidYouKnow.pdf for details), there is an option "AddFlag = TraceFlags"; if you uncomment this, the Validator will create a list of flags set and checked, and will have warnings when flags are set but never checked, or checked but never set. (The files will be accessible by scrolling to the bottom of the error list).

I did what you recommended, and I saw the flaganalysis log files, but none of them mention sire_bastard (which they should because it is not set in the event file, it is only checked).
 
num_of_realm_counties is a valid trigger within character scope.

Currently you get a huge number of error messages if a single entry is out of place within a title history file. Could it be reduced to one per file?

It'd be nice if the Validator would remember "Show Mod Errors" between sessions.
It'd be nice if the Validator would remember its size and position between sessions. I don't like it starting maximized on my primary monitor.

Mercenary modifiers don't need localization, but the Validator gives an error message if it is lacking.

All fixed.

Any way we can make Validator ignore a specific file entirely?

Code:
--- Error 1 of 1 ---
--- Error 1 of 1 ---
Duplicate ID: k_bahrain
[1]: mod\CK2Plus\localisation\0_titles.csv (124, 1)
[2]: <mod>\localisation\tk.csv (84, 1)

Also the ability to hide this error type would be great as I am not too worried about conflicting localizations with my compatibility mod

Hmm, so the situation is that you need to check localization (due to missing bracket errors or something), but then have too many duplicate warnings? And you want to ignore warnings for duplicates when one of them is your mod and one of them is a dependency mod or vanilla?

I did what you recommended, and I saw the flaganalysis log files, but none of them mention sire_bastard (which they should because it is not set in the event file, it is only checked).

Oops, that feature was completely broken. It has been fixed for the next release.
 
Hmm, so the situation is that you need to check localization (due to missing bracket errors or something), but then have too many duplicate warnings? And you want to ignore warnings for duplicates when one of them is your mod and one of them is a dependency mod or vanilla?

I don't want it to mention specifically duplicate localisation errors in general for the reason you stated yes, since Wiz for example has implemented a portion of my mod so it throws duplication errors for those specifically (an Error Code for me to toggle it would work too, as I'd imagine others might be interested in that scenario still).

Don't know if you missed my other suggestion, but the ability to tell the Validator to ignore a file in general would also be nice (again in the case of my mod, I completely replace Wiz's landed_titles.txt with my own which is simply a very minor modified version of his. This of course can throw errors I don't really care about, as they have nothing to do with my own mod.) I could also think of other uses for this like skipping files you know you don't need to scan anymore because you didn't change them this patch etc.
 
I don't want it to mention specifically duplicate localisation errors in general for the reason you stated yes, since Wiz for example has implemented a portion of my mod so it throws duplication errors for those specifically (an Error Code for me to toggle it would work too, as I'd imagine others might be interested in that scenario still).

Don't know if you missed my other suggestion, but the ability to tell the Validator to ignore a file in general would also be nice (again in the case of my mod, I completely replace Wiz's landed_titles.txt with my own which is simply a very minor modified version of his. This of course can throw errors I don't really care about, as they have nothing to do with my own mod.) I could also think of other uses for this like skipping files you know you don't need to scan anymore because you didn't change them this patch etc.
Bit of a side-note, but: Due to the new landed_titles system, surely you can simply make a separate file of your own rather than overwrite the entire landed_titles?
 
I add an extra county to the game (or rather make that big ugly grey blob in the Arabian peninsula a 1 holding county), which requires me to copy the whole thing unfortunately to carry over the change. Unless there is a way to add this county to Nefoud in only a couple lines in my other file without borking the mod?
 
I don't want it to mention specifically duplicate localisation errors in general for the reason you stated yes, since Wiz for example has implemented a portion of my mod so it throws duplication errors for those specifically (an Error Code for me to toggle it would work too, as I'd imagine others might be interested in that scenario still).

Don't know if you missed my other suggestion, but the ability to tell the Validator to ignore a file in general would also be nice (again in the case of my mod, I completely replace Wiz's landed_titles.txt with my own which is simply a very minor modified version of his. This of course can throw errors I don't really care about, as they have nothing to do with my own mod.) I could also think of other uses for this like skipping files you know you don't need to scan anymore because you didn't change them this patch etc.

For the moment, I won't implement these; due to how the code was written they are not too easy to put in. Sorry about that, but if more people request something similar, it may well be implemented in the future.
 
1.0 Release Candidate 12 is available: Download here

You can tweak a number of validation settings by copying a text file from the SettingsFiles folder into the game directory or mod directory, and naming it ValidatorSettings.txt. Then just open it and modify. This is where many of the former settings got moved to.

Also, comment ignore is here! Simply put
Code:
# Audax Validator "." Ignore_XXXX
in front of the node causing the error that you want to ignore. XXXX is an error code, found in Information/errorCodes.txt. So far only a few errors are supported, so tell me which ones you really want to be able to ignore. For more information, see DidYouKnow.pdf, in the dowload.

The final v1.0 will be released when a release candidate has been out for three weeks and no issues have been reported (note: this includes issues for Vic2, Eu3, and Rome).
 
I finally got the dependency thing to work. Not sure why it didn't work before, but it IS the same as in V2, namely with the brackets.
 
Keep getting errors when I try to run it:

Beginning validation...

ec) EXCEPTION CONTEXT



ERROR
System.NullReferenceException: Object reference not set to an instance of an object.
at Audax.Validator.Clausewitz.Ck2.MercenaryModifierFactory.LoadDefaultConstraints()
at Audax.Validator.TypeCore.ConstraintPrevalidation.<OnPrevalidation>b__1(KeyValuePair`2 fac)
at System.Linq.Enumerable.<SelectManyIterator>d__31`3.MoveNext()
at Audax.Validator.TypeCore.ConstraintPrevalidation.OnPrevalidation(Context c, Scope scope)
at Audax.Validator.GameValidator.Validate(Action onEachValidatorCompleteAction)
--- Error 1 of 1 ---
File Not Found
The file "ValidatorSettings.txt" was not found.