float GETTIME_HIRES = 2; // like REALTIME, but may reset between QC invocations and thus can be higher precision
float GETTIME_UPTIME = 3; // time of start of frame since start of the engine
//builtin definitions:
-float(float tmr) gettime = #519;
+float(float timer) gettime = #519;
//description:
//some timers to query...
//function definitions:
float(string effectname) particleeffectnum = #335; // same as in CSQC
void(entity ent, float effectnum, vector start, vector end) trailparticles = #336; // same as in CSQC
-void(float effectnum, vector org, vector vel, float howmany) pointparticles = #337; // same as in CSQC
+void(float effectnum, vector org, vector vel, float count) pointparticles = #337; // same as in CSQC
//SVC definitions:
//float svc_trailparticles = 60; // [short] entnum [short] effectnum [vector] start [vector] end
//float svc_pointparticles = 61; // [short] effectnum [vector] start [vector] velocity [short] count
void coverage() = #642; // Reports a coverage event. The engine counts for each of the calls to this builtin whether it has been called.
// assorted undocumented extensions
-string(string, float) netaddress_resolve = #625;
+string(string ip, float port) netaddress_resolve = #625;
string(string search, string replace, string subject) strreplace = #484;
string(string search, string replace, string subject) strireplace = #485;
string(float uselocaltime, string format, ...) strftime = #478;
=========
VM_M_getresolution
-vector getresolution(float number)
+vector getresolution(float number[, float forfullscreen])
=========
*/
static void VM_M_getresolution(prvm_prog_t *prog)
========================
VM_M_refreshserverlist
-refreshserverlist()
+refreshserverlist([bool reset])
========================
*/
static void VM_M_refreshserverlist(prvm_prog_t *prog)
NULL, // #354
VM_CL_videoplaying, // #355
VM_findfont, // #356 float(string fontname) loadfont (DP_GFX_FONTS)
-VM_loadfont, // #357 float(string fontname, string fontmaps, string sizes, float slot) loadfont (DP_GFX_FONTS)
+VM_loadfont, // #357 float(string fontname, string fontmaps, string sizes[, float slot[, float scale[, float voffset]]]) loadfont (DP_GFX_FONTS)
NULL, // #358
NULL, // #359
NULL, // #360
NULL, // #437
NULL, // #438
NULL, // #439
-VM_buf_create, // #440 float() buf_create (DP_QC_STRINGBUFFERS)
+VM_buf_create, // #440 float([string format[, float flags]]) buf_create (DP_QC_STRINGBUFFERS)
VM_buf_del, // #441 void(float bufhandle) buf_del (DP_QC_STRINGBUFFERS)
VM_buf_getsize, // #442 float(float bufhandle) buf_getsize (DP_QC_STRINGBUFFERS)
VM_buf_copy, // #443 void(float bufhandle_from, float bufhandle_to) buf_copy (DP_QC_STRINGBUFFERS)
VM_uri_escape, // #510 string(string in) uri_escape = #510;
VM_uri_unescape, // #511 string(string in) uri_unescape = #511;
VM_etof, // #512 float(entity ent) num_for_edict = #512 (DP_QC_NUM_FOR_EDICT)
-VM_uri_get, // #513 float(string uri, float id, [string post_contenttype, string post_delim, [float buf]]) uri_get = #513; (DP_QC_URI_GET, DP_QC_URI_POST)
+VM_uri_get, // #513 float(string uri, float id[, string post_contenttype[, string post_delim[, float buf[, float keyid]]]]) uri_get = #513; (DP_QC_URI_GET, DP_QC_URI_POST)
VM_tokenize_console, // #514 float(string str) tokenize_console = #514; (DP_QC_TOKENIZE_CONSOLE)
VM_argv_start_index, // #515 float(float idx) argv_start_index = #515; (DP_QC_TOKENIZE_CONSOLE)
VM_argv_end_index, // #516 float(float idx) argv_end_index = #516; (DP_QC_TOKENIZE_CONSOLE)
-VM_buf_cvarlist, // #517 void(float buf, string prefix, string antiprefix) buf_cvarlist = #517; (DP_QC_STRINGBUFFERS_CVARLIST)
+VM_buf_cvarlist, // #517 void(float buf, string prefix[, string antiprefix]) buf_cvarlist = #517; (DP_QC_STRINGBUFFERS_CVARLIST)
VM_cvar_description, // #518 float(string name) cvar_description = #518; (DP_QC_CVAR_DESCRIPTION)
NULL, // #519
NULL, // #520
VM_getsoundtime, // #533 float(entity e, float channel) getsoundtime = #533; (DP_SND_GETSOUNDTIME)
VM_soundlength, // #534 float(string sample) soundlength = #534; (DP_SND_GETSOUNDTIME)
VM_buf_loadfile, // #535 float(string filename, float bufhandle) buf_loadfile (DP_QC_STRINGBUFFERS_EXT_WIP)
-VM_buf_writefile, // #536 float(float filehandle, float bufhandle, float startpos, float numstrings) buf_writefile (DP_QC_STRINGBUFFERS_EXT_WIP)
-VM_bufstr_find, // #537 float(float bufhandle, string match, float matchrule, float startpos) bufstr_find (DP_QC_STRINGBUFFERS_EXT_WIP)
-VM_matchpattern, // #538 float(string s, string pattern, float matchrule) matchpattern (DP_QC_STRINGBUFFERS_EXT_WIP)
+VM_buf_writefile, // #536 float(float filehandle, float bufhandle[, float startpos[, float numstrings]]) buf_writefile (DP_QC_STRINGBUFFERS_EXT_WIP)
+VM_bufstr_find, // #537 float(float bufhandle, string match, float matchrule[, float startpos[, float step]]) bufstr_find (DP_QC_STRINGBUFFERS_EXT_WIP)
+VM_matchpattern, // #538 float(string s, string pattern, float matchrule[, float startpos]) matchpattern (DP_QC_STRINGBUFFERS_EXT_WIP)
NULL, // #539
NULL, // #540
NULL, // #541
VM_callfunction, // #605 void callfunction(...)
VM_writetofile, // #606 void writetofile(float fhandle, entity ent)
VM_isfunction, // #607 float isfunction(string function_name)
-VM_M_getresolution, // #608 vector getresolution(float number, [float forfullscreen])
+VM_M_getresolution, // #608 vector getresolution(float number[, float forfullscreen])
VM_keynumtostring, // #609 string keynumtostring(float keynum)
VM_findkeysforcommand, // #610 string findkeysforcommand(string command[, float bindmap])
VM_M_getserverliststat, // #611 float gethostcachevalue(float type)
VM_M_getserverlistindexforkey,// #622 float gethostcacheindexforkey(string key)
VM_M_addwantedserverlistkey, // #623 void addwantedhostcachekey(string key)
VM_CL_getextresponse, // #624 string getextresponse(void)
-VM_netaddress_resolve, // #625 string netaddress_resolve(string, float)
+VM_netaddress_resolve, // #625 string netaddress_resolve(string ip[, float port])
VM_M_getgamedirinfo, // #626 string getgamedirinfo(float n, float prop)
VM_sprintf, // #627 string sprintf(string format, ...)
NULL, // #628
single print to a specific client
-sprint(float clientnum,...[string])
+sprint(entity client, string s, ...)
=================
*/
void VM_sprint(prvm_prog_t *prog)
=========
*/
// chained search for strings in entity fields
-// entity(.string field, string match) findchain = #402;
+// entity(.string field, string match[, .entity chainfield]) findchain = #402;
void VM_findchain(prvm_prog_t *prog)
{
int i;
=========
VM_findchainfloat
-entity findchainfloat(.string field, float match)
-entity findchainentity(.string field, entity match)
+entity findchainfloat(.float field, float match[, .entity chainfield])
+entity findchainentity(.entity field, entity match[, .entity chainfield])
=========
*/
// LadyHavoc: chained search for float, int, and entity reference fields
-// entity(.string field, float match) findchainfloat = #403;
+// entity(.float field, float match[, .entity chainfield]) findchainfloat = #403;
void VM_findchainfloat(prvm_prog_t *prog)
{
int i;
========================
VM_findchainflags
-entity findchainflags(.float field, float match)
+entity findchainflags(.float field, float match[, .entity chainfield])
========================
*/
// LadyHavoc: chained search for flags in float fields
=========
VM_getostype
-float getostype(prvm_prog_t *prog)
+float getostype()
=========
*/ // not used at the moment -> not included in the common list
void VM_getostype(prvm_prog_t *prog)
=========
VM_gettime
-float gettime(prvm_prog_t *prog)
+float gettime([float timer])
=========
*/
float CDAudio_GetPosition(void);
=========
VM_getsoundtime
-float getsoundtime(prvm_prog_t *prog)
+float getsoundtime(entity e, float channel)
=========
*/
=========
VM_precache_pic
-string precache_pic(string pic)
+string precache_pic(string pic[, float flags])
=========
*/
#define PRECACHE_PIC_FROMWAD 1 /* FTEQW, not supported here */
=========
VM_drawcolorcodedstring
-float drawcolorcodedstring(vector position, string text, vector scale, float alpha, float flag)
-/
-float drawcolorcodedstring(vector position, string text, vector scale, vector rgb, float alpha, float flag)
+float drawcolorcodedstring(vector position, string text, vector scale[, vector rgb], float alpha, float flag)
=========
*/
void VM_drawcolorcodedstring(prvm_prog_t *prog)
=========
VM_stringwidth
-float stringwidth(string text, float allowColorCodes, float size)
+float stringwidth(string text, float allowColorCodes[, float size])
=========
*/
void VM_stringwidth(prvm_prog_t *prog)
=========
VM_loadfont
-float loadfont(string fontname, string fontmaps, string sizes, float slot)
+float loadfont(string fontname, string fontmaps, string sizes[, float slot[, float scale[, float voffset]]])
=========
*/
=========
VM_drawpic
-float drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag)
+float drawpic(vector position, string pic, vector size, vector rgb, float alpha[, float flag])
=========
*/
void VM_drawpic(prvm_prog_t *prog)
=========
VM_findkeysforcommand
-string findkeysforcommand(string command, float bindmap)
+string findkeysforcommand(string command[, float bindmap])
the returned string is an altstring
=========
=========
VM_getkeybind
-string getkeybind(float key, float bindmap)
+string getkeybind(float key[, float bindmap])
=========
*/
void VM_getkeybind (prvm_prog_t *prog)
=========
VM_setkeybind
-float setkeybind(float key, string cmd, float bindmap)
+float setkeybind(float key, string bind[, float bindmap])
=========
*/
void VM_setkeybind (prvm_prog_t *prog)
========================
VM_buf_create
creates new buffer, and returns it's index, returns -1 if failed
-float buf_create(prvm_prog_t *prog) = #460;
-float newbuf(string format, float flags) = #460;
+
+float buf_create([string format[, float flags]])
========================
*/
========================
VM_buf_writefile
writes stringbuffer to a file, returns 0 or 1
-float buf_writefile(float filehandle, float bufhandle, [, float startpos, float numstrings]) = #468;
+
+float buf_writefile(float filehandle, float bufhandle[, float startpos[, float numstrings]])
========================
*/
========================
VM_bufstr_find
find an index of bufstring matching rule
-float bufstr_find(float bufhandle, string match, float matchrule, float startpos, float step) = #468;
+
+float bufstr_find(float bufhandle, string match, float matchrule[, float startpos[, float step]])
========================
*/
/*
========================
VM_matchpattern
-float matchpattern(string s, string pattern, float matchrule, float startpos) = #468;
+
+float matchpattern(string s, string pattern, float matchrule[, float startpos])
========================
*/
void VM_matchpattern(prvm_prog_t *prog)
/*
========================
VM_buf_cvarlist
+
+void buf_cvarlist(float buf, string prefix[, string antiprefix])
========================
*/
VM_changeyaw
This was a major timewaster in progs, so it was converted to C
+
+void ChangeYaw()
==============
*/
void VM_changeyaw (prvm_prog_t *prog)
Z_Free(handle);
}
-// uri_get() gets content from an URL and calls a callback "uri_get_callback" with it set as string; an unique ID of the transfer is returned
+// float uri_get(string uri, float id[, string post_contenttype[, string post_delim[, float buf[, float keyid]]]])
+//
+// gets content from an URL and calls a callback "uri_get_callback" with it set as string; an unique ID of the transfer is returned
// returns 1 on success, and then calls the callback with the ID, 0 or the HTTP status code, and the received data in a string
void VM_uri_get (prvm_prog_t *prog)
{
}
}
+// string netaddress_resolve(string ip[, float port])
void VM_netaddress_resolve (prvm_prog_t *prog)
{
const char *ip;
PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(prog, "");
}
-//string(prvm_prog_t *prog) getextresponse = #624; // returns the next extResponse packet that was sent to this client
+// string getextresponse() = #624;
+// returns the next extResponse packet that was sent to this client
void VM_CL_getextresponse (prvm_prog_t *prog)
{
VM_SAFEPARMCOUNT(0,VM_argv);
single print to a specific client
-sprint(clientent, value)
+sprint(entity client, string s, ...)
=================
*/
static void VM_SV_sprint(prvm_prog_t *prog)
single print to a specific client
-centerprint(clientent, value)
+centerprint(entity client, string s, ...)
=================
*/
static void VM_SV_centerprint(prvm_prog_t *prog)
Sends text over to the client's execution buffer
-stuffcmd (clientent, value, ...)
+stuffcmd(entity client, string s, ...)
=================
*/
static void VM_SV_stuffcmd(prvm_prog_t *prog)
Returns a chain of entities that have origins within a spherical area
-findradius (origin, radius)
+findradius(vector org, float rad[, .entity chainfield])
=================
*/
static void VM_SV_findradius(prvm_prog_t *prog)
===============
VM_SV_walkmove
-float(float yaw, float dist[, settrace]) walkmove
+float(float yaw, float dist[, float settrace]) walkmove
===============
*/
static void VM_SV_walkmove(prvm_prog_t *prog)
VM_vectoyaw, // #13 float(vector v) vectoyaw (QUAKE)
VM_spawn, // #14 entity() spawn (QUAKE)
VM_remove, // #15 void(entity e) remove (QUAKE)
-VM_SV_traceline, // #16 void(vector v1, vector v2, float tryents) traceline (QUAKE)
+VM_SV_traceline, // #16 void(vector v1, vector v2, float tryents, entity ignoreent) traceline (QUAKE)
VM_SV_checkclient, // #17 entity() checkclient (QUAKE)
VM_find, // #18 entity(entity start, .string fld, string match) find (QUAKE)
VM_SV_precache_sound, // #19 void(string s) precache_sound (QUAKE)
VM_SV_precache_model, // #20 void(string s) precache_model (QUAKE)
VM_SV_stuffcmd, // #21 void(entity client, string s, ...) stuffcmd (QUAKE)
-VM_SV_findradius, // #22 entity(vector org, float rad) findradius (QUAKE)
+VM_SV_findradius, // #22 entity(vector org, float rad[, .entity chainfield]) findradius (QUAKE)
VM_bprint, // #23 void(string s, ...) bprint (QUAKE)
VM_SV_sprint, // #24 void(entity client, string s, ...) sprint (QUAKE)
VM_dprint, // #25 void(string s, ...) dprint (QUAKE)
VM_traceon, // #29 void() traceon (QUAKE)
VM_traceoff, // #30 void() traceoff (QUAKE)
VM_eprint, // #31 void(entity e) eprint (QUAKE)
-VM_SV_walkmove, // #32 float(float yaw, float dist) walkmove (QUAKE)
+VM_SV_walkmove, // #32 float(float yaw, float dist[, float settrace]) walkmove (QUAKE)
NULL, // #33 (QUAKE)
VM_SV_droptofloor, // #34 float() droptofloor (QUAKE)
VM_SV_lightstyle, // #35 void(float style, string value) lightstyle (QUAKE)
VM_changelevel, // #70 void(string s) changelevel (QUAKE)
NULL, // #71 (QUAKE)
VM_cvar_set, // #72 void(string var, string val) cvar_set (QUAKE)
-VM_SV_centerprint, // #73 void(entity client, strings) centerprint (QUAKE)
+VM_SV_centerprint, // #73 void(entity client, string s, ...) centerprint (QUAKE)
VM_SV_ambientsound, // #74 void(vector pos, string samp, float vol, float atten) ambientsound (QUAKE)
VM_SV_precache_model, // #75 string(string s) precache_model2 (QUAKE)
VM_SV_precache_sound, // #76 string(string s) precache_sound2 (QUAKE)
NULL, // #314
NULL, // #315 void(float width, vector pos1, vector pos2, float flag) drawline (EXT_CSQC)
NULL, // #316 float(string name) iscachedpic (EXT_CSQC)
-NULL, // #317 string(string name, float trywad) precache_pic (EXT_CSQC)
+NULL, // #317 string(string pic[, float flags]) precache_pic (EXT_CSQC)
NULL, // #318 vector(string picname) draw_getimagesize (EXT_CSQC)
NULL, // #319 void(string name) freepic (EXT_CSQC)
NULL, // #320 float(vector position, float character, vector scale, vector rgb, float alpha, float flag) drawcharacter (EXT_CSQC)
NULL, // #321 float(vector position, string text, vector scale, vector rgb, float alpha, float flag) drawstring (EXT_CSQC)
-NULL, // #322 float(vector position, string pic, vector size, vector rgb, float alpha, float flag) drawpic (EXT_CSQC)
+NULL, // #322 float(vector position, string pic, vector size, vector rgb, float alpha[, float flag]) drawpic (EXT_CSQC)
NULL, // #323 float(vector position, vector size, vector rgb, float alpha, float flag) drawfill (EXT_CSQC)
NULL, // #324 void(float x, float y, float width, float height) drawsetcliparea
NULL, // #325 void(void) drawresetcliparea
VM_SV_modelnameforindex, // #334 string(float mdlindex) modelnameforindex (EXT_CSQC)
VM_SV_particleeffectnum, // #335 float(string effectname) particleeffectnum (EXT_CSQC)
VM_SV_trailparticles, // #336 void(entity ent, float effectnum, vector start, vector end) trailparticles (EXT_CSQC)
-VM_SV_pointparticles, // #337 void(float effectnum, vector origin [, vector dir, float count]) pointparticles (EXT_CSQC)
+VM_SV_pointparticles, // #337 void(float effectnum, vector origin, vector dir, float count[, float color]) pointparticles (EXT_CSQC)
NULL, // #338 void(string s, ...) centerprint (EXT_CSQC)
VM_print, // #339 void(string s, ...) print (EXT_CSQC, DP_SV_PRINT)
NULL, // #340 string(float keynum) keynumtostring (EXT_CSQC)
NULL, // #341 float(string keyname) stringtokeynum (EXT_CSQC)
-NULL, // #342 string(float keynum) getkeybind (EXT_CSQC)
+NULL, // #342 string(float keynum[, float bindmap]) getkeybind (EXT_CSQC)
NULL, // #343 void(float usecursor) setcursormode (EXT_CSQC)
NULL, // #344 vector() getmousepos (EXT_CSQC)
NULL, // #345 float(float framenum) getinputstate (EXT_CSQC)
VM_SV_te_flamejet, // #457 void(vector org, vector vel, float howmany) te_flamejet = #457 (DP_TE_FLAMEJET)
NULL, // #458
VM_ftoe, // #459 entity(float num) entitybyindex (DP_QC_EDICT_NUM)
-VM_buf_create, // #460 float() buf_create (DP_QC_STRINGBUFFERS)
+VM_buf_create, // #460 float([string format[, float flags]]) buf_create (DP_QC_STRINGBUFFERS)
VM_buf_del, // #461 void(float bufhandle) buf_del (DP_QC_STRINGBUFFERS)
VM_buf_getsize, // #462 float(float bufhandle) buf_getsize (DP_QC_STRINGBUFFERS)
VM_buf_copy, // #463 void(float bufhandle_from, float bufhandle_to) buf_copy (DP_QC_STRINGBUFFERS)
VM_uri_escape, // #510 string(string in) uri_escape = #510;
VM_uri_unescape, // #511 string(string in) uri_unescape = #511;
VM_etof, // #512 float(entity ent) num_for_edict = #512 (DP_QC_NUM_FOR_EDICT)
-VM_uri_get, // #513 float(string uri, float id, [string post_contenttype, string post_delim, [float buf]]) uri_get = #513; (DP_QC_URI_GET, DP_QC_URI_POST)
+VM_uri_get, // #513 float(string uri, float id[, string post_contenttype[, string post_delim[, float buf[, float keyid]]]]) uri_get = #513; (DP_QC_URI_GET, DP_QC_URI_POST)
VM_tokenize_console, // #514 float(string str) tokenize_console = #514; (DP_QC_TOKENIZE_CONSOLE)
VM_argv_start_index, // #515 float(float idx) argv_start_index = #515; (DP_QC_TOKENIZE_CONSOLE)
VM_argv_end_index, // #516 float(float idx) argv_end_index = #516; (DP_QC_TOKENIZE_CONSOLE)
-VM_buf_cvarlist, // #517 void(float buf, string prefix, string antiprefix) buf_cvarlist = #517; (DP_QC_STRINGBUFFERS_CVARLIST)
+VM_buf_cvarlist, // #517 void(float buf, string prefix[, string antiprefix]) buf_cvarlist = #517; (DP_QC_STRINGBUFFERS_CVARLIST)
VM_cvar_description, // #518 float(string name) cvar_description = #518; (DP_QC_CVAR_DESCRIPTION)
VM_gettime, // #519 float(float timer) gettime = #519; (DP_QC_GETTIME)
NULL, // #520
VM_getsoundtime, // #533 float(entity e, float channel) getsoundtime = #533; (DP_SND_GETSOUNDTIME)
VM_soundlength, // #534 float(string sample) soundlength = #534; (DP_SND_GETSOUNDTIME)
VM_buf_loadfile, // #535 float(string filename, float bufhandle) buf_loadfile (DP_QC_STRINGBUFFERS_EXT_WIP)
-VM_buf_writefile, // #536 float(float filehandle, float bufhandle, float startpos, float numstrings) buf_writefile (DP_QC_STRINGBUFFERS_EXT_WIP)
-VM_bufstr_find, // #537 float(float bufhandle, string match, float matchrule, float startpos) bufstr_find (DP_QC_STRINGBUFFERS_EXT_WIP)
-VM_matchpattern, // #538 float(string s, string pattern, float matchrule) matchpattern (DP_QC_STRINGBUFFERS_EXT_WIP)
+VM_buf_writefile, // #536 float(float filehandle, float bufhandle[, float startpos[, float numstrings]]) buf_writefile (DP_QC_STRINGBUFFERS_EXT_WIP)
+VM_bufstr_find, // #537 float(float bufhandle, string match, float matchrule[, float startpos[, float step]]) bufstr_find (DP_QC_STRINGBUFFERS_EXT_WIP)
+VM_matchpattern, // #538 float(string s, string pattern, float matchrule[, float startpos]) matchpattern (DP_QC_STRINGBUFFERS_EXT_WIP)
NULL, // #539
VM_physics_enable, // #540 void(entity e, float physics_enabled) physics_enable = #540; (DP_PHYSICS_ODE)
VM_physics_addforce, // #541 void(entity e, vector force, vector relative_ofs) physics_addforce = #541; (DP_PHYSICS_ODE)