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