That was just an example, no need to use it as trigger. You could create your own function that returns the number of units, then you can use it anywhere in triggers with just 1 line. Some quick notes if you want to achieve this:
-Create a new function with an integer type parameter
-modify 'owned by player 1' with 'owned by <parameter>'
-add a 'Return Counter' as the last action
You should be able to call upon it from any triggers with something like: 'myIntVariable=myCountFunction()', where myCountFunction() is the function you just created, and myIntVariable is an int type varaible that you define within the trigger. Good luck.
That was just an example, no need to use it as trigger. You could create your own function that returns the number of units, then you can use it anywhere in triggers with just 1 line. Some quick notes if you want to achieve this:
-Create a new function with an integer type parameter
-modify 'owned by player 1' with 'owned by <parameter>'
-add a 'Return Counter' as the last action
You should be able to call upon it from any triggers with something like: 'myIntVariable=myCountFunction()', where myCountFunction() is the function you just created, and myIntVariable is an int type varaible that you define within the trigger. Good luck.
@HexenLord: Go
Local Variables
UnitGroup = (Empty unit group) <Unit Group>
Counter = 0 <Integer>
Actions
Variable - Set UnitGroup = (Any units in (Entire map) owned by player 1 matching Excluded: Missile, Dead, Hidden, with at most Any Amount)
Unit Group - Pick each unit in UnitGroup and do (Actions)
Actions
Variable - Set Counter = (Counter + 1)
If you want to use counter in another trigger then you might want to set UnitGroup as global variable.