Jump to content

script for unit count for reinforcement trigger help


Recommended Posts

Can anyone give us an idea that runs a script for a trigger that counts all units prior to the release of reinforcements therefore not allowing the game to ctd when the 250 units mark is breached on both sides. at the moment I just cant get it try all the coding I can but to no avail. I want to have one that counts all units above any other condition I impose on reinforcement release. and be able to use it for all reinforcement triggers.

Link to comment
Share on other sites

Put this argument routine in a loop that periodically checks GetNUnits status:

</font><blockquote>code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">GetNUnits

Returns the number of units in an army or group

Syntax:

GetNUnits ( <ObjectType> , <ObjectID> , <UnitType> , <Filter> )

This function/procedure uses the army identifier set with the help of the procedure SetWorkArmy with no influence exerted upon ObjectType – “ARMY”

<ObjectType> - “UNIT” || “GROUP” || “ARMY”

<ObjectID> - identifier of an object of the specified type (a constant or variable)

<UnitType> - “ALL” || “ARMOREDCAR” || “ARTILLERY” || “CAR” || “FLAK” || “FORTIFICATION” || “HMG” || “HUMAN” || “SPG” || “TANKS”

<Filter> - set of filters separated by spaces (commas): “BROKEN_WEAPON” || “OK_WEAPON” || “BROKEN_ENGINE” || “OK_ENGINE” || “EMPTY” || “NOT_EMPTY” || “CREW” || “PANIC” || “NO_PANIC”

The filter behavior is described in paragraph 3.5.9 GetNUnitsInArea

Example:

[Trigger]

Set @num = GetNUnits ( GROUP , “Group” , SPG , “NOT_EMPTY” , “OK_WEAPON” , “OK_ENGINE” )

// The number of SPGs in the group named Group is determined that have crews and active weapons and are able to move

Halt

[Trigger]

SET @groupVar = "Group1"

SET @num = GetNUnits ( GROUP , @groupVar , ALL )

// The number of units is determined in the group named Group1

Halt </pre>

Link to comment
Share on other sites

×
×
  • Create New...