ssdefs.qc (138631B)
1 /* 2 This file was generated by FTE Quake 5695, dated 2020-05-16T13:12:58.990875Z. 3 This file can be regenerated by issuing the following command: 4 pr_dumpplatform -O ssdefs -Tqw -Ffte -Fdefines 5 Available options: 6 -Ffte - target only FTE (optimations and additional extensions) 7 -Tnq - dump specifically NQ fields 8 -Tqw - dump specifically QW fields 9 -Tcs - dump specifically CSQC fields 10 -Tmenu - dump specifically menuqc fields 11 -Fdefines - generate #defines instead of constants 12 -Faccessors - use accessors instead of basic types via defines 13 -O - write to a different qc file 14 */ 15 #pragma noref 1 16 //#pragma flag enable logicops 17 #pragma warning error Q101 /*too many parms. The vanilla qcc didn't validate properly, hence why fteqcc normally treats it as a warning.*/ 18 #pragma warning error Q105 /*too few parms. The vanilla qcc didn't validate properly, hence why fteqcc normally treats it as a warning.*/ 19 #pragma warning error Q106 /*assignment to constant/lvalue. Define them as var if you want to initialise something.*/ 20 #pragma warning error Q208 /*system crc unknown. Compatibility goes out of the window if you disable this.*/ 21 #pragma warning disable F211 /*system crc outdated (eg: dp's csqc). Note that this may trigger emulation.*/ 22 #pragma warning enable F301 /*non-utf-8 strings. Think of the foreigners! Also think of text editors that insist on screwing up your char encodings.*/ 23 #pragma warning enable F302 /*uninitialised locals. They usually default to 0 in qc (except in recursive functions), but its still probably a bug*/ 24 #pragma target FTE 25 #ifndef QUAKEWORLD 26 #define QUAKEWORLD 27 #endif 28 #ifndef QWSSQC 29 #define QWSSQC 30 #endif 31 #ifndef SSQC 32 #define SSQC 33 #endif 34 #define FTE_PEXT_SETVIEW /* NQ's svc_setview works correctly even in quakeworld */ 35 #define DP_ENT_SCALE 36 #define FTE_PEXT_LIGHTSTYLECOL 37 #define DP_ENT_ALPHA 38 #define FTE_PEXT_VIEW2 39 #define FTE_PEXT_ACURATETIMINGS 40 #define FTE_PEXT_SOUNDDBL 41 #define FTE_PEXT_FATNESS 42 #define DP_HALFLIFE_MAP 43 #define FTE_PEXT_TE_BULLET 44 #define FTE_PEXT_HULLSIZE 45 #define FTE_PEXT_MODELDBL 46 #define FTE_PEXT_ENTITYDBL 47 #define FTE_PEXT_ENTITYDBL2 48 #define FTE_PEXT_FLOATCOORDS 49 #define FTE_PEXT_VWEAP 50 #define FTE_PEXT_Q2BSP 51 #define FTE_PEXT_Q3BSP 52 #define DP_ENT_COLORMOD 53 #define FTE_HEXEN2 54 #define FTE_PEXT_SPAWNSTATIC 55 #define FTE_PEXT_CUSTOMTENTS 56 #define FTE_PEXT_256PACKETENTITIES 57 #define TEI_SHOWLMP2 58 #define DP_GFX_QUAKE3MODELTAGS 59 #define FTE_PK3DOWNLOADS 60 #define PEXT_CHUNKEDDOWNLOADS 61 #define EXT_CSQC_SHARED 62 #define PEXT_DPFLAGS 63 #define EXT_CSQC 64 #define BX_COLOREDTEXT 65 #define DP_CON_SET /* The 'set' console command exists, and can be used to create/set cvars. */ 66 #define DP_CON_SETA /* The 'seta' console command exists, like the 'set' command, but also marks the cvar for archiving, allowing it to be written into the user's config. Use this command in your default.cfg file. */ 67 #define DP_CSQC_ROTATEMOVES 68 #define DP_EF_ADDITIVE 69 #define DP_EF_BLUE 70 #define DP_EF_FULLBRIGHT 71 #define DP_EF_NODEPTHTEST 72 #define DP_EF_NODRAW 73 #define DP_EF_NOGUNBOB 74 #define DP_EF_NOSHADOW 75 #define DP_EF_RED 76 #define DP_ENT_CUSTOMCOLORMAP 77 #define DP_ENT_EXTERIORMODELTOCLIENT 78 #define DP_ENT_TRAILEFFECTNUM /* self.traileffectnum=particleeffectnum("myeffectname"); can be used to attach a particle trail to the given server entity. This is equivelent to calling trailparticles each frame. */ 79 #define DP_ENT_VIEWMODEL 80 #define DP_GECKO_SUPPORT 81 #define DP_GFX_FONTS 82 #define DP_GFX_SKINFILES 83 #define DP_GFX_SKYBOX 84 #define DP_HALFLIFE_MAP_CVAR 85 #define DP_INPUTBUTTONS 86 #define DP_LIGHTSTYLE_STATICVALUE 87 #define DP_LITSUPPORT 88 #define DP_MONSTERWALK /* MOVETYPE_WALK is valid on non-player entities. Note that only players receive acceleration etc in line with none/bounce/fly/noclip movetypes on the player, thus you will have to provide your own accelerations (incluing gravity) yourself. */ 89 #define DP_MOVETYPEBOUNCEMISSILE 90 #define DP_MOVETYPEFOLLOW 91 #define DP_QC_ASINACOSATANATAN2TAN 92 #define DP_QC_CHANGEPITCH 93 #define DP_QC_COPYENTITY 94 #define DP_QC_CRC16 95 #define DP_QC_CVAR_DEFSTRING 96 #define DP_QC_CVAR_STRING 97 #define DP_QC_CVAR_TYPE 98 #define DP_QC_DIGEST_SHA256 99 #define DP_QC_EDICT_NUM 100 #define DP_QC_ENTITYDATA 101 #define DP_QC_ETOS 102 #define DP_QC_FINDCHAIN 103 #define DP_QC_FINDCHAINFLOAT 104 #define DP_QC_FINDFLAGS 105 #define DP_QC_FINDCHAINFLAGS 106 #define DP_QC_FINDFLOAT 107 #define DP_QC_FS_SEARCH 108 #define DP_QC_GETSURFACE 109 #define DP_QC_GETSURFACEPOINTATTRIBUTE 110 #define DP_QC_GETTAGINFO 111 #define DP_QC_MINMAXBOUND 112 #define DP_QC_MULTIPLETEMPSTRINGS /* Superseded by DP_QC_UNLIMITEDTEMPSTRINGS. Functions that return a temporary string will not overwrite/destroy previous temporary strings until at least 16 strings are returned (or control returns to the engine). */ 113 #define DP_QC_RANDOMVEC 114 #define DP_QC_RENDER_SCENE /* clearscene+addentity+setviewprop+renderscene+setmodel are available to menuqc. WARNING: DP advertises this extension without actually supporting it, FTE does actually support it. */ 115 #define DP_QC_SINCOSSQRTPOW 116 #define DP_QC_SPRINTF /* Provides the sprintf builtin, which allows for rich formatting along the lines of C's function with the same name. Not to be confused with QC's sprint builtin. */ 117 #define DP_QC_STRFTIME 118 #define DP_QC_STRING_CASE_FUNCTIONS 119 #define DP_QC_STRINGBUFFERS 120 #define DP_QC_STRINGCOLORFUNCTIONS 121 #define DP_QC_STRREPLACE 122 #define DP_QC_TOKENIZEBYSEPARATOR 123 #define DP_QC_TRACEBOX 124 #define DP_QC_TRACETOSS 125 #define DP_QC_TRACE_MOVETYPE_HITMODEL 126 #define DP_QC_TRACE_MOVETYPE_WORLDONLY 127 #define DP_QC_TRACE_MOVETYPES 128 #define DP_QC_UNLIMITEDTEMPSTRINGS /* Supersedes DP_QC_MULTIPLETEMPSTRINGS, superseded by FTE_QC_PERSISTENTTEMPSTRINGS. Specifies that all temp strings will be valid at least until the QCVM returns. */ 129 #define DP_QC_URI_ESCAPE 130 #define DP_QC_URI_GET 131 #define DP_QC_URI_POST 132 #define DP_QC_VECTOANGLES_WITH_ROLL 133 #define DP_QC_VECTORVECTORS 134 #define DP_QC_WHICHPACK 135 #define DP_QUAKE2_MODEL 136 #define DP_QUAKE2_SPRITE 137 #define DP_QUAKE3_MODEL 138 #define DP_REGISTERCVAR 139 #define DP_SND_SOUND7_WIP2 140 #define DP_SND_STEREOWAV 141 #define DP_SND_OGGVORBIS 142 #define DP_SOLIDCORPSE 143 #define DP_SPRITE32 144 #define DP_SV_BOTCLIENT 145 #define DP_SV_CLIENTCAMERA /* Works like svc_setview except also handles pvs. */ 146 #define DP_SV_CLIENTCOLORS /* Provided only for compatibility with DP. */ 147 #define DP_SV_CLIENTNAME /* Provided only for compatibility with DP. */ 148 #define DP_SV_DRAWONLYTOCLIENT 149 #define DP_SV_DROPCLIENT /* Equivelent to quakeworld's stuffcmd(self,"disconnect\n"); hack */ 150 #define DP_SV_EFFECT 151 #define DP_SV_EXTERIORMODELFORCLIENT 152 #define DP_SV_NODRAWTOCLIENT 153 #define DP_SV_PLAYERPHYSICS /* Allows reworking parts of NQ player physics. USE AT OWN RISK - this necessitates NQ physics and is thus guarenteed to break prediction. */ 154 #define DP_SV_POINTSOUND 155 #define DP_SV_PRECACHEANYTIME /* Specifies that the various precache builtins can be called at any time. WARNING: precaches are sent reliably while sound events, modelindexes, and particle events are not. This can mean sounds and particles might not work the first time around, or models may take a while to appear (after the reliables are received and the model is loaded from disk). Always attempt to precache a little in advance in order to reduce these issues (preferably at the start of the map...) */ 156 #define DP_SV_PRINT /* Says that the print builtin can be used from nqssqc (as well as just csqc), bypassing the developer cvar issues. */ 157 #define DP_SV_SETCOLOR 158 #define DP_SV_SPAWNFUNC_PREFIX 159 #define DP_SV_WRITEPICTURE 160 #define DP_SV_WRITEUNTERMINATEDSTRING 161 #define DP_TE_BLOOD 162 #define DP_TE_CUSTOMFLASH 163 #define DP_TE_EXPLOSIONRGB 164 #define DP_TE_PARTICLECUBE 165 #define DP_TE_PARTICLERAIN 166 #define DP_TE_PARTICLESNOW 167 #define DP_TE_SMALLFLASH 168 #define DP_TE_SPARK 169 #define DP_TE_STANDARDEFFECTBUILTINS 170 #define DP_VIEWZOOM 171 #define EXT_BITSHIFT 172 #define EXT_DIMENSION_VISIBILITY 173 #define EXT_DIMENSION_PHYSICS 174 #define EXT_DIMENSION_GHOST 175 #define FRIK_FILE 176 #define FTE_CALLTIMEOFDAY /* Replication of mvdsv functionality (call calltimeofday to cause 'timeofday' to be called, with arguments that can be saved off to a global). Generally strftime is simpler to use. */ 177 #define FTE_CSQC_ALTCONSOLES /* The engine tracks multiple consoles. These may or may not be directly visible to the user. */ 178 #define FTE_CSQC_BASEFRAME /* Specifies that .basebone, .baseframe2, .baselerpfrac, baseframe1time, etc exist in csqc. These fields affect all bones in the entity's model with a lower index than the .basebone field, allowing you to give separate control to the legs of a skeletal model, without affecting the torso animations. */ 179 #define FTE_CSQC_HALFLIFE_MODELS 180 #define FTE_CSQC_SERVERBROWSER /* Provides builtins to query the engine's serverbrowser servers list from ssqc. Note that these builtins are always available in menuqc. */ 181 #define FTE_CSQC_SKELETONOBJECTS /* Provides container objects for skeletal bone data, which can be modified on a per bone basis if needed. This allows you to dynamically generate animations (or just blend them with greater customisation) instead of being limited to a single animation or two. */ 182 #define FTE_CSQC_RAWIMAGES /* Provides raw rgba image access to csqc. With this, the csprogs can read textures into qc-accessible memory, modify it, and then upload it to the renderer. */ 183 #define FTE_CSQC_RENDERTARGETS /* VF_RT_DESTCOLOUR exists and can be used to redirect any rendering to a texture instead of the screen. */ 184 #define FTE_CSQC_REVERB /* Specifies that the mod can create custom reverb effects. Whether they will actually be used or not depends upon the sound driver. */ 185 #define FTE_CSQC_WINDOWCAPTION /* Provides csqc with the ability to change the window caption as displayed when running windowed or in the task bar when switched out. */ 186 #define FTE_ENT_SKIN_CONTENTS /* self.skin = CONTENTS_WATER; makes a brush entity into water. use -16 for a ladder. */ 187 #define FTE_ENT_UNIQUESPAWNID 188 #define FTE_EXTENDEDTEXTCODES 189 #define FTE_FORCESHADER /* Allows csqc to override shaders on models with an explicitly named replacement. Also allows you to define shaders with a fallback if it does not exist on disk. */ 190 #define FTE_FORCEINFOKEY /* Provides an easy way to change a user's userinfo from the server. */ 191 #define FTE_GFX_QUAKE3SHADERS /* specifies that the engine has full support for vanilla quake3 shaders */ 192 #define FTE_GFX_REMAPSHADER /* With the raw power of stuffcmds, the r_remapshader console command is exposed! This mystical command can be used to remap any shader to another. Remapped shaders that specify $diffuse etc in some form will inherit the textures implied by the surface. */ 193 #define FTE_GFX_MODELEVENTS /* Provides a query for per-animation events in model files, including from progs/foo.mdl.events files. */ 194 #define FTE_ISBACKBUFFERED /* Allows you to check if a client has too many reliable messages pending. */ 195 #define FTE_MEMALLOC /* Allows dynamically allocating memory. Use pointers to access this memory. Memory will not be saved into saved games. */ 196 #define FTE_MEDIA_CIN /* playfilm command supports q2 cin files. */ 197 #define FTE_MEDIA_ROQ /* playfilm command supports q3 roq files. */ 198 #define FTE_MULTIPROGS /* Multiple progs.dat files can be loaded inside the same qcvm. Insert new ones with addprogs inside the 'init' function, and use externvalue+externset to rewrite globals (and hook functions) to link them together. Note that the result is generally not very clean unless you carefully design for it beforehand. */ 199 #define FTE_MULTITHREADED /* Faux multithreading, allowing multiple contexts to run in sequence. */ 200 #define FTE_MVD_PLAYERSTATS /* In csqc, getplayerstat can be used to query any player's stats when playing back MVDs. isdemo will return 2 in this case. */ 201 #define FTE_PART_SCRIPT /* Specifies that the r_particledesc cvar can be used to select a list of particle effects to load from particles/*.cfg, the format of which is documented elsewhere. */ 202 #define FTE_PART_NAMESPACES /* Specifies that the engine can use foo.bar to load effect foo from particle description bar. When used via ssqc, this should cause the client to download whatever effects as needed. */ 203 #define FTE_PART_NAMESPACE_EFFECTINFO /* Specifies that effectinfo.bar can load effects from effectinfo.txt for DP compatibility. */ 204 #define FTE_QC_BASEFRAME /* Specifies that .basebone and .baseframe exist in ssqc. These fields affect all bones in the entity's model with a lower index than the .basebone field, allowing you to give separate control to the legs of a skeletal model, without affecting the torso animations, from ssqc. */ 205 #define FTE_QC_FILE_BINARY /* Extends FRIK_FILE with binary read+write, as well as allowing seeking. Requires pointers. */ 206 #define FTE_QC_CHANGELEVEL_HUB /* Adds an extra argument to changelevel which is carried over to the next map in the 'spawnspot' global. Maps will be saved+reloaded until the extra argument is omitted again, purging all saved maps. Saved games will contain a copy of each preserved map. parm1-parm64 globals can be used, giving more space to transfer more player data. */ 207 #define FTE_QC_CHECKCOMMAND /* Provides a way to test if a console command exists, and whether its a command/alias/cvar. Does not say anything about the expected meanings of any arguments or values. */ 208 #define FTE_QC_CHECKPVS 209 #define FTE_QC_CROSSPRODUCT 210 #define FTE_QC_CUSTOMSKINS /* The engine supports the use of q3 skins, as well as the use of such skin 'files' to specify rich top+bottom colours, qw skins, geomsets, or texture composition even on non-players.. */ 211 #define FTE_QC_DIGEST_SHA1 212 #define FTE_QC_DIGEST_SHA224 213 #define FTE_QC_DIGEST_SHA384 214 #define FTE_QC_DIGEST_SHA512 215 #define FTE_QC_FS_SEARCH_SIZEMTIME 216 #define FTE_QC_HARDWARECURSORS /* setcursormode exists in both csqc+menuqc, and accepts additional arguments to specify a cursor image to use when this module has focus. If the image exceeds hardware limits (or hardware cursors are unsupported), it will be emulated using regular draws - this at least still avoids conflicting cursors as only one will ever be used, even if console+menu+csqc are all overlayed. */ 217 #define FTE_QC_HASHTABLES /* Provides efficient string-based lookups. */ 218 #define FTE_QC_INFOKEY /* QuakeWorld's infokey builtin works, and reports at least name+topcolor+bottomcolor+ping(in ms)+ip(unmasked, but not always ipv4)+team(aka bottomcolor in nq). Does not require actual localinfo/serverinfo/userinfo, but they're _highly_ recommended to any engines with csqc */ 219 #define FTE_QC_INTCONV /* Provides string<>int conversions, including hex representations. */ 220 #define FTE_QC_MATCHCLIENTNAME 221 #define FTE_QC_MULTICAST /* QuakeWorld's multicast builtin works along with MSG_MULTICAST, but also with unicast support. */ 222 #define FTE_QC_PAUSED 223 #define FTE_QC_PERSISTENTTEMPSTRINGS /* Supersedes DP_QC_MULTIPLETEMPSTRINGS. Temp strings are garbage collected automatically, and do not expire while they're still in use. This makes strzone redundant. */ 224 #define FTE_QC_RAGDOLL_WIP 225 #define FTE_QC_SENDPACKET /* Allows the use of out-of-band udp packets to/from other hosts. Includes the SV_ParseConnectionlessPacket event. */ 226 #define FTE_QC_STUFFCMDFLAGS /* Variation on regular stuffcmd that gives control over how spectators/mvds should be treated. */ 227 #define FTE_QC_TRACETRIGGER 228 #define FTE_QUAKE2_CLIENT /* This engine is able to act as a quake2 client */ 229 #define FTE_QUAKE2_SERVER /* This engine is able to act as a quake2 server */ 230 #define FTE_QUAKE3_CLIENT /* This engine is able to act as a quake3 client */ 231 #define FTE_QUAKE3_SERVER /* This engine is able to act as a quake3 server */ 232 #define FTE_SOLID_LADDER /* Allows a simple trigger to remove effects of gravity (solid 20). obsolete. will prolly be removed at some point as it is not networked properly. Use FTE_ENT_SKIN_CONTENTS */ 233 #define FTE_SPLITSCREEN /* Client supports splitscreen, controlled via cl_splitscreen. Servers require allow_splitscreen 1 if splitscreen is to be used over the internet. Mods that use csqc will need to be aware for this to work properly. per-client networking may be problematic. */ 234 #define FTE_SQL /* Provides sql* builtins which can be used for sql database access */ 235 #define FTE_SQL_SQLITE /* SQL functionality is able to utilise sqlite databases */ 236 #define FTE_STRINGS /* Extra builtins (and additional behaviour) to make string manipulation easier */ 237 #define FTE_SV_POINTPARTICLES /* Specifies that particleeffectnum, pointparticles, and trailparticles exist in ssqc as well as csqc. particleeffectnum acts as a precache, allowing ssqc values to be networked up with csqc for use. Use in combination with FTE_PART_SCRIPT+FTE_PART_NAMESPACES to use custom effects. This extension is functionally identical to the DP version, but avoids any misplaced assumptions about the format of the client's particle descriptions. */ 238 #define FTE_SV_REENTER 239 #define FTE_TE_STANDARDEFFECTBUILTINS /* Provides builtins to replace writebytes, with a QW compatible twist. */ 240 #define FTE_TERRAIN_MAP /* This engine supports .hmp files, as well as terrain embedded within bsp files. */ 241 #define FTE_RAW_MAP /* This engine supports directly loading .map files, as well as realtime editing of the various brushes. */ 242 #define KRIMZON_SV_PARSECLIENTCOMMAND /* SSQC's SV_ParseClientCommand function is able to handle client 'cmd' commands. The tokenizing parts also work in csqc. */ 243 #define NEH_CMD_PLAY2 244 #define NEH_RESTOREGAME 245 #define QSG_CVARSTRING 246 #define QW_ENGINE 247 #define QWE_MVD_RECORD /* You can use the easyrecord command to record MVD demos serverside. */ 248 #define TEI_MD3_MODEL 249 #define TENEBRAE_GFX_DLIGHTS /* Allows ssqc to attach rtlights to entities with various special properties. */ 250 #define ZQ_MOVETYPE_FLY /* MOVETYPE_FLY works on players. */ 251 #define ZQ_MOVETYPE_NOCLIP /* MOVETYPE_NOCLIP works on players. */ 252 #define ZQ_MOVETYPE_NONE /* MOVETYPE_NONE works on players. */ 253 #define ZQ_VWEP 254 #define ZQ_QC_STRINGS /* The strings-only subset of FRIK_FILE is supported. */ 255 256 #ifdef _ACCESSORS 257 accessor strbuf : float; 258 accessor searchhandle : float; 259 accessor hashtable : float; 260 accessor infostring : string; 261 accessor filestream : float; 262 accessor filestream : float; 263 #else 264 #define strbuf float 265 #define searchhandle float 266 #define hashtable float 267 #define infostring string 268 #define filestream float 269 #endif 270 271 entity self; /* The magic me */ 272 entity other; /* Valid in touch functions, this is the entity that we touched. */ 273 entity world; /* The null entity. Hurrah. Readonly after map spawn time. */ 274 float time; /* The current game time. Stops when paused. */ 275 float frametime; /* The time since the last physics/render/input frame. */ 276 entity newmis; /* A named entity that should be run soon, to reduce the effects of latency. */ 277 float force_retouch; /* If positive, causes all entities to check for triggers. */ 278 string mapname; /* The short name of the map. */ 279 float serverflags; 280 float total_secrets; 281 float total_monsters; 282 float found_secrets; 283 float killed_monsters; 284 float parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ 285 vector v_forward, v_up, v_right; 286 float trace_allsolid, trace_startsolid, trace_fraction; 287 vector trace_endpos, trace_plane_normal; 288 float trace_plane_dist; 289 entity trace_ent; 290 float trace_inopen; 291 float trace_inwater; 292 entity msg_entity; 293 void() main; /* This function is never called, and is effectively dead code. */ 294 void() StartFrame; /* Called at the start of each new physics frame. Player entities may think out of sequence so try not to depend upon explicit ordering too much. */ 295 void() PlayerPreThink; /* With Prediction(QW compat/FTE default): Called before the player's input commands are processed. 296 No Prediction(NQ compat): Called AFTER the player's movement intents have already been processed (ie: velocity will have already changed according to input_*, but before the actual position change. */ 297 void() PlayerPostThink; /* Called after the player's input commands are processed. */ 298 void() ClientKill; /* Called in response to 'cmd kill' (or just 'kill'). */ 299 void(optional float csqcactive) ClientConnect; /* Called after the connecting client has finished loading and is ready to receive active entities. Note that this is NOT the first place that a client might be referred to. */ 300 void() PutClientInServer; /* Enginewise, this is only ever called immediately after ClientConnect and is thus a little redundant. Modwise, this is also called for respawning a player etc. */ 301 void() ClientDisconnect; /* Called once a client disconnects or times out. Not guarenteed to be called on map changes. */ 302 void() SetNewParms; /* Called without context when a new client initially connects (before ClientConnect is even called). This function is expected to only set the parm* globals so that they can be decoded properly later. You should not rely on 'self' being set. */ 303 void() SetChangeParms; /* Called for each client on map changes. Should copy various entity fields to the parm* globals. */ 304 void end_sys_globals; 305 .float modelindex; /* This is the model precache index for the model that was set on the entity, instead of having to look up the model according to the .model field. Use setmodel to change it. */ 306 .vector absmin; /* Set by the engine when the entity is relinked (by setorigin, setsize, or setmodel). This is in world coordinates. */ 307 .vector absmax; /* Set by the engine when the entity is relinked (by setorigin, setsize, or setmodel). This is in world coordinates. */ 308 .float ltime; /* On MOVETYPE_PUSH entities, this is used as an alternative to the 'time' global, and .nextthink is synced to this instead of time. This allows time to effectively freeze if the entity is blocked, ensuring the think happens when the entity reaches the target point instead of randomly. */ 309 .float lastruntime; /* This field used to be used to avoid running an entity multiple times in a single frame due to quakeworld's out-of-order thinks. It is no longer used by FTE due to precision issues, but may still be updated for compatibility reasons. */ 310 .float movetype; /* Describes how the entity moves. One of the MOVETYPE_ constants. */ 311 .float solid; /* Describes whether the entity is solid or not, and any special properties infered by that. Must be one of the SOLID_ constants */ 312 .vector origin; /* The current location of the entity in world space. Inline bsp entities (ie: ones placed by a mapper) will typically have a value of '0 0 0' in their neutral pose, as the geometry is offset from that. It is the reference point of the entity rather than the center of its geometry, for non-bsp models, this is often not a significant distinction. */ 313 .vector oldorigin; /* This is often used on players to reset the player back to where they were last frame if they somehow got stuck inside something due to fpu precision. Never change a player's oldorigin field to inside a solid, because that might cause them to become pemanently stuck. */ 314 .vector velocity; /* The direction and speed that the entity is moving in world space. */ 315 .vector angles; /* The eular angles the entity is facing in, in pitch, yaw, roll order. Due to a legacy bug, mdl/iqm/etc formats use +x=UP, bsp/spr/etc formats use +x=DOWN. */ 316 .vector avelocity; /* The amount the entity's angles change by per second. Note that this is direct eular angles, and thus the angular change is non-linear and often just looks buggy if you're changing more than one angle at a time. */ 317 .string classname; /* Identifies the class/type of the entity. Useful for debugging, also used for loading, but its value is not otherwise significant to the engine, this leaves the mod free to set it to whatever it wants and randomly test strings for values in whatever inefficient way it chooses fit. */ 318 .string model; /* The model name that was set via setmodel, in theory. Often, this is cleared to null to prevent the engine from being seen by clients while not changing modelindex. This behaviour allows inline models to remain solid yet be invisible. */ 319 .float frame; /* The current frame the entity is meant to be displayed in. In CSQC, note the lerpfrac and frame2 fields as well. if it specifies a framegroup, the framegroup will autoanimate in ssqc, but not in csqc. */ 320 .float skin; /* The skin index to use. on a bsp entity, setting this to 1 will switch to the 'activated' texture instead. A negative value will be understood as a replacement contents value, so setting it to CONTENTS_WATER will make a movable pool of water. */ 321 .float effects; /* Lots of random flags that change random effects. See EF_* constants. */ 322 .vector mins; /* The minimum extent of the model (ie: the bottom-left coordinate relative to the entity's origin). Change via setsize. May also be changed by setmodel. */ 323 .vector maxs; /* like mins, but in the other direction. */ 324 .vector size; /* maxs-mins. Updated when the entity is relinked (by setorigin, setsize, setmodel) */ 325 .void() touch; 326 .void() use; 327 .void() think; 328 .void() blocked; 329 .float nextthink; /* The time at which the entity is next scheduled to fire its think event. For MOVETYPE_PUSH entities, this is relative to that entity's ltime field, for all other entities it is relative to the time gloal. */ 330 .entity groundentity; 331 .float health; 332 .float frags; 333 .float weapon; 334 .string weaponmodel; 335 .float weaponframe; 336 .float currentammo; 337 .float ammo_shells; 338 .float ammo_nails; 339 .float ammo_rockets; 340 .float ammo_cells; 341 .float items; 342 .float takedamage; 343 .entity chain; 344 .float deadflag; 345 .vector view_ofs; 346 .float button0; 347 .float button1; 348 .float button2; 349 .float impulse; 350 .float fixangle; /* Forces the clientside view angles to change to the value of .angles (has some lag). If set to 1/TRUE, the server will guess whether to send a delta or an explicit angle. If 2, will always send a delta (due to lag between transmission and acknowledgement, this cannot be spammed reliably). If 3, will always send an explicit angle. */ 351 .vector v_angle; /* The angles a player is viewing. +x is DOWN (pitch, yaw, roll) */ 352 .string netname; 353 .entity enemy; 354 .float flags; 355 .float colormap; 356 .float team; 357 .float max_health; 358 .float teleport_time; /* While active, prevents the player from using the +back command, also blocks waterjumping. */ 359 .float armortype; 360 .float armorvalue; 361 .float waterlevel; 362 .float watertype; 363 .float ideal_yaw; 364 .float yaw_speed; 365 .entity aiment; 366 .entity goalentity; 367 .float spawnflags; 368 .string target; 369 .string targetname; 370 .float dmg_take; 371 .float dmg_save; 372 .entity dmg_inflictor; 373 .entity owner; 374 .vector movedir; 375 .string message; 376 .float sounds; 377 .string noise; 378 .string noise1; 379 .string noise2; 380 .string noise3; 381 void end_sys_fields; 382 float input_timelength; 383 vector input_angles; /* +x=DOWN */ 384 vector input_movevalues; 385 float input_buttons; 386 float input_impulse; 387 int trace_endcontents; 388 int trace_surfaceflags; 389 int trace_brush_id; 390 int trace_brush_faceid; 391 int trace_surface_id; /* 1-based. 0 if not known. */ 392 int trace_bone_id; /* 1-based. 0 if not known. typically needs MOVE_HITMODEL. */ 393 int trace_triangle_id; /* 1-based. 0 if not known. */ 394 vector global_gravitydir = '0 0 -1'; /* The direction gravity should act in if not otherwise specified per entity. */ 395 int serverid; /* The unique id of this server within the server cluster. */ 396 .float button3; 397 .float button4; 398 .float button5; 399 .float button6; 400 .float button7; 401 .float button8; 402 .vector punchangle; 403 .float gravity; /* Multiplier applied in addition to sv_gravity (not absolute units), to control the gravity affecting this entity specifically. */ 404 .float hull; /* Overrides the hull used by the entity for walkmove/movetogoal and not traceline/tracebox. */ 405 .entity movechain; /* This is a linked list of entities which will be moved whenever this entity moves, logically they are attached to this entity. */ 406 .void() chainmoved; /* Called when the entity is moved as a result of being part of another entity's .movechain */ 407 .void(float old, float new) contentstransition; /* This function is called when the entity moves between water and air. If specified, default splash sounds will be disabled allowing you to provide your own. */ 408 .float dimension_solid; /* This is the bitmask of dimensions which the entity is solid within. */ 409 .float dimension_hit; /* This is the bitmask of dimensions which the entity will be blocked by. If other.dimension_solid & self.dimension_hit, our traces will impact and not proceed. If its false, the traces will NOT impact, allowing self to pass straight through. */ 410 .int hitcontentsmaski; /* Traces performed for this entity will impact against surfaces that match this contents mask. */ 411 .float dphitcontentsmask; /* Some crappy field that inefficiently requires translating to the native contents flags. Ditch the 'dp', do it properly. */ 412 .float scale; /* Multiplier that resizes the entity. 1 is normal sized, 2 is double sized. scale 0 is remapped to 1. In SSQC, this is limited to 1/16th precision, with a maximum just shy of 16. */ 413 .float fatness; /* How many QuakeUnits to push the entity's verticies along their normals by. */ 414 .float alpha; /* The transparency of the entity. 1 means opaque, 0.0001 means virtually invisible. 0 is remapped to 1, for compatibility. */ 415 .float modelflags; /* Used to override the flags set in the entity's model. Should be set according to the MF_ constants. Use effects|=EF_NOMODELFLAGS to ignore the model's flags completely. The traileffectnum field is more versatile. */ 416 .float frame1time; /* This controls the time into the framegroup/animation named by .frame, you should increment this value according to frametime or to distance moved, depending on the sort of animation you're attempting. You may wish to avoid incrementing this while lerpfrac is still changing, to avoid wasting parts of the animation. */ 417 .float basebone; /* The base* frame animations are equivelent to their non-base versions, except that they only affect bone numbers below the 'basebone' value. This means that the base* animation can affect the legs of a skeletal model independantly of the normal animation fields affecting the torso area. For more complex animation than this, use skeletal objects. */ 418 .float baseframe; /* See basebone */ 419 .void() customphysics; /* Called once each physics frame, overriding the entity's .movetype field and associated logic. You'll probably want to use tracebox to move it through the world. Be sure to call .think as appropriate. */ 420 .entity tag_entity; 421 .float tag_index; 422 .float skeletonindex; /* This object serves as a container for the skeletal bone states used to override the animation data. */ 423 .vector colormod; /* Provides a colour tint for the entity (does not affect fullbrights). */ 424 .vector glowmod; /* Scaler for an entity's fullbright textures. */ 425 .vector gravitydir; /* Specifies the direction in which gravity acts. Must be normalised. '0 0 0' also means down. Use '0 0 1' if you want the player to be able to run on ceilings. */ 426 .vector(vector org, vector ang) camera_transform; /* Provides portal transform information for portal surfaces attached to this entity. Also used to open up pvs in ssqc. */ 427 .float pmove_flags; 428 .float geomtype; 429 .float friction; 430 .float erp; 431 .float jointtype; 432 .float mass; 433 .float bouncefactor; 434 .float bouncestop; 435 .float idealpitch; 436 .float pitch_speed; 437 .float drawflags; /* Various flags that affect lighting values and scaling. Typically set to 96 in quake for proper compatibility with DP_QC_SCALE. */ 438 .float abslight; /* Allows overriding light levels. Use drawflags to state that this field should actually be used. */ 439 .vector color; /* This affects the colour of realtime lights that were enabled via the pflags field. */ 440 .float light_lev; /* This is the radius of an entity's light. This is not normally used by the engine, but is used for realtime lights (ones that are enabled with the pflags field). */ 441 .float style; /* Used by the light util to decide how an entity's light should animate. On an entity with pflags set, this also affects realtime lights. */ 442 .float pflags; /* Realtime lighting flags */ 443 .float maxspeed; 444 .entity view2; /* defines a second viewpoint, typically displayed in a corner of the screen (also punches open pvs). */ 445 .vector movement; /* These are the directions that the player is currently trying to move in (ie: which +forward/+moveright/+moveup etc buttons they have held), expressed relative to that player's angles. Order is forward, right, up. */ 446 .float vw_index; /* This acts as a second modelindex, using the same frames etc. */ 447 .entity nodrawtoclient; /* This entity will not be sent to the player named by this field. They will be invisible and not emit dlights/particles. Does not work in MVD-recorded game. */ 448 .entity drawonlytoclient; /* This entity will be sent *only* to the player named by this field. To other players they will be invisible and not emit dlights/particles. Does not work in MVD-recorded game. */ 449 .entity viewmodelforclient; /* This entity will be sent only to the player named by this field, and this entity will be attached to the player's view as an additional weapon model. */ 450 .entity exteriormodeltoclient; /* This entity will be invisible to the player named by this field, except in mirrors or mirror-like surfaces, where it will be visible as normal. It may still cast shadows as normal, and generate lights+particles, depending on client settings. Does not affect how other players see the entity. */ 451 .entity clientcamera; /* Controls which entity to use for this client's camera. */ 452 .float glow_size; /* Some outdated particle trail thing. */ 453 .float glow_color; /* Some outdated particle trail thing. */ 454 .float glow_trail; /* Some outdated particle trail thing. */ 455 .float traileffectnum; /* This should be set to the result of particleeffectnum, in order to attach a custom trail effect to an entity as it moves. */ 456 .float emiteffectnum; /* This should be set to the result of particleeffectnum, in order to continually spawn particles in the direction that this entity faces. */ 457 .float dimension_see; /* This is the dimension mask (bitfield) that the client is allowed to see. Entities and events not in this dimension mask will be invisible. */ 458 .float dimension_seen; /* This is the dimension mask (bitfield) that the client is visible within. Clients that cannot see this dimension mask will not see this entity. */ 459 .float dimension_ghost; /* If this entity is visible only within these dimensions, it will become transparent, as if a ghost. */ 460 .float dimension_ghost_alpha; /* If this entity is subject to dimension_ghost, this is the scaler for its alpha value. If 0, 0.5 will be used instead. */ 461 .float(entity playerent, float changedflags) SendEntity; /* Called by the engine whenever an entity needs to be (re)sent to a client's csprogs, either because SendFlags was set or because data was lost. Must write its data to the MSG_ENTITY buffer. Will be called at the engine's leasure. */ 462 .float SendFlags; /* Indicates that something in the entity has been changed, and that it needs to be updated to all players that can see it. The engine will clear it at some point, with the cleared bits appearing in the 'changedflags' argument of the SendEntity method. */ 463 .float Version; /* Obsolete, set a SendFlags bit instead. */ 464 .float clientcolors; 465 .float viewzoom; 466 .float items2; 467 .float playerclass; 468 .float hasted; 469 .float light_level; /* Used by hexen2 to indicate the light level where the player is standing. */ 470 .float pvsflags; /* Reconfigures when the entity is visible to clients */ 471 .float uniquespawnid; /* Incremented by 1 whenever the entity is respawned. Persists across remove calls, for when the two-second grace period is insufficient. */ 472 .float() customizeentityforclient; /* Called just before an entity is sent to a client (non-csqc protocol). This gives you a chance to tailor 'self' according to what 'other' should see. */ 473 void(float reqid, float responsecode, string resourcebody, int resourcebytes) URI_Get_Callback; /* Called as an eventual result of the uri_get builtin. */ 474 void() SpectatorConnect; /* Called when a spectator joins the game. */ 475 void() SpectatorDisconnect; /* Called when a spectator disconnects from the game. */ 476 void() SpectatorThink; /* Called each frame for each spectator. */ 477 void(string cmd) SV_ParseClientCommand; /* Provides QC with a way to intercept 'cmd foo' commands from the client. Very handy. Self will be set to the sending client, while the 'cmd' argument can be tokenize()d and each element retrieved via argv(argno). Unrecognised cmds MUST be passed on to the clientcommand builtin. */ 478 void(string dest, string from, string cmd, string info) SV_ParseClusterEvent; /* Part of cluster mode. Handles cross-node events that were sent via clusterevent, on behalf of the named client. */ 479 float(string sender, string body) SV_ParseConnectionlessPacket; /* Provides QC with a way to communicate between servers, or with client server browsers. Sender is the sender's ip. Body is the body of the message. You'll need to add your own password/etc support as required. Self is not valid. */ 480 void(float pauseduration) SV_PausedTic; /* For each frame that the server is paused, this function will be called to give the gamecode a chance to unpause the server again. the pauseduration argument says how long the server has been paused for (the time global is frozen and will not increment while paused). Self is not valid. */ 481 float(float newstatus) SV_ShouldPause; /* Called to give the qc a change to block pause/unpause requests. Return false for the pause request to be ignored. newstatus is 1 if the user is trying to pause the game. For the duration of the call, self will be set to the player who tried to pause, or to world if it was triggered by a server-side event. */ 482 void() SV_RunClientCommand; /* Called each time a player movement packet was received from a client. Self is set to the player entity which should be updated, while the input_* globals specify the various properties stored within the input packet. The contents of this function should be somewaht identical to the equivelent function in CSQC, or prediction misses will occur. If you're feeling lazy, you can simply call 'runstandardplayerphysics' after modifying the inputs. */ 483 void() SV_AddDebugPolygons; /* Called each video frame. This is the only place where ssqc is allowed to call the R_BeginPolygon/R_PolygonVertex/R_EndPolygon builtins. This is exclusively for debugging, and will break in anything but single player as it will not be called if the engine is not running both a client and a server. */ 484 void() SV_PlayerPhysics; /* Compatibility method to tweak player input that does not reliably work with prediction (prediction WILL break). Mods that care about prediction should use SV_RunClientCommand instead. If pr_no_playerphysics is set to 1, this function will never be called, which will either fix prediction or completely break player movement depending on whether the feature was even useful. */ 485 void() EndFrame; /* Called after non-player entities have been run at the end of the physics frame. Player physics is performed out of order and can/will still occur between EndFrame and BeginFrame. */ 486 string(string addr, string uinfo, string features) SV_CheckRejectConnection; /* Called to give the mod a chance to ignore connection requests based upon client protocol support or other properties. Use infoget to read the uinfo and features arguments. */ 487 string(string uri, string method, string postdata, __in string requestheaders, __inout string responseheaders) Cef_GeneratePage; /* Provides an entrypoint to generate pages for the CEF plugin from within QC. Headers are 488 -separated key/value pairs (use tokenizebyseparator). */ 489 string(string uri, string method, string postdata, __in string requestheaders, __inout string responseheaders) HTTP_GeneratePage; /* Provides an entrypoint to generate pages for pages requested over http (sv_port_tcp+net_enable_http). Headers are 490 -separated key/value pairs (use tokenizebyseparator). Return __NULL__ to let the engine handle it, an empty string for a 404, and any other text for a regular 200 response. */ 491 void(float prevprogs) init; /* Part of FTE_MULTIPROGS. Called as soon as a progs is loaded, called at a time when entities are not valid. This is the only time when it is safe to call addprogs without field assignment. As it is also called as part of addprogs, this also gives you a chance to hook functions in modules that are already loaded (via externget+externget). */ 492 void() initents; /* Part of FTE_MULTIPROGS. Called after fields have been finalized. This is the first point at which it is safe to call spawn(), and is called before any entity fields have been parsed. You can use this entrypoint to send notifications to other modules. */ 493 float parm17, parm18, parm19, parm20, parm21, parm22, parm23, parm24, parm25, parm26, parm27, parm28, parm29, parm30, parm31, parm32; /* Additional spawn parms, following the same parmN theme. */ 494 float parm33, parm34, parm35, parm36, parm37, parm38, parm39, parm40, parm41, parm42, parm43, parm44, parm45, parm46, parm47, parm48; 495 float parm49, parm50, parm51, parm52, parm53, parm54, parm55, parm56, parm57, parm58, parm59, parm60, parm61, parm62, parm63, parm64; 496 string parm_string; /* Like the regular parmN globals, but preserves string contents. */ 497 string startspot; /* Receives the value of the second argument to changelevel from the previous map. */ 498 var float dimension_send; /* Used by multicast functionality. Multicasts (and related builtins that multicast internally) will only be sent to players where (player.dimension_see & dimension_send) is non-zero. */ 499 //var float dimension_default = 255; 500 /* Default dimension bitmask */ 501 __used var float physics_mode = 2; /* 0: original csqc - physics are not run 502 1: DP-compat. Thinks occur, but not true movetypes. 503 2: movetypes occur just as they do in ssqc. */ 504 #define TRUE 1 505 #define FALSE 0 /* File not found... */ 506 #define M_PI 3.14159 507 #define MOVETYPE_NONE 0 508 #define MOVETYPE_WALK 3 509 #define MOVETYPE_STEP 4 510 #define MOVETYPE_FLY 5 511 #define MOVETYPE_TOSS 6 512 #define MOVETYPE_PUSH 7 513 #define MOVETYPE_NOCLIP 8 514 #define MOVETYPE_FLYMISSILE 9 515 #define MOVETYPE_BOUNCE 10 516 #define MOVETYPE_BOUNCEMISSILE 11 517 #define MOVETYPE_FOLLOW 12 518 #define MOVETYPE_6DOF 30 /* A glorified MOVETYPE_FLY. Players using this movetype will get some flightsim-like physics, with fully independant rotations (order-dependant transforms). */ 519 #define MOVETYPE_WALLWALK 31 /* Players using this movetype will be able to orient themselves to walls, and then run up them. */ 520 #define MOVETYPE_PHYSICS 32 /* Enable the use of ODE physics upon this entity. */ 521 #define SOLID_NOT 0 522 #define SOLID_TRIGGER 1 523 #define SOLID_BBOX 2 524 #define SOLID_SLIDEBOX 3 525 #define SOLID_BSP 4 /* Does not collide against other SOLID_BSP entities. Normally paired with MOVETYPE_PUSH. */ 526 #define SOLID_CORPSE 5 /* Non-solid to SOLID_SLIDEBOX or other SOLID_CORPSE entities. For hitscan weapons to hit corpses, change the player's .solid value to SOLID_BBOX or so, perform the traceline, then revert the player's .solid value. */ 527 #define SOLID_LADDER 20 /* Obsolete and may be removed at some point. Use skin=CONTENT_LADDER and solid_bsp or solid_trigger instead. */ 528 #define SOLID_PORTAL 21 /* CSG subtraction volume combined with entity transformations on impact. */ 529 #define SOLID_BSPTRIGGER 22 /* For complex-shaped trigger volumes, instead of being a pure aabb. */ 530 #define SOLID_PHYSICS_BOX 32 531 #define SOLID_PHYSICS_SPHERE 33 532 #define SOLID_PHYSICS_CAPSULE 34 533 #define SOLID_PHYSICS_TRIMESH 35 534 #define SOLID_PHYSICS_CYLINDER 36 535 #define GEOMTYPE_NONE -1 536 #define GEOMTYPE_SOLID 0 537 #define GEOMTYPE_BOX 1 538 #define GEOMTYPE_SPHERE 2 539 #define GEOMTYPE_CAPSULE 3 540 #define GEOMTYPE_TRIMESH 4 541 #define GEOMTYPE_CYLINDER 5 542 #define GEOMTYPE_CAPSULE_X 6 543 #define GEOMTYPE_CAPSULE_Y 7 544 #define GEOMTYPE_CAPSULE_Z 8 545 #define GEOMTYPE_CYLINDER_X 9 546 #define GEOMTYPE_CYLINDER_Y 10 547 #define GEOMTYPE_CYLINDER_Z 11 548 #define JOINTTYPE_FIXED -1 549 #define JOINTTYPE_POINT 1 550 #define JOINTTYPE_HINGE 2 551 #define JOINTTYPE_SLIDER 3 552 #define JOINTTYPE_UNIVERSAL 4 553 #define JOINTTYPE_HINGE2 5 554 #define DAMAGE_NO 0 555 #define DAMAGE_YES 1 556 #define DAMAGE_AIM 2 557 #define CONTENT_EMPTY -1 558 #define CONTENT_SOLID -2 559 #define CONTENT_WATER -3 560 #define CONTENT_SLIME -4 561 #define CONTENT_LAVA -5 562 #define CONTENT_SKY -6 563 #define CONTENT_LADDER -16 /* If this value is assigned to a solid_bsp's .skin field, the entity will become a ladder volume. */ 564 const int CONTENTBIT_NONE = 0x00000000i; 565 const int CONTENTBIT_SOLID = 0x00000001i; 566 const int CONTENTBIT_LAVA = 0x00000008i; 567 const int CONTENTBIT_SLIME = 0x00000010i; 568 const int CONTENTBIT_WATER = 0x00000020i; 569 const int CONTENTBIT_FTELADDER = 0x00004000i; 570 const int CONTENTBIT_PLAYERCLIP = 0x00010000i; 571 const int CONTENTBIT_MONSTERCLIP = 0x00020000i; 572 const int CONTENTBIT_BODY = 0x02000000i; 573 const int CONTENTBIT_CORPSE = 0x04000000i; 574 const int CONTENTBIT_Q2LADDER = 0x20000000i; /* Content bit specific to q2bsp */ 575 const int CONTENTBIT_SKY = 0x80000000i; /* Content bit somewhat specific to q1bsp (aliases to NODROP in q3bsp), but you should probably check surfaceflags&SURF_SKY as well for q2+q3bsp too. */ 576 const int CONTENTBITS_POINTSOLID = CONTENTBIT_SOLID|0x00000002i|CONTENTBIT_BODY; /* Bits that traceline would normally consider solid */ 577 const int CONTENTBITS_BOXSOLID = CONTENTBIT_SOLID|0x00000002i|CONTENTBIT_BODY|CONTENTBIT_PLAYERCLIP; /* Bits that tracebox would normally consider solid */ 578 const int CONTENTBITS_FLUID = CONTENTBIT_WATER|CONTENTBIT_SLIME|CONTENTBIT_LAVA|CONTENTBIT_SKY; 579 #define SPA_POSITION 0 /* These SPA_* constants are to specify which attribute is returned by the getsurfacepointattribute builtin */ 580 #define SPA_S_AXIS 1 581 #define SPA_T_AXIS 2 582 #define SPA_R_AXIS 3 /* aka: SPA_NORMAL */ 583 #define SPA_TEXCOORDS0 4 584 #define SPA_LIGHTMAP0_TEXCOORDS 5 585 #define SPA_LIGHTMAP0_COLOR 6 586 #define CHAN_AUTO 0 /* The automatic channel, play as many sounds on this channel as you want, and they'll all play, however the other channels will replace each other. */ 587 #define CHAN_WEAPON 1 588 #define CHAN_VOICE 2 589 #define CHAN_ITEM 3 590 #define CHAN_BODY 4 591 #define CHANF_RELIABLE 8 /* Only valid if the flags argument is not specified. The sound will be sent reliably, which is important if it is intended to replace looping sounds on doors etc. */ 592 #define SOUNDFLAG_RELIABLE 1 /* The sound will be sent reliably, and without regard to phs. */ 593 #define SOUNDFLAG_FORCELOOP 2 /* The sound will restart once it reaches the end of the sample. */ 594 #define SOUNDFLAG_NOREVERB 32 /* Disables the use of underwater/reverb effects on this sound effect. */ 595 #define SOUNDFLAG_FOLLOW 64 /* The sound's origin will updated to follow the emitting entity. */ 596 #define SOUNDFLAG_UNICAST 256 /* The sound will be sent only by the player specified by msg_entity. Spectators and related splitscreen players will also hear the sound. */ 597 #define SOUNDFLAG_SENDVELOCITY 512 /* The entity's current velocity will be sent to the client, only useful if doppler is enabled. */ 598 #define ATTN_NONE 0 /* Sounds with this attenuation can be heard throughout the map */ 599 #define ATTN_NORM 1 /* Standard attenuation */ 600 #define ATTN_IDLE 2 /* Extra attenuation so that sounds don't travel too far. */ 601 #define ATTN_STATIC 3 /* Even more attenuation to avoid torches drowing out everything else throughout the map. */ 602 #define SVC_CGAMEPACKET 83 /* Direct ssqc->csqc message. Must only be multicast. The data triggers a CSQC_Parse_Event call in the csqc for the csqc to read the contents. The server *may* insert length information for clients connected via proxies which are not able to cope with custom csqc payloads. This should only ever be used in conjunction with the MSG_MULTICAST destination. */ 603 #define MSG_BROADCAST 0 /* The byte(s) will be unreliably sent to all players. MSG_ constants are valid arguments to the Write* builtin family. */ 604 #define MSG_ONE 1 /* The byte(s) will be reliably sent to the player specified in the msg_entity global. WARNING: in quakeworld servers without network preparsing enabled, this can result in illegible server messages (due to individual reliable messages being split between multiple backbuffers/packets). NQ has larger reliable buffers which avoids this issue, but still kicks the client. */ 605 #define MSG_ALL 2 /* The byte(s) will be reliably sent to all players. */ 606 #define MSG_INIT 3 /* The byte(s) will be written into the signon buffer. Clients will see these messages when they connect later. This buffer is only flushed on map changes, so spamming it _WILL_ result in overflows. */ 607 #define MSG_MULTICAST 4 /* The byte(s) will be written into the multicast buffer for more selective sending. Messages sent this way will never be split across packets, and using this for csqc-only messages will not break protocol translation. */ 608 #define MSG_ENTITY 5 /* The byte(s) will be written into the entity buffer. This is a special value used only inside 'SendEntity' functions. */ 609 #define MULTICAST_ALL 0 /* The multicast message is unreliably sent to all players. MULTICAST_ constants are valid arguments for the multicast builtin, which ignores the specified origin when given this constant. */ 610 #define MULTICAST_PHS 1 /* The multicast message is unreliably sent to only players that can potentially hear the specified origin. Its quite loose. */ 611 #define MULTICAST_PVS 2 /* The multicast message is unreliably sent to only players that can potentially see the specified origin. */ 612 #define MULTICAST_ONE 6 /* The multicast message is unreliably sent to the player (AND ALL TRACKING SPECTATORS) specified in the msg_entity global. The specified origin is ignored. */ 613 #define MULTICAST_ONE_NOSPECS 9 /* The multicast message is unreliably sent to the player specified in the msg_entity global. The specified origin is ignored. */ 614 #define MULTICAST_ALL_R 3 /* The multicast message is reliably sent to all players. The specified origin is ignored. */ 615 #define MULTICAST_PHS_R 4 /* The multicast message is reliably sent to only players that can potentially hear the specified origin. Players might still not receive it if they are out of range. */ 616 #define MULTICAST_PVS_R 5 /* The multicast message is reliably sent to only players that can potentially see the specified origin. Players might still not receive it if they cannot see the event. */ 617 #define MULTICAST_ONE_R 7 /* The multicast message is reliably sent to the player (AND ALL TRACKING SPECTATORS) specified in the msg_entity global. The specified origin is ignored */ 618 #define MULTICAST_ONE_R_NOSPECS 10 /* The multicast message is reliably sent to the player specified in the msg_entity global. The specified origin is ignored */ 619 #define PRINT_LOW 0 620 #define PRINT_MEDIUM 1 621 #define PRINT_HIGH 2 622 #define PRINT_CHAT 3 623 #define PVSF_NORMALPVS 0 /* Filter first by PVS, then filter this entity using tracelines if sv_cullentities is enabled. */ 624 #define PVSF_NOTRACECHECK 1 /* Filter strictly by PVS. */ 625 #define PVSF_USEPHS 2 /* Send if we're close enough to be able to hear this entity. */ 626 #define PVSF_IGNOREPVS 3 /* Ignores pvs. This entity is visible whereever you are on the map. Updates will be sent regardless of pvs or phs */ 627 #define PVSF_NOREMOVE 128 /* Once visible to a client, this entity will remain visible. This can be useful for csqc and corpses. While this flag is set, no CSQC_Remove events will be sent for the entity, but this does NOT mean that it will still receive further updates while outside of the pvs. */ 628 #define INFOKEY_P_IP "ip" /* The apparent ip address of the client. This may be a proxy's ip address. */ 629 #define INFOKEY_P_REALIP "realip" /* If sv_getrealip is set, this gives the ip as determine using that algorithm. */ 630 #define INFOKEY_P_CSQCACTIVE "csqcactive" /* Client has csqc enabled. CSQC ents etc will be sent to this player. */ 631 #define INFOKEY_P_SVPING "svping" 632 #define INFOKEY_P_GUID "guid" /* Some hash string which should be reasonably unique to this player's quake installation. */ 633 #define INFOKEY_P_CHALLENGE "challenge" 634 #define INFOKEY_P_USERID "*userid" 635 #define INFOKEY_P_DOWNLOADPCT "download" /* The client's download percentage for the current file. Additional files are not known. */ 636 #define INFOKEY_P_TRUSTLEVEL "trustlevel" 637 #define INFOKEY_P_PROTOCOL "protocol" /* The network protocol the client is using to connect to the server. */ 638 #define INFOKEY_P_VIP "*VIP" /* 1 if the player has the VIP 'penalty'. */ 639 #define INFOKEY_P_ISMUTED "*ismuted" /* 1 if the player has the 'mute' penalty and is not allowed to use the say/say_team commands. */ 640 #define INFOKEY_P_ISDEAF "*isdeaf" /* 1 if the player has the 'deaf' penalty and cannot see other people's say/say_team commands. */ 641 #define INFOKEY_P_ISCRIPPLED "*ismuted" /* 1 if the player has the cripple penalty, and their movement values are ignored (.movement is locked to 0). */ 642 #define INFOKEY_P_ISCUFFED "*ismuted" /* 1 if the player has the cuff penalty, and is unable to attack or use impulses(.button0 and .impulse fields are locked to 0). */ 643 #define INFOKEY_P_ISLAGGED "*ismuted" /* 1 if the player has the fakelag penalty and has an extra 200ms of lag. */ 644 #define INFOKEY_P_PING "ping" /* The player's ping time, in milliseconds. */ 645 #define INFOKEY_P_NAME "name" /* The player's name. */ 646 #define INFOKEY_P_SPECTATOR "*spectator" /* Whether the player is a spectator or not. */ 647 #define INFOKEY_P_TOPCOLOR "topcolor" /* The player's upper/shirt colour (palette index). */ 648 #define INFOKEY_P_BOTTOMCOLOR "bottomcolor" /* The player's lower/pants/trouser colour (palette index). */ 649 #define STUFFCMD_IGNOREINDEMO 1 /* This stuffcmd will NOT be written to mvds/qtv. */ 650 #define STUFFCMD_DEMOONLY 2 /* This stuffcmd will ONLY be written into mvds/qtv streams. */ 651 #define STUFFCMD_BROADCAST 4 /* The stuffcmd will be broadcast server-wide (according to the mvd filters). */ 652 #define STUFFCMD_UNRELIABLE 8 /* The stuffcmd might not arrive. It might also get there faster than ones sent over the reliable channel. */ 653 #define FL_FLY 1 654 #define FL_SWIM 2 655 #define FL_CLIENT 8 656 #define FL_INWATER 16 657 #define FL_MONSTER 32 658 #define FL_GODMODE 64 659 #define FL_NOTARGET 128 660 #define FL_ITEM 256 661 #define FL_ONGROUND 512 662 #define FL_PARTIALGROUND 1024 663 #define FL_WATERJUMP 2048 664 #define FL_FINDABLE_NONSOLID 16384 /* Allows this entity to be found with findradius */ 665 #define FL_LAGGEDMOVE 65536 /* Enables anti-lag on rockets etc. */ 666 #define MOVE_NORMAL 0 667 #define MOVE_NOMONSTERS 1 /* The trace will ignore all non-solid_bsp entities. */ 668 #define MOVE_MISSILE 2 /* The trace will use a bbox size of +/- 15 against entities with FL_MONSTER set. */ 669 #define MOVE_HITMODEL 4 /* Traces will impact the actual mesh of the model instead of merely their bounding box. Should generally only be used for tracelines. Note that this flag is unreliable as an object can animate through projectiles. The bounding box MUST be set to completely encompass the entity or those extra areas will be non-solid (leaving a hole for things to go through). */ 670 #define MOVE_TRIGGERS 16 /* This trace type will impact only triggers. It will ignore non-solid entities. */ 671 #define MOVE_EVERYTHING 32 /* This type of trace will hit solids and triggers alike. Even non-solid entities. */ 672 #define MOVE_LAGGED 64 /* Will use antilag based upon the player's latency. Traces will be performed against old positions for entities instead of their current origin. */ 673 #define MOVE_ENTCHAIN 128 /* Returns a list of entities impacted via the trace_ent.chain field */ 674 #define MOVE_OTHERONLY 256 /* Traces that use this trace type will collide against *only* the entity specified via the 'other' global, and will ignore all owner/solid_not/dimension etc rules, they will still adhere to contents and bsp/bbox rules though. */ 675 #define RESTYPE_MODEL 0 /* RESTYPE_* constants are used as arguments with the resourcestatus builtin. */ 676 #define RESTYPE_SOUND 1 /* precache_sound */ 677 #define RESTYPE_PARTICLE 2 /* particleeffectnum */ 678 #define RESSTATE_NOTKNOWN 0 /* RESSTATE_* constants are return values from the resourcestatus builtin. The engine doesn't know about the resource if it is in this state. This means you will need to precache it. Attempting to use it anyway may result in warnings, errors, or silently succeed, depending on engine version and resource type. */ 679 #define RESSTATE_NOTLOADED 1 /* The resource was precached, but has been flushed and there has not been an attempt to reload it. If you use the resource normally, chances are it'll be loaded but at the cost of a stall. */ 680 #define RESSTATE_LOADING 2 /* Resources in this this state are queued for loading, and will be loaded at the engine's convienience. If you attempt to query the resource now, the engine will stall until the result is available. sounds in this state may be delayed, while models/pics/shaders may be invisible. */ 681 #define RESSTATE_FAILED 3 /* Resources in this state are unusable/could not be loaded. You will get placeholders or dummy results. Queries will not stall the engine. The engine may display placeholder content. */ 682 #define RESSTATE_LOADED 4 /* Resources in this state are finally usable, everything will work okay. Hurrah. Queries will not stall the engine. */ 683 #define EF_BRIGHTFIELD 1 684 #define EF_BRIGHTLIGHT 4 685 #define EF_DIMLIGHT 8 686 #define EF_FLAG1 16 687 #define EF_FLAG2 32 688 #define EF_ADDITIVE 32 /* The entity will be drawn with an additive blend. This is NOT supported on players in any quakeworld engine. */ 689 #define EF_BLUE 64 /* A blue glow */ 690 #define EF_RED 128 /* A red glow */ 691 #define EF_GREEN 262144 /* A green glow */ 692 #define EF_FULLBRIGHT 512 /* This entity will ignore lighting */ 693 #define EF_NOSHADOW 4096 /* This entity will not cast shadows */ 694 #define EF_NODEPTHTEST 8192 /* This entity will be drawn over the top of other things that are closer. */ 695 #define EF_NOMODELFLAGS 8388608 /* Surpresses the normal flags specified in the model. */ 696 #define MF_ROCKET 1 697 #define MF_GRENADE 2 698 #define MF_GIB 4 /* Regular blood trail */ 699 #define MF_ROTATE 8 700 #define MF_TRACER 16 /* AKA: green scrag trail */ 701 #define MF_ZOMGIB 32 /* Dark blood trail */ 702 #define MF_TRACER2 64 /* AKA: hellknight projectile trail */ 703 #define MF_TRACER3 128 /* AKA: purple vore trail */ 704 #define SL_ORG_TL 20 /* Used with showpic etc, specifies that the x+y values are relative to the top-left of the screen */ 705 #define SL_ORG_TR 21 706 #define SL_ORG_BL 22 707 #define SL_ORG_BR 23 708 #define SL_ORG_MM 24 709 #define SL_ORG_TM 25 710 #define SL_ORG_BM 26 711 #define SL_ORG_ML 27 712 #define SL_ORG_MR 28 713 #define PFLAGS_NOSHADOW 1 /* Associated RT lights attached will not cast shadows, making them significantly faster to draw. */ 714 #define PFLAGS_CORONA 2 /* Enables support of coronas on the associated rtlights. */ 715 #define PFLAGS_FULLDYNAMIC 128 /* When set in self.pflags, enables fully-customised dynamic lights. Custom rtlight information is not otherwise used. */ 716 #define EV_STRING 1 717 #define EV_FLOAT 2 718 #define EV_VECTOR 3 719 #define EV_ENTITY 4 720 #define EV_FIELD 5 721 #define EV_FUNCTION 6 722 #define EV_POINTER 7 723 #define EV_INTEGER 8 724 #define EV_VARIANT 9 725 hashtable gamestate; /* Special hash table index for hash_add and hash_get. Entries in this table will persist over map changes (and doesn't need to be created/deleted). */ 726 #define HASH_REPLACE 256 /* Used with hash_add. Attempts to remove the old value instead of adding two values for a single key. */ 727 #define HASH_ADD 512 /* Used with hash_add. The new entry will be inserted in addition to the existing entry. */ 728 #define STAT_USER 32 /* Custom user stats start here (lower values are reserved for engine use). */ 729 #define CLIENTTYPE_DISCONNECTED 0 /* Return value from clienttype() builtin. This entity is a player slot that is currently empty. */ 730 #define CLIENTTYPE_REAL 1 /* This is a real player, and not a bot. */ 731 #define CLIENTTYPE_BOT 2 /* This player slot does not correlate to a real player, any messages sent to this client will be ignored. */ 732 #define CLIENTTYPE_NOTACLIENT 3 /* This entity is not even a player slot. This is typically an error condition. */ 733 #define FILE_READ 0 /* The file may be read via fgets to read a single line at a time. */ 734 #define FILE_APPEND 1 /* Like FILE_WRITE, but writing starts at the end of the file. */ 735 #define FILE_WRITE 2 /* fputs will be used to write to the file. */ 736 #define FILE_READNL 4 /* Like FILE_READ, except newlines are not special. fgets reads the entire file into a tempstring. */ 737 #define FILE_MMAP_READ 5 /* The file will be loaded into memory. fgets returns a pointer to the first byte (and will always return the same value for this file). Cast this to your datatype. */ 738 #define FILE_MMAP_RW 6 /* Like FILE_MMAP_READ, except any changes to the data will be written back to disk once the file is closed. */ 739 void(vector vang) makevectors = #1; /* 740 Takes an angle vector (pitch,yaw,roll) (+x=DOWN). Writes its results into v_forward, v_right, v_up vectors. */ 741 742 void(entity e, vector o) setorigin = #2; /* 743 Changes e's origin to be equal to o. Also relinks collision state (as well as setting absmin+absmax), which is required after changing .solid */ 744 745 void(entity e, string m) setmodel = #3; /* 746 Looks up m in the model precache list, and sets both e.model and e.modelindex to match. BSP models will set e.mins and e.maxs accordingly, other models depend upon the value of sv_gameplayfix_setmodelrealbox - for compatibility you should always call setsize after all pickups or non-bsp models. Also relinks collision state. */ 747 748 void(entity e, vector min, vector max) setsize = #4; /* 749 Sets the e's mins and maxs fields. Also relinks collision state, which sets absmin and absmax too. */ 750 751 void() breakpoint = #6; /* 752 Trigger a debugging event. FTE will break into the qc debugger. Other engines may crash with a debug execption. */ 753 754 float() random = #7; /* 755 Returns a random value between 0 and 1. Be warned, this builtin can return 1 in most engines, which can break arrays. */ 756 757 void(entity e, float chan, string samp, float vol, float atten, optional float speedpct, optional float flags, optional float timeofs) sound = #8; /* 758 Starts a sound centered upon the given entity. 759 chan is the entity sound channel to use, channel 0 will allow you to mix many samples at once, others will replace the old sample 760 'samp' must have been precached first 761 if specified, 'speedpct' should normally be around 100 (or =0), 200 for double speed or 50 for half speed. 762 If flags is specified, the reliable flag in the channels argument is used for additional channels. Flags should be made from SOUNDFLAG_* constants 763 timeofs should be negative in order to provide a delay before the sound actually starts. */ 764 765 vector(vector v) normalize = #9; /* 766 Shorten or lengthen a direction vector such that it is only one quake unit long. */ 767 768 void(string e) error = #10; /* 769 Ends the game with an easily readable error message. */ 770 771 void(string e) objerror = #11; /* 772 Displays a non-fatal easily readable error message concerning the self entity, including a field dump. self will be removed! */ 773 774 float(vector v) vlen = #12; /* 775 Returns the square root of the dotproduct of a vector with itself. Or in other words the length of a distance vector, in quake units. */ 776 777 float(vector v, optional entity reference) vectoyaw = #13; /* 778 Given a direction vector, returns the yaw angle in which that direction vector points. If an entity is passed, the yaw angle will be relative to that entity's gravity direction. */ 779 780 entity() spawn = #14; /* 781 Adds a brand new entity into the world! Hurrah, you're now a parent! */ 782 783 void(entity e) remove = #15; /* 784 Destroys the given entity and clears some limited fields (including model, modelindex, solid, classname). Any references to the entity following the call are an error. After half a second the entity will be reused, in the interim you can unfortunatly still read its fields to see if the reference is no longer valid. */ 785 786 void(entity e) removeinstant = #0:removeinstant; /* 787 Same thing as the regular remove builtin, but bypasses the half-second rule. The entity slot may be reused instantly. Be CERTAIN that you have no lingering references, because if they're followed they will end up poking an entirely different type of entity! So only use this where you're sure its safe. */ 788 789 void(vector v1, vector v2, float flags, entity ent) traceline = #16; /* 790 Traces a thin line through the world from v1 towards v2. 791 Will not collide with ent, ent.owner, or any entity who's owner field refers to ent. 792 The passed entity will also be used to determine whether to use a capsule trace, the contents that the trace should impact, and a couple of other extra fields that define the trace. 793 There are no side effects beyond the trace_* globals being written. 794 flags&MOVE_NOMONSTERS will not impact on non-bsp entities. 795 flags&MOVE_MISSILE will impact with increased size. 796 flags&MOVE_HITMODEL will impact upon model meshes, instead of their bounding boxes. 797 flags&MOVE_TRIGGERS will also stop on triggers 798 flags&MOVE_EVERYTHING will stop if it hits anything, even non-solid entities. 799 flags&MOVE_LAGGED will backdate entity positions for the purposes of this builtin according to the indicated player ent's latency, to provide lag compensation. */ 800 801 entity() checkclient = #17; /* 802 Returns one of the player entities. The returned player will change periodically. */ 803 804 entity(entity start, .string fld, string match) find = #18; /* 805 Scan for the next entity with a given field set to the given 'match' value. start should be either world, or the previous entity that was found. Returns world on failure/if there are no more. 806 If you have many many entities then you may find that hashtables will give more performance (but requires extra upkeep). */ 807 808 string(string s) precache_sound = #19; /* 809 Precaches a sound, making it known to clients and loading it from disk. This builtin (strongly) should be called during spawn functions. This builtin must be called for the sound before the sound builtin is called, or it might not even be heard. */ 810 811 string(string s) precache_model = #20; /* 812 Precaches a model, making it known to clients and loading it from disk if it has a .bsp extension. This builtin (strongly) should be called during spawn functions. This must be called for each model name before setmodel may use that model name. 813 Modelindicies precached in SSQC will always be positive. CSQC precaches will be negative if they are not also on the server. */ 814 815 void(entity client, string s) stuffcmd = #21; /* 816 Sends a console command (or cvar) to the client, where it will be executed. Different clients support different commands. Do NOT forget the final \n. 817 This builtin is generally considered evil. */ 818 819 void(entity client, float flags, string s) stuffcmdflags = #0:stuffcmdflags; /* Part of FTE_QC_STUFFCMDFLAGS 820 Sends a console command (or cvar) to the client, where it will be executed. Different clients support different commands. Do NOT forget the final \n. 821 This (just as evil) variant allows specifying some flags too. See the STUFFCMD_* constants. */ 822 823 entity(vector org, float rad, optional .entity chainfield) findradius = #22; /* 824 Finds all entities within a distance of the 'org' specified. One entity is returned directly, while other entities are returned via that entity's .chain field. */ 825 826 void(float msglvl, string s, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6, optional string s7) bprint = #23; /* 827 QW: Concatenates all string arguments, and prints the messsage on the console of only all clients who's 'msg' infokey is set lower or equal to the supplied 'msglvl' argument. */ 828 829 void(entity client, float msglvl, string s, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6) sprint = #24; /* 830 QW: Concatenates all string arguments, and prints the messsage on the named client's console, but only if that client's 'msg' infokey is set lower or equal to the supplied 'msglvl' argument. */ 831 832 void(string s, ...) dprint = #25; /* 833 QW: Unconditionally prints the given message on the server's console. Arguments will be concatenated into a single message. */ 834 835 string(float val) ftos = #26; /* 836 Returns a tempstring containing a representation of the given float. Precision depends upon engine. */ 837 838 string(vector val) vtos = #27; /* 839 Returns a tempstring containing a representation of the given vector. Precision depends upon engine. */ 840 841 void() coredump = #28; /* 842 Writes out a coredump. This contains stack, globals, and field info for all ents. This can be handy for debugging. */ 843 844 void() traceon = #29; /* 845 Enables tracing. This may be spammy, slow, and stuff. Set debugger 1 in order to use fte's qc debugger. */ 846 847 void() traceoff = #30; /* 848 Disables tracing again. */ 849 850 void(entity e) eprint = #31; /* 851 Debugging builtin that prints all fields of the given entity to the console. */ 852 853 float(float yaw, float dist, optional float settraceglobals) walkmove = #32; /* 854 Attempt to walk the entity at a given angle for a given distance. 855 if settraceglobals is set, the trace_* globals will be set, showing the results of the movement. 856 This function will trigger touch events. */ 857 858 float() droptofloor = #34; /* 859 Instantly moves the entity downwards until it hits the ground. If the entity is in solid or would need to drop more than 'pr_droptofloorunits' quake units, its position will be considered invalid and the builtin will abort, returning FALSE, otherwise TRUE. */ 860 861 void(float lightstyle, string stylestring, optional vector rgb) lightstyle = #35; /* 862 Specifies an auto-animating string that specifies the light intensity for entities using that lightstyle. 863 a is off, z is fully lit. Should be lower case only. 864 rgb will recolour all lights using that lightstyle. */ 865 866 float(float) rint = #36; /* 867 Rounds the given float up or down to the closest integeral value. X.5 rounds away from 0 */ 868 869 float(float) floor = #37; /* 870 Rounds the given float downwards, even when negative. */ 871 872 float(float) ceil = #38; /* 873 Rounds the given float upwards, even when negative. */ 874 875 float(entity ent) checkbottom = #40; /* 876 Expensive checks to ensure that the entity is actually sitting on something solid, returns true if it is. */ 877 878 float(vector pos) pointcontents = #41; /* 879 Checks the given point to see what is there. Returns one of the SOLID_* constants. Just because a spot is empty does not mean that the player can stand there due to the size of the player - use tracebox for such tests. */ 880 881 float(float) fabs = #43; /* 882 Removes the sign of the float, making it positive if it is negative. */ 883 884 vector(entity player, float missilespeed) aim = #44; /* 885 Returns a tweaked copy of the v_forward vector (must be set! ie: makevectors(player.v_angle) ). This is important for keyboard users (that don't want to have to look up/down the whole time), as well as joystick users (who's aim is otherwise annoyingly imprecise). Only the upwards component of the result will differ from the value of v_forward. The builtin will select the enemy closest to the crosshair within the angle of acos(sv_aim). */ 886 887 float(string) cvar = #45; /* 888 Returns the numeric value of the named cvar */ 889 890 void(string, ...) localcmd = #46; /* 891 Adds the string to the console command queue. Commands will not be executed immediately, but rather at the start of the following frame. */ 892 893 entity(entity) nextent = #47; /* 894 Returns the following entity. Skips over removed entities. Returns world when passed the last valid entity. */ 895 896 void(vector pos, vector dir, float colour, float count) particle = #48; /* 897 Spawn 'count' particles around 'pos' moving in the direction 'dir', with a palette colour index between 'colour' and 'colour+8'. */ 898 899 #define ChangeYaw changeyaw 900 void() changeyaw = #49; /* 901 Changes the self.angles_y field towards self.ideal_yaw by up to self.yaw_speed. */ 902 903 vector(vector fwd, optional vector up) vectoangles = #51; /* 904 Returns the angles (+x=UP) required to orient an entity to look in the given direction. The 'up' argument is required if you wish to set a roll angle, otherwise it will be limited to just monster-style turning. */ 905 906 void(float to, float val) WriteByte = #52; /* 907 Writes a single byte into a network message buffer. Typically you will find a more correct alternative to writing arbitary data. 'to' should be one of the MSG_* constants. MSG_ONE must have msg_entity set first. */ 908 909 void(float to, float val) WriteChar = #53; /* 910 Writes a signed value between -128 and 127. */ 911 912 void(float to, float val) WriteShort = #54; /* 913 Writes a signed value between -32768 and 32767. As an exception, values up to 65535 will not trigger warnings (but readshort will read the result as negative!) */ 914 915 void(float to, float val) WriteLong = #55; /* 916 Writes a signed 32bit integer. Note that the input argument being of float type limits the resulting integer to a mere 24 consecutive bits of validity. Use WriteInt if you want to write an entire 32bit int without data loss. */ 917 918 void(float to, float val) WriteCoord = #56; /* 919 Writes a single value suitable for a map coordinate axis. The precision is not strictly specified but is assumed to be of at least 13.3 fixed-point precision (ie: +/-4k with 1/8th precision). */ 920 921 void(float to, float val) WriteAngle = #57; /* 922 Writes a single value suitable for an angle axis. The precision is not strictly specified but is assumed to be 8bit, giving 256 notches instead of the assumed 360 range passed in. */ 923 924 void(float to, string val) WriteString = #58; /* 925 Writes a variable-length null terminated string. There are length limits. The codepage is not translated, so be sure that client+server agree on whether utf-8 is being used or not (or just stick to ascii+markup). */ 926 927 void(float to, entity val) WriteEntity = #59; /* 928 Writes the index of the specified entity (the network data size is not specified). This can be read clientside using the readentitynum builtin, with caveats. */ 929 930 float(float angle) sin = #60; /* Part of DP_QC_SINCOSSQRTPOW 931 Forgive me father, for I have trigonometry homework. */ 932 933 float(float angle) cos = #61; /* Part of DP_QC_SINCOSSQRTPOW*/ 934 float(float value) sqrt = #62; /* Part of DP_QC_SINCOSSQRTPOW*/ 935 float(float a, float n) modulo = #0:modulo; 936 void(entity ent) changepitch = #63; /* Part of DP_QC_CHANGEPITCH*/ 937 void(entity ent, entity ignore) tracetoss = #64; 938 string(entity ent) etos = #65; /* Part of DP_QC_ETOS*/ 939 void(float step) movetogoal = #67; /* 940 Runs lots and lots of fancy logic in order to try to step the entity the specified distance towards its goalentity. */ 941 942 string(string s) precache_file = #68; /* 943 This builtin does nothing. It was used only as a hint for pak generation. */ 944 945 void(entity e) makestatic = #69; /* 946 Sends a copy of the entity's renderable fields to all clients, and REMOVES the entity, preventing further changes. This means it will be unmutable and non-solid. */ 947 948 void(string mapname, optional string newmapstartspot) changelevel = #70; /* 949 Attempts to change the map to the named map. If 'newmapstartspot' is specified, the state of the current map will be preserved, and the argument will be passed to the next map in the 'startspot' global, and the next map will be loaded from archived state if it was previously visited. If not specified, all archived map states will be purged. */ 950 951 void(string cvarname, string valuetoset) cvar_set = #72; /* 952 Instantly sets a cvar to the given string value. Warning: the resulting string includes apostrophies surrounding the result. You may wish to use sprintf instead. */ 953 954 void(entity ent, string text, optional string text2, optional string text3, optional string text4, optional string text5, optional string text6, optional string text7) centerprint = #73; 955 void (vector pos, string samp, float vol, float atten) ambientsound = #74; 956 string(string str) precache_model2 = #75; 957 string(string str) precache_sound2 = #76; 958 string(string str) precache_file2 = #77; 959 void(entity player) setspawnparms = #78; 960 void(entity killer, entity killee) logfrag = #79; /* Part of QW_ENGINE*/ 961 string(entity e, string key) infokey = #80; /* Part of FTE_QC_INFOKEY, QW_ENGINE 962 If e is world, returns the field 'key' from either the serverinfo or the localinfo. If e is a player, returns the value of 'key' from the player's userinfo string. There are a few special exceptions, like 'ip' which is not technically part of the userinfo. */ 963 964 float(entity e, string key) infokeyf = #0:infokeyf; /* 965 Identical to regular infokey, except returns a float. */ 966 967 float(string) stof = #81; /* Part of FRIK_FILE, FTE_QC_INFOKEY, FTE_STRINGS, QW_ENGINE, ZQ_QC_STRINGS*/ 968 #define unicast(pl,reli) do{msg_entity = pl; multicast('0 0 0', reli?MULITCAST_ONE_R:MULTICAST_ONE);}while(0) 969 void(vector where, float set) multicast = #82; /* Part of FTE_QC_MULTICAST 970 Once the MSG_MULTICAST network message buffer has been filled with data, this builtin is used to dispatch it to the given target, filtering by pvs for reduced network bandwidth. */ 971 972 void(entity to, string str) redirectcmd = #101; /* Part of ??MVDSV_BUILTINS 973 Executes a single console command, and sends the text generated by it to the specified player. The command will be executed at the end of the frame once QC is no longer running - you may wish to pre/postfix it with 'echo'. */ 974 975 string(float style, optional __out vector rgb) getlightstyle = #0:getlightstyle; /* 976 Obtains the light style string for the given style. */ 977 978 vector(float style) getlightstylergb = #0:getlightstylergb; /* 979 Obtains the current rgb value of the specified light style. In csqc, this is correct with regard to the current frame, while ssqc gives no guarentees about time and ignores client cvars. Note: use getlight if you want the actual light value at a point. */ 980 981 void(float style, float val, optional vector rgb) lightstylestatic = #5; /* 982 Sets the lightstyle to an explicit numerical level. From Hexen2. */ 983 984 void(vector start, vector mins, vector maxs, vector end, float nomonsters, entity ent) tracebox = #90; /* Part of DP_QC_TRACEBOX 985 Exactly like traceline, but a box instead of a uselessly thin point. Acceptable sizes are limited by bsp format, q1bsp has strict acceptable size values. */ 986 987 vector() randomvec = #91; /* Part of DP_QC_RANDOMVEC 988 Returns a vector with random values. Each axis is independantly a value between -1 and 1 inclusive. */ 989 990 vector(vector org) getlight = #92; 991 float(string cvarname, string defaultvalue) registercvar = #93; /* Part of DP_REGISTERCVAR 992 Creates a new cvar on the fly. If it does not already exist, it will be given the specified value. If it does exist, this is a no-op. 993 This builtin has the limitation that it does not apply to configs or commandlines. Such configs will need to use the set or seta command causing this builtin to be a noop. 994 In engines that support it, you will generally find the autocvar feature easier and more efficient to use. */ 995 996 float(float a, float b, ...) min = #94; /* Part of DP_QC_MINMAXBOUND 997 Returns the lowest value of its arguments. */ 998 999 float(float a, float b, ...) max = #95; /* Part of DP_QC_MINMAXBOUND 1000 Returns the highest value of its arguments. */ 1001 1002 float(float minimum, float val, float maximum) bound = #96; /* Part of DP_QC_MINMAXBOUND 1003 Returns val, unless minimum is higher, or maximum is less. */ 1004 1005 float(float value, float exp) pow = #97; /* Part of DP_QC_SINCOSSQRTPOW*/ 1006 float(float v, optional float base) logarithm = #0:logarithm; /* 1007 Determines the logarithm of the input value according to the specified base. This can be used to calculate how much something was shifted by. */ 1008 1009 #define findentity findfloat 1010 entity(entity start, .__variant fld, __variant match) findfloat = #98; /* Part of DP_QC_FINDFLOAT 1011 Equivelent to the find builtin, but instead of comparing strings contents, this builtin compares the raw values. This builtin requires multiple calls in order to scan all entities - set start to the previous call's return value. 1012 world is returned when there are no more entities. */ 1013 1014 float(string extname) checkextension = #99; /* 1015 Checks for an extension by its name (eg: checkextension("FRIK_FILE") says that its okay to go ahead and use strcat). 1016 Use cvar("pr_checkextension") to see if this builtin exists. */ 1017 1018 float(__variant funcref) checkbuiltin = #0:checkbuiltin; /* 1019 Checks to see if the specified builtin is supported/mapped. This is intended as a way to check for #0 functions, allowing for simple single-builtin functions. Warning, if two different engines map different builtins to the same number, then this function will not tell you which will be called, only that it won't crash (the exception being #0, which are remapped as available). */ 1020 1021 float(string builtinname) builtin_find = #100; /* 1022 Looks to see if the named builtin is valid, and returns the builtin number it exists at. */ 1023 1024 float(float value) anglemod = #102; 1025 void(string slot, string picname, float x, float y, float zone, optional entity player) showpic = #104; /* Part of TEI_SHOWLMP2*/ 1026 void(string slot, optional entity player) hidepic = #105; /* Part of TEI_SHOWLMP2*/ 1027 void(string slot, float x, float y, float zone, optional entity player) movepic = #106; /* Part of TEI_SHOWLMP2*/ 1028 void(string slot, string picname, optional entity player) changepic = #107; /* Part of TEI_SHOWLMP2*/ 1029 filestream(string filename, float mode, optional float mmapminsize) fopen = #110; /* Part of FRIK_FILE 1030 Opens a file, typically prefixed with "data/", for either read or write access. */ 1031 1032 void(filestream fhandle) fclose = #111; /* Part of FRIK_FILE*/ 1033 string(filestream fhandle) fgets = #112; /* Part of FRIK_FILE 1034 Reads a single line out of the file. The new line character is not returned as part of the string. Returns the null string on EOF (use if not(string) to easily test for this, which distinguishes it from the empty string which is returned if the line being read is blank */ 1035 1036 void(filestream fhandle, string s, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6, optional string s7) fputs = #113; /* Part of FRIK_FILE 1037 Writes the given string(s) into the file. For compatibility with fgets, you should ensure that the string is terminated with a \n - this will not otherwise be done for you. It is up to the engine whether dos or unix line endings are actually written. */ 1038 1039 int(filestream fhandle, void *ptr, int size) fread = #0:fread; /* Part of FTE_QC_FILE_BINARY 1040 Reads binary data out of the file. Returns truncated lengths if the read exceeds the length of the file. */ 1041 1042 int(filestream fhandle, void *ptr, int size) fwrite = #0:fwrite; /* Part of FTE_QC_FILE_BINARY 1043 Writes binary data out of the file. */ 1044 1045 #define ftell fseek //c compat 1046 int(filestream fhandle, optional int newoffset) fseek = #0:fseek; /* Part of FTE_QC_FILE_BINARY 1047 Changes the current position of the file, if specified. Returns prior position, in bytes. */ 1048 1049 int(filestream fhandle, optional int newsize) fsize = #0:fsize; /* Part of FTE_QC_FILE_BINARY 1050 Reports the total size of the file, in bytes. Can also be used to truncate/extend the file */ 1051 1052 float(string s) strlen = #114; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS*/ 1053 string(string s1, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6, optional string s7, optional string s8) strcat = #115; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS*/ 1054 string(string s, float start, float length) substring = #116; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS*/ 1055 vector(string s) stov = #117; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS*/ 1056 string(string s, ...) strzone = #118; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS 1057 Create a semi-permanent copy of a string that only becomes invalid once strunzone is called on the string (instead of when the engine assumes your string has left scope). This builtin has become redundant in FTEQW due to the FTE_QC_PERSISTENTTEMPSTRINGS extension and is now functionally identical to strcat for compatibility with old engines+mods. */ 1058 1059 void(string s) strunzone = #119; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS 1060 Destroys a string that was allocated by strunzone. Further references to the string MAY crash the game. In FTE, this function became redundant and now does nothing. */ 1061 1062 void(string cvar, float val) cvar_setf = #176; 1063 void(string soundname, optional float channel, optional float volume) localsound = #177; /* 1064 Plays a sound... locally... probably best not to call this from ssqc. Also disables reverb. */ 1065 1066 float(string soundname, float queryonly) getsoundindex = #0:getsoundindex; /* 1067 Provides a way to query if a sound is already precached or not. The return value can also be checked for <=255 to see if it'll work over any network protocol. The sound index can also be used for writebyte hacks, but this is discouraged - use SOUNDFLAG_UNICAST instead. */ 1068 1069 float(string modelname, optional float queryonly) getmodelindex = #200; /* 1070 Acts as an alternative to precache_model(foo);setmodel(bar, foo); return bar.modelindex; 1071 If queryonly is set and the model was not previously precached, the builtin will return 0 without needlessly precaching the model. */ 1072 1073 __variant(float prnum, string funcname, ...) externcall = #201; /* Part of FTE_MULTIPROGS 1074 Directly call a function in a different/same progs by its name. 1075 prnum=0 is the 'default' or 'main' progs. 1076 prnum=-1 means current progs. 1077 prnum=-2 will scan through the active progs and will use the first it finds. */ 1078 1079 float(string progsname) addprogs = #202; /* Part of FTE_MULTIPROGS 1080 Loads an additional .dat file into the current qcvm. The returned handle can be used with any of the externcall/externset/externvalue builtins. 1081 There are cvars that allow progs to be loaded automatically. */ 1082 1083 __variant(float prnum, string varname) externvalue = #203; /* Part of FTE_MULTIPROGS 1084 Reads a global in the named progs by the name of that global. 1085 prnum=0 is the 'default' or 'main' progs. 1086 prnum=-1 means current progs. 1087 prnum=-2 will scan through the active progs and will use the first it finds. */ 1088 1089 void(float prnum, __variant newval, string varname) externset = #204; /* Part of FTE_MULTIPROGS 1090 Sets a global in the named progs by name. 1091 prnum=0 is the 'default' or 'main' progs. 1092 prnum=-1 means current progs. 1093 prnum=-2 will scan through the active progs and will use the first it finds. */ 1094 1095 void(entity portal, float state) openportal = #207; /* 1096 Opens or closes the portals associated with a door or some such on q2 or q3 maps. On Q2BSPs, the entity should be the 'func_areaportal' entity - its style field will say which portal to open. On Q3BSPs, the entity is the door itself, the portal will be determined by the two areas found from a preceding setorigin call. */ 1097 1098 float(float attributes, string effectname, ...) RegisterTempEnt = #208; /* Part of FTE_PEXT_CUSTOMTENTS*/ 1099 void(float type, vector pos, ...) CustomTempEnt = #209; /* Part of FTE_PEXT_CUSTOMTENTS*/ 1100 float(optional float sleeptime) fork = #210; /* Part of FTE_MULTITHREADED 1101 When called, this builtin simply returns. Twice. 1102 The current 'thread' will return instantly with a return value of 0. The new 'thread' will return after sleeptime seconds with a return value of 1. See documentation for the 'sleep' builtin for limitations/requirements concerning the new thread. Note that QC should probably call abort in the new thread, as otherwise the function will return to the calling qc function twice also. */ 1103 1104 void(optional __variant ret) abort = #211; /* Part of FTE_MULTITHREADED 1105 QC execution is aborted. Parent QC functions on the stack will be skipped, effectively this forces all QC functions to 'return ret' until execution returns to the engine. If ret is ommited, it is assumed to be 0. */ 1106 1107 void(float sleeptime) sleep = #212; /* Part of FTE_MULTITHREADED 1108 Suspends the current QC execution thread for 'sleeptime' seconds. 1109 Other QC functions can and will be executed in the interim, including changing globals and field state (but not simultaneously). 1110 The self and other globals will be restored when the thread wakes up (or set to world if they were removed since the thread started sleeping). Locals will be preserved, but will not be protected from remove calls. 1111 If the engine is expecting the QC to return a value (even in the parent/root function), the value 0 shall be used instead of waiting for the qc to resume. */ 1112 1113 void(entity player, string key, string value) forceinfokey = #213; /* Part of FTE_FORCEINFOKEY 1114 Directly changes a user's info without pinging off the client. Also allows explicitly setting * keys, including *spectator. Does not affect the user's config or other servers. */ 1115 1116 void(entity player, string key, void *data, int size) forceinfokeyblob = #0:forceinfokeyblob; /* 1117 Directly changes a user's info without pinging off the client. Also allows explicitly setting * keys, including *spectator. Does not affect the user's config or other servers. */ 1118 1119 void(vector org, vector dmin, vector dmax, float colour, float effect, float count) particle2 = #215; /* Part of FTE_HEXEN2*/ 1120 void(vector org, vector box, float colour, float effect, float count) particle3 = #216; /* Part of FTE_HEXEN2*/ 1121 void(vector org, float radius, float colour, float effect, float count) particle4 = #217; /* Part of FTE_HEXEN2*/ 1122 float(float number, float quantity) bitshift = #218; /* Part of EXT_BITSHIFT*/ 1123 void(vector pos) te_lightningblood = #219; /* Part of FTE_TE_STANDARDEFFECTBUILTINS*/ 1124 float(string s1, string sub, optional float startidx) strstrofs = #221; /* Part of FTE_STRINGS 1125 Returns the 0-based offset of sub within the s1 string, or -1 if sub is not in s1. 1126 If startidx is set, this builtin will ignore matches before that 0-based offset. */ 1127 1128 float(string str, float index) str2chr = #222; /* Part of FTE_STRINGS 1129 Retrieves the character value at offset 'index'. */ 1130 1131 string(float chr, ...) chr2str = #223; /* Part of FTE_STRINGS 1132 The input floats are considered character values, and are concatenated. */ 1133 1134 string(float ccase, float redalpha, float redchars, string str, ...) strconv = #224; /* Part of FTE_STRINGS 1135 Converts quake chars in the input string amongst different representations. 1136 ccase specifies the new case for letters. 1137 0: not changed. 1138 1: forced to lower case. 1139 2: forced to upper case. 1140 redalpha and redchars switch between colour ranges. 1141 0: no change. 1142 1: Forced white. 1143 2: Forced red. 1144 3: Forced gold(low) (numbers only). 1145 4: Forced gold (high) (numbers only). 1146 5+6: Forced to white and red alternately. 1147 You should not use this builtin in combination with UTF-8. */ 1148 1149 string(float pad, string str1, ...) strpad = #225; /* Part of FTE_STRINGS 1150 Pads the string with spaces, to ensure its a specific length (so long as a fixed-width font is used, anyway). If pad is negative, the spaces are added on the left. If positive the padding is on the right. */ 1151 1152 string(infostring old, string key, string value) infoadd = #226; /* Part of FTE_STRINGS 1153 Returns a new tempstring infostring with the named value changed (or added if it was previously unspecified). Key and value may not contain the \ character. */ 1154 1155 string(infostring info, string key) infoget = #227; /* Part of FTE_STRINGS 1156 Reads a named value from an infostring. The returned value is a tempstring */ 1157 1158 #define strcmp strncmp 1159 float(string s1, string s2, optional float len, optional float s1ofs, optional float s2ofs) strncmp = #228; /* Part of FTE_STRINGS 1160 Compares up to 'len' chars in the two strings. s1ofs allows you to treat s2 as a substring to compare against, or should be 0. 1161 Returns 0 if the two strings are equal, a negative value if s1 appears numerically lower, and positive if s1 appears numerically higher. */ 1162 1163 float(string s1, string s2) strcasecmp = #229; /* Part of FTE_STRINGS 1164 Compares the two strings without case sensitivity. 1165 Returns 0 if they are equal. The sign of the return value may be significant, but should not be depended upon. */ 1166 1167 float(string s1, string s2, float len, optional float s1ofs, optional float s2ofs) strncasecmp = #230; /* Part of FTE_STRINGS 1168 Compares up to 'len' chars in the two strings without case sensitivity. s1ofs allows you to treat s2 as a substring to compare against, or should be 0. 1169 Returns 0 if they are equal. The sign of the return value may be significant, but should not be depended upon. */ 1170 1171 string(string s) strtrim = #0:strtrim; /* 1172 Trims the whitespace from the start+end of the string. */ 1173 1174 void() calltimeofday = #231; /* Part of FTE_CALLTIMEOFDAY 1175 Asks the engine to instantly call the qc's 'timeofday' function, before returning. For compatibility with mvdsv. 1176 timeofday should have the prototype: void(float secs, float mins, float hour, float day, float mon, float year, string strvalue) 1177 The strftime builtin is more versatile and less weird. */ 1178 1179 void(float num, float type, .__variant fld) clientstat = #232; /* 1180 Specifies what data to use in order to send various stats, in a client-specific way. 1181 'num' should be a value between 32 and 127, other values are reserved. 1182 'type' must be set to one of the EV_* constants, one of EV_FLOAT, EV_STRING, EV_INTEGER, EV_ENTITY. 1183 fld must be a reference to the field used, each player will be sent only their own copy of these fields. */ 1184 1185 void(float num, float type, string name) globalstat = #233; /* 1186 Specifies what data to use in order to send various stats, in a non-client-specific way. num and type are as in clientstat, name however, is the name of the global to read in the form of a string (pass "foo"). */ 1187 1188 void(float num, float type, __variant *address) pointerstat = #0:pointerstat; /* 1189 Specifies what data to use in order to send various stats, in a non-client-specific way. num and type are as in clientstat, address however, is the address of the variable you would like to use (pass &foo). */ 1190 1191 float(entity player) isbackbuffered = #234; /* Part of FTE_ISBACKBUFFERED 1192 Returns if the given player's network buffer will take multiple network frames in order to clear. If this builtin returns non-zero, you should delay or reduce the amount of reliable (and also unreliable) data that you are sending to that client. */ 1193 1194 void(vector angle) rotatevectorsbyangle = #235; /* 1195 rotates the v_forward,v_right,v_up matrix by the specified angles. */ 1196 1197 void(vector fwd, vector right, vector up) rotatevectorsbyvectors = #236; 1198 float(float mdlindex, string skinname) skinforname = #237; 1199 void(vector org, optional float count) te_bloodqw = #239; /* Part of FTE_TE_STANDARDEFFECTBUILTINS*/ 1200 void(entity ent) te_muzzleflash = #0:te_muzzleflash; 1201 float(vector viewpos, entity entity) checkpvs = #240; /* Part of FTE_QC_CHECKPVS*/ 1202 entity(string match, optional float matchnum) matchclientname = #241; /* Part of FTE_QC_MATCHCLIENTNAME*/ 1203 float(string destaddress, string content) sendpacket = #242; /* Part of FTE_QC_SENDPACKET 1204 Sends a UDP packet to the specified destination. Note that the payload will be prefixed with four 255 bytes as a sort of security feature. */ 1205 1206 float(float dividend, float divisor) mod = #245; 1207 float(optional string host, optional string user, optional string pass, optional string defaultdb, optional string driver) sqlconnect = #250; /* Part of FTE_SQL*/ 1208 void(float serveridx) sqldisconnect = #251; /* Part of FTE_SQL*/ 1209 float(float serveridx, void(float serveridx, float queryidx, float rows, float columns, float eof, float firstrow) callback, float querytype, string query) sqlopenquery = #252; /* Part of FTE_SQL*/ 1210 void(float serveridx, float queryidx) sqlclosequery = #253; /* Part of FTE_SQL*/ 1211 string(float serveridx, float queryidx, float row, float column) sqlreadfield = #254; /* Part of FTE_SQL*/ 1212 string(float serveridx, optional float queryidx) sqlerror = #255; /* Part of FTE_SQL*/ 1213 string(float serveridx, string data) sqlescape = #256; /* Part of FTE_SQL*/ 1214 string(float serveridx) sqlversion = #257; /* Part of FTE_SQL*/ 1215 float(float serveridx, float queryidx, float row, float column) sqlreadfloat = #258; /* Part of FTE_SQL*/ 1216 int(float serveridx, float queryidx, float row, float column, __variant *ptr, int maxsize) sqlreadblob = #0:sqlreadblob; 1217 string(float serveridx, __variant *ptr, int maxsize) sqlescapeblob = #0:sqlescapeblob; 1218 int(string) stoi = #259; /* Part of FTE_QC_INTCONV 1219 Converts the given string into a true integer. Base 8, 10, or 16 is determined based upon the format of the string. */ 1220 1221 string(int) itos = #260; /* Part of FTE_QC_INTCONV 1222 Converts the passed true integer into a base10 string. */ 1223 1224 int(string) stoh = #261; /* Part of FTE_QC_INTCONV 1225 Reads a base-16 string (with or without 0x prefix) as an integer. Bugs out if given a base 8 or base 10 string. :P */ 1226 1227 string(int) htos = #262; /* Part of FTE_QC_INTCONV 1228 Formats an integer as a base16 string, with leading 0s and no prefix. Always returns 8 characters. */ 1229 1230 int(float) ftoi = #0:ftoi; /* Part of FTE_QC_INTCONV 1231 Converts the given float into a true integer without depending on extended qcvm instructions. */ 1232 1233 float(int) itof = #0:itof; /* Part of FTE_QC_INTCONV 1234 Converts the given true integer into a float without depending on extended qcvm instructions. */ 1235 1236 float(float modlindex, optional float useabstransforms) skel_create = #263; /* Part of FTE_CSQC_SKELETONOBJECTS 1237 Allocates a new uninitiaised skeletal object, with enough bone info to animate the given model. 1238 eg: self.skeletonobject = skel_create(self.modelindex); */ 1239 1240 float(float skel, entity ent, float modelindex, float retainfrac, float firstbone, float lastbone, optional float addfrac) skel_build = #264; /* Part of FTE_CSQC_SKELETONOBJECTS 1241 Animation data (according to the entity's frame info) is pulled from the specified model and blended into the specified skeletal object. 1242 If retainfrac is set to 0 on the first call and 1 on the others, you can blend multiple animations together according to the addfrac value. The final weight should be 1. Other values will result in scaling and/or other weirdness. You can use firstbone and lastbone to update only part of the skeletal object, to allow legs to animate separately from torso, use 0 for both arguments to specify all, as bones are 1-based. */ 1243 1244 typedef struct 1245 { 1246 int sourcemodelindex; /*frame data will be imported from this model, bones must be compatible*/ 1247 int reserved; 1248 int firstbone; 1249 int lastbone; 1250 float prescale; /*0 destroys existing data, 1 retains it*/ 1251 float scale[4]; /*you'll need to do lerpfrac manually*/ 1252 int animation[4]; 1253 float animationtime[4]; 1254 /*halflife models*/ 1255 float subblend[2]; 1256 float controllers[5]; 1257 } skelblend_t; 1258 float(float skel, int numblends, skelblend_t *weights, int structsize) skel_build_ptr = #0:skel_build_ptr; /* 1259 Like skel_build, but slightly simpler. */ 1260 1261 float(float skel) skel_get_numbones = #265; /* Part of FTE_CSQC_SKELETONOBJECTS 1262 Retrives the number of bones in the model. The valid range is 1<=bone<=numbones. */ 1263 1264 string(float skel, float bonenum) skel_get_bonename = #266; /* Part of FTE_CSQC_SKELETONOBJECTS 1265 Retrieves the name of the specified bone. Mostly only for debugging. */ 1266 1267 float(float skel, float bonenum) skel_get_boneparent = #267; /* Part of FTE_CSQC_SKELETONOBJECTS 1268 Retrieves which bone this bone's position is relative to. Bone 0 refers to the entity's position rather than an actual bone */ 1269 1270 float(float skel, string tagname) skel_find_bone = #268; /* Part of FTE_CSQC_SKELETONOBJECTS 1271 Finds a bone by its name, from the model that was used to create the skeletal object. */ 1272 1273 vector(float skel, float bonenum) skel_get_bonerel = #269; /* Part of FTE_CSQC_SKELETONOBJECTS 1274 Gets the bone position and orientation relative to the bone's parent. Return value is the offset, and v_forward, v_right, v_up contain the orientation. */ 1275 1276 vector(float skel, float bonenum) skel_get_boneabs = #270; /* Part of FTE_CSQC_SKELETONOBJECTS 1277 Gets the bone position and orientation relative to the entity. Return value is the offset, and v_forward, v_right, v_up contain the orientation. 1278 Use gettaginfo for world coord+orientation. */ 1279 1280 void(float skel, float bonenum, vector org, optional vector fwd, optional vector right, optional vector up) skel_set_bone = #271; /* Part of FTE_CSQC_SKELETONOBJECTS 1281 Sets a bone position relative to its parent. If the orientation arguments are not specified, v_forward+v_right+v_up are used instead. */ 1282 1283 void(float skel, float bonenum, vector org, optional vector fwd, optional vector right, optional vector up) skel_premul_bone = #272; /* Part of FTE_CSQC_SKELETONOBJECTS 1284 Transforms a single bone by a matrix. You can use makevectors to generate a rotation matrix from an angle. */ 1285 1286 void(float skel, float startbone, float endbone, vector org, optional vector fwd, optional vector right, optional vector up) skel_premul_bones = #273; /* Part of FTE_CSQC_SKELETONOBJECTS 1287 Transforms an entire consecutive range of bones by a matrix. You can use makevectors to generate a rotation matrix from an angle, but you'll probably want to divide the angle by the number of bones. */ 1288 1289 void(float skel, float bonenum, vector org, optional vector fwd, optional vector right, optional vector up) skel_postmul_bone = #0:skel_postmul_bone; /* 1290 Transforms a single bone by a matrix. You can use makevectors to generate a rotation matrix from an angle. */ 1291 1292 void(float skeldst, float skelsrc, float startbone, float entbone) skel_copybones = #274; /* Part of FTE_CSQC_SKELETONOBJECTS 1293 Copy bone data from one skeleton directly into another. */ 1294 1295 void(float skel) skel_delete = #275; /* Part of FTE_CSQC_SKELETONOBJECTS 1296 Deletes a skeletal object. The actual delete is delayed, allowing the skeletal object to be deleted in an entity's predraw function yet still be valid by the time the addentity+renderscene builtins need it. Also uninstanciates any ragdoll currently in effect on the skeletal object. */ 1297 1298 float(float modidx, string framename) frameforname = #276; /* Part of FTE_CSQC_SKELETONOBJECTS 1299 Looks up a framegroup from a model by name, avoiding the need for hardcoding. Returns -1 on error. */ 1300 1301 float(float modidx, float framenum) frameduration = #277; /* Part of FTE_CSQC_SKELETONOBJECTS 1302 Retrieves the duration (in seconds) of the specified framegroup. */ 1303 1304 void(float modidx, float framenum, __inout float basetime, float targettime, void(float timestamp, int code, string data) callback) processmodelevents = #0:processmodelevents; /* Part of FTE_GFX_MODELEVENTS 1305 Calls a callback for each event that has been reached. Basetime is set to targettime. */ 1306 1307 float(float modidx, float framenum, __inout float basetime, float targettime, __out int code, __out string data) getnextmodelevent = #0:getnextmodelevent; /* 1308 Reports the next event within a model's animation. Returns a boolean if an event was found between basetime and targettime. Writes to basetime,code,data arguments (if an event was found, basetime is set to the event's time, otherwise to targettime). 1309 WARNING: this builtin cannot deal with multiple events with the same timestamp (only the first will be reported). */ 1310 1311 float(float modidx, float framenum, int eventidx, __out float timestamp, __out int code, __out string data) getmodeleventidx = #0:getmodeleventidx; /* 1312 Reports an indexed event within a model's animation. Writes to timestamp,code,data arguments on success. Returns false if the animation/event/model was out of range/invalid. Does not consider looping animations (retry from index 0 if it fails and you know that its a looping animation). This builtin is more annoying to use than getnextmodelevent, but can be made to deal with multiple events with the exact same timestamp. */ 1313 1314 #define dotproduct(v1,v2) ((vector)(v1)*(vector)(v2)) 1315 vector(vector v1, vector v2) crossproduct = #0:crossproduct; /* Part of FTE_QC_CROSSPRODUCT 1316 Small helper function to calculate the crossproduct of two vectors. */ 1317 1318 float(entity pusher, vector move, vector amove) pushmove = #0:pushmove; 1319 __variant(float action, optional vector pos, optional float radius, optional float quant, ...) terrain_edit = #278; /* Part of FTE_TERRAIN_MAP 1320 Realtime terrain editing. Actions are the TEREDIT_ constants. */ 1321 1322 typedef struct 1323 { 1324 string shadername; 1325 vector planenormal; 1326 float planedist; 1327 vector sdir; 1328 float sbias; 1329 vector tdir; 1330 float tbias; 1331 } brushface_t; 1332 int(float modelidx, int brushid, brushface_t *out_faces, int maxfaces, int *out_contents) brush_get = #0:brush_get; /* Part of FTE_RAW_MAP 1333 Queries a brush's information. You must pre-allocate the face array for the builtin to write to. Return value is the number of faces retrieved, 0 on error. */ 1334 1335 int(float modelidx, brushface_t *in_faces, int numfaces, int contents, optional int brushid) brush_create = #0:brush_create; /* Part of FTE_RAW_MAP 1336 Inserts a new brush into the model. Return value is the new brush's id. */ 1337 1338 void(float modelidx, int brushid) brush_delete = #0:brush_delete; /* Part of FTE_RAW_MAP 1339 Destroys the specified brush. */ 1340 1341 float(float modelid, int brushid, int faceid, float selectedstate) brush_selected = #0:brush_selected; /* Part of FTE_RAW_MAP 1342 Allows you to easily set transient visual properties of a brush. returns old value. selectedstate=-1 changes nothing (called for its return value). */ 1343 1344 int(float modelid, int brushid, int faceid, vector *points, int maxpoints) brush_getfacepoints = #0:brush_getfacepoints; /* Part of FTE_RAW_MAP 1345 Returns the list of verticies surrounding the given face. If face is 0, returns the center of the brush (if space for 1 point) or the mins+maxs (if space for 2 points). */ 1346 1347 int(int faceid, brushface_t *in_faces, int numfaces, vector *points, int maxpoints) brush_calcfacepoints = #0:brush_calcfacepoints; /* Part of FTE_RAW_MAP 1348 Determines the points of the specified face, if the specified brush were to actually be created. */ 1349 1350 int(float modelid, vector *planes, float *dists, int numplanes, int *out_brushes, int *out_faces, int maxresults) brush_findinvolume = #0:brush_findinvolume; /* Part of FTE_RAW_MAP 1351 Allows you to easily obtain a list of brushes+faces within the given bounding region. If out_faces is not null, the same brush might be listed twice. */ 1352 1353 typedef struct 1354 { 1355 vector dest; 1356 int linkflags; 1357 } nodeslist_t; 1358 void(entity ent, vector dest, int denylinkflags, void(entity ent, vector dest, int numnodes, nodeslist_t *nodelist) callback) route_calculate = #0:route_calculate; /* 1359 Begin calculating a route. The callback function will be called once the route has finished being calculated. The route must be memfreed once it is no longer needed. The route must be followed in reverse order (ie: the first node that must be reached is at index numnodes-1). If no route is available then the callback will be called with no nodes. */ 1360 1361 void(optional entity ent, optional vector neworigin) touchtriggers = #279; /* 1362 Triggers a touch events between self and every SOLID_TRIGGER entity that it is in contact with. This should typically just be the triggers touch functions. Also optionally updates the origin of the moved entity. */ 1363 1364 void(float buf, float fl) WriteFloat = #280; /* 1365 Writes a full 32bit float without any data conversions at all, for full precision. */ 1366 1367 void(float buf, int fl) WriteInt = #0:WriteInt; /* 1368 Equivelent to WriteLong, but doesn't truncate to a float first before converting back to an int. */ 1369 1370 float(entity skelent, string dollcmd, float animskel) skel_ragupdate = #281; /* 1371 Updates the skeletal object attached to the entity according to its origin and other properties. 1372 if animskel is non-zero, the ragdoll will animate towards the bone state in the animskel skeletal object, otherwise they will pick up the model's base pose which may not give nice results. 1373 If dollcmd is not set, the ragdoll will update (this should be done each frame). 1374 If the doll is updated without having a valid doll, the model's default .doll will be instanciated. 1375 commands: 1376 doll foo.doll : sets up the entity to use the named doll file 1377 dollstring TEXT : uses the doll file directly embedded within qc, with that extra prefix. 1378 cleardoll : uninstanciates the doll without destroying the skeletal object. 1379 animate 0.5 : specifies the strength of the ragdoll as a whole 1380 animatebody somebody 0.5 : specifies the strength of the ragdoll on a specific body (0 will disable ragdoll animations on that body). 1381 enablejoint somejoint 1 : enables (or disables) a joint. Disabling joints will allow the doll to shatter. */ 1382 1383 float*(float skel) skel_mmap = #282; /* 1384 Map the bones in VM memory. They can then be accessed via pointers. Each bone is 12 floats, the four vectors interleaved (sadly). */ 1385 1386 void(entity ent, float bonenum, vector org, optional vector angorfwd, optional vector right, optional vector up) skel_set_bone_world = #283; /* 1387 Sets the world position of a bone within the given entity's attached skeletal object. The world position is dependant upon the owning entity's position. If no orientation argument is specified, v_forward+v_right+v_up are used for the orientation instead. If 1 is specified, it is understood as angles. If 3 are specified, they are the forawrd/right/up vectors to use. */ 1388 1389 string(float modidx, float framenum) frametoname = #284; 1390 string(float modidx, float skin) skintoname = #285; 1391 float(float resourcetype, float tryload, string resourcename) resourcestatus = #286; /* 1392 resourcetype must be one of the RESTYPE_ constants. Returns one of the RESSTATE_ constants. Tryload 0 is a query only. Tryload 1 will attempt to reload the content if it was flushed. */ 1393 1394 hashtable(float tabsize, optional float defaulttype) hash_createtab = #287; /* Part of FTE_QC_HASHTABLES 1395 Creates a hash table object. 1396 The tabsize argument is a performance hint and should generally be set to something similar to the number of entries expected, typically a power of two assumption. Too high simply wastes memory, too low results in extra string compares but no actual bugs. 1397 defaulttype must be one of the EV_* values, if specified. 1398 The hash table with index 0 is a game-persistant table and will NEVER be returned by this builtin (except as an error return). */ 1399 1400 void(hashtable table) hash_destroytab = #288; /* Part of FTE_QC_HASHTABLES 1401 Destroys a hash table object. */ 1402 1403 void(hashtable table, string name, __variant value, optional float typeandflags) hash_add = #289; /* Part of FTE_QC_HASHTABLES 1404 Adds the given key with the given value to the table. 1405 If flags&HASH_REPLACE, the old value will be removed, otherwise if flags&HASH_ADD then a duplicate entry will be added with a second value (can be obtained via hash_get's index argument). 1406 The type argument describes how the value should be stored in saved games, as well as providing constraints with the hash_get function. While you can claim that all variables are just vectors, being more precise can result in less issues with tempstrings or saved games - be sure to be explicit with EV_STRING where appropriate because tempstrings may be reclaimed before the get (especially with saved games or table 0). */ 1407 1408 __variant(hashtable table, string name, optional __variant deflt, optional float requiretype, optional float index) hash_get = #290; /* Part of FTE_QC_HASHTABLES 1409 Looks up the specified key name in the hash table. Returns deflt if the key was not found. 1410 If requiretype is specified then the function will only consider entries of the matching type (allowing you to store both flags+strings under a single name without getting confused). 1411 If index is specified then the function will ignore the first N entries with the same key (applicable only with entries added using HASH_ADD, not HASH_REPLACE), allowing you to store multiple entries. Keep querying higher indexes starting from 0 until it returns the deflt value. 1412 You will usually need to cast the result of this function to a real datatype. */ 1413 1414 __variant(hashtable table, string name) hash_delete = #291; /* Part of FTE_QC_HASHTABLES 1415 removes the named key. returns the value of the object that was destroyed, or 0 on error. */ 1416 1417 string(hashtable table, float idx) hash_getkey = #292; /* Part of FTE_QC_HASHTABLES 1418 gets some random key name. add+delete can change return values of this, so don't blindly increment the key index if you're removing all. */ 1419 1420 float(string name) checkcommand = #294; /* Part of FTE_QC_CHECKCOMMAND 1421 Checks to see if the supplied name is a valid command, cvar, or alias. Returns 0 if it does not exist. */ 1422 1423 string(string s) argescape = #295; /* 1424 Marks up a string so that it can be reliably tokenized as a single argument later. */ 1425 1426 void(string dest, string from, string cmd, string info) clusterevent = #0:clusterevent; /* 1427 Only functions in mapcluster mode. Sends an event to whichever server the named player is on. The destination server can then dispatch the event to the client or handle it itself via the SV_ParseClusterEvent entrypoint. If dest is empty, the event is broadcast to ALL servers. If the named player can't be found, the event will be returned to this server with the cmd prefixed with 'error:'. */ 1428 1429 string(entity player, optional string newnode) clustertransfer = #0:clustertransfer; /* 1430 Only functions in mapcluster mode. Initiate transfer of the player to a different node. Can take some time. If dest is specified, returns null on error. Otherwise returns the current/new target node (or null if not transferring). */ 1431 1432 float(float mdlidx) modelframecount = #0:modelframecount; /* 1433 Retrieves the number of frames in the specified model. */ 1434 1435 void(string texturename, optional float flags, optional float is2d) R_BeginPolygon = #306; /* 1436 Specifies the shader to use for the following polygons, along with optional flags. 1437 If is2d, the polygon will be drawn as soon as the EndPolygon call is made, rather than waiting for renderscene. This allows complex 2d effects. */ 1438 1439 void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex = #307; /* 1440 Specifies a polygon vertex with its various properties. */ 1441 1442 void() R_EndPolygon = #308; /* 1443 Ends the current polygon. At least 3 verticies must have been specified. You do not need to call beginpolygon again if you wish to draw another polygon with the same shader. */ 1444 1445 float(string effectname) particleeffectnum = #335; /* Part of DP_ENT_TRAILEFFECTNUM, FTE_SV_POINTPARTICLES 1446 Precaches the named particle effect. If your effect name is of the form 'foo.bar' then particles/foo.cfg will be loaded by the client if foo.bar was not already defined. 1447 Different engines will have different particle systems, this specifies the QC API only. */ 1448 1449 void(float effectnum, entity ent, vector start, vector end) trailparticles = #336; /* Part of FTE_SV_POINTPARTICLES 1450 Draws the given effect between the two named points. If ent is not world, distances will be cached in the entity in order to avoid framerate dependancies. The entity is not otherwise used. */ 1451 1452 void(float effectnum, vector origin, optional vector dir, optional float count) pointparticles = #337; /* Part of FTE_SV_POINTPARTICLES 1453 Spawn a load of particles from the given effect at the given point traveling or aiming along the direction specified. The number of particles are scaled by the count argument. 1454 For regular particles, the dir vector is multiplied by the 'veladd' property (while orgadd will push the particles along it). Decals will use it as a hint to align to the correct surface. In both cases, it should normally be a unit vector, but other lengths will still work. If it has length 0 then FTE will assume downwards. */ 1455 1456 void(string s, ...) print = #339; /* Part of DP_SV_PRINT 1457 Unconditionally print on the local system's console, even in ssqc (doesn't care about the value of the developer cvar). */ 1458 1459 void(entity ent) runstandardplayerphysics = #347; /* 1460 Perform the engine's standard player movement prediction upon the given entity using the input_* globals to describe movement. */ 1461 1462 int(string keyname, optional void *outptr, int size) getlocalinfo = #0:getlocalinfo; /* 1463 Obtains a copy of a data blob (with spaces) from the server's private localinfo. Will write up to size bytes and return the actual size. Does not null terminate (but memalloc(ret+1) will, if you want to cast the buffer to a string), and the blob may contain embedded nulls. Ignores all special keys, returning only what is actually there. */ 1464 1465 void(string keyname, optional void *outptr, int size) setlocalinfo = #0:setlocalinfo; /* 1466 Changes the server's private localinfo. This data will be available for the following map, and will *usually* reload with saved games. */ 1467 1468 float(entity ent) wasfreed = #353; /* 1469 Quickly check to see if the entity is currently free. This function is only valid during the two-second non-reuse window, after that it may give bad results. Try one second to make it more robust. */ 1470 1471 string(string key) serverkey = #354; /* 1472 Look up a key in the server's public serverinfo string. If the key contains binary data then it will be truncated at the first null. */ 1473 1474 float(string key, optional float assumevalue) serverkeyfloat = #0:serverkeyfloat; /* 1475 Version of serverkey that returns the value as a float (which avoids tempstrings). */ 1476 1477 int(string key, optional void *ptr, int maxsize) serverkeyblob = #0:serverkeyblob; /* 1478 Version of serverkey that returns data as a blob (ie: binary data that may contain nulls). Returns the full blob size, even if truncated (pass maxsize=0 to query required storage). */ 1479 1480 void(string key, void *ptr, optional int size) setserverkey = #0:setserverkey; /* 1481 Changes the server's serverinfo. */ 1482 1483 __variant*(int size) memalloc = #384; /* Part of FTE_MEMALLOC 1484 Allocate an arbitary block of memory */ 1485 1486 void(__variant *ptr) memfree = #385; /* Part of FTE_MEMALLOC 1487 Frees a block of memory that was allocated with memfree */ 1488 1489 void(__variant *dst, __variant *src, int size) memcpy = #386; /* Part of FTE_MEMALLOC 1490 Copys memory from one location to another */ 1491 1492 void(__variant *dst, int val, int size) memfill8 = #387; /* Part of FTE_MEMALLOC 1493 Sets an entire block of memory to a specified value. Pretty much always 0. */ 1494 1495 __variant(__variant *dst, float ofs) memgetval = #388; /* 1496 Looks up the 32bit value stored at a pointer-with-offset. */ 1497 1498 void(__variant *dst, float ofs, __variant val) memsetval = #389; /* 1499 Changes the 32bit value stored at the specified pointer-with-offset. */ 1500 1501 __variant*(__variant *base, float ofs) memptradd = #390; /* 1502 Perform some pointer maths. Woo. */ 1503 1504 float(string s) memstrsize = #0:memstrsize; /* 1505 strlen, except ignores utf-8 */ 1506 1507 float(entity e, float nowreadonly) entityprotection = #0:entityprotection; /* 1508 Changes the protection on the specified entity to protect it from further edits from QC. The return value is the previous setting. Note that this can be used to unprotect the world, but doing so long term is not advised as you will no longer be able to detect invalid entity references. Also, world is not networked, so results might not be seen by clients (or in other words, world.avelocity_y=64 is a bad idea). */ 1509 1510 entity(entity from, optional entity to) copyentity = #400; /* Part of DP_QC_COPYENTITY 1511 Copies all fields from one entity to another. */ 1512 1513 void(entity ent, float colours) setcolors = #401; /* 1514 Changes a player's colours. The bits 0-3 are the lower/trouser colour, bits 4-7 are the upper/shirt colours. */ 1515 1516 entity(.string field, string match, optional .entity chainfield) findchain = #402; /* Part of DP_QC_FINDCHAIN*/ 1517 entity(.float fld, float match, optional .entity chainfield) findchainfloat = #403; /* Part of DP_QC_FINDCHAINFLOAT*/ 1518 void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404; /* Part of DP_SV_EFFECT 1519 Spawns a self-animating sprite */ 1520 1521 void(vector org, vector dir, float count) te_blood = #405; /* Part of DP_TE_BLOOD*/ 1522 void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406; /* Part of _DP_TE_BLOODSHOWER*/ 1523 void(vector org, vector color) te_explosionrgb = #407; /* Part of DP_TE_EXPLOSIONRGB*/ 1524 void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408; /* Part of DP_TE_PARTICLECUBE*/ 1525 void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409; /* Part of DP_TE_PARTICLERAIN*/ 1526 void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410; /* Part of DP_TE_PARTICLESNOW*/ 1527 void(vector org, vector vel, float howmany) te_spark = #411; /* Part of DP_TE_SPARK*/ 1528 void(vector org) te_gunshotquad = #412; /* Part of _DP_TE_QUADEFFECTS1*/ 1529 void(vector org) te_spikequad = #413; /* Part of _DP_TE_QUADEFFECTS1*/ 1530 void(vector org) te_superspikequad = #414; /* Part of _DP_TE_QUADEFFECTS1*/ 1531 void(vector org) te_explosionquad = #415; /* Part of _DP_TE_QUADEFFECTS1*/ 1532 void(vector org) te_smallflash = #416; /* Part of DP_TE_SMALLFLASH*/ 1533 void(vector org, float radius, float lifetime, vector color) te_customflash = #417; /* Part of DP_TE_CUSTOMFLASH*/ 1534 void(vector org, optional float count) te_gunshot = #418; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ 1535 void(vector org) te_spike = #419; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ 1536 void(vector org) te_superspike = #420; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ 1537 void(vector org) te_explosion = #421; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ 1538 void(vector org) te_tarexplosion = #422; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ 1539 void(vector org) te_wizspike = #423; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ 1540 void(vector org) te_knightspike = #424; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ 1541 void(vector org) te_lavasplash = #425; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ 1542 void(vector org) te_teleport = #426; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ 1543 void(vector org, float color, float colorlength) te_explosion2 = #427; /* Part of DP_TE_STANDARDEFFECTBUILTINS*/ 1544 void(entity own, vector start, vector end) te_lightning1 = #428; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ 1545 void(entity own, vector start, vector end) te_lightning2 = #429; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ 1546 void(entity own, vector start, vector end) te_lightning3 = #430; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ 1547 void(entity own, vector start, vector end) te_beam = #431; /* Part of DP_TE_STANDARDEFFECTBUILTINS*/ 1548 void(vector dir) vectorvectors = #432; /* Part of DP_QC_VECTORVECTORS*/ 1549 void(vector org) te_plasmaburn = #433; /* Part of _DP_TE_PLASMABURN*/ 1550 float(entity e, float s) getsurfacenumpoints = #434; /* Part of DP_QC_GETSURFACE*/ 1551 vector(entity e, float s, float n) getsurfacepoint = #435; /* Part of DP_QC_GETSURFACE*/ 1552 vector(entity e, float s) getsurfacenormal = #436; /* Part of DP_QC_GETSURFACE*/ 1553 string(entity e, float s) getsurfacetexture = #437; /* Part of DP_QC_GETSURFACE*/ 1554 float(entity e, vector p) getsurfacenearpoint = #438; /* Part of DP_QC_GETSURFACE*/ 1555 vector(entity e, float s, vector p) getsurfaceclippedpoint = #439; /* Part of DP_QC_GETSURFACE*/ 1556 void(entity e, string s) clientcommand = #440; /* Part of KRIMZON_SV_PARSECLIENTCOMMAND*/ 1557 float(string s) tokenize = #441; /* Part of KRIMZON_SV_PARSECLIENTCOMMAND*/ 1558 string(float n) argv = #442; /* Part of KRIMZON_SV_PARSECLIENTCOMMAND*/ 1559 void(entity e, entity tagentity, string tagname) setattachment = #443; /* Part of DP_GFX_QUAKE3MODELTAGS*/ 1560 searchhandle(string pattern, float caseinsensitive, float quiet) search_begin = #444; /* Part of DP_QC_FS_SEARCH 1561 initiate a filesystem scan based upon filenames. Be sure to call search_end on the returned handle. */ 1562 1563 void(searchhandle handle) search_end = #445; /* Part of DP_QC_FS_SEARCH*/ 1564 float(searchhandle handle) search_getsize = #446; /* Part of DP_QC_FS_SEARCH 1565 Retrieves the number of files that were found. */ 1566 1567 string(searchhandle handle, float num) search_getfilename = #447; /* Part of DP_QC_FS_SEARCH 1568 Retrieves name of one of the files that was found by the initial search. */ 1569 1570 float(searchhandle handle, float num) search_getfilesize = #0:search_getfilesize; /* Part of FTE_QC_FS_SEARCH_SIZEMTIME 1571 Retrieves the size of one of the files that was found by the initial search. */ 1572 1573 string(searchhandle handle, float num) search_getfilemtime = #0:search_getfilemtime; /* Part of FTE_QC_FS_SEARCH_SIZEMTIME 1574 Retrieves modification time of one of the files. */ 1575 1576 string(string cvarname) cvar_string = #448; /* Part of DP_QC_CVAR_STRING*/ 1577 entity(entity start, .float fld, float match) findflags = #449; /* Part of DP_QC_FINDFLAGS*/ 1578 entity(.float fld, float match, optional .entity chainfield) findchainflags = #450; /* Part of DP_QC_FINDCHAINFLAGS*/ 1579 float(entity ent, string tagname) gettagindex = #451; /* Part of DP_QC_GETTAGINFO*/ 1580 vector(entity ent, float tagindex) gettaginfo = #452; /* Part of DP_QC_GETTAGINFO 1581 Obtains the current worldspace position+orientation of the bone or tag from the given entity. The return value is the world coord, v_forward, v_right, v_up are also set according to the bone/tag's orientation. */ 1582 1583 void(entity player) dropclient = #453; /* Part of DP_SV_DROPCLIENT*/ 1584 entity() spawnclient = #454; /* Part of DP_SV_BOTCLIENT*/ 1585 float(entity client) clienttype = #455; /* Part of DP_SV_BOTCLIENT*/ 1586 void(float target, string str) WriteUnterminatedString = #456; /* Part of DP_SV_WRITEUNTERMINATEDSTRING*/ 1587 void(vector org, vector vel, float howmany) te_flamejet = #457; /* Part of _DP_TE_FLAMEJET*/ 1588 entity(float entnum) edict_num = #459; /* Part of DP_QC_EDICT_NUM*/ 1589 strbuf() buf_create = #460; /* Part of DP_QC_STRINGBUFFERS*/ 1590 void(strbuf bufhandle) buf_del = #461; /* Part of DP_QC_STRINGBUFFERS*/ 1591 float(strbuf bufhandle) buf_getsize = #462; /* Part of DP_QC_STRINGBUFFERS*/ 1592 void(strbuf bufhandle_from, strbuf bufhandle_to) buf_copy = #463; /* Part of DP_QC_STRINGBUFFERS*/ 1593 void(strbuf bufhandle, float sortprefixlen, float backward) buf_sort = #464; /* Part of DP_QC_STRINGBUFFERS*/ 1594 string(strbuf bufhandle, string glue) buf_implode = #465; /* Part of DP_QC_STRINGBUFFERS*/ 1595 string(strbuf bufhandle, float string_index) bufstr_get = #466; /* Part of DP_QC_STRINGBUFFERS*/ 1596 void(strbuf bufhandle, float string_index, string str) bufstr_set = #467; /* Part of DP_QC_STRINGBUFFERS*/ 1597 float(strbuf bufhandle, string str, float ordered) bufstr_add = #468; /* Part of DP_QC_STRINGBUFFERS*/ 1598 void(strbuf bufhandle, float string_index) bufstr_free = #469; /* Part of DP_QC_STRINGBUFFERS*/ 1599 float(float s) asin = #471; /* Part of DP_QC_ASINACOSATANATAN2TAN*/ 1600 float(float c) acos = #472; /* Part of DP_QC_ASINACOSATANATAN2TAN*/ 1601 float(float t) atan = #473; /* Part of DP_QC_ASINACOSATANATAN2TAN*/ 1602 float(float c, float s) atan2 = #474; /* Part of DP_QC_ASINACOSATANATAN2TAN*/ 1603 float(float a) tan = #475; /* Part of DP_QC_ASINACOSATANATAN2TAN 1604 Forgive me father, for I have a sunbed and I'm not afraid to use it. */ 1605 1606 float(string s) strlennocol = #476; /* Part of DP_QC_STRINGCOLORFUNCTIONS 1607 Returns the number of characters in the string after any colour codes or other markup has been parsed. */ 1608 1609 string(string s) strdecolorize = #477; /* Part of DP_QC_STRINGCOLORFUNCTIONS 1610 Flattens any markup/colours, removing them from the string. */ 1611 1612 string(float uselocaltime, string format, ...) strftime = #478; /* Part of DP_QC_STRFTIME*/ 1613 float(string s, string separator1, ...) tokenizebyseparator = #479; /* Part of DP_QC_TOKENIZEBYSEPARATOR*/ 1614 string(string s) strtolower = #480; /* Part of DP_QC_STRING_CASE_FUNCTIONS*/ 1615 string(string s) strtoupper = #481; /* Part of DP_QC_STRING_CASE_FUNCTIONS*/ 1616 string(string s) cvar_defstring = #482; /* Part of DP_QC_CVAR_DEFSTRING*/ 1617 void(vector origin, string sample, float volume, float attenuation) pointsound = #483; /* Part of DP_SV_POINTSOUND*/ 1618 string(string search, string replace, string subject) strreplace = #484; /* Part of DP_QC_STRREPLACE*/ 1619 string(string search, string replace, string subject) strireplace = #485; /* Part of DP_QC_STRREPLACE*/ 1620 vector(entity e, float s, float n, float a) getsurfacepointattribute = #486; /* Part of DP_QC_GETSURFACEPOINTATTRIBUTE*/ 1621 float(float caseinsensitive, string s, ...) crc16 = #494; /* Part of DP_QC_CRC16*/ 1622 float(string name) cvar_type = #495; /* Part of DP_QC_CVAR_TYPE*/ 1623 float() numentityfields = #496; /* Part of DP_QC_ENTITYDATA 1624 Gives the number of named entity fields. Note that this is not the size of an entity, but rather just the number of unique names (ie: vectors use 4 names rather than 3). */ 1625 1626 float(string fieldname) findentityfield = #0:findentityfield; /* 1627 Find a field index by name. */ 1628 1629 typedef .__variant field_t; 1630 field_t(float fieldnum) entityfieldref = #0:entityfieldref; /* 1631 Returns a field value that can be directly used to read entity fields. Be sure to validate the type with entityfieldtype before using. */ 1632 1633 string(float fieldnum) entityfieldname = #497; /* Part of DP_QC_ENTITYDATA 1634 Retrieves the name of the given entity field. */ 1635 1636 float(float fieldnum) entityfieldtype = #498; /* Part of DP_QC_ENTITYDATA 1637 Provides information about the type of the field specified by the field num. Returns one of the EV_ values. */ 1638 1639 string(float fieldnum, entity ent) getentityfieldstring = #499; /* Part of DP_QC_ENTITYDATA*/ 1640 float(float fieldnum, entity ent, string s) putentityfieldstring = #500; /* Part of DP_QC_ENTITYDATA*/ 1641 void(float to, string s, float sz) WritePicture = #501; /* Part of DP_SV_WRITEPICTURE 1642 Encodes the named image across the network as-is adhering to some size limit. In FTE, this simply writes the string and is equivelent to writestring and sz is ignored. WritePicture should be paired with ReadPicture in csqc. */ 1643 1644 string(string filename, optional float makereferenced) whichpack = #503; /* Part of DP_QC_WHICHPACK 1645 Returns the pak file name that contains the file specified. progs/player.mdl will generally return something like 'pak0.pak'. If makereferenced is true, clients will automatically be told that the returned package should be pre-downloaded and used, even if allow_download_refpackages is not set. */ 1646 1647 string(string in) uri_escape = #510; /* Part of DP_QC_URI_ESCAPE*/ 1648 string(string in) uri_unescape = #511; /* Part of DP_QC_URI_ESCAPE*/ 1649 float(entity ent) num_for_edict = #512; 1650 #define uri_post uri_get 1651 float(string uril, float id, optional string postmimetype, optional string postdata) uri_get = #513; /* Part of DP_QC_URI_GET, DP_QC_URI_POST 1652 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 1653 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 1654 For a POST request, you will typically want the postmimetype set to application/x-www-form-urlencoded. 1655 For a GET request, omit the mime+data entirely. 1656 Consult your webserver/php/etc documentation for best-practise. */ 1657 1658 float(string str) tokenize_console = #514; /* 1659 Tokenize a string exactly as the console's tokenizer would do so. The regular tokenize builtin became bastardized for convienient string parsing, which resulted in a large disparity that can be exploited to bypass checks implemented in a naive SV_ParseClientCommand function, therefore you can use this builtin to make sure it exactly matches. */ 1660 1661 float(float idx) argv_start_index = #515; /* 1662 Returns the character index that the tokenized arg started at. */ 1663 1664 float(float idx) argv_end_index = #516; /* 1665 Returns the character index that the tokenized arg stopped at. */ 1666 1667 void(strbuf strbuf, string pattern, string antipattern) buf_cvarlist = #517; 1668 string(string cvarname) cvar_description = #518; /* 1669 Retrieves the description of a cvar, which might be useful for tooltips or help files. This may still not be useful. */ 1670 1671 float(optional float timetype) gettime = #519; 1672 void(string s) loadfromdata = #529; /* 1673 Reads a set of entities from the given string. This string should have the same format as a .ent file or a saved game. Entities will be spawned as required. If you need to see the entities that were created, you should use parseentitydata instead. */ 1674 1675 void(string s) loadfromfile = #530; /* 1676 Reads a set of entities from the named file. This file should have the same format as a .ent file or a saved game. Entities will be spawned as required. If you need to see the entities that were created, you should use parseentitydata instead. */ 1677 1678 void(float pause) setpause = #531; /* 1679 Sets whether the server should or should not be paused. This does not affect auto-paused things like when the console is down. */ 1680 1681 float(string mname) precache_vwep_model = #532; /* Part of ZQ_VWEP*/ 1682 float(float v, optional float base) log = #532; /* Part of ??MVDSV_BUILTINS 1683 Determines the logarithm of the input value according to the specified base. This can be used to calculate how much something was shifted by. */ 1684 1685 float(string filename, strbuf bufhandle) buf_loadfile = #535; /* 1686 Appends the named file into a string buffer (which must have been created in advance). The return value merely says whether the file was readable. */ 1687 1688 float(filestream filehandle, strbuf bufhandle, optional float startpos, optional float numstrings) buf_writefile = #536; /* 1689 Writes the contents of a string buffer onto the end of the supplied filehandle (you must have already used fopen). Additional optional arguments permit you to constrain the writes to a subsection of the stringbuffer. */ 1690 1691 float(optional float forcestate) physics_supported = #0:physics_supported; /* 1692 Queries whether rigid body physics is enabled or not. CSQC and SSQC may report different values. If the force argument is specified then the engine will try to activate or release physics (returning the new state, which may fail if plugins or dlls are missing). Note that restarting the physics engine is likely to result in hitches when collision trees get generated. The state may change if a plugin is disabled mid-map. */ 1693 1694 void(entity e, float physics_enabled) physics_enable = #540; /* 1695 Enable or disable the physics attached to a MOVETYPE_PHYSICS entity. Entities which have been disabled in this way will stop taking so much cpu time. */ 1696 1697 void(entity e, vector force, vector relative_ofs) physics_addforce = #541; /* 1698 Apply some impulse directional force upon a MOVETYPE_PHYSICS entity. */ 1699 1700 void(entity e, vector torque) physics_addtorque = #542; /* 1701 Apply some impulse rotational force upon a MOVETYPE_PHYSICS entity. */ 1702 1703 void(.../*, string funcname*/) callfunction = #605; /* 1704 Invokes the named function. The function name is always passed as the last parameter and must always be present. The others are passed to the named function as-is */ 1705 1706 void(filestream fh, entity e) writetofile = #606; /* 1707 Writes an entity's fields to the named frik_file file handle. */ 1708 1709 float(string s) isfunction = #607; /* 1710 Returns true if the named function exists and can be called with the callfunction builtin. */ 1711 1712 float(entity e, string s, optional float offset) parseentitydata = #613; /* 1713 Reads a single entity's fields into an already-spawned entity. s should contain field pairs like in a saved game: {"foo1" "bar" "foo2" "5"}. Returns <=0 on failure, otherwise returns the offset in the string that was read to. */ 1714 1715 string(entity e) generateentitydata = #0:generateentitydata; /* 1716 Dumps the entities fields into a string which can later be parsed with parseentitydata. */ 1717 1718 string(string dnsname, optional float defport) netaddress_resolve = #625; 1719 string(string fmt, ...) sprintf = #627; /* Part of DP_QC_SPRINTF 1720 'prints' to a formatted temp-string. Mostly acts as in C, however %d assumes floats (fteqcc has arg checking. Use it.). 1721 type conversions: l=arg is an int, h=arg is a float, and will work as a prefix for any float or int representation. 1722 float representations: d=decimal, e,E=exponent-notation, f,F=floating-point notation, g,G=terse float, c=char code, x,X=hex 1723 other representations: i=int, s=string, S=quoted and marked-up string, v=vector, p=pointer 1724 so %ld will accept an int arg, while %hi will expect a float arg. 1725 entities, fields, and functions will generally need to be printed as ints with %i. */ 1726 1727 float(entity e, float s) getsurfacenumtriangles = #628; 1728 vector(entity e, float s, float n) getsurfacetriangle = #629; 1729 string(string digest, string data, ...) digest_hex = #639; 1730 string(string digest, void *data, int length) digest_ptr = #0:digest_ptr; /* 1731 Calculates the digest of a single contiguous block of memory (including nulls) using the specified hash function. */ 1732 1733 float(string src, string dst) fcopy = #650; /* 1734 Equivelent to fopen+fread+fwrite+fclose from QC (ie: reads from $gamedir/data/ or $gamedir, but always writes to $gamedir/data/ ) */ 1735 1736 float(string src, string dst) frename = #651; /* 1737 Renames the file, returning 0 on success. Both paths are relative to the data/ subdir. */ 1738 1739 float(string fname) fremove = #652; /* 1740 Deletes the named file - path is relative to data/ subdir, like fopen's FILE_WRITE. Returns 0 on success. */ 1741 1742 float(string fname) fexists = #653; /* 1743 Use whichpack instead. Returns true if it exists inside the default writable path. */ 1744 1745 float(string path) rmtree = #654; /* 1746 Dangerous, but sandboxed to data/ */ 1747 1748 #ifdef _ACCESSORS 1749 accessor strbuf : float 1750 { 1751 inline get float asfloat[float idx] = {return stof(bufstr_get(this, idx));}; 1752 inline set float asfloat[float idx] = {bufstr_set(this, idx, ftos(value));}; 1753 get string[float] = bufstr_get; 1754 set string[float] = bufstr_set; 1755 get float length = buf_getsize; 1756 }; 1757 accessor searchhandle : float 1758 { 1759 get string[float] = search_getfilename; 1760 get float length = search_getsize; 1761 }; 1762 accessor hashtable : float 1763 { 1764 inline get vector v[string key] = {return hash_get(this, key, '0 0 0', EV_VECTOR);}; 1765 inline set vector v[string key] = {hash_add(this, key, value, HASH_REPLACE|EV_VECTOR);}; 1766 inline get string s[string key] = {return hash_get(this, key, "", EV_STRING);}; 1767 inline set string s[string key] = {hash_add(this, key, value, HASH_REPLACE|EV_STRING);}; 1768 inline get float f[string key] = {return hash_get(this, key, 0.0, EV_FLOAT);}; 1769 inline set float f[string key] = {hash_add(this, key, value, HASH_REPLACE|EV_FLOAT);}; 1770 inline get __variant[string key] = {return hash_get(this, key, __NULL__);}; 1771 inline set __variant[string key] = {hash_add(this, key, value, HASH_REPLACE);}; 1772 }; 1773 accessor infostring : string 1774 { 1775 get string[string] = infoget; 1776 inline set& string[string fld] = {this = infoadd(this, fld, value);}; 1777 }; 1778 accessor filestream : float 1779 { 1780 get string = fgets; 1781 inline set string = {fputs(this,value);}; 1782 }; 1783 #endif 1784 #pragma noref 0