I am looking for something along these lines and I'm having no luck. I need to keep track of the units inside of a region and I want a counter to take place. It will check if the number of units in the region is > zero, then it will count the units and store it into an array. Any help on this?
make a new condition definition
Number of units in region
Options: Condition
Return Type: Integer
Parameters
Region = No Region <Region>
Grammar Text: Number of units in Region
Hint Text: (None)
Custom Script Code
Local Variables
Actions
General - Return (Number of Living units in (Any units in Region owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount))
One more question. I am now trying to call those units stored. Trying to call their names. I am going to mess with it but if you have any tips on a good way to do that... let me know.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
That is something like:
Number of (Triggering Unit) Operator Integer
I am looking for something along these lines and I'm having no luck. I need to keep track of the units inside of a region and I want a counter to take place. It will check if the number of units in the region is > zero, then it will count the units and store it into an array. Any help on this?
You could use the Action "Pick Each Unit in Unit Group" and increment a variable for each Picked Unit that matches the conditions of an If Then Else.
@moronsonofboron: Go
Would the If Then Else Come after that action? Or would it be inside that action?
The If Then Else is inside the action, as you have to compare each unit that is picked.
make a new condition definition
Number of units in region
Options: Condition
Return Type: Integer
Parameters
Region = No Region <Region>
Grammar Text: Number of units in Region
Hint Text: (None)
Custom Script Code
Local Variables
Actions
General - Return (Number of Living units in (Any units in Region owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount))
I think I got it. Many thanks yall.
One more question. I am now trying to call those units stored. Trying to call their names. I am going to mess with it but if you have any tips on a good way to do that... let me know.