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

New Command: EvalSubUnitCount

Wed May 21, 2008 4:11 pm

EvalSubUnitCount = <Operator>;<Value>

Once you do a selection of sub-units (aka elements) with SelectSubUnit(s) you can want to do a test versus the number selected. This is where the command kick in. It is much more powerful than the old CountUnits, which is counting at the unit level and have less selection possibilities.

The valid operators, are, as usual: <, >, <=, >=, =, DICE

For example

EvalSubUnitCount = <=;10

Is: 'do I have selected at most 10 elements with SelectSubUnits'. The 'March to Richmond' event can be vastly improved with that, counting only line regiments and cavalries for example.
Image


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

User avatar
lodilefty
Posts: 7616
Joined: Sat Aug 11, 2007 3:27 pm
Location: Finger Lakes, NY GMT -5 US Eastern

Wed May 28, 2008 1:02 pm

I am trying to create 'Sanitation is Poor' event as a variation on 'epidemics'.

I want to select the largest Army, and apply the losses only if that group exceeds 4 CP.

Is that attached going to work?
Attachments
SanitationEvent.JPG
Always ask yourself: "Am I part of the Solution?" If you aren't, then you are part of the Problem!
[CENTER][/CENTER]
[CENTER]Visit AGEWiki - your increasingly comprehensive source for information about AGE games[/CENTER]

[CENTER]Rules for new members[/CENTER]
[CENTER]Forum Rules[/CENTER]

[CENTER]Help desk: support@slitherine.co.uk[/CENTER]

Return to “Modding AGE engine games”

Who is online

Users browsing this forum: No registered users and 20 guests