Nuclide
Software Development Kit for id Tech
defs.h File Reference
#include "../shared/entityDef.h"
#include "NSOutput.h"
#include "NSGameRules.h"
#include "skill.h"
#include "logging.h"
#include "../nav/defs.h"
#include "spawn.h"
#include "plugins.h"
#include "lament.h"
#include "vote.h"
#include "mapcycle.h"
#include "maptweaks.h"

Go to the source code of this file.

Macros

#define EVALUATE_FIELD(fieldname, changedflag)
 
#define EVALUATE_VECTOR(fieldname, idx, changedflag)
 
#define SENDENTITY_BYTE(field, changedflag)
 
#define SENDENTITY_SHORT(field, changedflag)
 
#define SENDENTITY_INT(field, changedflag)
 
#define SENDENTITY_FLOAT(field, changedflag)
 
#define SENDENTITY_STRING(field, changedflag)
 
#define SENDENTITY_COORD(field, changedflag)
 
#define SENDENTITY_ANGLE(field, changedflag)
 
#define SENDENTITY_ENTITY(field, changedflag)
 
#define SENDENTITY_COLOR(field, changedflag)
 
#define SENDENTITY_MODELINDEX(field, changedflag)
 
#define SAVE_DECIMAL(x, y, z)   fputs(x, sprintf("%S \"%d\" ", y, z))
 
#define SAVE_INTEGER(x, y, z)   fputs(x, sprintf("%S \"%i\" ", y, z))
 
#define SAVE_FLOAT(x, y, z)   fputs(x, sprintf("%S \"%f\" ", y, z))
 
#define SAVE_VECTOR(x, y, z)   fputs(x, sprintf("%S \"%v\" ", y, z))
 
#define SAVE_STRING(x, y, z)   fputs(x, sprintf("%S \"%s\" ", y, z))
 
#define SAVE_HEX(x, y, z)   fputs(x, sprintf("%S \"%x\" ", y, z))
 

Functions

void Client_FixAngle (entity, vector)
 
void Client_ShakeOnce (vector, float, float, float, float)
 
void Mapcycle_Load (string)
 
 void (void) PlayerUse
 
void main (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...
 
NSEntity Entity_CreateClass (string className)
 Spawns an entity of a class, guaranteed to be valid. More...
 
bool EntityDef_HasSpawnClass (string className)
 Checks if an entity class was defined in an EntityDef. More...
 
string EntityDef_GetKeyValue (string className, string keyName)
 Retrieves the value of a specific key defined within an EntityDef. More...
 
void WriteEntityEvent (float to, entity targetEntity, float eventType)
 

Variables

var bool g_isloading = false
 
var bool autocvar_mp_flashlight = true
 
NSEntity eActivator
 
bool iBleeds
 
entity eUser
 
float material
 
float deaths
 
float botinfo
 
entity real_owner
 
int trace_surfaceflagsi
 
string startspot
 
string __fullspawndata
 
NSEntity g_dmg_eAttacker
 
NSEntity g_dmg_eTarget
 
int g_dmg_iDamage
 
bodyType_t g_dmg_iHitBody
 
int g_dmg_iFlags
 
int g_dmg_iWeapon
 
vector g_dmg_vecLocation
 
var bool g_ents_initialized = FALSE
 

Macro Definition Documentation

◆ EVALUATE_FIELD

#define EVALUATE_FIELD (   fieldname,
  changedflag 
)
Value:
{\
if (ATTR_CHANGED(fieldname)) {\
SetSendFlags(changedflag);\
}\
SAVE_STATE(fieldname);\
}
#define ATTR_CHANGED(x)
Definition: defs.h:65

◆ EVALUATE_VECTOR

#define EVALUATE_VECTOR (   fieldname,
  idx,
  changedflag 
)
Value:
{\
if (VEC_CHANGED(fieldname, idx)) {\
SetSendFlags(changedflag);\
}\
SAVE_STATE_FIELD(fieldname, idx);\
}
#define VEC_CHANGED(x, y)
Definition: defs.h:66

◆ SAVE_DECIMAL

#define SAVE_DECIMAL (   x,
  y,
 
)    fputs(x, sprintf("%S \"%d\" ", y, z))

◆ SAVE_FLOAT

#define SAVE_FLOAT (   x,
  y,
 
)    fputs(x, sprintf("%S \"%f\" ", y, z))

◆ SAVE_HEX

#define SAVE_HEX (   x,
  y,
 
)    fputs(x, sprintf("%S \"%x\" ", y, z))

◆ SAVE_INTEGER

#define SAVE_INTEGER (   x,
  y,
 
)    fputs(x, sprintf("%S \"%i\" ", y, z))

◆ SAVE_STRING

#define SAVE_STRING (   x,
  y,
 
)    fputs(x, sprintf("%S \"%s\" ", y, z))

◆ SAVE_VECTOR

#define SAVE_VECTOR (   x,
  y,
 
)    fputs(x, sprintf("%S \"%v\" ", y, z))

◆ SENDENTITY_ANGLE

#define SENDENTITY_ANGLE (   field,
  changedflag 
)
Value:
{\
if (flChanged & changedflag)\
WriteAngle(MSG_ENTITY, field);\
}

◆ SENDENTITY_BYTE

#define SENDENTITY_BYTE (   field,
  changedflag 
)
Value:
{\
if (flChanged & changedflag)\
WriteByte(MSG_ENTITY, field);\
}

◆ SENDENTITY_COLOR

#define SENDENTITY_COLOR (   field,
  changedflag 
)
Value:
{\
if (flChanged & changedflag)\
WriteByte(MSG_ENTITY, field * 255.0);\
}

◆ SENDENTITY_COORD

#define SENDENTITY_COORD (   field,
  changedflag 
)
Value:
{\
if (flChanged & changedflag)\
WriteCoord(MSG_ENTITY, field);\
}

◆ SENDENTITY_ENTITY

#define SENDENTITY_ENTITY (   field,
  changedflag 
)
Value:
{\
if (flChanged & changedflag)\
WriteEntity(MSG_ENTITY, field);\
}

◆ SENDENTITY_FLOAT

#define SENDENTITY_FLOAT (   field,
  changedflag 
)
Value:
{\
if (flChanged & changedflag)\
WriteFloat(MSG_ENTITY, field);\
}

◆ SENDENTITY_INT

#define SENDENTITY_INT (   field,
  changedflag 
)
Value:
{\
if (flChanged & changedflag)\
WriteInt(MSG_ENTITY, field);\
}

◆ SENDENTITY_MODELINDEX

#define SENDENTITY_MODELINDEX (   field,
  changedflag 
)
Value:
{\
if (flChanged & changedflag)\
WriteShort(MSG_ENTITY, field);\
}

◆ SENDENTITY_SHORT

#define SENDENTITY_SHORT (   field,
  changedflag 
)
Value:
{\
if (flChanged & changedflag)\
WriteShort(MSG_ENTITY, field);\
}

◆ SENDENTITY_STRING

#define SENDENTITY_STRING (   field,
  changedflag 
)
Value:
{\
if (flChanged & changedflag)\
WriteString(MSG_ENTITY, field);\
}

Function Documentation

◆ Client_FixAngle()

void Client_FixAngle ( entity  target,
vector  ang 
)

◆ Client_ShakeOnce()

void Client_ShakeOnce ( vector  pos,
float  radius,
float  duration,
float  frequency,
float  amplitude 
)

◆ 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.

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

Even if the entity def does not exist.

◆ 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_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_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.

◆ main()

void main ( void  )

◆ Mapcycle_Load()

void Mapcycle_Load ( string  filename)

◆ void()

void ( void  )

◆ WriteEntityEvent()

void WriteEntityEvent ( float  to,
entity  targetEntity,
float  eventType 
)

Variable Documentation

◆ __fullspawndata

string __fullspawndata

◆ autocvar_mp_flashlight

var bool autocvar_mp_flashlight = true

◆ botinfo

float botinfo

◆ deaths

float deaths

◆ eActivator

NSEntity eActivator

◆ eUser

entity eUser

◆ g_dmg_eAttacker

NSEntity g_dmg_eAttacker

◆ g_dmg_eTarget

NSEntity g_dmg_eTarget

◆ g_dmg_iDamage

int g_dmg_iDamage

◆ g_dmg_iFlags

int g_dmg_iFlags

◆ g_dmg_iHitBody

bodyType_t g_dmg_iHitBody

◆ g_dmg_iWeapon

int g_dmg_iWeapon

◆ g_dmg_vecLocation

vector g_dmg_vecLocation

◆ g_ents_initialized

var bool g_ents_initialized = FALSE

◆ g_isloading

var bool g_isloading = false

◆ iBleeds

bool iBleeds

◆ material

float material

◆ real_owner

entity real_owner

◆ startspot

string startspot

◆ trace_surfaceflagsi

int trace_surfaceflagsi