Nuclide
Software Development Kit for id Tech
NSIO Class Reference

This class is responsible for handling core entity functionality. More...

#include <NSIO.h>

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

Public Member Functions

virtual void Spawned (void)
 Called when the entity is fulled initialized. 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 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 ::SpawnKey but for save-game fields. More...
 
virtual void RestoreComplete (void)
 Called when the entity has been successfully restored from a savegame file. More...
 
virtual void TransitionComplete (void)
 Called when the entity has successfully completed a level transition. More...
 
virtual void Input (entity, string, string)
 Called when we are being prompted by another object/function with an input message. More...
 
nonvirtual void UseOutput (entity, string)
 Triggers an output field that has been created beforehand. More...
 
nonvirtual string PrepareOutput (string, string)
 Prepares an output field. More...
 
nonvirtual string CreateOutput (string)
 Called at the end of setting up an entity's output field. More...
 
nonvirtual bool CheckOutput (string)
 Returns whether the Output is ready, or has done firing - not currently scheduled to fire, etc. More...
 
virtual void ParentUpdate (void)
 Called when we need to re-align the entity to our parent entity. More...
 
nonvirtual void SaveFloat (float, string, float)
 Saves a floating point key/value pair to a filehandle. More...
 
nonvirtual void SaveInt (float, string, int)
 Saves a integer key/value pair to a filehandle. More...
 
nonvirtual void SaveString (float, string, string)
 Saves a string key/value pair to a filehandle. More...
 
nonvirtual void SaveVector (float, string, vector)
 Saves a vector key/value pair to a filehandle. More...
 
nonvirtual void SaveBool (float, string, bool)
 Saves a boolean key/value pair to a filehandle. More...
 
nonvirtual void SaveEntity (float, string, entity)
 Saves an entity id key/value pair to a filehandle. More...
 
nonvirtual float ReadFloat (string)
 reads a floating point value from a string More...
 
nonvirtual int ReadInt (string)
 reads an integer value from a string More...
 
nonvirtual string ReadString (string)
 reads a string value from a string (with error checking) More...
 
nonvirtual vector ReadVector (string)
 reads a vector from a string More...
 
nonvirtual bool ReadBool (string)
 reads a boolean value from a string More...
 
nonvirtual entity ReadEntity (string)
 read an entity id, converted to entity, from a string More...
 
nonvirtual float GetTime (void)
 Get the level time the entity finds itself in. More...
 

Detailed Description

This class is responsible for handling core entity functionality.

It handles entity spawns, respawns, save/load as well as key/value pair loading, as well as inputs/outputs which is our basic entity model.

This is a very low-level class. You're never meant to use this. Use NSEntity as a basis for your classes.

Member Function Documentation

◆ CheckOutput()

bool NSIO::CheckOutput ( string  strOut)

Returns whether the Output is ready, or has done firing - not currently scheduled to fire, etc.

Input is the identifier of an output.

◆ CreateOutput()

string NSIO::CreateOutput ( string  outmsg)

Called at the end of setting up an entity's output field.

The input is a 5 parameter, commar separated string. The return value is the targetname of a minion object that'll handle the triggering (and counting down of uses) as defined in the Source Engine's Input/Output specification.

◆ GetTime()

float NSIO::GetTime ( void  )

Get the level time the entity finds itself in.

Always use this instead of the time global. The time global may not be valid on every type of entity. Specifically, MOVETYPE_PUSH entities only update upon movement (so that any think timers the entity may have are not triggered when it is at rest.

◆ Input()

◆ ParentUpdate()

void NSIO::ParentUpdate ( void  )
virtual

Called when we need to re-align the entity to our parent entity.

Reimplemented in NSEntity, and NSSurfacePropEntity.

◆ PrepareOutput()

string NSIO::PrepareOutput ( string  strOut,
string  strValue 
)

Prepares an output field.

Commonly used within ::SpawnKey() to prepare output fields. For example: m_someOutput = PrepareOutput(m_someOutput, strValue);` This will ensure that when an entity wants to trigger multiple outputs that those can be called with a single UseOutput call.

◆ ReadBool()

bool NSIO::ReadBool ( string  strValue)

reads a boolean value from a string

◆ ReadEntity()

entity NSIO::ReadEntity ( string  strValue)

read an entity id, converted to entity, from a string

◆ ReadFloat()

float NSIO::ReadFloat ( string  strValue)

reads a floating point value from a string

◆ ReadInt()

int NSIO::ReadInt ( string  strValue)

reads an integer value from a string

◆ ReadString()

string NSIO::ReadString ( string  strValue)

reads a string value from a string (with error checking)

◆ ReadVector()

vector NSIO::ReadVector ( string  strValue)

reads a vector from a string

◆ Respawn()

void NSIO::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 in env_particle, env_sound, env_soundscape, infodecal, light_environment, prop_static, button_target, cycler, env_explosion, env_message, env_model, env_physexplosion, env_shooter, env_spark, func_breakable, func_brush, func_button, func_door, func_door_rotating, func_guntarget, func_healthcharger, func_lod, 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_tankcontrols, func_tracktrain, func_train, func_traincontrols, func_wall_toggle, game_counter, game_counter_set, game_zone_player, info_node, info_node_air, infodecal, item_food, item_generic, 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_camera, 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_multiple, 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_wall, logic_achievement, prop_physics_multiplayer, speaker, trigger_gravity, trigger_push, NSOutput, NSClientPlayer, NSEntity, NSItem, NSMonster, NSPhysicsEntity, NSPointTrigger, NSRenderableEntity, NSSpawnPoint, NSSurfacePropEntity, NSTalkMonster, NSTrigger, and NSPMoveVars.

◆ Restore()

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

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

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

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, light, logic_auto, logic_case, logic_timer, momentary_rot_button, NSMomentary, monstermaker, multi_manager_sub, 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, NSGameRules, NSTraceAttack, NSClient, NSClientPlayer, NSClientSpectator, NSEntity, NSItem, NSMonster, NSMoverEntity, NSNavAI, NSPhysicsConstraint, NSPhysicsEntity, NSPointTrigger, NSProjectile, NSRenderableEntity, NSSquadMonster, NSSurfacePropEntity, NSTalkMonster, NSTimer, NSTrigger, NSVehicle, and NSWeapon.

◆ RestoreComplete()

void NSIO::RestoreComplete ( void  )
virtual

Called when the entity has been successfully restored from a savegame file.

Reimplemented in light, logic_auto, trigger_auto, trigger_changelevel, NSGameRules, NSTraceAttack, and NSNavAI.

◆ Save()

void NSIO::Save ( float  handle)
virtual

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

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

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, light, logic_auto, logic_case, logic_timer, momentary_rot_button, NSMomentary, monstermaker, multi_manager_sub, 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, NSGameRules, NSTraceAttack, NSClient, NSClientPlayer, NSClientSpectator, NSEntity, NSItem, NSMonster, NSMoverEntity, NSNavAI, NSPhysicsConstraint, NSPhysicsEntity, NSPointTrigger, NSProjectile, NSRenderableEntity, NSSquadMonster, NSSurfacePropEntity, NSTalkMonster, NSTimer, NSTrigger, NSVehicle, and NSWeapon.

◆ SaveBool()

void NSIO::SaveBool ( float  handle,
string  key,
bool  value 
)

Saves a boolean key/value pair to a filehandle.

◆ SaveEntity()

void NSIO::SaveEntity ( float  handle,
string  key,
entity  targ 
)

Saves an entity id key/value pair to a filehandle.

◆ SaveFloat()

void NSIO::SaveFloat ( float  handle,
string  key,
float  value 
)

Saves a floating point key/value pair to a filehandle.

◆ SaveInt()

void NSIO::SaveInt ( float  handle,
string  key,
int  value 
)

Saves a integer key/value pair to a filehandle.

◆ SaveString()

void NSIO::SaveString ( float  handle,
string  key,
string  value 
)

Saves a string key/value pair to a filehandle.

◆ SaveVector()

void NSIO::SaveVector ( float  handle,
string  key,
vector  value 
)

Saves a vector key/value pair to a filehandle.

◆ Spawned()

◆ SpawnKey()

void NSIO::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 in env_fire, NSInteractiveSurface, env_cubemap, env_particle, env_sound, env_soundscape, env_sun, func_dustcloud, func_dustmotes, func_lod, 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_spark, func_areaportal, func_breakable, func_brush, func_button, func_door, func_door_rotating, func_guntarget, func_healthcharger, func_lod, 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_generic, light, logic_auto, logic_case, logic_relay, logic_timer, momentary_door, momentary_rot_button, 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, info_waypoint, light_dynamic, logic_achievement, prop_physics_multiplayer, speaker, trigger_gravity, trigger_push, worldspawn, NSEntity, NSItem, NSMonster, NSMoverEntity, NSPhysicsConstraint, NSPhysicsEntity, NSPointTrigger, NSProjectile, NSRenderableEntity, NSSpawnPoint, NSSquadMonster, NSSurfacePropEntity, NSTalkMonster, and NSTrigger.

◆ TransitionComplete()

void NSIO::TransitionComplete ( void  )
virtual

Called when the entity has successfully completed a level transition.

Reimplemented in func_tracktrain.

◆ UseOutput()

void NSIO::UseOutput ( entity  act,
string  outname 
)

Triggers an output field that has been created beforehand.


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