Nuclide
Software Development Kit for id Tech
defs.h File Reference
#include "global.h"
#include "cloader.h"
#include "sound.h"
#include "effects.h"
#include "math.h"
#include "../gs-entbase/client/defs.h"
#include "NSDecal.h"
#include "../botlib/botinfo.h"
#include "sentences.h"
#include "NSIO.h"
#include "NSDict.h"
#include "NSTrigger.h"
#include "NSEntity.h"
#include "NSTimer.h"
#include "NSRenderableEntity.h"
#include "NSSurfacePropEntity.h"
#include "NSMoverEntity.h"
#include "NSPhysicsConstraint.h"
#include "NSPhysicsEntity.h"
#include "NSBrushTrigger.h"
#include "NSPointTrigger.h"
#include "NSItem.h"
#include "NSWeapon.h"
#include "NSNavAI.h"
#include "NSWeapon_NSNavAI.h"
#include "NSMonster.h"
#include "NSSquadMonster.h"
#include "NSTalkMonster.h"
#include "NSSpawnPoint.h"
#include "NSSoundScape.h"
#include "NSProjectile.h"
#include "NSSpraylogo.h"
#include "NSPortal.h"
#include "NSDebris.h"
#include "../xr/defs.h"
#include "../botlib/NSBot.h"
#include "NSClient.h"
#include "NSClientSpectator.h"
#include "NSClientPlayer.h"
#include "NSVehicle.h"
#include "materials.h"
#include "damage.h"
#include "flags.h"
#include "entities.h"
#include "events.h"
#include "hitmesh.h"
#include "pmove.h"
#include "memory.h"
#include "platform.h"
#include "propdata.h"
#include "surfaceproperties.h"
#include "decalgroups.h"
#include "colors.h"
#include "motd.h"
#include "util.h"
#include "ammo.h"

Go to the source code of this file.

Macros

#define NETWORKED_INT(x)   int x; int x ##_net;
 
#define NETWORKED_FLOAT(x)   float x; float x ##_net;
 
#define NETWORKED_VECTOR(x)   vector x; vector x ##_net;
 
#define NETWORKED_ENT(x)   entity x; entity x ##_net;
 
#define NETWORKED_STRING(x)   string x; string x ##_net;
 
#define NETWORKED_BOOL(x)   bool x; bool x ##_net;
 
#define NETWORKED_MODELINDEX(x)   float x; float x ##_net;
 
#define NETWORKED_INT_N(x)   int x ##_net;
 
#define NETWORKED_FLOAT_N(x)   float x ##_net;
 
#define NETWORKED_VECTOR_N(x)   vector x ##_net;
 
#define NETWORKED_STRING_N(x)   string x ##_net;
 
#define PREDICTED_INT(x)   int x; int x ##_net;
 
#define PREDICTED_FLOAT(x)   float x; float x ##_net;
 
#define PREDICTED_VECTOR(x)   vector x; vector x ##_net;
 
#define PREDICTED_ENT(x)   entity x; entity x ##_net;
 
#define PREDICTED_STRING(x)   string x; string x ##_net;
 
#define PREDICTED_BOOL(x)   bool x; bool x ##_net;
 
#define PREDICTED_INT_N(x)   int x ##_net;
 
#define PREDICTED_FLOAT_N(x)   float x ##_net;
 
#define PREDICTED_VECTOR_N(x)   vector x ##_net;
 
#define PREDICTED_STRING_N(x)   string x ##_net;
 
#define NSENTITY_READENTITY(x, y)
 
#define NETWORKED_DEFAULT(x, y)   x ##_net = x = y;
 
#define ROLL_BACK(x)   x = x ##_net;
 
#define SAVE_STATE(x)   x ##_net = x;
 
#define SAVE_STATE_FIELD(x, y)   x ##_net[y] = x[y];
 
#define ATTR_CHANGED(x)   (x ##_net != x)
 
#define VEC_CHANGED(x, y)   (x ##_net[y] != x[y])
 
#define MAX_AMMO_TYPES   16i
 
#define BSPVER_PREREL   28
 
#define BSPVER_Q1   29
 
#define BSPVER_HL   30
 
#define BSPVER_Q2   38
 
#define BSPVER_Q2W   69
 
#define BSPVER_Q3   46
 
#define BSPVER_RTCW   47
 
#define BSPVER_RBSP   1
 
#define CLASSEXPORT(a, b)   void a(void) { if (!isfunction(#b)) { self.classname = strcat("spawnfunc_", #b); } else { self.classname = #b; } callfunction(self.classname); }
 
#define INPUT_BUTTON0   0x00000001 /* attack 1*/
 
#define INPUT_BUTTON2   0x00000002 /* jumping */
 
#define INPUT_BUTTON3   0x00000004 /* prone */
 
#define INPUT_BUTTON4   0x00000008 /* reload */
 
#define INPUT_BUTTON5   0x00000010 /* secondary */
 
#define INPUT_BUTTON6   0x00000020 /* use */
 
#define INPUT_BUTTON7   0x00000040 /* reserved */
 
#define INPUT_BUTTON8   0x00000080 /* crouching */
 
#define INPUT_PRIMARY   INPUT_BUTTON0
 
#define INPUT_JUMP   INPUT_BUTTON2
 
#define INPUT_PRONE   INPUT_BUTTON3
 
#define INPUT_RELOAD   INPUT_BUTTON4
 
#define INPUT_SECONDARY   INPUT_BUTTON6
 
#define INPUT_USE   INPUT_BUTTON5 /* This can NEVER change. Engine hard-coded. */
 
#define INPUT_SPRINT   INPUT_BUTTON7
 
#define INPUT_CROUCH   INPUT_BUTTON8
 
#define UPDATE_ALL   16777215
 
#define clamp(d, min, max)   bound(min,d,max)
 

Typedefs

typedef entity id
 

Enumerations

enum  {
  SEARCH_INSENSITIVE , SEARCH_FULLPACKAGE , SEARCH_ALLOWDUPES , SEARCH_FORCESEARCH ,
  SEARCH_MULTISEARCH , SEARCH_NAMESORT
}
 

Functions

void Empty (void)
 
void Util_Destroy (void)
 
string Util_TimeToString (float fTime)
 
bool Util_IsTeamplay (void)
 
bool Util_IsPaused (void)
 
__wrap void dprint (string m)
 
void crossprint (string m)
 
__wrap string precache_sound (string sample)
 
float pseudorandom ()
 
__wrap void setmodel (entity ent, string mname)
 
__wrap __variant * memalloc (int size)
 
__wrap void remove (entity target)
 
__wrap void traceline (vector v1, vector v2, float flags, entity ent)
 
void setorigin_safe (entity target, vector testorg)
 
 void (string cmd) readcmd
 
string Util_FixModel (string mdl)
 
string Util_ChangeExtension (string baseString, string newExtension)
 Returns a string (usually filename) with only the file extension at the end replaced with a given, new extension. More...
 
bool Util_IsSingleplayer (void)
 
float crandom (void)
 
string dirname (string input)
 
string textfile_to_string (string filename)
 
vector Route_GetJumpVelocity (vector vecFrom, vector vecTo, float flGravMod)
 
bool FileExists (string filePath)
 
void DebugBox (vector absPos, vector minSize, vector maxSize, vector boxColor, float boxAlpha)
 

Variables

noref const float SVC_TEMPENTITY = 23
 
string __fullspawndata
 
const vector VEC_HULL_MIN = [-16,-16,-36]
 
const vector VEC_HULL_MAX = [16,16,36]
 
const vector VEC_CHULL_MIN = [-16,-16,-18]
 
const vector VEC_CHULL_MAX = [16,16,18]
 
float jumptime
 
float teleport_time
 
vector basevelocity
 
float gflags
 
noref float input_sequence
 
float identity
 
float removed
 

Macro Definition Documentation

◆ ATTR_CHANGED

#define ATTR_CHANGED (   x)    (x ##_net != x)

◆ BSPVER_HL

#define BSPVER_HL   30

◆ BSPVER_PREREL

#define BSPVER_PREREL   28

◆ BSPVER_Q1

#define BSPVER_Q1   29

◆ BSPVER_Q2

#define BSPVER_Q2   38

◆ BSPVER_Q2W

#define BSPVER_Q2W   69

◆ BSPVER_Q3

#define BSPVER_Q3   46

◆ BSPVER_RBSP

#define BSPVER_RBSP   1

◆ BSPVER_RTCW

#define BSPVER_RTCW   47

◆ clamp

#define clamp (   d,
  min,
  max 
)    bound(min,d,max)

◆ CLASSEXPORT

#define CLASSEXPORT (   a,
 
)    void a(void) { if (!isfunction(#b)) { self.classname = strcat("spawnfunc_", #b); } else { self.classname = #b; } callfunction(self.classname); }

◆ INPUT_BUTTON0

#define INPUT_BUTTON0   0x00000001 /* attack 1*/

◆ INPUT_BUTTON2

#define INPUT_BUTTON2   0x00000002 /* jumping */

◆ INPUT_BUTTON3

#define INPUT_BUTTON3   0x00000004 /* prone */

◆ INPUT_BUTTON4

#define INPUT_BUTTON4   0x00000008 /* reload */

◆ INPUT_BUTTON5

#define INPUT_BUTTON5   0x00000010 /* secondary */

◆ INPUT_BUTTON6

#define INPUT_BUTTON6   0x00000020 /* use */

◆ INPUT_BUTTON7

#define INPUT_BUTTON7   0x00000040 /* reserved */

◆ INPUT_BUTTON8

#define INPUT_BUTTON8   0x00000080 /* crouching */

◆ INPUT_CROUCH

#define INPUT_CROUCH   INPUT_BUTTON8

◆ INPUT_JUMP

#define INPUT_JUMP   INPUT_BUTTON2

◆ INPUT_PRIMARY

#define INPUT_PRIMARY   INPUT_BUTTON0

◆ INPUT_PRONE

#define INPUT_PRONE   INPUT_BUTTON3

◆ INPUT_RELOAD

#define INPUT_RELOAD   INPUT_BUTTON4

◆ INPUT_SECONDARY

#define INPUT_SECONDARY   INPUT_BUTTON6

◆ INPUT_SPRINT

#define INPUT_SPRINT   INPUT_BUTTON7

◆ INPUT_USE

#define INPUT_USE   INPUT_BUTTON5 /* This can NEVER change. Engine hard-coded. */

◆ MAX_AMMO_TYPES

#define MAX_AMMO_TYPES   16i

◆ NETWORKED_BOOL

#define NETWORKED_BOOL (   x)    bool x; bool x ##_net;

◆ NETWORKED_DEFAULT

#define NETWORKED_DEFAULT (   x,
 
)    x ##_net = x = y;

◆ NETWORKED_ENT

#define NETWORKED_ENT (   x)    entity x; entity x ##_net;

◆ NETWORKED_FLOAT

#define NETWORKED_FLOAT (   x)    float x; float x ##_net;

◆ NETWORKED_FLOAT_N

#define NETWORKED_FLOAT_N (   x)    float x ##_net;

◆ NETWORKED_INT

#define NETWORKED_INT (   x)    int x; int x ##_net;

◆ NETWORKED_INT_N

#define NETWORKED_INT_N (   x)    int x ##_net;

◆ NETWORKED_MODELINDEX

#define NETWORKED_MODELINDEX (   x)    float x; float x ##_net;

◆ NETWORKED_STRING

#define NETWORKED_STRING (   x)    string x; string x ##_net;

◆ NETWORKED_STRING_N

#define NETWORKED_STRING_N (   x)    string x ##_net;

◆ NETWORKED_VECTOR

#define NETWORKED_VECTOR (   x)    vector x; vector x ##_net;

◆ NETWORKED_VECTOR_N

#define NETWORKED_VECTOR_N (   x)    vector x ##_net;

◆ NSENTITY_READENTITY

#define NSENTITY_READENTITY (   x,
 
)
Value:
{ \
local x x ##_e = ( x )self;\
if (y == true) { \
self.classname = strcat("spawnfunc_", #x); \
callfunction(self.classname); \
} \
x ##_e.ReceiveEntity( y, readfloat() );\
x ##_e.Relink();\
}

◆ PREDICTED_BOOL

#define PREDICTED_BOOL (   x)    bool x; bool x ##_net;

◆ PREDICTED_ENT

#define PREDICTED_ENT (   x)    entity x; entity x ##_net;

◆ PREDICTED_FLOAT

#define PREDICTED_FLOAT (   x)    float x; float x ##_net;

◆ PREDICTED_FLOAT_N

#define PREDICTED_FLOAT_N (   x)    float x ##_net;

◆ PREDICTED_INT

#define PREDICTED_INT (   x)    int x; int x ##_net;

◆ PREDICTED_INT_N

#define PREDICTED_INT_N (   x)    int x ##_net;

◆ PREDICTED_STRING

#define PREDICTED_STRING (   x)    string x; string x ##_net;

◆ PREDICTED_STRING_N

#define PREDICTED_STRING_N (   x)    string x ##_net;

◆ PREDICTED_VECTOR

#define PREDICTED_VECTOR (   x)    vector x; vector x ##_net;

◆ PREDICTED_VECTOR_N

#define PREDICTED_VECTOR_N (   x)    vector x ##_net;

◆ ROLL_BACK

#define ROLL_BACK (   x)    x = x ##_net;

◆ SAVE_STATE

#define SAVE_STATE (   x)    x ##_net = x;

◆ SAVE_STATE_FIELD

#define SAVE_STATE_FIELD (   x,
 
)    x ##_net[y] = x[y];

◆ UPDATE_ALL

#define UPDATE_ALL   16777215

◆ VEC_CHANGED

#define VEC_CHANGED (   x,
 
)    (x ##_net[y] != x[y])

Typedef Documentation

◆ id

typedef entity id

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SEARCH_INSENSITIVE 
SEARCH_FULLPACKAGE 
SEARCH_ALLOWDUPES 
SEARCH_FORCESEARCH 
SEARCH_MULTISEARCH 
SEARCH_NAMESORT 

Function Documentation

◆ crandom()

float crandom ( void  )

◆ crossprint()

void crossprint ( string  m)

◆ DebugBox()

void DebugBox ( vector  absPos,
vector  minSize,
vector  maxSize,
vector  boxColor,
float  boxAlpha 
)

◆ dirname()

string dirname ( string  input)

◆ dprint()

__wrap void dprint ( string  m)

◆ Empty()

void Empty ( void  )

◆ FileExists()

bool FileExists ( string  filePath)

◆ memalloc()

__wrap __variant * memalloc ( int  size)

◆ precache_sound()

__wrap string precache_sound ( string  sample)

◆ pseudorandom()

float pseudorandom ( )

◆ remove()

__wrap void remove ( entity  target)

◆ Route_GetJumpVelocity()

vector Route_GetJumpVelocity ( vector  vecFrom,
vector  vecTo,
float  flGravMod 
)

◆ setmodel()

__wrap void setmodel ( entity  ent,
string  mname 
)

◆ setorigin_safe()

void setorigin_safe ( entity  target,
vector  testorg 
)

◆ textfile_to_string()

string textfile_to_string ( string  filename)

◆ traceline()

__wrap void traceline ( vector  v1,
vector  v2,
float  flags,
entity  ent 
)

◆ Util_ChangeExtension()

string Util_ChangeExtension ( string  baseString,
string  newExtension 
)

Returns a string (usually filename) with only the file extension at the end replaced with a given, new extension.

◆ Util_Destroy()

void Util_Destroy ( void  )

◆ Util_FixModel()

string Util_FixModel ( string  mdl)

◆ Util_IsPaused()

bool Util_IsPaused ( void  )

◆ Util_IsSingleplayer()

bool Util_IsSingleplayer ( void  )

◆ Util_IsTeamplay()

bool Util_IsTeamplay ( void  )

◆ Util_TimeToString()

string Util_TimeToString ( float  fTime)

◆ void()

void ( string  cmd)

Variable Documentation

◆ __fullspawndata

string __fullspawndata

◆ basevelocity

vector basevelocity

◆ gflags

float gflags

◆ identity

float identity

◆ input_sequence

noref float input_sequence

◆ jumptime

float jumptime

◆ removed

float removed

◆ SVC_TEMPENTITY

noref const float SVC_TEMPENTITY = 23

◆ teleport_time

float teleport_time

◆ VEC_CHULL_MAX

const vector VEC_CHULL_MAX = [16,16,18]

◆ VEC_CHULL_MIN

const vector VEC_CHULL_MIN = [-16,-16,-18]

◆ VEC_HULL_MAX

const vector VEC_HULL_MAX = [16,16,36]

◆ VEC_HULL_MIN

const vector VEC_HULL_MIN = [-16,-16,-36]