FTEQW
Documentation of the FTE engine source tree.
progdefs.h
Go to the documentation of this file.
1/*
2Copyright (C) 1996-1997 Id Software, Inc.
3
4This program is free software; you can redistribute it and/or
5modify it under the terms of the GNU General Public License
6as published by the Free Software Foundation; either version 2
7of the License, or (at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13See the GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program; if not, write to the Free Software
17Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19*/
20
21/* file generated by qcc, do not modify */
22
23typedef struct globalvars_s
24{
26 union {
30 } ret;
31 union {
33 pvec_t f;
34 pint_t i;
35 } param[8];
37
38#define NUM_SPAWN_PARMS 64
39typedef struct nqglobalvars_s
40{
63#ifdef HAVE_LEGACY
65#endif
68#ifdef HAVE_LEGACY
70#endif
83#ifdef HAVE_LEGACY
88#endif
103
105
138
140 pvec_t *spawnparamglobals[NUM_SPAWN_PARMS];
144
145#define P_VEC(v) (pr_global_struct->v)
146
147
148#ifndef HAVE_LEGACY
149#define comfieldfloat_legacy(n,desc)
150#define comfieldfloatdep_legacy(n,desc,depreason)
151#else
152#define comfieldfloat_legacy comfieldfloat
153#define comfieldfloatdep_legacy comfieldfloatdep
154#endif
155
156#ifndef QUAKESTATS
157#define comfieldfloat_legacystat(n,desc)
158#define comfieldfloatdep_legacystat(n,desc,depreason)
159#else
160#define comfieldfloat_legacystat comfieldfloat
161#define comfieldfloatdep_legacystat comfieldfloatdep
162#endif
163
164/*my hands are tied when it comes to the layout of this structure
165On the server side, the structure *must* match original quakeworld, or we break compatibility with mvdsv's qvm api
166On the client, it really doesn't matter what order fields are in, qclib will remap.
167But fields that are actually useful on both sides need to be in the same locations.
168But if we include all, that's a waste for csqc...
169But we can overlap useful csqc-only ones with ssqc ones that are not going to be used on the client, so long as the types match.
170This list isn't shared with the menu.
171
172so the base fields are a fixed size
173and the extension fields are added on the end and can have extra vm-specific stuff added on the end
174*/
175/*DO NOT ADD TO THIS STRUCTURE (base-qw-compat for q1qvm)*/
176#define comqcfields \
177 comfieldfloat(modelindex,"This is the model precache index for the model that was set on the entity, instead of having to look up the model according to the .model field. Use setmodel to change it.")\
178 comfieldvector(absmin,"Set by the engine when the entity is relinked (by setorigin, setsize, or setmodel). This is in world coordinates.")\
179 comfieldvector(absmax,"Set by the engine when the entity is relinked (by setorigin, setsize, or setmodel). This is in world coordinates.")\
180 comfieldfloat(ltime,"On MOVETYPE_PUSH entities, this is used as an alternative to the 'time' global, and .nextthink is synced to this instead of time. This allows time to effectively freeze if the entity is blocked, ensuring the think happens when the entity reaches the target point instead of randomly.")\
181 comfieldfloat(lastruntime,"This field used to be used to avoid running an entity multiple times in a single frame due to quakeworld's out-of-order thinks. It is no longer used by FTE due to precision issues, but may still be updated for compatibility reasons.") /*type doesn't match the qc, we use a hidden double instead. this is dead.*/ \
182 comfieldfloat(movetype,"Describes how the entity moves. One of the MOVETYPE_ constants.")\
183 comfieldfloat(solid,"Describes whether the entity is solid or not, and any special properties infered by that. Must be one of the SOLID_ constants")\
184 comfieldvector(origin,"The current location of the entity in world space. Inline bsp entities (ie: ones placed by a mapper) will typically have a value of '0 0 0' in their neutral pose, as the geometry is offset from that. It is the reference point of the entity rather than the center of its geometry, for non-bsp models, this is often not a significant distinction.")\
185 comfieldvector(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.")\
186 comfieldvector(velocity,"The direction and speed that the entity is moving in world space.")\
187 comfieldvector(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.")\
188 comfieldvector(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.")\
189 comfieldstring(classname,"Identifies the class/type of the entity. Useful for debugging, also used for loading, but its value is not otherwise significant to the engine, this leaves the mod free to set it to whatever it wants and randomly test strings for values in whatever inefficient way it chooses fit.")\
190 comfieldstring(model,"The model name that was set via setmodel, in theory. Often, this is cleared to null to prevent the engine from being seen by clients while not changing modelindex. This behaviour allows inline models to remain solid yet be invisible.")\
191 comfieldfloat(frame,"The current frame the entity is meant to be displayed in. In CSQC, note the lerpfrac and frame2 fields as well. if it specifies a framegroup, the framegroup will autoanimate in ssqc, but not in csqc.")\
192 comfieldfloat(skin,"The skin index to use. on a bsp entity, setting this to 1 will switch to the 'activated' texture instead. A negative value will be understood as a replacement contents value, so setting it to CONTENTS_WATER will make a movable pool of water.")\
193 comfieldfloat(effects,"Lots of random flags that change random effects.")\
194 comfieldvector(mins,"The minimum extent of the model (ie: the bottom-left coordinate relative to the entity's origin). Change via setsize. May also be changed by setmodel.")\
195 comfieldvector(maxs,"like mins, but in the other direction.")\
196 comfieldvector(size,"maxs-mins. Updated when the entity is relinked (by setorigin, setsize, setmodel)")\
197 comfieldfunction(touch, ".void()",NULL)\
198 comfieldfunction(use, ".void()",NULL)\
199 comfieldfunction(think, ".void()",NULL)\
200 comfieldfunction(blocked, ".void()",NULL)\
201 comfieldfloat(nextthink,"The time at which the entity is next scheduled to fire its think event. For MOVETYPE_PUSH entities, this is relative to that entity's ltime field, for all other entities it is relative to the time gloal.")\
202 comfieldentity(groundentity,NULL)\
203 comfieldfloat(health,NULL)\
204 comfieldfloat(frags,NULL)\
205 comfieldfloat(weapon,NULL)\
206 comfieldstring(weaponmodel,NULL)\
207 comfieldfloat(weaponframe,NULL)\
208 comfieldfloat(currentammo,NULL)\
209 comfieldfloat(ammo_shells,NULL)\
210 comfieldfloat(ammo_nails,NULL)\
211 comfieldfloat(ammo_rockets,NULL)\
212 comfieldfloat(ammo_cells,NULL)\
213 comfieldfloat(items,NULL)\
214 comfieldfloat(takedamage,NULL)\
215 comfieldentity(chain,NULL)\
216 comfieldfloat(deadflag,NULL)\
217 comfieldvector(view_ofs,NULL)\
218 comfieldfloat(button0,NULL)\
219 comfieldfloat(button1,NULL) /*dead field in nq mode*/ \
220 comfieldfloat(button2,NULL)\
221 comfieldfloat(impulse,NULL)\
222 comfieldfloat(fixangle,NULL)\
223 comfieldvector(v_angle,"The angles a player is viewing. +x is DOWN (pitch, yaw, roll)")\
224 comfieldstring(netname,NULL)\
225 comfieldentity(enemy,NULL)\
226 comfieldfloat(flags,NULL)\
227 comfieldfloat(colormap,NULL)\
228 comfieldfloat(team,NULL)\
229 comfieldfloat(max_health,NULL)\
230 comfieldfloat(teleport_time,NULL)\
231 comfieldfloat(armortype,NULL)\
232 comfieldfloat(armorvalue,NULL)\
233 comfieldfloat(waterlevel,NULL)\
234 comfieldfloat(watertype,NULL)\
235 comfieldfloat(ideal_yaw,NULL)\
236 comfieldfloat(yaw_speed,NULL)\
237 comfieldentity(aiment,NULL)\
238 comfieldentity(goalentity,NULL)\
239 comfieldfloat(spawnflags,NULL)\
240 comfieldstring(target,NULL)\
241 comfieldstring(targetname,NULL)\
242 comfieldfloat(dmg_take,NULL)\
243 comfieldfloat(dmg_save,NULL)\
244 comfieldentity(dmg_inflictor,NULL)\
245 comfieldentity(owner,NULL)\
246 comfieldvector(movedir,NULL)\
247 comfieldstring(message,NULL) /*don't use directly, hexen2 uses floats, so we go via qclib for message*/\
248 comfieldfloat(sounds,NULL)\
249 comfieldstring(noise,NULL)\
250 comfieldstring(noise1,NULL)\
251 comfieldstring(noise2,NULL)\
252 comfieldstring(noise3,NULL)
253/*DO NOT ADD TO THE ABOVE STRUCTURE (unless you want to break qvms)*/
254
255#ifdef HEXEN2
256#define comextqcfieldshexen2 \
257 comfieldfloat(drawflags,"Various flags that affect lighting values and scaling. Typically set to 96 in quake for proper compatibility with DP_QC_SCALE.")/*hexen2*/\
258 comfieldfloat(abslight,"Allows overriding light levels. Use drawflags to state that this field should actually be used.")/*hexen2's force a lightlevel*/\
259
260#define svextqcfieldshexen2 \
261 comfieldfloat(playerclass,NULL)/*hexen2 requirements*/\
262 comfieldfloat(hasted,NULL)/*hexen2 uses this AS WELL as maxspeed*/\
263 comfieldfloat(light_level,"Used by hexen2 to indicate the light level where the player is standing.")\
264
265#else
266#define comextqcfieldshexen2
267#define svextqcfieldshexen2
268#endif
269
270#define comextqcfields \
271 comfieldvector(punchangle,NULL) /*std in nq*/\
272 comfieldfloat(gravity,"Multiplier applied in addition to sv_gravity (not absolute units), to control the gravity affecting this entity specifically.") /*added in quake 1.09 (for hipnotic)*/\
273 comfieldfloat(hull,"Overrides the hull used by the entity for walkmove/movetogoal and not traceline/tracebox.")/*PEXT_HEXEN2*/\
274 comfieldentity(movechain,"This is a linked list of entities which will be moved whenever this entity moves, logically they are attached to this entity.")/*hexen2*/\
275 comfieldfunction(chainmoved, ".void()","Called when the entity is moved as a result of being part of another entity's .movechain")/*hexen2*/\
276 comfieldfunction(contentstransition, ".void(float old, float new)","This function is called when the entity moves between water and air. If specified, default splash sounds will be disabled allowing you to provide your own.")/*ENTITYCONTENTSTRANSITION*/\
277 comfieldfloat(dimension_solid,"This is the bitmask of dimensions which the entity is solid within. This is not networked, instead csqc traces impacting ssqc entities assumes the ssqc entity to have a dimension_solid of 1.")/*EXT_DIMENSION_PHYSICS*/\
278 comfieldfloat(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.")/*EXT_DIMENSION_PHYSICS*/\
279 /*comfieldfloat_legacy(hitcontentsmask,"Traces performed for this entity will impact against surfaces that match this contents mask.")*/ \
280 comfieldint(hitcontentsmaski,"Traces performed for this entity will impact against surfaces that match this contents mask (CONTENTBITS_* constants).")\
281 comfieldfloatdep_legacy(dphitcontentsmask, "Some crappy field that inefficiently requires translating to the native contents flags. Ditch the 'dp', do it properly.", "Does not support mod-specific contents.")\
282 comfieldfloat(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.")/*DP_ENT_SCALE*/\
283 comfieldfloat(fatness,"How many QuakeUnits to push the entity's verticies along their normals by.")/*FTE_PEXT_FATNESS*/\
284 comfieldfloat(alpha,"The transparency of the entity. 1 means opaque, 0.0001 means virtually invisible. 0 is remapped to 1, for compatibility.")/*DP_ENT_ALPHA*/\
285 comfieldfloat(modelflags,"Used to override the flags set in the entity's model. Should be set according to the MF_ constants. Use effects|=EF_NOMODELFLAGS to ignore the model's flags completely. The traileffectnum field is more versatile.")\
286 comfieldfloat(frame1time,"This controls the time into the framegroup/animation named by .frame, you should increment this value according to frametime or to distance moved, depending on the sort of animation you're attempting. You may wish to avoid incrementing this while lerpfrac is still changing, to avoid wasting parts of the animation.") /*EXT_CSQC_1*/\
287 comfieldfloat(basebone,"The base* frame animations are equivelent to their non-base versions, except that they only affect bone numbers below the 'basebone' value. This means that the base* animation can affect the legs of a skeletal model independantly of the normal animation fields affecting the torso area. For more complex animation than this, use skeletal objects.") /*FTE_QC_BASEFRAME*/\
288 comfieldfloat(baseframe,"See basebone") /*FTE_QC_BASEFRAME*/\
289 comfieldfunction(customphysics,".void()", "Called once each physics frame, overriding the entity's .movetype field and associated logic. You'll probably want to use tracebox to move it through the world. Be sure to call .think as appropriate.")\
290 comfieldentity(tag_entity,"Specifies which entity this entity's origin+angles is 'attached' to.")\
291 comfieldfloat(tag_index,"Specifies the tag or bone on the parent entity that we're attached to. If this is -1 then the entity is instead a q3-like camera portal, with the tag_entity saying the entity to display for. If tag_entity is world then this is a q3-like portal surface marker with a separate camera (with a tag_entity referring to the portal surface).")\
292 comfieldfloat(skeletonindex,"This object serves as a container for the skeletal bone states used to override the animation data.") /*FTE_CSQC_SKELETONOBJECTS*/\
293 comfieldvector(colormod,"Provides a colour tint for the entity (does not affect fullbrights).")\
294 comfieldvector(glowmod,"Scaler for an entity's fullbright textures.")\
295 comfieldvector(gravitydir,"Specifies the direction in which gravity acts. Must be normalised. '0 0 0' also means down. Use '0 0 1' if you want the player to be able to run on ceilings.")\
296 comfieldfunction(camera_transform,".vector(vector org, vector ang)", "A callback that provides portal transform information for portal surfaces attached to this entity. Also used to open up pvs in ssqc.")\
297 comfieldfloat(pmove_flags,NULL)/*EXT_CSQC_1*/\
298 comfieldfloat(geomtype,NULL)/*DP_...PHYSICS*/\
299 comfieldfloat(friction,NULL)/*DP_...PHYSICS*/\
300 comfieldfloat(erp,NULL)/*DP_...PHYSICS*/\
301 comfieldfloat(jointtype,NULL)/*DP_...PHYSICS*/\
302 comfieldfloat(mass,NULL)/*DP_...PHYSICS*/\
303 comfieldfloat(bouncefactor,NULL)/*DP_...PHYSICS*/\
304 comfieldfloat(bouncestop,NULL)/*DP_...PHYSICS*/\
305 comfieldfloat(idealpitch,NULL)/*DP_QC_CHANGEPITCH (inconsistant naming)*/\
306 comfieldfloat(pitch_speed,NULL)/*DP_QC_CHANGEPITCH*/\
307 comextqcfieldshexen2 \
308 comfieldvector(color,"This affects the colour of realtime lights that were enabled via the pflags field.")/*Hexen2 has a .float color, the warnings should be benign but does mean updated hexen2 mods may need to use color_x for map compat*/ \
309 comfieldfloat(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).")\
310 comfieldfloat(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.")\
311 comfieldfloat(pflags,"Realtime lighting flags")
312
313#ifdef HEXEN2
314#else
315#define svextqcfieldshexen2
316#endif
317
318#ifdef PEXT_VIEW2
319#define svextqcfield_clientcamera comfieldentity(clientcamera,"Controls which entity to use for this client's camera.")
320#else
321#define svextqcfield_clientcamera
322#endif
323
324#define svextqcfields \
325 comfieldfloat(maxspeed,NULL)/*added in quake 1.09*/\
326 comfieldentity(view2,"defines a second viewpoint, typically displayed in a corner of the screen (also punches open pvs).")/*FTE_PEXT_VIEW2*/\
327 comfieldvector(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.")\
328 comfieldfloat(vw_index,"This acts as a second modelindex, using the same frames etc.")\
329 comfieldentitydep(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.", "Cannot be recorded in MVDs, nor work properly with splitscreen. Use CSQC instead.")\
330 comfieldentitydep(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.", "Cannot be recorded in MVDs, nor work properly with splitscreen. Use CSQC instead.")\
331 comfieldentitydep(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.", "Redundant. Cannot be recorded in MVDs, nor work properly with splitscreen. Use CSQC instead.")/*DP_ENT_VIEWMODEL*/\
332 comfieldentitydep(exteriormodeltoclient,"This entity will be invisible to the player named by this field, except in mirrors or mirror-like surfaces, where it will be visible as normal. It may still cast shadows as normal, and generate lights+particles, depending on client settings. Does not affect how other players see the entity.", "Cannot be recorded in MVDs, nor work properly with splitscreen. Use CSQC instead.")\
333 svextqcfield_clientcamera\
334 comfieldfloat(glow_size,"Some outdated particle trail thing.")\
335 comfieldfloat(glow_color,"Some outdated particle trail thing.")\
336 comfieldfloat(glow_trail,"Some outdated particle trail thing.")\
337 comfieldfloat(traileffectnum,"This should be set to the result of particleeffectnum, in order to attach a custom trail effect to an entity as it moves.")/*DP_ENT_TRAILEFFECTNUM*/\
338 comfieldfloat(emiteffectnum,"This should be set to the result of particleeffectnum, in order to continually spawn particles in the direction that this entity faces.")/*DP_ENT_TRAILEFFECTNUM*/\
339 /*comfieldfloat(baseframe,"Specifies the current frame(group) to use for the lower (numerically) bones of a skeletal model. The basebone field specifies the bone where the regular frame field takes over.")*/ /*FTESS_QC_BASEFRAME*/\
340 /*comfieldfloat(basebone,"Specifies the bone at which the baseframe* fields stop being effective.")*/ /*FTE_SSQC_BASEFRAME*/\
341 comfieldfloatdep(dimension_see,"This is the dimension mask (bitfield) that the client is allowed to see. Entities and events not in this dimension mask will be invisible.", "Does not work with MVDs nor splitscreen.")/*EXT_DIMENSION_VISIBLE*/\
342 comfieldfloatdep(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.", "Does not work with MVDs nor splitscreen.")/*EXT_DIMENSION_VISIBLE*/\
343 comfieldfloatdep(dimension_ghost,"If this entity is visible only within these dimensions, it will become transparent, as if a ghost.", "Does not work with MVDs nor splitscreen.")/*EXT_DIMENSION_GHOST*/\
344 comfieldfloatdep(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.", "Does not work with MVDs nor splitscreen.")/*EXT_DIMENSION_GHOST*/\
345 comfieldfunction(SendEntity, ".float(entity playerent, float changedflags)","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.")/*EXT_CSQC*/\
346 comfieldfloat(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.")/*EXT_CSQC_1 (one of the DP guys came up with it)*/\
347 comfieldfloatdep_legacy(Version,"Obsolete", "Use SendFlags instead.")/*EXT_CSQC (obsolete)*/\
348 comfieldfloatdep_legacy(clientcolors,NULL, "Doesn't support RGB player colours.")\
349 comfieldfloat_legacystat(viewzoom,NULL)/*DP_VIEWZOOM, stats*/\
350 comfieldfloat_legacystat(items2,"stub. commented by default, to prevent items2 being networked instead of runes.") /*added in quake 1.09 (for hipnotic). legacy because of stats*/\
351 svextqcfieldshexen2 \
352 comfieldfloat(pvsflags,"Reconfigures when the entity is visible to clients")/*EXT_CSQC_1*/\
353 comfieldfloat(uniquespawnid,"Incremented by 1 whenever the entity is respawned. Persists across remove calls, for when the two-second grace period is insufficient.")/*FTE_ENT_UNIQUESPAWNID*/\
354 comfieldfunction(customizeentityforclient, "DEP_CSQC .float()","Called just before an entity is sent to a client (non-csqc protocol). This gives you a chance to tailor 'self' according to what 'other' should see.")
355
356#ifdef HALFLIFEMODELS
357#define HALFLIFEMODEL_FIELDS \
358 comfieldfloat(bonecontrol1,"Halflife model format bone controller. On player models, this typically affects the spine's yaw.") /*FTE_CSQC_HALFLIFE_MODELS*/\
359 comfieldfloat(bonecontrol2,"Halflife model format bone controller. On player models, this typically affects the spine's yaw.") /*FTE_CSQC_HALFLIFE_MODELS*/\
360 comfieldfloat(bonecontrol3,"Halflife model format bone controller. On player models, this typically affects the spine's yaw.") /*FTE_CSQC_HALFLIFE_MODELS*/\
361 comfieldfloat(bonecontrol4,"Halflife model format bone controller. On player models, this typically affects the spine's yaw.") /*FTE_CSQC_HALFLIFE_MODELS*/\
362 comfieldfloat(bonecontrol5,"Halflife model format bone controller. This typically affects the mouth.") /*FTE_CSQC_HALFLIFE_MODELS*/\
363 comfieldfloat(subblendfrac,"Weird animation value specific to halflife models. On player models, this typically affects the spine's pitch, or yaw, or...") /*FTE_CSQC_HALFLIFE_MODELS*/\
364 comfieldfloat(subblend2frac,"Weird animation value specific to halflife models. I've no idea what this does, probably nothing for most models.") /*FTE_CSQC_HALFLIFE_MODELS*/\
365 comfieldfloat(basesubblendfrac,"See basebone") /*FTE_CSQC_HALFLIFE_MODELS+FTE_CSQC_BASEFRAME*/\
366 comfieldfloat(basesubblend2frac,"See basebone") /*FTE_CSQC_HALFLIFE_MODELS+FTE_CSQC_BASEFRAME*/
367#else
368#define HALFLIFEMODEL_FIELDS
369#endif
370
371#if FRAME_BLENDS >= 4
372#define frame34fields \
373 comfieldfloat(frame3,"Some people just don't understand how to use framegroups...") \
374 comfieldfloat(frame3time,".frame3 equivelent of frame1time.") /*EXT_CSQC_1*/\
375 comfieldfloat(lerpfrac3,"Weight of .frame3 - .frame's weight is automatically calculated as 1-(lerpfrac+lerpfrac3+lerpfrac4), as a result these fields should NEVER add to above 1.") \
376 comfieldfloat(frame4,NULL) \
377 comfieldfloat(frame4time,".frame4 equivelent of frame1time.") /*EXT_CSQC_1*/\
378 comfieldfloat(lerpfrac4,NULL) \
379
380#else
381#define frame34fields
382#endif
383
384//this is the list for all the csqc fields.
385//(the #define is so the list always matches the ones pulled out)
386#define csqcextfields \
387 comfieldfloat(entnum,"This is the number of the entity that the ssqc is using.") \
388 comfieldfloat(frame2,"This is typically the old frame of the entity. if lerpfrac is 1, .frame will be ignored and .frame2 will be used solely. lerpfrac 0.5 will give an even 50/50 blend.") /*EXT_CSQC_1*/\
389 comfieldfloat(frame2time,".frame2 equivelent of frame1time.") /*EXT_CSQC_1*/\
390 comfieldfloat(lerpfrac,"The weight of .frame2 (with the weight of .frame being inferred). A value of 0 normally means the entity will animate using only .frame, while 1 would exclusively be .frame2. As this value is incremented, more of frame2 will be used. If you wish to use .frame2 as the 'old' frame, it is generally recommended to start this field with the value 1, to decrement it by frametime, and when it drops below 0 add 1 to it and update .frame2 and .frame to lerp into the new frame.") /*EXT_CSQC_1*/\
391 frame34fields \
392 comfieldfloat(renderflags,"Matches to the RF_* flags, read during addentity/addentities.")\
393 comfieldfloat(forceshader,"Contains a shader handle used to replace all surfaces upon the entity.")/*FTE_CSQC_SHADERS*/\
394 \
395 comfieldfloat(baseframe2,"See basebone") /*FTE_CSQC_BASEFRAME*/\
396 comfieldfloat(baseframe1time,"See basebone") /*FTE_CSQC_BASEFRAME*/\
397 comfieldfloat(baseframe2time,"See basebone") /*FTE_CSQC_BASEFRAME*/\
398 comfieldfloat(baselerpfrac,"See basebone") /*FTE_CSQC_BASEFRAME*/\
399 HALFLIFEMODEL_FIELDS \
400 comfieldfloat(drawmask, "Matces the bitmask passed to the addentities builtin, to easily submit entities to the renderer. Not otherwise meaningful.") /*So that the qc can specify all rockets at once or all bannanas at once*/ \
401 comfieldfunction(predraw, ".float()","Called as part of the addentities builtin. Returns one of the PREDRAW_ constants. This gives you a chance to interpolate or animate entities as desired.") /*If present, is called just before it's drawn.*/
402
403
404#define comfieldentitydep(nam,desc,depreason) comfieldentity(nam,desc)
405#define comfieldfloatdep(nam,desc,depreason) comfieldfloat(nam,desc)
406
407typedef struct stdentvars_s //standard = standard for qw
408{
409#define comfieldfloat(sharedname,desc) pvec_t sharedname;
410#define comfieldvector(sharedname,desc) pvec3_t sharedname;
411#define comfieldentity(sharedname,desc) pint_t sharedname;
412#define comfieldstring(sharedname,desc) string_t sharedname;
413#define comfieldfunction(sharedname, typestr,desc) func_t sharedname;
414comqcfields
415#undef comfieldfloat
416#undef comfieldvector
417#undef comfieldentity
418#undef comfieldstring
419#undef comfieldfunction
420#ifdef VM_Q1
422
423typedef struct extentvars_s
424{
425#endif
426#define comfieldfloat(name,desc) pvec_t name;
427#define comfieldint(name,desc) pint_t name;
428#define comfieldvector(name,desc) pvec3_t name;
429#define comfieldentity(name,desc) pint_t name;
430#define comfieldstring(name,desc) string_t name;
431#define comfieldfunction(name, typestr,desc) func_t name;
432comextqcfields
433svextqcfields
434#undef comfieldfloat
435#undef comfieldint
436#undef comfieldvector
437#undef comfieldentity
438#undef comfieldstring
439#undef comfieldfunction
440
441#ifdef VM_Q1
443#else
445#endif
446
447typedef struct {
448#define comfieldfloat(sharedname,desc) pvec_t sharedname;
449#define comfieldvector(sharedname,desc) pvec3_t sharedname;
450#define comfieldentity(sharedname,desc) pint_t sharedname;
451#define comfieldstring(sharedname,desc) string_t sharedname;
452#define comfieldfunction(sharedname, typestr,desc) func_t sharedname;
453comqcfields
454#undef comfieldfloat
455#undef comfieldvector
456#undef comfieldentity
457#undef comfieldstring
458#undef comfieldfunction
459
460#ifdef VM_Q1
462typedef struct {
463#endif
464
465#define comfieldfloat(name,desc) pvec_t name;
466#define comfieldint(name,desc) pint_t name;
467#define comfieldvector(name,desc) pvec3_t name;
468#define comfieldentity(name,desc) pint_t name;
469#define comfieldstring(name,desc) string_t name;
470#define comfieldfunction(name, typestr,desc) func_t name;
471comextqcfields
472#undef comfieldfloat
473#undef comfieldint
474#undef comfieldvector
475#undef comfieldentity
476#undef comfieldstring
477#undef comfieldfunction
478
479#ifdef VM_Q1
481#else
483#endif
484
485#ifdef USEAREAGRID
486#define AREAGRIDPERENT 16
487#endif
488
489#ifdef USERBE
490typedef struct
491{
492 void *body;
493 void *geom;
494} rbebody_t;
495typedef struct
496{
497 //doll info
498 char name[32];
499 int bone;
500 float animate;
505
506 //physics engine info
508 float relmatrix[12];
509 float inverserelmatrix[12];
511 float mass;
513
514typedef struct
515{
516 void *joint;
517} rbejoint_t;
518typedef struct
519{
520 //doll info
521 char name[32];
522// unsigned int disablebits;
525
526 //ode info
527 int type;
528 int body1; //handled by the ragdoll code, rather than the physics library.
529 int body2; //handled by the ragdoll code.
530 int bonepivot; //pivot is specified relative to this bone.
531
532 float FMax, FMax2;
533 float HiStop, HiStop2;
534 float LoStop, LoStop2;
535 float CFM, CFM2;
536 float ERP, ERP2;
537 float Vel, Vel2;
538 vec3_t offset, offset2;
539 vec3_t axis, axis2;
541
543{
548};
549
550typedef struct rbecommandqueue_s
551{
558
559typedef struct
560{
561 // physics parameters
565 float *vertex3f;
578 vec_t movelimit; // smallest component of (maxs[]-mins[])
579 float offsetmatrix[16];
580 float offsetimatrix[16];
584 vec3_t joint_origin; // joint anchor
585 vec3_t joint_angles; // joint axis
586 vec3_t joint_velocity; // second joint axis
587 vec3_t joint_movedir; // parameters
588 void *massbuf;
590#endif
qboolean
Definition: api_menu.h:34
float vec_t
Definition: api_menu.h:38
vec_t vec3_t[3]
Definition: api_menu.h:40
GLuint GLcharARB * name
Definition: glquake.h:155
struct stdentvars_s stdentvars_t
Definition: progdefs.h:444
struct globalvars_s globalvars_t
struct extentvars_s extentvars_t
struct rbecommandqueue_s rbecommandqueue_t
rbecommands_e
Definition: progdefs.h:543
@ RBECMD_DISABLE
Definition: progdefs.h:545
@ RBECMD_ENABLE
Definition: progdefs.h:544
@ RBECMD_FORCE
Definition: progdefs.h:546
@ RBECMD_TORQUE
Definition: progdefs.h:547
struct nqglobalvars_s globalptrs_t
comentvars_t
Definition: progdefs.h:482
uint64_t puint_t
Definition: progtype.h:21
int64_t pint_t
Definition: progtype.h:20
puint_t string_t
Definition: progtype.h:66
puint_t func_t
Definition: progtype.h:65
pvec_t pvec3_t[3]
Definition: progtype.h:63
double pvec_t
Definition: progtype.h:19
Definition: progdefs.h:462
Definition: progdefs.h:560
vec3_t angles
Definition: progdefs.h:574
rbebody_t body
Definition: progdefs.h:563
void * massbuf
Definition: progdefs.h:588
int numvertices
Definition: progdefs.h:567
float * vertex3f
Definition: progdefs.h:565
int * element3i
Definition: progdefs.h:566
rbejoint_t joint
Definition: progdefs.h:564
vec3_t avelocity
Definition: progdefs.h:575
vec3_t mins
Definition: progdefs.h:569
int joint_enemy
Definition: progdefs.h:582
vec3_t joint_origin
Definition: progdefs.h:584
int numtriangles
Definition: progdefs.h:568
vec3_t joint_angles
Definition: progdefs.h:585
vec3_t velocity
Definition: progdefs.h:573
int joint_type
Definition: progdefs.h:581
vec_t movelimit
Definition: progdefs.h:578
vec3_t joint_movedir
Definition: progdefs.h:587
int modelindex
Definition: progdefs.h:577
vec3_t maxs
Definition: progdefs.h:570
qboolean gravity
Definition: progdefs.h:576
vec_t mass
Definition: progdefs.h:571
vec3_t origin
Definition: progdefs.h:572
qboolean physics
Definition: progdefs.h:562
vec3_t joint_velocity
Definition: progdefs.h:586
int joint_aiment
Definition: progdefs.h:583
Definition: progdefs.h:424
Definition: progdefs.h:24
pvec3_t vec
Definition: progdefs.h:27
pvec_t f
Definition: progdefs.h:28
union globalvars_s::@377 param[8]
pint_t i
Definition: progdefs.h:29
pint_t null
Definition: progdefs.h:25
union globalvars_s::@376 ret
Definition: progdefs.h:40
pint_t * other
Definition: progdefs.h:42
pvec_t * trace_fraction
Definition: progdefs.h:62
pvec_t * trace_endcontentsf
Definition: progdefs.h:69
pvec3_t * input_left_origin
Definition: progdefs.h:127
pvec3_t * v_forward
Definition: progdefs.h:57
pvec_t * frametime
Definition: progdefs.h:45
pvec3_t * input_movevalues
Definition: progdefs.h:112
func_t * ClientKill
Definition: progdefs.h:94
pvec_t * input_cursor_entitynumber
Definition: progdefs.h:119
pvec3_t * input_left_velocity
Definition: progdefs.h:129
func_t * PutClientInServer
Definition: progdefs.h:96
pvec_t * dimension_default
Definition: progdefs.h:102
pint_t * newmis
Definition: progdefs.h:46
pvec3_t * input_left_angles
Definition: progdefs.h:128
pvec3_t * input_head_origin
Definition: progdefs.h:121
pvec_t * input_buttons
Definition: progdefs.h:113
pvec3_t * input_left_avelocity
Definition: progdefs.h:130
pint_t * trace_surface_id
Definition: progdefs.h:74
pvec_t * force_retouch
Definition: progdefs.h:47
pvec_t * input_clienttime
Definition: progdefs.h:108
pvec_t * input_impulse
Definition: progdefs.h:110
pvec_t * trace_startsolid
Definition: progdefs.h:61
pvec_t * input_timelength
Definition: progdefs.h:109
puint_t * input_head_status
Definition: progdefs.h:120
puint_t * input_right_weapon
Definition: progdefs.h:137
puint_t * input_head_weapon
Definition: progdefs.h:125
pint_t * trace_bone_id
Definition: progdefs.h:75
pvec3_t * input_cursor_trace_start
Definition: progdefs.h:117
pvec3_t * input_head_velocity
Definition: progdefs.h:123
puint_t * input_right_status
Definition: progdefs.h:132
pvec3_t * input_head_angles
Definition: progdefs.h:122
pint_t * trace_surfaceflagsi
Definition: progdefs.h:66
pvec3_t * input_right_origin
Definition: progdefs.h:133
puint_t * input_left_weapon
Definition: progdefs.h:131
pvec3_t * input_head_avelocity
Definition: progdefs.h:124
string_t * mapname
Definition: progdefs.h:48
pvec3_t * input_right_velocity
Definition: progdefs.h:135
func_t * StartFrame
Definition: progdefs.h:91
pvec_t * input_lightlevel
Definition: progdefs.h:115
pint_t * trace_endcontentsi
Definition: progdefs.h:71
pvec_t * killed_monsters
Definition: progdefs.h:56
pint_t * trace_brush_id
Definition: progdefs.h:72
pvec_t * found_secrets
Definition: progdefs.h:55
pvec_t * serverflags
Definition: progdefs.h:52
pvec_t * total_monsters
Definition: progdefs.h:54
string_t * trace_dphittexturename
Definition: progdefs.h:84
pvec3_t * trace_endpos
Definition: progdefs.h:77
pint_t * self
Definition: progdefs.h:41
pvec_t * trace_dphitcontents
Definition: progdefs.h:86
func_t * PlayerPreThink
Definition: progdefs.h:92
pvec_t * trace_inwater
Definition: progdefs.h:82
pvec_t * teamplay
Definition: progdefs.h:51
pvec_t * spawnparamglobals[NUM_SPAWN_PARMS]
Definition: progdefs.h:140
pvec_t * trace_surfaceflagsf
Definition: progdefs.h:64
pvec_t * cycle_wrapped
Definition: progdefs.h:100
pvec3_t * input_cursor_trace_endpos
Definition: progdefs.h:118
pvec_t * trace_allsolid
Definition: progdefs.h:60
string_t * parm_string
Definition: progdefs.h:141
pint_t * world
Definition: progdefs.h:43
pvec_t * dimension_send
Definition: progdefs.h:101
pvec3_t * input_right_angles
Definition: progdefs.h:134
pint_t * msg_entity
Definition: progdefs.h:89
pvec_t * physics_mode
Definition: progdefs.h:104
pvec3_t * input_angles
Definition: progdefs.h:111
pvec3_t * global_gravitydir
Definition: progdefs.h:139
pvec3_t * trace_plane_normal
Definition: progdefs.h:78
pvec_t * deathmatch
Definition: progdefs.h:49
pint_t * trace_brush_faceid
Definition: progdefs.h:73
pvec_t * total_secrets
Definition: progdefs.h:53
puint_t * input_weapon
Definition: progdefs.h:114
pvec3_t * v_right
Definition: progdefs.h:59
pvec_t * trace_dphitq3surfaceflags
Definition: progdefs.h:87
func_t * main
Definition: progdefs.h:90
puint_t * input_left_status
Definition: progdefs.h:126
pvec_t * trace_dpstartcontents
Definition: progdefs.h:85
pvec_t * trace_plane_dist
Definition: progdefs.h:79
pvec_t * coop
Definition: progdefs.h:50
pvec3_t * input_right_avelocity
Definition: progdefs.h:136
func_t * ClientConnect
Definition: progdefs.h:95
func_t * SetChangeParms
Definition: progdefs.h:99
pvec_t * input_servertime
Definition: progdefs.h:107
pvec_t * input_sequence
Definition: progdefs.h:106
func_t * ClientDisconnect
Definition: progdefs.h:97
pvec_t * time
Definition: progdefs.h:44
pvec_t * trace_inopen
Definition: progdefs.h:81
func_t * SetNewParms
Definition: progdefs.h:98
pint_t * trace_triangle_id
Definition: progdefs.h:76
pvec3_t * v_up
Definition: progdefs.h:58
pint_t * trace_ent
Definition: progdefs.h:80
pvec3_t * input_cursor_screen
Definition: progdefs.h:116
func_t * PlayerPostThink
Definition: progdefs.h:93
string_t * trace_surfacename
Definition: progdefs.h:67
pint_t * serverid
Definition: progdefs.h:142
Definition: progdefs.h:491
void * body
Definition: progdefs.h:492
void * geom
Definition: progdefs.h:493
Definition: progdefs.h:496
float mass
Definition: progdefs.h:511
int bone
Definition: progdefs.h:499
int orientpeer
Definition: progdefs.h:504
qboolean draw
Definition: progdefs.h:501
qboolean isoffset
Definition: progdefs.h:503
vec3_t dimensions
Definition: progdefs.h:510
qboolean orient
Definition: progdefs.h:502
int geomshape
Definition: progdefs.h:507
float animate
Definition: progdefs.h:500
Definition: progdefs.h:551
enum rbecommands_e command
Definition: progdefs.h:553
vec3_t v1
Definition: progdefs.h:555
struct wedict_s * edict
Definition: progdefs.h:554
struct rbecommandqueue_s * next
Definition: progdefs.h:552
vec3_t v2
Definition: progdefs.h:556
Definition: progdefs.h:515
void * joint
Definition: progdefs.h:516
Definition: progdefs.h:519
int body1
Definition: progdefs.h:528
float ERP
Definition: progdefs.h:536
int bonepivot
Definition: progdefs.h:530
int body2
Definition: progdefs.h:529
float Vel
Definition: progdefs.h:537
float CFM
Definition: progdefs.h:535
qboolean draw
Definition: progdefs.h:523
float HiStop
Definition: progdefs.h:533
vec3_t axis
Definition: progdefs.h:539
qboolean startenabled
Definition: progdefs.h:524
int type
Definition: progdefs.h:527
vec3_t offset
Definition: progdefs.h:538
float LoStop
Definition: progdefs.h:534
float FMax
Definition: progdefs.h:532
Definition: progdefs.h:408
Definition: pr_common.h:13