- Physics are now handled partially by the engine again

- Added first bot prototypes (only use with the latest FTEQW and ENGINE_ROUTING enabled
This commit is contained in:
Marco Hladik 2018-06-09 18:37:42 +02:00
parent d1aa5feb35
commit 6e9268d764
17 changed files with 442 additions and 142 deletions

319
Source/Builtins.h Executable file → Normal file
View File

@ -1,5 +1,5 @@
/*
This file was automatically generated by FTE QuakeWorld v1.05
This file was automatically generated by FTE Quake v1.06
This file can be regenerated by issuing the following command:
pr_dumpplatform
Available options:
@ -18,6 +18,7 @@ Available options:
#pragma warning error Q105 /*too few parms*/
#pragma warning error Q106 /*assignment to constant/lvalue*/
#pragma warning error Q208 /*system crc unknown*/
#pragma warning disable F211 /*system crc outdated (eg: dp's csqc)*/
#pragma warning enable F301 /*non-utf-8 strings*/
#pragma warning enable F302 /*uninitialised locals*/
#if !defined(CSQC) && !defined(NQSSQC) && !defined(QWSSQC)&& !defined(MENU)
@ -76,6 +77,7 @@ Available options:
#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_ENT_VIEWMODEL
#define DP_GECKO_SUPPORT
#define DP_GFX_FONTS
#define DP_GFX_SKINFILES
#define DP_GFX_SKYBOX
#define DP_HALFLIFE_MAP_CVAR
@ -109,6 +111,7 @@ Available options:
#define DP_QC_RANDOMVEC
#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_SINCOSSQRTPOW
#define DP_QC_SPRINTF /* Provides the sprintf builtin, which allows for rich formatting along the lines of C's function with the same name. Not to be confused with QC's sprint builtin. */
#define DP_QC_STRFTIME
#define DP_QC_STRING_CASE_FUNCTIONS
#define DP_QC_STRINGBUFFERS
@ -131,6 +134,7 @@ Available options:
#define DP_QUAKE2_SPRITE
#define DP_QUAKE3_MODEL
#define DP_REGISTERCVAR
#define DP_SND_SOUND7_WIP2
#define DP_SND_STEREOWAV
#define DP_SND_OGGVORBIS
#define DP_SOLIDCORPSE
@ -146,6 +150,7 @@ Available options:
#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_POINTSOUND
#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 DP_SV_PRINT /* Says that the print builtin can be used from nqssqc (as well as just csqc), bypassing the developer cvar issues. */
#define DP_SV_SETCOLOR
#define DP_SV_SPAWNFUNC_PREFIX
#define DP_SV_WRITEPICTURE
@ -169,7 +174,7 @@ Available options:
#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_CSQC_HALFLIFE_MODELS
#define FTE_CSQC_SERVERBROWSER
#define FTE_CSQC_SERVERBROWSER /* Provides builtins to query the engine's serverbrowser servers list from ssqc. Note that these builtins are always available in menuqc. */
#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_RAWIMAGES /* Provides raw rgba image access to csqc. With this, the csprogs can read textures into qc-accessible memory, modify it, and then upload it to the renderer. */
#define FTE_CSQC_RENDERTARGETS /* VF_RT_DESTCOLOUR exists and can be used to redirect any rendering to a texture instead of the screen. */
@ -182,15 +187,15 @@ Available options:
#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_GFX_MODELEVENTS /* Provides a query for per-animation events in model files, including from progs/foo.mdl.events files. */
#define FTE_ISBACKBUFFERED /* Allows you to check if a client has too many reliable messages pending. */
#define FTE_MEMALLOC /* Allows dynamically allocating memory. Use pointers to access this memory. Memory will not be saved into saved games. */
#define FTE_MEDIA_AVI /* playfilm command supports avi files. */
#define FTE_MEDIA_CIN /* playfilm command supports q2 cin files. */
#define FTE_MEDIA_ROQ /* playfilm command supports q3 roq files. */
#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_NPCCHAT
#define FTE_QC_NPCCHAT
#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. */
@ -200,11 +205,14 @@ Available options:
#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_CHECKPVS
#define FTE_QC_CROSSPRODUCT
#define FTE_QC_CUSTOMSKINS /* The engine supports the use of q3 skins, as well as the use of such skin 'files' to specify rich top+bottom colours, qw skins, geomsets, or texture composition even on non-players.. */
#define FTE_QC_FS_SEARCH_SIZEMTIME
#define FTE_QC_HARDWARECURSORS /* setcursormode exists in both csqc+menuqc, and accepts additional arguments to specify a cursor image to use when this module has focus. If the image exceeds hardware limits (or hardware cursors are unsupported), it will be emulated using regular draws - this at least still avoids conflicting cursors as only one will ever be used, even if console+menu+csqc are all overlayed. */
#define FTE_QC_HASHTABLES /* Provides efficient string-based lookups. */
#define FTE_QC_INFOKEY /* QuakeWorld's infokey builtin works, and reports at least name+topcolor+bottomcolor+ping(in ms)+ip(unmasked, but not always ipv4)+team(aka bottomcolor in nq). Does not require actual localinfo/serverinfo/userinfo, but they're _highly_ recommended to any engines with csqc */
#define FTE_QC_INTCONV /* Provides string<>int conversions, including hex representations. */
#define FTE_QC_MATCHCLIENTNAME
#define FTE_QC_MULTICAST /* QuakeWorld's multicast builtin works along with MSG_MULTICAST, but also with unicast support. */
#define FTE_QC_PAUSED
#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_QC_RAGDOLL_WIP
@ -216,6 +224,7 @@ Available options:
#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_SPLITSCREEN /* Client supports splitscreen, controlled via cl_splitclients. Servers require allow_splitscreen 1 if splitscreen is to be used over the internet. Mods that use csqc will need to be aware for this to work properly. per-client networking may be problematic. */
#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 */
@ -355,7 +364,7 @@ void end_sys_globals;
.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. */
.vector avelocity; /* The amount the entity's angles change by per second. Note that this is direct eular angles, and thus the angular change is non-linear and often just looks buggy if you're changing more than one angle at a time. */
#endif
#ifdef CSQC
.float pmove_flags;
@ -420,7 +429,7 @@ void end_sys_globals;
.float button1;
.float button2;
.float impulse;
.float fixangle;
.float fixangle; /* Forces the clientside view angles to change to the value of .angles (has some lag). If set to 1/TRUE, the server will guess whether to send a delta or an explicit angle. If 2, will always send a delta (due to lag between transmission and acknowledgement, this cannot be spammed reliably). If 3, will always send an explicit angle. */
.vector v_angle; /* The angles a player is viewing. +x is DOWN (pitch, yaw, roll) */
#endif
#if defined(NQSSQC)
@ -508,6 +517,7 @@ int serverid; /* The unique id of this server within the server cluster. */
.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. */
.int hitcontentsmaski; /* Traces performed for this entity will impact against surfaces that match this contents mask. */
.float dphitcontentsmask; /* Some crappy field that inefficiently requires translating to the native contents flags. Ditch the 'dp', do it properly. */
.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. */
@ -545,6 +555,8 @@ int serverid; /* The unique id of this server within the server cluster. */
#endif
#if defined(CSQC) || defined(SSQC)
.float pitch_speed;
.float drawflags; /* Various flags that affect lighting values and scaling. Typically set to 96 in quake for proper compatibility with DP_QC_SCALE. */
.float abslight; /* Allows overriding light levels. Use drawflags to state that this field should actually be used. */
.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. */
@ -552,9 +564,9 @@ int serverid; /* The unique id of this server within the server cluster. */
#endif
#ifdef SSQC
.float maxspeed;
.entity view2;
.entity view2; /* defines a second viewpoint, typically displayed in a corner of the screen (also punches open pvs). */
.vector movement; /* These are the directions that the player is currently trying to move in (ie: which +forward/+moveright/+moveup etc buttons they have held), expressed relative to that player's angles. Order is forward, right, up. */
.float vw_index;
.float vw_index; /* This acts as a second modelindex, using the same frames etc. */
.entity nodrawtoclient; /* This entity will not be sent to the player named by this field. They will be invisible and not emit dlights/particles. Does not work in MVD-recorded game. */
.entity drawonlytoclient; /* This entity will be sent *only* to the player named by this field. To other players they will be invisible and not emit dlights/particles. Does not work in MVD-recorded game. */
.entity viewmodelforclient; /* This entity will be sent only to the player named by this field, and this entity will be attached to the player's view as an additional weapon model. */
@ -574,8 +586,6 @@ int serverid; /* The unique id of this server within the server cluster. */
.float dimension_seen; /* This is the dimension mask (bitfield) that the client is visible within. Clients that cannot see this dimension mask will not see this entity. */
.float dimension_ghost; /* If this entity is visible only within these dimensions, it will become transparent, as if a ghost. */
.float dimension_ghost_alpha; /* If this entity is subject to dimension_ghost, this is the scaler for its alpha value. If 0, 0.5 will be used instead. */
.float drawflags; /* Various flags that affect lighting values and scaling. Typically set to 96 in quake for proper compatibility with DP_QC_SCALE. */
.float abslight; /* Allows overriding light levels. Use drawflags to state that this field should actually be used. */
.float(entity playerent, float changedflags) SendEntity; /* Called by the engine whenever an entity needs to be (re)sent to a client's csprogs, either because SendFlags was set or because data was lost. Must write its data to the MSG_ENTITY buffer. Will be called at the engine's leasure. */
.float SendFlags; /* Indicates that something in the entity has been changed, and that it needs to be updated to all players that can see it. The engine will clear it at some point, with the cleared bits appearing in the 'changedflags' argument of the SendEntity method. */
.float Version; /* Obsolete, set a SendFlags bit instead. */
@ -604,8 +614,10 @@ int serverid; /* The unique id of this server within the server cluster. */
.float bonecontrol3; /* Halflife model format bone controller. On player models, this typically affects the spine's yaw. */
.float bonecontrol4; /* Halflife model format bone controller. On player models, this typically affects the spine's yaw. */
.float bonecontrol5; /* Halflife model format bone controller. This typically affects the mouth. */
.float subblendfrac; /* Weird animation value specific to halflife models. On player models, this typically affects the spine's pitch. */
.float subblendfrac; /* Weird animation value specific to halflife models. On player models, this typically affects the spine's pitch, or yaw, or... */
.float subblend2frac; /* Weird animation value specific to halflife models. I've no idea what this does, probably nothing for most models. */
.float basesubblendfrac; /* See basebone */
.float basesubblend2frac; /* See basebone */
#endif
void(float reqid, float responsecode, string resourcebody) URI_Get_Callback; /* Called as an eventual result of the uri_get builtin. */
#ifdef SSQC
@ -640,16 +652,21 @@ float(float evtype, float scanx, float chary, float devid) CSQC_InputEvent; /* C
__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. */
void(float isnew) CSQC_Ent_Update;
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.
WARNING: link text can potentially come from other players, so be careful about what you allow to be changed. */
void(float entnum) CSQC_Ent_Spawn; /* Clumsily defined function for compat with DP. Should call spawn, set that ent's entnum field, and return the entity inside the 'self' global which will then be used for fllowing Ent_Updates. MUST NOT PARSE ANY NETWORK DATA (which makes it kinda useless). */
void(float isnew) CSQC_Ent_Update; /* Parses the data sent by ssqc's various SendEntity functions (must use the exact same reads as the ssqc used writes - to debug this rule more easily, you may wish to use sv_csqcdebug). 'self' provides context between frames, and self.entnum should normally report which ssqc entity . Be aware that interpolation will need to happen separately. */
void() CSQC_Ent_Remove;
float(float entnum, float channel, string soundname, float vol, float attenuation, vector pos, float pitchmod, float flags) CSQC_Event_Sound;
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. */
float() CSQC_Parse_TempEntity; /* Please don't use this. Use CSQC_Parse_Event and multicasts instead.
The use of serverside protocol translation to handle QW vs NQ protocols mean that you're likely to end up reading slightly different data. Which is bad.
Return true to say that you fully handled the tempentity. Return false to have the client attempt to rewind the network stream and parse the message itself. */
#endif
#if defined(CSQC) || defined(MENU)
void(string cmdtext) GameCommand;
#endif
string(string uri, string method, string postdata, __in string requestheaders, __inout string responseheaders) Cef_GeneratePage; /* Provides an entrypoint to generate pages for the CEF plugin from within QC. Headers are
-separated key/value pairs (use tokenizebyseparator). */
#if defined(CSQC) || defined(SSQC)
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. */
@ -658,7 +675,9 @@ void() initents; /* Part of FTE_MULTIPROGS. Called after fields have been finali
void() m_init;
void() m_shutdown;
void(vector screensize) m_draw; /* Provides the menuqc with a chance to draw. Will be called even if the menu does not have focus, so be sure to avoid that. COMPAT: screensize is not provided in DP. */
void(vector screensize) m_drawloading; /* Additional drawing function to draw loading screen overlays. */
void(vector screensize, float opaque) m_drawloading; /* Additional drawing function to draw loading screens. If opaque is set, then this function must ensure that the entire screen is overdrawn (even if just by a black drawfill). */
float(float evtype, float scanx, float chary, float devid) Menu_InputEvent; /* If present, this is called instead of m_keydown and m_keyup
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. */
void(float scan, float chr) m_keydown;
void(float scan, float chr) m_keyup;
void(float wantmode) m_toggle;
@ -788,20 +807,20 @@ const float CONTENT_SLIME = -4;
const float CONTENT_LAVA = -5;
const float CONTENT_SKY = -6;
const float CONTENT_LADDER = -16; /* If this value is assigned to a solid_bsp's .skin field, the entity will become a ladder volume. */
const int CONTENTBIT_NONE = 0x00000000;
const int CONTENTBIT_SOLID = 0x00000001;
const int CONTENTBIT_LAVA = 0x00000008;
const int CONTENTBIT_SLIME = 0x00000010;
const int CONTENTBIT_WATER = 0x00000020;
const int CONTENTBIT_FTELADDER = 0x00004000;
const int CONTENTBIT_PLAYERCLIP = 0x00010000;
const int CONTENTBIT_MONSTERCLIP = 0x00020000;
const int CONTENTBIT_BODY = 0x02000000;
const int CONTENTBIT_CORPSE = 0x04000000;
const int CONTENTBIT_Q2LADDER = 0x20000000; /* Content bit specific to q2bsp */
const int CONTENTBIT_NONE = 0x00000000i;
const int CONTENTBIT_SOLID = 0x00000001i;
const int CONTENTBIT_LAVA = 0x00000008i;
const int CONTENTBIT_SLIME = 0x00000010i;
const int CONTENTBIT_WATER = 0x00000020i;
const int CONTENTBIT_FTELADDER = 0x00004000i;
const int CONTENTBIT_PLAYERCLIP = 0x00010000i;
const int CONTENTBIT_MONSTERCLIP = 0x00020000i;
const int CONTENTBIT_BODY = 0x02000000i;
const int CONTENTBIT_CORPSE = 0x04000000i;
const int CONTENTBIT_Q2LADDER = 0x20000000i; /* 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_POINTSOLID = CONTENTBIT_SOLID|0x00000002i|CONTENTBIT_BODY; /* Bits that traceline would normally consider solid */
const int CONTENTBITS_BOXSOLID = CONTENTBIT_SOLID|0x00000002i|CONTENTBIT_BODY|CONTENTBIT_PLAYERCLIP; /* Bits that tracebox would normally consider solid */
const int CONTENTBITS_FLUID = CONTENTBIT_WATER|CONTENTBIT_SLIME|CONTENTBIT_LAVA|CONTENTBIT_SKY;
const int SPA_POSITION; /* These SPA_* constants are to specify which attribute is returned by the getsurfacepointattribute builtin */
const int SPA_S_AXIS = 1;
@ -833,14 +852,10 @@ const float SOUNDFLAG_NOSPACIALISE = 4; /* The different audio channels are play
#endif
#if defined(CSQC) || defined(SSQC)
const float SOUNDFLAG_NOREVERB = 32; /* Disables the use of underwater/reverb effects on this sound effect. */
#endif
#ifdef SSQC
const float SOUNDFLAG_UNICAST = 256; /* The sound will be heard only by the player specified by msg_entity. */
#endif
#if defined(CSQC) || defined(SSQC)
const float SOUNDFLAG_FOLLOW = 64; /* The sound's origin will updated to follow the emitting entity. */
#endif
#ifdef SSQC
const float SOUNDFLAG_UNICAST = 256; /* The sound will be heard only by the player specified by msg_entity. */
const float SOUNDFLAG_SENDVELOCITY = 512; /* The entity's current velocity will be sent to the client, only useful if doppler is enabled. */
#endif
#if defined(CSQC) || defined(SSQC)
@ -924,11 +939,13 @@ const string SERVERKEY_DLSTATE = "dlstate"; /* The progress of any current downl
files-remaining, total-size, unknown-sizes-flag, file-localname, file-remotename, file-percent, file-rate, file-received-bytes, file-total-bytes
If the current file info is omitted, then we are waiting for a download to start. */
const string SERVERKEY_PROTOCOL = "protocol"; /* The protocol we are connected to the server with. */
const string SERVERKEY_MAXPLAYERS = "maxplayers"; /* The protocol we are connected to the server with. */
const string SERVERKEY_MAXPLAYERS = "maxplayers"; /* The number of player/spectator slots allocated on the server. */
#endif
#ifdef SSQC
const float STUFFCMD_IGNOREINDEMO = 1; /* The protocol we are connected to the server with. */
const float STUFFCMD_DEMOONLY = 2; /* The protocol we are connected to the server with. */
const float STUFFCMD_IGNOREINDEMO = 1; /* This stuffcmd will NOT be written to mvds/qtv. */
const float STUFFCMD_DEMOONLY = 2; /* This stuffcmd will ONLY be written into mvds/qtv streams. */
const float STUFFCMD_BROADCAST = 4; /* The stuffcmd will be broadcast server-wide (according to the mvd filters). */
const float STUFFCMD_UNRELIABLE = 8; /* The stuffcmd might not arrive. It might also get there faster than ones sent over the reliable channel. */
#endif
#if defined(CSQC) || defined(SSQC)
const float FL_FLY = 1;
@ -1137,6 +1154,7 @@ const float VF_RT_SOURCECOLOUR = 209; /* The texture name to use with shaders th
const float 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. */
const float 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. */
const float 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. */
const float VF_USERDATA = 221; /* Pointer (and byte size) to an array of vec4s. This data is then globally visible to all glsl via the w_user uniform. */
#endif
#ifdef CSQC
const float 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. */
@ -1200,6 +1218,7 @@ const float LFLAG_FLASHBLEND = 8;
const float LFLAG_NOSHADOWS = 256;
const float LFLAG_SHADOWMAP = 512;
const float LFLAG_CREPUSCULAR = 1024;
const float LFLAG_ORTHOSUN = 0;
const float TEREDIT_RELOAD = 0;
const float TEREDIT_SAVE = 1;
const float TEREDIT_SETHOLE = 2;
@ -1223,7 +1242,6 @@ const float TEREDIT_MESH_KILL = 16;
const float TEREDIT_TINT = 17;
const float TEREDIT_RESET_SECT = 20;
const float TEREDIT_RELOAD_SECT = 21;
const float TEREDIT_ENTS_WIPE = 22;
const float TEREDIT_ENT_GET = 26;
const float TEREDIT_ENT_SET = 27;
const float TEREDIT_ENT_ADD = 28;
@ -1255,7 +1273,7 @@ float(string ext) checkextension = #1; /*
void(string err,...) error = #2;
void(string err,...) objerror = #3;
void(string text,...) print = #4;
void(string text,...) print = #4; /* Part of DP_SV_PRINT*/
void(string text,...) bprint = #5;
void(float clientnum, string text,...) msprint = #6;
void(string text,...) cprint = #7;
@ -1272,7 +1290,7 @@ string(float) ftos = #17;
float(float) fabs = #18;
string(vector) vtos = #19;
string(entity) etos = #20; /* Part of DP_QC_ETOS*/
float(string) stof = #21; /* Part of FRIK_FILE, FTE_STRINGS, QW_ENGINE, ZQ_QC_STRINGS*/
float(string) stof = #21; /* Part of FRIK_FILE, FTE_QC_INFOKEY, FTE_STRINGS, QW_ENGINE, ZQ_QC_STRINGS*/
entity() spawn = #22;
void(entity) remove = #23;
entity(entity start, .string field, string match) find = #24;
@ -1419,7 +1437,8 @@ entity() checkclient = #17; /*
#endif
#if defined(CSQC) || defined(SSQC)
entity(entity start, .string fld, string match) find = #18; /*
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. */
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). */
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. */
@ -1440,7 +1459,7 @@ void(entity client, float flags, string s) stuffcmdflags = #0:stuffcmdflags; /*
#endif
#if defined(CSQC) || defined(SSQC)
entity(vector org, float rad) findradius = #22; /*
entity(vector org, float rad, optional .entity chainfield) findradius = #22; /*
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. */
#endif
@ -1611,19 +1630,29 @@ void(entity player) setspawnparms = #78;
void(entity killer, entity killee) logfrag = #79; /* Part of QW_ENGINE*/
#endif
#if defined(CSQC) || defined(SSQC)
string(entity e, string key) infokey = #80; /* Part of QW_ENGINE
string(entity e, string key) infokey = #80; /* Part of FTE_QC_INFOKEY, QW_ENGINE
If e is world, returns the field 'key' from either the serverinfo or the localinfo. If e is a player, returns the value of 'key' from the player's userinfo string. There are a few special exceptions, like 'ip' which is not technically part of the userinfo. */
float(string) stof = #81; /* Part of FRIK_FILE, FTE_STRINGS, QW_ENGINE, ZQ_QC_STRINGS*/
#endif
#ifdef SSQC
#define unicast(pl,reli) do{msg_entity = pl; multicast('0 0 0', reli?MULITCAST_ONE_R:MULTICAST_ONE);}while(0)
void(vector where, float set) multicast = #82; /*
Once the MSG_MULTICAST network message buffer has been filled with data, this builtin is used to dispatch it to the given target, filtering by pvs for reduced network bandwidth. */
float(entity e, string key) infokeyf = #0:infokeyf; /*
Identical to regular infokey, except returns a float. */
#endif
#if defined(CSQC) || defined(SSQC)
string(float style, optional vector rgb) getlightstyle = #0:getlightstyle; /*
float(string) stof = #81; /* Part of FRIK_FILE, FTE_QC_INFOKEY, FTE_STRINGS, QW_ENGINE, ZQ_QC_STRINGS*/
#endif
#ifdef SSQC
#define unicast(pl,reli) do{msg_entity = pl; multicast('0 0 0', reli?MULITCAST_ONE_R:MULTICAST_ONE);}while(0)
void(vector where, float set) multicast = #82; /* Part of FTE_QC_MULTICAST
Once the MSG_MULTICAST network message buffer has been filled with data, this builtin is used to dispatch it to the given target, filtering by pvs for reduced network bandwidth. */
void(entity to, string str) redirectcmd = #101; /* Part of ??MVDSV_BUILTINS
Executes a single console command, and sends the text generated by it to the specified player. The command will be executed at the end of the frame once QC is no longer running - you may wish to pre/postfix it with 'echo'. */
#endif
#if defined(CSQC) || defined(SSQC)
string(float style, optional __out vector rgb) getlightstyle = #0:getlightstyle; /*
Obtains the light style string for the given style. */
vector(float style) getlightstylergb = #0:getlightstylergb; /*
@ -1785,7 +1814,7 @@ void(float sleeptime) sleep = #212; /* Part of FTE_MULTITHREADED
void(entity player, string key, string value) forceinfokey = #213; /* Part of FTE_FORCEINFOKEY
Directly changes a user's info without pinging off the client. Also allows explicitly setting * keys, including *spectator. Does not affect the user's config or other servers. */
void(string filename, float starttag, entity edict) chat = #214; /* Part of FTE_NPCCHAT*/
void(string filename, float starttag, entity edict) chat = #214; /* Part of FTE_QC_NPCCHAT*/
#endif
#if defined(CSQC) || defined(SSQC)
void(vector org, vector dmin, vector dmax, float colour, float effect, float count) particle2 = #215; /* Part of FTE_HEXEN2*/
@ -1869,7 +1898,9 @@ float(entity player) isbackbuffered = #234; /* Part of FTE_ISBACKBUFFERED
#endif
#if defined(CSQC) || defined(SSQC)
void(vector angle) rotatevectorsbyangle = #235;
void(vector angle) rotatevectorsbyangle = #235; /*
rotates the v_forward,v_right,v_up matrix by the specified angles. */
void(vector fwd, vector right, vector up) rotatevectorsbyvectors = #236;
float(float mdlindex, string skinname) skinforname = #237;
#endif
@ -1891,7 +1922,7 @@ float(vector viewpos, entity entity) checkpvs = #240; /* Part of FTE_QC_CHECKPVS
#endif
#ifdef SSQC
entity(string match, optional float matchnum) matchclientname = #241; /* Part of FTE_QC_MATCHCLIENTNAME*/
void(string dest, string content) sendpacket = #242; /* Part of FTE_QC_SENDPACKET*/
void(string destaddress, string content) sendpacket = #242; /* Part of FTE_QC_SENDPACKET*/
#endif
#ifdef CSQC
vector(entity ent, float tagnum) rotatevectorsbytag = #244;
@ -1937,10 +1968,27 @@ float(float modlindex, optional float useabstransforms) skel_create = #263; /* P
Allocates a new uninitiaised skeletal object, with enough bone info to animate the given model.
eg: self.skeletonobject = skel_create(self.modelindex); */
typedef struct
{
int sourcemodelindex; /*frame data will be imported from this model, bones must be compatible*/
int reserved;
int firstbone;
int lastbone;
float prescale; /*0 destroys existing data, 1 retains it*/
float scale[4]; /*you'll need to do lerpfrac manually*/
int animation[4];
float animationtime[4];
/*halflife models*/
float subblend[2];
float controllers[5];
} skelblend_t;
float(float skel, entity ent, float modelindex, float retainfrac, float firstbone, float lastbone, optional float addfrac) skel_build = #264; /* Part of FTE_CSQC_SKELETONOBJECTS
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, int numblends, skelblend_t *weights, int structsize) skel_build_ptr = #0:skel_build_ptr; /*
Like skel_build, but slightly simpler. */
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. */
@ -1963,12 +2011,16 @@ vector(float skel, float bonenum) skel_get_boneabs = #270; /* Part of FTE_CSQC_S
void(float skel, float bonenum, vector org, optional vector fwd, optional vector right, optional vector up) skel_set_bone = #271; /* Part of FTE_CSQC_SKELETONOBJECTS
Sets a bone position relative to its parent. If the orientation arguments are not specified, v_forward+v_right+v_up are used instead. */
void(float skel, float bonenum, vector org, optional vector fwd, optional vector right, optional vector up) skel_mul_bone = #272; /* Part of FTE_CSQC_SKELETONOBJECTS
void(float skel, float bonenum, vector org, optional vector fwd, optional vector right, optional vector up) skel_premul_bone = #272; /* Part of FTE_CSQC_SKELETONOBJECTS
Transforms a single bone by a matrix. You can use makevectors to generate a rotation matrix from an angle. */
void(float skel, float startbone, float endbone, vector org, optional vector fwd, optional vector right, optional vector up) skel_mul_bones = #273; /* Part of FTE_CSQC_SKELETONOBJECTS
void(float skel, float startbone, float endbone, vector org, optional vector fwd, optional vector right, optional vector up) skel_premul_bones = #273; /* Part of FTE_CSQC_SKELETONOBJECTS
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 skel, float bonenum, vector org, optional vector fwd, optional vector right, optional vector up) skel_postmul_bone = #0:skel_postmul_bone; /*
Transforms a single bone by a matrix. You can use makevectors to generate a rotation matrix from an angle. */
void(float skel, float bonenum, vector org, optional vector fwd, optional vector right, optional vector up) skel_mul_bone = #272; /* Part of FTE_CSQC_SKELETONOBJECTS
Transforms a single bone by a matrix. You can use makevectors to generate a rotation matrix from an angle. */
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. */
@ -1981,7 +2033,7 @@ float(float modidx, string framename) frameforname = #276; /* Part of FTE_CSQC_S
float(float modidx, float framenum) frameduration = #277; /* Part of FTE_CSQC_SKELETONOBJECTS
Retrieves the duration (in seconds) of the specified framegroup. */
void(float modidx, float framenum, __inout float basetime, float targettime, void(float timestamp, int code, string data) callback) processmodelevents = #0:processmodelevents; /*
void(float modidx, float framenum, __inout float basetime, float targettime, void(float timestamp, int code, string data) callback) processmodelevents = #0:processmodelevents; /* Part of FTE_GFX_MODELEVENTS
Calls a callback for each event that has been reached. Basetime is set to targettime. */
float(float modidx, float framenum, __inout float basetime, float targettime, __out int code, __out string data) getnextmodelevent = #0:getnextmodelevent; /*
@ -1992,11 +2044,12 @@ float(float modidx, float framenum, int eventidx, __out float timestamp, __out i
Reports an indexed event within a model's animation. Writes to timestamp,code,data arguments on success. Returns false if the animation/event/model was out of range/invalid. Does not consider looping animations (retry from index 0 if it fails and you know that its a looping animation). This builtin is more annoying to use than getnextmodelevent, but can be made to deal with multiple events with the exact same timestamp. */
#endif
#define dotproduct(a,b) ((vector)(a)*(vector)(b))
#define dotproduct(v1,v2) ((vector)(v1)*(vector)(v2))
vector(vector v1, vector v2) crossproduct = #0:crossproduct; /* Part of FTE_QC_CROSSPRODUCT
Small helper function to calculate the crossproduct of two vectors. */
#if defined(CSQC) || defined(SSQC)
float(entity pusher, vector move, vector amove) pushmove = #0:pushmove;
void(float action, optional vector pos, optional float radius, optional float quant, ...) terrain_edit = #278; /* Part of FTE_TERRAIN_MAP
Realtime terrain editing. Actions are the TEREDIT_ constants. */
@ -2031,6 +2084,14 @@ int(int faceid, brushface_t *in_faces, int numfaces, vector *points, int maxpoin
int(float modelid, vector *planes, float *dists, int numplanes, int *out_brushes, int *out_faces, int maxresults) brush_findinvolume = #0:brush_findinvolume; /* Part of FTE_RAW_MAP
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. */
typedef struct
{
vector dest;
int linkflags;
} nodeslist_t;
void(entity ent, vector dest, int denylinkflags, void(entity ent, vector dest, int numnodes, nodeslist_t *nodelist) callback) route_calculate = #0:route_calculate; /*
Begin calculating a route. The callback function will be called once the route has finished being calculated. The route must be memfreed once it is no longer needed. The route must be followed in reverse order (ie: the first node that must be reached is at index numnodes-1). If no route is available then the callback will be called with no nodes. */
void(optional entity ent, optional vector neworigin) touchtriggers = #279; /*
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. */
@ -2122,7 +2183,14 @@ void(entity ent) addentity = #302; /*
#endif
#ifdef CSQC
void(string texturename, float flags, void *verts, int *indexes, int numindexes) addtrisoup_1 = #0:addtrisoup_1; /*
void(entity ent) removeentity = #0:removeentity; /*
Undoes all addentities added to the scene from the given entity, without removing ALL entities (useful for splitscreen/etc, readd modified versions as desired). */
typedef float vec2[2];
typedef float vec3[3];
typedef float vec4[4];
typedef struct trisoup_simple_vert_s {vec3 xyz;vec2 st;vec4 rgba;} trisoup_simple_vert_t;
void(string texturename, int flags, struct trisoup_simple_vert_s *verts, int *indexes, int numindexes) addtrisoup_simple = #0:addtrisoup_simple; /*
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. */
#endif
@ -2184,7 +2252,7 @@ string(string name, optional float trywad) precache_pic = #317; /*
void(string imagename, int width, int height, int *pixeldata) r_uploadimage = #0:r_uploadimage; /* Part of FTE_CSQC_RAWIMAGES
Updates a texture with the specified rgba data. Will be created if needed. */
int*(string filename, __inout int width, __inout int height) r_readimage = #0:r_readimage; /* Part of FTE_CSQC_RAWIMAGES
int*(string filename, __out int width, __out int height) r_readimage = #0:r_readimage; /* Part of FTE_CSQC_RAWIMAGES
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. */
#define draw_getimagesize drawgetimagesize
@ -2244,7 +2312,7 @@ void(vector pivot, vector mins, vector maxs, string pic, vector txmin, vector tx
#ifdef CSQC
#define getstati_punf(stnum) (float)(__variant)getstati(stnum)
int(float stnum) getstati = #330; /*
Retrieves the numerical value of the given EV_INTEGER or EV_ENTITY stat (converted to a float). */
Retrieves the numerical value of the given EV_INTEGER or EV_ENTITY stat. Use getstati_punf if you wish to type-pun a float stat as an int to avoid truncation issues in DP. */
#define getstatbits getstatf
float(float stnum, optional float firstbit, optional float bitcount) getstatf = #331; /*
@ -2252,7 +2320,7 @@ float(float stnum, optional float firstbit, optional float bitcount) getstatf =
string(float stnum) getstats = #332; /*
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 QuakeWorld uses a separate namespace for string stats and has a much higher length limit. */
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. */
__variant(float playernum, float statnum, float stattype) getplayerstat = #0:getplayerstat; /*
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. */
@ -2273,7 +2341,8 @@ void(float effectnum, entity ent, vector start, vector end) trailparticles = #33
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, vector origin, optional vector dir, optional float count) pointparticles = #337; /* Part of FTE_SV_POINTPARTICLES
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. */
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. */
#endif
#ifdef CSQC
@ -2282,7 +2351,7 @@ void(string s, ...) cprint = #338; /*
#endif
#if defined(CSQC) || defined(SSQC)
void(string s, ...) print = #339; /*
void(string s, ...) print = #339; /* Part of DP_SV_PRINT
Unconditionally print on the local system's console, even in ssqc (doesn't care about the value of the developer cvar). */
#endif
@ -2340,6 +2409,9 @@ string(float playernum, string keyname) getplayerkeyvalue = #348; /*
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. */
float(float playernum, string keyname, optional float assumevalue) getplayerkeyfloat = #0:getplayerkeyfloat; /*
Cheaper version of getplayerkeyvalue that avoids the need for so many tempstrings. */
#endif
#if defined(CSQC) || defined(MENU)
float() isdemo = #349; /*
@ -2395,6 +2467,9 @@ float(entity ent) wasfreed = #353; /*
string(string key) serverkey = #354; /*
Look up a key in the server's public serverinfo string */
float(string key, optional float assumevalue) serverkeyfloat = #0:serverkeyfloat; /*
Version of serverkey that returns the value as a float (which avoids tempstrings). */
#endif
#ifdef CSQC
string(optional string resetstring) getentitytoken = #355; /*
@ -2406,16 +2481,16 @@ string(optional string resetstring) getentitytoken = #355; /*
#endif
#if defined(CSQC) || defined(MENU)
float(string s) findfont = #356; /*
float(string s) findfont = #356; /* Part of DP_GFX_FONTS
Looks up a named font slot. Matches the actual font name as a last resort. */
float(string fontname, string fontmaps, string sizes, float slot, optional float fix_scale, optional float fix_voffset) loadfont = #357; /*
float(string fontname, string fontmaps, string sizes, float slot, optional float fix_scale, optional float fix_voffset) loadfont = #357; /* Part of DP_GFX_FONTS
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.. */
#endif
#ifdef CSQC
void(string evname, string evargs, ...) sendevent = #359; /*
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. */
Invoke CSEv_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. */
float() readbyte = #360;
float() readchar = #361;
@ -2430,6 +2505,9 @@ float(string modelname, float(float isnew) updatecallback, float flags) deltalis
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(vector org, float radius, vector rgb) dynamiclight_spawnstatic = #0:dynamiclight_spawnstatic; /*
Creates a static persistent light at the given position with the specified colour. Additional properties must be set via dynamiclight_set. */
__variant(float lno, float fld) dynamiclight_get = #372; /*
Retrieves a property from the given dynamic/rt light. Return type depends upon the light field requested. */
@ -2444,8 +2522,13 @@ void(string shadername, vector origin, vector up, vector side, vector rgb, float
#endif
#if defined(CSQC) || defined(MENU)
void(entity e, string skinfilename, optional string skindata) setcustomskin = #376; /*
Sets an entity's skin overrides. These are custom per-entity surface->shader lookups. The skinfilename/data should be in .skin format:
void(entity e, string skinfilename, optional string skindata) setcustomskin = #376; /* Part of FTE_QC_CUSTOMSKINS
Sets an entity's skin overrides to a new skin object. Releases the entities old skin (refcounted). */
#endif
#ifdef CSQC
float(string skinfilename, optional string skindata) loadcustomskin = #377; /*
Creates a new skin object and returns it. These are custom per-entity surface->shader lookups. The skinfilename/data should be in .skin format:
surfacename,shadername - makes the named surface use the named shader
replace "surfacename" "shadername" - same.
qwskin "foo" - use an unmodified quakeworld player skin (including crop+repalette rules)
@ -2453,7 +2536,13 @@ void(entity e, string skinfilename, optional string skindata) setcustomskin = #3
q1upper 0x0000ff - specify an override for the entity's lower colour, in this case to blue
compose "surfacename" "shader" "imagename@x,y:w,h$s,t,s2,t2?r,g,b,a" - compose a skin texture from multiple images.
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). */
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). Must be matched with a releasecustomskin call later, and is pointless without applycustomskin. */
void(entity e, float skinobj) applycustomskin = #378; /*
Updates the entity's custom skin (refcounted). */
void(float skinobj) releasecustomskin = #379; /*
Lets the engine know that the skin will no longer be needed. Thanks to refcounting any ents with the skin already applied will retain their skin until later changed. It is valid to destroy a skin just after applying it to an ent in the same function that it was created in, as the skin will only be destroyed once its refcount rops to 0. */
#endif
__variant*(int size) memalloc = #384; /* Part of FTE_MEMALLOC
@ -2518,8 +2607,8 @@ void(entity ent, float colours) setcolors = #401; /*
#endif
#if defined(CSQC) || defined(SSQC)
entity(.string field, string match) findchain = #402; /* Part of DP_QC_FINDCHAIN*/
entity(.float fld, float match) findchainfloat = #403; /* Part of DP_QC_FINDCHAINFLOAT*/
entity(.string field, string match, optional .entity chainfield) findchain = #402; /* Part of DP_QC_FINDCHAIN*/
entity(.float fld, float match, optional .entity chainfield) findchainfloat = #403; /* Part of DP_QC_FINDCHAINFLOAT*/
void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404; /* Part of DP_SV_EFFECT
Spawns a self-animating sprite */
@ -2568,7 +2657,7 @@ void(strbuf bufhandle, float sortprefixlen, float backward) buf_sort = #444; /*
string(strbuf bufhandle, string glue) buf_implode = #445; /* Part of DP_QC_STRINGBUFFERS*/
string(strbuf bufhandle, float string_index) bufstr_get = #446; /* Part of DP_QC_STRINGBUFFERS*/
void(strbuf bufhandle, float string_index, string str) bufstr_set = #447; /* Part of DP_QC_STRINGBUFFERS*/
float(strbuf bufhandle, string str, float order) bufstr_add = #448; /* Part of DP_QC_STRINGBUFFERS*/
float(strbuf bufhandle, string str, float ordered) bufstr_add = #448; /* Part of DP_QC_STRINGBUFFERS*/
void(strbuf bufhandle, float string_index) bufstr_free = #449; /* Part of DP_QC_STRINGBUFFERS*/
float(string name) iscachedpic = #451;
string(string name, optional float trywad) precache_pic = #452;
@ -2610,7 +2699,7 @@ string(searchhandle handle, float num) search_getfilemtime = #0:search_getfilemt
#if defined(CSQC) || defined(SSQC)
string(string cvarname) cvar_string = #448; /* Part of DP_QC_CVAR_STRING*/
entity(entity start, .float fld, float match) findflags = #449; /* Part of DP_QC_FINDFLAGS*/
entity(.float fld, float match) findchainflags = #450; /* Part of DP_QC_FINDCHAINFLAGS*/
entity(.float fld, float match, optional .entity chainfield) findchainflags = #450; /* Part of DP_QC_FINDCHAINFLAGS*/
float(entity ent, string tagname) gettagindex = #451; /* Part of DP_MD3_TAGSINFO*/
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. */
@ -2633,7 +2722,7 @@ void(strbuf bufhandle, float sortprefixlen, float backward) buf_sort = #464; /*
string(strbuf bufhandle, string glue) buf_implode = #465; /* Part of DP_QC_STRINGBUFFERS*/
string(strbuf bufhandle, float string_index) bufstr_get = #466; /* Part of DP_QC_STRINGBUFFERS*/
void(strbuf bufhandle, float string_index, string str) bufstr_set = #467; /* Part of DP_QC_STRINGBUFFERS*/
float(strbuf bufhandle, string str, float order) bufstr_add = #468; /* Part of DP_QC_STRINGBUFFERS*/
float(strbuf bufhandle, string str, float ordered) bufstr_add = #468; /* Part of DP_QC_STRINGBUFFERS*/
void(strbuf bufhandle, float string_index) bufstr_free = #469; /* Part of DP_QC_STRINGBUFFERS*/
#endif
float(float s) asin = #471; /* Part of DP_QC_ASINACOSATANATAN2TAN*/
@ -2663,7 +2752,7 @@ string(string search, string replace, string subject) strireplace = #485; /* Par
vector(entity e, float s, float n, float a) getsurfacepointattribute = #486; /* Part of DP_QC_GETSURFACEPOINTATTRIBUTE*/
#endif
#if defined(CSQC) || defined(MENU)
float(string name) gecko_create = #487; /* Part of DP_GECKO_SUPPORT
float(string name, optional string initialURI) gecko_create = #487; /* Part of DP_GECKO_SUPPORT
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
@ -2672,7 +2761,7 @@ void(string name) gecko_destroy = #488; /* Part of DP_GECKO_SUPPORT
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
float(string name, float key, float eventtype, optional float charcode) 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
@ -2806,6 +2895,11 @@ float(string filename, strbuf bufhandle) buf_loadfile = #535; /*
float(filestream filehandle, strbuf bufhandle, optional float startpos, optional float numstrings) buf_writefile = #536; /*
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. */
#ifdef SSQC
float(optional float force) physics_supported = #0:physics_supported; /*
Queries whether rigid body physics is enabled or not. CSQC and SSQC may report different values. If the force argument is used then the engine will try to activate or release physics (returning the new state, which may fail if plugins or dlls are missing). Note that restarting the physics engine is likely to result in hitches when collision trees get generated. The state may change if a plugin is disabled mid-map. */
#endif
#if defined(CSQC) || defined(SSQC)
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. */
@ -2872,14 +2966,14 @@ void(float mask, float fld, string str, float op) sethostcachemaskstring = #616;
void(float mask, float fld, float num, float op) sethostcachemasknumber = #617; /* Part of FTE_CSQC_SERVERBROWSER*/
void() resorthostcache = #618; /* Part of FTE_CSQC_SERVERBROWSER*/
void(float fld, float descending) sethostcachesort = #619; /* Part of FTE_CSQC_SERVERBROWSER*/
void() refreshhostcache = #620; /* Part of FTE_CSQC_SERVERBROWSER*/
void(optional float dopurge) refreshhostcache = #620; /* Part of FTE_CSQC_SERVERBROWSER*/
float(float fld, float hostnr) gethostcachenumber = #621; /* Part of FTE_CSQC_SERVERBROWSER*/
float(string key) gethostcacheindexforkey = #622; /* Part of FTE_CSQC_SERVERBROWSER*/
void(string key) addwantedhostcachekey = #623; /* Part of FTE_CSQC_SERVERBROWSER*/
string() getextresponse = #624; /* Part of FTE_CSQC_SERVERBROWSER*/
#endif
string(string dnsname, optional float defport) netaddress_resolve = #625;
string(string fmt, ...) sprintf = #627;
string(string fmt, ...) sprintf = #627; /* Part of DP_QC_SPRINTF*/
#if defined(CSQC) || defined(SSQC)
float(entity e, float s) getsurfacenumtriangles = #628;
vector(entity e, float s, float n) getsurfacetriangle = #629;
@ -2951,11 +3045,13 @@ string(string digest, string data, ...) digest_hex = #639;
#define K_MOUSE8 521
#define K_MOUSE9 522
#define K_MOUSE10 523
#define K_LWIN 239
#define K_RWIN 240
#define K_MWHEELUP 515
#define K_MWHEELDOWN 516
#define K_LWIN -239
#define K_RWIN -240
#define K_APP -241
#define K_SEARCH -242
#define K_POWER 130
#define K_POWER -130
#define K_VOLUP -243
#define K_VOLDOWN -244
#define K_JOY1 768
@ -2995,15 +3091,76 @@ string(string digest, string data, ...) digest_hex = #639;
#define K_AUX31 814
#define K_AUX32 815
#define K_PAUSE 153
#define K_MWHEELUP 515
#define K_MWHEELDOWN 516
#define K_PRINTSCREEN 174
#define K_CAPSLOCK 155
#define K_SCROLLLOCK 156
#define K_SEMICOLON 59
#define K_PLUS 43
#define K_MINUS 45
#define K_TILDE 126
#define K_BACKQUOTE 96
#define K_BACKSLASH 92
#define K_GP_A 826
#define K_GP_B 827
#define K_GP_X 828
#define K_GP_Y 829
#define K_GP_LSHOULDER 824
#define K_GP_RSHOULDER 825
#define K_GP_LTRIGGER 830
#define K_GP_RTRIGGER 831
#define K_GP_BACK 821
#define K_GP_START 820
#define K_GP_LTHUMB 822
#define K_GP_RTHUMB 823
#define K_GP_DPAD_UP 816
#define K_GP_DPAD_DOWN 817
#define K_GP_DPAD_LEFT 818
#define K_GP_DPAD_RIGHT 819
#define K_GP_GUIDE -202
#define K_GP_UNKNOWN -255
#define K_GP_LTHUMB_UP 832
#define K_GP_LTHUMB_DOWN 833
#define K_GP_LTHUMB_LEFT 834
#define K_GP_LTHUMB_RIGHT 835
#define K_GP_RTHUMB_UP 836
#define K_GP_RTHUMB_DOWN 837
#define K_GP_RTHUMB_LEFT 838
#define K_GP_RTHUMB_RIGHT 839
#endif
#ifdef _ACCESSORS
accessor strbuf : float
{
inline get float asfloat[float idx] = {return stof(bufstr_get(this, idx));};
inline set float asfloat[float idx] = {bufstr_set(this, idx, ftos(value));};
get string[float] = bufstr_get;
set string[float] = bufstr_set;
get float length = buf_getsize;
};
accessor searchhandle : float
{
get string[float] = search_getfilename;
get float length = search_getsize;
};
accessor hashtable : float
{
inline get vector v[string key] = {return hash_get(this, key, '0 0 0', EV_VECTOR);};
inline set vector v[string key] = {hash_add(this, key, value, HASH_REPLACE|EV_VECTOR);};
inline get string s[string key] = {return hash_get(this, key, "", EV_STRING);};
inline set string s[string key] = {hash_add(this, key, value, HASH_REPLACE|EV_STRING);};
inline get float f[string key] = {return hash_get(this, key, 0.0, EV_FLOAT);};
inline set float f[string key] = {hash_add(this, key, value, HASH_REPLACE|EV_FLOAT);};
inline get __variant[string key] = {return hash_get(this, key, __NULL__);};
inline set __variant[string key] = {hash_add(this, key, value, HASH_REPLACE);};
};
accessor infostring : string
{
get string[string] = infoget;
inline seti& string[string fld] = {this = infoadd(this, fld, value);};
};
accessor filestream : float
{
get string = fgets;
inline set string = {fputs(this,value);};
};
#endif
#pragma noref 0

View File

@ -99,7 +99,7 @@ void CSQC_Init(float apilevel, string enginename, float engineversion) {
PARTICLE_SMOKEGRENADE = particleeffectnum( "smokegren" );
FONT_16 = loadfont( "16", "fonts/default", "16", -1 );
FONT_CON = loadfont( "font", "fonts/default", "12", -1 );
FONT_CON = loadfont( "font", "", "12", -1 );
SHADER_CULLED = shaderforname( "mirror_cull" );

View File

@ -69,7 +69,64 @@ float Math_CRandom( void ) {
void Damage_Apply( entity eTarget, entity eAttacker, int iDamage, vector vHitPos, int iSkipArmor );
#endif
void runplayerphysics(void)
{
Physics_Run();
{ //operates on self
float fallvel = ( self.flags & FL_ONGROUND )?0:-self.velocity_z;
if ( self.movetype == MOVETYPE_WALK ) {
// Crouching
if ( input_movevalues_z < 0 ) {
if ( !( self.flags & FL_CROUCHING ) ) {
//setorigin( self, self.origin - '0 0 32' );
self.flags |= FL_CROUCHING;
}
} else {
if ( self.flags & FL_CROUCHING && self.flags & FL_ONGROUND ) {
tracebox( self.origin + '0 0 18', VEC_HULL_MIN, VEC_HULL_MAX, self.origin + '0 0 18', FALSE, self );
if ( trace_startsolid == FALSE ) {
setorigin( self, self.origin + '0 0 18' );
self.flags -= FL_CROUCHING;
if ( self.velocity_z <= 0 ) {
self.velocity_z = self.velocity_z + 25;
}
}
}
}
}
// Adjust the bounds and the viewheight, as well as speed
if ( self.flags & FL_CROUCHING ) {
self.mins = VEC_CHULL_MIN;
self.maxs = VEC_CHULL_MAX;
self.view_ofs = VEC_PLAYER_CVIEWPOS;
} else {
self.mins = VEC_HULL_MIN;
self.maxs = VEC_HULL_MAX;
self.view_ofs = VEC_PLAYER_VIEWPOS;
}
self.maxspeed = Game_GetMaxSpeed( self.weapon );
runstandardplayerphysics( self );
if ( ( self.flags & FL_ONGROUND ) && self.movetype == MOVETYPE_WALK && ( fallvel > 100 )) {
#ifdef SSQC
if ( fallvel > 580 ) {
float fFallDamage = (fallvel-580) * ( 200 / ( 1024 - 580 ) );
Damage_Apply( self, world, fFallDamage, self.origin, FALSE );
}
#endif
#ifdef SSQC
if ( cvar( "pm_bunnyspeedcap") == 0 ) {
return;
}
#else
if ( serverkey( "pm_bunnyspeedcap") == 0 ) {
return;
}
#endif
if ( fallvel > 245 ) {
self.velocity *= 0.25;
}
}
}
#endif

View File

@ -35,6 +35,8 @@ var string autocvar_cl_logofile = "lambda";
var vector autocvar_cl_logocolor = '255 0 0';
var vector vHeaderButtonPos;
#define FONTSIZE '12 12'
var vector vMousePos;
var float fInputKeyCode;
var float fInputKeyASCII;

View File

@ -62,5 +62,5 @@ void m_draw( vector vScreenSize ) {
fcsMain[ iMenu ].vMenu();
Header_Draw();
drawstring( '16 16', sprintf( "FreeCS Version: %s\n", __DATE__ ), '12 12', '1 1 1', 1.0f, 0 );
drawstring( '16 16', sprintf( "FreeCS Version: %s\n", __DATE__ ), FONTSIZE, '1 1 1', 1.0f, 0 );
}

View File

@ -69,7 +69,7 @@ void m_init( void ) {
}
search_end( shSprays );
drawfont = loadfont( "font", "fonts/default", "12", -1 );
drawfont = loadfont( "font", "", "12", -1 );
}
/*

View File

@ -41,10 +41,10 @@ void Menu_Main( void ) {
if ( iHLContent == FALSE ) {
Object_Frame( '232 200', '400 96' );
Object_Label( '244 212', "Warning", '12 12' );
Object_Label( '244 248', "You have not copied over your 'valve' directory", '12 12' );
Object_Label( '244 258', "from Half-Life. This will cause missing models,", '12 12' );
Object_Label( '244 268', "sounds and textures. Be warned!", '12 12' );
Object_Label( '244 212', "Warning", FONTSIZE );
Object_Label( '244 248', "You have not copied over your 'valve' directory", FONTSIZE );
Object_Label( '244 258', "from Half-Life. This will cause missing models,", FONTSIZE );
Object_Label( '244 268', "sounds and textures. Be warned!", FONTSIZE );
}
Object_Button( '72 188', BTN_CONSOLE, Main_ButtonConsole, fButtonAlpha[0] );
@ -73,7 +73,7 @@ void Menu_Quit( void ) {
}
Object_Frame( '192 192', '256 96' );
Object_Label( '212 216', _("FREECS_QUITMSG"), '12 12' );
Object_Label( '212 216', _("FREECS_QUITMSG"), FONTSIZE );
Object_Button( '208 248', BTN_QUIT, Quit_Exit, fButtonAlpha[0] );
Object_Button( '364 248', BTN_CANCEL, Quit_Cancel, fButtonAlpha[1] );

View File

@ -144,7 +144,7 @@ void Object_TextButton( vector vPosition, string sButtonText, void() vFunction,
fAlpha = 0.0f;
}
if ( Menu_InputCheckMouse( vPosition, [stringwidth(sButtonText, TRUE, '12 12'), 12] ) == TRUE ) {
if ( Menu_InputCheckMouse( vPosition, [stringwidth(sButtonText, TRUE, FONTSIZE), 12] ) == TRUE ) {
if ( sLastButton != sButtonText ) {
localcmd( "play ../media/launch_deny2.wav\n" );
}
@ -160,7 +160,7 @@ void Object_TextButton( vector vPosition, string sButtonText, void() vFunction,
}
}
drawstring( vPosition, sButtonText, '12 12', autocvar_menu_fgcolor, fAlpha, 1 );
drawstring( vPosition, sButtonText, FONTSIZE, autocvar_menu_fgcolor, fAlpha, 1 );
}
/*
@ -192,7 +192,7 @@ A label in a cvar driven color scheme
*/
void Object_Label( vector vPosition, string sLabel, vector vSize ) {
vPosition += vMenuOffset;
drawstring( vPosition, sLabel, vSize, autocvar_menu_fgcolor, 1.0f, 0 );
drawstring( vPosition, sLabel, vSize, autocvar_menu_fgcolor, 1.0f, 0 );
}
/*
@ -308,9 +308,9 @@ void Object_CvarToggle( vector vPosition, string sLabel, string sCvar ) {
drawfill( vPosition + '-2 -2', [ iWidth + 36, 16 ], '0 0 0', 0.8f );
if ( cvar( sCvar ) == 0 ) {
drawstring( vPosition, sprintf( "[ ] %s", sLabel ), '12 12', autocvar_menu_fgcolor, fAlpha, 0 );
drawstring( vPosition, sprintf( "[ ] %s", sLabel ), FONTSIZE, autocvar_menu_fgcolor, fAlpha, 0 );
} else {
drawstring( vPosition, sprintf( "[X] %s", sLabel ), '12 12', autocvar_menu_fgcolor, fAlpha, 0 );
drawstring( vPosition, sprintf( "[X] %s", sLabel ), FONTSIZE, autocvar_menu_fgcolor, fAlpha, 0 );
}
}
@ -337,9 +337,9 @@ void Object_FuncToggle( vector vPosition, string sLabel, void( void ) vFunc, int
drawfill( vPosition + '-2 -2', [ iWidth + 36, 16 ], '0 0 0', 0.8f );
if ( iValue == 0 ) {
drawstring( vPosition, sprintf( "[ ] %s", sLabel ), '12 12', autocvar_menu_fgcolor, fAlpha, 0 );
drawstring( vPosition, sprintf( "[ ] %s", sLabel ), FONTSIZE, autocvar_menu_fgcolor, fAlpha, 0 );
} else {
drawstring( vPosition, sprintf( "[X] %s", sLabel ), '12 12', autocvar_menu_fgcolor, fAlpha, 0 );
drawstring( vPosition, sprintf( "[X] %s", sLabel ), FONTSIZE, autocvar_menu_fgcolor, fAlpha, 0 );
}
}
@ -374,8 +374,8 @@ void Object_Textfield( vector vPosition, __inout string strValue, int iMaxChars
}
}
fFieldAlpha = 1.0f;
drawstring( vPosition, sprintf( "%s_", strValue ), '12 12', autocvar_menu_fgcolor, fFieldAlpha, FALSE );
drawstring( vPosition, sprintf( "%s_", strValue ), FONTSIZE, autocvar_menu_fgcolor, fFieldAlpha, FALSE );
} else {
drawstring( vPosition, strValue, '12 12', autocvar_menu_fgcolor, fFieldAlpha, FALSE );
drawstring( vPosition, strValue, FONTSIZE, autocvar_menu_fgcolor, fFieldAlpha, FALSE );
}
}

View File

@ -139,12 +139,17 @@ void SV_RunClientCommand( void ) {
self.fInBuyZone = FALSE;
self.fInHostageZone = FALSE;
if (clienttype(self) == CLIENTTYPE_BOT) {
((CBot)self).RunAI();
}
if ( fGameState == GAME_FREEZE && self.health > 0 ) {
input_movevalues = '0 0 0';
//input_buttons = 0;
input_impulse = 0;
}
Input_Handle();
runplayerphysics();
}

View File

@ -87,14 +87,116 @@ void SV_ParseClientCommand( string sCommand ) {
}
float ConsoleCmd( string sCommand ) {
CBot bot;
if ( !self ) {
for ( other = world; ( other = find( other, classname, "player" ) ); ) {
if ( clienttype( other ) == CLIENTTYPE_REAL ) {
self = other;
break;
}
}
}
tokenize( sCommand );
if ( argv( 0 ) == "vox" ) {
switch ( argv( 0 ) ) {
case "bot_add":
bot = (CBot)spawnclient();
if ( !bot ) {
print( "Server is full\n" );
return TRUE;
}
bot.CreateRandom();
break;
case "bot_follow":
if ( !self ) {
return TRUE;
}
for ( other = world; ( other = find( other, classname, "Player" ) ); ) {
if ( clienttype( other ) != CLIENTTYPE_BOT ) {
continue;
}
bot = (CBot)other;
if ( bot.route ) {
// RT_RouteChange( bot.route, bot.origin, self.origin );
} else {
// RT_Destroy( bot.route );
// bot.route = RT_RouteCreate( bot.origin, self.origin );
}
}
break;
case "bot_kill":
if ( !self ) {
return TRUE;
}
for ( other = world; ( other = find( other, classname, "Player" ) ); ) {
if ( clienttype( other ) != CLIENTTYPE_BOT ) {
continue;
}
if ( argv( 1 ) ) {
if ( other.netname == argv( 1 ) ) {
//Damage_Apply( other, other, 500, DAMAGE_SUICIDE, 0 );
break;
}
} else {
//Damage_Apply( other, other, 500, DAMAGE_SUICIDE, 0 );
}
}
break;
case "bot_kick":
if ( !self ) {
return TRUE;
}
for ( other = world; ( other = find( other, classname, "Player" ) ); ) {
if ( clienttype( other ) != CLIENTTYPE_BOT ) {
continue;
}
if ( argv( 1 ) ) {
if ( other.netname == argv( 1 ) ) {
dropclient( other );
break;
}
} else {
dropclient( other );
}
}
break;
case "way_add":
if ( !self ) {
return TRUE;
}
Way_Waypoint_Create( self, TRUE );
break;
case "way_delete":
if ( !self ) {
return TRUE;
}
Way_Waypoint_Delete( Way_FindClosestWaypoint( self.origin ) );
break;
case "way_radius":
if ( !self ) {
return TRUE;
}
Way_Waypoint_SetRadius( Way_FindClosestWaypoint( self.origin ), stof( argv( 1 ) ) );
break;
case "way_makejump":
if ( !self ) {
return TRUE;
}
Way_Waypoint_MakeJump( Way_FindClosestWaypoint( self.origin ) );
break;
case "way_save":
Way_DumpWaypoints( argv( 1 ) );
break;
case "way_load":
Way_ReadWaypoints( argv( 1 ) );
break;
case "vox":
Vox_Broadcast( argv( 1 ) );
return TRUE;
break;
default:
return FALSE;
}
return FALSE;
return TRUE;
}
void SV_PausedTic( float fDuration ) {
@ -238,6 +340,8 @@ void worldspawn( void ) {
precache_model( sWeaponModels[ i ] );
}
Bot_Init();
precache_model( "models/w_flashbang.mdl" );
precache_model( "models/w_hegrenade.mdl" );
precache_model( "models/w_smokegrenade.mdl" );

View File

@ -218,7 +218,6 @@ Run before physics
=================
*/
void PlayerPreThink( void ) {
Input_Handle();
BaseGun_ShotMultiplierUpdate();
}

View File

@ -71,6 +71,10 @@ FuncVehicle.c
ArmouryEntity.c
AmbientSound.c
Bot/Bot.h
Bot/Way.c
Light.c
Main.c
Player.c
@ -78,4 +82,7 @@ Spawn.c
Footsteps.c
Input.c
Client.c
Bot/Route.c
Bot/Bot.c
#endlist

View File

@ -24,9 +24,9 @@ vector input_movevalues;
float input_buttons;
#define PHYSICS_STEPHEIGHT 18
#define PHYSICS_AIRSTEPHEIGHT 18
#define PHYSICS_AIRSTEPHEIGHT 18
#define PHYSICS_FRICTION 4
#define PHYSICS_EDGEFRICTION 2
#define PHYSICS_EDGEFRICTION 2
#define PHYSICS_GRAVITY 800
#define PHYSICS_ACCELERATE 10
#define PHYSICS_STOPSPEED 100
@ -133,39 +133,7 @@ void Physics_Run_Acceleration( float flMovetime, float flBefore ) {
return;
}
if ( self.movetype == MOVETYPE_WALK ) {
// Crouching
if ( input_movevalues_z < 0 ) {
if ( !( self.flags & FL_CROUCHING ) ) {
setorigin( self, self.origin - '0 0 18' );
self.flags |= FL_CROUCHING;
}
} else {
if ( self.flags & FL_CROUCHING || ( self.flags & FL_CROUCHING ) ) {
tracebox( self.origin + '0 0 18', VEC_HULL_MIN, VEC_HULL_MAX, self.origin + '0 0 18', FALSE, self );
if ( trace_startsolid == FALSE ) {
setorigin( self, self.origin + '0 0 18' );
self.flags -= FL_CROUCHING;
if ( self.velocity_z <= 0 ) {
self.velocity_z = self.velocity_z + 25;
}
}
}
}
}
// Adjust the bounds and the viewheight, as well as speed
if ( self.flags & FL_CROUCHING ) {
self.mins = VEC_CHULL_MIN;
self.maxs = VEC_CHULL_MAX;
self.view_ofs = VEC_PLAYER_CVIEWPOS;
} else {
self.mins = VEC_HULL_MIN;
self.maxs = VEC_HULL_MAX;
self.view_ofs = VEC_PLAYER_VIEWPOS;
}
self.maxspeed = Game_GetMaxSpeed( self.weapon );
makevectors( input_angles );
// swim

Binary file not shown.

View File

@ -56,6 +56,7 @@ seta v_bob 0.01
seta v_bobup 0.5
seta r_particledesc default
seta pm_bunnyspeedcap "1"
seta pm_stepdown 1
seta sv_accelerate "4"
seta con_textsize "12"
seta con_color "255 170 0"
@ -86,4 +87,4 @@ seta lang "en_us"
seta cfg_save_auto "1"
seta r_meshpitch "1"
seta gl_overbright "0"
seta gl_font "fonts/default"
seta gl_font "gfx/wfont?fmt=h"

Binary file not shown.

Binary file not shown.