Nuclide
Software Development Kit for id Technology (BETA)
ncEntity Class Reference

About this class

ncEntity 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.

Inheritance diagram for ncEntity:
ncTrigger NSWorldspawn env_cubemap env_muzzleflash env_particle env_shockwave env_soundscape env_sun func_areaportal func_dustcloud func_dustmotes func_friction func_monsterclip func_smokevolume infodecal light_environment ncBrushTrigger ncInteractiveSurface ncOutput ncPMoveVars ncPhysicsConstraint ncPointTrigger ncPortal ncRenderableEntity ncSpraylogo ncTimer point_message prop_rope prop_static reserved_spot sky_camera

Public Member Functions

void ncEntity (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...
 
nonvirtual void Spawn (void)
 
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...
 
nonvirtual bool HasModel (void)
 Returns if this entity has a model set. 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 ncIO::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...
 
nonvirtual void Event_SpawnDefRelative (string, float, float, float)
 
nonvirtual bool SharesPVSWithPlayer (void)
 
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 (__int32)
 Sets the whole effects field. More...
 
nonvirtual void AddEffects (__int32)
 Appends one or more effects to the entity. More...
 
nonvirtual void RemoveEffects (__int32)
 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 __int32 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 GetSize (void)
 Returns the virtual size 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 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 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...
 
nonvirtual void EnablePlayerCollision (void)
 Will enable collision with players, which is the default. More...
 
nonvirtual void DisablePlayerCollision (void)
 Will disable collision with player entities. More...
 
nonvirtual bool HeldByPlayer (void)
 Returns whether this entity is being held in the hands of a player. More...
 
nonvirtual bool IsBrush (void)
 Returns whether this entity is a brush or using a sub-model of the level. More...
 

Constructor & Destructor Documentation

◆ ncEntity()

void ncEntity::ncEntity ( void  )

The constructor.

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

Member Function Documentation

◆ AddAngularVelocity()

void ncEntity::AddAngularVelocity ( vector  addVel)

Adds onto the existing angular velocity.

◆ AddEffects()

void ncEntity::AddEffects ( __int32  fl)

Appends one or more effects to the entity.

Check the effects_t enum for available effects.

◆ AddFlags()

void ncEntity::AddFlags ( float  fl)

Adds one or more engine specific flags to the entity.

◆ AddVelocity()

void ncEntity::AddVelocity ( vector  addVel)

Adds onto the existing velocity.

◆ AddVFlags()

void ncEntity::AddVFlags ( float  fl)

Adds one or more nuclide specific flags to the entity.

◆ AttackByDef()

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

Will read from the named def to perform an attack.

◆ CanSpawn()

bool ncEntity::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 ncInteractiveSurface, env_cubemap, env_particle, env_soundscape, env_sun, func_dustcloud, func_dustmotes, func_smokevolume, infodecal, light_environment, point_message, prop_static, sky_camera, func_lod, and info_notnull.

◆ ClearAngles()

nonvirtual void ncEntity::ClearAngles ( void  )

Unsets any any angle related values within the entity.

◆ ClearParent()

nonvirtual void ncEntity::ClearParent ( void  )

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

◆ ClearVelocity()

void ncEntity::ClearVelocity ( void  )

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

◆ CreatedByMap()

bool ncEntity::CreatedByMap ( void  )

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

◆ DebugDraw()

virtual void ncEntity::DebugDraw ( void  )
virtual

◆ DisablePlayerCollision()

void ncEntity::DisablePlayerCollision ( void  )

Will disable collision with player entities.

◆ Disappear()

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

◆ EnablePlayerCollision()

void ncEntity::EnablePlayerCollision ( void  )

Will enable collision with players, which is the default.

◆ EntIndex()

float ncEntity::EntIndex ( void  )

Returns the unique entity id of the entity.

◆ EvaluateEntity()

◆ Event_SpawnDefRelative()

void ncEntity::Event_SpawnDefRelative ( string  classDef,
float  xOfs,
float  yOfs,
float  zOfs 
)

◆ ForceNetworkUpdate()

nonvirtual void ncEntity::ForceNetworkUpdate ( void  )

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

◆ GetAbsoluteMaxs()

vector ncEntity::GetAbsoluteMaxs ( void  )

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

◆ GetAbsoluteMins()

vector ncEntity::GetAbsoluteMins ( void  )

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

◆ GetAngles()

vector ncEntity::GetAngles ( void  )

Returns the direction the entity is facing in euler angles.

◆ GetAngularVelocity()

vector ncEntity::GetAngularVelocity ( void  )

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

◆ GetEffects()

__int32 ncEntity::GetEffects ( void  )

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

◆ GetEyePos()

vector ncEntity::GetEyePos ( void  )

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

◆ GetFlags()

float ncEntity::GetFlags ( void  )

Returns an engine flags bitfield that the entity associates with.

◆ GetForward()

vector ncEntity::GetForward ( void  )

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

◆ GetFrame()

float ncEntity::GetFrame ( void  )

Returns the currently active framegroup of the entity.

◆ GetGravity()

float ncEntity::GetGravity ( void  )

Returns the gravity modifier of the entity.

◆ GetGroundEntity()

entity ncEntity::GetGroundEntity ( void  )

Returns the entity we're standing on.

If the result is __NULL__ that does not mean that we're in air. Check ncEntity::IsOnGround() for that information.

◆ GetMaxs()

vector ncEntity::GetMaxs ( void  )

Returns the bounding box maxs of the entity.

◆ GetMins()

vector ncEntity::GetMins ( void  )

Returns the bounding box mins of the entity.

◆ GetModel()

string ncEntity::GetModel ( void  )

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

◆ GetModelindex()

float ncEntity::GetModelindex ( void  )

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

◆ GetMovetype()

float ncEntity::GetMovetype ( void  )

Returns the movement type of the entity.

◆ GetNearbySpot()

vector ncEntity::GetNearbySpot ( void  )

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

Extra padding as argument.

◆ GetOrigin()

vector ncEntity::GetOrigin ( void  )

Returns the absolute world position of the entity.

◆ GetOwner()

entity ncEntity::GetOwner ( void  )

Returns the owner of the entity.

◆ GetParent()

nonvirtual entity ncEntity::GetParent ( void  )

Returns the entity this is parented to.

May be NULL when we have no parent.

◆ GetRealMaxs()

vector ncEntity::GetRealMaxs ( void  )

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

◆ GetRealMins()

vector ncEntity::GetRealMins ( void  )

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

◆ GetRight()

vector ncEntity::GetRight ( void  )

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

◆ GetScale()

float ncEntity::GetScale ( void  )

Returns the scale modifier of the entity.

◆ GetSharedID()

int ncEntity::GetSharedID ( void  )

Returns a unique id between shared entities.

◆ GetSize()

vector ncEntity::GetSize ( void  )

Returns the virtual size of the entity.

◆ GetSkin()

float ncEntity::GetSkin ( void  )

Returns the currently equipped skin of the entity.

◆ GetSolid()

float ncEntity::GetSolid ( void  )

Returns the collision type of the entity.

◆ GetSpawnAge()

float ncEntity::GetSpawnAge ( void  )

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

◆ GetSpawnTime()

float ncEntity::GetSpawnTime ( void  )

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

◆ GetUp()

vector ncEntity::GetUp ( void  )

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

◆ GetVelocity()

vector ncEntity::GetVelocity ( void  )

Returns the movement velocity of the entity.

◆ GetVFlags()

float ncEntity::GetVFlags ( void  )

Returns a nuclide flags bitfield that the entity associates with.

◆ GetViewAngle()

vector ncEntity::GetViewAngle ( void  )

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

These are not necessarily eye values.

◆ HandleThink()

void ncEntity::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 ncEntity::HasFlags ( float  bits)

Returns true if the entity has the specified engine flags.

◆ HasModel()

bool ncEntity::HasModel ( void  )

Returns if this entity has a model set.

◆ HasSpawnFlags()

bool ncEntity::HasSpawnFlags ( float  sf)

Returns if the entity has any spawnflags set.

◆ HasVFlags()

bool ncEntity::HasVFlags ( float  bits)

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

◆ HeldByPlayer()

bool ncEntity::HeldByPlayer ( void  )

Returns whether this entity is being held in the hands of a player.

As in via ncPlayer::PickupEntity().

◆ Hide()

void ncEntity::Hide ( void  )

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

◆ Input()

◆ IntersectsWith()

bool ncEntity::IntersectsWith ( entity  check)

Returns whether or not the given entity insersects with us.

Like a more lenient WithinBounds().

◆ IsBrush()

bool ncEntity::IsBrush ( void  )

Returns whether this entity is a brush or using a sub-model of the level.

◆ IsFacing()

bool ncEntity::IsFacing ( entity  target)

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

◆ IsFacingPosition()

bool ncEntity::IsFacingPosition ( vector  targetPos)

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

◆ IsHidden()

bool ncEntity::IsHidden ( void  )

Returns if the entity is currently being hidden explicitly.

◆ IsOnGround()

bool ncEntity::IsOnGround ( void  )

Returns if the entity is aligned to the ground.

◆ IsSolid()

bool ncEntity::IsSolid ( void  )

Returns if the entity is solid or non-solid.

◆ MakeStatic()

void ncEntity::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 ncRenderableEntity.

◆ NearestWallPointForRadius()

vector ncEntity::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.

◆ ParentUpdate()

virtual void ncEntity::ParentUpdate ( void  )
virtual

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

Reimplemented from ncIO.

Reimplemented in ncSurfacePropEntity.

◆ postdraw()

void ncEntity::postdraw ( void  )
virtual

Client: Run after the rendering of 3D world is complete.

2D calls can happen here.

Reimplemented in ncInteractiveSurface, env_sun, env_glow, env_instructor_hint, info_waypoint, ncPlayer, ncPhysicsEntity, ncProjectile, and ncRenderableEntity.

◆ predraw()

◆ ReceiveEntity()

◆ ReceiveEvent()

void ncEntity::ReceiveEvent ( float  eventType)
virtual

Reimplemented in ncItem, and ncWeapon.

◆ Relink()

void ncEntity::Relink ( void  )

Relink the entity against the world.

Updates PVS info etc.

◆ RemoveEffects()

void ncEntity::RemoveEffects ( __int32  fl)

Removes one or more effects from the entity.

Check the effects_t enum for available effects.

◆ RemoveFlags()

void ncEntity::RemoveFlags ( float  fl)

Remove one or more engine specific flags from the entity.

◆ RemoveVFlags()

void ncEntity::RemoveVFlags ( float  fl)

Remove one or more nuclide specific flags from the entity.

◆ RendererRestarted()

void ncEntity::RendererRestarted ( void  )
virtual

Client: Called when video resources need to be allocated or reloaded for the entity.

Reimplemented in ncRenderableEntity, ncInteractiveSurface, env_sun, env_beam, env_cascade_light, env_fog_controller, env_funnel, env_glow, env_laser, light_dynamic, point_spotlight, and ncSpraylogo.

◆ Respawn()

void ncEntity::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 ncTrigger.

Reimplemented in env_particle, env_soundscape, 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_camera, point_trigger, prop_door_rotating, prop_dynamic, prop_physics, prop_portal, prop_static, random_speaker, random_trigger, reserved_spot, scripted_sequence, targ_speaker, target_cdaudio, target_speaker, 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_fire, env_fog, env_fog_controller, env_funnel, env_glow, env_instructor_hint, env_laser, env_projectedtexture, env_smoker, env_sprite, func_conveyor, func_friction, func_illusionary, func_ladder, func_lod, func_monitor, func_tankmortar, func_useableladder, func_vehicle, func_wall, info_particle_system, light_dynamic, logic_achievement, phys_rope, point_spotlight, prop_rope, prop_vehicle_driveable, speaker, trigger_camera, trigger_gravity, trigger_push, ncOutput, ncBrushTrigger, ncCharger, ncPlayer, ncItem, ncMonster, ncPhysicsEntity, ncPointTrigger, ncRenderableEntity, ncSound, ncSpawnPoint, ncSurfacePropEntity, and ncTalkMonster.

◆ Restore()

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

Similar to ncIO::SpawnKey() but for save-game fields.

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

Reimplemented from ncTrigger.

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, ncMomentary, monstermaker, multi_manager, path_corner, path_track, phys_convert, phys_hinge, phys_keepupright, phys_slideconstraint, player_loadsaved, point_camera, point_trigger, prop_door_rotating, random_speaker, random_trigger, scripted_sentence, scripted_sequence, targ_speaker, target_cdaudio, trigger_auto, trigger_autosave, trigger_cdaudio, trigger_changelevel, trigger_changetarget, trigger_counter, trigger_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, func_vehicle, info_waypoint, logic_achievement, phys_rope, prop_rope, speaker, trigger_camera, trigger_gravity, trigger_push, NSWorldspawn, ncAttack, ncCharger, ncClient, ncPlayer, ncSpectator, ncItem, ncMonster, ncMoverEntity, ncActor, ncPhysicsConstraint, ncPhysicsEntity, ncPointTrigger, ncProjectile, ncRenderableEntity, ncSoundScape, ncSquadMonster, ncSurfacePropEntity, ncTalkMonster, ncTimer, ncVehicle, and ncWeapon.

◆ RestoreAngles()

nonvirtual void ncEntity::RestoreAngles ( void  )

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

◆ Save()

void ncEntity::Save ( float  handle)
virtual

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

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

Reimplemented from ncTrigger.

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, ncMomentary, monstermaker, multi_manager, path_corner, path_track, phys_convert, phys_hinge, phys_keepupright, phys_slideconstraint, player_loadsaved, point_camera, point_trigger, prop_door_rotating, random_speaker, random_trigger, scripted_sentence, scripted_sequence, targ_speaker, target_cdaudio, trigger_auto, trigger_autosave, trigger_cdaudio, trigger_changelevel, trigger_changetarget, trigger_counter, trigger_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, func_vehicle, info_waypoint, logic_achievement, phys_rope, prop_rope, speaker, trigger_camera, trigger_gravity, trigger_push, NSWorldspawn, ncAttack, ncCharger, ncClient, ncPlayer, ncSpectator, ncItem, ncMonster, ncMoverEntity, ncActor, ncPhysicsConstraint, ncPhysicsEntity, ncPointTrigger, ncProjectile, ncRenderableEntity, ncSoundScape, ncSquadMonster, ncSurfacePropEntity, ncTalkMonster, ncTimer, ncVehicle, and ncWeapon.

◆ SendEntity()

◆ SetAngles()

void ncEntity::SetAngles ( vector  newAngles)

Sets the direction the entity is facing in eueler angles.

◆ SetAngularVelocity()

void ncEntity::SetAngularVelocity ( vector  newAvel)

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

◆ SetBotTag()

void ncEntity::SetBotTag ( botInfo_t  newTag)

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

◆ SetEffects()

void ncEntity::SetEffects ( __int32  newEffects)

Sets the whole effects field.

Check the effects_t enum for available effects.

◆ SetEyePos()

void ncEntity::SetEyePos ( vector  value)

Sets the relative position of the eyes.

◆ SetFrame()

void ncEntity::SetFrame ( float  newFrame)

Sets the framegroup sequence of the entity.

Must be positive.

◆ SetGravity()

void ncEntity::SetGravity ( float  newGrav)

Sets the gravitational modifier of the entity.

The default is 1.0.

◆ SetModel()

void ncEntity::SetModel ( string  newModel)
virtual

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

Reimplemented in ncPhysicsEntity, and ncSurfacePropEntity.

◆ SetModelindex()

void ncEntity::SetModelindex ( float  newModelIndex)

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

◆ SetMovetype()

void ncEntity::SetMovetype ( float  newMovetype)

Sets the movement type of the entity.

Check the movetype_t enum for available types.

◆ SetOrigin()

void ncEntity::SetOrigin ( vector  newOrigin)

Sets the absolute 3D world position of the entity.

◆ SetOriginUnstick()

void ncEntity::SetOriginUnstick ( vector  newOrigin)

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

◆ SetOwner()

void ncEntity::SetOwner ( entity  newOwner)

Sets the owner of the entity.

Entities will no longer collide with the specified owner.

◆ SetParent()

nonvirtual void ncEntity::SetParent ( string  )

Call this to parent the entity to another entity.

◆ SetParentAttachment()

nonvirtual void ncEntity::SetParentAttachment ( string  )

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

◆ SetScale()

void ncEntity::SetScale ( float  newScale)

Sets the scale of the entity.

Affects collision as well.

◆ SetSendFlags()

void ncEntity::SetSendFlags ( float  flSendFlags)

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

◆ SetSize()

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

Sets the bounding box size of the entity.

This affects both collision and rendering bounds checking.

◆ SetSkin()

void ncEntity::SetSkin ( float  newSkin)

Sets the skingroup of the entity.

Must be positive.

◆ SetSolid()

void ncEntity::SetSolid ( float  newSolid)

Sets the collision type of the entity.

Check the solid_t enum for available types.

◆ SetTouch()

void ncEntity::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 ncEntity::SetVelocity ( vector  vecNew)

Sets the movement velocity of the given entity.

◆ SharesPVSWithPlayer()

nonvirtual bool ncEntity::SharesPVSWithPlayer ( void  )

◆ Show()

void ncEntity::Show ( void  )

When called, will unhide the entity.

◆ Spawn()

void ncEntity::Spawn ( void  )

◆ Spawned()

◆ SpawnKey()

void ncEntity::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 ncIO.

Reimplemented from ncTrigger.

Reimplemented in ncInteractiveSurface, env_cubemap, env_particle, env_soundscape, env_sun, func_dustcloud, func_dustmotes, func_smokevolume, infodecal, light_environment, point_message, prop_static, sky_camera, env_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, prop_portal, random_speaker, random_trigger, scripted_sentence, scripted_sequence, targ_speaker, target_cdaudio, target_speaker, trigger_auto, trigger_cdaudio, trigger_changelevel, trigger_changetarget, trigger_counter, trigger_hurt, trigger_look, trigger_monsterjump, trigger_multiple, trigger_once, trigger_relay, trigger_teleport, ambient_generic, env_beam, env_bubbles, env_cascade_light, env_fire, env_fog, env_fog_controller, env_funnel, env_glow, env_instructor_hint, env_laser, env_muzzleflash, env_projectedtexture, env_shockwave, env_smoker, env_sprite, func_conveyor, func_friction, func_lod, func_monitor, func_tankmortar, func_useableladder, func_vehicle, info_particle_system, info_waypoint, light_dynamic, logic_achievement, phys_rope, point_spotlight, prop_rope, speaker, trigger_camera, trigger_gravity, trigger_push, NSWorldspawn, ncAttack, ncCharger, ncItem, ncMonster, ncMoverEntity, ncActor, ncPhysicsConstraint, ncPhysicsEntity, ncPointTrigger, ncProjectile, ncRenderableEntity, ncSoundScape, ncSquadMonster, ncSurfacePropEntity, ncTalkMonster, and ncWeapon.

◆ StartSound()

bool ncEntity::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 ncEntity::StartSoundDef ( string  strSample,
float  channel,
bool  broadcast 
)

Plays a soundDef on the entity.

Returns FALSE if the soundDef was not found.

◆ StopSound()

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

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

◆ Transport()

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

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

◆ TurnTo()

void ncEntity::TurnTo ( float  targetAngle)

Turns to the specified angle.

◆ TurnToPos()

void ncEntity::TurnToPos ( vector  targetPos)

Turns towards the specified position.

◆ UpdateBounds()

void ncEntity::UpdateBounds ( void  )

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

◆ UseBy()

nonvirtual void ncEntity::UseBy ( entity  )

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

◆ Visible()

bool ncEntity::Visible ( entity  ent)

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

◆ VisibleVec()

bool ncEntity::VisibleVec ( vector  org)

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

◆ WaterLevel()

float ncEntity::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 ncEntity::WithinBounds ( entity  check)

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

◆ WorldSpaceCenter()

vector ncEntity::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: