#define FTE_PEXT_SETVIEW /* NQ's svc_setview works correctly even in quakeworld */
#define DP_ENT_SCALE
#define FTE_PEXT_LIGHTSTYLECOL
#define DP_ENT_ALPHA
#define FTE_PEXT_VIEW2
#define FTE_PEXT_ACURATETIMINGS
#define FTE_PEXT_SOUNDDBL
#define FTE_PEXT_FATNESS
#define DP_HALFLIFE_MAP
#define FTE_PEXT_TE_BULLET
#define FTE_PEXT_HULLSIZE
#define FTE_PEXT_MODELDBL
#define FTE_PEXT_ENTITYDBL
#define FTE_PEXT_ENTITYDBL2
#define FTE_PEXT_FLOATCOORDS
#define FTE_PEXT_VWEAP
#define FTE_PEXT_Q2BSP
#define FTE_PEXT_Q3BSP
#define DP_ENT_COLORMOD
#define FTE_HEXEN2
#define FTE_PEXT_SPAWNSTATIC
#define FTE_PEXT_CUSTOMTENTS
#define FTE_PEXT_256PACKETENTITIES
#define TEI_SHOWLMP2
#define DP_GFX_QUAKE3MODELTAGS
#define FTE_PK3DOWNLOADS
#define PEXT_CHUNKEDDOWNLOADS
#define EXT_CSQC_SHARED
#define PEXT_DPFLAGS
#define EXT_CSQC
#define BX_COLOREDTEXT
#define DP_CON_SET /* The 'set' console command exists, and can be used to create/set cvars. */
#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. */
#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. */
#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. */
#define DP_MOVETYPEBOUNCEMISSILE
#define DP_MOVETYPEFOLLOW
#define DP_QC_ASINACOSATANATAN2TAN
#define DP_QC_CHANGEPITCH
#define DP_QC_COPYENTITY
#define DP_QC_CRC16
#define DP_QC_CVAR_DEFSTRING
#define DP_QC_CVAR_STRING
#define DP_QC_CVAR_TYPE
#define DP_QC_EDICT_NUM
#define DP_QC_ENTITYDATA
#define DP_QC_ETOS
#define DP_QC_FINDCHAIN
#define DP_QC_FINDCHAINFLOAT
#define DP_QC_FINDFLAGS
#define DP_QC_FINDCHAINFLAGS
#define DP_QC_FINDFLOAT
#define DP_QC_FS_SEARCH
#define DP_QC_GETSURFACE
#define DP_QC_GETSURFACEPOINTATTRIBUTE
#define DP_QC_MINMAXBOUND
#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). */
#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. */
#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. */
#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. */
#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...) */
#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. */
#define FTE_CSQC_ALTCONSOLES /* The engine tracks multiple consoles. These may or may not be directly visible to the user. */
#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. */
#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. */
#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. */
#define FTE_CSQC_RENDERTARGETS /* VF_RT_DESTCOLOUR exists and can be used to redirect any rendering to a texture instead of the screen. */
#define FTE_ENT_SKIN_CONTENTS /* self.skin = CONTENTS_WATER; makes a brush entity into water. use -16 for a ladder. */
#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. */
#define FTE_FORCEINFOKEY /* Provides an easy way to change a user's userinfo from the server. */
#define FTE_GFX_QUAKE3SHADERS /* specifies that the engine has full support for vanilla quake3 shaders */
#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. */
#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. */
#define FTE_MULTITHREADED /* Faux multithreading, allowing multiple contexts to run in sequence. */
#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. */
#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. */
#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. */
#define FTE_PART_NAMESPACE_EFFECTINFO /* Specifies that effectinfo.bar can load effects from effectinfo.txt for DP compatibility. */
#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. */
#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, it will be emulated using regular draws - this at least still avoids conflicting cursors. */
#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. */
#define FTE_QUAKE2_CLIENT /* This engine is able to act as a quake2 client */
#define FTE_QUAKE2_SERVER /* This engine is able to act as a quake2 server */
#define FTE_QUAKE3_CLIENT /* This engine is able to act as a quake3 client */
#define FTE_QUAKE3_SERVER /* This engine is able to act as a quake3 server */
#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 */
#define FTE_SQL /* Provides sql* builtins which can be used for sql database access */
#define FTE_SQL_SQLITE /* SQL functionality is able to utilise sqlite databases */
#define FTE_STRINGS /* Extra builtins (and additional behaviour) to make string manipulation easier */
#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. */
#define FTE_TE_STANDARDEFFECTBUILTINS /* Provides builtins to replace writebytes, with a QW compatible twist. */
#define FTE_TERRAIN_MAP /* This engine supports .hmp files, as well as terrain embedded within bsp files. */
#define FTE_RAW_MAP /* This engine supports directly loading .map files, as well as realtime editing of the various brushes. */
#define KRIMZON_SV_PARSECLIENTCOMMAND /* SSQC's SV_ParseClientCommand function is able to handle client 'cmd' commands. The tokenizing parts also work in csqc. */
entity other; /* Valid in touch functions, this is the entity that we touched. */
entity world; /* The null entity. Hurrah. Readonly after map spawn time. */
float time; /* The current game time. Stops when paused. */
float cltime; /* A local timer that ticks relative to local time regardless of latency, packetloss, or pause. */
float frametime; /* The time since the last physics/render/input frame. */
float player_localentnum; /* This is entity number the player is seeing from/spectating, or the player themself, can change mid-map. */
float player_localnum; /* The 0-based player index, valid for getplayerkeyvalue calls. */
float maxclients; /* Maximum number of player slots on the server. */
float clientcommandframe; /* This is the input-frame sequence. frames < clientcommandframe have been sent to the server. frame==clientcommandframe is still being generated and can still change. */
float servercommandframe; /* This is the input-frame that was last acknowledged by the server. Input frames greater than this should be applied to the player's entity. */
.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. */
.vector absmin; /* Set by the engine when the entity is relinked (by setorigin, setsize, or setmodel). This is in world coordinates. */
.vector absmax; /* Set by the engine when the entity is relinked (by setorigin, setsize, or setmodel). This is in world coordinates. */
.float entnum; /* The entity number as its known on the server. */
.float drawmask; /* Acts as a filter in the addentities call. */
.float() predraw; /* Called by addentities after the filter and before the entity is actually drawn. Do your interpolation and animation in here. Should return one of the PREDRAW_* constants. */
.float movetype; /* Describes how the entity moves. One of the MOVETYPE_ constants. */
.float solid; /* Describes whether the entity is solid or not, and any special properties infered by that. Must be one of the SOLID_ constants */
.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. */
.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. */
.vector velocity; /* The direction and speed that the entity is moving in world space. */
.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. */
.vector avelocity; /* The amount the entity's angles change by each frame. Note that this is direct eular angles, and thus the angular change is non-linear and often just looks buggy. */
.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. */
.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. */
.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. */
.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. */
.float effects; /* Lots of random flags that change random effects. See EF_* constants. */
.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. */
.vector maxs; /* like mins, but in the other direction. */
.vector size; /* maxs-mins. Updated when the entity is relinked (by setorigin, setsize, setmodel) */
.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. */
.float hull; /* Overrides the hull used by the entity for walkmove/movetogoal and not traceline/tracebox. */
.entity movechain; /* This is a linked list of entities which will be moved whenever this entity moves, logically they are attached to this entity. */
.void() chainmoved; /* Called when the entity is moved as a result of being part of another entity's .movechain */
.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. */
.float dimension_solid; /* This is the bitmask of dimensions which the entity is solid within. */
.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. */
.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. */
.float fatness; /* How many QuakeUnits to push the entity's verticies along their normals by. */
.float alpha; /* The transparency of the entity. 1 means opaque, 0.0001 means virtually invisible. 0 is remapped to 1, for compatibility. */
.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. */
.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. */
.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. */
.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. */
.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. */
.vector color; /* This affects the colour of realtime lights that were enabled via the pflags field. */
.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). */
.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. */
void(float reqid, float responsecode, string resourcebody) URI_Get_Callback; /* Called as an eventual result of the uri_get builtin. */
void(float apilevel, string enginename, float engineversion) CSQC_Init; /* Called at startup. enginename and engineversion are arbitary hints and can take any form. enginename should be consistant between revisions, but this cannot truely be relied upon. */
void() CSQC_WorldLoaded; /* Called after model+sound precaches have been executed. Gives a chance for the qc to read the entity lump from the bsp. */
void() CSQC_Shutdown; /* Specifies that the csqc is going down. Save your persistant settings here. */
void(float vwidth, float vheight, float notmenu) CSQC_UpdateView; /* Called every single video frame. The CSQC is responsible for rendering the entire screen. */
void(float vwidth, float vheight, float notmenu) CSQC_UpdateViewLoading; /* Alternative to CSQC_UpdateView, called when the engine thinks there should be a loading screen. If present, will inhibit the engine's normal loading screen, deferring to qc to draw it. */
void(string msg) CSQC_Parse_StuffCmd; /* Gives the CSQC a chance to intercept stuffcmds. Use the tokenize builtin to parse the message. Unrecognised commands would normally be localcmded, but its probably better to drop unrecognised stuffcmds completely. */
float(string msg) CSQC_Parse_CenterPrint; /* Gives the CSQC a chance to intercept centerprints. Return true if you wish the engine to otherwise ignore the centerprint. */
float(float save, float take, vector inflictororg) CSQC_Parse_Damage; /* Called as a result of player.dmg_save or player.dmg_take being set on the server.
Return true to completely inhibit the engine's colour shift and damage rolls, allowing you to do your own thing.
You can use punch_roll += (normalize(inflictororg-player.origin)*v_right)*(take+save)*autocvar_v_kickroll; as a modifier for the roll angle should the player be hit from the side, and slowly fade it away over time. */
void(string printmsg, float printlvl) CSQC_Parse_Print; /* Gives the CSQC a chance to intercept sprint/bprint builtin calls. CSQC should filter by the client's current msg setting and then pass the message on to the print command, or handle them itself. */
void() CSQC_Parse_Event; /* Called when the client receives an SVC_CGAMEPACKET. The csqc should read the data or call the error builtin if it does not recognise the message. */
float(float evtype, float scanx, float chary, float devid) CSQC_InputEvent; /* Called whenever a key is pressed, the mouse is moved, etc. evtype will be one of the IE_* constants. The other arguments vary depending on the evtype. Key presses are not guarenteed to have both scan and unichar values set at the same time. */
__used void() CSQC_Input_Frame; /* Called just before each time clientcommandframe is updated. You can edit the input_* globals in order to apply your own player inputs within csqc, which may allow you a convienient way to pass certain info to ssqc. */
void(string rendererdescription) CSQC_RendererRestarted; /* Called by the engine after the video was restarted. This serves to notify the CSQC that any render targets that it may have cached were purged, and will need to be regenerated. */
float(string cmd) CSQC_ConsoleCommand; /* Called if the user uses any console command registed via registercommand. */
float(string text, string info) CSQC_ConsoleLink; /* Called if the user clicks a ^[text\infokey\infovalue^] link. Use infoget to read/check each supported key. Return true if you wish the engine to not attempt to handle the link itself. */
float(string resname, string restype) CSQC_LoadResource; /* Called each time some resource is being loaded. CSQC can invoke various draw calls to provide a loading screen, until WorldLoaded is called. */
float() CSQC_Parse_TempEntity; /* Please don't use this. Use CSQC_Parse_Event and multicasts instead. */
void(string cmdtext) GameCommand;
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). */
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. */
__used var float physics_mode = 2; /* 0: original csqc - physics are not run
#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). */
#define SOLID_BSP 4 /* Does not collide against other SOLID_BSP entities. Normally paired with MOVETYPE_PUSH. */
#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. */
#define GE_MAXENTS -1 /* Valid for getentity, ignores the entity argument. Returns the maximum number of entities which may be valid, to avoid having to poll 65k when only 100 are used. */
#define GE_ACTIVE 0 /* Valid for getentity. Returns whether this entity is known to the client or not. */
#define GE_ORIGIN 1 /* Valid for getentity. Returns the interpolated .origin. */
#define GE_FORWARD 2 /* Valid for getentity. Returns the interpolated forward vector. */
#define GE_RIGHT 3 /* Valid for getentity. Returns the entity's right vector. */
#define GE_UP 4 /* Valid for getentity. Returns the entity's up vector. */
#define GE_SCALE 5 /* Valid for getentity. Returns the entity .scale. */
#define GE_ORIGINANDVECTORS 6 /* Valid for getentity. Returns interpolated .origin, but also sets v_forward, v_right, and v_up accordingly. Use vectoangles(v_forward,v_up) to determine the angles. */
#define GE_ALPHA 7 /* Valid for getentity. Returns the entity alpha. */
#define GE_COLORMOD 8 /* Valid for getentity. Returns the colormod vector. */
#define GE_PANTSCOLOR 9 /* Valid for getentity. Returns the entity's lower color (from .colormap), as a palette range value. */
#define GE_SHIRTCOLOR 10 /* Valid for getentity. Returns the entity's lower color (from .colormap), as a palette range value. */
#define GE_SKIN 11 /* Valid for getentity. Returns the entity's .skin index. */
#define GE_MINS 12 /* Valid for getentity. Guesses the entity's .min vector. */
#define GE_MAXS 13 /* Valid for getentity. Guesses the entity's .max vector. */
#define GE_ABSMIN 14 /* Valid for getentity. Guesses the entity's .absmin vector. */
#define GE_ABSMAX 15 /* Valid for getentity. Guesses the entity's .absmax vector. */
const int CONTENTBIT_Q2LADDER = 0x20000000; /* Content bit specific to q2bsp */
const int CONTENTBIT_SKY = 0x80000000i;
const int CONTENTBITS_POINTSOLID = CONTENTBIT_SOLID|0x00000002|CONTENTBIT_BODY; /* Bits that traceline would normally consider solid */
const int CONTENTBITS_BOXSOLID = CONTENTBIT_SOLID|0x00000002|CONTENTBIT_BODY|CONTENTBIT_PLAYERCLIP; /* Bits that tracebox would normally consider solid */
const int CONTENTBITS_FLUID = CONTENTBIT_WATER|CONTENTBIT_SLIME|CONTENTBIT_LAVA|CONTENTBIT_SKY;
#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. */
#define SOUNDFLAG_ABSVOLUME 16 /* The sample's volume is not scaled by the volume cvar. Use with caution */
#define SOUNDFLAG_FORCELOOP 2 /* The sound will restart once it reaches the end of the sample. */
#define SOUNDFLAG_NOSPACIALISE 4 /* The different audio channels are played at the same volume regardless of which way the player is facing, without needing to use 0 attenuation. */
#define SOUNDFLAG_NOREVERB 32 /* Disables the use of underwater/reverb effects on this sound effect. */
#define SOUNDFLAG_FOLLOW 64 /* The sound's origin will updated to follow the emitting entity. */
#define INFOKEY_P_TOPCOLOR_RGB "topcolor_rgb" /* The player's upper/shirt colour as an rgb value in a format usable with stov. */
#define INFOKEY_P_BOTTOMCOLOR_RGB "bottomcolor_rgb" /* The player's lower/pants/trouser colour as an rgb value in a format usable with stov. */
#define INFOKEY_P_MUTED "ignored" /* 0: we can see the result of the player's say/say_team commands. 1: we see no say/say_team messages from this player. Use the ignore command to toggle this value. */
#define INFOKEY_P_VOIP_MUTED "vignored" /* 0: we can hear this player when they speak (assuming voip is generally enabled). 1: we ignore everything this player says. Use cl_voip_mute to change the values. */
#define INFOKEY_P_ENTERTIME "entertime" /* Reads the timestamp at which the player entered the game, in terms of csqc's time global. */
#define INFOKEY_P_FRAGS "frags" /* Reads a player's frag count. */
#define INFOKEY_P_PACKETLOSS "pl" /* Reads a player's packetloss, as a percentage. */
#define INFOKEY_P_VOIPSPEAKING "voipspeaking" /* Boolean value that says whether the given player is currently sending voice information. */
#define INFOKEY_P_VOIPLOUDNESS "voiploudness" /* Only valid for the local player. Gives a value between 0 and 1 to indicate to the user how loud their mic is. */
#define SERVERKEY_IP "ip" /* The address of the server we connected to. */
#define SERVERKEY_SERVERNAME "servername" /* The hostname that was last passed to the connect command. */
#define SERVERKEY_CONSTATE "constate" /* The current connection state. Will be set to one of: disconnected (menu-only mode), active (gamestate received and loaded), connecting(connecting, downloading, or precaching content, aka: loading screen). */
#define SERVERKEY_PAUSESTATE "pausestate" /* 1 if the server claimed to be paused. 0 otherwise */
#define SERVERKEY_DLSTATE "dlstate" /* The progress of any current downloads. Empty string if no download is active, otherwise a tokenizable string containing this info:
#define MOVE_NOMONSTERS 1 /* The trace will ignore all non-solid_bsp entities. */
#define MOVE_MISSILE 2 /* The trace will use a bbox size of +/- 15 against entities with FL_MONSTER set. */
#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). */
#define MOVE_TRIGGERS 16 /* This trace type will impact only triggers. It will ignore non-solid entities. */
#define MOVE_EVERYTHING 32 /* This type of trace will hit solids and triggers alike. Even non-solid entities. */
#define MOVE_ENTCHAIN 128 /* Returns a list of entities impacted via the trace_ent.chain field */
#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. */
#define RESTYPE_PIC 3 /* precache_pic. Status results are an amalgomation of the textures used by the named shader. */
#define RESTYPE_SKIN 4 /* setcustomskin */
#define RESTYPE_TEXTURE 5 /* Individual textures within shaders. These are not directly usable, but may be named as part of a skin file, or a shader. */
#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. */
#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. */
#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. */
#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. */
#define RESSTATE_LOADED 4 /* Resources in this state are finally usable, everything will work okay. Hurrah. Queries will not stall the engine. */
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). */
#define HASH_REPLACE 256 /* Used with hash_add. Attempts to remove the old value instead of adding two values for a single key. */
#define STAT_ITEMS 15 /* self.items | (self.items2<<23). In order to decode this stat properly, you need to use getstatbits(STAT_ITEMS,0,23) to read self.items, and getstatbits(STAT_ITEMS,23,11) to read self.items2 or getstatbits(STAT_ITEMS,28,4) to read the visible part of serverflags, whichever is applicable. */
#define VF_DRAWWORLD 19 /* boolean. If set to 1, the engine will draw the world and static/persistant rtlights. If 0, the world will be skipped and everything will be fullbright. */
#define VF_DRAWENGINESBAR 20 /* boolean. If set to 1, the sbar will be drawn, and viewsize will be honoured automatically. */
#define VF_DRAWCROSSHAIR 21 /* boolean. If set to 1, the engine will draw its default crosshair. */
#define VF_PERSPECTIVE 200 /* 1: regular rendering. Fov specifies the angle. 0: isometric-style. Fov specifies the number of Quake Units each side of the viewport, and mindist restrictions are removed, pvs culling should be disabled. */
#define VF_AFOV 203 /* Aproximate fov. Matches the 'fov' cvar. The engine handles the aspect ratio for you. */
#define VF_SCREENVSIZE 204 /* Provides a reliable way to retrieve the current virtual screen size (even if the screen is automatically scaled to retain aspect). */
#define VF_SCREENPSIZE 205 /* Provides a reliable way to retrieve the current physical screen size (cvars need vid_restart for them to take effect). */
#define VF_VIEWENTITY 206 /* Changes the RF_EXTERNALMODEL flag on entities to match the new selection, and removes entities flaged with RF_VIEWENTITY. Requires cunning use of .entnum and typically requires calling addentities(MASK_VIEWMODEL) too. */
#define VF_RT_DESTCOLOUR 212 /* The texture name to write colour info into, this includes both 3d and 2d drawing.
Additional arguments are: format (rgba8=1,rgba16f=2,rgba32f=3), sizexy.
Written to by both 3d and 2d rendering.
Note that any rendertarget textures may be destroyed on video mode changes or so. Shaders can name render targets by prefixing texture names with '$rt:', or $sourcecolour. */
#define VF_RT_SOURCECOLOUR 209 /* The texture name to use with shaders that specify a $sourcecolour map. */
#define VF_RT_DEPTH 210 /* The texture name to use as a depth buffer. Also used for shaders that specify $sourcedepth. 1-based. Additional arguments are: format (16bit=4,24bit=5,32bit=6), sizexy. */
#define VF_RT_RIPPLE 211 /* The texture name to use as a ripplemap (target for shaders with 'sort ripple'). Also used for shaders that specify $ripplemap. 1-based. Additional arguments are: format, sizexy. */
#define VF_ENVMAP 220 /* The cubemap name to use as a fallback for $reflectcube, if a shader was unable to load one. Note that this doesn't automatically change shader permutations or anything. */
#define RF_VIEWMODEL 1 /* Specifies that the entity is a view model, and that its origin is relative to the current view position. These entities are also subject to viewweapon bob. */
#define RF_EXTERNALMODEL 2 /* Specifies that this entity should be displayed in mirrors (and may still cast shadows), but will not otherwise be visible. */
#define RF_DEPTHHACK 4 /* Hacks the depth values such that the entity uses depth values as if it were closer to the screen. This is useful when combined with viewmodels to avoid weapons poking in to walls. */
#define RF_ADDITIVE 8 /* Shaders from this entity will temporarily be hacked to use an additive blend mode instead of their normal blend mode. */
#define RF_USEAXIS 16 /* The entity will be oriented according to the current v_forward+v_right+v_up vector values instead of the entity's .angles field. */
#define RF_NOSHADOW 32 /* This entity will not cast shadows. Often useful on view models. */
#define RF_FRAMETIMESARESTARTTIMES 64 /* Specifies that the frame1time, frame2time field are timestamps (denoting the start of the animation) rather than time into the animation. */
#define IE_KEYDOWN 0 /* Specifies that a key was pressed. Second argument is the scan code. Third argument is the unicode (printable) char value. Fourth argument denotes which keyboard(or mouse, if its a mouse 'scan' key) the event came from. Note that some systems may completely separate scan codes and unicode values, with a 0 value for the unspecified argument. */
#define IE_KEYUP 1 /* Specifies that a key was released. Arguments are the same as IE_KEYDOWN. On some systems, this may be fired instantly after IE_KEYDOWN was fired. */
#define IE_MOUSEDELTA 2 /* Specifies that a mouse was moved (touch screens and tablets typically give IE_MOUSEABS events instead, use _windowed_mouse 0 to test code to cope with either). Second argument is the X displacement, third argument is the Y displacement. Fourth argument is which mouse or touch event triggered the event. */
#define IE_MOUSEABS 3 /* Specifies that a mouse cursor or touch event was moved to a specific location relative to the virtual screen space. Second argument is the new X position, third argument is the new Y position. Fourth argument is which mouse or touch event triggered the event. */
#define IE_FOCUS 5 /* Specifies that input focus was given. parama says mouse focus, paramb says keyboard focus. If either are -1, then it is unchanged. */
#define IE_JOYAXIS 6 /* Specifies that what value a joystick/controller axis currently specifies. x=axis, y=value. Will be called multiple times, once for each axis of each active controller. */
#define FILE_READ 0 /* The file may be read via fgets to read a single line at a time. */
#define FILE_APPEND 1 /* Like FILE_WRITE, but writing starts at the end of the file. */
#define FILE_WRITE 2 /* fputs will be used to write to the file. */
#define FILE_READNL 4 /* Like FILE_READ, except newlines are not special. fgets reads the entire file into a tempstring. */
#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. */
#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. */
#define MASK_ENGINE 1 /* Valid as an argument for addentities. If specified, all non-csqc entities will be added to the scene. */
#define MASK_VIEWMODEL 2 /* Valid as an argument for addentities. If specified, the regular engine viewmodel will be added to the scene. */
#define PREDRAW_AUTOADD 0 /* Valid as a return value from the predraw function. Returning this will cause the engine to automatically invoke addentity(self) for you. */
#define PREDRAW_NEXT 1 /* Valid as a return value from the predraw function. Returning this will simply move on to the next entity without the autoadd behaviour, so can be used for particle/invisible/special entites, or entities that were explicitly drawn with addentity. */
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 */
void(entity e, string m) setmodel = #3; /*
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. */
void(entity e, vector min, vector max) setsize = #4; /*
Sets the e's mins and maxs fields. Also relinks collision state, which sets absmin and absmax too. */
float() random = #7; /*
Returns a random value between 0 and 1. Be warned, this builtin can return 1 in most engines, which can break arrays. */
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. */
Adds a brand new entity into the world! Hurrah, you're now a parent! */
void(entity e) remove = #15; /*
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 two seconds, the entity will be reused, in the interim you can unfortunatly still read its fields to see if the reference is no longer valid. */
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.
There are no side effects beyond the trace_* globals being written.
flags&MOVE_NOMONSTERS will not impact on non-bsp entities.
flags&MOVE_MISSILE will impact with increased size.
flags&MOVE_HITMODEL will impact upon model meshes, instead of their bounding boxes.
flags&MOVE_TRIGGERS will also stop on triggers
flags&MOVE_EVERYTHING will stop if it hits anything, even non-solid entities.
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. */
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. */
string(string s) precache_sound = #19; /*
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. */
string(string s) precache_model = #20; /*
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.
Modelindicies precached in SSQC will always be positive. CSQC precaches will be negative if they are not also on the server. */
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. */
void(string s, ...) dprint = #25; /*
NQ: Prints the given message on the server's console, but only if the developer cvar is set. Arguments will be concatenated into a single message. */
void(string s, ...) dprint = #25; /*
QW: Unconditionally prints the given message on the server's console. Arguments will be concatenated into a single message. */
string(float val) ftos = #26; /*
Returns a tempstring containing a representation of the given float. Precision depends upon engine. */
string(vector val) vtos = #27; /*
Returns a tempstring containing a representation of the given vector. Precision depends upon engine. */
void() coredump = #28; /*
Writes out a coredump. This contains stack, globals, and field info for all ents. This can be handy for debugging. */
void() traceon = #29; /*
Enables tracing. This may be spammy, slow, and stuff. Set debugger 1 in order to use fte's qc debugger. */
void() traceoff = #30; /*
Disables tracing again. */
void(entity e) eprint = #31; /*
Debugging builtin that prints all fields of the given entity to the console. */
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. */
Rounds the given float up or down to the closest integeral value. X.5 rounds away from 0 */
float(float) floor = #37; /*
Rounds the given float downwards, even when negative. */
float(float) ceil = #38; /*
Rounds the given float upwards, even when negative. */
float(entity ent) checkbottom = #40; /*
Expensive checks to ensure that the entity is actually sitting on something solid, returns true if it is. */
float(vector pos) pointcontents = #41; /*
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. */
float(float) fabs = #43; /*
Removes the sign of the float, making it positive if it is negative. */
float(string) cvar = #45; /*
Returns the numeric value of the named cvar */
void(string, ...) localcmd = #46; /*
Adds the string to the console command queue. Commands will not be executed immediately, but rather at the start of the following frame. */
entity(entity) nextent = #47; /*
Returns the following entity. Skips over removed entities. Returns world when passed the last valid entity. */
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. */
This builtin does nothing. It was used only as a hint for pak generation. */
void(entity e) makestatic = #69; /*
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. */
void(vector start, vector mins, vector maxs, vector end, float nomonsters, entity ent) tracebox = #90; /* Part of DP_QC_TRACEBOX
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. */
vector() randomvec = #91; /* Part of DP_QC_RANDOMVEC
Returns a vector with random values. Each axis is independantly a value between -1 and 1 inclusive. */
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.
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.
In engines that support it, you will generally find the autocvar feature easier and more efficient to use. */
float(float a, float b, ...) min = #94; /* Part of DP_QC_MINMAXBOUND
Returns the lowest value of its arguments. */
float(float a, float b, ...) max = #95; /* Part of DP_QC_MINMAXBOUND
Returns the highest value of its arguments. */
float(float minimum, float val, float maximum) bound = #96; /* Part of DP_QC_MINMAXBOUND
Returns val, unless minimum is higher, or maximum is less. */
entity(entity start, .__variant fld, __variant match) findfloat = #98; /* Part of DP_QC_FINDFLOAT
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.
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. */
string(filestream fhandle) fgets = #112; /* Part of FRIK_FILE
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 */
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. */
int(filestream fhandle, void *ptr, int size) fread = #0:fread; /*
Reads binary data out of the file. Returns truncated lengths if the read exceeds the length of the file. */
int(filestream fhandle, void *ptr, int size) fwrite = #0:fwrite; /*
Writes binary data out of the file. */
#define ftell fseek //c compat
int(filestream fhandle, optional int newoffset) fseek = #0:fseek; /*
Changes the current position of the file, if specified. Returns prior position, in bytes. */
int(filestream fhandle, optional int newsize) fsize = #0:fsize; /*
Reports the total size of the file, in bytes. Can also be used to truncate/extend the file */
string(string s, ...) strzone = #118; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS
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. */
void(string s) strunzone = #119; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS
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. */
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. */
void(optional __variant ret) abort = #211; /* Part of FTE_MULTITHREADED
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. */
float(string s1, string sub, optional float startidx) strstrofs = #221; /* Part of FTE_STRINGS
Returns the 0-based offset of sub within the s1 string, or -1 if sub is not in s1.
If startidx is set, this builtin will ignore matches before that 0-based offset. */
float(string str, float index) str2chr = #222; /* Part of FTE_STRINGS
Retrieves the character value at offset 'index'. */
string(float chr, ...) chr2str = #223; /* Part of FTE_STRINGS
The input floats are considered character values, and are concatenated. */
string(float ccase, float redalpha, float redchars, string str, ...) strconv = #224; /* Part of FTE_STRINGS
Converts quake chars in the input string amongst different representations.
ccase specifies the new case for letters.
0: not changed.
1: forced to lower case.
2: forced to upper case.
redalpha and redchars switch between colour ranges.
0: no change.
1: Forced white.
2: Forced red.
3: Forced gold(low) (numbers only).
4: Forced gold (high) (numbers only).
5+6: Forced to white and red alternately.
You should not use this builtin in combination with UTF-8. */
string(float pad, string str1, ...) strpad = #225; /* Part of FTE_STRINGS
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. */
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. */
Reads a named value from an infostring. The returned value is a tempstring */
#define strcmp strncmp
float(string s1, string s2, optional float len, optional float s1ofs, optional float s2ofs) strncmp = #228; /* Part of FTE_STRINGS
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.
Returns 0 if the two strings are equal, a negative value if s1 appears numerically lower, and positive if s1 appears numerically higher. */
float(string s1, string s2) strcasecmp = #229; /* Part of FTE_STRINGS
Compares the two strings without case sensitivity.
Returns 0 if they are equal. The sign of the return value may be significant, but should not be depended upon. */
float(string s1, string s2, float len, optional float s1ofs, optional float s2ofs) strncasecmp = #230; /* Part of FTE_STRINGS
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.
Returns 0 if they are equal. The sign of the return value may be significant, but should not be depended upon. */
float(string shadername, optional string defaultshader, ...) shaderforname = #238; /* Part of FTE_FORCESHADER
Caches the named shader and returns a handle to it.
If the shader could not be loaded from disk (missing file or ruleset_allow_shaders 0), it will be created from the 'defaultshader' string if specified, or a 'skin shader' default will be used.
defaultshader if not empty should include the outer {} that you would ordinarily find in a shader. */
Animation data (according to the entity's frame info) is pulled from the specified model and blended into the specified skeletal object.
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. */
float(float skel) skel_get_numbones = #265; /* Part of FTE_CSQC_SKELETONOBJECTS
Retrives the number of bones in the model. The valid range is 1<=bone<=numbones. */
string(float skel, float bonenum) skel_get_bonename = #266; /* Part of FTE_CSQC_SKELETONOBJECTS
Retrieves the name of the specified bone. Mostly only for debugging. */
float(float skel, float bonenum) skel_get_boneparent = #267; /* Part of FTE_CSQC_SKELETONOBJECTS
Retrieves which bone this bone's position is relative to. Bone 0 refers to the entity's position rather than an actual bone */
float(float skel, string tagname) skel_find_bone = #268; /* Part of FTE_CSQC_SKELETONOBJECTS
Finds a bone by its name, from the model that was used to create the skeletal object. */
vector(float skel, float bonenum) skel_get_bonerel = #269; /* Part of FTE_CSQC_SKELETONOBJECTS
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. */
vector(float skel, float bonenum) skel_get_boneabs = #270; /* Part of FTE_CSQC_SKELETONOBJECTS
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.
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. */
void(float skeldst, float skelsrc, float startbone, float entbone) skel_copybones = #274; /* Part of FTE_CSQC_SKELETONOBJECTS
Copy bone data from one skeleton directly into another. */
void(float skel) skel_delete = #275; /* Part of FTE_CSQC_SKELETONOBJECTS
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. */
float(float modidx, string framename) frameforname = #276; /* Part of FTE_CSQC_SKELETONOBJECTS
Looks up a framegroup from a model by name, avoiding the need for hardcoding. Returns -1 on error. */
float(float modidx, float framenum) frameduration = #277; /* Part of FTE_CSQC_SKELETONOBJECTS
Retrieves the duration (in seconds) of the specified framegroup. */
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. */
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). */
int(float modelid, vector *planes, float *dists, int numplanes, int *out_brushes, int *out_faces, int maxresults) brush_findinvolume = #0:brush_findinvolume; /*
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. */
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. */
Updates the skeletal object attached to the entity according to its origin and other properties.
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.
If dollcmd is not set, the ragdoll will update (this should be done each frame).
If the doll is updated without having a valid doll, the model's default .doll will be instanciated.
commands:
doll foo.doll : sets up the entity to use the named doll file
dollstring TEXT : uses the doll file directly embedded within qc, with that extra prefix.
cleardoll : uninstanciates the doll without destroying the skeletal object.
animate 0.5 : specifies the strength of the ragdoll as a whole
animatebody somebody 0.5 : specifies the strength of the ragdoll on a specific body (0 will disable ragdoll animations on that body).
enablejoint somejoint 1 : enables (or disables) a joint. Disabling joints will allow the doll to shatter. */
float*(float skel) skel_mmap = #282; /*
Map the bones in VM memory. They can then be accessed via pointers. Each bone is 12 floats, the four vectors interleaved (sadly). */
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. */
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. */
hashtable(float tabsize, optional float defaulttype) hash_createtab = #287; /* Part of FTE_QC_HASHTABLES
Creates a hash table object with at least 'tabsize' slots. hash table with index 0 is a game-persistant table and will NEVER be returned by this builtin (except as an error return). */
Adds the given key with the given value to the table.
If flags&HASH_REPLACE, the old value will be removed, if not set then multiple values may be added for a single key, they won't overwrite.
The type argument describes how the value should be stored and saved to files. While you can claim that all variables are just vectors, being more precise can result in less issues with tempstrings or saved games. */
looks up the specified key name in the hash table. returns deflt if key was not found. If stringsonly=1, the return value will be in the form of a tempstring, otherwise it'll be the original value argument exactly as it was. If requiretype is specified, then values not of the specified type will be ignored. Hurrah for multiple types with the same name. */
void(string texturename, float flags, void *verts, int *indexes, int numindexes) addtrisoup_1 = #0:addtrisoup_1; /*
Adds the specified trisoup into the scene as additional geometry. This permits caching geometry to reduce builtin spam. Indexes are a triangle list (so eg quads will need 6 indicies to form two triangles). NOTE: this is not going to be a speedup over polygons if you're still generating lots of new data every frame. */
Allows you to override default view properties like viewport, fov, and whether the engine hud will be drawn. Different VF_ values have slightly different arguments, some are vectors, some floats. */
void() renderscene = #304; /*
Draws all entities, polygons, and particles on the rentity list (which were added via addentities or addentity), using the various view properties set via setproperty. There is no ordering dependancy.
The scene must generally be cleared again before more entities are added, as entities will persist even over to the next frame.
You may call this builtin multiple times per frame, but should only be called from CSQC_UpdateView. */
Specifies a polygon vertex with its various properties. */
void() R_EndPolygon = #308; /*
Ends the current polygon. At least 3 verticies must have been specified. You do not need to call beginpolygon if you wish to draw another polygon with the same shader. */
Retrieve a currently-set (typically view) property, allowing you to read the current viewport or other things. Due to cheat protection, certain values may be unretrievable. */
vector (vector v) unproject = #310; /*
Transform a 2d screen-space point (with depth) into a 3d world-space point, according the various origin+angle+fov etc settings set via setproperty. */
vector (vector v) project = #311; /*
Transform a 3d world-space point into a 2d screen-space point, according the various origin+angle+fov etc settings set via setproperty. */
void(string imagename, int width, int height, int *pixeldata) r_uploadimage = #0:r_uploadimage; /*
Updates a texture with the specified rgba data. Will be created if needed. */
int*(string filename, __out int width, __out int height) r_readimage = #0:r_readimage; /*
Reads and decodes an image from disk, providing raw pixel data. Returns __NULL__ if the image could not be read for any reason. Use memfree to free the data once you're done with it. */
Returns the dimensions of the named image. Images specified with .lmp should give the original .lmp's dimensions even if texture replacements use a different resolution. */
void(string name) freepic = #319; /*
Tells the engine that the image is no longer needed. The image will appear to be new the next time its needed. */
Draws an shader within the given 2d screen box. Software engines may omit support for rgb+alpha, but must support rescaling, and must clip to the screen without crashing. */
Specifies a 2d clipping region (aka: scissor test). 2d draw calls will all be clipped to this 2d box, the area outside will not be modified by any 2d draw call (even 2d polygons). */
void(void) drawresetcliparea = #325; /*
Reverts the scissor/clip area to the whole screen. */
Calculates the width of the screen in virtual pixels. If usecolours is 1, markup that does not affect the string width will be ignored. Will always be decoded as UTF-8 if UTF-8 is globally enabled.
If the char size is not specified, '8 8 0' will be assumed. */
Overcomplicated draw function for over complicated people. Positions follow drawrotpic, while texture coords follow drawsubpic. Due to argument count limitations in builtins, the alpha value and angles are combined into separate fields of a vector (tip: use fteqcc's [alpha, angle] feature. */
Older engines may use 4 consecutive integer stats, with a limit of 15 chars (yes, really. 15.), but FTE QuakeWorld uses a separate namespace for string stats and has a much higher length limit. */
Retrieves a specific player's stat, matching the type specified on the server. This builtin is primarily intended for mvd playback where ALL players are known. For EV_ENTITY, world will be returned if the entity is not in the pvs, use type-punning with EV_INTEGER to get the entity number if you just want to see if its set. STAT_ITEMS should be queried as an EV_INTEGER on account of runes and items2 being packed into the upper bits. */
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.
Different engines will have different particle systems, this specifies the QC API only. */
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. */
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. */
void(string s, ...) cprint = #338; /*
Print into the center of the screen just as ssqc's centerprint would appear. */
void(string s, ...) print = #339; /*
Unconditionally print on the local system's console, even in ssqc (doesn't care about the value of the developer cvar). */
string(float keynum) keynumtostring = #340; /*
Returns a hunam-readable name for the given keycode, as a tempstring. */
float(string keyname) stringtokeynum = #341; /*
Looks up the key name in the same way that the bind command would, returning the keycode for that key. */
Pass TRUE if you want the engine to release the mouse cursor (absolute input events + touchscreen mode). Pass FALSE if you want the engine to grab the cursor (relative input events + standard looking). If the image name is specified, the engine will use that image for a cursor (use an empty string to clear it again), in a way that will not conflict with the console. Images specified this way will be hardware accelerated, if supported by the platform/port. */
Reports the cursor mode this module previously attempted to use. If 'effective' is true, reports the cursor mode currently active (if was overriden by a different module which has precidence, for instance, or if there is only a touchscreen and no mouse). */
Sets the position of the view, as far as the audio subsystem is concerned. This should be called once per CSQC_UpdateView as it will otherwise revert to default. For reverbtype, see setup_reverb or treat as 'underwater'. */
typedef struct {
float flDensity;
float flDiffusion;
float flGain;
float flGainHF;
float flGainLF;
float flDecayTime;
float flDecayHFRatio;
float flDecayLFRatio;
float flReflectionsGain;
float flReflectionsDelay;
vector flReflectionsPan;
float flLateReverbGain;
float flLateReverbDelay;
vector flLateReverbPan;
float flEchoTime;
float flEchoDepth;
float flModulationTime;
float flModulationDepth;
float flAirAbsorptionGainHF;
float flHFReference;
float flLFReference;
float flRoomRolloffFactor;
int iDecayHFLimit;
} reverbinfo_t;
void(float reverbslot, reverbinfo_t *reverbinfo, int sizeofreverinfo_t) setup_reverb = #0:setup_reverb; /*
Reconfigures a reverb slot for weird effects. Slot 0 is reserved for no effects. Slot 1 is reserved for underwater effects. Reserved slots will be reinitialised on snd_restart, but can otherwise be changed. These reverb slots can be activated with SetListener. Note that reverb will currently only work when using OpenAL. */
Register the given console command, for easy console use.
Console commands that are later used will invoke CSQC_ConsoleCommand. */
float(entity ent) wasfreed = #353; /*
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. */
string(string key) serverkey = #354; /*
Look up a key in the server's public serverinfo string */
too convoluted for me to even try to explain correct usage. Try drawfont = loadfont("", "cour", "16", -1, 0, 0); to switch to the courier font (optimised for 16 virtual pixels high), if you have the freetype2 library in windows.. */
Invoke Cmd_evname_evargs in ssqc. evargs must be a string of initials refering to the types of the arguments to pass. v=vector, e=entity(.entnum field is sent), f=float, i=int. 6 arguments max - you can get more if you pack your floats into vectors. */
Specifies a per-modelindex callback to listen for engine-networking entity updates. Such entities are automatically interpolated by the engine (unless flags specifies not to).
The various standard entity fields will be overwritten each frame before the updatecallback function is called. */
Retrieves either the name or the body of the effect with the given number. The effect body is regenerated from internal state, and can be changed before being reapplied via the localcmd builtin. */
Adds a temporary clipped decal shader to the scene, centered at the given point with given orientation. Will be drawn by the next renderscene call, and freed by the next clearscene call. */
The texture is determined to be sufficient to hold the first named image, additional images can be named as extra tokens on the same line.
Use a + at the end of the line to continue reading image tokens from the next line also, the named shader must use 'map $diffuse' to read the composed texture (compatible with the defaultskin shader). */
Reads or sets a property from a console object. The old value is returned. Iterrate through consoles with the 'next' field. Valid properties: title, name, next, unseen, markup, forceutf8, close, clear, hidden, linecount */
float(entity e, float nowreadonly) entityprotection = #0:entityprotection; /*
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). */
entity(entity from, optional entity to) copyentity = #400; /* Part of DP_QC_COPYENTITY
vector(entity ent, float tagindex) gettaginfo = #452; /* Part of DP_MD3_TAGSINFO
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. */
Create a new 'browser tab' shader with the specified name that can then be drawn via drawpic (shader should not already exist - including from map/model textures or disk). In order to function correctly, this builtin depends upon external plugins being available. Use gecko_navigate to navigate it to a page of your choosing. */
void(string name) gecko_destroy = #488; /* Part of DP_GECKO_SUPPORT
Destroy a shader. */
void(string name, string URI) gecko_navigate = #489; /* Part of DP_GECKO_SUPPORT
Sends a command to the media decoder attached to the specified shader. In the case of a browser decoder, this changes the url that the browser displays. 'cmd:[un]focus' will tell the decoder that it has focus. */
float(string name, float key, float eventtype) gecko_keyevent = #490; /* Part of DP_GECKO_SUPPORT
Send a key event to a media decoder. This applies only to interactive decoders like browsers. */
void(string name, float x, float y) gecko_mousemove = #491; /* Part of DP_GECKO_SUPPORT
Sets a media decoder shader's mouse position. Values should be 0-1. */
void(string name, float w, float h) gecko_resize = #492; /* Part of DP_GECKO_SUPPORT
Request to resize a media decoder. */
vector(string name) gecko_get_texture_extent = #493; /* Part of DP_GECKO_SUPPORT
float() numentityfields = #496; /* Part of DP_QC_ENTITYDATA
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). */
Reads a picture that was written by ReadPicture, and returns a name that can be used in drawpic and other 2d drawing functions. In FTE, this acts as a readstring-with-downloadcheck - the image will appear normally once it has been downloaded, but its size may be incorrect until then. */
string(string filename, optional float makereferenced) whichpack = #503; /* Part of DP_QC_WHICHPACK
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. */
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
For a POST request, you will typically want the postmimetype set to application/x-www-form-urlencoded.
For a GET request, omit the mime+data entirely.
Consult your webserver/php/etc documentation for best-practise. */
float(string str) tokenize_console = #514; /*
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. */
float(float idx) argv_start_index = #515; /*
Returns the character index that the tokenized arg started at. */
float(float idx) argv_end_index = #516; /*
Returns the character index that the tokenized arg stopped at. */
Returns a list of keycodes that perform the given console command in a format that can only be parsed via tokenize (NOT tokenize_console). This only and always returns two values - if only one key is actually bound, -1 will be returned. The bindmap argument is listed for compatibility with dp-specific defs, but is ignored in FTE. */
Returns a list of key bindings in keyname format instead of keynums. Use tokenize to parse. This list may contain modifiers. May return large numbers of keys. */
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. */
void(string s) loadfromfile = #530; /*
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. */
Changes the properties of the current sound being played on the given entity channel. newsample may be empty, and will be ignored in this case. timeoffset is relative to the current position (subtract the result of getsoundtime for absolute positions). Negative volume can be used to stop the sound. Return value is a fractional value based upon the number of audio devices that could be updated - test against TRUE rather than non-zero. */
float(entity e, float channel) getsoundtime = #533; /*
Returns the current playback time of the sample on the given entity's channel. Beware CHAN_AUTO (in csqc, channels are not limited by network protocol). */
float(string sample) soundlength = #534; /*
Provides a way to query the duration of a sound sample, allowing you to set up a timer to chain samples. */
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. */
void(entity e, float physics_enabled) physics_enable = #540; /*
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. */
void(entity e, vector force, vector relative_ofs) physics_addforce = #541; /*
Apply some impulse directional force upon a MOVETYPE_PHYSICS entity. */
void(entity e, vector torque) physics_addtorque = #542; /*
Apply some impulse rotational force upon a MOVETYPE_PHYSICS entity. */
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 */
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. */