| Home Page | Recent Changes

SquadAI

UT2003 :: Actor >> Info >> ReplicationInfo >> SquadAI

Every Bot in UT200x is member of a squad which is controlled by a SquadAI instance. The team's TeamAI puts bots on squads and orders squads around. Bots in turn query their squad for information about orders, objectives and interaction with other players.

Properties

Main

UnrealTeamInfo? Team
UnrealTeamInfo? actor of the team this squad belongs to.
SquadAI NextSquad
Next squad in the linked list of squads maintained by TeamAI. The start of the list is referenced by the Squads variable in TeamAI.
Controller SquadLeader
Leader of this squad. Can be either a human player or a bot.
TeamPlayerReplicationInfo? LeaderPRI
The squad leader's TeamPlayerReplicationInfo? actor.
GameObjective SquadObjective
Current GameObjective that has been assigned to this squad.
name CurrentOrders
Current orders of this squad, updated only by GetOrders (which deduces the orders from other information available about this squad). Supported values are:
  • 'Defend' – Defend the current SquadObjective
  • 'Freelance' – Roam the map, follow individual goals
  • 'Attack' – Attack the current SquadObjective
  • 'Human' – Follow the human squad leader
int Size
Number of bots on this squad. (Human players on the squad are not counted)
Bot SquadMembers
First Bot in a linked list of squad members. The bots are linked by their NextSquadMember variable.
Pawn Enemies[8]
List of enemies, maintained by AddEnemy, LostEnemy and RemoveEnemy.
bool bFreelance
Set if this squad doesn't defend or attack an objective.
bool bFreelanceAttack
bool bFreelanceDefend
Used by TeamAI to mark freelance squads that are temporarily ordered to reinforce the team's offense or defense.
UnrealScriptedSequence FreelanceScripts
First UnrealScriptedSequence in a linked list of "freelance scripts" (scripts found in the map that aren't assigned to any GameObjective); set by SetFreelanceScriptFor. The scripts are linked by their NextScript variable. The list is maintained by class UnrealScriptedSequence itself.
RestingFormation? RestingFormation
RestingFormation actor for this squad (spawned by GetRestingFormation), describing the resting formation the squad's members should assume.

Configuration

float GatherThreshold
The fraction of players on this squad that must be gathered when going to an objective before the squads starts moving on.
int MaxSquadSize
Maximum number of bots on this squad. Before the squad size exceeds this number, a new squad is created.
class<RestingFormation> RestingFormationClass
RestingFormation? for this squad. An actor of this class is spawned by GetRestingFormation and referenced by the RestingFormation variable when requested.

Information

string SupportString (localized)
string DefendString (localized)
string AttackString (localized)
string HoldString (localized)
string FreelanceString (localized)
string SupportStringTrailer (localized)
Used to assemble a human-readable representation of this squad's orders by GetOrderStringFor (which is called by ScoreBoardTeamDeathMatch?).

Functions

AssignCombo( Bot B )
Assign the combo. Example: if(Pawn.Health < 50) B.TryCombo("XGame.ComboDefensive");
FindPathToObjective( Bot B, Actor O )
The indispensable function for move easily the bot to a actor. For a objective the bot use the alternate path.
NotifyKilled( Controller Killer, Controller Killed, Pawn KilledPawn )
Called by the GameInfo for all players when a player was killed. If a bot see a team mate killed this bot send message Man down!, if the killed is a enemy this enemy are removed of enemy list, the bot killer play a random victory animation. (no insult here)
PickNewLeader()
Indicate a new squad leader. (about FIXME note: what for not in squad chain check the more near squad member via a VSize of objective and Pawn of all squad member, a litte like for FindNewEnemy() in MonsterController)
AddBot( Bot B )
Add a bot to this squad. Removes the bot from the squad it was on first, if any. WARNING: This function does NOT check if the bot is on the right team!
RemoveBot( Bot B )
Remove a bot from the squad.
RemoveEnemy( Pawn E )
Remove a enemy of enemy list.
RemovePlayer( PlayerController P)
Remove a player from the squad.
SetAlternatePath( bool bResetSquad )
For move all squad to alternate path chain. (if exist)
SetFinalStretch( bool bValue )
Toggle the final stretch of bot and all team mate.
SetLeader( Controller C )
Make a new squad leader.
bool AddEnemy( Pawn NewEnemy )
Allow to add a other enemy in enemy list.
bool AllowDetourTo( Bot B, NavigationPoint N )
Allow of this bot to make a detour before move to objective. Example: return (B.NeedWeapon());
bool AllowImpactJumpBy( Bot B )
Allow of this bot to use a impact jump. (with shieldgun)
bool AllowTaunt( Bot B )
Allow of this bot to use the taunt.
bool AllowTranslocationBy( Bot B )
Allow of this bot to use the translauncher. Example: on BombingSquadAI?, is not available for the bomb carrier.
bool AssignSquadResponsibility( Bot B )
The ExecuteWhatToDoNext() routine of objectives, just that.
bool CautiousAdvance( Bot B )
If return true the bot advance crouched. (humm... also when Bot in state Retreating!?)
bool CheckSquadObjectives( Bot B )
The main AI code for gametype oriented objective. Important note: is not called in DMSquadAI?, modifi directely the function AssignSquadResponsibility(Bot B).
bool FindNewEnemyFor( Bot B, bool bSeeEnemy )
Seek a new enemy, if exemple this new enemy is more near to other enemy, this new enemy is more priority with a update enemy list. Return false if no new enemy.
bool IsOnSquad( Controller C )
Return true if C is a team mate. (in same squad)
bool LostEnemy( Bot B )
Return true if no enemy and seek a another enemy, else return false.
bool MustKeepEnemy( Pawn E)
(not implemented) Example: in CTFSquadAI return true if this pawn is a important enemy flag holder.
bool TellBotToFollow( Bot B, Controller C )
The routine IFollowATeamMate, return true if the bot can yet follow.
bool TryToIntercept( Bot B, Pawn P, Actor RouteGoal )
This bot (B) try to intercept the pawn (P) on actor point location (RouteGoal). Example: on CTFSquadAI, is used for try to intercept the enemy flag carrier on enemy base.
bool UnderFire( Pawn NewThreat, Bot Ignored )
Checks and returns whether the enemy Pawn given as the first parameter is already under fire by other bots from this squad that are closer to the enemy than the bot specified in the second parameter. (In that case the bot could be reassigned to a different task, for instance, or at least consider the given enemy less of a threat.)
int GetSize()
Return the number of squad members.
name GetOrders()
Return the current order name.
string GetOrderStringFor( TeamPlayerReplicationInfo? PRI )
Return the current order in string exemple for the ScoreBoardTeamDeathMatch?, require the TeamPRI for holding replication (!?).

Known Subclasses

Related Topics


Category Class (UT2003)

Category Class (UT2004)

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

FAQs

Help Desk

Mapping Topics

Mapping Lessons

UnrealEd Interface

UnrealScript Topics

UnrealScript Lessons

Making Mods

Class Tree

Modeling Topics

Chongqing Page

Log In