Due to a sudden burst in spammer activity, account creation has been temporarily disabled. Sorry for the inconvenience to any new potential contributors.

CountUnits

From AGEWiki

Revision as of 13:37, 5 April 2012 by Lodilefty (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

CountUnits

Syntax  

CountUnits = <area alias>; <region or area>; <faction>; <unit type>; <operator>; <number of units>

Description

This condition is fulfilled if the specified number of units belonging to the specified faction exist in the specified area.

Example  

CountUnits = $Close_to_Richmond;1;$USA;-1;>=;10

This condition will be fulfilled if the USA has 10 units (any type) in the Close_to_Richmond area.


IMPORTANT NOTE: This command can be abused easily, one unit can be a single element (within an unit) or a full division made of 18 elements. It is much better to use instead SelectSubUnits, which has many possible selection parameters followed by EvalSubUnitCount.


Example 2

CountUnits = $Shipping;0;$USA;-1;DICE;20 

TRUE if the USA has a number of units greater than a Random number between 1-20 in the Region $Shipping


 

Parameters

area alias

String; alias of a region or area

region or area

0 or 1;

0 for region, 1 for area
faction

String; alias of a faction

unit type

Integer; -1 for any type of the following families (e.g. Leaders are not counted)

$Regular = 0
$Irregular = 1
$Militia = 2
$Cavalry = 3
$Artillery = 4
$Arty = 4
$SupplyType = 5
$Ship = 6
operator

<,<=,>,>=,=

number of units

Integer (0-999); the number of units that will fulfil the condition

Forums