![]() |
Nuclide
Software Development Kit for id Technology (BETA)
|
ncTrigger handles all the non-input as well as Legacy (Quake, GoldSource) style trigger behaviour.
It also deals with masters, touches, blocking and so on.
When an entity sets a 'master', it will only activate (which often includes firing its targets) when their specified 'master' itself returns a positive state.
The state can be set with SetValue() and is queried with GetValue().
Public Member Functions | |
void | ncTrigger (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 ncIO::SpawnKey() but for save-game fields. More... | |
virtual void | Spawned (void) |
Called when the entity is fulled initialized. More... | |
virtual void | Input (entity, string, string) |
Called when we are being prompted by another object/function with an input message. More... | |
nonvirtual void | SetValue (int newValue) |
Sets the internal value of the entity as queried by GetValue(). 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 ncTrigger::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 bool | TriggerEnabled (void) |
Returns whether the trigger functionality of this entity is enabled. More... | |
nonvirtual void | EnableTrigger (void) |
nonvirtual void | DisableTrigger (void) |
nonvirtual void | ToggleTrigger (void) |
nonvirtual globalstate_t | GetGlobalValue (string) |
Returns the value of a given env_global property. More... | |
nonvirtual string | GetTriggerMessage (void) |
Returns the message which will be displayed upon trigger. More... | |
nonvirtual string | GetTriggerKillTarget (void) |
Returns the name of the entity group it will remove from the game upon trigger. More... | |
nonvirtual string | GetTriggerTarget (void) |
Returns the name of the entity group it can trigger (legacy style). More... | |
nonvirtual float | GetTriggerDelay (void) |
Returns the time until this triggers is scheduled to fire its targets, relative time in seconds. 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... | |
nonvirtual vector | GetTouchPosition (void) |
Returns the last valid point the entity has touched. More... | |
nonvirtual vector | GetTouchNormal (void) |
Returns the normal of the last valid surface the entity has touched. More... | |
void ncTrigger::ncTrigger | ( | void | ) |
|
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.
|
virtual |
void ncTrigger::DisableTrigger | ( | void | ) |
void ncTrigger::EnableTrigger | ( | void | ) |
|
virtual |
Called when we stopped touching the last touched entity.
Reimplemented in point_trigger, and trigger_multiple.
globalstate_t ncTrigger::GetGlobalValue | ( | string | strName | ) |
Returns the value of a given env_global property.
int ncTrigger::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.
entity ncTrigger::GetTargetEntity | ( | void | ) |
Returns the first entity named after the target field.
float ncTrigger::GetTeam | ( | void | ) |
Retrives the team value of a given entity.
vector ncTrigger::GetTouchNormal | ( | void | ) |
Returns the normal of the last valid surface the entity has touched.
vector ncTrigger::GetTouchPosition | ( | void | ) |
Returns the last valid point the entity has touched.
float ncTrigger::GetTriggerDelay | ( | void | ) |
Returns the time until this triggers is scheduled to fire its targets, relative time in seconds.
string ncTrigger::GetTriggerKillTarget | ( | void | ) |
Returns the name of the entity group it will remove from the game upon trigger.
string ncTrigger::GetTriggerMessage | ( | void | ) |
Returns the message which will be displayed upon trigger.
string ncTrigger::GetTriggerTarget | ( | void | ) |
Returns the name of the entity group it can trigger (legacy style).
|
virtual |
Returns what we will pass onto other's ncTrigger::GetMaster()
calls if we're their master.
Reimplemented in game_team_master, multisource, and ncBrushTrigger.
bool ncTrigger::HasTargetname | ( | void | ) |
Returns TRUE if the entity has a name that can be used for messaging.
bool ncTrigger::HasTriggerTarget | ( | void | ) |
Returns TRUE if the entity has a legacy trigger target.
|
virtual |
Called when we are being prompted by another object/function with an input message.
Reimplemented from ncIO.
Reimplemented in env_explosion, env_fade, env_physexplosion, env_shake, env_shooter, env_spark, func_areaportal, func_door, func_door_rotating, func_guntarget, func_plat, func_tracktrain, func_wall_toggle, game_team_master, game_text, light, logic_case, logic_relay, logic_timer, path_track, phys_convert, phys_hinge, phys_keepupright, phys_slideconstraint, point_camera, point_servercommand, point_trigger, prop_portal, scripted_sentence, trigger_changelevel, trigger_hurt, trigger_multiple, trigger_once, ambient_generic, env_beam, env_bubbles, env_cascade_light, env_fog_controller, env_funnel, env_hudcounter, env_instructor_hint, env_muzzleflash, env_projectedtexture, env_smoker, env_sprite, func_conveyor, func_monitor, info_particle_system, info_waypoint, light_dynamic, logic_achievement, point_spotlight, trigger_camera, ncActor, ncEntity, ncItem, ncMonster, ncPhysicsConstraint, ncPlayer, ncRenderableEntity, ncSoundScape, ncSquadMonster, ncSurfacePropEntity, and ncTalkMonster.
|
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 ncIO.
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_helper, 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, ncMomentary, 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_endround, 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_hudcounter, env_instructor_hint, env_muzzleflash, env_smoker, func_conveyor, func_vehicle, info_waypoint, logic_achievement, phys_rope, prop_rope, speaker, trigger_camera, trigger_gravity, trigger_push, ncWorldSpawn, ncHint, ncActor, ncCharger, ncClient, ncEntity, ncItem, ncMonster, ncMoverEntity, ncPhysicsConstraint, ncPhysicsEntity, ncPlayer, ncPMoveVars, ncProjectile, ncRenderableEntity, ncSoundScape, ncSpectator, ncSquadMonster, ncSurfacePropEntity, ncTalkMonster, ncTimer, ncVehicle, and ncWeapon.
|
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 ncIO.
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_helper, 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, ncMomentary, 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_endround, 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_hudcounter, env_instructor_hint, env_muzzleflash, env_smoker, func_conveyor, func_vehicle, info_waypoint, logic_achievement, phys_rope, prop_rope, speaker, trigger_camera, trigger_gravity, trigger_push, ncWorldSpawn, ncHint, ncActor, ncCharger, ncClient, ncEntity, ncItem, ncMonster, ncMoverEntity, ncPhysicsConstraint, ncPhysicsEntity, ncPlayer, ncPMoveVars, ncProjectile, ncRenderableEntity, ncSoundScape, ncSpectator, ncSquadMonster, ncSurfacePropEntity, ncTalkMonster, ncTimer, ncVehicle, and ncWeapon.
void ncTrigger::SetTeam | ( | float | new_team | ) |
Assigns the entity to a given team value.
void ncTrigger::SetTriggerTarget | ( | string | name | ) |
Sets the legacy target for this entity.
void ncTrigger::SetValue | ( | int | newValue | ) |
Sets the internal value of the entity as queried by GetValue().
This is used to to communicate whether or not the entity will permit triggers to fire that have this entity set as their 'master'. See the section regarding 'masters' for details.
|
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 ncIO.
Reimplemented in ncInteractiveSurface, env_sun, func_dustcloud, func_dustmotes, func_smokevolume, infodecal, prop_static, cycler_wreckage, env_explosion, env_global, env_spark, func_areaportal, func_breakable, func_button, func_door, func_door_rotating, func_guntarget, func_plat, func_pushable, func_trackchange, func_tracktrain, func_train, gibshooter, info_hint, infodecal, light, light_environment, logic_auto, logic_case, logic_timer, multi_manager, path_corner, phys_convert, point_trigger, scripted_sentence, trigger_autosave, trigger_changelevel, trigger_hurt, trigger_look, trigger_multiple, trigger_once, trigger_teleport, ambient_generic, env_fog, env_shockwave, env_sprite, func_lod, func_tankmortar, func_vehicle, logic_achievement, prop_vehicle_driveable, speaker, ncWorldSpawn, ncHint, ncActor, ncCharger, ncEntity, ncItem, ncMonster, ncPhysicsConstraint, ncPhysicsEntity, ncPlayer, ncProjectile, ncSound, ncSquadMonster, ncSurfacePropEntity, and ncWeapon.
|
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 ncIO.
Reimplemented in ncInteractiveSurface, env_cubemap, env_particle, env_soundscape, env_sun, func_dustcloud, func_dustmotes, func_smokevolume, infodecal, light_environment, point_message, prop_static, sky_camera, 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, prop_portal, random_speaker, random_trigger, scripted_sentence, scripted_sequence, targ_speaker, target_cdaudio, target_speaker, trigger_auto, trigger_cdaudio, trigger_changelevel, trigger_changetarget, trigger_counter, trigger_endround, trigger_hurt, trigger_look, trigger_monsterjump, trigger_multiple, trigger_once, trigger_relay, trigger_teleport, ambient_generic, env_beam, env_bubbles, env_cascade_light, env_fire, env_fog, env_fog_controller, env_funnel, env_glow, env_hudcounter, env_instructor_hint, env_laser, env_muzzleflash, env_projectedtexture, env_shockwave, env_smoker, env_sprite, func_conveyor, func_friction, func_lod, func_monitor, func_tankmortar, func_useableladder, func_vehicle, info_particle_system, info_waypoint, light_dynamic, logic_achievement, phys_rope, point_spotlight, prop_rope, speaker, trigger_camera, trigger_gravity, trigger_push, ncWorldSpawn, ncHint, ncCaptureItem, ncActor, ncCharger, ncEntity, ncItem, ncMonster, ncMoverEntity, ncPhysicsConstraint, ncPhysicsEntity, ncProjectile, ncRenderableEntity, ncSoundScape, ncSquadMonster, ncSurfacePropEntity, ncTalkMonster, and ncWeapon.
|
virtual |
Called when we started touching another entity.
void ncTrigger::ToggleTrigger | ( | void | ) |
|
virtual |
Called whenever we're touching another entity.
Reimplemented in func_breakable, func_button, func_door, func_door_rotating, func_plat_helper, func_pushable, func_rot_button, func_rotating, item_food, point_trigger, scripted_sequence, target_cdaudio, trigger_autosave, trigger_cdaudio, trigger_changelevel, trigger_counter, trigger_endround, trigger_hurt, trigger_look, trigger_monsterjump, trigger_multiple, trigger_once, trigger_teleport, func_conveyor, func_friction, trigger_gravity, trigger_push, ncCaptureItem, ncCapturePoint, ncDebris, ncItem, ncMonster, ncPhysicsEntity, ncProjectile, and ncTalkMonster.
|
virtual |
Called whenever we're legacy triggered by another object or function.
Reimplemented in button_target, env_beverage, env_explosion, env_fade, env_global, env_hudhint, env_model, env_render, env_shake, env_shooter, env_spark, func_areaportal, func_breakable, func_brush, func_button, func_door, func_door_rotating, func_guntarget, func_mortar_field, func_pendulum, func_plat, func_platrot, func_rotating, func_tracktrain, func_train, func_wall_toggle, game_counter, game_counter_set, game_end, game_player_equip, game_player_hurt, game_player_team, game_score, game_team_master, game_team_set, game_text, game_zone_player, infodecal, item_eyescanner, light, monstermaker, multi_manager, multisource, path_corner, path_track, player_loadsaved, player_weaponstrip, point_trigger, random_speaker, random_trigger, script_brushmodel, script_model, script_origin, script_struct, script_vehicle, scripted_sentence, scripted_sequence, targ_speaker, trigger_cdaudio, trigger_changelevel, trigger_changetarget, trigger_counter, trigger_endround, trigger_endsection, trigger_hurt, trigger_playerfreeze, trigger_relay, env_beam, env_bubbles, env_cascade_light, env_fog, env_fog_controller, env_funnel, env_hudcounter, env_instructor_hint, env_laser, env_muzzleflash, env_projectedtexture, env_shockwave, env_smoker, env_sprite, func_conveyor, func_illusionary, func_ladder, func_monitor, func_useableladder, func_wall, info_particle_system, info_waypoint, light_dynamic, logic_achievement, point_spotlight, speaker, trigger_camera, trigger_push, ncMonster, and ncProjectile.
bool ncTrigger::TriggerEnabled | ( | void | ) |
Returns whether the trigger functionality of this entity is enabled.
void ncTrigger::UseTargets | ( | entity | act, |
int | state, | ||
float | triggerDelay | ||
) |
When called will trigger its legacy targets with a given delay.