SGroupID is the ID of a group of squads on the battlefield.
Usually, you use sgroup name, a string value associated with a Squad Group, [ sg_playerarmy ]. This must be defined via the Mission Editor or a SCAR function like Util_CreateSquadsAtPosition( )?. A Squad Group is any grouping of squads. Entities assigned to sgroups will automatically be filtered out.
Then, we can get the SGroupID from the predefined name
You can usually perform group actions using SGroupID's, such as moving many enemy units to attack a point, or destroying/undeploying many units at once.
To perform actions specifically on one squad, either put that one squad in a seperate, and otherwise empty, squad group, or use its SquadID to perform actions on it, out of a larger Squad Group.
function Create_Traks()
-- Create an Ork Trak for player 1, at marker "mk_mekshop"
-- Need to create the SGroup first, and remove anything else from it
SGroup_CreateIfNotFound("sg_OrkTrak")
SGroup_Clear(SGroup_FromName("sg_OrkTrak"))
-- Create the squads at the correct marker.
Util_CreateSquadsAtMarker(g_Player2, "sg_OrkTrak", "ork_squad_wartrak", "mk_mekshop", 1)
-- Order them to attack always (this orders all squads in "sg_OrkTrak" to do this order)
Cmd_SetStance("sg_OrkTrak", STANCE_Attack)
Squad Index Category
Data Types
Functions
SCAR Home
Wiki Home