44 virtual void SpawnKey(
string,
string);
82 virtual void Save(
float);
87 virtual void Restore(
string,
string);
96 virtual void Input(entity,
string,
string);
100 nonvirtual
void UseOutput(entity,
string);
124 nonvirtual
void SaveFloat(
float,
string,
float);
126 nonvirtual
void SaveInt(
float,
string,
int);
128 nonvirtual
void SaveString(
float,
string,
string);
130 nonvirtual
void SaveVector(
float,
string,vector);
132 nonvirtual
void SaveBool(
float,
string,
bool);
134 nonvirtual
void SaveEntity(
float,
string,entity);
157 nonvirtual
int ReadInt(
string);
172 nonvirtual
float GetTime(
void);
178 nonvirtual
void DebugInt(
string,
int);
191 string m_strEditorIcon;
192 string m_strSpawnData;
194 string m_strOnTrigger;
201 string m_strModelEventCB;
209_NSEntLog(
string className,
string functionName,
float edictNum,
string warnMessage)
211 if (autocvar_g_logTimestamps)
212 print(sprintf(
"^9%f ^7%s (%d)^7: %s\n", time, className, edictNum, warnMessage));
214 print(sprintf(
"^7%s (%d)^7: %s\n", className, edictNum, warnMessage));
218_NSEntWarning(
string className,
string functionName,
float edictNum,
string warnMessage)
220 if (autocvar_g_logTimestamps)
221 print(sprintf(
"^9%f ^3%s (%d)^7: %s\n", time, functionName, edictNum, warnMessage));
223 print(sprintf(
"^3%s (%d)^7: %s\n", functionName, edictNum, warnMessage));
227_NSEntError(
string className,
string functionName,
float edictNum,
string warnMessage)
229 if (autocvar_g_logTimestamps)
230 print(sprintf(
"^9%f ^1%s (id: %d)^7: %s\n", time, functionName, edictNum, warnMessage));
232 print(sprintf(
"^1%s (id: %d)^7: %s\n", functionName, edictNum, warnMessage));
238#define EntLog(...) if (autocvar_g_logLevel >= LOGLEVEL_DEBUG) _NSEntLog(classname, __FUNC__, num_for_edict(this), sprintf(__VA_ARGS__))
244#define EntWarning(...) if (autocvar_g_logLevel >= LOGLEVEL_WARNINGS) _NSEntWarning(classname, __FUNC__, num_for_edict(this), sprintf(__VA_ARGS__))
250#define EntError(...) if (autocvar_g_logLevel >= LOGLEVEL_ERRORS) _NSEntError(classname, __FUNC__, num_for_edict(this), sprintf(__VA_ARGS__))
This class is responsible for handling core entity functionality.
Definition: NSIO.h:27
nonvirtual int GetDefInt(string)
Looks up the integer value of a key within this entity's declaration.
Definition: NSIO.qc:117
nonvirtual bool GetDefBool(string)
Looks up the boolean value of a key within this entity's declaration.
Definition: NSIO.qc:111
nonvirtual void SaveFloat(float, string, float)
Saves a floating point key/value pair to a filehandle.
Definition: NSIO.qc:424
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: NSIO.qc:192
nonvirtual void SaveEntity(float, string, entity)
Saves an entity id key/value pair to a filehandle.
Definition: NSIO.qc:448
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: NSIO.qc:198
nonvirtual float GetDefAct(string)
Looks up a sequence from an act of a key within this entity's declaration.
Definition: NSIO.qc:160
virtual void Respawn(void)
Server: Called when the entity first spawns or when game-logic requests the entity to return to its o...
Definition: NSIO.qc:46
nonvirtual float GetDefFloat(string)
Looks up the floating-point value of a key within this entity's declaration.
Definition: NSIO.qc:105
nonvirtual void DebugVector(string, vector)
Debug print for a given vector.
Definition: NSIO.qc:961
void NSIO(void)
Definition: NSIO.qc:18
nonvirtual vector GetDefVector(string)
Looks up the integer value of a key within this entity's declaration.
Definition: NSIO.qc:99
nonvirtual bool GetSpawnBool(string)
Returns the boolean value of a named key in the entity's spawn data.
Definition: NSIO.qc:254
nonvirtual void SaveInt(float, string, int)
Saves a integer key/value pair to a filehandle.
Definition: NSIO.qc:430
nonvirtual int GetSpawnInt(string)
Returns the integer value of a named key in the entity's spawn data.
Definition: NSIO.qc:266
nonvirtual float GetSpawnFloat(string)
Returns the floating-point value of a named key in the entity's spawn data.
Definition: NSIO.qc:260
nonvirtual vector ReadVector(string)
Returns a vector from a string.
Definition: NSIO.qc:235
nonvirtual float GetTime(void)
Get the level time the entity finds itself in.
Definition: NSIO.qc:934
virtual void Input(entity, string, string)
Called when we are being prompted by another object/function with an input message.
Definition: NSIO.qc:391
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: NSIO.qc:166
virtual void Spawned(void)
Called when the entity is fulled initialized.
Definition: NSIO.qc:52
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: NSIO.qc:180
virtual void Restore(string, string)
Similar to NSIO::SpawnKey but for save-game fields.
Definition: NSIO.qc:561
nonvirtual int ReadInt(string)
Returns an integer value from a string.
Definition: NSIO.qc:219
nonvirtual string CreateOutput(string)
Called at the end of setting up an entity's output field.
Definition: NSIO.qc:323
nonvirtual void DebugEntity(string, entity)
Debug print for a given entity.
Definition: NSIO.qc:966
virtual void Save(float)
Handles saving a copy of this entity to a given filehandle.
Definition: NSIO.qc:457
nonvirtual void DebugBool(string, bool)
Debug print for a given boolean.
Definition: NSIO.qc:941
nonvirtual void DebugFloat(string, float)
Debug print for a given float.
Definition: NSIO.qc:946
nonvirtual void SaveBool(float, string, bool)
Saves a boolean key/value pair to a filehandle.
Definition: NSIO.qc:418
nonvirtual void UseOutput(entity, string)
Triggers an output field that has been created beforehand.
Definition: NSIO.qc:302
nonvirtual void SetEditorIcon(string)
Sets the editor icon.
Definition: NSIO.qc:972
virtual void RestoreComplete(void)
Called when the entity has been successfully restored from a savegame file.
Definition: NSIO.qc:861
virtual void OnRemoveEntity(void)
Handles what happens before the entity gets removed from the client game.
Definition: NSIO.qc:70
nonvirtual void DebugString(string, string)
Debug print for a given string.
Definition: NSIO.qc:956
nonvirtual string PrepareOutput(string, string)
Prepares an output field.
Definition: NSIO.qc:381
nonvirtual entity GetSpawnEntity(string, entity)
Returns an entity of a named key in the entity's spawn data.
Definition: NSIO.qc:293
nonvirtual float ReadFloat(string)
Returns a floating point value from a string value.
Definition: NSIO.qc:212
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: NSIO.qc:124
nonvirtual void SaveVector(float, string, vector)
Saves a vector key/value pair to a filehandle.
Definition: NSIO.qc:442
nonvirtual bool CheckOutput(string)
Returns whether the Output is ready, or has done firing - not currently scheduled to fire,...
Definition: NSIO.qc:368
nonvirtual string GetDefString(string)
Looks up the string value of a key within this entity's declaration.
Definition: NSIO.qc:93
nonvirtual string ReadString(string)
Returns a string value from a string (with error checking).
Definition: NSIO.qc:226
nonvirtual vector GetSpawnVector(string)
Returns the vector value of a named key in the entity's spawn data.
Definition: NSIO.qc:287
nonvirtual entity ReadEntity(string)
Reads an entity id from a string and returns the entity.
Definition: NSIO.qc:242
virtual void TransitionComplete(void)
Called when the entity has successfully completed a level transition.
Definition: NSIO.qc:866
nonvirtual void Destroy(void)
When called, will remove the entity from the game entirely.
Definition: NSIO.qc:75
nonvirtual void SaveString(float, string, string)
Saves a string key/value pair to a filehandle.
Definition: NSIO.qc:436
nonvirtual void DebugInt(string, int)
Debug print for a given integer.
Definition: NSIO.qc:951
nonvirtual bool ReadBool(string)
Returns a boolean value from a string.
Definition: NSIO.qc:205
nonvirtual string GetSpawnString(string)
Returns the string value of a named key in the entity's spawn data.
Definition: NSIO.qc:272
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: NSIO.qc:186
virtual void ParentUpdate(void)
Called when we need to re-align the entity to our parent entity.
Definition: NSIO.qc:871
virtual void SpawnKey(string, string)
This method handles entity key/value pairs on map load.
Definition: NSIO.qc:878