Nuclide
Software Development Kit for id Tech
|
Entity class declaration system. More...
Classes | |
struct | entityDef_t |
Data holding EntityDef entries. More... | |
Macros | |
#define | ENTITYDEF_MAX 256 |
Can be redefined in the server its progs.src file. More... | |
Enumerations | |
enum | { EDEFTWEAK_EQ = 0 , EDEFTWEAK_LT , EDEFTWEAK_GT , EDEFTWEAK_NOT , EDEFTWEAK_CONTAINS } |
Options for EntityDef checks. More... | |
Functions | |
void | EntityDef_Init (void) |
void | EntityDef_DebugList (void) |
string | EntityDef_GetKeyValue (string, string) |
Retrieves the value of a specific key defined within an EntityDef. More... | |
int | EntityDef_IDFromName (string) |
string | EntityDef_NameFromID (int) |
string | EntityDef_GetSpawnData (int) |
bool | EntityDef_HasSpawnClass (string className) |
Checks if an entity class was defined in an EntityDef. More... | |
bool | EntityDef_Precache (string) |
NSEntity | Entity_CreateClass (string className) |
Always returns a valid entity. More... | |
Entity class declaration system.
These definitions are a further abstraction from how we view entity definitions. this system tries to be mostly compatible with the def system in id Tech 4 (Doom 3, Quake 4, Prey, etc.)
The first references to such a system existing can be found when Team Fortress Software was working on Team Fortress 2, originally on Quake II's engine.
The gist is, that an entity def can set a base spawnclass (e.g. func_door) and populate it with key/value pairs.
Using this example definition, we can re-invent func_illusionary using an already existing entity class (func_wall) and making it non-solid:
We also have features exclusive to our entityDef format. In the following example, you can change the body
key equals 1
, the switch will skin
to id 4
. You can as many conditions as you like.
Will allow developers to configure other fields when certain conditions are met.
This is also expanded to include model event callbacks to the tried and true I/O system:
#define ENTITYDEF_MAX 256 |
Can be redefined in the server its progs.src file.
anonymous enum |
Always returns a valid entity.
Spawns an entity of a class, guaranteed to be valid.
Even if the entity def does not exist.
Retrieves the value of a specific key defined within an EntityDef.
className | specifies which class definition to look in. |
keyName | specifies the 'key' we want to know its value of. |
string EntityDef_GetSpawnData | ( | int | defNum | ) |
bool EntityDef_HasSpawnClass | ( | string | className | ) |
Checks if an entity class was defined in an EntityDef.
You can then use EntityDef_GetKeyValue() to get various key values from said EntityDef.
className | specifies which class definition to look for. |
int EntityDef_IDFromName | ( | string | defName | ) |
string EntityDef_NameFromID | ( | int | defNum | ) |
bool EntityDef_Precache | ( | string | defName | ) |