User avatar
jastaV
AGEod Guard of Honor
Posts: 1159
Joined: Mon Apr 14, 2008 9:22 am

Syntax troubles

Sat Aug 23, 2008 9:16 pm

I noticed a trouble with NCP 1.04b possibly to be referred to Syntax troubles and typing errors!

Looking at "LGE_Setup_scenar_1813r" excel file from last available NCP_DB, uploaded 14 Ago 2008........
Pick up line 129-131:

129|NULL|NULL|CountUnits|$Leipzig|0|$C13|[color="Red"]$Regular[/color]|>=|25
130|NULL|NULL|Actions NULL
131|NULL|NULL|SelectSubUnits|Area $Theater_Germany|[color="red"]Faction Tags[/color] SAX

(| is used as symbol to separate excel columns!)
I marked in [color="red"]RED [/color]supposed errors!

1. Condition described at line 129 is never met, as a result we cannot trigger Saxon Betrayal event!
The possible trouble is with [color="red"]$Regular[/color] Syntax used to indicate regular infantry units.
I checked at AACWWiki guide, where a numerical character is instead recommanded to indicate units families!
So -1 = any type units; 0 = $Regular; 1 = $Irregular; and so on......

see AACWWiki guide for full descriptions!

Now, I replaced the original $Regular with 0, (Zero):

129|NULL|NULL|CountUnits|$Leipzig|0|$C13|0|>=|25

I tested the event moving > 25 COA Regular infantry units at Leipzig: event is triggered, as evidenced by the reported textual message.........

Unfortunately things works differentely as I expected:

All COA armies & forces present into the "Theater_Germany" area disapear!!!!

2. I discovered this trouble is related to a Syntax-Typing error in line 131:

Here the correct Syntax is:

131|NULL|NULL|SelectSubUnits|Area $Theater_Germany [color="Blue"]FactionTags[/color] SAX

While [color="Red"]Faction Tags[/color] note the space between two words is wrong!

I corrected all supposed mistakes and tried again to trigger the event:

129|NULL|NULL|CountUnits|$Leipzig|0|$C13|[color="Blue"]$Regular[/color]|>=|25
130|NULL|NULL|Actions NULL
131|NULL|NULL|SelectSubUnits|Area $Theater_Germany|[color="blue"]Faction Tags[/color] SAX

This time event occured properly with Saxon units switching side!

Please check, NCP file for possible analogous mistakes: guess $Irregular for =, zero has been used a mess of times......

Check always for possible wrong "Faction (space) Tags" syntax to be corrected in FactionTags!

P.S.: I corrcted both mistakes within 1813 Hist mod Campaign ver 3.13

Example of correct files are available, (for 1813 Hist Mod campaign) at:
http://www.ageod-forum.com/showpost.php?p=98757&postcount=11

Please check!

User avatar
Gray_Lensman
Posts: 497
Joined: Mon Jun 18, 2007 4:04 am
Location: Who is John Galt?

Sun Aug 24, 2008 7:22 am

deleted

User avatar
jastaV
AGEod Guard of Honor
Posts: 1159
Joined: Mon Apr 14, 2008 9:22 am

Wed Sep 10, 2008 5:08 pm

Gray_Lensman wrote:I think you are correct in regard to the 2nd syntax error "Faction Tags", it should probably be "FactionTags" as you pointed out.

However did you retest the Event file with only that change?

According to the Alias definition file "SubTypes (of units&models).ini" located in the ...NCP/Aliases folder, $Regular = 0, so the Alias "Regular" should be equivalent to using "0" in the same statement.

Try this event again, leaving the $Regular alias syntax in place but correct the "FactionTags" syntax. Let me know if that works. There would be more errors in regard to using $Regular in other files including AACW if the Alias definition was not equivalent to 0 at RunTime.



Hi,
back on line!

As regard the reported troubles, having fixed the "FactionTags" syntax I tried many time in turn with $Regular alias syntax in place with no resunts!
I had to use the "0" syntax to actually trigger the event!
......Anyway I please you or anyother to try that too for a double check!

User avatar
Pocus
Posts: 25673
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Wed Sep 10, 2008 5:23 pm

Oops missed that post.

Don't use CountUnits, it is old and deprecated. Do a SelectSubUnits, with the possible advanced criteria then do an EvalSubUnitCount
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

User avatar
jastaV
AGEod Guard of Honor
Posts: 1159
Joined: Mon Apr 14, 2008 9:22 am

Wed Sep 10, 2008 7:48 pm

Pocus wrote:Oops missed that post.

Don't use CountUnits, it is old and deprecated. Do a SelectSubUnits, with the possible advanced criteria then do an EvalSubUnitCount


May be I already used the SelectSubUnits command within 1815 Hist. Mod Campaign.
Anyway the trouble I reported with CountUnits commands is quite actual, being CountUnits command commonly used within more NCP default Campaigns as Peninsular war and 1813!
So A fix or check is recemmended!...I guess! :D

User avatar
Pocus
Posts: 25673
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Thu Sep 11, 2008 6:57 am

That's not good then, because a regular unit can range from a single regiment, made into an unit, to a full division...

As for the command, I concur with Gray. If $Regular was not translated into a 0, we would get much more problems.

SelectSubUnits & EvalSubUnitCount is so much more powerful and accurate...
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

Return to “Help to improve NCP!”

Who is online

Users browsing this forum: No registered users and 9 guests