djcev.com

//

Git Repos / fte_dogmode / qc / defs_builtins.qc

Last update to this file was on 2024-04-12 at 18:56.

Show defs_builtins.qc

//==============================================================================
// BUILTIN FUNCTIONS
//==============================================================================

//======================================================================
// id1 builtins -- most comments from fteextensions.qc
//======================================================================

#if defined(CSQC) || defined(SSQC)
// Takes an angle vector (pitch,yaw,roll) (+x=DOWN). Writes its results
// into v_forward, v_right, v_up vectors.
void(vector ang) makevectors = #1;

// 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, vector o) setorigin = #2;

// 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, string m) setmodel = #3;

// Sets the e's mins and maxs fields. Also relinks collision state,
// which sets absmin and absmax too.
void(entity e, vector min, vector max) setsize = #4;

// #5 was removed
#endif

#ifdef SSQC
// Trigger a debugging event. FTE will break into the qc debugger.
// Other engines may crash with a debug execption.
void() breakpoint = #6;
#endif

#if defined(CSQC) || defined(SSQC)
// Returns a random value between 0 and 1. Be warned, this builtin can
// return 1 in most engines, which can break arrays.
float() random = #7;

// Starts a sound centered upon the given entity.
// 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
// 'samp' must have been precached first
// if specified, 'speedpct' should normally be around 100 (or =0), 200
// for double speed or 50 for half speed.
// If flags is specified, the reliable flag in the channels argument is
// used for additional channels. Flags should be made from
// SOUNDFLAG_* constants
// timeofs should be negative in order to provide a delay before the
// sound actually starts.
void(entity e, float chan, string samp, float vol, float atten,
optional float speedpct, optional float flags, optional float timeofs)
sound = #8;

// Shorten or lengthen a direction vector such that it is only one quake
// unit long.
vector(vector v) normalize = #9;

// Ends the game with an easily readable error message.
void(string e) error = #10;

// Displays a non-fatal easily readable error message concerning the
// self entity, including a field dump. self will be removed!
void(string e) objerror = #11;

// 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.
float(vector v) vlen = #12;

// 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.
float(vector v, optional entity reference) vectoyaw = #13;

// Adds a brand new entity into the world! Hurrah, you're now a parent!
entity() spawn = #14;

// 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.
void(entity e) remove = #15;

// Traces a thin line through the world from v1 towards v2.
// Will not collide with ent, ent.owner, or any entity who's owner
// field refers to ent.
// 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.
void(vector v1, vector v2, float flags, entity ent) traceline = #16;
#endif

#ifdef SSQC
// Returns one of the player entities. The returned player will
// change periodically.
entity() checkclient = #17;
#endif

#if defined(CSQC) || defined(SSQC)
// 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.
// If you have many many entities then you may find that hashtables will
// give more performance (but requires extra upkeep).
entity(entity start, .string fld, string match) find = #18;

// 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_sound = #19;

// 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.
string(string s) precache_model = #20;
#endif

#ifdef SSQC
// 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.
// This builtin is generally considered evil.
void(entity client, string s) stuffcmd = #21;
#endif

#if defined(CSQC) || defined(SSQC)
// 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.
entity(vector org, float rad) findradius = #22;
#endif

#ifdef SSQC
// NQ: Concatenates all arguments, and prints the messsage on the
// console of all connected clients.
void(string s) bprint = #23;

// NQ: Concatenates all string arguments, and prints the messsage
// on the named client's console
void(entity client, string s) sprint = #24;
#endif

#if defined(CSQC) || defined(SSQC)
// 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;

// Returns a tempstring containing a representation of the given float.
// Precision depends upon engine.
string(float f) ftos = #26;

// Returns a tempstring containing a representation of the given vector.
// Precision depends upon engine.
string(vector v) vtos = #27;

// Writes out a coredump. This contains stack, globals, and field info
// for all ents. This can be handy for debugging.
void() coredump = #28;

// Enables tracing. This may be spammy, slow, and stuff. Set debugger 1
// in order to use fte's qc debugger.
void() traceon = #29;

// Disables tracing again.
void() traceoff = #30;

// Debugging builtin that prints all fields of the given entity to the console.
void(entity e) eprint = #31;

// Attempt to walk the entity at a given angle for a given distance.
// if settraceglobals is set, the trace_* globals will be set, showing
// the results of the movement.
// This function will trigger touch events.
float(float yaw, float dist, optional float settraceglobals) walkmove = #32;

// #33 was removed

// 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.
float() droptofloor = #34;

// Specifies an auto-animating string that specifies the light intensity
// for entities using that lightstyle.
// a is off, z is fully lit. Should be lower case only.
// rgb will recolour all lights using that lightstyle.
void(float style, string stylestring, optional vector rgb) lightstyle = #35;

// Rounds the given float up or down to the closest integeral value.
// X.5 rounds away from 0
float(float v) rint = #36;

// Rounds the given float downwards, even when negative.
float(float v) floor = #37;

// Rounds the given float upwards, even when negative.
float(float v) ceil = #38;

// #39 was removed

// Expensive checks to ensure that the entity is actually sitting on
// something solid, returns true if it is.
float(entity e) checkbottom = #40;

// 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.
// old comment: returns a CONTENT_*
float(vector v) pointcontents = #41;

// #42 was removed

// Removes the sign of the float, making it positive if it is negative.
float(float f) fabs = #43;
#endif

#ifdef SSQC
// Returns a direction vector (specifically v_forward on error).
// This builtin attempts to guess what pitch angle to fire projectiles at
// for people that don't know about mouselook. Does not affect yaw angles.
vector(entity e, float speed) aim = #44;
#endif

#if defined(CSQC) || defined(SSQC)
// Returns the numeric value of the named cvar
float(string s) cvar = #45;

// Adds the string to the console command queue. Commands will not be
// executed immediately, but rather at the start of the following frame.
void(string s) localcmd = #46;

// Returns the following entity. Skips over removed entities. Returns
// world when passed the last valid entity.
entity(entity e) nextent = #47;

// Spawn 'count' particles around 'pos' moving in the direction 'dir',
// with a palette colour index between 'colour' and 'colour+8'.
void(vector o, vector d, float color, float count) particle = #48;

// Changes the self.angles_y field towards self.ideal_yaw by up to
// self.yaw_speed.
void() changeyaw = #49;

// #50 was removed

// 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.
vector(vector fwd, optional vector up) vectoangles = #51;
#endif

#ifdef SSQC
// direct client message generation
void(float to, float f) WriteByte = #52;
void(float to, float f) WriteChar = #53;
void(float to, float f) WriteShort = #54;
void(float to, float f) WriteLong = #55;
void(float to, float f) WriteCoord = #56;
void(float to, float f) WriteAngle = #57;
void(float to, string s) WriteString = #58;
void(float to, entity s) WriteEntity = #59;
#endif

#if defined(CSQC) || defined(SSQC)
// Runs lots and lots of fancy logic in order to try to step the entity
// the specified distance towards its goalentity.
void(float step) movetogoal = #67;

// This builtin does nothing. It was used only as a hint for pak
// generation.
string(string s) precache_file = #68;

// 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(entity e) makestatic = #69;
#endif

#ifdef SSQC
// 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.
void(string s) changelevel = #70;
#endif

// #71 was removed

#if defined(CSQC) || defined(SSQC)
// Instantly sets a cvar to the given string value.
void(string var, string val) cvar_set = #72;

// Starts playing a sound with no connection to any entity. A sound must
// be precached during map load in order to be considered valid.
// Once an ambient sound starts playing it cannot be stopped.
// Unlike standard sounds, ambient sounds must loop in order to be
// considered valid (sound markers need to be present in the file).
// ^^^ information copied from https://quakewiki.org/wiki/ambientsound
void(vector pos, string samp, float vol, float atten) ambientsound = #74;

// The same as precache_model. This was only used for models in the
// registered version of Quake. Using precache_model() is preferred.
// ^^^ information from https://quakewiki.org/wiki/precache_model2
string(string s) precache_model2 = #75;

// The same as precache_sound. This was only used for sounds in the
// registered version of Quake. Using precache_sound() is preferred.
// ^^^ information from https://quakewiki.org/wiki/precache_sound2
string(string s) precache_sound2 = #76;

// The same as precache_file. Does nothing.
// ^^^ information from https://quakewiki.org/wiki/precache_file2
string(string s) precache_file2 = #77;
#endif

#ifdef SSQC
// set parm1... to the values at level start for coop respawn
void(entity e) setspawnparms = #78;
#endif

//======================================================================
// id1 builtin overrides
//======================================================================

#ifdef SSQC
//----------------------------------------------------------------------
// Centerprint
//
// The following function definitions allow the engine's builtin
// centerprint function (builtin #73) to be called with different
// numbers of string arguments. The string that will be printed is the
// concatenation of the string arguments.
//
// These definitions work because builtin #73 is implemented in such a
// way that it can accept multiple string arguments in this manner, even
// though the original QuakeC code didn't take advantage of this fact.
// A maximum of seven string arguments can be passed because a function
// is limited to a total of eight arguments (and the first argument is
// the client). Note that in the original engine, all of the strings
// for a centerprint message are concatenated into a single 256-char
// buffer, therefore excessively long messages should be avoided. -- iw
//----------------------------------------------------------------------

.float suppressCenterPrint;

void(entity client, string s1) centerprint_builtin = #73;
void(entity client, string s1, string s2) centerprint_builtin2 = #73;
void(entity client, string s1, string s2, string s3) centerprint_builtin3 = #73;
void(entity client, string s1, string s2, string s3, string s4)
centerprint_builtin4 = #73;
void(entity client, string s1, string s2, string s3, string s4, string s5)
centerprint_builtin5 = #73;
void(entity client, string s1, string s2, string s3, string s4, string s5,
string s6) centerprint_builtin6 = #73;
void(entity client, string s1, string s2, string s3, string s4, string s5,
string s6, string s7) centerprint_builtin7 = #73;

void(entity client, string s1) centerprint =
{
// Is the centerprint message being used by something else?
if (!client.suppressCenterPrint)
{
centerprint_builtin(client, s1);
}
else
{
// Send message to client console instead
sprint(client, "(centerprint) ");
sprint(client, s1);
sprint(client, "\n");
}
};

void(entity client, string s1, string s2) centerprint2 =
{
// Is the centerprint message being used by something else?
if (!client.suppressCenterPrint)
{
centerprint_builtin2(client, s1, s2);
}
else
{
// Send message to client console instead
sprint(client, "(centerprint) ");
sprint(client, s1);
sprint(client, s2);
sprint(client, "\n");
}
};
#endif

//======================================================================
// engine extension builtins
//======================================================================

#if defined(CSQC) || defined(SSQC)
// Part of DP_QC_SINCOSSQRTPOW -- copied from fteextensions.qc -- CEV
// Forgive me father, for I have trigonometry homework.
float(float angle) sin = #60;
float(float angle) cos = #61;
float(float value) sqrt = #62;

// Part of DP_QC_TRACETOSS -- copied from fteextensions.qc -- CEV
// Simulates movement of the entity as if it is MOVETYPE_TOSS and
// starting with it's current state (location, velocity, etc),
// returns relevant trace_ variables (trace_fraction is always 0,
// all other values are supported - trace_ent, trace_endpos,
// trace_plane_normal), does not actually alter the entity.
// ^^^ text copied from https://quakewiki.org/wiki/DP_QC_TRACETOSS
void(entity ent, entity ignore) tracetoss = #64;

// Part of FRIK_FILE, FTE_QC_INFOKEY, FTE_STRINGS, QW_ENGINE, ZQ_QC_STRINGS
float(string) stof = #81;

// Part of DP_QC_TRACEBOX -- copied from fteextensions.qc -- CEV
// 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.
void(vector start, vector mins, vector maxs, vector end, float nomonsters,
entity ent) tracebox = #90;

// DP_QC_GETLIGHT -- copied from fteextensions.qc -- CEV
// Returns the lighting at the requested location (in color),
// 0-255 range (can exceed 255).
// ^^^ text copied from https://quakewiki.org/wiki/DP_QC_GETLIGHT
vector(vector org) getlight = #92;

// Part of DP_QC_MINMAXBOUND -- copied from fteextensions.qc -- CEV
// Returns the lowest value of its arguments.
float(float a, float b, ...) min = #94;
// Returns the highest value of its arguments.
float(float a, float b, ...) max = #95;
// Returns val, unless minimum is higher, or maximum is less.
float(float minimum, float val, float maximum) bound = #96;

// Part of DP_QC_SINCOSSQRTPOW -- copied from fteextensions.qc -- CEV
// raise value to power exp
float(float value, float exp) pow = #97;

// Part of DP_QC_FINDFLOAT -- copied from fteextensions.qc -- CEV
// Equivalent to the find builtin, but instead of comparing string 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. world is returned when there are no more entities.
entity(entity start, .__variant fld, __variant match) findfloat = #98;

// Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS -- copied from fteextensions.qc
float(string s) strlen = #114;
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;
string(string s, float start, float length) substring = #116;
vector(string s) stov = #117;

// Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS -- copied from fteextensions.qc
// 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.
string(string s, ...) strzone = #118;

// Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS -- copied from fteextensions.qc
// 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.
void(string s) strunzone = #119;
#endif

#ifdef CSQC
// Part of FTE_STRINGS -- copied from fteextensions.qc -- CEV
// Retrieves the character value at offset 'index'.
float(string str, float index) str2chr = #222;

// Part of FTE_STRINGS -- copied from fteextensions.qc -- CEV
// 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 ccase, float redalpha, float redchars, string str, ...)
strconv = #224;
#endif

#if defined(CSQC) || defined(SSQC)
// copied from fteextensions.qc -- CEV
float(float dividend, float divisor) mod = #245;

// 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.
void(optional entity ent, optional vector neworigin) touchtriggers = #279;
#endif

#ifdef SSQC
// copied from fteextensions.qc -- CEV
void(float buf, float fl) WriteFloat = #280;
#endif

#ifdef CSQC
// copied from fteextensions.qc -- CEV
// Forgets all rentities, polygons, and temporary dlights.
// Resets all view properties to their default values.
void() clearscene = #300;

// copied from fteextensions.qc -- CEV
// Walks through all entities effectively doing this:
// if (ent.drawmask&mask){ if (!ent.predaw()) addentity(ent); }
// If mask&MASK_DELTA, non-csqc entities, particles, and related effects
// will also be added to the rentity list.
// If mask&MASK_STDVIEWMODEL then the default view model will also be added.
void(float mask) addentities = #301;

// copied from fteextensions.qc -- CEV
// Copies the entity fields into a new rentity for later rendering via addscene.
void(entity ent) addentity = #302;

// copied from fteextensions.qc -- CEV
// 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.
float(float property, ...) setproperty = #303;

// copied from fteextensions.qc -- CEV
// 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.
void() renderscene = #304;

// copied from fteextensions.qc -- CEV
// Forces the engine to load the named image. If trywad is specified,
// the specified name must any lack path and extension.
string(string name, optional float trywad) precache_pic = #317;

// copied from fteextensions.qc -- CEV
// 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.
vector(string picname) drawgetimagesize = #318;

// copied from fteextensions.qc -- CEV
// Tells the engine that the image is no longer needed.
// The image will appear to be new the next time its needed.
void(string name) freepic = #319;

// copied from fteextensions.qc -- CEV
// Draw the given quake character at the given position.
// If flag&4, the function will consider the char to be a unicode char
// instead (or display as a ? if outside the 32-127 range).
// size should normally be something like '8 8 0'.
// rgb should normally be '1 1 1'
// alpha normally 1.
// Software engines may assume the named defaults.
// Note that ALL text may be rescaled on the X axis due to variable
// width fonts. The X axis may even be ignored completely.
float(vector position, float character, vector size, vector rgb,
float alpha, optional float drawflag) drawcharacter = #320;

// copied from fteextensions.qc -- CEV
// Draws the specified string without using any markup at all, even in
// engines that support it.
// If UTF-8 is globally enabled in the engine, then that encoding is used
// (without additional markup), otherwise it is raw quake chars.
// Software engines may assume a size of '8 8 0', rgb='1 1 1', alpha=1,
// flag&3=0, but it is not an error to draw out of the screen.
float(vector position, string text, vector size, vector rgb, float alpha,
optional float drawflag) drawrawstring = #321;

// 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. -- copied from fteextensions.qc -- CEV
float(vector position, string pic, vector size, vector rgb, float alpha,
optional float drawflag) drawpic = #322;

// copied from fteextension.qc -- CEV
// Draws a solid block over the given 2d box, with given colour, alpha,
// and blend mode (specified via flags).
// flags&3=0 simple blend.
// flags&3=1 additive blend
float(vector position, vector size, vector rgb, float alpha,
optional float drawflag) drawfill = #323;

// copied from fteextensions.qc -- CEV
// 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(float x, float y, float width, float height) drawsetcliparea = #324;

// copied from fteextensions.qc -- CEV
// Reverts the scissor/clip area to the whole screen.
void(void) drawresetcliparea = #325;

// copied from fteextension.qc -- CEV
// Draws a string, interpreting markup and recolouring as appropriate.
float(vector position, string text, vector size, vector rgb, float alpha,
float drawflag) drawstring = #326;

// copied from fteextension.qc -- CEV
// 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.
float(string text, float usecolours, optional vector fontsize)
stringwidth = #327;

// copied from fteextension.qc -- CEV
// Retrieves the numerical value of the given EV_FLOAT stat. If firstbit
// and bitcount are specified, retrieves the upper bits of the STAT_ITEMS
// stat (converted into a float, so there are no VM dependancies).
float(float stnum, optional float firstbit, optional float bitcount)
getstatf = #331;

// copied from fteextension.qc -- CEV
// Retrieves the value of the given EV_STRING stat, as a tempstring.
// Older engines may use 4 consecutive integer stats, with a limit of 15
// chars (yes, really. 15.), but FTE Quake uses a separate namespace for
// string stats and has a much higher length limit.
string(float stnum) getstats = #332;
#endif

#if defined(CSQC) || defined(SSQC)
// Part of DP_ENT_TRAILEFFECTNUM, FTE_SV_POINTPARTICLES -- from fteextensions.qc
// 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.
float(string effectname) particleeffectnum = #335;

// Part of FTE_SV_POINTPARTICLES -- copied from fteextensions.qc -- CEV
// 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.
void(float effectnum, entity ent, vector start, vector end)
trailparticles = #336;

// Part of FTE_SV_POINTPARTICLES -- copied from fteextensions.qc -- CEV
// 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.
// 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.
void(float effectnum, vector origin, optional vector dir, optional float count)
pointparticles = #337;

// Part of DP_SV_PRINT -- copied from fteextensions.qc -- CEV
// Unconditionally print on the local system's console, even in ssqc
// (doesn't care about the value of the developer cvar).
void(string s, ...) print = #339;
#endif

#ifdef CSQC
// copied from fteextensions.qc -- CEV
// Looks up an input frame from the log, setting the input_* globals
// accordingly.
// The sequence number range used for prediction should normally be
// servercommandframe < sequence <= clientcommandframe.
// The sequence equal to clientcommandframe will change between input frames.
float(float inputsequencenum) getinputstate = #345;
#endif

#if defined(CSQC) || defined(SSQC)
// goes with SV_RunClientCommand -- copied from fteextensions.qc -- CEV
// Perform the engine's standard player movement prediction upon the given
// entity using the input_* globals to describe movement.
void(entity ent) runstandardplayerphysics = #347;
#endif

#ifdef CSQC
// copied from fteextensions.qc -- CEV
// Look up a player's userinfo, to discover things like their name,
// topcolor, bottomcolor, skin, team, *ver.
// Also includes scoreboard info like frags, ping, pl, userid, entertime,
// as well as voipspeaking and voiploudness.
string(float playernum, string keyname) getplayerkeyvalue = #348;

// copied from fteextensions.qc -- CEV
// Returns if the client is currently playing a demo or not
float() isdemo = #349;

// copied from fteextensions.qc -- CEV
// Returns if the client is acting as the server (aka: listen server)
float() isserver = #350;

// copied from fteextensions.qc -- CEV
// 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'.
void(vector origin, vector forward, vector right, vector up,
optional float reverbtype) SetListener = #351;

// copied from fteextensions.qc -- CEV
// Register the given console command, for easy console use.
// Console commands that are later used will invoke CSQC_ConsoleCommand.
void(string cmdname) registercommand = #352;
#endif

#if defined(CSQC) || defined(SSQC)
// copied from fteextensions.qc -- CEV
// Look up a key in the server's public serverinfo string
string(string key) serverkey = #354;
#endif

#ifdef CSQC
// copied from fteextensions.qc -- CEV
float() ReadByte = #360;
float() ReadChar = #361;
float() ReadShort = #362;
float() ReadLong = #363;
float() ReadCoord = #364;
float() ReadAngle = #365;
string() ReadString = #366;
float() ReadFloat = #367;
float() ReadEntityNum = #368;

// copied from fteextensions.qc -- CEV
// 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.
float(string modelname, float(float isnew) updatecallback, float flags)
deltalisten = #371;
#endif

#if defined(CSQC) || defined(SSQC)
// Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS
// copied from fteextensions.qc -- CEV
void(entity own, vector start, vector end) te_lightning2 = #429;

// Part of KRIMZON_SV_PARSECLIENTCOMMAND -- copied from fteextensions.qc -- CEV
void(entity e, string s) clientcommand = #440;
float(string s) tokenize = #441;
string(float n) argv = #442;

// Part of DP_QC_EDICT_NUM -- copied from fteextensions.qc -- CEV
entity(float entnum) edict_num = #459;

// Part of DP_QC_ASINACOSATANATAN2TAN -- copied from fteextensions.qc -- CEV
float(float s) asin = #471;
float(float c) acos = #472;
float(float t) atan = #473;
float(float c, float s) atan2 = #474;
float(float a) tan = #475;
#endif

#ifdef CSQC
// copied from fteextensions.qc -- CEV
// 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(string str) tokenize_console = #514;
#endif

#if defined(CSQC) || defined(SSQC)
// Part of DP_QC_SPRINTF -- copied from fteextensions.qc -- CEV
// 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.
string(string fmt, ...) sprintf = #627;
#endif

#if defined(CSQC) || defined(SSQC)
// Part of FTE_QC_CROSSPRODUCT -- copied from fteextensions.qc -- CEV
// Small helper function to calculate the crossproduct of two vectors.
vector(vector v1, vector v2) crossproduct = #0:crossproduct;
#endif

#ifdef SSQC
// Writes all 4 bytes of a 32bit integer without truncating to a float
// first before converting back to an int (unlike WriteLong does, but
// otherwise equivalent).
void(float buf, int fl) WriteInt = #0:WriteInt;
#endif

Return to the top of this page or return to the overview of this repo.

Log defs_builtins.qc

Return to the top of this page or return to the overview of this repo.