2 // Basically every vm builtin cmd should be in here.
3 // All 3 builtin and extension lists can be found here
4 // cause large (I think they will) parts are from pr_cmds the same copyright like in pr_cmds
9 ============================================================================
13 checkextension(string)
18 sprint(float clientnum,...[string])
19 centerprint(...[string])
20 vector normalize(vector)
22 float vectoyaw(vector)
23 vector vectoangles(vector)
27 cvar_set (string,string)
33 float stof(...[string])
36 entity find(entity start, .string field, string match)
38 entity findfloat(entity start, .float field, float match)
39 entity findentity(entity start, .entity field, entity match)
41 entity findchain(.string field, string match)
43 entity findchainfloat(.string field, float match)
44 entity findchainentity(.string field, entity match)
46 string precache_file(string)
47 string precache_sound (string sample)
55 entity nextent(entity)
60 float registercvar (string name, string value, float flags)
61 float min(float a, float b, ...[float])
62 float max(float a, float b, ...[float])
63 float bound(float min, float value, float max)
64 float pow(float a, float b)
65 copyentity(entity src, entity dst)
66 float fopen(string filename, float mode)
68 string fgets(float fhandle)
69 fputs(float fhandle, string s)
70 float strlen(string s)
71 string strcat(string,string,...[string])
72 string substring(string s, float start, float length)
74 string strzone(string s)
76 float tokenize(string s)
81 clientcommand(float client, string s) (for client and menu)
82 changelevel(string map)
83 localsound(string sample)
86 loadfromdata(string data)
87 loadfromfile(string file)
88 parseentitydata(entity ent, string data)
89 float mod(float val, float m)
90 const string cvar_string (string)
94 float search_begin(string pattern, float caseinsensitive, float quiet)
95 void search_end(float handle)
96 float search_getsize(float handle)
97 string search_getfilename(float handle, float num)
99 string chr(float ascii)
104 -------will be removed soon----------
105 float altstr_count(string)
106 string altstr_prepare(string)
107 string altstr_get(string,float)
108 string altstr_set(string altstr, float num, string set)
109 string altstr_ins(string altstr, float num, string set)
110 --------------------------------------
112 entity findflags(entity start, .float field, float match)
113 entity findchainflags(.float field, float match)
115 const string VM_cvar_defstring (string)
117 perhaps only : Menu : WriteMsg
118 ===============================
120 WriteByte(float data, float dest, float desto)
121 WriteChar(float data, float dest, float desto)
122 WriteShort(float data, float dest, float desto)
123 WriteLong(float data, float dest, float desto)
124 WriteAngle(float data, float dest, float desto)
125 WriteCoord(float data, float dest, float desto)
126 WriteString(string data, float dest, float desto)
127 WriteEntity(entity data, float dest, float desto)
129 Client & Menu : draw functions & video functions
130 ===================================================
132 float iscachedpic(string pic)
133 string precache_pic(string pic)
135 float drawcharacter(vector position, float character, vector scale, vector rgb, float alpha, float flag)
136 float drawstring(vector position, string text, vector scale, vector rgb, float alpha, float flag)
137 float drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag)
138 float drawfill(vector position, vector size, vector rgb, float alpha, float flag)
139 drawsetcliparea(float x, float y, float width, float height)
141 vector getimagesize(string pic)
143 float cin_open(string file, string name)
144 void cin_close(string name)
145 void cin_setstate(string name, float type)
146 float cin_getstate(string name)
147 void cin_restart(string name)
149 ==============================================================================
153 setkeydest(float dest)
155 setmousetarget(float target)
156 float getmousetarget()
158 callfunction(...,string function_name)
159 writetofile(float fhandle, entity ent)
160 float isfunction(string function_name)
161 vector getresolution(float number)
162 string keynumtostring(float keynum)
163 string findkeysforcommand(string command)
164 float getserverliststat(float type)
165 string getserverliststring(float fld, float hostnr)
167 float stringtokeynum(string key)
169 resetserverlistmasks()
170 setserverlistmaskstring(float mask, float fld, string str)
171 setserverlistmasknumber(float mask, float fld, float num, float op)
173 setserverlistsort(float field, float descending)
175 float getserverlistnumber(float fld, float hostnr)
176 float getserverlistindexforkey(string key)
177 addwantedserverlistkey(string key)
180 #include "quakedef.h"
181 #include "progdefs.h"
183 #include "clprogdefs.h"
184 #include "mprogdefs.h"
186 #include "cl_video.h"
188 //============================================================================
189 // nice helper macros
191 #ifndef VM_NOPARMCHECK
192 #define VM_SAFEPARMCOUNT(p,f) if(prog->argc != p) PRVM_ERROR(#f " wrong parameter count (" #p " expected ) !")
194 #define VM_SAFEPARMCOUNT(p,f)
197 #define VM_RETURN_EDICT(e) (((int *)prog->globals.generic)[OFS_RETURN] = PRVM_EDICT_TO_PROG(e))
199 #define e10 NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL
200 #define e100 e10,e10,e10,e10,e10,e10,e10,e10,e10,e10
201 #define e1000 e100,e100,e100,e100,e100,e100,e100,e100,e100,e100
203 #define VM_STRINGTEMP_BUFFERS 16
204 #define VM_STRINGTEMP_LENGTH 4096
206 // builtins and other general functions
208 char *VM_GetTempString(void);
209 void VM_CheckEmptyString (const char *s);
210 void VM_VarString(int first, char *out, int outlength);
212 void VM_checkextension (void);
213 void VM_error (void);
214 void VM_objerror (void);
215 void VM_print (void);
216 void VM_bprint (void);
217 void VM_sprint (void);
218 void VM_centerprint (void);
219 void VM_normalize (void);
221 void VM_vectoyaw (void);
222 void VM_vectoangles (void);
223 void VM_random (void);
224 void VM_localsound(void);
225 void VM_break (void);
226 void VM_localcmd (void);
228 void VM_cvar_string(void);
229 void VM_cvar_defstring (void);
230 void VM_cvar_set (void);
231 void VM_dprint (void);
239 void VM_spawn (void);
240 void VM_remove (void);
242 void VM_findfloat (void);
243 void VM_findchain (void);
244 void VM_findchainfloat (void);
245 void VM_findflags (void);
246 void VM_findchainflags (void);
247 void VM_precache_file (void);
248 void VM_precache_error (void);
249 void VM_precache_sound (void);
250 void VM_coredump (void);
252 void VM_stackdump (void);
253 void VM_crash(void); // REMOVE IT
254 void VM_traceon (void);
255 void VM_traceoff (void);
256 void VM_eprint (void);
258 void VM_floor (void);
260 void VM_nextent (void);
262 void VM_changelevel (void);
266 void VM_randomvec (void);
267 void VM_registercvar (void);
270 void VM_bound (void);
272 void VM_copyentity (void);
274 void VM_Files_Init(void);
275 void VM_Files_CloseAll(void);
278 void VM_fclose(void);
281 // used by M_WriteToFile
282 // should be only called from a builtin
283 qfile_t *VM_GetFileHandle( int index );
285 void VM_strlen(void);
286 void VM_strcat(void);
287 void VM_substring(void);
289 void VM_strzone(void);
290 void VM_strunzone(void);
292 void VM_clcommand (void);
294 void VM_tokenize (void);
297 void VM_isserver(void);
298 void VM_clientcount(void);
299 void VM_clientstate(void);
300 // not used at the moment -> not included in the common list
301 void VM_getostype(void);
302 void VM_getmousepos(void);
303 void VM_gettime(void);
304 void VM_loadfromdata(void);
305 void VM_parseentitydata(void);
306 void VM_loadfromfile(void);
307 void VM_modulo(void);
309 void VM_search_begin(void);
310 void VM_search_end(void);
311 void VM_search_getsize(void);
312 void VM_search_getfilename(void);
314 void VM_iscachedpic(void);
315 void VM_precache_pic(void);
316 void VM_freepic(void);
317 void VM_drawcharacter(void);
318 void VM_drawstring(void);
319 void VM_drawpic(void);
320 void VM_drawfill(void);
321 void VM_drawsetcliparea(void);
322 void VM_drawresetcliparea(void);
323 void VM_getimagesize(void);
325 void VM_cin_open( void );
326 void VM_cin_close( void );
327 void VM_cin_setstate( void );
328 void VM_cin_getstate( void );
329 void VM_cin_restart( void );
331 void VM_altstr_count( void );
332 void VM_altstr_prepare( void );
333 void VM_altstr_get( void );
334 void VM_altstr_set( void );
335 void VM_altstr_ins(void);
337 void VM_Cmd_Init(void);
338 void VM_Cmd_Reset(void);