Unit group
Unit Group allows you to put multiple units in a group for uniform processing.
Functions
pick_unit_in_unit_group_to_perform_action
Iterate through the units in a unit group to perform an action.
unit_group:pick_unit_in_unit_group_to_perform_action()
select_unit_by_unit_group
Select units by unit group.
unit_group:select_unit_by_unit_group()
add_unit
Add a unit.
Parameter
Variable | Type | Description |
---|---|---|
unit | unit | Unit. |
unit_group:add_unit(unit)
remove_unit
Remove a unit.
Parameter
Variable | Type | Description |
---|---|---|
unit | unit | Unit. |
unit_group:remove_unit(unit)
remove_unit_type
Remove unit type.
Parameter
Variable | Type | Description |
---|---|---|
unit_id | integer | Unit type ID. |
unit_group:remove_unit_type(unit_id)
integer_random_units_from_unit_group
Random integer units from a unit group
Return
Type | Description |
---|---|
unit_group | Random integer units. |
unit_group:integer_random_units_from_unit_group(count)
number_of_units_in_unit_group
Get the number of units in a unit group.
Return
Type | Description |
---|---|
integer | Number of units. |
unit_group:number_of_units_in_unit_group()
get_number_of_units_of_specified_type_in_unit_group
Number of unit types in a unit group.
Return
Type | Description |
---|---|
integer | Number of unit types. |
unit_group:get_number_of_units_of_specified_type_in_unit_group(unit_id)
get_the_first_unit_in_a_unit_group
Get the first unit in a unit group.
Return
Type | Description |
---|---|
unit | First unit in a unit group. |
unit_group:get_the_first_unit_in_a_unit_group()
get_random_unit_from_unit_group
Get a random unit from a unit group.
Return
Type | Description |
---|---|
unit | A random unit from a unit group. |
unit_group:get_random_unit_from_unit_group()
get_last_unit_in_unit_group
Get the last unit in a unit group.
Return
Type | Description |
---|---|
unit | A random unit in the unit group. |
unit_group:get_last_unit_in_unit_group()
get_number_of_units_in_specified_state_in_unit_group
The number of units in a state in a unit group.
Return
Type | Description |
---|---|
integer |
unit_group:get_number_of_units_in_specified_state_in_unit_group()
filter_unit_in_area
Filter all units in the range.
Parameters
Return
Type | Description |
---|---|
unit_group | All units in range. |
unit_group.filter_unit_in_area(point, shape, owner_player, visible_player, invisible_player, not_in_unit_group, has_tag,
unit_of_a_specified_unit_type
Unit of a specified unit type.
Parameter
Variable | Type | Description |
---|---|---|
unit_id | integer | Unit type ID. |
Return
Type | Description |
---|---|
unit_group | Unit group. |
unit_group.unit_of_a_specified_unit_type(unit_id)