Nuclide
Software Development Kit for id Tech
NSEntity Class Reference

NSEntity is the lowest of the user-accessible entity class. More...

#include <NSEntity.h>

Inheritance diagram for NSEntity:
NSTrigger 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 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ NSEntity()

void NSEntity::NSEntity ( void  )

The constructor.

Not much may be known of what the entity will be just yet.

Member Function Documentation

◆ AddAngularVelocity()

void NSEntity::AddAngularVelocity ( vector  addVel)

Adds onto the existing angular velocity.

◆ AddEffects()

void NSEntity::AddEffects ( effects_t  )

Appends one or more effects to the entity.

Check the effects_t enum for available effects.

◆ AddFlags()

void NSEntity::AddFlags ( float  fl)

Adds one or more engine specific flags to the entity.

◆ AddVelocity()

void NSEntity::AddVelocity ( vector  addVel)

Adds onto the existing velocity.

◆ AddVFlags()

void NSEntity::AddVFlags ( float  fl)

Adds one or more nuclide specific flags to the entity.

◆ AttackByDef()

bool NSEntity::AttackByDef ( string  defName,
bool  wasReleased 
)
virtual

Will read from the named def to perform an attack.

◆ CanSpawn()

bool NSEntity::CanSpawn ( bool  clientSide)
virtual

Returns if this entity can spawned from the map file.

Parameters
clientSideIf 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.

◆ ClearAngles()

nonvirtual void NSEntity::ClearAngles ( void  )

Unsets any any angle related values within the entity.

◆ ClearParent()

nonvirtual void NSEntity::ClearParent ( void  )

Call this on an entity to remove the connection to its parent.

◆ ClearVelocity()

void NSEntity::ClearVelocity ( void  )

When called, will clear anything related to physical movement on the entity.

◆ CreatedByMap()

bool NSEntity::CreatedByMap ( void  )

Returns if the entity was spawned by the map we're on.

◆ DebugDraw()

virtual void NSEntity::DebugDraw ( void  )
virtual

◆ Destroy()

void NSEntity::Destroy ( void  )

When called, will remove the entity from the game entirely.

◆ Disappear()

void NSEntity::Disappear ( void  )

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.

◆ DistanceFromYaw()

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.

◆ DropToFloor()

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.

◆ EntIndex()

float NSEntity::EntIndex ( void  )

Returns the unique entity id of the entity.

◆ EvaluateEntity()

◆ ForceNetworkUpdate()

nonvirtual void NSEntity::ForceNetworkUpdate ( void  )

Forces the entity to re-network updates to all clients.

◆ GetAbsoluteMaxs()

vector NSEntity::GetAbsoluteMaxs ( void  )

Returns the absolute bounding box maxs of the entity, instead of being relative to the world position.

◆ GetAbsoluteMins()

vector NSEntity::GetAbsoluteMins ( void  )

Returns the absolute bounding box mins of the entity, instead of being relative to the world position.

◆ GetAngles()

vector NSEntity::GetAngles ( void  )

Returns the direction the entity is facing in euler angles.

◆ GetAngularVelocity()

vector NSEntity::GetAngularVelocity ( void  )

Returns the direction the entity is spinning in degrees per second for each axis.

◆ GetEffects()

float NSEntity::GetEffects ( void  )

Returns a bitfield of the active effects running on the entity.

◆ GetEyePos()

vector NSEntity::GetEyePos ( void  )

Returns the absolute world position of where the eyes are located.

◆ GetFlags()

float NSEntity::GetFlags ( void  )

Returns an engine flags bitfield that the entity associates with.

◆ GetForward()

vector NSEntity::GetForward ( void  )

Returns a normalized forward vector of the entity to more easily test which way it's facing.

◆ GetFrame()

float NSEntity::GetFrame ( void  )

Returns the currently active framegroup of the entity.

◆ GetGravity()

float NSEntity::GetGravity ( void  )

Returns the gravity modifier of the entity.

◆ GetGroundEntity()

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.

◆ GetMaxs()

vector NSEntity::GetMaxs ( void  )

Returns the bounding box maxs of the entity.

◆ GetMins()

vector NSEntity::GetMins ( void  )

Returns the bounding box mins of the entity.

◆ GetModel()

string NSEntity::GetModel ( void  )

Returns the name of the 3D model representation of the entity.

◆ GetModelindex()

float NSEntity::GetModelindex ( void  )

Returns the model id of the 3D model representation of the entity.

◆ GetMovetype()

float NSEntity::GetMovetype ( void  )

Returns the movement type of the entity.

◆ GetNearbySpot()

vector NSEntity::GetNearbySpot ( void  )

Finds a free spot of an entity near itself of same size.

Extra padding as argument.

◆ GetNextThinkTime()

float NSEntity::GetNextThinkTime ( void  )

Returns an absolute value of when the entity will be think again.

Any result should be tested against GetTime().

◆ GetOrigin()

vector NSEntity::GetOrigin ( void  )

Returns the absolute world position of the entity.

◆ GetOwner()

entity NSEntity::GetOwner ( void  )

Returns the owner of the entity.

◆ GetParent()

nonvirtual entity NSEntity::GetParent ( void  )

Returns the entity this is parented to.

May be NULL when we have no parent.

◆ GetRealMaxs()

vector NSEntity::GetRealMaxs ( void  )

Returns the actual bounding box maxs of the entity, before having been affected by scale modifiers.

◆ GetRealMins()

vector NSEntity::GetRealMins ( void  )

Returns the actual bounding box mins of the entity, before having been affected by scale modifiers.

◆ GetRight()

vector NSEntity::GetRight ( void  )

Returns a normalized right vector of the entity to more easily test what's right next to it.

◆ GetScale()

float NSEntity::GetScale ( void  )

Returns the scale modifier of the entity.

◆ GetSharedID()

int NSEntity::GetSharedID ( void  )

Returns a unique id between shared entities.

◆ GetSkin()

float NSEntity::GetSkin ( void  )

Returns the currently equipped skin of the entity.

◆ GetSolid()

float NSEntity::GetSolid ( void  )

Returns the collision type of the entity.

◆ GetSpawnAge()

float NSEntity::GetSpawnAge ( void  )

Returns the time that's passed since the entity has been spawned.

◆ GetSpawnTime()

float NSEntity::GetSpawnTime ( void  )

Returns the absolute timestamp of when the entity had been spawned.

◆ GetUp()

vector NSEntity::GetUp ( void  )

Returns a normalized up vector of the entity to more easily test what may be above it.

◆ GetVelocity()

vector NSEntity::GetVelocity ( void  )

Returns the movement velocity of the entity.

◆ GetVFlags()

float NSEntity::GetVFlags ( void  )

Returns a nuclide flags bitfield that the entity associates with.

◆ GetViewAngle()

vector NSEntity::GetViewAngle ( void  )

Returns an euler angle of where the entity is 'looking' at.

These are not necessarily eye values.

◆ HandleThink()

void NSEntity::HandleThink ( void  )

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.

◆ HasFlags()

bool NSEntity::HasFlags ( float  bits)

Returns true if the entity has the specified engine flags.

◆ HasSpawnFlags()

bool NSEntity::HasSpawnFlags ( float  sf)

Returns if the entity has any spawnflags set.

◆ HasVFlags()

bool NSEntity::HasVFlags ( float  bits)

Returns true if the entity has the specified, nuclide specific, flags.

◆ Hide()

void NSEntity::Hide ( void  )

When called, the entity will stop being rendered on the client.

◆ Input()

◆ IntersectsWith()

bool NSEntity::IntersectsWith ( entity  check)

Returns whether or not the given entity insersects with us.

Like a more lenient WithinBounds().

◆ IsFacing()

bool NSEntity::IsFacing ( entity  target)

Returns either true or false depending on if this entity is facing the entity in question.

◆ IsFacingPosition()

bool NSEntity::IsFacingPosition ( vector  targetPos)

Returns either true or false depending on if this entity is facing a position in question.

◆ IsHidden()

bool NSEntity::IsHidden ( void  )

Returns if the entity is currently being hidden explicitly.

◆ IsOnGround()

bool NSEntity::IsOnGround ( void  )

Returns if the entity is aligned to the ground.

◆ IsSolid()

bool NSEntity::IsSolid ( void  )

Returns if the entity is solid or non-solid.

◆ IsThinking()

bool NSEntity::IsThinking ( void  )

Returns whether or not we're currently expecting to think any time soon.

◆ MakeStatic()

void NSEntity::MakeStatic ( void  )
virtual

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.

◆ NearestWallPointForRadius()

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.

◆ OnRemoveEntity()

void NSEntity::OnRemoveEntity ( void  )
virtual

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.

◆ ParentUpdate()

virtual void NSEntity::ParentUpdate ( void  )
virtual

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

Reimplemented from NSIO.

Reimplemented in NSSurfacePropEntity.

◆ postdraw()

void NSEntity::postdraw ( void  )
virtual

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.

◆ predraw()

◆ ReceiveEntity()

◆ ReceiveEvent()

void NSEntity::ReceiveEvent ( float  eventType)
virtual

Reimplemented in NSItem, and NSWeapon.

◆ ReleaseThink()

void NSEntity::ReleaseThink ( void  )

When called, will unset anything related to ongoing think operations.

◆ Relink()

void NSEntity::Relink ( void  )

Relink the entity against the world.

Updates PVS info etc.

◆ RemoveEffects()

void NSEntity::RemoveEffects ( effects_t  )

Removes one or more effects from the entity.

Check the effects_t enum for available effects.

◆ RemoveFlags()

void NSEntity::RemoveFlags ( float  fl)

Remove one or more engine specific flags from the entity.

◆ RemoveVFlags()

void NSEntity::RemoveVFlags ( float  fl)

Remove one or more nuclide specific flags from the entity.

◆ RendererRestarted()

void NSEntity::RendererRestarted ( void  )
virtual

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.

◆ Respawn()

void NSEntity::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 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.

◆ Restore()

void NSEntity::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 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.

◆ RestoreAngles()

nonvirtual void NSEntity::RestoreAngles ( void  )

Restore the entity's angles to the value the spawndata contains.

◆ Save()

void NSEntity::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 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.

◆ ScheduleThink()

void NSEntity::ScheduleThink ( void(void func,
float  fl 
)

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.

◆ SendEntity()

◆ SetAngles()

void NSEntity::SetAngles ( vector  newAngles)

Sets the direction the entity is facing in eueler angles.

◆ SetAngularVelocity()

void NSEntity::SetAngularVelocity ( vector  newAvel)

Sets the angular velocity of the entity in degrees per second on each axis.

◆ SetBotTag()

void NSEntity::SetBotTag ( botInfo_t  newTag)

Sets the Info Tags tag on this entity to the desired botInfo_t tag.

◆ SetEffects()

void NSEntity::SetEffects ( float  newEffects)

Sets the whole effects field.

Check the effects_t enum for available effects.

◆ SetEyePos()

void NSEntity::SetEyePos ( vector  value)

Sets the relative position of the eyes.

◆ SetFrame()

void NSEntity::SetFrame ( float  newFrame)

Sets the framegroup sequence of the entity.

Must be positive.

◆ SetGravity()

void NSEntity::SetGravity ( float  newGrav)

Sets the gravitational modifier of the entity.

The default is 1.0.

◆ SetModel()

void NSEntity::SetModel ( string  newModel)
virtual

Sets the 3D model representation of the entity from a file path and name.

Reimplemented in NSSurfacePropEntity.

◆ SetModelindex()

void NSEntity::SetModelindex ( float  newModelIndex)

Sets the 3D model representation of the entity from an already precached resource id.

◆ SetMovetype()

void NSEntity::SetMovetype ( float  newMovetype)

Sets the movement type of the entity.

Check the movetype_t enum for available types.

◆ SetNextThink()

void NSEntity::SetNextThink ( float  fl)

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.

◆ SetOrigin()

void NSEntity::SetOrigin ( vector  newOrigin)

Sets the absolute 3D world position of the entity.

◆ SetOriginUnstick()

void NSEntity::SetOriginUnstick ( vector  newOrigin)

Same as SetOrigin(), but will push the entity out the ground if needed.

◆ SetOwner()

void NSEntity::SetOwner ( entity  newOwner)

Sets the owner of the entity.

Entities will no longer collide with the specified owner.

◆ SetParent()

nonvirtual void NSEntity::SetParent ( string  )

Call this to parent the entity to another entity.

◆ SetParentAttachment()

nonvirtual void NSEntity::SetParentAttachment ( string  )

Call this to parent the entity to an attachment of another entity.

◆ SetScale()

void NSEntity::SetScale ( float  newScale)

Sets the scale of the entity.

Affects collision as well.

◆ SetSendFlags()

void NSEntity::SetSendFlags ( float  flSendFlags)

Overrides the field that's used to determine which information should be networked.

◆ SetSize()

void NSEntity::SetSize ( vector  newMins,
vector  newMaxs 
)

Sets the bounding box size of the entity.

This affects both collision and rendering bounds checking.

◆ SetSkin()

void NSEntity::SetSkin ( float  newSkin)

Sets the skingroup of the entity.

Must be positive.

◆ SetSolid()

void NSEntity::SetSolid ( float  newSolid)

Sets the collision type of the entity.

Check the solid_t enum for available types.

◆ SetThink()

void NSEntity::SetThink ( void()  )

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.

◆ SetTouch()

void NSEntity::SetTouch ( void()  newTouch)

Overrides the touch function of a the entity to the specified function.

As a result Start/EndTouch will be unreliable.

◆ SetVelocity()

void NSEntity::SetVelocity ( vector  vecNew)

Sets the movement velocity of the given entity.

◆ Show()

void NSEntity::Show ( void  )

When called, will unhide the entity.

◆ Spawned()

◆ SpawnKey()

void NSEntity::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 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.

◆ StartSound()

bool NSEntity::StartSound ( string  strSample,
float  channel,
float  flags,
bool  broadcast 
)

Plays a sound sample directly onto the entity.

Returns FALSE if the sample was not found.

◆ StartSoundDef()

bool NSEntity::StartSoundDef ( string  strSample,
float  channel,
bool  broadcast 
)

Plays a soundDef on the entity.

Returns FALSE if the soundDef was not found.

◆ StopSound()

void NSEntity::StopSound ( float  channel,
bool  broadcast 
)

Stops a sound sample or soundDef that is playing on the given channel.

◆ ThinkBusy()

void NSEntity::ThinkBusy ( float  busyTime)

When called, will make the entity think busy for the specified amount of time.

In that time, IsThinking() will return true.

◆ Transport()

void NSEntity::Transport ( vector  new_pos,
vector  new_ang 
)

Move the entity to a new position, with updated angles.

◆ TurnTo()

void NSEntity::TurnTo ( float  targetAngle)

Turns to the specified angle.

◆ TurnToPos()

void NSEntity::TurnToPos ( vector  targetPos)

Turns towards the specified position.

◆ UpdateBounds()

void NSEntity::UpdateBounds ( void  )

Call this if you want to update bounding boxes to take angles into account.

◆ UseBy()

nonvirtual void NSEntity::UseBy ( entity  )

Simulates the press of the use/activate key, with the passed entity being the activator.

◆ Visible()

bool NSEntity::Visible ( entity  ent)

Returns if the entity is visible by another entity and a field of view of 90 degrees.

◆ VisibleVec()

bool NSEntity::VisibleVec ( vector  org)

Returns if the entity is visible from a given position and a field of view of 90 degrees.

◆ WaterLevel()

float NSEntity::WaterLevel ( void  )

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

◆ WithinBounds()

bool NSEntity::WithinBounds ( entity  check)

Returns whether or not we are fully within the bounds of a given entity.

◆ WorldSpaceCenter()

vector NSEntity::WorldSpaceCenter ( void  )

Returns absolute world coordinates of the center of the entity according to its pivot point.


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