Nuclide
Software Development Kit for id Technology
NSSquadMonster Class Reference

About this class

NSSquadMonster based NPCs are able to communicate strategies together.

Inheritance diagram for NSSquadMonster:
NSMonster NSTalkMonster ambient_generic monster_generic speaker

Public Member Functions

void NSSquadMonster (void)
 
virtual void Spawned (void)
 Called when the entity is fulled initialized. More...
 
virtual void SpawnKey (string, string)
 This method handles entity key/value pairs on map load. More...
 
virtual void Save (float)
 Handles saving a copy of this entity to a given filehandle. More...
 
virtual void Restore (string, string)
 Similar to NSIO::SpawnKey but for save-game fields. More...
 
virtual void HasBecomeSquadLeader (void)
 Overridable: Called when this NPC became squad leader. More...
 
virtual void HasJoinedSquad (void)
 Overridable: Called when this NPC joined a squad. More...
 
nonvirtual bool InSquad (void)
 Returns true/false if they're in a squad. More...
 
nonvirtual bool IsSquadLeader (void)
 Returns whether or not they're the squad leader. More...
 
nonvirtual NSSquadMonster GetSquadLeader (void)
 Returns the leader of their squad. More...
 
nonvirtual void FindSquadNearMe (float)
 Will find and attach to a Squad in the specified radius. More...
 
nonvirtual void AddToSquad (NSSquadMonster)
 Will add the specified NPC to this entity's current squad. More...
 
nonvirtual void RemoveFromSquad (NSSquadMonster)
 Will remove the specified NPC from this entity's current squad. More...
 
nonvirtual NSSquadMonster GetNearestSquadMember (void)
 Returns the nearest available member of its squad. More...
 
nonvirtual NSSquadMonster GetFarthestSquadMember (void)
 Returns the farthest available member of its squad. More...
 

Constructor & Destructor Documentation

◆ NSSquadMonster()

void NSSquadMonster::NSSquadMonster ( void  )

Member Function Documentation

◆ AddToSquad()

void NSSquadMonster::AddToSquad ( NSSquadMonster  addMember)

Will add the specified NPC to this entity's current squad.

◆ FindSquadNearMe()

void NSSquadMonster::FindSquadNearMe ( float  searchRadius)

Will find and attach to a Squad in the specified radius.

◆ GetFarthestSquadMember()

NSSquadMonster NSSquadMonster::GetFarthestSquadMember ( void  )

Returns the farthest available member of its squad.

◆ GetNearestSquadMember()

NSSquadMonster NSSquadMonster::GetNearestSquadMember ( void  )

Returns the nearest available member of its squad.

◆ GetSquadLeader()

NSSquadMonster NSSquadMonster::GetSquadLeader ( void  )

Returns the leader of their squad.

Invalid if none.

◆ HasBecomeSquadLeader()

void NSSquadMonster::HasBecomeSquadLeader ( void  )
virtual

Overridable: Called when this NPC became squad leader.

◆ HasJoinedSquad()

void NSSquadMonster::HasJoinedSquad ( void  )
virtual

Overridable: Called when this NPC joined a squad.

◆ InSquad()

bool NSSquadMonster::InSquad ( void  )

Returns true/false if they're in a squad.

◆ IsSquadLeader()

bool NSSquadMonster::IsSquadLeader ( void  )

Returns whether or not they're the squad leader.

◆ RemoveFromSquad()

void NSSquadMonster::RemoveFromSquad ( NSSquadMonster  toRemove)

Will remove the specified NPC from this entity's current squad.

Can be called on self.

◆ Restore()

void NSSquadMonster::Restore ( string  strKey,
string  strValue 
)
virtual

Similar to NSIO::SpawnKey but for save-game fields.

Whatever you write into file handles within your NSIO::Save() method needs to be read back in here.

Reimplemented from NSMonster.

Reimplemented in ambient_generic, speaker, and NSTalkMonster.

◆ Save()

void NSSquadMonster::Save ( float  handle)
virtual

Handles saving a copy of this entity to a given filehandle.

Within you want to use the NSIO::SaveFloat() etc. methods to write the internal member attributes to the specified file handle.

Reimplemented from NSMonster.

Reimplemented in ambient_generic, speaker, and NSTalkMonster.

◆ Spawned()

void NSSquadMonster::Spawned ( void  )
virtual

Called when the entity is fulled initialized.

Any spawn key/value info pairs have already been dealt with. So now we can make full decisions on the entity. Always make sure to call super::Spawned(); inside your method when overriding.

Reimplemented from NSMonster.

Reimplemented in ambient_generic, and speaker.

◆ SpawnKey()

void NSSquadMonster::SpawnKey ( string  strKey,
string  strValue 
)
virtual

This method handles entity key/value pairs on map load.

You can easily convert the strValue parameter using the ReadFloat etc. methods that are part of NSIO.

Reimplemented from NSMonster.

Reimplemented in ambient_generic, speaker, and NSTalkMonster.


The documentation for this class was generated from the following files: