Nuclide
Software Development Kit for id Technology
NSTalkMonster Class Reference

About this class

This class represents NSMonsters that talk.

QUAKED NSTalkMonster (0 0.8 0.8) (-16 -16 0) (16 16 72) WAITTILLSEEN GAG MONSTERCLIP x PRISONER x IGNOREPLAYER WAITFORSCRIPT PREDISASTER FADECORPSE MULTIPLAYER FALLING HORDE

OVERVIEW

This class represents NSMonsters that talk. They need to network extra information and can speak more complicated dialogue using the Sentences system.

They also can communicate with other NSTalkMonster based entities.

KEYS

  • "targetname" : Name
  • "netname" : Name used for obituaries and debug info.
  • "maxs" : Bounding box mins.
  • "mins" : Bounding box maxs.

KEYS - SENTENCES

  • "talk_answer" : SentenceDef to play when they're providing a generic answer to a question.
  • "talk_ask" : SentenceDef to play when they're asking a question.
  • "talk_ally_shot" : SentenceDef to play when they're commenting on an ally being shot.
  • "talk_greet" : SentenceDef to play when greeting an ally.
  • "talk_idle" : SentenceDef to play when idling about.
  • "talk_panic" : SentenceDef to play when the state from being calm changes to being fearful.
  • "talk_hearing" : SentenceDef to play when commenting on a suspicious noise.
  • "talk_smelling" : SentenceDef to play when commenting on a suspicious smell.
  • "talk_stare" : SentenceDef to play when commenting on the player staring at them.
  • "talk_survived" : SentenceDef to play when they've survived an attack.
  • "talk_wounded" : SentenceDef to play when they've been severely wounded.
  • "talk_alert" : SentenceDef to play when they've become alerted.
  • "talk_player_ask" : SentenceDef to play when they want to ask the player a question.
  • "talk_player_greet" : SentenceDef to play when they want to greet the player.
  • "talk_player_idle" : SentenceDef to play when they hang around the player.
  • "talk_player_wounded1" :
  • "talk_player_wounded2" :
  • "talk_player_wounded3" :
  • "talk_unfollow" : SentenceDef to play for when they're choosing to unfollow someone.
  • "talk_follow" : SentenceDef to play for when they're choosing follow someone.
  • "talk_stop_follow" : SentenceDef to play for when they're being asked to unfollow someone.
  • "talk_deny_follow" : SentenceDef to play for when they're denying the follow request.
  • "follow_on_use" : Can be either 0 or 1, will decide if they can follow someone.
  • "follow_dist" : Distance between the it and the player its following.
  • "follow_maxdist" : Maximum distance between it and the player before giving up following them.

For more keys, see NSMonster.

Inheritance diagram for NSTalkMonster:
NSSquadMonster ambient_generic monster_generic speaker

Public Member Functions

void NSTalkMonster (void)
 
virtual void Sentence (string)
 When called, will play a Sentence over the network. More...
 
virtual void Speak (string)
 When called, will play a single sample (.wav/.ogg) over the network. More...
 
virtual void WarnAllies (void)
 When called, will alert all allies in a nearby area. More...
 
virtual void StartleAllies (void)
 When called, will startle all allies in a nearby area. More...
 
virtual void FollowPlayer (void)
 Internal use only. More...
 
virtual void FollowChain (void)
 Internal use only. More...
 
virtual void RunAI (void)
 Internal use only. More...
 
virtual void PanicFrame (void)
 Run every frame if we're in a state of panic. More...
 
virtual void OnPlayerUse (void)
 
virtual void Respawn (void)
 Server: Called when the entity first spawns or when game-logic requests the entity to return to its original spawn state. More...
 
virtual void SpawnKey (string, string)
 This method handles entity key/value pairs on map load. More...
 
virtual float SendEntity (entity, float)
 Called by the engine whenever we need to send a client an update about this entity. 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 Touch (entity)
 Called whenever we're touching another entity. More...
 
virtual void TalkPanic (void)
 Called when they're in a state of panic. More...
 
virtual void TalkPlayerAsk (void)
 Called when they want to ask the player a question. More...
 
virtual void SeenPlayer (NSActor)
 Called when they are greeting the player. More...
 
virtual void SeenFriend (NSActor)
 Called when they are chit-chatting with the player. More...
 
virtual void TalkPlayerWounded1 (void)
 Called when they tell the player that they're wounded. More...
 
virtual void TalkPlayerWounded2 (void)
 Called when they tell the player that severely wounded. More...
 
virtual void TalkPlayerWounded3 (void)
 Called when they tell the player that they're near death. More...
 
virtual void TalkUnfollow (void)
 Called when they tell the player that they'll give up following. More...
 
virtual void TalkFollow (void)
 Called when they tell the player that they'll start following. More...
 
virtual void TalkStopFollow (void)
 Called when they tell the player that they'll stop following. More...
 
virtual void TalkDenyFollow (void)
 Called when they tell the player they won't follow you. More...
 
virtual float predraw (void)
 
virtual void ReceiveEntity (float, float)
 Client: Handles network updates from the server for the associated entity. More...
 
virtual void SentenceSample (string)
 Plays a single sample from a sentence. More...
 
virtual void ProcessWordQue (void)
 Called once per frame to process the word queue. More...
 
virtual void HandleAnimEvent (float, int, string)
 Callback for any model event that gets triggered while playing a framegroup. More...
 

Constructor & Destructor Documentation

◆ NSTalkMonster()

void NSTalkMonster::NSTalkMonster ( void  )

Member Function Documentation

◆ FollowChain()

void NSTalkMonster::FollowChain ( void  )
virtual

Internal use only.

Run every frame to update who we're following in the chain

◆ FollowPlayer()

void NSTalkMonster::FollowPlayer ( void  )
virtual

Internal use only.

Run every frame to run after the player we are set to follow.

◆ HandleAnimEvent()

void NSTalkMonster::HandleAnimEvent ( float  flTimeStamp,
int  iCode,
string  strData 
)
virtual

Callback for any model event that gets triggered while playing a framegroup.

Reimplemented from NSRenderableEntity.

◆ OnPlayerUse()

void NSTalkMonster::OnPlayerUse ( void  )
virtual

◆ PanicFrame()

void NSTalkMonster::PanicFrame ( void  )
virtual

Run every frame if we're in a state of panic.

◆ predraw()

virtual float NSTalkMonster::predraw ( void  )
virtual

Reimplemented from NSMonster.

◆ ProcessWordQue()

virtual void NSTalkMonster::ProcessWordQue ( void  )
virtual

Called once per frame to process the word queue.

◆ ReceiveEntity()

virtual void NSTalkMonster::ReceiveEntity ( float  flNew,
float  flChanged 
)
virtual

Client: Handles network updates from the server for the associated entity.

Reimplemented from NSMonster.

Reimplemented in speaker.

◆ Respawn()

void NSTalkMonster::Respawn ( void  )
virtual

Server: Called when the entity first spawns or when game-logic requests the entity to return to its original spawn state.

Reimplemented from NSMonster.

Reimplemented in monster_generic, ambient_generic, and speaker.

◆ Restore()

void NSTalkMonster::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 NSSquadMonster.

Reimplemented in ambient_generic, and speaker.

◆ RunAI()

void NSTalkMonster::RunAI ( void  )
virtual

Internal use only.

Run every frame to go through the main AI loop.

Reimplemented from NSMonster.

◆ Save()

void NSTalkMonster::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 NSSquadMonster.

Reimplemented in ambient_generic, and speaker.

◆ SeenFriend()

void NSTalkMonster::SeenFriend ( NSActor  theActor)
virtual

Called when they are chit-chatting with the player.

Reimplemented from NSMonster.

◆ SeenPlayer()

void NSTalkMonster::SeenPlayer ( NSActor  thePlayer)
virtual

Called when they are greeting the player.

Reimplemented from NSMonster.

◆ SendEntity()

float NSTalkMonster::SendEntity ( entity  ,
float   
)
virtual

Called by the engine whenever we need to send a client an update about this entity.

Reimplemented from NSMonster.

Reimplemented in ambient_generic, and speaker.

◆ Sentence()

void NSTalkMonster::Sentence ( string  sentence)
virtual

When called, will play a Sentence over the network.

◆ SentenceSample()

virtual void NSTalkMonster::SentenceSample ( string  )
virtual

Plays a single sample from a sentence.

◆ SpawnKey()

void NSTalkMonster::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 NSSquadMonster.

Reimplemented in ambient_generic, and speaker.

◆ Speak()

void NSTalkMonster::Speak ( string  sentence)
virtual

When called, will play a single sample (.wav/.ogg) over the network.

◆ StartleAllies()

void NSTalkMonster::StartleAllies ( void  )
virtual

When called, will startle all allies in a nearby area.

◆ TalkDenyFollow()

void NSTalkMonster::TalkDenyFollow ( void  )
virtual

Called when they tell the player they won't follow you.

◆ TalkFollow()

void NSTalkMonster::TalkFollow ( void  )
virtual

Called when they tell the player that they'll start following.

◆ TalkPanic()

void NSTalkMonster::TalkPanic ( void  )
virtual

Called when they're in a state of panic.

◆ TalkPlayerAsk()

void NSTalkMonster::TalkPlayerAsk ( void  )
virtual

Called when they want to ask the player a question.

◆ TalkPlayerWounded1()

void NSTalkMonster::TalkPlayerWounded1 ( void  )
virtual

Called when they tell the player that they're wounded.

◆ TalkPlayerWounded2()

void NSTalkMonster::TalkPlayerWounded2 ( void  )
virtual

Called when they tell the player that severely wounded.

◆ TalkPlayerWounded3()

void NSTalkMonster::TalkPlayerWounded3 ( void  )
virtual

Called when they tell the player that they're near death.

◆ TalkStopFollow()

void NSTalkMonster::TalkStopFollow ( void  )
virtual

Called when they tell the player that they'll stop following.

◆ TalkUnfollow()

void NSTalkMonster::TalkUnfollow ( void  )
virtual

Called when they tell the player that they'll give up following.

◆ Touch()

void NSTalkMonster::Touch ( entity  eToucher)
virtual

Called whenever we're touching another entity.

Reimplemented from NSMonster.

◆ WarnAllies()

void NSTalkMonster::WarnAllies ( void  )
virtual

When called, will alert all allies in a nearby area.


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