Nuclide
Software Development Kit for id Technology
|
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.
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... | |
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 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... | |
nonvirtual void | Event_SpawnDefRelative (string, float, float, float) |
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 | 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 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 | 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... | |
void NSEntity::NSEntity | ( | void | ) |
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.
void NSEntity::AddEffects | ( | effects_t | ) |
Appends one or more effects to the entity.
Check the effects_t enum for available effects.
void NSEntity::AddFlags | ( | float | fl | ) |
Adds one or more engine specific flags to the entity.
void NSEntity::AddVelocity | ( | vector | addVel | ) |
Adds onto the existing velocity.
void NSEntity::AddVFlags | ( | float | fl | ) |
Adds one or more nuclide specific flags to the entity.
|
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, infodecal, light_environment, point_message, prop_static, sky_camera, func_lod, and info_notnull.
nonvirtual void NSEntity::ClearAngles | ( | void | ) |
Unsets any any angle related values within the entity.
nonvirtual void NSEntity::ClearParent | ( | void | ) |
Call this on an entity to remove the connection to its parent.
void NSEntity::ClearVelocity | ( | void | ) |
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.
|
virtual |
Reimplemented in light, path_track, scripted_sequence, ambient_generic, NSActor, NSPointTrigger, and NSSoundScape.
void NSEntity::DisablePlayerCollision | ( | void | ) |
Will disable collision with player entities.
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.
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.
void NSEntity::EnablePlayerCollision | ( | void | ) |
Will enable collision with players, which is the default.
float NSEntity::EntIndex | ( | void | ) |
Returns the unique entity id of the entity.
|
virtual |
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, NSRagdoll, NSRenderableEntity, NSSound, NSSoundScape, NSSurfacePropEntity, NSVehicle, NSWeapon, and NSPMoveVars.
void NSEntity::Event_SpawnDefRelative | ( | string | classDef, |
float | xOfs, | ||
float | yOfs, | ||
float | zOfs | ||
) |
nonvirtual void NSEntity::ForceNetworkUpdate | ( | void | ) |
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.
float NSEntity::GetEffects | ( | void | ) |
Returns a bitfield of the active effects running on the entity.
vector NSEntity::GetEyePos | ( | void | ) |
Returns the absolute world position of where the eyes are located.
float NSEntity::GetFlags | ( | void | ) |
Returns an engine flags bitfield that the entity associates with.
vector NSEntity::GetForward | ( | void | ) |
Returns a normalized forward vector of the entity to more easily test which way it's facing.
float NSEntity::GetFrame | ( | void | ) |
Returns the currently active framegroup of the entity.
float NSEntity::GetGravity | ( | void | ) |
Returns the gravity modifier of the entity.
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.
string NSEntity::GetModel | ( | void | ) |
Returns the name of the 3D model representation of the entity.
float NSEntity::GetModelindex | ( | void | ) |
Returns the model id of the 3D model representation of the entity.
float NSEntity::GetMovetype | ( | void | ) |
Returns the movement type of the entity.
vector NSEntity::GetNearbySpot | ( | void | ) |
Finds a free spot of an entity near itself of same size.
Extra padding as argument.
float NSEntity::GetNextThinkTime | ( | void | ) |
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.
float NSEntity::GetScale | ( | void | ) |
Returns the scale modifier of the entity.
int NSEntity::GetSharedID | ( | void | ) |
Returns a unique id between shared entities.
vector NSEntity::GetSize | ( | void | ) |
Returns the virtual size of the entity.
float NSEntity::GetSkin | ( | void | ) |
Returns the currently equipped skin of the entity.
float NSEntity::GetSolid | ( | void | ) |
Returns the collision type of the entity.
float NSEntity::GetSpawnAge | ( | void | ) |
Returns the time that's passed since the entity has been spawned.
float NSEntity::GetSpawnTime | ( | void | ) |
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.
float NSEntity::GetVFlags | ( | void | ) |
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.
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.
bool NSEntity::HasFlags | ( | float | bits | ) |
Returns true if the entity has the specified engine flags.
bool NSEntity::HasModel | ( | void | ) |
Returns if this entity has a model set.
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.
bool NSEntity::HeldByPlayer | ( | void | ) |
Returns whether this entity is being held in the hands of a player.
As in via NSClientPlayer::PickupEntity().
void NSEntity::Hide | ( | void | ) |
When called, the entity will stop being rendered on the client.
|
virtual |
Called when we are being prompted by another object/function with an input message.
Reimplemented from NSTrigger.
Reimplemented in env_explosion, env_fade, env_physexplosion, env_shake, env_shooter, env_spark, func_areaportal, func_door, func_door_rotating, func_guntarget, func_plat, func_tracktrain, func_wall_toggle, game_team_master, game_text, light, logic_case, logic_relay, logic_timer, path_track, phys_convert, phys_hinge, phys_keepupright, phys_slideconstraint, point_camera, point_servercommand, point_trigger, prop_portal, scripted_sentence, trigger_changelevel, trigger_hurt, trigger_multiple, trigger_once, ambient_generic, env_beam, env_bubbles, env_cascade_light, env_fog_controller, env_funnel, env_instructor_hint, env_muzzleflash, env_smoker, env_sprite, func_conveyor, info_waypoint, logic_achievement, NSClientPlayer, NSItem, NSMonster, NSActor, 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::IsBrush | ( | void | ) |
Returns whether this entity is a brush or using a sub-model of the level.
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.
|
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.
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.
|
virtual |
Called when we need to re-align the entity to our parent entity.
Reimplemented from NSIO.
Reimplemented in NSSurfacePropEntity.
|
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, NSProjectile, and NSRenderableEntity.
|
virtual |
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, NSRagdoll, NSRenderableEntity, NSSpraylogo, NSSurfacePropEntity, and NSTalkMonster.
|
virtual |
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, NSRagdoll, NSRenderableEntity, NSSound, NSSoundScape, NSSurfacePropEntity, NSTalkMonster, NSVehicle, NSWeapon, and NSPMoveVars.
void NSEntity::ReleaseThink | ( | void | ) |
When called, will unset anything related to ongoing think operations.
void NSEntity::Relink | ( | void | ) |
Relink the entity against the world.
Updates PVS info etc.
void NSEntity::RemoveEffects | ( | effects_t | ) |
Removes one or more effects from the entity.
Check the effects_t enum for available effects.
void NSEntity::RemoveFlags | ( | float | fl | ) |
Remove one or more engine specific flags from the entity.
void NSEntity::RemoveVFlags | ( | float | fl | ) |
Remove one or more nuclide specific flags from the entity.
|
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.
|
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, 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_fog, env_fog_controller, env_funnel, env_glow, env_instructor_hint, env_laser, env_smoker, env_sprite, func_conveyor, func_friction, func_illusionary, func_ladder, func_lod, func_useableladder, func_wall, logic_achievement, speaker, trigger_gravity, trigger_push, NSOutput, NSBrushTrigger, NSCharger, NSClientPlayer, NSItem, NSMonster, NSPhysicsEntity, NSPointTrigger, NSRenderableEntity, NSSound, NSSpawnPoint, NSSurfacePropEntity, and NSTalkMonster.
|
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, NSWorldspawn, NSAttack, NSCharger, NSClient, NSClientPlayer, NSClientSpectator, NSItem, NSMonster, NSMoverEntity, NSActor, NSPhysicsConstraint, NSPhysicsEntity, NSPointTrigger, NSProjectile, NSRenderableEntity, NSSoundScape, NSSquadMonster, NSSurfacePropEntity, NSTalkMonster, NSTimer, NSVehicle, and NSWeapon.
nonvirtual void NSEntity::RestoreAngles | ( | void | ) |
Restore the entity's angles to the value the spawndata contains.
|
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, NSWorldspawn, NSAttack, NSCharger, NSClient, NSClientPlayer, NSClientSpectator, NSItem, NSMonster, NSMoverEntity, NSActor, NSPhysicsConstraint, NSPhysicsEntity, NSPointTrigger, NSProjectile, NSRenderableEntity, NSSoundScape, NSSquadMonster, NSSurfacePropEntity, NSTalkMonster, NSTimer, NSVehicle, and NSWeapon.
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.
|
virtual |
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, NSRagdoll, NSRenderableEntity, NSSound, 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.
void NSEntity::SetBotTag | ( | botInfo_t | newTag | ) |
Sets the Info Tags tag on this entity to the desired botInfo_t tag.
void NSEntity::SetEffects | ( | float | newEffects | ) |
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.
void NSEntity::SetFrame | ( | float | newFrame | ) |
Sets the framegroup sequence of the entity.
Must be positive.
void NSEntity::SetGravity | ( | float | newGrav | ) |
Sets the gravitational modifier of the entity.
The default is 1.0.
|
virtual |
Sets the 3D model representation of the entity from a file path and name.
Reimplemented in NSPhysicsEntity, and NSSurfacePropEntity.
void NSEntity::SetModelindex | ( | float | newModelIndex | ) |
Sets the 3D model representation of the entity from an already precached resource id.
void NSEntity::SetMovetype | ( | float | newMovetype | ) |
Sets the movement type of the entity.
Check the movetype_t enum for available types.
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.
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.
nonvirtual void NSEntity::SetParent | ( | string | ) |
Call this to parent the entity to another entity.
nonvirtual void NSEntity::SetParentAttachment | ( | string | ) |
Call this to parent the entity to an attachment of another entity.
void NSEntity::SetScale | ( | float | newScale | ) |
Sets the scale of the entity.
Affects collision as well.
void NSEntity::SetSendFlags | ( | float | flSendFlags | ) |
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.
void NSEntity::SetSkin | ( | float | newSkin | ) |
Sets the skingroup of the entity.
Must be positive.
void NSEntity::SetSolid | ( | float | newSolid | ) |
Sets the collision type of the entity.
Check the solid_t enum for available types.
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.
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.
void NSEntity::SetVelocity | ( | vector | vecNew | ) |
Sets the movement velocity of the given entity.
void NSEntity::Show | ( | void | ) |
When called, will unhide the entity.
void NSEntity::Spawn | ( | void | ) |
|
virtual |
Called when the entity is fulled initialized.
Any spawn key/value info pairs have already been dealt with. So now we can make full decisions on the entity. Always make sure to call super::Spawned();
inside your method when overriding.
Reimplemented from NSIO.
Reimplemented in NSInteractiveSurface, env_sun, func_dustcloud, func_dustmotes, func_smokevolume, infodecal, 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, info_hint, 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, NSWorldspawn, NSAttack, NSCharger, NSClientPlayer, NSItem, NSMonster, NSActor, NSPhysicsConstraint, NSPhysicsEntity, NSProjectile, NSSound, NSSquadMonster, NSSurfacePropEntity, and NSWeapon.
|
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, 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_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, func_useableladder, info_waypoint, light_dynamic, logic_achievement, speaker, trigger_gravity, trigger_push, NSWorldspawn, NSAttack, NSCharger, NSItem, NSMonster, NSMoverEntity, NSPhysicsConstraint, NSPhysicsEntity, NSPointTrigger, NSProjectile, NSRenderableEntity, NSSoundScape, NSSquadMonster, NSSurfacePropEntity, NSTalkMonster, and NSWeapon.
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.
bool NSEntity::StartSoundDef | ( | string | strSample, |
float | channel, | ||
bool | broadcast | ||
) |
Plays a soundDef on the entity.
Returns FALSE
if the soundDef was not found.
void NSEntity::StopSound | ( | float | channel, |
bool | broadcast | ||
) |
Stops a sound sample or soundDef that is playing on the given channel.
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.
void NSEntity::Transport | ( | vector | new_pos, |
vector | new_ang | ||
) |
Move the entity to a new position, with updated angles.
void NSEntity::TurnTo | ( | float | targetAngle | ) |
Turns to the specified angle.
void NSEntity::TurnToPos | ( | vector | targetPos | ) |
Turns towards the specified position.
void NSEntity::UpdateBounds | ( | void | ) |
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.
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
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.