Nuclide
Software Development Kit for id Tech
|
NSEntity is the lowest of the user-accessible entity class. More...
#include <NSEntity.h>
Public Member Functions | |
void | NSEntity (void) |
The constructor. More... | |
virtual void | ReceiveEntity (float, float) |
Client: Handles network updates from the server for the associated entity. More... | |
virtual void | ReceiveEvent (float) |
virtual float | predraw (void) |
virtual void | postdraw (void) |
Client: Run after the rendering of 3D world is complete. More... | |
virtual void | RendererRestarted (void) |
Client: Called when video resources need to be allocated or reloaded for the entity. More... | |
virtual void | SpawnKey (string, string) |
This method handles entity key/value pairs on map load. More... | |
virtual void | Spawned (void) |
Called when the entity is fulled initialized. More... | |
virtual void | OnRemoveEntity (void) |
Handles what happens before the entity gets removed from the client game. More... | |
virtual void | MakeStatic (void) |
Tells the engine to make the entity static, effectively making it inaccessible. More... | |
virtual bool | CanSpawn (bool clientSide) |
Returns if this entity can spawned from the map file. 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 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 | ParentUpdate (void) |
Called when we need to re-align the entity to our parent entity. More... | |
virtual void | DebugDraw (void) |
virtual void | EvaluateEntity (void) |
Run each tic after physics are run to determine if we need to send updates over the network. More... | |
virtual float | SendEntity (entity, float) |
Called by the engine whenever we need to send a client an update about this entity. More... | |
nonvirtual entity | GetParent (void) |
Returns the entity this is parented to. More... | |
nonvirtual void | SetParent (string) |
Call this to parent the entity to another entity. More... | |
nonvirtual void | SetParentAttachment (string) |
Call this to parent the entity to an attachment of another entity. More... | |
nonvirtual void | ClearParent (void) |
Call this on an entity to remove the connection to its parent. More... | |
nonvirtual void | RestoreAngles (void) |
Restore the entity's angles to the value the spawndata contains. More... | |
nonvirtual void | ClearAngles (void) |
Unsets any any angle related values within the entity. More... | |
nonvirtual void | UseBy (entity) |
Simulates the press of the use/activate key, with the passed entity being the activator. More... | |
nonvirtual void | ForceNetworkUpdate (void) |
Forces the entity to re-network updates to all clients. More... | |
nonvirtual void | SetEffects (float) |
Sets the whole effects field. More... | |
nonvirtual void | AddEffects (effects_t) |
Appends one or more effects to the entity. More... | |
nonvirtual void | RemoveEffects (effects_t) |
Removes one or more effects from the entity. More... | |
nonvirtual void | SetFrame (float) |
Sets the framegroup sequence of the entity. More... | |
nonvirtual void | SetSkin (float) |
Sets the skingroup of the entity. More... | |
nonvirtual void | SetScale (float) |
Sets the scale of the entity. More... | |
nonvirtual void | SetOwner (entity) |
Sets the owner of the entity. More... | |
nonvirtual void | SetVelocity (vector) |
Sets the movement velocity of the given entity. More... | |
nonvirtual void | AddAngularVelocity (vector) |
Adds onto the existing angular velocity. More... | |
nonvirtual void | AddVelocity (vector) |
Adds onto the existing velocity. More... | |
nonvirtual void | SetTouch (void()) |
Overrides the touch function of a the entity to the specified function. More... | |
nonvirtual void | SetSendFlags (float) |
Overrides the field that's used to determine which information should be networked. More... | |
nonvirtual void | SetSolid (float) |
Sets the collision type of the entity. More... | |
virtual void | SetModel (string) |
Sets the 3D model representation of the entity from a file path and name. More... | |
nonvirtual void | SetModelindex (float) |
Sets the 3D model representation of the entity from an already precached resource id. More... | |
nonvirtual void | SetMovetype (float) |
Sets the movement type of the entity. More... | |
nonvirtual void | SetGravity (float) |
Sets the gravitational modifier of the entity. More... | |
nonvirtual void | SetAngles (vector) |
Sets the direction the entity is facing in eueler angles. More... | |
nonvirtual void | SetAngularVelocity (vector) |
Sets the angular velocity of the entity in degrees per second on each axis. More... | |
nonvirtual void | SetOrigin (vector) |
Sets the absolute 3D world position of the entity. More... | |
nonvirtual void | SetOriginUnstick (vector) |
Same as SetOrigin(), but will push the entity out the ground if needed. More... | |
nonvirtual void | SetSize (vector, vector) |
Sets the bounding box size of the entity. More... | |
nonvirtual void | AddFlags (float) |
Adds one or more engine specific flags to the entity. More... | |
nonvirtual void | RemoveFlags (float) |
Remove one or more engine specific flags from the entity. More... | |
nonvirtual void | AddVFlags (float) |
Adds one or more nuclide specific flags to the entity. More... | |
nonvirtual void | RemoveVFlags (float) |
Remove one or more nuclide specific flags from the entity. More... | |
nonvirtual void | TurnTo (float) |
Turns to the specified angle. More... | |
nonvirtual void | TurnToPos (vector) |
Turns towards the specified position. More... | |
nonvirtual void | SetThink (void()) |
Overrides the Think function of the entity. More... | |
nonvirtual void | SetNextThink (float) |
Sets the next think timer of the entity. More... | |
nonvirtual void | ScheduleThink (void(void), float) |
Schedules a think timer. More... | |
nonvirtual float | GetEffects (void) |
Returns a bitfield of the active effects running on the entity. More... | |
nonvirtual float | GetFrame (void) |
Returns the currently active framegroup of the entity. More... | |
nonvirtual float | GetSkin (void) |
Returns the currently equipped skin of the entity. More... | |
nonvirtual float | GetScale (void) |
Returns the scale modifier of the entity. More... | |
nonvirtual entity | GetOwner (void) |
Returns the owner of the entity. More... | |
nonvirtual vector | GetVelocity (void) |
Returns the movement velocity of the entity. More... | |
nonvirtual float | GetSolid (void) |
Returns the collision type of the entity. More... | |
nonvirtual string | GetModel (void) |
Returns the name of the 3D model representation of the entity. More... | |
nonvirtual float | GetModelindex (void) |
Returns the model id of the 3D model representation of the entity. More... | |
nonvirtual float | GetMovetype (void) |
Returns the movement type of the entity. More... | |
nonvirtual float | GetGravity (void) |
Returns the gravity modifier of the entity. More... | |
nonvirtual vector | GetAngles (void) |
Returns the direction the entity is facing in euler angles. More... | |
nonvirtual vector | GetAngularVelocity (void) |
Returns the direction the entity is spinning in degrees per second for each axis. More... | |
nonvirtual vector | GetOrigin (void) |
Returns the absolute world position of the entity. More... | |
nonvirtual vector | GetMins (void) |
Returns the bounding box mins of the entity. More... | |
nonvirtual vector | GetMaxs (void) |
Returns the bounding box maxs of the entity. More... | |
nonvirtual vector | GetRealMins (void) |
Returns the actual bounding box mins of the entity, before having been affected by scale modifiers. More... | |
nonvirtual vector | GetRealMaxs (void) |
Returns the actual bounding box maxs of the entity, before having been affected by scale modifiers. More... | |
nonvirtual vector | GetAbsoluteMins (void) |
Returns the absolute bounding box mins of the entity, instead of being relative to the world position. More... | |
nonvirtual vector | GetAbsoluteMaxs (void) |
Returns the absolute bounding box maxs of the entity, instead of being relative to the world position. More... | |
nonvirtual float | GetFlags (void) |
Returns an engine flags bitfield that the entity associates with. More... | |
nonvirtual float | HasFlags (float) |
Returns true if the entity has the specified engine flags. More... | |
nonvirtual float | GetVFlags (void) |
Returns a nuclide flags bitfield that the entity associates with. More... | |
nonvirtual float | HasVFlags (float) |
Returns true if the entity has the specified, nuclide specific, flags. More... | |
nonvirtual float | GetNextThinkTime (void) |
Returns an absolute value of when the entity will be think again. More... | |
nonvirtual bool | IsThinking (void) |
Returns whether or not we're currently expecting to think any time soon. More... | |
nonvirtual void | ReleaseThink (void) |
When called, will unset anything related to ongoing think operations. More... | |
nonvirtual void | ThinkBusy (float) |
When called, will make the entity think busy for the specified amount of time. More... | |
nonvirtual void | ClearVelocity (void) |
When called, will clear anything related to physical movement on the entity. More... | |
nonvirtual vector | GetEyePos (void) |
Returns the absolute world position of where the eyes are located. More... | |
nonvirtual void | SetEyePos (vector) |
Sets the relative position of the eyes. More... | |
nonvirtual vector | GetViewAngle (void) |
Returns an euler angle of where the entity is 'looking' at. More... | |
nonvirtual void | Show (void) |
When called, will unhide the entity. More... | |
nonvirtual void | Hide (void) |
When called, the entity will stop being rendered on the client. More... | |
nonvirtual bool | IsHidden (void) |
Returns if the entity is currently being hidden explicitly. More... | |
nonvirtual bool | IsSolid (void) |
Returns if the entity is solid or non-solid. More... | |
nonvirtual void | Disappear (void) |
When called it'll make the entity uninteractable (but not destroy it). More... | |
nonvirtual void | Destroy (void) |
When called, will remove the entity from the game entirely. More... | |
nonvirtual void | UpdateBounds (void) |
Call this if you want to update bounding boxes to take angles into account. More... | |
nonvirtual float | EntIndex (void) |
Returns the unique entity id of the entity. More... | |
nonvirtual bool | DropToFloor (void) |
When called, will drop the entity down onto the surface it's hovering over. More... | |
nonvirtual vector | GetForward (void) |
Returns a normalized forward vector of the entity to more easily test which way it's facing. More... | |
nonvirtual vector | GetRight (void) |
Returns a normalized right vector of the entity to more easily test what's right next to it. More... | |
nonvirtual vector | GetUp (void) |
Returns a normalized up vector of the entity to more easily test what may be above it. More... | |
nonvirtual vector | WorldSpaceCenter (void) |
Returns absolute world coordinates of the center of the entity according to its pivot point. More... | |
nonvirtual float | WaterLevel (void) |
Returns the water level the entity is in. More... | |
nonvirtual bool | Visible (entity) |
Returns if the entity is visible by another entity and a field of view of 90 degrees. More... | |
nonvirtual bool | VisibleVec (vector) |
Returns if the entity is visible from a given position and a field of view of 90 degrees. More... | |
nonvirtual float | DistanceFromYaw (vector) |
Returns a normalized value of how far away the target is from the entity's view direction. More... | |
nonvirtual bool | HasSpawnFlags (float) |
Returns if the entity has any spawnflags set. More... | |
nonvirtual bool | IsOnGround (void) |
Returns if the entity is aligned to the ground. More... | |
nonvirtual entity | GetGroundEntity (void) |
Returns the entity we're standing on. More... | |
nonvirtual bool | CreatedByMap (void) |
Returns if the entity was spawned by the map we're on. More... | |
nonvirtual bool | WithinBounds (entity) |
Returns whether or not we are fully within the bounds of a given entity. More... | |
nonvirtual bool | IntersectsWith (entity) |
Returns whether or not the given entity insersects with us. More... | |
nonvirtual bool | StartSound (string, float, float, bool) |
Plays a sound sample directly onto the entity. More... | |
nonvirtual bool | StartSoundDef (string, float, bool) |
Plays a soundDef on the entity. More... | |
nonvirtual void | StopSound (float, bool) |
Stops a sound sample or soundDef that is playing on the given channel. More... | |
nonvirtual vector | NearestWallPointForRadius (float) |
Returns the nearest point on a wall of this entity within a specified radius. More... | |
nonvirtual void | HandleThink (void) |
For physics functions only. More... | |
nonvirtual bool | IsFacing (entity) |
Returns either true or false depending on if this entity is facing the entity in question. More... | |
nonvirtual bool | IsFacingPosition (vector) |
Returns either true or false depending on if this entity is facing a position in question. More... | |
nonvirtual float | GetSpawnAge (void) |
Returns the time that's passed since the entity has been spawned. More... | |
nonvirtual float | GetSpawnTime (void) |
Returns the absolute timestamp of when the entity had been spawned. More... | |
nonvirtual void | Transport (vector, vector) |
Move the entity to a new position, with updated angles. More... | |
nonvirtual void | Relink (void) |
Relink the entity against the world. More... | |
nonvirtual vector | GetNearbySpot (void) |
Finds a free spot of an entity near itself of same size. More... | |
nonvirtual int | GetSharedID (void) |
Returns a unique id between shared entities. More... | |
virtual bool | AttackByDef (string, bool) |
Will read from the named def to perform an attack. More... | |
nonvirtual void | SetBotTag (botInfo_t) |
Sets the Info Tags tag on this entity to the desired botInfo_t tag. More... | |
NSEntity is the lowest of the user-accessible entity class.
It's responsible for handling practically every entity in Nuclide.
Try to avoid using the built-in 'entity' type unless you know exactly what you are doing. Otherwise, you will deal with loss of savegames and much more.
The constructor.
Not much may be known of what the entity will be just yet.
void NSEntity::AddAngularVelocity | ( | vector | addVel | ) |
Adds onto the existing angular velocity.
Appends one or more effects to the entity.
Check the effects_t enum for available effects.
void NSEntity::AddVelocity | ( | vector | addVel | ) |
Adds onto the existing velocity.
|
virtual |
Will read from the named def to perform an attack.
|
virtual |
Returns if this entity can spawned from the map file.
clientSide | If it's being spawned on the client-side. |
Reimplemented in NSInteractiveSurface, env_cubemap, env_particle, env_soundscape, env_sun, func_dustcloud, func_dustmotes, func_smokevolume, info_notnull, infodecal, light_environment, point_message, prop_static, sky_camera, and func_lod.
Unsets any any angle related values within the entity.
Call this on an entity to remove the connection to its parent.
When called, will clear anything related to physical movement on the entity.
bool NSEntity::CreatedByMap | ( | void | ) |
Returns if the entity was spawned by the map we're on.
Reimplemented in light, path_track, scripted_sequence, ambient_generic, NSActor, NSPointTrigger, and NSSoundScape.
When called it'll make the entity uninteractable (but not destroy it).
It will hide it, as well as remove any collision associated with it.
float NSEntity::DistanceFromYaw | ( | vector | targetPos | ) |
Returns a normalized value of how far away the target is from the entity's view direction.
1 means dead-center. -1 means it's behind.
bool NSEntity::DropToFloor | ( | void | ) |
When called, will drop the entity down onto the surface it's hovering over.
Will return false
if the entity fell through the floor, or something else that's undesirable.
Run each tic after physics are run to determine if we need to send updates over the network.
Reimplemented in func_tracktrain, 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, env_sprite, func_conveyor, info_waypoint, speaker, trigger_push, NSClientPlayer, NSClientSpectator, NSItem, NSMonster, NSPhysicsEntity, NSProjectile, NSRenderableEntity, NSSoundScape, NSSurfacePropEntity, NSVehicle, NSWeapon, and NSPMoveVars.
Forces the entity to re-network updates to all clients.
vector NSEntity::GetAbsoluteMaxs | ( | void | ) |
Returns the absolute bounding box maxs of the entity, instead of being relative to the world position.
vector NSEntity::GetAbsoluteMins | ( | void | ) |
Returns the absolute bounding box mins of the entity, instead of being relative to the world position.
vector NSEntity::GetAngles | ( | void | ) |
Returns the direction the entity is facing in euler angles.
vector NSEntity::GetAngularVelocity | ( | void | ) |
Returns the direction the entity is spinning in degrees per second for each axis.
vector NSEntity::GetEyePos | ( | void | ) |
Returns the absolute world position of where the eyes are located.
vector NSEntity::GetForward | ( | void | ) |
Returns a normalized forward vector of the entity to more easily test which way it's facing.
entity NSEntity::GetGroundEntity | ( | void | ) |
Returns the entity we're standing on.
If the result is __NULL__
that does not mean that we're in air. Check NSEntity::IsOnGround()
for that information.
vector NSEntity::GetMaxs | ( | void | ) |
Returns the bounding box maxs of the entity.
vector NSEntity::GetMins | ( | void | ) |
Returns the bounding box mins of the entity.
Returns the model id of the 3D model representation of the entity.
vector NSEntity::GetNearbySpot | ( | void | ) |
Finds a free spot of an entity near itself of same size.
Extra padding as argument.
Returns an absolute value of when the entity will be think again.
Any result should be tested against GetTime()
.
vector NSEntity::GetOrigin | ( | void | ) |
Returns the absolute world position of the entity.
entity NSEntity::GetOwner | ( | void | ) |
Returns the owner of the entity.
nonvirtual entity NSEntity::GetParent | ( | void | ) |
Returns the entity this is parented to.
May be NULL when we have no parent.
vector NSEntity::GetRealMaxs | ( | void | ) |
Returns the actual bounding box maxs of the entity, before having been affected by scale modifiers.
vector NSEntity::GetRealMins | ( | void | ) |
Returns the actual bounding box mins of the entity, before having been affected by scale modifiers.
vector NSEntity::GetRight | ( | void | ) |
Returns a normalized right vector of the entity to more easily test what's right next to it.
int NSEntity::GetSharedID | ( | void | ) |
Returns a unique id between shared entities.
Returns the time that's passed since the entity has been spawned.
Returns the absolute timestamp of when the entity had been spawned.
vector NSEntity::GetUp | ( | void | ) |
Returns a normalized up vector of the entity to more easily test what may be above it.
vector NSEntity::GetVelocity | ( | void | ) |
Returns the movement velocity of the entity.
Returns a nuclide flags bitfield that the entity associates with.
vector NSEntity::GetViewAngle | ( | void | ) |
Returns an euler angle of where the entity is 'looking' at.
These are not necessarily eye values.
For physics functions only.
Call this inside your customphysics function of any entity class that you want to support think functions in. This saves you the effort of writing your own routines and methods.
bool NSEntity::HasFlags | ( | float | bits | ) |
Returns true if the entity has the specified engine flags.
bool NSEntity::HasSpawnFlags | ( | float | sf | ) |
Returns if the entity has any spawnflags set.
bool NSEntity::HasVFlags | ( | float | bits | ) |
Returns true if the entity has the specified, nuclide specific, flags.
Called when we are being prompted by another object/function with an input message.
Reimplemented from NSTrigger.
Reimplemented in env_explosion, env_physexplosion, env_shooter, env_spark, func_areaportal, func_door, func_guntarget, func_plat, func_wall_toggle, game_team_master, game_text, logic_case, logic_relay, logic_timer, path_track, phys_convert, phys_hinge, phys_keepupright, phys_slideconstraint, point_camera, point_servercommand, point_trigger, scripted_sentence, trigger_changelevel, trigger_hurt, trigger_multiple, trigger_once, ambient_generic, env_bubbles, env_cascade_light, env_fog_controller, env_funnel, env_instructor_hint, env_muzzleflash, env_smoker, func_conveyor, info_waypoint, logic_achievement, NSMonster, NSPhysicsConstraint, NSRenderableEntity, NSSoundScape, and NSSurfacePropEntity.
bool NSEntity::IntersectsWith | ( | entity | check | ) |
Returns whether or not the given entity insersects with us.
Like a more lenient WithinBounds().
bool NSEntity::IsFacing | ( | entity | target | ) |
Returns either true or false depending on if this entity is facing the entity in question.
bool NSEntity::IsFacingPosition | ( | vector | targetPos | ) |
Returns either true or false depending on if this entity is facing a position in question.
bool NSEntity::IsHidden | ( | void | ) |
Returns if the entity is currently being hidden explicitly.
bool NSEntity::IsOnGround | ( | void | ) |
Returns if the entity is aligned to the ground.
bool NSEntity::IsSolid | ( | void | ) |
Returns if the entity is solid or non-solid.
bool NSEntity::IsThinking | ( | void | ) |
Returns whether or not we're currently expecting to think any time soon.
Tells the engine to make the entity static, effectively making it inaccessible.
It will be removed from the game-logic but remain visible and it will retain its collision and maintain the appearance it had before getting removed.
Reimplemented in NSRenderableEntity.
vector NSEntity::NearestWallPointForRadius | ( | float | radius | ) |
Returns the nearest point on a wall of this entity within a specified radius.
If there is nothing nearby, it'll return the position of the entity.
Handles what happens before the entity gets removed from the client game.
Reimplemented in cycler_wreckage, env_shake, func_pushable, ambient_generic, env_cascade_light, light_dynamic, prop_vehicle_driveable, NSClient, NSClientPlayer, NSPhysicsConstraint, and NSTimer.
Called when we need to re-align the entity to our parent entity.
Reimplemented from NSIO.
Reimplemented in NSSurfacePropEntity.
Client: Run after the rendering of 3D world is complete.
2D calls can happen here.
Reimplemented in NSInteractiveSurface, env_sun, env_instructor_hint, info_waypoint, NSClientPlayer, NSPhysicsEntity, and NSRenderableEntity.
Reimplemented in NSInteractiveSurface, env_sun, func_dustcloud, func_dustmotes, func_smokevolume, infodecal, env_muzzleflash, env_projectedtexture, env_shockwave, func_lod, light_dynamic, phys_rope, point_spotlight, prop_rope, NSClient, NSClientPlayer, NSClientSpectator, NSMonster, NSProjectile, NSRenderableEntity, NSSpraylogo, NSSurfacePropEntity, and NSTalkMonster.
Client: Handles network updates from the server for the associated entity.
Reimplemented in func_tracktrain, env_cascade_light, env_fog, env_fog_controller, env_instructor_hint, env_projectedtexture, func_conveyor, func_monitor, func_tankmortar, info_particle_system, info_waypoint, light_dynamic, phys_rope, point_spotlight, prop_rope, prop_vehicle_driveable, speaker, trigger_camera, trigger_push, NSClientPlayer, NSClientSpectator, NSItem, NSMonster, NSPhysicsEntity, NSProjectile, NSRenderableEntity, NSSoundScape, NSSurfacePropEntity, NSTalkMonster, NSVehicle, NSWeapon, and NSPMoveVars.
When called, will unset anything related to ongoing think operations.
Removes one or more effects from the entity.
Check the effects_t enum for available effects.
Client: Called when video resources need to be allocated or reloaded for the entity.
Reimplemented in NSRenderableEntity, NSInteractiveSurface, env_sun, env_cascade_light, env_fog_controller, light_dynamic, and NSSpraylogo.
Server: Called when the entity first spawns or when game-logic requests the entity to return to its original spawn state.
Reimplemented from NSTrigger.
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, NSItem, NSMonster, NSPhysicsEntity, NSPointTrigger, NSRenderableEntity, NSSpawnPoint, NSSurfacePropEntity, and NSTalkMonster.
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 NSTrigger.
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, NSItem, NSMonster, NSMoverEntity, NSActor, NSPhysicsConstraint, NSPhysicsEntity, NSPointTrigger, NSProjectile, NSRenderableEntity, NSSoundScape, NSSquadMonster, NSSurfacePropEntity, NSTalkMonster, NSTimer, NSVehicle, and NSWeapon.
Restore the entity's angles to the value the spawndata contains.
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 NSTrigger.
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, NSItem, NSMonster, NSMoverEntity, NSActor, NSPhysicsConstraint, NSPhysicsEntity, NSPointTrigger, NSProjectile, NSRenderableEntity, NSSoundScape, NSSquadMonster, NSSurfacePropEntity, NSTalkMonster, NSTimer, NSVehicle, and NSWeapon.
Schedules a think timer.
You can only have one going at any given time. This is the preferred way of setting think timers. Note that when an entity of movement type MOVETYPE_PUSH
is not moving, it will never get to think.
Called by the engine whenever we need to send a client an update about this entity.
Reimplemented in func_tracktrain, 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, env_sprite, func_conveyor, func_lod, info_waypoint, speaker, trigger_push, NSClientPlayer, NSClientSpectator, NSItem, NSMonster, NSPhysicsEntity, NSProjectile, NSRenderableEntity, NSSoundScape, NSSurfacePropEntity, NSTalkMonster, NSVehicle, NSWeapon, and NSPMoveVars.
void NSEntity::SetAngles | ( | vector | newAngles | ) |
Sets the direction the entity is facing in eueler angles.
void NSEntity::SetAngularVelocity | ( | vector | newAvel | ) |
Sets the angular velocity of the entity in degrees per second on each axis.
Sets the Info Tags tag on this entity to the desired botInfo_t tag.
Sets the whole effects field.
Check the effects_t enum for available effects.
void NSEntity::SetEyePos | ( | vector | value | ) |
Sets the relative position of the eyes.
Sets the framegroup sequence of the entity.
Must be positive.
Sets the gravitational modifier of the entity.
The default is 1.0.
Sets the 3D model representation of the entity from a file path and name.
Reimplemented in NSSurfacePropEntity.
Sets the 3D model representation of the entity from an already precached resource id.
Sets the movement type of the entity.
Check the movetype_t enum for available types.
Sets the next think timer of the entity.
It has to be a positive value. For example `SetNextThink(1.5f); will trigger the think 1.5 seconds from then on.
void NSEntity::SetOrigin | ( | vector | newOrigin | ) |
Sets the absolute 3D world position of the entity.
void NSEntity::SetOriginUnstick | ( | vector | newOrigin | ) |
Same as SetOrigin(), but will push the entity out the ground if needed.
void NSEntity::SetOwner | ( | entity | newOwner | ) |
Sets the owner of the entity.
Entities will no longer collide with the specified owner.
Call this to parent the entity to an attachment of another entity.
Overrides the field that's used to determine which information should be networked.
void NSEntity::SetSize | ( | vector | newMins, |
vector | newMaxs | ||
) |
Sets the bounding box size of the entity.
This affects both collision and rendering bounds checking.
Sets the collision type of the entity.
Check the solid_t enum for available types.
Overrides the Think function of the entity.
Only use it when you want to retain a think timer that's already been set for the entity.
Overrides the touch function of a the entity to the specified function.
As a result Start/EndTouch will be unreliable.
void NSEntity::SetVelocity | ( | vector | vecNew | ) |
Sets the movement velocity of the given entity.
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 NSIO.
Reimplemented in NSInteractiveSurface, env_sun, func_dustcloud, func_dustmotes, func_smokevolume, prop_static, cycler_wreckage, env_beverage, env_explosion, env_global, env_shooter, env_spark, func_areaportal, func_breakable, func_button, func_door, func_door_rotating, func_guntarget, func_healthcharger, func_plat, func_pushable, func_recharge, func_tank, func_trackchange, func_tracktrain, func_train, infodecal, item_healthcharger, item_recharge, 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_bubbles, env_fog, env_sprite, func_lod, func_tankmortar, logic_achievement, prop_vehicle_driveable, speaker, worldspawn, NSItem, NSMonster, NSPhysicsConstraint, NSPhysicsEntity, NSProjectile, NSSquadMonster, NSSurfacePropEntity, and NSWeapon.
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 NSTrigger.
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, NSItem, NSMonster, NSMoverEntity, NSPhysicsConstraint, NSPhysicsEntity, NSPointTrigger, NSProjectile, NSRenderableEntity, NSSoundScape, NSSpawnPoint, NSSquadMonster, NSSurfacePropEntity, NSTalkMonster, and NSWeapon.
Plays a sound sample directly onto the entity.
Returns FALSE
if the sample was not found.
Plays a soundDef on the entity.
Returns FALSE
if the soundDef was not found.
Stops a sound sample or soundDef that is playing on the given channel.
When called, will make the entity think busy for the specified amount of time.
In that time, IsThinking() will return true.
void NSEntity::Transport | ( | vector | new_pos, |
vector | new_ang | ||
) |
Move the entity to a new position, with updated angles.
void NSEntity::TurnToPos | ( | vector | targetPos | ) |
Turns towards the specified position.
Call this if you want to update bounding boxes to take angles into account.
nonvirtual void NSEntity::UseBy | ( | entity | ) |
Simulates the press of the use/activate key, with the passed entity being the activator.
bool NSEntity::Visible | ( | entity | ent | ) |
Returns if the entity is visible by another entity and a field of view of 90 degrees.
bool NSEntity::VisibleVec | ( | vector | org | ) |
Returns if the entity is visible from a given position and a field of view of 90 degrees.
Returns the water level the entity is in.
0 - Entity is not in any water/liquid.
1 - Entity 1/4 submerged.
2 - Entity 3/4 submerged.
3 - Entity is fully submerged
bool NSEntity::WithinBounds | ( | entity | check | ) |
Returns whether or not we are fully within the bounds of a given entity.
vector NSEntity::WorldSpaceCenter | ( | void | ) |
Returns absolute world coordinates of the center of the entity according to its pivot point.