Nuclide
Software Development Kit for id Technology (BETA)
ncSquadMonster Class Reference

About this class

ncSquadMonster based NPCs are able to communicate strategies together.

Inheritance diagram for ncSquadMonster:
ncMonster ncTalkMonster ambient_generic monster_generic speaker

Public Member Functions

void ncSquadMonster (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 ncIO::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 ncSquadMonster 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 (ncSquadMonster)
 Will add the specified NPC to this entity's current squad. More...
 
nonvirtual void RemoveFromSquad (ncSquadMonster)
 Will remove the specified NPC from this entity's current squad. More...
 
nonvirtual ncSquadMonster GetNearestSquadMember (void)
 Returns the nearest available member of its squad. More...
 
nonvirtual ncSquadMonster GetFarthestSquadMember (void)
 Returns the farthest available member of its squad. More...
 

Constructor & Destructor Documentation

◆ ncSquadMonster()

void ncSquadMonster::ncSquadMonster ( void  )

Member Function Documentation

◆ AddToSquad()

void ncSquadMonster::AddToSquad ( ncSquadMonster  addMember)

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

◆ FindSquadNearMe()

void ncSquadMonster::FindSquadNearMe ( float  searchRadius)

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

◆ GetFarthestSquadMember()

ncSquadMonster ncSquadMonster::GetFarthestSquadMember ( void  )

Returns the farthest available member of its squad.

◆ GetNearestSquadMember()

ncSquadMonster ncSquadMonster::GetNearestSquadMember ( void  )

Returns the nearest available member of its squad.

◆ GetSquadLeader()

ncSquadMonster ncSquadMonster::GetSquadLeader ( void  )

Returns the leader of their squad.

Invalid if none.

◆ HasBecomeSquadLeader()

void ncSquadMonster::HasBecomeSquadLeader ( void  )
virtual

Overridable: Called when this NPC became squad leader.

◆ HasJoinedSquad()

void ncSquadMonster::HasJoinedSquad ( void  )
virtual

Overridable: Called when this NPC joined a squad.

◆ InSquad()

bool ncSquadMonster::InSquad ( void  )

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

◆ IsSquadLeader()

bool ncSquadMonster::IsSquadLeader ( void  )

Returns whether or not they're the squad leader.

◆ RemoveFromSquad()

void ncSquadMonster::RemoveFromSquad ( ncSquadMonster  toRemove)

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

Can be called on self.

◆ Restore()

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

Similar to ncIO::SpawnKey() but for save-game fields.

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

Reimplemented from ncMonster.

Reimplemented in ambient_generic, speaker, and ncTalkMonster.

◆ Save()

void ncSquadMonster::Save ( float  handle)
virtual

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

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

Reimplemented from ncMonster.

Reimplemented in ambient_generic, speaker, and ncTalkMonster.

◆ Spawned()

void ncSquadMonster::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 ncMonster.

Reimplemented in ambient_generic, and speaker.

◆ SpawnKey()

void ncSquadMonster::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 ncIO.

Reimplemented from ncMonster.

Reimplemented in ambient_generic, speaker, and ncTalkMonster.


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