Difference between revisions of "Variables/Unit Group"

From HIVE
Jump to navigation Jump to search
(Issuing orders to unit groups and adding units to unit group variables.)
 
m
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
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.
+
A Unit Group is a [[Variable]] type used in the [[trigger]] editor.  It is used to store a group of created units to be issued orders, have properties changed, referenced for something, and so on.
 
 
[[File:Unit_Group_Example.jpeg]]
 
  
 +
[[File:Unit_Group_Example.jpeg|center|400px|For each integer, it will create one marine for the picked integer. Then it will add that unit to a unit group variable.]]
 
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".
 
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".
  
[[File:Issue Units' Orders.jpg]]
 
  
 +
[[File:Issue Units' Orders.jpg|center|400px]]
 
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".
 
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.
+
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 with the "Issue Order" [[Actions|action]] and not "Issue Order to Unit Group", assuming you want to issue orders) and using the index of "1" will return the SCV.
 +
 
 +
[[Category:StarCraft II]]
 +
[[Category:Triggers]]
 +
[[Category:Reference]]

Latest revision as of 10:27, 27 March 2013

A Unit Group is a Variable type used in the trigger editor. It is used to store a group of created units to be issued orders, have properties changed, referenced for something, and so on.

For each integer, it will create one marine for the picked integer. Then it will add that unit to a unit group variable.

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 with the "Issue Order" action and not "Issue Order to Unit Group", assuming you want to issue orders) and using the index of "1" will return the SCV.