Squad Functions
Note
One squad can only hold 32 NPCs in one map.
SetSquad
Sets an NPC's squad.
Syntax
SetSquad [string]
- Sets squad
SetSquad null
- Clears out squad
Example
// (From ai_mission_pwac)
st_init
{
Group Neutral
Patterns
{
pt_default
{
actions
{
ExecutePattern bh_base:st_init.pt_default
SetAttr "GrenadeType GRND_TYPE_FRAG"
SetAttr "flag_ThrowSafe 1"
// Set our squad as Cops_squad
SetSquad Cops_squad
SetSquadRelation Prison_squad:enemy:2,Player_squad:enemy:4
}
}
}
}
SetSquadRelation
Sets an NPC's squad's relation towards another squad.
Syntax
SetSquadRelation [squad name]:[neutral/enemy/fear]:[priority]
-- use commas (,) to set more relations
Example
// (from ai_mission_jwb)
pt_default
{
actions
{
ExecutePattern bh_base:st_init.pt_default
TargetEntByName "mission_logic"
TargetToMem msGP
FireEvent CopSpawned
SetSquad cop_squad
// Hates Player, and Soccer Moms, but hates the latter more
SetSquadRelation Player_squad:enemy:3,SoccerMom:enemy:1
SetAttr "IdleTask 0"
SetAreaGroup AG_DEFAULT,AG_BATTLE,AG_SHOP
}
}
RemoveSquadRelation
Unused Postal3Script function.
Removes an NPC's squad's relation towards another squad.
Syntax
RemoveSquadRelation [squad name],[squad name]
RemoveSquadRelation clear_all
-- Clears every squad relation from current squad