A collection of units moving and attacking together. The engine creates autonomous unit groups to attack polluted areas. The script can create and control such groups as well. Groups can accept commands in the same manner as regular units.
|add_member(unit)||Make a unit a member of this group.|
|set_command(command)||Give this group a command.|
|set_autonomous()||Make this group autonomous.|
|start_moving()||Make the group start moving even if some of its members haven't yet arrived.|
|destroy()||Dissolve this group.|
|members :: array of LuaEntity [R]||Members of this group.|
|position :: Position [R]||Group position.|
|state :: defines.group_state [R]||Whether this group is gathering, moving or attacking.|
|force :: LuaForce [R]||The force of this unit group.|
|surface :: LuaSurface [R]||The surface of this unit group.|
|group_number :: uint [R]||The group number for this unit group.|
|is_script_driven :: boolean [R]||Whether this unit group is controlled by a script or by the game engine.|
|command :: Command [R]|| The command given to this group or |
|distraction_command :: Command [R]|| The distraction command given to this group or |
|valid :: boolean [R]||Is this object valid?|
|help() → string||All methods, and properties that this object supports.|
Make a unit a member of this group. Has the same effect as giving a
group_command with this
group to the unit.
Give this group a command.
Make this group autonomous. Autonomous groups will automatically attack polluted areas. Autonomous groups aren't considered to be script driven
Make the group start moving even if some of its members haven't yet arrived.
Dissolve this group. Its members won't be destroyed, they will be merely unlinked from this group.
Members of this group.
Group position. This can have different meanings depending on the group state. When the group is gathering, the position is the place of gathering. When the group is moving, the position is the expected position of its members along the path. When the group is attacking, it is the average position of its members.
Whether this group is gathering, moving or attacking.
The force of this unit group.
The surface of this unit group.
The group number for this unit group.
Whether this unit group is controlled by a script or by the game engine.
The command given to this group or
nil is the group has no command.
The distraction command given to this group or
nil is the group currently isn't distracted.