5 ==============================================================================
7 SOURCE FOR GLOBALVARS_T C STRUCTURE
8 MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
10 ==============================================================================
22 float force_retouch; // force all entities to touch triggers
23 // next frame. this is needed because
24 // non-moving things don't normally scan
25 // for triggers, and when a trigger is
26 // created (like a teleport trigger), it
27 // needs to catch everything.
28 // decremented each frame, so set to 2
29 // to guarantee everything is touched
36 int serverflags; // propagated from level to level, used to
37 // keep track of completed episodes
42 float found_secrets; // number of secrets found
43 float killed_monsters; // number of monsters killed
46 // spawnparms are used to encode information about clients across server
48 float parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16;
51 // global variables set by built in functions
53 vector v_forward, v_up, v_right; // set by makevectors()
55 // set by traceline / tracebox
57 float trace_startsolid;
60 vector trace_plane_normal;
61 float trace_plane_dist;
66 entity msg_entity; // destination of single entity writes
69 // required prog functions
71 void() main; // only for testing
75 void() PlayerPreThink;
76 void() PlayerPostThink;
79 #ifdef DP_EXT_PRECONNECT
80 void() ClientPreConnect;
83 void() PutClientInServer; // call after setting the parm1... parms
84 void() ClientDisconnect;
86 void() SetNewParms; // called when a client first connects to
87 // a server. sets parms so they can be
88 // saved off for restarts
90 void() SetChangeParms; // call to set parms for self so they can
91 // be saved for a level transition
94 //================================================
95 void end_sys_globals; // flag for structure dumping
96 //================================================
99 ==============================================================================
101 SOURCE FOR ENTVARS_T C STRUCTURE
102 MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
104 ==============================================================================
108 // system fields (*** = do not set in prog code, maintained by C code)
110 .int modelindex; // *** model index in the precached list
111 .vector absmin, absmax; // *** origin + mins / maxs
113 .float ltime; // local time for entity
117 .vector origin; // ***
118 .vector oldorigin; // ***
123 .vector punchangle; // temp angle adjust from damage or recoil
125 .string classname; // spawn function
131 .vector mins, maxs; // bounding box extents reletive to origin
132 .vector size; // maxs - mins
137 .void() blocked; // for doors or plats, called when can't push other
140 .entity groundentity;
145 .int weapon; // one of the IT_SHOTGUN, etc flags
149 .float ammo_shells, ammo_nails, ammo_rockets, ammo_cells;
151 .int items; // bit flags
157 .vector view_ofs; // add to origin to get eye point
160 .float button0; // fire
161 .float button1; // use
162 .float button2; // jump
164 .float impulse; // weapon changes
167 .vector v_angle; // view / targeting angle for players
168 .float idealpitch; // calculated pitch angle for lookup up slopes
180 .float max_health; // players maximum health is stored here
182 .float teleport_time; // don't back up
184 .float armortype; // save this fraction of incoming damage
187 .float waterlevel; // 0 = not in, 1 = feet, 2 = wast, 3 = eyes
188 .float watertype; // a contents value
195 .entity goalentity; // a movetarget or an enemy
202 // damage is accumulated through a frame. and sent as one single
203 // message, so the super shotgun doesn't generate huge messages
206 .entity dmg_inflictor;
208 .entity owner; // who launched a missile
209 .vector movedir; // mostly for doors, but also used for waterjump
211 .string message; // trigger messages
213 .float sounds; // either a cd track number or sound number
215 .string noise, noise1, noise2, noise3; // contains names of wavs to play
217 //================================================
218 void end_sys_fields; // flag for structure dumping
219 //================================================
222 ==============================================================================
226 ==============================================================================
235 const int FL_FLY = 1;
236 const int FL_SWIM = 2;
237 const int FL_CLIENT = 8; // set for all client edicts
238 const int FL_INWATER = 16; // for enter / leave water splash
239 const int FL_MONSTER = 32;
240 const int FL_GODMODE = 64; // player cheat
241 const int FL_NOTARGET = 128; // player cheat
242 const int FL_ITEM = 256; // extra wide size for bonus items
243 const int FL_ONGROUND = 512; // standing on something
244 const int FL_PARTIALGROUND = 1024; // not all corners are valid
245 const int FL_WATERJUMP = 2048; // player jumping out of water
246 const int FL_JUMPRELEASED = 4096; // for jump debouncing
248 // edict.movetype values
249 const int MOVETYPE_NONE = 0; // never moves
250 //const int MOVETYPE_ANGLENOCLIP= 1;
251 //const int MOVETYPE_ANGLECLIP = 2;
252 const int MOVETYPE_WALK = 3; // players only
253 const int MOVETYPE_STEP = 4; // discrete, not real time unless fall
254 const int MOVETYPE_FLY = 5;
255 const int MOVETYPE_TOSS = 6; // gravity
256 const int MOVETYPE_PUSH = 7; // no clip to world, push and crush
257 const int MOVETYPE_NOCLIP = 8;
258 const int MOVETYPE_FLYMISSILE = 9; // fly with extra size against monsters
259 const int MOVETYPE_BOUNCE = 10;
260 const int MOVETYPE_BOUNCEMISSILE= 11; // bounce with extra size
262 // edict.solid values
263 const int SOLID_NOT = 0; // no interaction with other objects
264 const int SOLID_TRIGGER = 1; // touch on edge, but not blocking
265 const int SOLID_BBOX = 2; // touch on edge, block
266 const int SOLID_SLIDEBOX = 3; // touch on edge, but not an onground
267 const int SOLID_BSP = 4; // bsp clip, touch on edge, block
270 const int RANGE_MELEE = 0;
271 const int RANGE_NEAR = 1;
272 const int RANGE_MID = 2;
273 const int RANGE_FAR = 3;
277 const int DEAD_NO = 0;
278 const int DEAD_DYING = 1;
279 const int DEAD_DEAD = 2;
280 const int DEAD_RESPAWNABLE = 3;
281 const int DEAD_RESPAWNING = 4; // dead, waiting for buttons to be released
285 const int DAMAGE_NO = 0;
286 const int DAMAGE_YES = 1;
287 const int DAMAGE_AIM = 2;
290 const int IT_AXE = 4096;
291 const int IT_SHOTGUN = 1;
292 const int IT_SUPER_SHOTGUN = 2;
293 const int IT_NAILGUN = 4;
294 const int IT_SUPER_NAILGUN = 8;
295 const int IT_GRENADE_LAUNCHER = 16;
296 const int IT_ROCKET_LAUNCHER = 32;
297 const int IT_LIGHTNING = 64;
298 const int IT_EXTRA_WEAPON = 128;
300 //const int IT_SHELLS = 256;
301 //const int IT_NAILS = 512;
302 //const int IT_ROCKETS = 1024;
303 //const int IT_CELLS = 2048;
305 const int IT_ARMOR1 = 8192;
306 const int IT_ARMOR2 = 16384;
307 const int IT_ARMOR3 = 32768;
308 const int IT_SUPERHEALTH = 65536;
310 //const int IT_KEY1 = 131072;
311 //const int IT_KEY2 = 262144;
313 const int IT_INVISIBILITY = 524288;
314 const int IT_INVULNERABILITY = 1048576;
315 const int IT_SUIT = 2097152;
316 const int IT_QUAD = 4194304;
318 // point content values
320 const int CONTENT_EMPTY = -1;
321 const int CONTENT_SOLID = -2;
322 const int CONTENT_WATER = -3;
323 const int CONTENT_SLIME = -4;
324 const int CONTENT_LAVA = -5;
325 const int CONTENT_SKY = -6;
327 const int STATE_TOP = 0;
328 const int STATE_BOTTOM = 1;
329 const int STATE_UP = 2;
330 const int STATE_DOWN = 3;
332 const vector VEC_ORIGIN = '0 0 0';
333 const vector VEC_HULL_MIN = '-16 -16 -24';
334 const vector VEC_HULL_MAX = '16 16 32';
336 const vector VEC_HULL2_MIN = '-32 -32 -24';
337 const vector VEC_HULL2_MAX = '32 32 64';
340 const int SVC_TEMPENTITY = 23;
341 const int SVC_KILLEDMONSTER = 27;
342 const int SVC_FOUNDSECRET = 28;
343 const int SVC_INTERMISSION = 30;
344 const int SVC_FINALE = 31;
345 const int SVC_CDTRACK = 32;
346 const int SVC_SELLSCREEN = 33;
349 const int TE_SPIKE = 0;
350 const int TE_SUPERSPIKE = 1;
351 const int TE_GUNSHOT = 2;
352 const int TE_EXPLOSION = 3;
353 const int TE_TAREXPLOSION = 4;
354 const int TE_LIGHTNING1 = 5;
355 const int TE_LIGHTNING2 = 6;
356 const int TE_WIZSPIKE = 7;
357 const int TE_KNIGHTSPIKE = 8;
358 const int TE_LIGHTNING3 = 9;
359 const int TE_LAVASPLASH = 10;
360 const int TE_TELEPORT = 11;
363 // channel 0 never willingly overrides
364 // other channels (1-7) allways override a playing sound on that channel
365 const int CHAN_AUTO = 0;
366 const int CHAN_WEAPON = 1;
367 const int CHAN_VOICE = 2;
368 const int CHAN_ITEM = 3;
369 const int CHAN_BODY = 4;
371 const int ATTN_NONE = 0;
372 const int ATTN_NORM = 1;
373 const int ATTN_IDLE = 2;
374 const int ATTN_STATIC = 3;
378 const int UPDATE_GENERAL = 0;
379 const int UPDATE_STATIC = 1;
380 const int UPDATE_BINARY = 2;
381 const int UPDATE_TEMP = 3;
385 const int EF_BRIGHTFIELD = 1;
386 const int EF_MUZZLEFLASH = 2;
387 const int EF_BRIGHTLIGHT = 4;
388 const int EF_DIMLIGHT = 8;
392 const int MSG_BROADCAST = 0; // unreliable to all
393 const int MSG_ONE = 1; // reliable to one (msg_entity)
394 const int MSG_ALL = 2; // reliable to all
395 const int MSG_INIT = 3; // write to the init string
397 //===========================================================================
403 void(vector ang) makevectors = #1; // sets v_forward, etc globals
404 void(entity e, vector o) setorigin = #2;
405 void(entity e, string m) setmodel = #3; // set movetype and solid first
406 void(entity e, vector min, vector max) setsize = #4;
408 void() break_to_debugger = #6;
409 float() random = #7; // returns 0 - 1
410 void(entity e, float chan, string samp, float vol, float atten) sound = #8;
411 vector(vector v) normalize = #9;
412 void(string e, ...) error = #10;
413 void(string e, ...) objerror = #11;
414 float(vector v) vlen = #12;
415 float(vector v) vectoyaw = #13;
416 entity() spawn = #14;
417 void(entity e) remove = #15;
419 // sets trace_* globals
420 // nomonsters can be:
421 // An entity will also be ignored for testing if forent == test,
422 // forent->owner == test, or test->owner == forent
423 // a forent of world is ignored
424 void(vector v1, vector v2, float nomonsters, entity forent) traceline = #16;
426 entity() checkclient = #17; // returns a client to look for
427 entity(entity start, .string fld, string match) find = #18;
428 string(string s) precache_sound = #19;
429 string(string s) precache_model = #20;
430 void(entity client, string s, ...)stuffcmd = #21;
431 entity(vector org, float rad) findradius = #22;
432 void(string s, ...) bprint = #23;
433 void(entity client, string s, ...) sprint = #24;
434 void(string s, ...) dprint = #25;
435 string(float f) ftos = #26;
436 string(vector v) vtos = #27;
437 void() coredump = #28; // prints all edicts
438 void() traceon = #29; // turns statment trace on
439 void() traceoff = #30;
440 void(entity e) eprint = #31; // prints an entire edict
441 float(float yaw, float dist) walkmove = #32; // returns true or false
443 float() droptofloor= #34; // true if landed on floor
444 void(float style, string value) lightstyle = #35;
445 float(float v) rint = #36; // round to nearest int
446 float(float v) floor = #37; // largest integer <= v
447 float(float v) ceil = #38; // smallest integer >= v
449 float(entity e) checkbottom = #40; // true if self is on ground
450 float(vector v) pointcontents = #41; // returns a CONTENT_*
452 float(float f) fabs = #43;
453 vector(entity e, float speed) aim = #44; // returns the shooting vector
454 float(string s) cvar = #45; // return cvar.value
455 void(string s, ...) localcmd = #46; // put string into local que
456 entity(entity e) nextent = #47; // for looping through all ents
457 void(vector o, vector d, float color, float count) particle = #48;// start a particle effect
458 void() ChangeYaw = #49; // turn towards self.ideal_yaw
461 vector(vector v) vectoangles = #51;
464 // direct client message generation
466 void(float to, float f) WriteByte = #52;
467 void(float to, float f) WriteChar = #53;
468 void(float to, float f) WriteShort = #54;
469 void(float to, float f) WriteLong = #55;
470 void(float to, float f) WriteCoord = #56;
471 void(float to, float f) WriteAngle = #57;
472 void(float to, string s, ...) WriteString = #58;
473 void(float to, entity s) WriteEntity = #59;
476 // broadcast client message generation
479 // void(float f) bWriteByte = #59;
480 // void(float f) bWriteChar = #60;
481 // void(float f) bWriteShort = #61;
482 // void(float f) bWriteLong = #62;
483 // void(float f) bWriteCoord = #63;
484 // void(float f) bWriteAngle = #64;
485 // void(string s) bWriteString = #65;
486 // void(entity e) bWriteEntity = #66;
488 void(float step) movetogoal = #67;
490 string(string s) precache_file = #68; // no effect except for -copy
491 void(entity e) makestatic = #69;
492 void(string s) changelevel = #70;
496 void(string name, string value) cvar_set = #72; // sets cvar.value
498 void(entity client, string s, ...) centerprint = #73; // sprint, but in middle
500 void(vector pos, string samp, float vol, float atten) ambientsound = #74;
502 string(string s) precache_model2 = #75; // registered version only
503 string(string s) precache_sound2 = #76; // registered version only
504 string(string s) precache_file2 = #77; // registered version only
506 void(entity e) setspawnparms = #78; // set parm1... to the
507 // values at level start
510 //============================================================================