2 ==============================================================================
4 SOURCE FOR GLOBALVARS_T C STRUCTURE
5 MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
7 ==============================================================================
19 float player_localentnum; //the entnum
20 float player_localnum; //the playernum
21 float maxclients; //a constant filled in by the engine. gah, portability eh?
23 float clientcommandframe; //player movement
24 float servercommandframe; //clientframe echoed off the server
29 // global variables set by built in functions
31 vector v_forward, v_up, v_right; // set by makevectors()
33 // set by traceline / tracebox
35 float trace_startsolid;
38 vector trace_plane_normal;
39 float trace_plane_dist;
45 // required prog functions
49 float(float f, float t, float n) CSQC_InputEvent;
50 void(float w, float h) CSQC_UpdateView;
51 float(string s) CSQC_ConsoleCommand;
53 //these fields are read and set by the default player physics
58 //retrieved from the current movement commands (read by player physics)
59 float input_timelength;
61 vector input_movevalues; //forwards, right, up.
62 float input_buttons; //attack, use, jump (default physics only uses jump)
64 float movevar_gravity;
65 float movevar_stopspeed;
66 float movevar_maxspeed;
67 float movevar_spectatormaxspeed; //used by NOCLIP movetypes.
68 float movevar_accelerate;
69 float movevar_airaccelerate;
70 float movevar_wateraccelerate;
71 float movevar_friction;
72 float movevar_waterfriction;
73 float movevar_entgravity; //the local player's gravity field. Is a multiple (1 is the normal value)
75 //================================================
76 void end_sys_globals; // flag for structure dumping
77 //================================================
80 ==============================================================================
82 SOURCE FOR ENTVARS_T C STRUCTURE
83 MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
85 ==============================================================================
89 // system fields (*** = do not set in prog code, maintained by C code)
91 .float modelindex; // *** model index in the precached list
92 .vector absmin, absmax; // *** origin + mins / maxs
94 .float entnum; // *** the ent number as on the server
101 .vector origin; // ***
102 .vector oldorigin; // ***
107 .string classname; // spawn function
113 .vector mins, maxs; // bounding box extents reletive to origin
114 .vector size; // maxs - mins
119 .void() blocked; // for doors or plats, called when can't push other
133 .entity owner; // who launched a missile
135 //================================================
136 void end_sys_fields; // flag for structure dumping
137 //================================================
140 ==============================================================================
142 OPTIONAL FIELDS AND GLOBALS
144 ==============================================================================
147 // Additional OPTIONAL Fields and Globals
148 float intermission; // indicates intermission state (0 = normal, 1 = scores, 2 = finale text)
150 vector view_angles; // same as input_angles
151 vector view_punchangle; // from server
152 vector view_punchvector; // from server
155 ==============================================================================
159 ==============================================================================
162 const float MASK_ENGINE = 1;
163 const float MASK_ENGINEVIEWMODELS = 2;
164 const float MASK_NORMAL = 4;
166 const float RF_VIEWMODEL = 1;
167 const float RF_EXTERNALMODEL = 2;
168 const float RF_DEPTHHACK = 4;
169 const float RF_ADDATIVE = 8;
170 const float RF_USEAXIS = 16;
172 const float VF_MIN = 1; //(vector)
173 const float VF_MIN_X = 2; //(float)
174 const float VF_MIN_Y = 3; //(float)
175 const float VF_SIZE = 4; //(vector) (viewport size)
176 const float VF_SIZE_Y = 5; //(float)
177 const float VF_SIZE_X = 6; //(float)
178 const float VF_VIEWPORT = 7; //(vector, vector)
179 const float VF_FOV = 8; //(vector)
180 const float VF_FOVX = 9; //(float)
181 const float VF_FOVY = 10; //(float)
182 const float VF_ORIGIN = 11; //(vector)
183 const float VF_ORIGIN_X = 12; //(float)
184 const float VF_ORIGIN_Y = 13; //(float)
185 const float VF_ORIGIN_Z = 14; //(float)
186 const float VF_ANGLES = 15; //(vector)
187 const float VF_ANGLES_X = 16; //(float)
188 const float VF_ANGLES_Y = 17; //(float)
189 const float VF_ANGLES_Z = 18; //(float)
190 const float VF_DRAWWORLD = 19; //(float)
191 const float VF_DRAWENGINESBAR = 20; //(float)
192 const float VF_DRAWCROSSHAIR = 21; //(float)
194 const float VF_CL_VIEWANGLES = 33; //(vector)
195 const float VF_CL_VIEWANGLES_X = 34; //(float)
196 const float VF_CL_VIEWANGLES_Y = 35; //(float)
197 const float VF_CL_VIEWANGLES_Z = 36; //(float)
199 const float VF_PERSPECTIVE = 200;
201 const float STAT_HEALTH = 0;
202 const float STAT_WEAPONMODEL = 2;
203 const float STAT_AMMO = 3;
204 const float STAT_ARMOR = 4;
205 const float STAT_WEAPONFRAME = 5;
206 const float STAT_SHELLS = 6;
207 const float STAT_NAILS = 7;
208 const float STAT_ROCKETS = 8;
209 const float STAT_CELLS = 9;
210 const float STAT_ACTIVEWEAPON = 10;
211 const float STAT_TOTALSECRETS = 11;
212 const float STAT_TOTALMONSTERS = 12;
213 const float STAT_SECRETS = 13;
214 const float STAT_MONSTERS = 14;
215 const float STAT_ITEMS = 15;
216 const float STAT_VIEWHEIGHT = 16;
218 // Quake Sound Constants
219 const float CHAN_AUTO = 0;
220 const float CHAN_WEAPON = 1;
221 const float CHAN_VOICE = 2;
222 const float CHAN_ITEM = 3;
223 const float CHAN_BODY = 4;
225 const float ATTN_NONE = 0;
226 const float ATTN_NORM = 1;
227 const float ATTN_IDLE = 2;
228 const float ATTN_STATIC = 3;
230 // Frik File Constants
231 const float FILE_READ = 0;
232 const float FILE_APPEND = 1;
233 const float FILE_WRITE = 2;
235 // Quake Point Contents
236 const float CONTENT_EMPTY = -1;
237 const float CONTENT_SOLID = -2;
238 const float CONTENT_WATER = -3;
239 const float CONTENT_SLIME = -4;
240 const float CONTENT_LAVA = -5;
241 const float CONTENT_SKY = -6;
243 // Quake Solid Constants
244 const float SOLID_NOT = 0;
245 const float SOLID_TRIGGER = 1;
246 const float SOLID_BBOX = 2;
247 const float SOLID_SLIDEBOX = 3;
248 const float SOLID_BSP = 4;
249 const float SOLID_CORPSE = 5;
251 // Quake Move Constants
252 const float MOVE_NORMAL = 0;
253 const float MOVE_NOMONSTERS = 1;
254 const float MOVE_MISSILE = 2;
257 const float true = 1;
258 const float false = 0;
259 const float TRUE = 1;
260 const float FALSE = 0;
262 const float EXTRA_LOW = -99999999;
263 const float EXTRA_HIGH = 99999999;
265 const vector VEC_1 = '1 1 1';
266 const vector VEC_0 = '0 0 0';
267 const vector VEC_M1 = '-1 -1 -1';
269 const float M_PI = 3.14159265358979323846;
271 vector VEC_HULL_MIN = '-16 -16 -24';
272 vector VEC_HULL_MAX = '16 16 32';
274 // Quake Temporary Entity Constants
275 const float TE_SPIKE = 0;
276 const float TE_SUPERSPIKE = 1;
277 const float TE_GUNSHOT = 2;
278 const float TE_EXPLOSION = 3;
279 const float TE_TAREXPLOSION = 4;
280 const float TE_LIGHTNING1 = 5;
281 const float TE_LIGHTNING2 = 6;
282 const float TE_WIZSPIKE = 7;
283 const float TE_KNIGHTSPIKE = 8;
284 const float TE_LIGHTNING3 = 9;
285 const float TE_LAVASPLASH = 10;
286 const float TE_TELEPORT = 11;
287 const float TE_EXPLOSION2 = 12;
288 // Darkplaces Additions
289 const float TE_EXPLOSIONRGB = 53;
290 const float TE_GUNSHOTQUAD = 57;
291 const float TE_EXPLOSIONQUAD = 70;
292 const float TE_SPIKEQUAD = 58;
293 const float TE_SUPERSPIKEQUAD = 59;
295 // PFlags for Dynamic Lights
296 const float PFLAGS_NOSHADOW = 1;
297 const float PFLAGS_CORONA = 2;
298 const float PFLAGS_FULLDYNAMIC = 128;
300 const float EF_ADDITIVE = 32;
301 const float EF_BLUE = 64;
302 const float EF_FLAME = 1024;
303 const float EF_FULLBRIGHT = 512;
304 const float EF_NODEPTHTEST = 8192;
305 const float EF_NODRAW = 16;
306 const float EF_NOSHADOW = 4096;
307 const float EF_RED = 128;
308 const float EF_STARDUST = 2048;
309 const float EF_SELECTABLE = 16384;
311 const float PFL_ONGROUND = 1;
312 const float PFL_CROUCH = 2;
313 const float PFL_DEAD = 4;
314 const float PFL_GIBBED = 8;
317 ==============================================================================
320 EXTENSIONS ARE NOT ADDED HERE, BUT BELOW!
322 ==============================================================================
325 void(vector ang) makevectors = #1;
326 void(entity e, vector o) setorigin = #2;
327 void(entity e, string m) setmodel = #3;
328 void(entity e, vector min, vector max) setsize = #4;
332 void(entity e, float chan, string samp) sound = #8;
333 vector(vector v) normalize = #9;
334 void(string e) error = #10;
335 void(string e) objerror = #11;
336 float(vector v) vlen = #12;
337 float(vector v) vectoyaw = #13;
338 entity() spawn = #14;
339 void(entity e) remove = #15;
340 float(vector v1, vector v2, float tryents, entity ignoreentity) traceline = #16;
342 entity(entity start, .string fld, string match) find = #18;
343 void(string s) precache_sound = #19;
344 void(string s) precache_model = #20;
346 entity(vector org, float rad) findradius = #22;
348 void(string s, ...) dprint = #25;
349 string(float f) ftos = #26;
350 string(vector v) vtos = #27;
351 void() coredump = #28;
352 void() traceon = #29;
353 void() traceoff = #30;
354 void(entity e) eprint = #31;
356 float(float yaw, float dist, float settrace) walkmove = #32;
358 float() droptofloor = #34;
359 void(float style, string value) lightstyle = #35;
360 float(float v) rint = #36;
361 float(float v) floor = #37;
362 float(float v) ceil = #38;
364 float(entity e) checkbottom = #40;
365 float(vector v) pointcontents = #41;
367 float(float f) fabs = #43;
369 float(string s) cvar = #45;
370 void(string s, ...) localcmd = #46;
371 entity(entity e) nextent = #47;
372 void(vector o, vector d, float color, float count) particle = #48;
373 void() ChangeYaw = #49;
375 vector(vector v) vectoangles = #51;
376 vector(vector v, vector w) vectoangles2 = #51;
378 float(float f) sin = #60;
379 float(float f) cos = #61;
380 float(float f) sqrt = #62;
381 void(entity ent) changepitch = #63;
382 void(entity e, entity ignore) tracetoss = #64;
383 string(entity ent) etos = #65;
385 string(string s) precache_file = #68;
386 void(entity e) makestatic = #69;
388 void(string var, string val) cvar_set = #72;
390 void(vector pos, string samp, float vol, float atten) ambientsound = #74;
391 string(string s) precache_model2 = #75;
392 string(string s) precache_sound2 = #76;
393 string(string s) precache_file2 = #77;
395 float(string s) stof = #81;
398 void(vector v1, vector min, vector max, vector v2, float nomonsters, entity forent) tracebox = #90;
399 vector() randomvec = #91;
400 vector(vector org) getlight = #92;
401 vector(vector org, float lpflags) getlight2 = #92;
403 vector getlight_ambient;
404 vector getlight_diffuse;
405 const float LP_LIGHTMAP = 1;
406 const float LP_RTWORLD = 2;
407 const float LP_DYNLIGHT = 4;
408 const float LP_COMPLETE = 7;
410 float(string name, string value) registercvar = #93;
411 float( float a, ... ) min = #94;
412 float( float b, ... ) max = #95;
413 float(float minimum, float val, float maximum) bound = #96;
414 float(float f, float f) pow = #97;
415 entity(entity start, .float fld, float match) findfloat = #98;
416 float(string s) checkextension = #99;
417 // FrikaC and Telejano range #100-#199
419 float(string filename, float mode) fopen = #110;
420 void(float fhandle) fclose = #111;
421 string(float fhandle) fgets = #112;
422 void(float fhandle, string s) fputs = #113;
423 float(string s) strlen = #114;
424 string(...) strcat = #115;
425 string(string s, float start, float length) substring = #116;
426 vector(string) stov = #117;
427 string(string s) strzone = #118;
428 void(string s) strunzone = #119;
430 // FTEQW range #200-#299
432 float(float number, float quantity) bitshift = #218;
434 //float(string str, string sub[, float startpos]) strstrofs = #221;
435 float(string str, string sub, float startpos) strstrofs = #221;
436 float(string str, float ofs) str2chr = #222;
437 string(float c, ...) chr2str = #223;
438 string(float ccase, float calpha, float cnum, string s, ...) strconv = #224;
439 string(float chars, string s, ...) strpad = #225;
440 string(string info, string key, string value, ...) infoadd = #226;
441 string(string info, string key) infoget = #227;
442 float(string s1, string s2, float len) strncmp = #228;
443 float(string s1, string s2) strcasecmp = #229;
444 float(string s1, string s2, float len) strncasecmp = #230;
446 // CSQC range #300-#399
447 void() clearscene = #300;
448 void(float mask) addentities = #301;
449 void(entity ent) addentity = #302;
450 float(float property, ...) setproperty = #303;
451 float(float property) getproperty = #309;
452 vector(float property) getpropertyvec = #309;
453 void() renderscene = #304;
454 void(vector org, float radius, vector lightcolours) adddynamiclight = #305;
455 void(vector org, float radius, vector lightcolours, float style, string cubemapname, float pflags) adddynamiclight2 = #305;
456 //void(string texturename, float flag[, float is2d, float lines]) R_BeginPolygon = #306;
457 void(string texturename, float flag, float is2d, float lines) R_BeginPolygon = #306;
458 void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex = #307;
459 void() R_EndPolygon = #308;
460 vector (vector v) cs_unproject = #310;
461 vector (vector v) cs_project = #311;
463 void(float width, vector pos1, vector pos2, float flag) drawline = #315;
464 float(string name) iscachedpic = #316;
465 string(string name, float trywad) precache_pic = #317;
466 string(string name) precache_cubemap = #317;
467 vector(string picname) draw_getimagesize = #318;
468 void(string name) freepic = #319;
469 float(vector position, float character, vector scale, vector rgb, float alpha, float flag) drawcharacter = #320;
470 float(vector position, string text, vector scale, vector rgb, float alpha, float flag) drawstring = #321;
471 float(vector position, string pic, vector size, vector rgb, float alpha, float flag) drawpic = #322;
472 float(vector position, vector size, vector rgb, float alpha, float flag) drawfill = #323;
473 void(float x, float y, float width, float height) drawsetcliparea = #324;
474 void(void) drawresetcliparea = #325;
475 float(vector position, string text, vector scale, float alpha, float flag) drawcolorcodedstring = #326;
476 vector(vector position, string text, vector scale, vector rgb, float alpha, float flag) drawcolorcodedstring2 = #326;
478 float(float stnum) getstatf = #330;
479 float(float stnum) getstati = #331;
480 string(float firststnum) getstats = #332;
481 void(entity e, float mdlindex) setmodelindex = #333;
482 string(float mdlindex) modelnameforindex = #334;
483 float(string effectname) particleeffectnum = #335;
484 void(entity ent, float effectnum, vector start, vector end) trailparticles = #336;
485 //void(float effectnum, vector origin [, vector dir, float count]) pointparticles = #337;
486 void(float effectnum, vector origin , vector dir, float count) pointparticles = #337;
487 void(string s, ...) centerprint = #338;
488 void(string s, ...) print = #339;
489 string(float keynum) keynumtostring = #340;
490 float(string keyname) stringtokeynum = #341;
491 string(float keynum) getkeybind = #342;
492 void(float usecursor) setcursormode = #343;
493 vector() getmousepos = #344;
494 float(float framenum) getinputstate = #345;
495 void(float sens) setsensitivityscale = #346;
496 void() runstandardplayerphysics = #347;
497 string(float playernum, string keyname) getplayerkeyvalue = #348;
498 float() isdemo = #349;
499 float() isserver = #350;
500 void(vector origin, vector forward, vector right, vector up) SetListener = #351;
501 void(string cmdname) registercommand = #352;
502 float(entity ent) wasfreed = #353;
503 string(string key) serverkey = #354;
505 // Use proper case; refer to the id1 Write* functions!
506 float() ReadByte = #360;
507 float() ReadChar = #361;
508 float() ReadShort = #362;
509 float() ReadLong = #363;
510 float() ReadCoord = #364;
511 float() ReadAngle = #365;
512 string() ReadString = #366;
513 float() ReadFloat = #367;
515 // LordHavoc's range #400-#499
516 void(entity from, entity to) copyentity = #400;
518 entity(.string fld, string match) findchain = #402;
519 entity(.float fld, float match) findchainfloat = #403;
520 void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404;
521 void(vector org, vector velocity, float howmany) te_blood = #405;
522 void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406;
523 void(vector org, vector color) te_explosionrgb = #407;
524 void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408;
525 void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409;
526 void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410;
527 void(vector org, vector vel, float howmany) te_spark = #411;
528 void(vector org) te_gunshotquad = #412;
529 void(vector org) te_spikequad = #413;
530 void(vector org) te_superspikequad = #414;
531 void(vector org) te_explosionquad = #415;
532 void(vector org) te_smallflash = #416;
533 void(vector org, float radius, float lifetime, vector color) te_customflash = #417;
534 void(vector org) te_gunshot = #418;
535 void(vector org) te_spike = #419;
536 void(vector org) te_superspike = #420;
537 void(vector org) te_explosion = #421;
538 void(vector org) te_tarexplosion = #422;
539 void(vector org) te_wizspike = #423;
540 void(vector org) te_knightspike = #424;
541 void(vector org) te_lavasplash = #425;
542 void(vector org) te_teleport = #426;
543 void(vector org, float colorstart, float colorlength) te_explosion2 = #427;
544 void(entity own, vector start, vector end) te_lightning1 = #428;
545 void(entity own, vector start, vector end) te_lightning2 = #429;
546 void(entity own, vector start, vector end) te_lightning3 = #430;
547 void(entity own, vector start, vector end) te_beam = #431;
548 void(vector dir) vectorvectors = #432;
549 void(vector org) te_plasmaburn = #433;
550 float(entity e, float s) getsurfacenumpoints = #434;
551 vector(entity e, float s, float n) getsurfacepoint = #435;
552 vector(entity e, float s) getsurfacenormal = #436;
553 string(entity e, float s) getsurfacetexture = #437;
554 float(entity e, vector p) getsurfacenearpoint = #438;
555 vector(entity e, float s, vector p) getsurfaceclippedpoint = #439;
557 float(string s) tokenize = #441;
558 string(float n) argv = #442;
559 void(entity e, entity tagentity, string tagname) setattachment = #443;
560 float(string pattern, float caseinsensitive, float quiet) search_begin = #444;
561 void(float handle) search_end = #445;
562 float(float handle) search_getsize = #446;
563 string(float handle, float num) search_getfilename = #447;
564 string(string s) cvar_string = #448;
565 entity(entity start, .float fld, float match) findflags = #449;
566 entity(.float fld, float match) findchainflags = #450;
567 float(entity ent, string tagname) gettagindex = #451;
568 vector(entity ent, float tagindex) gettaginfo = #452;
570 void(vector org, vector vel, float howmany) te_flamejet = #457;
572 entity(float num) entitybyindex = #459;
573 float() buf_create = #460;
574 void(float bufhandle) buf_del = #461;
575 float(float bufhandle) buf_getsize = #462;
576 void(float bufhandle_from, float bufhandle_to) buf_copy = #463;
577 void(float bufhandle, float sortpower, float backward) buf_sort = #464;
578 string(float bufhandle, string glue) buf_implode = #465;
579 string(float bufhandle, float string_index) bufstr_get = #466;
580 void(float bufhandle, float string_index, string str) bufstr_set = #467;
581 float(float bufhandle, string str, float order) bufstr_add = #468;
582 void(float bufhandle, float string_index) bufstr_free = #469;
584 float(float s) asin = #471;
585 float(float c) acos = #472;
586 float(float t) atan = #473;
587 float(float c, float s) atan2 = #474;
588 float(float a) tan = #475;
589 float(string s) strippedstringlen = #476;
590 float(string s) strlennocol = #476; // This is the correct name for the function, but not removing the decolorizedstring mapping.
591 string(string s) decolorizedstring = #477;
592 string(string s) strdecolorize = #477; // This is the correct name for the function, but not removing the decolorizedstring mapping.
593 string(float uselocaltime, string format, ...) strftime = #478;
594 float(string s) tokenizebyseparator = #479;
595 string(string s) strtolower = #480;
596 string(string s) strtoupper = #481;
597 string(string s) cvar_defstring = #482;
598 void(vector origin, string sample, float volume, float attenuation) pointsound = #483;
599 string(string search, string replace, string subject) strreplace = #484;
600 string(string search, string replace, string subject) strireplace = #485;
601 vector(entity e, float s, float n, float a) getsurfacepointattribute = #486;
603 float gecko_create( string name ) = #487;
604 void gecko_destroy( string name ) = #488;
605 void gecko_navigate( string name, string URI ) = #489;
606 float gecko_keyevent( string name, float key, float eventtype ) = #490;
607 void gecko_mousemove( string name, float x, float y ) = #491;
608 void gecko_resize( string name, float w, float h ) = #492;
609 vector gecko_get_texture_extent( string name ) = #493;
615 ==============================================================================
617 EXTENSION DEFINITIONS
619 ==============================================================================
622 // DP_CSQC_SPAWNPARTICLE
624 // darkplaces implementation: VorteX
625 // constant definitions:
626 // particle base behavior:
627 float PT_ALPHASTATIC = 1;
632 float PT_RAINDECAL = 6;
638 float PT_ENTITYPARTICLE = 12;
639 // particle blendtypes:
640 float PBLEND_ALPHA = 0;
641 float PBLEND_ADD = 1;
642 float PBLEND_INVMOD = 2;
643 // particle orientation:
644 float PARTICLE_BILLBOARD = 0;
645 float PARTICLE_SPARK = 1;
646 float PARTICLE_ORIENTED_DOUBLESIDED = 2;
647 float PARTICLE_BEAM = 3;
648 // global definitions:
649 float particle_type; // one of PT_
650 float particle_blendmode; // one of PBLEND_ values
651 float particle_orientation; // one of PARTICLE_ values
652 vector particle_color1;
653 vector particle_color2;
654 float particle_tex; // number of chunk in particlefont
656 float particle_sizeincrease;
657 float particle_alpha;
658 float particle_alphafade;
660 float particle_gravity;
661 float particle_bounce;
662 float particle_airfriction;
663 float particle_liquidfriction;
664 float particle_originjitter;
665 float particle_velocityjitter;
666 float particle_qualityreduction; // enable culling of this particle when FPS is low
667 float particle_stretch;
668 vector particle_staincolor1;
669 vector particle_staincolor2;
670 float particle_staintex;
671 float particle_stainalpha;
672 float particle_stainsize;
673 float particle_delayspawn;
674 float particle_delaycollision;
675 float particle_angle;
677 // builtin definitions:
678 float(float max_themes) initparticlespawner = #522; // check fields/globals for integration and enable particle spawner, return 1 is succeded, otherwise returns 0
679 void() resetparticle = #523; // reset p_ globals to default theme #0
680 void(float theme) particletheme = #524; // restore p_ globals from saved theme
681 float() particlethemesave = #525; // save p_ globals to new particletheme and return it's index
682 void(float theme) particlethemeupdate = #525; // save p_ globals to new particletheme and return it's index
683 void(float theme) particlethemefree = #526; // delete a particle theme
684 float(vector org, vector vel) spawnparticle = #527; // returns 0 when failed, 1 when spawned
685 float(vector org, vector vel, float theme) quickparticle = #527; // not reading globals, just theme, returns 0 when failed, 1 when spawned
686 float(vector org, vector vel, float delay, float collisiondelay) delayedparticle = #528;
687 float(vector org, vector vel, float delay, float collisiondelay, float theme) quickdelayedparticle = #528;
688 // description: this builtin provides an easy and flexible way to spawn particles,
689 // it is not created as replace for DP_SV_POINTPARTICLES but as an addition to it.
690 // With this extension you can create a specific particles like rain particles, or entity particles
692 // 1) 0 is default particle template, it could be changed
693 // 2) color vectors could have value 0-255 of each component
694 // restrictions: max themes could be between 4 and 2048
695 // warning: you should call initparticlespawner() at very beginning BEFORE all other particle spawner functions
696 // function to query particle info
697 // don't remove this function as it protects all particle_ globals from FTEQCC/FRIKQCC non-referenced removal optimisation
698 void() printparticle =
700 // vortex: this also protects from 'non-referenced' optimisation on some compilers
701 print("PARTICLE:\n");
702 print(strcat(" type: ", ftos(particle_type), "\n"));
703 print(strcat(" blendmode: ", ftos(particle_blendmode), "\n"));
704 print(strcat(" orientation: ", ftos(particle_orientation), "\n"));
705 print(strcat(" color1: ", vtos(particle_color1), "\n"));
706 print(strcat(" color2: ", vtos(particle_color2), "\n"));
707 print(strcat(" tex: ", ftos(particle_tex), "\n"));
708 print(strcat(" size: ", ftos(particle_size), "\n"));
709 print(strcat(" sizeincrease: ", ftos(particle_sizeincrease), "\n"));
710 print(strcat(" alpha: ", ftos(particle_alpha), "\n"));
711 print(strcat(" alphafade: ", ftos(particle_alphafade), "\n"));
712 print(strcat(" time: ", ftos(particle_time), "\n"));
713 print(strcat(" gravity: ", ftos(particle_gravity), "\n"));
714 print(strcat(" bounce: ", ftos(particle_bounce), "\n"));
715 print(strcat(" airfriction: ", ftos(particle_airfriction), "\n"));
716 print(strcat(" liquidfriction: ", ftos(particle_liquidfriction), "\n"));
717 print(strcat(" originjitter: ", ftos(particle_originjitter), "\n"));
718 print(strcat(" velocityjitter: ", ftos(particle_velocityjitter), "\n"));
719 print(strcat(" qualityreduction: ", ftos(particle_qualityreduction), "\n"));
720 print(strcat(" stretch: ", ftos(particle_stretch), "\n"));
721 print(strcat(" staincolor1: ", vtos(particle_staincolor1), "\n"));
722 print(strcat(" staincolor2: ", vtos(particle_staincolor2), "\n"));
723 print(strcat(" staintex: ", ftos(particle_staintex), "\n"));
724 print(strcat(" stainalpha: ", ftos(particle_stainalpha), "\n"));
725 print(strcat(" stainsize: ", ftos(particle_stainsize), "\n"));
726 print(strcat(" delayspawn: ", ftos(particle_delayspawn), "\n"));
727 print(strcat(" delaycollision: ", ftos(particle_delaycollision), "\n"));
728 print(strcat(" angle: ", ftos(particle_angle), "\n"));
729 print(strcat(" spin: ", ftos(particle_spin), "\n"));
732 // DP_CSQC_ENTITYTRANSPARENTSORTING_OFFSET
734 // darkplaces implementation: VorteX
735 float RF_USETRANSPARENTOFFSET = 64; // enables transparent origin offsetting
736 // global definitions
737 float transparent_offset; // should be set before entity is added
738 // description: offset a model's meshes origin used for transparent sorting. Could be used to tweak sorting bugs on very large transparent entities or hacking transparent sorting order for certain objects
739 // example: transparent_offset = 1000000; // entity always appear on background of other transparents
740 // note: offset is done in view forward axis
742 // DP_CSQC_ENTITYWORLDOBJECT
744 // darkplaces implementation: VorteX
745 const float RF_WORLDOBJECT = 128;
746 // description: when renderflag is set, engine will not use culling methods for this entity, e.g. it will always be drawn
747 // useful for large outdoor objects (like asteroids on sky horizon or sky models)
749 // DP_CSQC_ENTITYMODELLIGHT
751 // darkplaces implementation: VorteX
752 const float RF_MODELLIGHT = 4096;
753 .vector modellight_ambient;
754 .vector modellight_diffuse;
755 .vector modellight_dir;
756 // description: allows CSQC to override directional model lightning on entity
760 // darkplaces implementation: VorteX
761 // builtin definitions:
762 void(float ispaused) setpause = #531;
763 // description: provides ability to set pause in local games (similar to one set once console is activated)
764 // not stopping sound/cd track, useful for inventory screens, ingame menus with input etc.
766 // DP_CSQC_QUERYRENDERENTITY
768 // darkplaces implementation: VorteX
769 // constant definitions:
770 // render entity fields:
771 float E_ACTIVE = 0; // float 0/1
772 float E_ORIGIN = 1; // vector
773 float E_FORWARD = 2; // vector
774 float E_RIGHT = 3; // vector
775 float E_UP = 4; // vector
776 float E_SCALE = 5; // float
777 float E_ORIGINANDVECTORS = 6; // returns origin, + sets v_* vectors to orientation
778 float E_ALPHA = 7; // float
779 float E_COLORMOD = 8; // vector
780 float E_PANTSCOLOR = 9; // vector
781 float E_SHIRTCOLOR = 10; // vector
782 float E_SKIN = 11; // float
783 float E_MINS = 12; // vector
784 float E_MAXS = 13; // vector
785 float E_ABSMIN = 14; // vector
786 float E_ABSMAX = 15; // vector
787 float E_LIGHT = 16; // vector - modellight
788 // builtin definitions:
789 float(float entitynum, float fldnum) getentity = #504;
790 vector(float entitynum, float fldnum) getentityvec = #504;
791 // description: allows to query parms from render entities, especially useful with attaching CSQC ents to
792 // server entities networked and interpolated by engine (monsters, players), number of entity is it's SVQC number
793 // you can send it via tempentity/CSQC entity message. Note that this builtin doesnt know about entity removing/reallocating
794 // so it's meaning to work for short period of time, dont use it on missiles/grenades whatever will be removed next five seconds
797 //idea: Blub\0, divVerent
798 //darkplaces implementation: Blub\0
800 // loadfont fontname fontmaps size1 size2 ...
801 // A font can simply be gfx/tgafile (freetype fonts doent need extension),
802 // or alternatively you can specify multiple fonts and faces
803 // Like this: gfx/vera-sans:2,gfx/fallback:1
804 // to load face 2 of the font gfx/vera-sans and use face 1
805 // of gfx/fallback as fallback font
806 // You can also specify a list of font sizes to load, like this:
807 // loadfont console gfx/conchars,gfx/fallback 8 12 16 24 32
808 // In many cases, 8 12 16 24 32 should be a good choice.
810 //constant definitions:
811 float drawfont; // set it before drawstring()/drawchar() calls
812 float FONT_DEFAULT = 0; // 'default'
813 float FONT_CONSOLE = 1; // 'console', REALLY should be fixed width (ls!)
814 float FONT_SBAR = 2; // 'sbar', used on hud, must be fixed width
815 float FONT_NOTIFY = 3; // 'notify', used on sprint/bprint
816 float FONT_CHAT = 4; // 'chat'
817 float FONT_CENTERPRINT = 5;// 'centerprint'
818 float FONT_INFOBAR = 6; // 'infobar'
819 float FONT_MENU = 7; // 'menu', should be fixed width
820 float FONT_USER0 = 8; // 'user0', userdefined fonts
821 float FONT_USER1 = 9; // 'user1', userdefined fonts
822 float FONT_USER2 = 10; // 'user2', userdefined fonts
823 float FONT_USER3 = 11; // 'user3', userdefined fonts
824 float FONT_USER4 = 12; // 'user4', userdefined fonts
825 float FONT_USER5 = 13; // 'user5', userdefined fonts
826 float FONT_USER6 = 14; // 'user6', userdefined fonts
827 float FONT_USER7 = 15; // 'user7' slot, userdefined fonts
828 //builtin definitions:
829 float findfont(string s) = #356; // find font by fontname and return it's index
830 float loadfont(string fontname, string fontmaps, string sizes, float slot, float fix_scale, float fix_voffset) = #357;
831 // loads font immediately so stringwidth() function can be used just after builtin call
832 // returns a font slotnum (which is used to set drawfont to)
833 // first 3 parms are identical to "loadfont" console command ones
834 // slot could be one of FONT_ constants or result of findfont() or -1 to not use it
835 // if slot is given, font will be loaded to this slotnum and fontname become new title for it
836 // this way you can rename user* fonts to something more usable
837 // fix_* parms let you fix badly made fonts by applying some transformations to them
838 // fix_scale : per-character center-oriented scale (doesn't change line height at all)
839 // fix_voffset : vertical offset for each character, it's a multiplier to character height
840 float stringwidth(string text, float allowColorCodes, vector size) = #327; // get a width of string with given font and char size
841 float stringwidth_menu(string text, float allowColorCodes, vector size) = #468; // in menu.dat it has different builtin #
842 //description: engine support for custom fonts in console, hud, qc etc.
844 // max 128 chars for font name
845 // max 3 font fallbacks
846 // max 8 sizes per font
848 //DP_GFX_FONTS_FREETYPE
849 //idea: Blub\0, divVerent
850 //darkplaces implementation: Blub\0
852 // r_font_disable_freetype 0/1 : disable freetype fonts loading (uttetly disables freetype library initialization)
853 // r_font_antialias 0/1 : antialiasing when loading font
854 // r_font_hint 0/1/2/3 : hinting when loading font, 0 is no hinting, 1 light autohinting , 2 full autohinting, 3 full hinting
855 // r_font_postprocess_blur X : font outline blur amount
856 // r_font_postprocess_outline X : font outline width
857 // r_font_postprocess_shadow_x X : font outline shadow x shift amount, applied during outlining
858 // r_font_postprocess_shadow_y X : font outline shadow y shift amount, applied during outlining
859 // r_font_postprocess_shadow_z X : font outline shadow z shift amount, applied during blurring
860 //description: engine support for truetype/freetype fonts
861 //so .AFM+.PFB/.OTF/.TTF files could be stuffed as fontmaps in loadfont()
862 //(console command version will support them as well)
865 //idea: daemon, motorsep
866 //darkplaces implementation: divVerent
867 //builtin definitions:
868 string(float key, float bindmap) getkeybind_bindmap = #342;
869 float(float key, string bind, float bindmap) setkeybind_bindmap = #630;
870 vector(void) getbindmaps = #631;
871 float(vector bm) setbindmaps = #632;
872 string(string command, float bindmap) findkeysforcommand = #610;
873 //<already in EXT_CSQC> float(string key) stringtokeynum = #341;
874 //<already in EXT_CSQC> string(float keynum) keynumtostring = #340;
875 //description: key bind setting/getting including support for switchable
880 //darkplaces implementation: divVerent
881 //builtin definitions: (CSQC)
882 float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513;
884 //use -1 as buffer handle to justs end delim as postdata
888 //darkplaces implementation: divVerent
889 //constant definitions:
890 const float VF_MAINVIEW = 400;
891 //use setproperty(VF_MAINVIEW, 1); before calling R_RenderView for the render
892 //that shall become the "main" view, which is e.g. used by PRYDON_CLIENTCURSOR
893 //this flag is set for the first scene, and not cleared by R_ClearScene
894 //this flag is automatically cleared by R_RenderView
895 //so when not using this extension, the first view rendered is the main view
897 //DP_CSQC_MINFPS_QUALITY
899 //darkplaces implementation: divVerent
900 //constant definitions:
901 const float VF_MINFPS_QUALITY = 401;
902 //use getproperty(VF_MINFPS_QUALITY); to do CSQC based LOD based on cl_minfps
903 //1 should lead to an unmodified view
905 //DP_CSQC_V_CALCREFDEF_WIP1
907 //darkplaces implementation: divVerent
908 //builtin definitions:
909 void(entity e, float refdefflags) V_CalcRefdef = #640;
910 //constant definitions:
911 float PMF_DUCKED = 4;
912 float PMF_ONGROUND = 8;
913 float REFDEFFLAG_TELEPORTED = 1;
914 float REFDEFFLAG_JUMPING = 2;
915 //- use this on the player entity after performing prediction
916 //- pass REFDEFFLAG_TELEPORTED if the player teleported since last frame
917 //- pass REFDEFFLAG_JUMPING if jump button is pressed
918 //- the player entity needs to have origin, velocity, pmove_flags set according
919 // to prediction (the above two PMF_ flags are used in the player's pmove_flags)
920 //- NOTE: to check for this, ALSO OR a check with DP_CSQC_V_CALCREFDEF to also support
921 // the finished extension once done