Nuclide
Software Development Kit for id Tech
NSTrigger Class Reference

NSTrigger handles all the non-input as well as Legacy (Quake, GoldSource) style trigger behaviour. More...

#include <NSTrigger.h>

Inheritance diagram for NSTrigger:
NSIO NSEntity NSBrushTrigger NSInteractiveSurface NSOutput NSPMoveVars NSPhysicsConstraint NSPointTrigger NSPortal NSRenderableEntity NSSpraylogo NSTimer env_cubemap env_muzzleflash env_particle env_shockwave env_soundscape env_sun func_areaportal func_dustcloud func_dustmotes func_friction func_monsterclip func_smokevolume info_notnull infodecal light_environment phys_rope point_message prop_rope prop_static sky_camera worldspawn

Public Member Functions

void NSTrigger (void)
 
virtual void Blocked (entity)
 Called whenever out movement is being blocked by an entity. More...
 
virtual void StartTouch (entity)
 Called when we started touching another entity. More...
 
virtual void Touch (entity)
 Called whenever we're touching another entity. More...
 
virtual void EndTouch (entity)
 Called when we stopped touching the last touched entity. 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 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 Input (entity, string, string)
 Called when we are being prompted by another object/function with an input message. More...
 
virtual bool CanBeTriggeredBy (entity)
 
virtual void Trigger (entity, triggermode_t)
 Called whenever we're legacy triggered by another object or function. More...
 
virtual int GetValue (entity)
 Returns what we will pass onto other's NSTrigger::GetMaster() calls if we're their master. More...
 
nonvirtual void UseTargets (entity, int, float)
 When called will trigger its legacy targets with a given delay. More...
 
nonvirtual void SetTriggerTarget (string)
 Sets the legacy target for this entity. More...
 
nonvirtual int GetMaster (entity)
 Returns whether our master allows us to be triggered. More...
 
nonvirtual globalstate_t GetGlobalValue (string)
 Returns the value of a given env_global property. More...
 
nonvirtual string GetTriggerTarget (void)
 Returns the name of the entity group it can trigger (legacy style). More...
 
nonvirtual entity GetTargetEntity (void)
 Returns the first entity named after the target field. More...
 
nonvirtual bool HasTriggerTarget (void)
 Returns TRUE if the entity has a legacy trigger target. More...
 
nonvirtual bool HasTargetname (void)
 Returns TRUE if the entity has a name that can be used for messaging. More...
 
nonvirtual void SetTeam (float)
 Assigns the entity to a given team value. More...
 
nonvirtual float GetTeam (void)
 Retrives the team value of a given entity. More...
 

Detailed Description

NSTrigger handles all the non-input as well as Legacy (Quake, GoldSource) style trigger behaviour.

It also deals with masters, touches, blocking and so on.

Constructor & Destructor Documentation

◆ NSTrigger()

void NSTrigger::NSTrigger ( void  )

Member Function Documentation

◆ Blocked()

void NSTrigger::Blocked ( entity  eBlocker)
virtual

Called whenever out movement is being blocked by an entity.

This is currently only relevant on entities that are of MOVETYPE_PUSH.

Reimplemented in func_button, func_door, func_door_rotating, func_rotating, func_tracktrain, and func_train.

◆ CanBeTriggeredBy()

bool NSTrigger::CanBeTriggeredBy ( entity  testEnt)
virtual

◆ EndTouch()

void NSTrigger::EndTouch ( entity  eToucher)
virtual

Called when we stopped touching the last touched entity.

Reimplemented in point_trigger, and trigger_multiple.

◆ GetGlobalValue()

globalstate_t NSTrigger::GetGlobalValue ( string  strName)

Returns the value of a given env_global property.

◆ GetMaster()

int NSTrigger::GetMaster ( entity  queryingEntity)

Returns whether our master allows us to be triggered.

The argument specifies who's requesting the info for the master. Required for game_team_master to verify against players.

◆ GetTargetEntity()

entity NSTrigger::GetTargetEntity ( void  )

Returns the first entity named after the target field.

◆ GetTeam()

float NSTrigger::GetTeam ( void  )

Retrives the team value of a given entity.

◆ GetTriggerTarget()

string NSTrigger::GetTriggerTarget ( void  )

Returns the name of the entity group it can trigger (legacy style).

◆ GetValue()

int NSTrigger::GetValue ( entity  queryingEntity)
virtual

Returns what we will pass onto other's NSTrigger::GetMaster() calls if we're their master.

Reimplemented in game_team_master, multisource, and NSBrushTrigger.

◆ HasTargetname()

bool NSTrigger::HasTargetname ( void  )

Returns TRUE if the entity has a name that can be used for messaging.

◆ HasTriggerTarget()

bool NSTrigger::HasTriggerTarget ( void  )

Returns TRUE if the entity has a legacy trigger target.

◆ Input()

◆ Respawn()

void NSTrigger::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 NSIO.

Reimplemented in env_particle, env_soundscape, infodecal, light_environment, prop_static, button_target, cycler, env_explosion, env_message, env_model, env_shooter, env_spark, func_breakable, func_brush, func_button, func_door, func_door_rotating, func_guntarget, func_healthcharger, func_monsterclip, func_mortar_field, func_pendulum, func_physbox, func_plat, func_platrot, func_pushable, func_recharge, func_rot_button, func_rotating, func_tank, func_tracktrain, func_train, func_traincontrols, func_wall_toggle, game_counter, game_counter_set, game_zone_player, info_node, info_node_air, infodecal, item_eyescanner, item_food, item_generic, item_healthcharger, item_recharge, light, logic_auto, logic_case, logic_relay, logic_timer, momentary_door, momentary_rot_button, monster_furniture, monster_generic, monstermaker, multi_manager, multisource, path_corner, path_track, phys_ballsocket, phys_constraint, phys_constraintsystem, phys_convert, phys_hinge, phys_keepupright, phys_slideconstraint, point_trigger, prop_door_rotating, prop_dynamic, prop_physics, prop_static, random_speaker, random_trigger, scripted_sequence, targ_speaker, target_cdaudio, trigger_auto, trigger_autosave, trigger_cdaudio, trigger_changelevel, trigger_counter, trigger_endsection, trigger_hurt, trigger_look, trigger_monsterjump, trigger_once, trigger_playerfreeze, trigger_relay, trigger_teleport, trigger_transition, ambient_generic, env_beam, env_bubbles, env_cascade_light, env_fog, env_fog_controller, env_funnel, env_glow, env_instructor_hint, env_laser, env_smoker, func_conveyor, func_friction, func_illusionary, func_ladder, func_lod, func_wall, logic_achievement, speaker, trigger_gravity, trigger_push, NSOutput, NSBrushTrigger, NSClientPlayer, NSEntity, NSItem, NSMonster, NSPhysicsEntity, NSPointTrigger, NSRenderableEntity, NSSpawnPoint, NSSurfacePropEntity, and NSTalkMonster.

◆ Restore()

void NSTrigger::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 NSIO.

Reimplemented in env_beverage, env_explosion, env_fade, env_global, env_hudhint, env_message, env_physexplosion, env_shake, env_shooter, env_spark, func_areaportal, func_breakable, func_brush, func_button, func_door, func_door_rotating, func_guntarget, func_healthcharger, func_mortar_field, func_pendulum, func_plat, func_platrot, func_pushable, func_recharge, func_rot_button, func_rotating, func_tank, func_trackchange, func_tracktrain, func_train, func_wall_toggle, game_counter, game_counter_set, game_player_equip, game_player_hurt, game_score, game_team_master, game_text, game_zone_player, info_hint, infodecal, item_food, item_generic, item_healthcharger, item_recharge, light, logic_auto, logic_case, logic_timer, momentary_rot_button, NSMomentary, monstermaker, multi_manager, path_corner, path_track, phys_convert, phys_hinge, phys_keepupright, phys_slideconstraint, player_loadsaved, point_camera, point_trigger, prop_door_rotating, random_speaker, random_trigger, scripted_sentence, scripted_sequence, targ_speaker, target_cdaudio, trigger_auto, trigger_autosave, trigger_cdaudio, trigger_changelevel, trigger_changetarget, trigger_counter, trigger_hurt, trigger_look, trigger_monsterjump, trigger_multiple, trigger_once, trigger_relay, trigger_teleport, ambient_generic, env_bubbles, env_cascade_light, env_fog, env_fog_controller, env_funnel, env_instructor_hint, env_muzzleflash, env_smoker, func_conveyor, info_waypoint, logic_achievement, speaker, trigger_gravity, trigger_push, worldspawn, NSClient, NSClientPlayer, NSClientSpectator, NSEntity, NSItem, NSMonster, NSMoverEntity, NSActor, NSPhysicsConstraint, NSPhysicsEntity, NSPointTrigger, NSProjectile, NSRenderableEntity, NSSoundScape, NSSquadMonster, NSSurfacePropEntity, NSTalkMonster, NSTimer, NSVehicle, and NSWeapon.

◆ Save()

void NSTrigger::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 NSIO.

Reimplemented in env_beverage, env_explosion, env_fade, env_global, env_hudhint, env_message, env_physexplosion, env_shake, env_shooter, env_spark, func_areaportal, func_breakable, func_brush, func_button, func_door, func_door_rotating, func_guntarget, func_healthcharger, func_mortar_field, func_pendulum, func_plat, func_platrot, func_pushable, func_recharge, func_rot_button, func_rotating, func_tank, func_trackchange, func_tracktrain, func_train, func_wall_toggle, game_counter, game_counter_set, game_player_equip, game_player_hurt, game_score, game_team_master, game_text, game_zone_player, info_hint, infodecal, item_food, item_generic, item_healthcharger, item_recharge, light, logic_auto, logic_case, logic_timer, momentary_rot_button, NSMomentary, monstermaker, multi_manager, path_corner, path_track, phys_convert, phys_hinge, phys_keepupright, phys_slideconstraint, player_loadsaved, point_camera, point_trigger, prop_door_rotating, random_speaker, random_trigger, scripted_sentence, scripted_sequence, targ_speaker, target_cdaudio, trigger_auto, trigger_autosave, trigger_cdaudio, trigger_changelevel, trigger_changetarget, trigger_counter, trigger_hurt, trigger_look, trigger_monsterjump, trigger_multiple, trigger_once, trigger_relay, trigger_teleport, ambient_generic, env_bubbles, env_cascade_light, env_fog, env_fog_controller, env_funnel, env_instructor_hint, env_muzzleflash, env_smoker, func_conveyor, info_waypoint, logic_achievement, speaker, trigger_gravity, trigger_push, worldspawn, NSClient, NSClientPlayer, NSClientSpectator, NSEntity, NSItem, NSMonster, NSMoverEntity, NSActor, NSPhysicsConstraint, NSPhysicsEntity, NSPointTrigger, NSProjectile, NSRenderableEntity, NSSoundScape, NSSquadMonster, NSSurfacePropEntity, NSTalkMonster, NSTimer, NSVehicle, and NSWeapon.

◆ SetTeam()

void NSTrigger::SetTeam ( float  new_team)

Assigns the entity to a given team value.

◆ SetTriggerTarget()

void NSTrigger::SetTriggerTarget ( string  name)

Sets the legacy target for this entity.

◆ SpawnKey()

void NSTrigger::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 NSIO.

Reimplemented in env_fire, NSInteractiveSurface, env_cubemap, env_particle, env_soundscape, env_sun, func_dustcloud, func_dustmotes, func_smokevolume, infodecal, light_environment, point_message, prop_static, sky_camera, env_beverage, env_explosion, env_fade, env_global, env_hudhint, env_message, env_model, env_physexplosion, env_shake, env_shooter, env_sound, env_spark, func_areaportal, func_breakable, func_brush, func_button, func_door, func_door_rotating, func_guntarget, func_healthcharger, func_mortar_field, func_pendulum, func_physbox, func_plat, func_platrot, func_pushable, func_recharge, func_rot_button, func_rotating, func_tank, func_trackchange, func_tracktrain, func_train, game_counter, game_counter_set, game_player_equip, game_player_hurt, game_score, game_team_master, game_text, game_zone_player, info_hint, infodecal, item_eyescanner, item_generic, item_healthcharger, item_recharge, light, light_environment, logic_auto, logic_case, logic_relay, logic_timer, momentary_door, momentary_rot_button, monster_furniture, monstermaker, multi_manager, path_corner, path_track, phys_convert, phys_hinge, phys_keepupright, phys_slideconstraint, player_loadsaved, point_camera, point_trigger, prop_door_rotating, prop_dynamic, prop_physics, random_speaker, random_trigger, scripted_sentence, scripted_sequence, targ_speaker, target_cdaudio, trigger_auto, trigger_cdaudio, trigger_changelevel, trigger_changetarget, trigger_counter, trigger_hurt, trigger_look, trigger_monsterjump, trigger_multiple, trigger_once, trigger_relay, trigger_teleport, ambient_generic, env_beam, env_bubbles, env_cascade_light, env_fog, env_fog_controller, env_funnel, env_glow, env_instructor_hint, env_laser, env_muzzleflash, env_shockwave, env_smoker, env_sprite, func_conveyor, func_friction, func_lod, info_waypoint, light_dynamic, logic_achievement, speaker, trigger_gravity, trigger_push, worldspawn, NSEntity, NSItem, NSMonster, NSMoverEntity, NSPhysicsConstraint, NSPhysicsEntity, NSPointTrigger, NSProjectile, NSRenderableEntity, NSSoundScape, NSSpawnPoint, NSSquadMonster, NSSurfacePropEntity, NSTalkMonster, and NSWeapon.

◆ StartTouch()

void NSTrigger::StartTouch ( entity  eToucher)
virtual

Called when we started touching another entity.

◆ Touch()

◆ Trigger()

◆ UseTargets()

void NSTrigger::UseTargets ( entity  act,
int  state,
float  triggerDelay 
)

When called will trigger its legacy targets with a given delay.


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