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

CheckPowerRatio

From AGEWiki

(Difference between revisions)
Jump to: navigation, search
m (moved AI.CheckPowerRatio to CheckPowerRatio: Command renamed)
m (formatting)
 
Line 1: Line 1:
{{ scriptcommand
{{ scriptcommand
| name = CheckPowerRatio
| name = CheckPowerRatio
-
| syntax = Kind{{!}}Range{{!}}Ratio{{!}}Operator{{!}}FixedPercNoPerm{{!}}<FixedPercPerm>
+
| syntax = <Kind>{{!}}<Range>{{!}}<Ratio>{{!}}<Operator>{{!}}<FixedPercNoPerm>{{!}}<FixedPercPerm>
| description = This command tests the power ratio of owned and friendly units against hostile units, within a certain range around the region in selection against an operator and a value. If the test fails, the conditions are not ok and the event doesn't trigger.
| description = This command tests the power ratio of owned and friendly units against hostile units, within a certain range around the region in selection against an operator and a value. If the test fails, the conditions are not ok and the event doesn't trigger.
Line 9: Line 9:
| example-description = Check if we (and our allies) reach a 3 to 1 ratio in land units, within 4 regions from the region in selection. Fixed units are worth either 50% or 25% of their normal power value (both sides).
| example-description = Check if we (and our allies) reach a 3 to 1 ratio in land units, within 4 regions from the region in selection. Fixed units are worth either 50% or 25% of their normal power value (both sides).
   
   
-
| param1 = Kind
+
| param1 = <Kind>
| param1desc = The kind of units tested.
| param1desc = The kind of units tested.
:Either (textually) LAND or NAV.  
:Either (textually) LAND or NAV.  
:Planes are LAND units.
:Planes are LAND units.
-
| param2 = Range  
+
| param2 = <Range>
| param2desc = Search range in regions
| param2desc = Search range in regions
:Between 0 (within the region) to 6 (regions around)
:Between 0 (within the region) to 6 (regions around)
-
| param3 = Power Ratio  
+
| param3 = <Power Ratio>
| param3desc = The ratio, in percentage to test against
| param3desc = The ratio, in percentage to test against
:(20 to 500) (1 vs 5 to 5 vs 1)
:(20 to 500) (1 vs 5 to 5 vs 1)
:example 400 = 4 to 1 ratio (in favor of our units)
:example 400 = 4 to 1 ratio (in favor of our units)
-
| param4 = Operator
+
| param4 = <Operator>
| param4desc = One of <, <=, =, >=, >
| param4desc = One of <, <=, =, >=, >
-
| param5 = Coeff for non permanently fixed units
+
| param5 = <FixedPercNoPerm>
-
| param5desc = Value for fixed units (are they considered normally or not)
+
| param5desc = Coeff for non permanently fixed units
 +
:Value for fixed units (are they considered normally or not)
:(0 to 100)
:(0 to 100)
-
| param6 = Coeff for permanently fixed units
+
| param6 = <FixedPercPerm>
-
| param6desc = Value for fixed units (are they considered normally or not)
+
| param6desc = Coeff for permanently fixed units
 +
:Value for fixed units (are they considered normally or not)
:(0 to 100)
:(0 to 100)
}}
}}
[[Category:AI Modding]]
[[Category:AI Modding]]

Latest revision as of 11:56, 9 November 2010

CheckPowerRatio

Syntax  

CheckPowerRatio = <Kind>|<Range>|<Ratio>|<Operator>|<FixedPercNoPerm>|<FixedPercPerm>

Description

This command tests the power ratio of owned and friendly units against hostile units, within a certain range around the region in selection against an operator and a value. If the test fails, the conditions are not ok and the event doesn't trigger.

Allied units are considered with a 50% coefficient. Fixed units are considered according to FixedPercNoPerm (if not permanently fixed) or FixedPercPerm (otherwise, and optional, will take the FixedPercNoPerm value if not specified) coefficients.

Example  

CheckPowerRatio = LAND|4|300|>=|50|25

Check if we (and our allies) reach a 3 to 1 ratio in land units, within 4 regions from the region in selection. Fixed units are worth either 50% or 25% of their normal power value (both sides).


 

Parameters

<Kind>

The kind of units tested.

Either (textually) LAND or NAV.
Planes are LAND units.
<Range>

Search range in regions

Between 0 (within the region) to 6 (regions around)
<Power Ratio>

The ratio, in percentage to test against

(20 to 500) (1 vs 5 to 5 vs 1)
example 400 = 4 to 1 ratio (in favor of our units)
<Operator>

One of <, <=, =, >=, >

<FixedPercNoPerm>

Coeff for non permanently fixed units

Value for fixed units (are they considered normally or not)
(0 to 100)
<FixedPercPerm>

Coeff for permanently fixed units

Value for fixed units (are they considered normally or not)
(0 to 100)
Forums