ironside Posted January 20, 2008 Share Posted January 20, 2008 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 More sharing options...
Gnasher Posted January 20, 2008 Share Posted January 20, 2008 Don't forget the vehicle crews. You can easily pop your limits when a tank is hit & 5 crew jump out. Link to comment Share on other sites More sharing options...
SlapHappy Posted January 20, 2008 Share Posted January 20, 2008 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 More sharing options...
SlapHappy Posted January 20, 2008 Share Posted January 20, 2008 In the above example, you could check each army individually and then sum the values returned, or check each individually and only apply reinforcements based on some maximum value per army. Link to comment Share on other sites More sharing options...
ironside Posted January 21, 2008 Author Share Posted January 21, 2008 yeah cheers it's the looping part I seam to be struggling with.ideas? Link to comment Share on other sites More sharing options...
Recommended Posts