Difference between revisions of "Variables/Unit Group"

From HIVE
Jump to: navigation, search
m (DevliN moved page Unit groups to Variables/Unit Groups without leaving a redirect)
m
Line 10: Line 10:
  
 
If you would like to reference a single unit from the unit group, use the [[function]] "Convert Unit To Unit Group".  You may also choose to select a unit from a certain position in the unit group.  For example, if you added an SCV to "Unit Group Variable", he would have the index of 1.  If you later added a Marine to "Unit Group Variable", the Marine would then have the index of 2.  So, using the function "Unit from Unit Group" (which must be used in conjunction to the action "Issue Order" and not "Issue Order to Unit Group", considering you want to issue orders) and using the index of 1 will return the SCV.
 
If you would like to reference a single unit from the unit group, use the [[function]] "Convert Unit To Unit Group".  You may also choose to select a unit from a certain position in the unit group.  For example, if you added an SCV to "Unit Group Variable", he would have the index of 1.  If you later added a Marine to "Unit Group Variable", the Marine would then have the index of 2.  So, using the function "Unit from Unit Group" (which must be used in conjunction to the action "Issue Order" and not "Issue Order to Unit Group", considering you want to issue orders) and using the index of 1 will return the SCV.
 +
 +
[[Category:StarCraft II]]
 +
[[Category:Triggers]]
 +
[[Category:Reference]]

Revision as of 09:35, 27 March 2013

A Unit Group is a variable type used in the trigger editor. It is used to store a group of units in the variable to be commanded orders or have properties changed.

Unit Group Example.jpeg

In the above example, the trigger will pick each integer between 1 and 4. For each integer picked, it will create one marine for the picked integer in the center of the map. Then, the unit is added to a unit group, "Unit Group Variable".

Issue Units' Orders.jpg

In this trigger, it will pick each unit in the unit group "Unit Group Variable" and tell them to attack to a random point in the map. Make sure that the first parenthesis ("(Attack targeting (Random...") is set to "Order Targeting Point".

If you would like to reference a single unit from the unit group, use the function "Convert Unit To Unit Group". You may also choose to select a unit from a certain position in the unit group. For example, if you added an SCV to "Unit Group Variable", he would have the index of 1. If you later added a Marine to "Unit Group Variable", the Marine would then have the index of 2. So, using the function "Unit from Unit Group" (which must be used in conjunction to the action "Issue Order" and not "Issue Order to Unit Group", considering you want to issue orders) and using the index of 1 will return the SCV.