Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!
Difference between revisions of "List of builtin functions"
From Quake Wiki
(The numbering for EXT_BITSHIFT and FTE_STRINGS was wrong (at least according to the pages for EXT_BITSHIFT and FTE_STRINGS).) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | [[ | + | Builtin functions are functions in QuakeC that perform a callback to a function within the engine itself. This was done to improve performance as some tasks were too expensive to do within QuakeC itself. They're declared by creating a function prototype and assigning it to an index within the internal builtin table. |
+ | returntype(datatype param1) functionname = #[index]; | ||
+ | [index] in this case is the actual index of the function within the builtin table. This is not exposed to QuakeC at all so validation must be done by checking the table within the engine itself. For instance, <code>makevectors()</code> is defined as | ||
+ | void(vector ang) makevectors = #1; | ||
+ | since the corresponding internal function is at index 1 within the table. | ||
− | === | + | == Builtin Functions == |
− | + | Below are all of the builtin functions with the number signifying their index in the table. | |
− | |||
+ | === Vanilla Builtins === | ||
{|style="border:1px solid #000000" | {|style="border:1px solid #000000" | ||
|- | |- | ||
Line 19: | Line 23: | ||
|- | |- | ||
| 4 || [[setsize]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | | 4 || [[setsize]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
− | |||
− | |||
|- | |- | ||
| 6 || [[break]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | | 6 || [[break]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
Line 75: | Line 77: | ||
|- | |- | ||
| 32 || [[walkmove]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | | 32 || [[walkmove]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
− | |||
− | |||
|- | |- | ||
| 34 || [[droptofloor]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | | 34 || [[droptofloor]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
Line 87: | Line 87: | ||
|- | |- | ||
| 38 || [[ceil]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | | 38 || [[ceil]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
− | |||
− | |||
|- | |- | ||
| 40 || [[checkbottom]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | | 40 || [[checkbottom]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
|- | |- | ||
| 41 || [[pointcontents]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | | 41 || [[pointcontents]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
− | |||
− | |||
|- | |- | ||
| 43 || [[fabs]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | | 43 || [[fabs]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
Line 109: | Line 105: | ||
|- | |- | ||
| 49 || [[ChangeYaw]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | | 49 || [[ChangeYaw]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
− | |||
− | |||
|- | |- | ||
| 51 || [[vectoangles]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | | 51 || [[vectoangles]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
Line 129: | Line 123: | ||
|- | |- | ||
| 59 || [[WriteEntity]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | | 59 || [[WriteEntity]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
+ | |- | ||
+ | | 67 || [[movetogoal]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
+ | |- | ||
+ | | 68 || [[precache_file]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
+ | |- | ||
+ | | 69 || [[makestatic]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
+ | |- | ||
+ | | 70 || [[changelevel]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
+ | |- | ||
+ | | 72 || [[cvar_set]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
+ | |- | ||
+ | | 73 || [[centerprint]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
+ | |- | ||
+ | | 74 || [[ambientsound]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
+ | |- | ||
+ | | 75 || [[precache_model2]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
+ | |- | ||
+ | | 76 || [[precache_sound2]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
+ | |- | ||
+ | | 77 || [[precache_file2]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
+ | |- | ||
+ | | 78 || [[setspawnparms]] || [[NQ]] || [[QW]] || [[H2MP]] || N/A | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | |||
+ | === Extended Builtins === | ||
+ | These are builtins that only certain source ports have access to. | ||
+ | {|style="border:1px solid #000000" | ||
+ | |- | ||
+ | |style="align:center" | '''#''' | ||
+ | |style="align:center" | '''Function''' | ||
+ | |style="align:center" colspan="3" | '''Supported by ''' | ||
+ | |style="align:center" | '''[[QSG extensions|QSG Key]]''' | ||
+ | |- | ||
+ | | 5 || [[lightstylestatic]] || || || [[H2MP]] || N/A | ||
+ | |- | ||
+ | | 33 || [[tracearea]] || || || [[H2MP]] || N/A | ||
+ | |- | ||
+ | | 39 || [[AwardExperience]] || || || [[H2MP]] || N/A | ||
+ | |- | ||
+ | | 42 || [[particle2]] || || || [[H2MP]] || N/A | ||
+ | |- | ||
+ | | 50 || [[vhlen]] || || || [[H2MP]] || N/A | ||
|- | |- | ||
| 60 || [[sin]] || || || || [[DP_QC_SINCOSSQRTPOW]] | | 60 || [[sin]] || || || || [[DP_QC_SINCOSSQRTPOW]] | ||
Line 155: | Line 193: | ||
|- | |- | ||
| 66 || [[setclass]] || || || [[H2MP]] || N/A | | 66 || [[setclass]] || || || [[H2MP]] || N/A | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| 71 || [[lightstylevalue]] || || || [[H2MP]] || N/A | | 71 || [[lightstylevalue]] || || || [[H2MP]] || N/A | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| 79 || [[logfrag]] || || [[QW]] || || N/A | | 79 || [[logfrag]] || || [[QW]] || || N/A | ||
Line 514: | Line 530: | ||
|} | |} | ||
− | ===[[Telejano]] (NQ)=== | + | |
− | * [[cvarstring]] | + | === [[Telejano]] (NQ) === |
− | * [[readline]] | + | *[[cvarstring]] |
+ | *[[readline]] | ||
+ | |||
+ | == See Also == | ||
+ | *[[Builtin ranges]] | ||
+ | *[[QSG extensions]] |
Latest revision as of 11:32, 2 August 2023
Builtin functions are functions in QuakeC that perform a callback to a function within the engine itself. This was done to improve performance as some tasks were too expensive to do within QuakeC itself. They're declared by creating a function prototype and assigning it to an index within the internal builtin table.
returntype(datatype param1) functionname = #[index];
[index] in this case is the actual index of the function within the builtin table. This is not exposed to QuakeC at all so validation must be done by checking the table within the engine itself. For instance, makevectors()
is defined as
void(vector ang) makevectors = #1;
since the corresponding internal function is at index 1 within the table.
Contents
Builtin Functions[edit]
Below are all of the builtin functions with the number signifying their index in the table.
Vanilla Builtins[edit]
Extended Builtins[edit]
These are builtins that only certain source ports have access to.