Nuclide
Software Development Kit for id Tech
entityDef.qc File Reference

Classes

struct  entityDef_t
 

Macros

#define ENTITYDEF_MAX   256
 

Enumerations

enum  {
  EDEFTWEAK_EQ = 0 , EDEFTWEAK_LT , EDEFTWEAK_GT , EDEFTWEAK_NOT ,
  EDEFTWEAK_CONTAINS
}
 

Functions

void EntityDef_ReadFile (string filePath)
 
void EntityDef_Init (void)
 
NSEntity EntityDef_SpawnClassname (string className)
 When called will turn the entity 'self' into the specified classname. More...
 
NSEntity EntityDef_CreateClassname (string className)
 Spawns an entity of a specific class. More...
 
string EntityDef_GetKeyValue (string className, string keyName)
 Retrieves the value of a specific key defined within an EntityDef. More...
 
bool EntityDef_HasSpawnClass (string className)
 Checks if an entity class was defined in an EntityDef. More...
 
NSEntity Entity_CreateClass (string className)
 Spawns an entity of a class, guaranteed to be valid. More...
 
void EntityDef_DebugList (void)
 

Variables

var string g_lastSpawnData
 
entityDef_t g_entDefTable [256]
 
var int g_entDefCount
 
string g_entDefInclude
 

Macro Definition Documentation

◆ ENTITYDEF_MAX

#define ENTITYDEF_MAX   256

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
EDEFTWEAK_EQ 
EDEFTWEAK_LT 
EDEFTWEAK_GT 
EDEFTWEAK_NOT 
EDEFTWEAK_CONTAINS 

Function Documentation

◆ Entity_CreateClass()

NSEntity Entity_CreateClass ( string  className)

Spawns an entity of a class, guaranteed to be valid.

This is the primary, encouraged method of spawning entities. If you don't spawn an entity class using this, it will not respond to sendInput().

If a specified class does not exist, it will create an info_notnull type entity, but with the new, desired classname.

The only time when this function returns NULL is if the game is unable to allocate any more entities.

Parameters
classNameis the type of class to be instantiated.

◆ EntityDef_CreateClassname()

NSEntity EntityDef_CreateClassname ( string  className)

Spawns an entity of a specific class.

If class doesn't exist, returns NULL.

Parameters
classNameis the type of class to be instantiated.

◆ EntityDef_DebugList()

void EntityDef_DebugList ( void  )

◆ EntityDef_GetKeyValue()

string EntityDef_GetKeyValue ( string  className,
string  keyName 
)

Retrieves the value of a specific key defined within an EntityDef.

Parameters
classNamespecifies which class definition to look in.
keyNamespecifies the 'key' we want to know its value of.

◆ EntityDef_HasSpawnClass()

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.

Parameters
classNamespecifies which class definition to look for.

◆ EntityDef_Init()

void EntityDef_Init ( void  )

◆ EntityDef_ReadFile()

void EntityDef_ReadFile ( string  filePath)

◆ EntityDef_SpawnClassname()

NSEntity EntityDef_SpawnClassname ( string  className)

When called will turn the entity 'self' into the specified classname.

This is useful for entities that are already in the game, and need to transition into a different type of entity.

Parameters
classNameis the type of class to be changed to.

Variable Documentation

◆ g_entDefCount

var int g_entDefCount

◆ g_entDefInclude

string g_entDefInclude

◆ g_entDefTable

entityDef_t g_entDefTable[256]

◆ g_lastSpawnData

var string g_lastSpawnData