Difference between revisions of "Variables/Unit Group"
m |
m |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | A Unit Group is a | + | 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|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|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 [[ | + | 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:StarCraft II]] | ||
[[Category:Triggers]] | [[Category:Triggers]] | ||
[[Category:Reference]] | [[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.
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 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.