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
150 vector view_angles; // same as input_angles
151 vector view_punchangle;
152 vector view_punchvector;
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;
402 const float LP_LIGHTMAP = 1;
403 const float LP_RTWORLD = 2;
404 const float LP_DYNLIGHT = 4;
405 const float LP_COMPLETE = 7;
407 float(string name, string value) registercvar = #93;
408 float( float a, ... ) min = #94;
409 float( float b, ... ) max = #95;
410 float(float minimum, float val, float maximum) bound = #96;
411 float(float f, float f) pow = #97;
412 entity(entity start, .float fld, float match) findfloat = #98;
413 float(string s) checkextension = #99;
414 // FrikaC and Telejano range #100-#199
416 float(string filename, float mode) fopen = #110;
417 void(float fhandle) fclose = #111;
418 string(float fhandle) fgets = #112;
419 void(float fhandle, string s) fputs = #113;
420 float(string s) strlen = #114;
421 string(...) strcat = #115;
422 string(string s, float start, float length) substring = #116;
423 vector(string) stov = #117;
424 string(string s) strzone = #118;
425 void(string s) strunzone = #119;
427 // FTEQW range #200-#299
429 float(float number, float quantity) bitshift = #218;
431 //float(string str, string sub[, float startpos]) strstrofs = #221;
432 float(string str, string sub, float startpos) strstrofs = #221;
433 float(string str, float ofs) str2chr = #222;
434 string(float c, ...) chr2str = #223;
435 string(float ccase, float calpha, float cnum, string s, ...) strconv = #224;
436 string(float chars, string s, ...) strpad = #225;
437 string(string info, string key, string value, ...) infoadd = #226;
438 string(string info, string key) infoget = #227;
439 float(string s1, string s2, float len) strncmp = #228;
440 float(string s1, string s2) strcasecmp = #229;
441 float(string s1, string s2, float len) strncasecmp = #230;
443 // CSQC range #300-#399
444 void() clearscene = #300;
445 void(float mask) addentities = #301;
446 void(entity ent) addentity = #302;
447 float(float property, ...) setproperty = #303;
448 void() renderscene = #304;
449 void(vector org, float radius, vector lightcolours) adddynamiclight = #305;
450 void(vector org, float radius, vector lightcolours, float style, string cubemapname, float pflags) adddynamiclight2 = #305;
451 //void(string texturename, float flag[, float is2d, float lines]) R_BeginPolygon = #306;
452 void(string texturename, float flag, float is2d, float lines) R_BeginPolygon = #306;
453 void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex = #307;
454 void() R_EndPolygon = #308;
455 vector (vector v) cs_unproject = #310;
456 vector (vector v) cs_project = #311;
458 void(float width, vector pos1, vector pos2, float flag) drawline = #315;
459 float(string name) iscachedpic = #316;
460 string(string name, float trywad) precache_pic = #317;
461 vector(string picname) draw_getimagesize = #318;
462 void(string name) freepic = #319;
463 float(vector position, float character, vector scale, vector rgb, float alpha, float flag) drawcharacter = #320;
464 float(vector position, string text, vector scale, vector rgb, float alpha, float flag) drawstring = #321;
465 float(vector position, string pic, vector size, vector rgb, float alpha, float flag) drawpic = #322;
466 float(vector position, vector size, vector rgb, float alpha, float flag) drawfill = #323;
467 void(float x, float y, float width, float height) drawsetcliparea = #324;
468 void(void) drawresetcliparea = #325;
469 float(vector position, string text, vector scale, float alpha, float flag) drawcolorcodedstring = #326;
471 float(float stnum) getstatf = #330;
472 float(float stnum) getstati = #331;
473 string(float firststnum) getstats = #332;
474 void(entity e, float mdlindex) setmodelindex = #333;
475 string(float mdlindex) modelnameforindex = #334;
476 float(string effectname) particleeffectnum = #335;
477 void(entity ent, float effectnum, vector start, vector end) trailparticles = #336;
478 //void(float effectnum, vector origin [, vector dir, float count]) pointparticles = #337;
479 void(float effectnum, vector origin , vector dir, float count) pointparticles = #337;
480 void(string s, ...) centerprint = #338;
481 void(string s, ...) print = #339;
482 string(float keynum) keynumtostring = #340;
483 float(string keyname) stringtokeynum = #341;
484 string(float keynum) getkeybind = #342;
485 void(float usecursor) setcursormode = #343;
486 vector() getmousepos = #344;
487 float(float framenum) getinputstate = #345;
488 void(float sens) setsensitivityscale = #346;
489 void() runstandardplayerphysics = #347;
490 string(float playernum, string keyname) getplayerkeyvalue = #348;
491 float() isdemo = #349;
492 float() isserver = #350;
493 void(vector origin, vector forward, vector right, vector up) SetListener = #351;
494 void(string cmdname) registercommand = #352;
495 float(entity ent) wasfreed = #353;
496 string(string key) serverkey = #354;
498 // Use proper case; refer to the id1 Write* functions!
499 float() ReadByte = #360;
500 float() ReadChar = #361;
501 float() ReadShort = #362;
502 float() ReadLong = #363;
503 float() ReadCoord = #364;
504 float() ReadAngle = #365;
505 string() ReadString = #366;
506 float() ReadFloat = #367;
508 // LordHavoc's range #400-#499
509 void(entity from, entity to) copyentity = #400;
511 entity(.string fld, string match) findchain = #402;
512 entity(.float fld, float match) findchainfloat = #403;
513 void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404;
514 void(vector org, vector velocity, float howmany) te_blood = #405;
515 void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406;
516 void(vector org, vector color) te_explosionrgb = #407;
517 void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408;
518 void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409;
519 void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410;
520 void(vector org, vector vel, float howmany) te_spark = #411;
521 void(vector org) te_gunshotquad = #412;
522 void(vector org) te_spikequad = #413;
523 void(vector org) te_superspikequad = #414;
524 void(vector org) te_explosionquad = #415;
525 void(vector org) te_smallflash = #416;
526 void(vector org, float radius, float lifetime, vector color) te_customflash = #417;
527 void(vector org) te_gunshot = #418;
528 void(vector org) te_spike = #419;
529 void(vector org) te_superspike = #420;
530 void(vector org) te_explosion = #421;
531 void(vector org) te_tarexplosion = #422;
532 void(vector org) te_wizspike = #423;
533 void(vector org) te_knightspike = #424;
534 void(vector org) te_lavasplash = #425;
535 void(vector org) te_teleport = #426;
536 void(vector org, float colorstart, float colorlength) te_explosion2 = #427;
537 void(entity own, vector start, vector end) te_lightning1 = #428;
538 void(entity own, vector start, vector end) te_lightning2 = #429;
539 void(entity own, vector start, vector end) te_lightning3 = #430;
540 void(entity own, vector start, vector end) te_beam = #431;
541 void(vector dir) vectorvectors = #432;
542 void(vector org) te_plasmaburn = #433;
543 float(entity e, float s) getsurfacenumpoints = #434;
544 vector(entity e, float s, float n) getsurfacepoint = #435;
545 vector(entity e, float s) getsurfacenormal = #436;
546 string(entity e, float s) getsurfacetexture = #437;
547 float(entity e, vector p) getsurfacenearpoint = #438;
548 vector(entity e, float s, vector p) getsurfaceclippedpoint = #439;
550 float(string s) tokenize = #441;
551 string(float n) argv = #442;
552 void(entity e, entity tagentity, string tagname) setattachment = #443;
553 float(string pattern, float caseinsensitive, float quiet) search_begin = #444;
554 void(float handle) search_end = #445;
555 float(float handle) search_getsize = #446;
556 string(float handle, float num) search_getfilename = #447;
557 string(string s) cvar_string = #448;
558 entity(entity start, .float fld, float match) findflags = #449;
559 entity(.float fld, float match) findchainflags = #450;
560 float(entity ent, string tagname) gettagindex = #451;
561 vector(entity ent, float tagindex) gettaginfo = #452;
563 void(vector org, vector vel, float howmany) te_flamejet = #457;
565 entity(float num) entitybyindex = #459;
566 float() buf_create = #460;
567 void(float bufhandle) buf_del = #461;
568 float(float bufhandle) buf_getsize = #462;
569 void(float bufhandle_from, float bufhandle_to) buf_copy = #463;
570 void(float bufhandle, float sortpower, float backward) buf_sort = #464;
571 string(float bufhandle, string glue) buf_implode = #465;
572 string(float bufhandle, float string_index) bufstr_get = #466;
573 void(float bufhandle, float string_index, string str) bufstr_set = #467;
574 float(float bufhandle, string str, float order) bufstr_add = #468;
575 void(float bufhandle, float string_index) bufstr_free = #469;
577 float(float s) asin = #471;
578 float(float c) acos = #472;
579 float(float t) atan = #473;
580 float(float c, float s) atan2 = #474;
581 float(float a) tan = #475;
582 float(string s) strippedstringlen = #476;
583 float(string s) strlennocol = #476; // This is the correct name for the function, but not removing the decolorizedstring mapping.
584 string(string s) decolorizedstring = #477;
585 string(string s) strdecolorize = #477; // This is the correct name for the function, but not removing the decolorizedstring mapping.
586 string(float uselocaltime, string format, ...) strftime = #478;
587 float(string s) tokenizebyseparator = #479;
588 string(string s) strtolower = #480;
589 string(string s) strtoupper = #481;
590 string(string s) cvar_defstring = #482;
591 void(vector origin, string sample, float volume, float attenuation) pointsound = #483;
592 string(string search, string replace, string subject) strreplace = #484;
593 string(string search, string replace, string subject) strireplace = #485;
594 vector(entity e, float s, float n, float a) getsurfacepointattribute = #486;
596 float gecko_create( string name ) = #487;
597 void gecko_destroy( string name ) = #488;
598 void gecko_navigate( string name, string URI ) = #489;
599 float gecko_keyevent( string name, float key, float eventtype ) = #490;
600 void gecko_mousemove( string name, float x, float y ) = #491;
601 void gecko_resize( string name, float w, float h ) = #492;
602 vector gecko_get_texture_extent( string name ) = #493;
608 ==============================================================================
610 EXTENSION DEFINITIONS
612 ==============================================================================
615 // DP_CSQC_SPAWNPARTICLE
617 // darkplaces implementation: VorteX
618 // constant definitions:
619 // particle base behavior:
620 float PT_ALPHASTATIC = 1;
625 float PT_RAINDECAL = 6;
631 float PT_ENTITYPARTICLE = 12;
632 // particle blendtypes:
633 float PBLEND_ALPHA = 0;
634 float PBLEND_ADD = 1;
635 float PBLEND_INVMOD = 2;
636 // particle orientation:
637 float PARTICLE_BILLBOARD = 0;
638 float PARTICLE_SPARK = 1;
639 float PARTICLE_ORIENTED_DOUBLESIDED = 2;
640 float PARTICLE_BEAM = 3;
641 // global definitions:
642 float particle_type; // one of PT_
643 float particle_blendmode; // one of PBLEND_ values
644 float particle_orientation; // one of PARTICLE_ values
645 vector particle_color1;
646 vector particle_color2;
647 float particle_tex; // number of chunk in particlefont
649 float particle_sizeincrease;
650 float particle_alpha;
651 float particle_alphafade;
653 float particle_gravity;
654 float particle_bounce;
655 float particle_airfriction;
656 float particle_liquidfriction;
657 float particle_originjitter;
658 float particle_velocityjitter;
659 float particle_qualityreduction; // enable culling of this particle when FPS is low
660 float particle_stretch;
661 vector particle_staincolor1;
662 vector particle_staincolor2;
663 float particle_staintex;
664 float particle_stainalpha;
665 float particle_stainsize;
666 float particle_delayspawn;
667 float particle_delaycollision;
668 float particle_angle;
670 // builtin definitions:
671 float(float max_themes) initparticlespawner = #522; // check fields/globals for integration and enable particle spawner, return 1 is succeded, otherwise returns 0
672 void() resetparticle = #523; // reset p_ globals to default theme #0
673 void(float theme) particletheme = #524; // restore p_ globals from saved theme
674 float() particlethemesave = #525; // save p_ globals to new particletheme and return it's index
675 void(float theme) particlethemeupdate = #525; // save p_ globals to new particletheme and return it's index
676 void(float theme) particlethemefree = #526; // delete a particle theme
677 float(vector org, vector vel) particle = #527; // returns 0 when failed, 1 when spawned
678 float(vector org, vector vel, float theme) quickparticle = #527; // not reading globals, just theme, returns 0 when failed, 1 when spawned
679 float(vector org, vector vel, float delay, float collisiondelay) delayedparticle = #528;
680 float(vector org, vector vel, float delay, float collisiondelay, float theme) quickdelayedparticle = #528;
681 // description: this builtin provides an easy and flexible way to spawn particles,
682 // it is not created as replace for DP_SV_POINTPARTICLES but as an addition to it.
683 // With this extension you can create a specific particles like rain particles, or entity particles
685 // 1) 0 is default particle template, it could be changed
686 // 2) color vectors could have value 0-255 of each component
687 // restrictions: max themes could be between 4 and 2048
688 // warning: you should call initparticlespawner() at very beginning BEFORE all other particle spawner functions
689 // function to query particle info
690 // don't remove this function as it protects all particle_ globals from FTEQCC/FRIKQCC non-referenced removal optimisation
691 void() printparticle =
693 // vortex: this also protects from 'non-referenced' optimisation on some compilers
694 print("PARTICLE:\n");
695 print(strcat(" type: ", ftos(particle_type), "\n"));
696 print(strcat(" blendmode: ", ftos(particle_blendmode), "\n"));
697 print(strcat(" orientation: ", ftos(particle_orientation), "\n"));
698 print(strcat(" color1: ", vtos(particle_color1), "\n"));
699 print(strcat(" color2: ", vtos(particle_color2), "\n"));
700 print(strcat(" tex: ", ftos(particle_tex), "\n"));
701 print(strcat(" size: ", ftos(particle_size), "\n"));
702 print(strcat(" sizeincrease: ", ftos(particle_sizeincrease), "\n"));
703 print(strcat(" alpha: ", ftos(particle_alpha), "\n"));
704 print(strcat(" alphafade: ", ftos(particle_alphafade), "\n"));
705 print(strcat(" time: ", ftos(particle_time), "\n"));
706 print(strcat(" gravity: ", ftos(particle_gravity), "\n"));
707 print(strcat(" bounce: ", ftos(particle_bounce), "\n"));
708 print(strcat(" airfriction: ", ftos(particle_airfriction), "\n"));
709 print(strcat(" liquidfriction: ", ftos(particle_liquidfriction), "\n"));
710 print(strcat(" originjitter: ", ftos(particle_originjitter), "\n"));
711 print(strcat(" velocityjitter: ", ftos(particle_velocityjitter), "\n"));
712 print(strcat(" qualityreduction: ", ftos(particle_qualityreduction), "\n"));
713 print(strcat(" stretch: ", ftos(particle_stretch), "\n"));
714 print(strcat(" staincolor1: ", vtos(particle_staincolor1), "\n"));
715 print(strcat(" staincolor2: ", vtos(particle_staincolor2), "\n"));
716 print(strcat(" staintex: ", ftos(particle_staintex), "\n"));
717 print(strcat(" stainalpha: ", ftos(particle_stainalpha), "\n"));
718 print(strcat(" stainsize: ", ftos(particle_stainsize), "\n"));
719 print(strcat(" delayspawn: ", ftos(particle_delayspawn), "\n"));
720 print(strcat(" delaycollision: ", ftos(particle_delaycollision), "\n"));
721 print(strcat(" angle: ", ftos(particle_angle), "\n"));
722 print(strcat(" spin: ", ftos(particle_spin), "\n"));
725 // DP_CSQC_ENTITYTRANSPARENTSORTING_OFFSET
727 // darkplaces implementation: VorteX
728 float RF_USETRANSPARENTOFFSET = 64; // enables transparent origin offsetting
729 // global definitions
730 float transparent_offset; // should be set before entity is added
731 // 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
732 // example: transparent_offset = 1000000; // entity always appear on background of other transparents
733 // note: offset is done in view forward axis
735 // DP_CSQC_ENTITYNOCULL
737 // darkplaces implementation: VorteX
738 const float RF_NOCULL = 128;
739 // description: when renderflag is set, engine will not use culling methods for this entity, e.g. it will always be drawn
740 // useful for large outdoor objects (like asteriods on sky horizont or sky models)
741 // also useful when culling is done at CSQC side
745 // darkplaces implementation: VorteX
746 // builtin definitions:
747 void(float ispaused) setpause = #531;
748 // description: provides ability to set pause in local games (similar to one set once console is activated)
749 // not stopping sound/cd track, useful for inventory screens, ingame menus with input etc.
751 // DP_CSQC_QUERYRENDERENTITY
753 // darkplaces implementation: VorteX
754 // constant definitions:
755 // render entity fields:
756 float E_ACTIVE = 0; // float 0/1
757 float E_ORIGIN = 1; // vector
758 float E_FORWARD = 2; // vector
759 float E_RIGHT = 3; // vector
760 float E_UP = 4; // vector
761 float E_SCALE = 5; // float
762 float E_ORIGINANDVECTORS = 6; // returns origin, + sets v_* vectors to orientation
763 float E_ALPHA = 7; // float
764 float E_COLORMOD = 8; // vector
765 float E_PANTSCOLOR = 9; // vector
766 float E_SHIRTCOLOR = 10; // vector
767 float E_SKIN = 11; // float
768 float E_MINS = 12; // vector
769 float E_MAXS = 13; // vector
770 float E_ABSMIN = 14; // vector
771 float E_ABSMAX = 15; // vector
772 float E_LIGHT = 16; // vector - modellight
773 // builtin definitions:
774 float(float entitynum, float fldnum) getentity = #504;
775 vector(float entitynum, float fldnum) getentityvec = #504;
776 // description: allows to query parms from render entities, especially useful with attaching CSQC ents to
777 // server entities networked and interpolated by engine (monsters, players), number of entity is it's SVQC number
778 // you can send it via tempentity/CSQC entity message. Note that this builtin doesnt know about entity removing/reallocating
779 // so it's meaning to work for short period of time, dont use it on missiles/grenades whatever will be removed next five seconds
782 //idea: Blub\0, divVerent
783 //darkplaces implementation: Blub\0
785 // loadfont fontname fontmaps size1 size2 ...
786 // A font can simply be gfx/tgafile (freetype fonts doent need extension),
787 // or alternatively you can specify multiple fonts and faces
788 // Like this: gfx/vera-sans:2,gfx/fallback:1
789 // to load face 2 of the font gfx/vera-sans and use face 1
790 // of gfx/fallback as fallback font
791 // You can also specify a list of font sizes to load, like this:
792 // loadfont console gfx/conchars,gfx/fallback 8 12 16 24 32
793 // In many cases, 8 12 16 24 32 should be a good choice.
795 //constant definitions:
796 float drawfont; // set it before drawstring()/drawchar() calls
797 float FONT_DEFAULT = 0; // 'default'
798 float FONT_CONSOLE = 1; // 'console', REALLY should be fixed width (ls!)
799 float FONT_SBAR = 2; // 'sbar', used on hud, must be fixed width
800 float FONT_NOTIFY = 3; // 'notify', used on sprint/bprint
801 float FONT_CHAT = 4; // 'chat'
802 float FONT_CENTERPRINT = 5;// 'centerprint'
803 float FONT_INFOBAR = 6; // 'infobar'
804 float FONT_MENU = 7; // 'menu', should be fixed width
805 float FONT_USER0 = 8; // 'user0', userdefined fonts
806 float FONT_USER1 = 9; // 'user1', userdefined fonts
807 float FONT_USER2 = 10; // 'user2', userdefined fonts
808 float FONT_USER3 = 11; // 'user3', userdefined fonts
809 float FONT_USER4 = 12; // 'user4', userdefined fonts
810 float FONT_USER5 = 13; // 'user5', userdefined fonts
811 float FONT_USER6 = 14; // 'user6', userdefined fonts
812 float FONT_USER7 = 15; // 'user7' slot, userdefined fonts
813 //builtin definitions:
814 float findfont(string s) = #356; // find font by fontname and return it's index
815 float loadfont(string fontname, string fontmaps, string sizes, float slot, float fix_scale, float fix_voffset) = #357;
816 // loads font immediately so stringwidth() function can be used just after builtin call
817 // returns a font slotnum (which is used to set drawfont to)
818 // first 3 parms are identical to "loadfont" console command ones
819 // slot could be one of FONT_ constants or result of findfont() or -1 to not use it
820 // if slot is given, font will be loaded to this slotnum and fontname become new title for it
821 // this way you can rename user* fonts to something more usable
822 // fix_* parms let you fix badly made fonts by applying some transformations to them
823 // fix_scale : per-character center-oriented scale (doesn't change line height at all)
824 // fix_voffset : vertical offset for each character, it's a multiplier to character height
825 float stringwidth(string text, float allowColorCodes, vector size) = #327; // get a width of string with given font and char size
826 float stringwidth_menu(string text, float allowColorCodes, vector size) = #468; // in menu.dat it has different builtin #
827 //description: engine support for custom fonts in console, hud, qc etc.
829 // max 128 chars for font name
830 // max 3 font fallbacks
831 // max 8 sizes per font
833 //DP_GFX_FONTS_FREETYPE
834 //idea: Blub\0, divVerent
835 //darkplaces implementation: Blub\0
837 // r_font_disable_freetype 0/1 : disable freetype fonts loading (uttetly disables freetype library initialization)
838 // r_font_antialias 0/1 : antialiasing when loading font
839 // r_font_hint 0/1/2/3 : hinting when loading font, 0 is no hinting, 1 light autohinting , 2 full autohinting, 3 full hinting
840 // r_font_postprocess_blur X : font outline blur amount
841 // r_font_postprocess_outline X : font outline width
842 // r_font_postprocess_shadow_x X : font outline shadow x shift amount, applied during outlining
843 // r_font_postprocess_shadow_y X : font outline shadow y shift amount, applied during outlining
844 // r_font_postprocess_shadow_z X : font outline shadow z shift amount, applied during blurring
845 //description: engine support for truetype/freetype fonts
846 //so .AFM+.PFB/.OTF/.TTF files could be stuffed as fontmaps in loadfont()
847 //(console command version will support them as well)
850 //idea: daemon, motorsep
851 //darkplaces implementation: divVerent
852 //builtin definitions:
853 string(float key, float bindmap) getkeybind_bindmap = #342;
854 float(float key, string bind, float bindmap) setkeybind_bindmap = #630;
855 vector(void) getbindmaps = #631;
856 float(vector bm) setbindmaps = #632;
857 string(string command, float bindmap) findkeysforcommand = #610;
858 //<already in EXT_CSQC> float(string key) stringtokeynum = #341;
859 //<already in EXT_CSQC> string(float keynum) keynumtostring = #340;
860 //description: key bind setting/getting including support for switchable
865 //darkplaces implementation: divVerent
866 //builtin definitions: (CSQC)
867 float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513;
869 //use -1 as buffer handle to justs end delim as postdata