Nuclide
Software Development Kit for id Technology
NSEntity.h
1/*
2 * Copyright (c) 2016-2024 Vera Visions LLC.
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
14 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*/
16
22typedef enumflags
23{
24 BASEFL_CHANGED_MODELINDEX,
25 BASEFL_CHANGED_ORIGIN_X,
26 BASEFL_CHANGED_ORIGIN_Y,
27 BASEFL_CHANGED_ORIGIN_Z,
28 BASEFL_CHANGED_ANGLES_X,
29 BASEFL_CHANGED_ANGLES_Y,
30 BASEFL_CHANGED_ANGLES_Z,
31 BASEFL_CHANGED_VELOCITY_X,
32 BASEFL_CHANGED_VELOCITY_Y,
33 BASEFL_CHANGED_VELOCITY_Z,
34 BASEFL_CHANGED_ANGULARVELOCITY,
35 BASEFL_CHANGED_SIZE,
36 BASEFL_CHANGED_FLAGS,
37 BASEFL_CHANGED_SOLID,
38 BASEFL_CHANGED_FRAME,
39 BASEFL_CHANGED_SKIN,
40 BASEFL_CHANGED_MOVETYPE,
41 BASEFL_CHANGED_EFFECTS,
42 BASEFL_CHANGED_SCALE,
43} nsentity_changed_t;
44
54{
55public:
58 void NSEntity(void);
59
60#ifdef CLIENT
62 virtual void ReceiveEntity(float,float);
63
64 virtual void ReceiveEvent(float);
65
66 virtual float predraw(void);
67
69 virtual void postdraw(void);
70
72 virtual void RendererRestarted(void);
73#endif
74
75 /* overrides */
76 virtual void SpawnKey(string,string);
77 virtual void Spawned(void);
78 nonvirtual void Spawn(void);
79
83 virtual void MakeStatic(void);
84
87 virtual bool CanSpawn(bool clientSide);
88
90 nonvirtual bool HasModel(void);
91
92#ifdef SERVER
93 virtual void Respawn(void);
94 virtual void Input(entity,string,string);
95 virtual void Save(float);
96 virtual void Restore(string,string);
97 virtual void ParentUpdate(void);
98
99 nonvirtual void Event_SpawnDefRelative(string, float, float, float);
100
101 /* Server-side rendering function. Expensive, but useful. */
102 virtual void DebugDraw(void);
103
105 virtual void EvaluateEntity(void);
106
108 virtual float SendEntity(entity,float);
109
111 nonvirtual entity GetParent(void);
112
114 nonvirtual void SetParent(string);
115
117 nonvirtual void SetParentAttachment(string);
118
120 nonvirtual void ClearParent(void);
121
123 nonvirtual void RestoreAngles(void);
124
126 nonvirtual void ClearAngles(void);
127
129 nonvirtual void UseBy(entity);
130
132 nonvirtual void ForceNetworkUpdate(void);
133#endif
134
135 /* sets */
137 nonvirtual void SetEffects(float);
139 nonvirtual void AddEffects(effects_t);
141 nonvirtual void RemoveEffects(effects_t);
143 nonvirtual void SetFrame(float);
145 nonvirtual void SetSkin(float);
147 nonvirtual void SetScale(float);
149 nonvirtual void SetOwner(entity);
151 nonvirtual void SetVelocity(vector);
152
154 nonvirtual void AddAngularVelocity(vector);
156 nonvirtual void AddVelocity(vector);
157
160 nonvirtual void SetTouch(void());
162 nonvirtual void SetSendFlags(float);
164 nonvirtual void SetSolid(float);
166 virtual void SetModel(string);
168 nonvirtual void SetModelindex(float);
170 nonvirtual void SetMovetype(float);
172 nonvirtual void SetGravity(float);
174 nonvirtual void SetAngles(vector);
176 nonvirtual void SetAngularVelocity(vector);
178 nonvirtual void SetOrigin(vector);
180 nonvirtual void SetOriginUnstick(vector);
183 nonvirtual void SetSize(vector,vector);
185 nonvirtual void AddFlags(float);
187 nonvirtual void RemoveFlags(float);
189 nonvirtual void AddVFlags(float);
191 nonvirtual void RemoveVFlags(float);
192
194 nonvirtual void TurnTo(float);
196 nonvirtual void TurnToPos(vector);
197
200 nonvirtual void SetThink(void());
204 nonvirtual void SetNextThink(float);
209 nonvirtual void ScheduleThink(void(void),float);
210
211 /* gets */
213 nonvirtual float GetEffects(void);
215 nonvirtual float GetFrame(void);
217 nonvirtual float GetSkin(void);
219 nonvirtual float GetScale(void);
221 nonvirtual entity GetOwner(void);
223 nonvirtual vector GetVelocity(void);
225 nonvirtual float GetSolid(void);
227 nonvirtual string GetModel(void);
229 nonvirtual float GetModelindex(void);
231 nonvirtual float GetMovetype(void);
233 nonvirtual float GetGravity(void);
235 nonvirtual vector GetAngles(void);
237 nonvirtual vector GetAngularVelocity(void);
239 nonvirtual vector GetOrigin(void);
241 nonvirtual vector GetSize(void);
243 nonvirtual vector GetMins(void);
245 nonvirtual vector GetMaxs(void);
248 nonvirtual vector GetRealMins(void);
251 nonvirtual vector GetRealMaxs(void);
254 nonvirtual vector GetAbsoluteMins(void);
257 nonvirtual vector GetAbsoluteMaxs(void);
259 nonvirtual float GetFlags(void);
261 nonvirtual float HasFlags(float);
263 nonvirtual float GetVFlags(void);
265 nonvirtual float HasVFlags(float);
268 nonvirtual float GetNextThinkTime(void);
270 nonvirtual bool IsThinking(void);
272 nonvirtual void ReleaseThink(void);
274 nonvirtual void ThinkBusy(float);
276 nonvirtual void ClearVelocity(void);
277
278 /* eye/shoot pos/angle */
280 nonvirtual vector GetEyePos(void);
282 nonvirtual void SetEyePos(vector);
284 nonvirtual vector GetViewAngle(void);
285
286 /* drawing related */
288 nonvirtual void Show(void);
290 nonvirtual void Hide(void);
292 nonvirtual bool IsHidden(void);
294 nonvirtual bool IsSolid(void);
295
298 nonvirtual void Disappear(void);
300 nonvirtual void UpdateBounds(void);
301
302 /* useful methods, (some) based on GMod's API */
304 nonvirtual float EntIndex(void);
306 nonvirtual bool DropToFloor(void);
308 nonvirtual vector GetForward(void);
310 nonvirtual vector GetRight(void);
312 nonvirtual vector GetUp(void);
314 nonvirtual vector WorldSpaceCenter(void);
324 nonvirtual float WaterLevel(void);
325
327 nonvirtual bool Visible(entity);
329 nonvirtual bool VisibleVec(vector);
331 nonvirtual float DistanceFromYaw(vector);
333 nonvirtual bool HasSpawnFlags(float);
335 nonvirtual bool IsOnGround(void);
339 nonvirtual entity GetGroundEntity(void);
341 nonvirtual bool CreatedByMap(void);
343 nonvirtual bool WithinBounds(entity);
345 nonvirtual bool IntersectsWith(entity);
346
347 /* useful methods, (some) based on Doom 3's API */
350 nonvirtual bool StartSound(string,float,float,bool);
353 nonvirtual bool StartSoundDef(string,float,bool);
355 nonvirtual void StopSound(float,bool);
356
359 nonvirtual vector NearestWallPointForRadius(float);
360
364 nonvirtual void HandleThink(void);
365
367 nonvirtual bool IsFacing(entity);
368
370 nonvirtual bool IsFacingPosition(vector);
371
373 nonvirtual float GetSpawnAge(void);
374
376 nonvirtual float GetSpawnTime(void);
378 nonvirtual void Transport(vector, vector);
379
381 nonvirtual void Relink(void);
382
384 nonvirtual vector GetNearbySpot(void);
385
387 nonvirtual int GetSharedID(void);
388
390 virtual bool AttackByDef(string, bool);
391
393 nonvirtual void SetBotTag(botInfo_t);
394
396 nonvirtual void EnablePlayerCollision(void);
398 nonvirtual void DisablePlayerCollision(void);
400 nonvirtual bool HeldByPlayer(void);
402 nonvirtual bool IsBrush(void);
403
404private:
405 float m_flSpawnTime;
406 bool m_bHidden;
407 vector m_vecMins;
408 vector m_vecMaxs;
410 bool m_bIsBrush;
411 vector m_vecEditorColor;
412
413 NETWORKED_INT(entityDefID)
414 NETWORKED_VECTOR_N(origin)
415 NETWORKED_VECTOR_N(angles)
416 NETWORKED_FLOAT_N(modelindex)
417 NETWORKED_VECTOR_N(size)
418 NETWORKED_VECTOR_N(mins)
419 NETWORKED_VECTOR_N(maxs)
420 NETWORKED_FLOAT_N(solid)
421 NETWORKED_FLOAT_N(movetype)
422 NETWORKED_FLOAT_N(scale)
423 NETWORKED_FLOAT_N(flags)
424 NETWORKED_FLOAT_N(vv_flags)
425 NETWORKED_VECTOR_N(velocity)
426 NETWORKED_VECTOR_N(avelocity)
427
428#ifdef CLIENT
430 virtual void _ReceiveComplete(float, float);
431#endif
432
433 entity m_holdingPlayer;
434 float m_lastHeldTime;
435
436#ifdef SERVER
437 string m_parent;
438 string m_parent_old;
439 string m_parent_attachment;
440 NETWORKED_FLOAT_N(frame)
441 NETWORKED_FLOAT_N(skin)
442 NETWORKED_FLOAT_N(effects)
443 vector m_vecModelMins;
444 vector m_vecModelMaxs;
445 nonvirtual vector GetModelMins(void);
446 nonvirtual vector GetModelMaxs(void);
447#endif
449 nonvirtual bool _ProjectileAttack(string, bool);
450};
451
454NSEntity spawnClass(string className, vector desiredPos);
455
456#ifdef SERVER
457bool changeClass(entity target, string className)
458#endif
459
460void sendInput(entity target, string inputName, string dataString, entity activator);
461
462bool isAI(entity entityToCheck);
463
464bool isAlive(entity entityToCheck);
465
466bool isGodMode(entity entityToCheck);
467
468bool isClient(entity entityToCheck);
469
470bool isPlayer(entity entityToCheck);
471
472bool isSentient(entity entityToCheck);
473
474bool isBot(entity entityToCheck);
475
476bool isItem(entity entityToCheck);
477
478bool isWeapon(entity entityToCheck);
NSEntity is the lowest of the user-accessible entity class.
Definition: NSEntity.h:54
nonvirtual void ScheduleThink(void(void), float)
Schedules a think timer.
Definition: NSEntity.qc:796
nonvirtual vector GetOrigin(void)
Returns the absolute world position of the entity.
Definition: NSEntity.qc:873
nonvirtual void SetOrigin(vector)
Sets the absolute 3D world position of the entity.
Definition: NSEntity.qc:676
nonvirtual bool Visible(entity)
Returns if the entity is visible by another entity and a field of view of 90 degrees.
Definition: NSEntity.qc:137
nonvirtual vector GetRealMins(void)
Returns the actual bounding box mins of the entity, before having been affected by scale modifiers.
Definition: NSEntity.qc:897
nonvirtual vector GetRight(void)
Returns a normalized right vector of the entity to more easily test what's right next to it.
Definition: NSEntity.qc:93
nonvirtual void SetTouch(void())
Overrides the touch function of a the entity to the specified function.
Definition: NSEntity.qc:532
nonvirtual bool IsThinking(void)
Returns whether or not we're currently expecting to think any time soon.
Definition: NSEntity.qc:951
nonvirtual float EntIndex(void)
Returns the unique entity id of the entity.
Definition: NSEntity.qc:75
nonvirtual void SetOriginUnstick(vector)
Same as SetOrigin(), but will push the entity out the ground if needed.
Definition: NSEntity.qc:682
nonvirtual float HasVFlags(float)
Returns true if the entity has the specified, nuclide specific, flags.
Definition: NSEntity.qc:939
nonvirtual void AddVFlags(float)
Adds one or more nuclide specific flags to the entity.
Definition: NSEntity.qc:755
nonvirtual void EnablePlayerCollision(void)
Will enable collision with players, which is the default.
Definition: NSEntity.qc:1589
virtual void MakeStatic(void)
Tells the engine to make the entity static, effectively making it inaccessible.
Definition: NSEntity.qc:1297
virtual void ParentUpdate(void)
Called when we need to re-align the entity to our parent entity.
nonvirtual vector GetSize(void)
Returns the virtual size of the entity.
Definition: NSEntity.qc:879
nonvirtual void ReleaseThink(void)
When called, will unset anything related to ongoing think operations.
Definition: NSEntity.qc:957
nonvirtual void SetSize(vector, vector)
Sets the bounding box size of the entity.
Definition: NSEntity.qc:660
nonvirtual float GetFlags(void)
Returns an engine flags bitfield that the entity associates with.
Definition: NSEntity.qc:921
nonvirtual void Disappear(void)
When called it'll make the entity uninteractable (but not destroy it).
Definition: NSEntity.qc:1290
virtual bool AttackByDef(string, bool)
Will read from the named def to perform an attack.
Definition: NSEntity.qc:1557
nonvirtual float GetSkin(void)
Returns the currently equipped skin of the entity.
Definition: NSEntity.qc:812
virtual void Restore(string, string)
Similar to NSIO::SpawnKey but for save-game fields.
Definition: NSEntity.qc:1024
nonvirtual void Transport(vector, vector)
Move the entity to a new position, with updated angles.
Definition: NSEntity.qc:1428
nonvirtual float GetNextThinkTime(void)
Returns an absolute value of when the entity will be think again.
Definition: NSEntity.qc:945
nonvirtual float GetScale(void)
Returns the scale modifier of the entity.
Definition: NSEntity.qc:817
nonvirtual vector GetAbsoluteMins(void)
Returns the absolute bounding box mins of the entity, instead of being relative to the world position...
Definition: NSEntity.qc:909
nonvirtual bool IsFacing(entity)
Returns either true or false depending on if this entity is facing the entity in question.
Definition: NSEntity.qc:1402
nonvirtual void SetNextThink(float)
Sets the next think timer of the entity.
Definition: NSEntity.qc:780
nonvirtual bool DropToFloor(void)
When called, will drop the entity down onto the surface it's hovering over.
Definition: NSEntity.qc:81
nonvirtual void UseBy(entity)
Simulates the press of the use/activate key, with the passed entity being the activator.
nonvirtual bool IsOnGround(void)
Returns if the entity is aligned to the ground.
Definition: NSEntity.qc:166
nonvirtual void TurnTo(float)
Turns to the specified angle.
Definition: NSEntity.qc:765
virtual void Respawn(void)
Server: Called when the entity first spawns or when game-logic requests the entity to return to its o...
Definition: NSEntity.qc:992
nonvirtual float GetMovetype(void)
Returns the movement type of the entity.
Definition: NSEntity.qc:849
nonvirtual void SetOwner(entity)
Sets the owner of the entity.
Definition: NSEntity.qc:520
nonvirtual void SetAngularVelocity(vector)
Sets the angular velocity of the entity in degrees per second on each axis.
Definition: NSEntity.qc:654
virtual void Input(entity, string, string)
Called when we are being prompted by another object/function with an input message.
Definition: NSEntity.qc:1088
nonvirtual vector GetAngularVelocity(void)
Returns the direction the entity is spinning in degrees per second for each axis.
Definition: NSEntity.qc:867
nonvirtual void AddFlags(float)
Adds one or more engine specific flags to the entity.
Definition: NSEntity.qc:744
nonvirtual float GetGravity(void)
Returns the gravity modifier of the entity.
Definition: NSEntity.qc:855
nonvirtual vector GetViewAngle(void)
Returns an euler angle of where the entity is 'looking' at.
Definition: NSEntity.qc:575
nonvirtual void SetGravity(float)
Sets the gravitational modifier of the entity.
Definition: NSEntity.qc:552
nonvirtual float GetSpawnAge(void)
Returns the time that's passed since the entity has been spawned.
Definition: NSEntity.qc:1416
nonvirtual bool StartSoundDef(string, float, bool)
Plays a soundDef on the entity.
Definition: NSEntity.qc:1358
nonvirtual float GetSolid(void)
Returns the collision type of the entity.
Definition: NSEntity.qc:832
nonvirtual void RemoveEffects(effects_t)
Removes one or more effects from the entity.
Definition: NSEntity.qc:738
nonvirtual vector GetMins(void)
Returns the bounding box mins of the entity.
Definition: NSEntity.qc:885
virtual float predraw(void)
Definition: NSEntity.qc:203
nonvirtual bool IsBrush(void)
Returns whether this entity is a brush or using a sub-model of the level.
Definition: NSEntity.qc:688
nonvirtual vector GetForward(void)
Returns a normalized forward vector of the entity to more easily test which way it's facing.
Definition: NSEntity.qc:87
virtual void postdraw(void)
Client: Run after the rendering of 3D world is complete.
Definition: NSEntity.qc:271
virtual void EvaluateEntity(void)
Run each tic after physics are run to determine if we need to send updates over the network.
nonvirtual bool HasSpawnFlags(float)
Returns if the entity has any spawnflags set.
Definition: NSEntity.qc:160
nonvirtual void SetSkin(float)
Sets the skingroup of the entity.
Definition: NSEntity.qc:514
nonvirtual vector GetVelocity(void)
Returns the movement velocity of the entity.
Definition: NSEntity.qc:827
nonvirtual void AddVelocity(vector)
Adds onto the existing velocity.
Definition: NSEntity.qc:727
nonvirtual void SetSendFlags(float)
Overrides the field that's used to determine which information should be networked.
Definition: NSEntity.qc:538
nonvirtual void ClearVelocity(void)
When called, will clear anything related to physical movement on the entity.
Definition: NSEntity.qc:973
nonvirtual void SetSolid(float)
Sets the collision type of the entity.
Definition: NSEntity.qc:558
nonvirtual int GetSharedID(void)
Returns a unique id between shared entities.
Definition: NSEntity.qc:1579
nonvirtual void ForceNetworkUpdate(void)
Forces the entity to re-network updates to all clients.
nonvirtual void SetMovetype(float)
Sets the movement type of the entity.
Definition: NSEntity.qc:546
virtual void RendererRestarted(void)
Client: Called when video resources need to be allocated or reloaded for the entity.
Definition: NSEntity.qc:197
nonvirtual void SetBotTag(botInfo_t)
Sets the Info Tags tag on this entity to the desired botInfo_t tag.
Definition: NSEntity.qc:1571
nonvirtual string GetModel(void)
Returns the name of the 3D model representation of the entity.
Definition: NSEntity.qc:837
void NSEntity(void)
The constructor.
Definition: NSEntity.qc:29
nonvirtual vector GetEyePos(void)
Returns the absolute world position of where the eyes are located.
Definition: NSEntity.qc:591
nonvirtual float HasFlags(float)
Returns true if the entity has the specified engine flags.
Definition: NSEntity.qc:933
nonvirtual void StopSound(float, bool)
Stops a sound sample or soundDef that is playing on the given channel.
Definition: NSEntity.qc:1366
virtual void SpawnKey(string, string)
This method handles entity key/value pairs on map load.
Definition: NSEntity.qc:1209
nonvirtual vector GetMaxs(void)
Returns the bounding box maxs of the entity.
Definition: NSEntity.qc:891
nonvirtual bool IsHidden(void)
Returns if the entity is currently being hidden explicitly.
Definition: NSEntity.qc:1284
nonvirtual vector GetNearbySpot(void)
Finds a free spot of an entity near itself of same size.
Definition: NSEntity.qc:1450
nonvirtual void SetModelindex(float)
Sets the 3D model representation of the entity from an already precached resource id.
Definition: NSEntity.qc:710
nonvirtual void SetThink(void())
Overrides the Think function of the entity.
Definition: NSEntity.qc:775
virtual float SendEntity(entity, float)
Called by the engine whenever we need to send a client an update about this entity.
nonvirtual float GetEffects(void)
Returns a bitfield of the active effects running on the entity.
Definition: NSEntity.qc:802
nonvirtual float WaterLevel(void)
Returns the water level the entity is in.
Definition: NSEntity.qc:111
nonvirtual void UpdateBounds(void)
Call this if you want to update bounding boxes to take angles into account.
Definition: NSEntity.qc:601
nonvirtual void SetEyePos(vector)
Sets the relative position of the eyes.
Definition: NSEntity.qc:585
nonvirtual void AddEffects(effects_t)
Appends one or more effects to the entity.
Definition: NSEntity.qc:733
nonvirtual void SetEffects(float)
Sets the whole effects field.
Definition: NSEntity.qc:464
nonvirtual vector GetAngles(void)
Returns the direction the entity is facing in euler angles.
Definition: NSEntity.qc:861
nonvirtual float GetSpawnTime(void)
Returns the absolute timestamp of when the entity had been spawned.
Definition: NSEntity.qc:1422
nonvirtual void RestoreAngles(void)
Restore the entity's angles to the value the spawndata contains.
nonvirtual bool IsFacingPosition(vector)
Returns either true or false depending on if this entity is facing a position in question.
Definition: NSEntity.qc:1409
nonvirtual bool WithinBounds(entity)
Returns whether or not we are fully within the bounds of a given entity.
Definition: NSEntity.qc:1309
virtual void DebugDraw(void)
nonvirtual vector GetRealMaxs(void)
Returns the actual bounding box maxs of the entity, before having been affected by scale modifiers.
Definition: NSEntity.qc:903
virtual void ReceiveEntity(float, float)
Client: Handles network updates from the server for the associated entity.
Definition: NSEntity.qc:214
nonvirtual float GetFrame(void)
Returns the currently active framegroup of the entity.
Definition: NSEntity.qc:807
nonvirtual void RemoveFlags(float)
Remove one or more engine specific flags from the entity.
Definition: NSEntity.qc:749
nonvirtual void SetFrame(float)
Sets the framegroup sequence of the entity.
Definition: NSEntity.qc:470
virtual bool CanSpawn(bool clientSide)
Returns if this entity can spawned from the map file.
Definition: NSEntity.qc:1303
nonvirtual vector GetAbsoluteMaxs(void)
Returns the absolute bounding box maxs of the entity, instead of being relative to the world position...
Definition: NSEntity.qc:915
nonvirtual void SetParent(string)
Call this to parent the entity to another entity.
nonvirtual void Hide(void)
When called, the entity will stop being rendered on the client.
Definition: NSEntity.qc:1278
virtual void Save(float)
Handles saving a copy of this entity to a given filehandle.
Definition: NSEntity.qc:1005
nonvirtual void ThinkBusy(float)
When called, will make the entity think busy for the specified amount of time.
Definition: NSEntity.qc:964
virtual void Spawned(void)
Called when the entity is fulled initialized.
Definition: NSEntity.qc:50
nonvirtual bool HeldByPlayer(void)
Returns whether this entity is being held in the hands of a player.
Definition: NSEntity.qc:190
nonvirtual vector WorldSpaceCenter(void)
Returns absolute world coordinates of the center of the entity according to its pivot point.
Definition: NSEntity.qc:105
nonvirtual bool CreatedByMap(void)
Returns if the entity was spawned by the map we're on.
Definition: NSEntity.qc:184
nonvirtual void RemoveVFlags(float)
Remove one or more nuclide specific flags from the entity.
Definition: NSEntity.qc:760
nonvirtual vector NearestWallPointForRadius(float)
Returns the nearest point on a wall of this entity within a specified radius.
Definition: NSEntity.qc:1382
nonvirtual entity GetOwner(void)
Returns the owner of the entity.
Definition: NSEntity.qc:822
nonvirtual void SetScale(float)
Sets the scale of the entity.
Definition: NSEntity.qc:564
nonvirtual void SetParentAttachment(string)
Call this to parent the entity to an attachment of another entity.
nonvirtual float GetModelindex(void)
Returns the model id of the 3D model representation of the entity.
Definition: NSEntity.qc:843
nonvirtual void ClearParent(void)
Call this on an entity to remove the connection to its parent.
nonvirtual entity GetGroundEntity(void)
Returns the entity we're standing on.
Definition: NSEntity.qc:178
nonvirtual float DistanceFromYaw(vector)
Returns a normalized value of how far away the target is from the entity's view direction.
Definition: NSEntity.qc:154
nonvirtual void Relink(void)
Relink the entity against the world.
Definition: NSEntity.qc:1444
nonvirtual bool IsSolid(void)
Returns if the entity is solid or non-solid.
Definition: NSEntity.qc:172
nonvirtual bool StartSound(string, float, float, bool)
Plays a sound sample directly onto the entity.
Definition: NSEntity.qc:1335
nonvirtual float GetVFlags(void)
Returns a nuclide flags bitfield that the entity associates with.
Definition: NSEntity.qc:927
nonvirtual vector GetUp(void)
Returns a normalized up vector of the entity to more easily test what may be above it.
Definition: NSEntity.qc:99
nonvirtual void Event_SpawnDefRelative(string, float, float, float)
Definition: NSEntity.qc:1073
nonvirtual bool IntersectsWith(entity)
Returns whether or not the given entity insersects with us.
Definition: NSEntity.qc:1322
nonvirtual bool HasModel(void)
Returns if this entity has a model set.
Definition: NSEntity.qc:69
virtual void ReceiveEvent(float)
Definition: NSEntity.qc:262
nonvirtual void TurnToPos(vector)
Turns towards the specified position.
Definition: NSEntity.qc:770
nonvirtual void SetAngles(vector)
Sets the direction the entity is facing in eueler angles.
Definition: NSEntity.qc:648
nonvirtual bool VisibleVec(vector)
Returns if the entity is visible from a given position and a field of view of 90 degrees.
Definition: NSEntity.qc:117
nonvirtual void AddAngularVelocity(vector)
Adds onto the existing angular velocity.
Definition: NSEntity.qc:721
nonvirtual void DisablePlayerCollision(void)
Will disable collision with player entities.
Definition: NSEntity.qc:1596
virtual void SetModel(string)
Sets the 3D model representation of the entity from a file path and name.
Definition: NSEntity.qc:694
nonvirtual void Show(void)
When called, will unhide the entity.
Definition: NSEntity.qc:1272
nonvirtual entity GetParent(void)
Returns the entity this is parented to.
nonvirtual void HandleThink(void)
For physics functions only.
Definition: NSEntity.qc:1390
nonvirtual void SetVelocity(vector)
Sets the movement velocity of the given entity.
Definition: NSEntity.qc:526
nonvirtual void Spawn(void)
Definition: NSEntity.qc:38
nonvirtual void ClearAngles(void)
Unsets any any angle related values within the entity.
NSTrigger handles all the non-input as well as Legacy (Quake, GoldSource) style trigger behaviour.
Definition: NSTrigger.h:71
botInfo_t
Definition: botinfo.h:29
typedef enumflags
Defines the valid alignment flags for text fields.
Definition: font.h:37
float flags
Definition: sound.h:114