Nuclide
Software Development Kit for id Tech
defs.h File Reference
#include "NSOutput.h"
#include "NSGameRules.h"
#include "skill.h"
#include "logging.h"
#include "nodes.h"
#include "spawn.h"
#include "weapons.h"
#include "plugins.h"
#include "NSTraceAttack.h"
#include "../shared/weapons.h"
#include "../shared/weapon_common.h"
#include "route.h"
#include "way.h"
#include "lament.h"

Go to the source code of this file.

Macros

#define EVALUATE_FIELD(fieldname, changedflag)
 
#define EVALUATE_VECTOR(fieldname, id, 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 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 TraceAttack_FireBullets (int, vector, int, vector, int)
 
void TraceAttack_SetPenetrationPower (int)
 
void TraceAttack_SetRangeModifier (float)
 
void Damage_Radius (vector, entity, float, float, int, int)
 
void Damage_Apply (entity, entity, float, int, damageType_t)
 
void Client_FixAngle (entity, vector)
 
void Client_ShakeOnce (vector, float, float, float, float)
 
void Game_ServerModelEvent (float, int, string)
 
void Event_ServerModelEvent (float, int, string)
 
void Mapcycle_Load (string)
 
 void (void) PlayerUse = #30
 
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...
 

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
 
int g_dmg_iRealDamage
 
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:62

◆ EVALUATE_VECTOR

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

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

◆ Damage_Apply()

void Damage_Apply ( entity  t,
entity  c,
float  dmg,
int  w,
damageType_t  type 
)

◆ Damage_Radius()

void Damage_Radius ( vector  org,
entity  attacker,
float  dmg,
float  r,
int  check,
int  w 
)

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

◆ Event_ServerModelEvent()

void Event_ServerModelEvent ( float  flTimeStamp,
int  iCode,
string  strData 
)

◆ Game_ServerModelEvent()

void Game_ServerModelEvent ( float  ,
int  ,
string   
)

◆ main()

void main ( void  )

◆ Mapcycle_Load()

void Mapcycle_Load ( string  filename)

◆ TraceAttack_FireBullets()

void TraceAttack_FireBullets ( int  iShots,
vector  vecPos,
int  iDamage,
vector  vecSpread,
int  iWeapon 
)

◆ TraceAttack_SetPenetrationPower()

void TraceAttack_SetPenetrationPower ( int  power)

◆ TraceAttack_SetRangeModifier()

void TraceAttack_SetRangeModifier ( float  units)

◆ void()

void ( void  ) = #30

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_iRealDamage

int g_dmg_iRealDamage

◆ 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