98 virtual void SpawnKey(
string,
string);
133 nonvirtual
void Relink(
void);
162 virtual void Save(
float);
167 virtual void Restore(
string,
string);
176 virtual void Input(entity,
string,
string);
180 nonvirtual
void UseOutput(entity,
string);
204 nonvirtual
void SaveFloat(
float,
string,
float);
206 nonvirtual
void SaveInt(
float,
string,
int);
208 nonvirtual
void SaveString(
float,
string,
string);
210 nonvirtual
void SaveVector(
float,
string,vector);
212 nonvirtual
void SaveBool(
float,
string,
bool);
214 nonvirtual
void SaveEntity(
float,
string,entity);
243 nonvirtual
int ReadInt(
string);
258 nonvirtual
float GetTime(
void);
264 nonvirtual
void DebugInt(
string,
int);
275 string m_rawSpawnData;
277 string m_outputOnSpawn;
278 string m_outputOnKilled;
279 string m_outputOnTrigger;
280 string m_outputOnUser1;
281 string m_outputOnUser2;
282 string m_outputOnUser3;
283 string m_outputOnUser4;
286 string m_modelEventCallbacks;
287 string m_gameModeFilter;
291#define CREATE_OUTPUT(x) if (STRING_SET(x)) { \
292 x = CreateOutput(x); \
297#define CGENT_LOG imageToConsole("gfx/icon16/brick", ICN_SIZE, "Client Entity Log")
298#define CGENT_WARNING imageToConsole("gfx/icon16/brick_error", ICN_SIZE, "Client Entity Warning")
299#define CGENT_ERROR imageToConsole("gfx/icon16/brick_delete", ICN_SIZE, "Client Entity Error")
301#define SVENT_LOG imageToConsole("gfx/icon16/brick", ICN_SIZE, "Server Entity Log")
302#define SVENT_WARNING imageToConsole("gfx/icon16/brick_error", ICN_SIZE, "Server Entity Warning")
303#define SVENT_ERROR imageToConsole("gfx/icon16/brick_delete", ICN_SIZE, "Server Entity Error")
306_NSEntLog(
string className,
string functionName,
float edictNum,
string warnMessage)
309 if (autocvar_g_logTimestamps)
310 print(sprintf(
"%s ^9%f ^7%s (%d)^7: %s\n", SVENT_LOG, time, className, edictNum, warnMessage));
312 print(sprintf(
"%s ^7%s (%d)^7: %s\n", SVENT_LOG, className, edictNum, warnMessage));
315 if (autocvar_g_logTimestamps)
316 print(sprintf(
"%s ^9%f ^7%s (%d)^7: %s\n", CGENT_LOG, time, className, edictNum, warnMessage));
318 print(sprintf(
"%s ^7%s (%d)^7: %s\n", CGENT_LOG, className, edictNum, warnMessage));
323_NSEntWarning(
string className,
string functionName,
float edictNum,
string warnMessage)
326 if (autocvar_g_logTimestamps)
327 print(sprintf(
"%s ^9%f ^3%s (%d)^1: %s\n", SVENT_WARNING, time, functionName, edictNum, warnMessage));
329 print(sprintf(
"%s ^3%s (%d)^1: %s\n", SVENT_WARNING, functionName, edictNum, warnMessage));
332 if (autocvar_g_logTimestamps)
333 print(sprintf(
"%s ^9%f ^3%s (%d)^1: %s\n", CGENT_WARNING, time, functionName, edictNum, warnMessage));
335 print(sprintf(
"%s ^3%s (%d)^1: %s\n", CGENT_WARNING, functionName, edictNum, warnMessage));
340_NSEntError(
string className,
string functionName,
float edictNum,
string warnMessage)
343 if (autocvar_g_logTimestamps)
344 print(sprintf(
"%s ^9%f ^1%s (id: %d)^1: %s\n", SVENT_ERROR, time, functionName, edictNum, warnMessage));
346 print(sprintf(
"%s ^1%s (id: %d)^1: %s\n", SVENT_ERROR, functionName, edictNum, warnMessage));
349 if (autocvar_g_logTimestamps)
350 print(sprintf(
"%s ^9%f ^1%s (id: %d)^1: %s\n", CGENT_ERROR, time, functionName, edictNum, warnMessage));
352 print(sprintf(
"%s ^1%s (id: %d)^1: %s\n", CGENT_ERROR, functionName, edictNum, warnMessage));
360#define EntLog(...) if (autocvar_g_logLevel >= LOGLEVEL_DEBUG) _NSEntLog(classname, __FUNC__, num_for_edict(this), sprintf(__VA_ARGS__))
366#define EntWarning(...) if (autocvar_g_logLevel >= LOGLEVEL_WARNINGS) _NSEntWarning(classname, __FUNC__, num_for_edict(this), sprintf(__VA_ARGS__))
372#define EntError(...) if (autocvar_g_logLevel >= LOGLEVEL_ERRORS) _NSEntError(classname, __FUNC__, num_for_edict(this), sprintf(__VA_ARGS__))
virtual void OnRemoveEntity(void)
Handles what happens before the entity gets removed from the client game.
Definition IO.qc:102
nonvirtual float GetSubDefFloat(string, string)
Like GetDefFloat, but queries a specified def, falling back to reading from our own if it's not defin...
Definition IO.qc:205
nonvirtual bool ReadBool(string)
Returns a boolean value from a string.
Definition IO.qc:224
nonvirtual float GetDefAct(string)
Looks up a sequence from an act of a key within this entity's declaration.
Definition IO.qc:179
nonvirtual bool CheckOutput(string)
Returns whether the Output is ready, or has done firing - not currently scheduled to fire,...
Definition IO.qc:401
nonvirtual void DebugEntity(string, entity)
Debug print for a given entity.
Definition IO.qc:683
nonvirtual void ScheduleThink(void(void), float)
Schedules a think timer.
Definition IO.qc:740
nonvirtual void DebugString(string, string)
Debug print for a given string.
Definition IO.qc:673
nonvirtual int GetDefInt(string)
Looks up the integer value of a key within this entity's declaration.
Definition IO.qc:166
nonvirtual string CreateOutput(string)
Called at the end of setting up an entity's output field.
Definition IO.qc:346
virtual void Respawn(void)
Server: Called when the entity first spawns or when game-logic requests the entity to return to its o...
Definition IO.qc:56
nonvirtual string GetDefString(string)
Looks up the string value of a key within this entity's declaration.
Definition IO.qc:142
nonvirtual void DebugBool(string, bool)
Debug print for a given boolean.
Definition IO.qc:658
nonvirtual string ReadString(string)
Returns a string value from a string (with error checking).
Definition IO.qc:245
nonvirtual void SetThink(void())
Overrides the Think function of the entity.
Definition IO.qc:717
virtual void SpawnKey(string, string)
This method handles entity key/value pairs on map load.
Definition IO.qc:586
nonvirtual float GetSubDefAct(string, string)
Like GetDefAct, but queries a specified def, falling back to reading from our own if it's not defined...
Definition IO.qc:173
nonvirtual float GetSpawnFloat(string)
Returns the floating-point value of a named key in the entity's spawn data.
Definition IO.qc:279
virtual void ParentUpdate(void)
Called when we need to re-align the entity to our parent entity.
Definition IO.qc:555
virtual void Spawned(void)
Called when the entity is fulled initialized.
Definition IO.qc:67
nonvirtual float GetDefFloat(string)
Looks up the floating-point value of a key within this entity's declaration.
Definition IO.qc:154
nonvirtual void SaveEntity(float, string, entity)
Saves an entity id key/value pair to a filehandle.
Definition IO.qc:491
nonvirtual void Relink(void)
Relink the entity against the world.
Definition IO.qc:579
nonvirtual void SaveFloat(float, string, float)
Saves a floating point key/value pair to a filehandle.
Definition IO.qc:467
nonvirtual bool GetSpawnBool(string)
Returns the boolean value of a named key in the entity's spawn data.
Definition IO.qc:273
nonvirtual void SetSendFlags(float)
Overrides the field that's used to determine which information should be networked.
Definition IO.qc:561
virtual void _ReceiveComplete(float, float)
Called once ReceiveEntity has done its job.
Definition IO.qc:572
nonvirtual vector GetSpawnVector(string)
Returns the vector value of a named key in the entity's spawn data.
Definition IO.qc:306
nonvirtual void SaveInt(float, string, int)
Saves a integer key/value pair to a filehandle.
Definition IO.qc:473
nonvirtual void SetNextThink(float)
Sets the next think timer of the entity.
Definition IO.qc:723
nonvirtual float GetTime(void)
Get the level time the entity finds itself in.
Definition IO.qc:651
nonvirtual void SaveVector(float, string, vector)
Saves a vector key/value pair to a filehandle.
Definition IO.qc:485
nonvirtual bool GetDefBool(string)
Looks up the boolean value of a key within this entity's declaration.
Definition IO.qc:160
nonvirtual void DebugFloat(string, float)
Debug print for a given float.
Definition IO.qc:663
virtual void ReloadCachedAttributes(void)
Shared: Called on launch/reload to read variables from defaults.
Definition IO.qc:62
nonvirtual int GetSubDefInt(string, string)
Like GetDefInt, but queries a specified def, falling back to reading from our own if it's not defined...
Definition IO.qc:217
nonvirtual void ThinkBusy(float)
When called, will make the entity think busy for the specified amount of time.
Definition IO.qc:708
nonvirtual vector ReadVector(string)
Returns a vector from a string.
Definition IO.qc:254
nonvirtual void DebugVector(string, vector)
Debug print for a given vector.
Definition IO.qc:678
nonvirtual void SaveBool(float, string, bool)
Saves a boolean key/value pair to a filehandle.
Definition IO.qc:461
nonvirtual vector GetSubDefVector(string, string)
Like GetDefVector, but queries a specified def, falling back to reading from our own if it's not defi...
Definition IO.qc:199
nonvirtual string GetSubDefString(string, string)
Like GetDefString, but queries a specified def, falling back to reading from our own if it's not defi...
Definition IO.qc:185
virtual void Input(entity, string, string)
Called when we are being prompted by another object/function with an input message.
Definition IO.qc:424
nonvirtual float GetNextThinkTime(void)
Returns an absolute value of when the entity will be think again.
Definition IO.qc:689
nonvirtual entity GetSpawnEntity(string, entity)
Returns an entity of a named key in the entity's spawn data.
Definition IO.qc:312
nonvirtual string PrepareOutput(string, string)
Prepares an output field.
Definition IO.qc:414
nonvirtual entity ReadEntity(string)
Reads an entity id from a string and returns the entity.
Definition IO.qc:261
nonvirtual void Destroy(void)
When called, will remove the entity from the game entirely.
Definition IO.qc:107
nonvirtual vector GetDefVector(string)
Looks up the integer value of a key within this entity's declaration.
Definition IO.qc:148
void ncIO(void)
Definition IO.qc:18
nonvirtual bool IsThinking(void)
Returns whether or not we're currently expecting to think any time soon.
Definition IO.qc:695
virtual void RestoreComplete(void)
Called when the entity has been successfully restored from a savegame file.
Definition IO.qc:545
virtual void TransitionComplete(void)
Called when the entity has successfully completed a level transition.
Definition IO.qc:550
nonvirtual void SaveString(float, string, string)
Saves a string key/value pair to a filehandle.
Definition IO.qc:479
virtual void Save(float)
Handles saving a copy of this entity to a given filehandle.
Definition IO.qc:500
nonvirtual string GetSpawnString(string)
Returns the string value of a named key in the entity's spawn data.
Definition IO.qc:291
nonvirtual bool GetSubDefBool(string, string)
Like GetDefBool, but queries a specified def, falling back to reading from our own if it's not define...
Definition IO.qc:211
nonvirtual void ReleaseThink(void)
When called, will unset anything related to ongoing think operations.
Definition IO.qc:701
nonvirtual void UseOutput(entity, string)
Triggers an output field that has been created beforehand.
Definition IO.qc:321
nonvirtual void DebugInt(string, int)
Debug print for a given integer.
Definition IO.qc:668
nonvirtual int ReadInt(string)
Returns an integer value from a string.
Definition IO.qc:238
nonvirtual float ReadFloat(string)
Returns a floating point value from a string value.
Definition IO.qc:231
nonvirtual int GetSpawnInt(string)
Returns the integer value of a named key in the entity's spawn data.
Definition IO.qc:285
virtual void Restore(string, string)
Similar to ncIO::SpawnKey() but for save-game fields.
Definition IO.qc:514