Difference between revisions of "Built In Functions"
Jump to navigation
Jump to search
(Created page with "{| class="wikitable" |+ !number !name !return !brief |- |1 |makevectors |void |// sets v_forward, etc globals |- |2 |setorigin |void |set movetype and solid first |- |3 |setmodel |void | |- |4 |setsize |void | |- |6 |break |void | |- |7 |random |float |returns 0 - 1 |- |8 |sound |void | |- |9 |normalize |vector | |- |10 |error |void | |- |11 |objerror |void | |- |12 |vlen |float | |- |13 |vectoyaw |float | |- |14 |[spawn] |entity | |- |15 |remove |void | |- | | | | |}...") |
|||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
These are the 'built in' (ie coded in C in the Quake ''engine'') functions available in the 2021 Quake rerelease. | |||
{| class="wikitable" | {| class="wikitable" | ||
|+ | |+ | ||
Line 9: | Line 10: | ||
|makevectors | |makevectors | ||
|void | |void | ||
| | |sets v_forward, v_up, v_right from cartesian angles | ||
|- | |- | ||
|2 | |2 | ||
|setorigin | |setorigin | ||
|void | |void | ||
|set movetype and solid first | |sets the 'origin; of an entity - set movetype and solid first | ||
|- | |- | ||
|3 | |3 | ||
|setmodel | |setmodel | ||
|void | |void | ||
| | |sets the model for an entity | ||
|- | |- | ||
|4 | |4 | ||
|setsize | |setsize | ||
|void | |void | ||
| | |sets the 'size' of an entity | ||
|- | |- | ||
|6 | |6 | ||
Line 34: | Line 35: | ||
|random | |random | ||
|float | |float | ||
|returns 0 - 1 | |returns a "random" number between 0 - 1 | ||
|- | |- | ||
|8 | |8 | ||
Line 44: | Line 45: | ||
|normalize | |normalize | ||
|vector | |vector | ||
| | |returns a unit length vector along the given vector | ||
|- | |- | ||
|10 | |10 | ||
Line 59: | Line 60: | ||
|vlen | |vlen | ||
|float | |float | ||
| | |returns the length of a vector | ||
|- | |- | ||
|13 | |13 | ||
Line 67: | Line 68: | ||
|- | |- | ||
|14 | |14 | ||
|[spawn] | |[[Spawn()|spawn]] | ||
|entity | |entity | ||
| | |creates an entity | ||
|- | |- | ||
|15 | |15 | ||
|remove | |remove | ||
|void | |||
|immediately removes an entity from the game | |||
|- | |||
|16 | |||
|[[traceline]] | |||
|void | |||
|performs a raycast and populates some variables with the results | |||
|- | |||
|17 | |||
|checkclient | |||
|entity | |||
|// returns a client to look for | |||
|- | |||
|18 | |||
|find | |||
|entity | |||
|searches the 'world' for an entity matching criteria | |||
|- | |||
|19 | |||
|precache_sound | |||
|string | |||
|caches a sound for later use | |||
|- | |||
|20 | |||
|precache_model | |||
|string | |||
|caches a model for later use | |||
|- | |||
|21 | |||
|stuffcmd | |||
|void | |||
| | |||
|- | |||
|22 | |||
|findradius | |||
|entity | |||
|"finds" all entities within a given radius | |||
|- | |||
|23 | |||
|[[bprint]] | |||
|void | |||
|prints to all players | |||
|- | |||
|24 | |||
|[[sprint]] | |||
|void | |||
|prints to one player/entity | |||
|- | |||
|25 | |||
|[[dprint]] | |||
|void | |||
|debug print | |||
|- | |||
|26 | |||
|[[ftos]] | |||
|string | |||
|returns a string version of a floating point number | |||
|- | |||
|27 | |||
|[[vtos]] | |||
|string | |||
|returns a string representation of a vector | |||
|- | |||
|28 | |||
|coredump | |||
|void | |||
|// prints all edicts | |||
|- | |||
|29 | |||
|traceon | |||
|void | |||
|// turns statment trace on | |||
|- | |||
|30 | |||
|traceoff | |||
|void | |||
| | |||
|- | |||
|31 | |||
|eprint | |||
|void | |||
|// prints an entire edict | |||
|- | |||
|32 | |||
|walkmove | |||
|float | |||
|// returns TRUE or FALSE | |||
|- | |||
|33 | |||
| | |||
| | |||
|// #33 was removed | |||
|- | |||
|34 | |||
|droptofloor | |||
|float | |||
|// TRUE if landed on floor | |||
|- | |||
|35 | |||
|lightstyle | |||
|void | |||
| | |||
|- | |||
|36 | |||
|rint | |||
|float | |||
|// round to nearest int | |||
|- | |||
|37 | |||
|floor | |||
|float | |||
|// largest integer <= v | |||
|- | |||
|38 | |||
|ceil | |||
|float | |||
|// smallest integer >= v | |||
|- | |||
|39 | |||
| | |||
| | |||
|// #was removed | |||
|- | |||
|40 | |||
|checkbottom | |||
|float | |||
|// true if self is on ground | |||
|- | |||
|41 | |||
|pointcontents | |||
|float | |||
|// returns a CONTENT_* | |||
|- | |||
|42 | |||
| | |||
| | |||
|// #42 was removed | |||
|- | |||
|43 | |||
|fabs | |||
|float | |||
|floating point absolute value func | |||
|- | |||
|44 | |||
|aim | |||
|vector | |||
|// returns the shooting vector | |||
|- | |||
|45 | |||
|cvar | |||
|float | |||
|// return cvar.value | |||
|- | |||
|46 | |||
|localcmd | |||
|void | |||
|// put string into local que | |||
|- | |||
|47 | |||
|nextent | |||
|entity | |||
|// for looping through all ents | |||
|- | |||
|48 | |||
|particle | |||
|void | |||
|// start a particle effect | |||
|- | |||
|49 | |||
|ChangeYaw | |||
|void | |||
|// turn towards self.ideal_yaw | |||
|- | |||
|50 | |||
| | |||
| | |||
|// #50 was removed | |||
|- | |||
|51 | |||
|vectoangles | |||
|vector | |||
|gets catesian angles from a vector | |||
|- | |||
|52 | |||
|WriteByte | |||
|void | |||
| | |||
|- | |||
|53 | |||
|WriteChar | |||
|void | |||
| | |||
|- | |||
|54 | |||
|WriteShort | |||
|void | |||
| | |||
|- | |||
|55 | |||
|WriteLong | |||
|void | |||
| | |||
|- | |||
|56 | |||
|WriteCoord | |||
|void | |||
| | |||
|- | |||
|57 | |||
|WriteAngle | |||
|void | |||
| | |||
|- | |||
|58 | |||
|WriteString | |||
|void | |||
| | |||
|- | |||
|59 | |||
|WriteEntity | |||
|void | |||
| | |||
|- | |||
|60 | |||
|bWriteChar | |||
|void | |||
| | |||
|- | |||
|61 | |||
|bWriteShort | |||
|void | |||
| | |||
|- | |||
|62 | |||
|bWriteLong | |||
|void | |||
| | |||
|- | |||
|63 | |||
|bWriteCoord | |||
|void | |||
| | |||
|- | |||
|64 | |||
|bWriteAngle | |||
|void | |||
| | |||
|- | |||
|65 | |||
|bWriteString | |||
|void | |||
| | |||
|- | |||
|66 | |||
|bWriteEntity | |||
|void | |||
| | |||
|- | |||
|67 | |||
|movetogoal | |||
|void | |||
| | |||
|- | |||
|68 | |||
|precache_file | |||
|string | |||
| | |||
|- | |||
|69 | |||
|makestatic | |||
|void | |||
| | |||
|- | |||
|70 | |||
|changelevel | |||
|void | |||
| | |||
|- | |||
|71 | |||
| | |||
| | |||
|//#71 was removed | |||
|- | |||
|72 | |||
|cvar_set | |||
|void | |||
|// sets cvar.value | |||
|- | |||
|73 | |||
|centerprint | |||
|void | |||
|prints to one player/entity in the middle of the screen | |||
|- | |||
|74 | |||
|ambientsound | |||
|void | |||
| | |||
|- | |||
|75 | |||
|precache_model2 | |||
|string | |||
|// registered version only | |||
|- | |||
|76 | |||
|precache_sound2 | |||
|string | |||
|// registered version only | |||
|- | |||
|77 | |||
|precache_file2 | |||
|string | |||
|// registered version only | |||
|- | |||
|78 | |||
|setspawnparms | |||
|void | |||
|// set parm1... to the | |||
|- | |||
|79 | |||
|finaleFinished | |||
|void | |void | ||
| | | | ||
|- | |- | ||
|80 | |||
|localsound | |||
|string | |||
| | | | ||
|- | |||
|81 | |||
|draw_point | |||
|void | |||
|draws a point for debugging | |||
|- | |||
|82 | |||
|draw_line | |||
|void | |||
|draws a line for debugging | |||
|- | |||
|83 | |||
|draw_arrow | |||
|void | |||
|draws an arrow for debugging | |||
|- | |||
|84 | |||
|draw_ray | |||
|void | |||
|draws a ray for debugging | |||
|- | |||
|85 | |||
|draw_circle | |||
|void | |||
|draws circle geometry for debugging | |||
|- | |||
|86 | |||
|draw_bounds | |||
|void | |||
|draws a bounding box for debugging | |||
|- | |||
|87 | |||
|draw_worldtext | |||
|void | |||
|draws text geometry for debugging | |||
|- | |||
|88 | |||
|draw_sphere | |||
|void | |||
|draws sphere geometry for debugging | |||
|- | |||
|89 | |||
|draw_cylinder | |||
|void | |||
|draws cylinder geometry for debugging | |||
|- | |||
|90 | |||
|centerprint2 | |||
|void | |||
| | | | ||
|- | |||
|91 | |||
|bprint2 | |||
|void | |||
| | | | ||
|- | |||
|92 | |||
|sprint2 | |||
|void | |||
| | |||
|- | |||
|99 | |||
|checkextension | |||
|float | |||
| | | | ||
|} | |} | ||
Latest revision as of 06:45, 24 March 2022
These are the 'built in' (ie coded in C in the Quake engine) functions available in the 2021 Quake rerelease.
number | name | return | brief |
---|---|---|---|
1 | makevectors | void | sets v_forward, v_up, v_right from cartesian angles |
2 | setorigin | void | sets the 'origin; of an entity - set movetype and solid first |
3 | setmodel | void | sets the model for an entity |
4 | setsize | void | sets the 'size' of an entity |
6 | break | void | |
7 | random | float | returns a "random" number between 0 - 1 |
8 | sound | void | |
9 | normalize | vector | returns a unit length vector along the given vector |
10 | error | void | |
11 | objerror | void | |
12 | vlen | float | returns the length of a vector |
13 | vectoyaw | float | |
14 | spawn | entity | creates an entity |
15 | remove | void | immediately removes an entity from the game |
16 | traceline | void | performs a raycast and populates some variables with the results |
17 | checkclient | entity | // returns a client to look for |
18 | find | entity | searches the 'world' for an entity matching criteria |
19 | precache_sound | string | caches a sound for later use |
20 | precache_model | string | caches a model for later use |
21 | stuffcmd | void | |
22 | findradius | entity | "finds" all entities within a given radius |
23 | bprint | void | prints to all players |
24 | sprint | void | prints to one player/entity |
25 | dprint | void | debug print |
26 | ftos | string | returns a string version of a floating point number |
27 | vtos | string | returns a string representation of a vector |
28 | coredump | void | // prints all edicts |
29 | traceon | void | // turns statment trace on |
30 | traceoff | void | |
31 | eprint | void | // prints an entire edict |
32 | walkmove | float | // returns TRUE or FALSE |
33 | // #33 was removed | ||
34 | droptofloor | float | // TRUE if landed on floor |
35 | lightstyle | void | |
36 | rint | float | // round to nearest int |
37 | floor | float | // largest integer <= v |
38 | ceil | float | // smallest integer >= v |
39 | // #was removed | ||
40 | checkbottom | float | // true if self is on ground |
41 | pointcontents | float | // returns a CONTENT_* |
42 | // #42 was removed | ||
43 | fabs | float | floating point absolute value func |
44 | aim | vector | // returns the shooting vector |
45 | cvar | float | // return cvar.value |
46 | localcmd | void | // put string into local que |
47 | nextent | entity | // for looping through all ents |
48 | particle | void | // start a particle effect |
49 | ChangeYaw | void | // turn towards self.ideal_yaw |
50 | // #50 was removed | ||
51 | vectoangles | vector | gets catesian angles from a vector |
52 | WriteByte | void | |
53 | WriteChar | void | |
54 | WriteShort | void | |
55 | WriteLong | void | |
56 | WriteCoord | void | |
57 | WriteAngle | void | |
58 | WriteString | void | |
59 | WriteEntity | void | |
60 | bWriteChar | void | |
61 | bWriteShort | void | |
62 | bWriteLong | void | |
63 | bWriteCoord | void | |
64 | bWriteAngle | void | |
65 | bWriteString | void | |
66 | bWriteEntity | void | |
67 | movetogoal | void | |
68 | precache_file | string | |
69 | makestatic | void | |
70 | changelevel | void | |
71 | //#71 was removed | ||
72 | cvar_set | void | // sets cvar.value |
73 | centerprint | void | prints to one player/entity in the middle of the screen |
74 | ambientsound | void | |
75 | precache_model2 | string | // registered version only |
76 | precache_sound2 | string | // registered version only |
77 | precache_file2 | string | // registered version only |
78 | setspawnparms | void | // set parm1... to the |
79 | finaleFinished | void | |
80 | localsound | string | |
81 | draw_point | void | draws a point for debugging |
82 | draw_line | void | draws a line for debugging |
83 | draw_arrow | void | draws an arrow for debugging |
84 | draw_ray | void | draws a ray for debugging |
85 | draw_circle | void | draws circle geometry for debugging |
86 | draw_bounds | void | draws a bounding box for debugging |
87 | draw_worldtext | void | draws text geometry for debugging |
88 | draw_sphere | void | draws sphere geometry for debugging |
89 | draw_cylinder | void | draws cylinder geometry for debugging |
90 | centerprint2 | void | |
91 | bprint2 | void | |
92 | sprint2 | void | |
99 | checkextension | float |