• 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.
There's still a whole lot of stuff within the scenario file to sort out, but conditionals, and using the default values in the eeg file for the inc files, works.
Sounds good. :D
 
Working Version 0.7.4.17 is available for download

--> Download Validator v0.7.4.17 <--


NOTE: This version requires the .NET Framework 4.0 Client Profile!!!
Download the Framework here: http://www.microsoft.com/downloads/details.aspx?FamilyID=5765d7a8-7722-4888-a970-ac39b33fd8ab

Changelog
Code:
General
Added the possibility of nameless nodes (i.e. A = { { ... } } ) to the PDO parser.
Made it easier to describe PDO lists with a PdoListItem constraint.
Many PDO lists have been converted to use a PdoListItem constraint.
Added "[" and "]" as valid starting characters in a PDO file.
The PDO format now supports conditionals in the form '¤IF XXX', '¤ELSE', and '¤ENDIF'.
Games based on the Clausewitz validation will now have mods worked as before, though using the "name" argument in the .mod file still works.
Eu3
Triggers: Country trigger 'technology_group' now accepts THIS when in reference to a country.
Ftg
Commands: Command 'provinceculture' now accepts -1 as a value, indicating the primary culture of the country receiving the event.
Scenarios: Added to permissible values in a province definition 'looted' (and 'date'), 'manpower', 'province_revoltrisk', 'mine', and 'goods'.
Scenarios: province definition 'income' has been changed from PositiveInt to NonNegInt.
Scenarios: When a mod is used, scenarios in vanilla will not be checked. (To do so, the Scenarios folder has been given a 'replace' characteristic, as opposed to 'extend'.
Leaders: When validating a mod, invalid files in the vanilla folder will not trigger an error (i.e. having a file "leaders_ABC.txt" in vanilla will not trigger an error if there is no such tag "ABC" in the mod).
Monarchs: When validating a mod, invalid files in the vanilla folder will not trigger an error (i.e. having a file "monarchs_ABC.txt" in vanilla will not trigger an error if there is no such tag "ABC" in the mod).
Scenarios: Fixed invalid warning in clause 'flagname' in case of ' ABC = Blah DEF = Blah '; now the warning will warn about ' ABC = Blah ABC = MoreBlah '.
Scenarios: Added 'combat' clause.
Commands: Added 'leader' as a synonym for 'wakeleader'.
Localization: Will no longer crash if a mod has a language not included in the base game.
'ai' clauses will no longer crash if their value is not a string.
Scenarios: Now recognizes 'option' clauses in the header, and will use their default values.
Scenarios: The 'name' clause in units is now optional.
Scenarios: Added optional 'loansize' to country definitions.
Scenarios: The following entries in country definitions are now optional: colonialattempts, colonialnation, major, colonists, merchants, inflation.
Scenarios: The 'date' entry in a country's policy definition is now optional.
Scenarios: Added optional 'trade' and 'guarenteed' clauses to a country's relation list.
Scenarios: Added optional 'historicalleader' to a country's unit clauses.
Victoria
'ai' clauses will no longer crash if their value is not a string.
Hoi3
SF: Oob: Added optional 'organisation' clause to wings, regiments, and ships.
Modifiers: Added 'global_metal' modifier.
Triggers: Country trigger 'faction' now accepts THIS in reference to a country, as well as Factions.
Triggers: Added country trigger 'total_amount_of_brigades'.
Non-SF: Triggers: Province trigger 'province_id' has been removed.
Modifiers: Added 'local_manpower' and 'local_leadership' modifiers.
SF: Triggers: Added 'land_fort' province trigger.
SF: Events: Added 'triggered_only_once' to country events.
SF: Commands: Added 'surrender_inherit' country command.
SF: Commands: Added province commands (already country commands) 'add_country_modifier', 'clr_global_flag', and 'set_global_flag'.
SF: Triggers: Added province triggers (already country triggers) 'tag' and 'has_global_flag'.
 
Version 0.8 has been released

--> Download Validator v0.8 <--


NOTE: This version requires the .NET Framework 4.0 Client Profile!!!
Download the Framework here: http://www.microsoft.com/downloads/details.aspx?FamilyID=5765d7a8-7722-4888-a970-ac39b33fd8ab

8dcf881656.png
 
I've been working on adding AI validation. First, note that AI validation is a "side dish" - it will only work on files found while validating other things. For example if you validate the revolts file, and turn AI validation on, only AI files referenced the revolts file will be checked.

Now, what can be in an AI file? ai_readme.txt seems to be missing a lot of information. Also, is it correct that all entries in an AI file are optional?
 
Additional Questions about scenarios

In a city clause:
- How does the "construction" clause function?
- How does the "date" clause function?
- For city fortresses, what are the meanings of "date" and "increase"?

- Country "last_peace" and "war" - do they simply accept a date?
- Country "flagname" - what values are accepted?
- Country "leadertable" and "monarchtable" - they point to leader and monarch files?

Also, what values are acceptable within an AI file? ai_readme.txt seems to be missing a lot of information. Also, is it correct that all entries in an AI file are optional?
 
Additional Questions about scenarios

In a city clause:
- How does the "construction" clause function?
- How does the "date" clause function?
If the date is present, it tells when the manufactory of type <construction> will be finished. The construction doesn't seem to be cleared after it has finished, but it is not used after that.
- For city fortresses, what are the meanings of "date" and "increase"?
If increase = yes, then the fortress is being expanded and will finish on the date given.

- Country "last_peace" and "war" - do they simply accept a date?
Yes.
- Country "flagname" - what values are accepted?
Any string value, though I imagine the filesystem itself is a little more restrictive than that.
- Country "leadertable" and "monarchtable" - they point to leader and monarch files?
If their value is a string, then yes. Otherwise, they can hold the entire leader or monarch table inline and the normal file will be ignored. If they are not present, then Db\Leaders\leaders_tag.txt or Db\Monarchs\monarchs_tag.txt are used if present (they are not required).

Also, what values are acceptable within an AI file? ai_readme.txt seems to be missing a lot of information.
Sorry, I meant to answer that sooner. Here's what gets parsed:

Continent, region, and area: lists of preferred places to explore and colonize (weighted in the order area > region > continent). These of course must be defined in geography.txt.

base and front are weights that must be greater than 0 (the game will force them to a small positive value if they are not). They are not limited otherwise; they are used in conjunction so the only thing that matters is their relative sizes.

expansion is pretty well covered, though it's not technically limited to 100 (but is normally less than 10).

war is also not techically limited at all; even if it's below 100 the AI could still decide to declare war, but it's less likely the lower it goes.

tradingpost is a percentage, so numbers outside [0,100] are unnecessary.

neighbor is not limited; it is a weighting factor for placing colonies adjacent to other owned provinces. If it is greater than 90, its effect is doubled.

enemy is similar to neighbor, but it is generally set to 0 or below to keep from clustering colonies next to enemy provinces.

traders is another percentage, so values outside [0,100] are unnecessary.

monopoly is also a percentage, but it's used sometimes as 0-100 and elsewhere in combination with several other factors as a 0-1000 chance. Large negative values can be used to keep the AI from ever embargoing.

naval is actually in the range 0-5, not 0-100 as ai_readme says. It is a multiplier.

combat is a list of tags to target in wars.

Inside the conquer and garrison sections, all values are multipliers and are technically not limited.

Finally, there can also be a flags section containing a list of event flags for the AI. This is only rarely done in AI files but can happen. In saved games, all event flags for the country are stored here, even for a human country.

Also, is it correct that all entries in an AI file are optional?
Yes, all will be given more-or-less reasonable defaults if they are not present. Or if they have already been set by a previous AI file, the previous values are kept.
 
Thank you, MichealM. The information proved most helpful, and AI validation is essentially complete, while scenario validation hopefully has few errors.

A few more questions about AI files:
- Do sreligion, ferocity, and galleys mean anything?
- In area, region, and continent clauses, are quotes required for listing areas/regions/continents with spaces? For example, is
Code:
area = { Grand Lacs }
valid, or would it have to be
Code:
area = { "Grand Lacs" }
?
 
- Do sreligion, ferocity, and galleys mean anything?
Yes, but the documentation in ai_readme.txt is correct so I didn't mention them. Perhaps I should have.

- In area, region, and continent clauses, are quotes required for listing areas/regions/continents with spaces?
Yes, quotes are required when spaces are present. Otherwise they are optional.
 
Last edited:
base and front are weights that must be greater than 0 (the game will force them to a small positive value if they are not). They are not limited otherwise; they are used in conjunction so the only thing that matters is their relative sizes.

base and front are used together and represent a % of troops that the nation will keep at home ( base) or go to front.......so base of 1 front of 5 is the same as base of 20 front of 100....its a percentage.......it sometimes conflicts with war ( war number in the garrison portion )
This is only active in times of PEACE........in war the AI do other stuff
 
Last edited:
Thank you, MichealM. The information proved most helpful, and AI validation is essentially complete, while scenario validation hopefully has few errors.

A few more questions about AI files:
- Do sreligion, ferocity, and galleys mean anything?
- In area, region, and continent clauses, are quotes required for listing areas/regions/continents with spaces? For example, is
Code:
area = { Grand Lacs }
valid, or would it have to be
Code:
area = { "Grand Lacs" }
?

ferocity means it will not give a peace proposal and also in most times not accept a proposal

naval range from 0 to 5 in number, with 1 being the default
I tested this and every number above 1 represent 25% of proposed to spend money on naval instead of land tech, ....so 5 = 100%

unsure about quotes for names, coz we tested Cape Verde with quotes it works, while unquoted it does not work, .....it seems one word area names all need to be unquoted..........it must be something to do with 2 words.
 
Last edited:
v0.8.2 beta is available for download

--> Download Validator v0.8.2 beta <--

As this is a beta version, it has not undergone the extensive testing of a full release. However, reasonable attempts to limit the number and severity of bugs have been made.

NOTE: This version requires the .NET Framework 4.0 Client Profile
Download the Framework here: http://www.microsoft.com/downloads/details.aspx?FamilyID=5765d7a8-7722-4888-a970-ac39b33fd8ab



Changelog
Code:
v0.8.2 beta (releassed 2010 Aug 08)
General
When displaying an element path ending in a list node for the PDO format, rather than being labeled "Item[X]", the actual value of the list item will be displayed.
Internals
Node selector: When selecting a right-side string, it will first be checked whether the node is a value element.
ComplexConstraint: When the first member of a complex constraint is an element judge, ElementIsInstance will return false if the first member's ElementIsInstance returns false.
Eu3
H3T: Added revolt triggers validation.
Ftg
Added many scenario checks and generally improved scenario validation.
AI validation is complete.

v0.8.1 beta (released 2010 Aug 07)
General
Instead of assertions, exceptions will be thrown in many cases.
The NodeSwitcher constraint allows enumerations to be added, and has a "MarkChecked" property, that when set to false, will not mark the operated node as checked.
Rome
Commands: Added province command 'change_controller'.
Commands: The command 'add_core' in province scope will now accept Tags, but not ThisProvince.
Triggers: Added to country triggers scopes 'civil_war_faction', 'previous_ruler', and 'ally'.
Triggers: Added to province triggers scopes 'sea_zone' and 'any_trade_route'.
Commands/Triggers: Added many items of questionable scope - e.g. stability triggers within province scope.
Triggers: Triggers 'is_friend' and 'is_rival' now accept ThisCountry as well as ThisChar.
Commands: The sum of probabilities in a random list no longer has to sum to 100.
Triggers: Added 'spouse' scope in character scope.
Triggers: Added 'sibling' and 'family' triggers with value ThisChar.
Commands: Added 'merc_*' character commands.
Commands: Added 'change_charisma' as an synonym to 'charisma'.
Eu3
Triggers: Province trigger 'has_discovered' now accepts ThisProvince.
Triggers: Country trigger 'army' now accepts ThisProvince.
Triggers: Country trigger 'navy' now accepts ThisProvince.
H3T: Commands: 'add_casus_belli' and 'casus_belli' no longer accept ThisCountry, ThisProvince, and Tag.
H3T: Commands: 'casus_belli | add_casus_belli'.'target' now accepts ThisProvince.
H3T: Commands: 'remove_casus_belli | this_remove_casus_belli'.'target' now accepts ThisProvince.
H3T: Commands: 'kill_heir' now accepts ThisProvince as an argument.
Commands: 'kill_ruler' now accepts ThisProvince as an argument.
Triggers: "is_core" as a province trigger will now accept an argument of "yes".
Commands: 'kill_ruler' now accepts "yes" as an argument.
H3T: Events: Country events called by the on_action "on_hre_province_reconquest" will be recognized as province events.
Ftg
Added partial AI validation.
 
So I was going to post a bug report for the validator. I noticed that the new AI validator kept warning that "CarribeanSea is not a valid Region"; I set it to be case-insensitive, but it still complained.

Then I thought maybe it was because it's a sea region, so I dug a little further to see if any other sea regions had problems.

I didn't find any other sea regions. But I did find several reports about "Carribean is not a valid Region". That's strange; what do they have in common except that they're both Caribbean?


And then it finally hit.


Do you know how many times "Caribbean" was misspelled in the AI files? Twenty-seven times, that's how many.

I love this thing. :D

---

I do have to report a possible bug, though. When I try to validate WATKABAOI, it fails with this stack trace:
Code:
ERROR
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Audax.Clausewitz.Validator.NodeSelection.NodeSelectionPart.<Yield>b__3(ElementNode n)
   at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Audax.Clausewitz.Validator.NodeSelection.NodeSelectionPart.Yield(IList`1 current)
   at Audax.Clausewitz.Validator.NodeSelector.DoSelection(ParentNode root, String selectPath, Scope scope)
   at Audax.Clausewitz.Validator.NodeSelector.SelectMany(ParentNode root, String selectPath, Scope scope)
   at Audax.Clausewitz.Validator.NodeSelector.<>c__DisplayClass5.<SelectMany>b__4(ParentNode node)
   at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Audax.Clausewitz.Validator.NodeSelector.SelectMany(IEnumerable`1 root, String selectPath, Scope scope)
   at Audax.Clausewitz.Validator.ScriptingSystem.ScriptTask.ParseScriptNode(Context c, ElementNode node, Scope scope)
   at Audax.Clausewitz.Validator.ScriptingSystem.ScriptTask.Prevalidation(Context c, Scope scope)
   at Audax.Clausewitz.Validator.GameValidator.Validate(Action onEachValidatorCompleteAction)
 
So I was going to post a bug report for the validator. I noticed that the new AI validator kept warning that "CarribeanSea is not a valid Region"; I set it to be case-insensitive, but it still complained.

Then I thought maybe it was because it's a sea region, so I dug a little further to see if any other sea regions had problems.

I didn't find any other sea regions. But I did find several reports about "Carribean is not a valid Region". That's strange; what do they have in common except that they're both Caribbean?


And then it finally hit.


Do you know how many times "Caribbean" was misspelled in the AI files? Twenty-seven times, that's how many.

I love this thing. :D

---

I do have to report a possible bug, though. When I try to validate WATKABAOI, it fails with this stack trace:
Code:
ERROR
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Audax.Clausewitz.Validator.NodeSelection.NodeSelectionPart.<Yield>b__3(ElementNode n)
   at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Audax.Clausewitz.Validator.NodeSelection.NodeSelectionPart.Yield(IList`1 current)
   at Audax.Clausewitz.Validator.NodeSelector.DoSelection(ParentNode root, String selectPath, Scope scope)
   at Audax.Clausewitz.Validator.NodeSelector.SelectMany(ParentNode root, String selectPath, Scope scope)
   at Audax.Clausewitz.Validator.NodeSelector.<>c__DisplayClass5.<SelectMany>b__4(ParentNode node)
   at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Audax.Clausewitz.Validator.NodeSelector.SelectMany(IEnumerable`1 root, String selectPath, Scope scope)
   at Audax.Clausewitz.Validator.ScriptingSystem.ScriptTask.ParseScriptNode(Context c, ElementNode node, Scope scope)
   at Audax.Clausewitz.Validator.ScriptingSystem.ScriptTask.Prevalidation(Context c, Scope scope)
   at Audax.Clausewitz.Validator.GameValidator.Validate(Action onEachValidatorCompleteAction)
Thanks :D

Also, the problem with WATKABAOI has been fixed. It now will report these error messages, and avoid crashing.

Code:
--- Error 1 of 3 ---
Child Count Error
At <mod>\db\map\provinces.txt [province[1638]] (44851, 1):
At least 1 instance(s) of a terrain\[R] entry are required, but there are only 0 instances.
--- Error 2 of 3 ---
Child Count Error
At <mod>\db\map\provinces.txt [province[1638]] (44851, 1):
At least 1 instance(s) of a terrain\[R] entry are required, but there are only 0 instances.
--- Error 3 of 3 ---
Child Count Error
At <mod>\db\map\provinces.txt [province[1638]] (44851, 1):
At least 1 instance(s) of a terrain\[R] entry are required, but there are only 0 instances.
I believe the problem is
Code:
	type = coastal
	type = inland
whereas one of them should be terrain.

As an aside, would it be useful to have validation for some of the files in Db\map, and if so, which ones would be most crucial?
 
I believe the problem is
Code:
	type = coastal
	type = inland
whereas one of them should be terrain.
Right you are. That fixed it up nicely.

As an aside, would it be useful to have validation for some of the files in Db\map, and if so, which ones would be most crucial?
There's probably not a lot to validate in there. Most of the listing files would just be checking whether the provinces are land or not and making sure there aren't duplicates or so.

But yes, if that wouldn't be too much trouble, it might save some time down the line when something like this pops up again.

By the way, "action" is a valid replacement for "action_[a-d]". The a,b,c,d aren't used anymore. As long as one of those is present, the event is valid.
 
Right you are. That fixed it up nicely.

There's probably not a lot to validate in there. Most of the listing files would just be checking whether the provinces are land or not and making sure there aren't duplicates or so.

But yes, if that wouldn't be too much trouble, it might save some time down the line when something like this pops up again.

By the way, "action" is a valid replacement for "action_[a-d]". The a,b,c,d aren't used anymore. As long as one of those is present, the event is valid.
So events now go:
Code:
event = {
...
action = { ... }
[possibly more action = { ... }]
?

Should the validator warn about use of action_[abcd], or is it intended to keep action_[abcd] around and only write new events with action?
 
So events now go:
Code:
event = {
...
action = { ... }
[possibly more action = { ... }]
?
Yes.

Should the validator warn about use of action_[abcd], or is it intended to keep action_[abcd] around and only write new events with action?
There's no real reason to switch to the new way except for clarity (since in EU2 the letters were the only way to guide the AI chance).
 
So I was going to post a bug report for the validator. I noticed that the new AI validator kept warning that "CarribeanSea is not a valid Region"; I set it to be case-insensitive, but it still complained.

Then I thought maybe it was because it's a sea region, so I dug a little further to see if any other sea regions had problems.

I didn't find any other sea regions. But I did find several reports about "Carribean is not a valid Region". That's strange; what do they have in common except that they're both Caribbean?


And then it finally hit.


Do you know how many times "Caribbean" was misspelled in the AI files? Twenty-seven times, that's how many.

I love this thing. :D

---

I do have to report a possible bug, though. When I try to validate WATKABAOI, it fails with this stack trace:
Code:
ERROR
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Audax.Clausewitz.Validator.NodeSelection.NodeSelectionPart.<Yield>b__3(ElementNode n)
   at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Audax.Clausewitz.Validator.NodeSelection.NodeSelectionPart.Yield(IList`1 current)
   at Audax.Clausewitz.Validator.NodeSelector.DoSelection(ParentNode root, String selectPath, Scope scope)
   at Audax.Clausewitz.Validator.NodeSelector.SelectMany(ParentNode root, String selectPath, Scope scope)
   at Audax.Clausewitz.Validator.NodeSelector.<>c__DisplayClass5.<SelectMany>b__4(ParentNode node)
   at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Audax.Clausewitz.Validator.NodeSelector.SelectMany(IEnumerable`1 root, String selectPath, Scope scope)
   at Audax.Clausewitz.Validator.ScriptingSystem.ScriptTask.ParseScriptNode(Context c, ElementNode node, Scope scope)
   at Audax.Clausewitz.Validator.ScriptingSystem.ScriptTask.Prevalidation(Context c, Scope scope)
   at Audax.Clausewitz.Validator.GameValidator.Validate(Action onEachValidatorCompleteAction)

according to this
http://home.broadpark.no/~havmoe/EU/appendix_a.htm

which breaks up the regions into groups for the AI file exploration

it should be
Sea Regions: AlaskaSea, ArcticSeaSea, CarribeanSea, ECAtlanticSea, ENACoastSea, EPacificSea, HudsonBaySea, Lake, NAtlanticSea, NCAtlanticSea, NWPacificSea, NWPacificSea, SEAtlanticSea, SEPacificSea, SWAtlanticSea, WCAtlanticSea
Region: Carribean


while a file does have
# AGCEEP
# Columbus AI
# Spain 1491-1499
# Fodoron 2005
#
region = {
CaribbeanSea
Caribbean
"Central America"
}


nice pick up:D

anyway the havard link is correct in spelling .............
 
By the way, there is a misconception regarding the roles of colonynames.txt and the new_colony entry in countries.txt.

The names in colonynames.txt are always consulted; e.g. if your tag is BRE, it will first check the names in colonynames to see if there are any for BRE (which there are), and, only if those are already used, it will use the new_colony entry of GER to consult the list in countries_special.txt. There it will find that for GER, it should make a name starting with "Neu " and followed by the name of a city owned by BRE.

So the new_colony entries don't actually point to entries in colonynames.txt.

(This is actually what it says in the header of countries.txt.)