djcev.com

//

Git Repos / fte_dogmode / qc / world.qc

Last update to this file was on 2024-11-20 at 23:54.

Show world.qc

//==============================================================================
// WORLD
//==============================================================================

//======================================================================
// constants
//======================================================================

#if defined(CSQC) || defined(SSQC)
enum
{
KNOWN_RELEASE_NOT, // known_release values -- iw
KNOWN_RELEASE_ID1,
KNOWN_RELEASE_FUNC_MAPJAMX,
KNOWN_RELEASE_DMD, // Deathmatch Dimension
KNOWN_RELEASE_QUAKE3,
KNOWN_RELEASE_DOTP // Dimension Of The Past
};

const float WORLDTYPE_MEDIEVAL = 0; // worldtype values
const float WORLDTYPE_METAL = 1;
const float WORLDTYPE_BASE = 2;
#endif

//======================================================================
// globals
//======================================================================

#ifdef SSQC
entity bodyque_head;
entity lastspawn;
float known_release; // unique ID for a release
nosave float *world_sounds; // via Spike fun times! nosave=noclobber
#endif

#if defined(CSQC) || defined(SSQC)
float world_airstep; // latched cvars, reset on world spawn
float world_bigcoords;
float world_gravity;
float world_maxvelocity;
float world_nostep;
float world_walljump;
float world_clforwardspeed;
float world_clsidespeed;
#endif

//======================================================================
// fields
//======================================================================

#if defined(CSQC) || defined(SSQC)
.string wad;
.string map;
.float worldtype; // 0=medieval 1=metal 2=base
.float skip_id1_overrides;
#endif

//======================================================================
// forward declarations
//======================================================================

#if defined(CSQC) || defined(SSQC)
void() world_latched_cvars;
#endif
#ifdef SSQC
void() world_weapon_precache;
void() world_detect_known_release;
float(entity e, vector offset) world_surface_type;
#endif
#if defined(CSQC) || defined(SSQC)
void() worldspawn;
#endif
#ifdef SSQC
void() bodyque;
void() InitBodyQue;
void(entity ent) CopyToBodyQue;
#endif

//------------------------------------------------------------------------------

#if defined(CSQC) || defined(SSQC)
//----------------------------------------------------------------------
void() world_latched_cvars =
{
world_airstep = autocvar (pm_airstep, TRUE);
world_bigcoords = autocvar (sv_bigcoords, FALSE);
world_gravity = autocvar (sv_gravity, 800.0);
world_maxvelocity = autocvar (sv_maxvelocity, 10000.0);
world_nostep = autocvar (pm_nostep, FALSE);
world_walljump = autocvar (pm_walljump, TRUE);

world_clforwardspeed = autocvar (cl_forwardspeed, PM_MAXSPEED);
world_clsidespeed = autocvar (cl_sidespeed, PM_MAXSPEED);
};
#endif

#ifdef SSQC
//----------------------------------------------------------------------
// world_weapon_precache -- was W_Precache; called by worldspawn
//----------------------------------------------------------------------
void() world_weapon_precache =
{
precache_sound ("weapons/r_exp3.wav"); // rocket explosion
precache_sound ("weapons/rocket1i.wav");// spike gun
precache_sound ("weapons/sgun1.wav");
precache_sound ("weapons/guncock.wav"); // player shotgun
precache_sound ("weapons/ric1.wav"); // ricochet (used in c code)
precache_sound ("weapons/ric2.wav"); // ricochet (used in c code)
precache_sound ("weapons/ric3.wav"); // ricochet (used in c code)
precache_sound ("weapons/spike2.wav"); // super spikes
precache_sound ("weapons/tink1.wav"); // spikes tink (used in c code)
precache_sound ("weapons/grenade.wav"); // grenade launcher
precache_sound ("weapons/bounce.wav"); // grenade bounce
precache_sound ("weapons/shotgn2.wav"); // super shotgun

// cev custom weapons precaches START
precache_sound ("cev/tribolt/boltexpl.ogg");

// dumptruck_ds mobot.qc precaches START
precache_model ("progs/ogre.mdl");
precache_model ("progs/h_ogre.mdl");
precache_model ("progs/grenade.mdl");
precache_sound ("ogre/ogdrag.wav");
precache_sound ("ogre/ogdth.wav");
precache_sound ("ogre/ogidle.wav");
precache_sound ("ogre/ogidle2.wav");
precache_sound ("ogre/ogpain1.wav");
precache_sound ("ogre/ogsawatk.wav");
precache_sound ("ogre/ogwake.wav");

precache_model ("progs/demon.mdl");
precache_model ("progs/h_demon.mdl");

precache_sound ("demon/ddeath.wav");
precache_sound ("demon/dhit2.wav");
precache_sound ("demon/djump.wav");
precache_sound ("demon/dpain1.wav");
precache_sound ("demon/idle1.wav");
precache_sound ("demon/sight2.wav");

precache_model2 ("progs/enforcer.mdl");
precache_model2 ("progs/h_mega.mdl");
precache_model2 ("progs/laser.mdl");
precache_model2 ("progs/s_spike.mdl");

precache_sound2 ("enforcer/death1.wav");
precache_sound2 ("enforcer/enfire.wav");
precache_sound2 ("enforcer/enfstop.wav");
precache_sound2 ("enforcer/idle1.wav");
precache_sound2 ("enforcer/pain1.wav");
precache_sound2 ("enforcer/pain2.wav");
precache_sound2 ("enforcer/sight1.wav");
precache_sound2 ("enforcer/sight2.wav");
precache_sound2 ("enforcer/sight3.wav");
precache_sound2 ("enforcer/sight4.wav");

precache_model ("progs/soldier.mdl");
precache_model ("progs/h_guard.mdl");

precache_model ("progs/gib1.mdl");
precache_model ("progs/gib2.mdl");
precache_model ("progs/gib3.mdl");

precache_sound ("soldier/death1.wav");
precache_sound ("soldier/idle.wav");
precache_sound ("soldier/pain1.wav");
precache_sound ("soldier/pain2.wav");
precache_sound ("soldier/sattck1.wav");
precache_sound ("soldier/sight1.wav");
precache_sound ("player/udeath.wav"); // gib death

precache_model ("progs/h_dog.mdl");
precache_model ("progs/dog.mdl");
precache_sound ("dog/dattack1.wav");
precache_sound ("dog/ddeath.wav");
precache_sound ("dog/dpain1.wav");
precache_sound ("dog/dsight.wav");
precache_sound ("dog/idle.wav");

precache_model ("progs/wizard.mdl");
precache_model ("progs/h_wizard.mdl");
precache_model ("progs/w_spike.mdl");

precache_sound ("wizard/hit.wav"); // used by c code
precache_sound ("wizard/wattack.wav");
precache_sound ("wizard/wdeath.wav");
precache_sound ("wizard/widle1.wav");
precache_sound ("wizard/widle2.wav");
precache_sound ("wizard/wpain.wav");
precache_sound ("wizard/wsight.wav");

precache_model2 ("progs/shalrath.mdl");
precache_model2 ("progs/h_shal.mdl");
precache_model2 ("progs/v_spike.mdl");

precache_sound2 ("shalrath/attack.wav");
precache_sound2 ("shalrath/attack2.wav");
precache_sound2 ("shalrath/death.wav");
precache_sound2 ("shalrath/idle.wav");
precache_sound2 ("shalrath/pain.wav");
precache_sound2 ("shalrath/sight.wav");

precache_model ("progs/knight.mdl");
precache_model ("progs/h_knight.mdl");

precache_sound ("knight/kdeath.wav");
precache_sound ("knight/khurt.wav");
precache_sound ("knight/ksight.wav");
precache_sound ("knight/sword1.wav");
precache_sound ("knight/sword2.wav");
precache_sound ("knight/idle.wav");

precache_model2 ("progs/hknight.mdl");
precache_model2 ("progs/k_spike.mdl");
precache_model2 ("progs/k_spike2.mdl");
precache_model2 ("progs/h_hellkn.mdl");
precache_model2 ("progs/hknight.mdl");
precache_model2 ("progs/h_hellkn.mdl");
precache_model2 ("progs/k_spike.mdl");

precache_sound2 ("hknight/attack1.wav");
precache_sound2 ("hknight/death1.wav");
precache_sound2 ("hknight/pain1.wav");
precache_sound2 ("hknight/sight1.wav");
precache_sound ("hknight/hit.wav"); // used by C code; don't sound2
precache_sound2 ("hknight/slash1.wav");
precache_sound2 ("hknight/idle.wav");
precache_sound2 ("hknight/grunt.wav");
precache_sound ("knight/sword1.wav");
precache_sound ("knight/sword2.wav");

precache_sound2 ("blob/death1.wav");
precache_sound2 ("blob/hit1.wav");
precache_sound2 ("blob/land1.wav");
precache_sound2 ("blob/sight1.wav");

precache_model ("progs/zombie.mdl");
precache_model ("progs/h_zombie.mdl");
precache_model ("progs/zom_gib.mdl");

precache_sound ("zombie/z_idle.wav");
precache_sound ("zombie/z_idle1.wav");
precache_sound ("zombie/z_shot1.wav");
precache_sound ("zombie/z_gib.wav");
precache_sound ("zombie/z_pain.wav");
precache_sound ("zombie/z_pain1.wav");
precache_sound ("zombie/z_fall.wav");
precache_sound ("zombie/z_miss.wav");
precache_sound ("zombie/z_hit.wav");
precache_sound ("zombie/idle_w2.wav");

precache_model ("progs/shambler.mdl");
precache_model ("progs/s_light.mdl");
precache_model ("progs/h_shams.mdl");
precache_model ("progs/bolt.mdl");

precache_sound ("shambler/sattck1.wav");
precache_sound ("shambler/sboom.wav");
precache_sound ("shambler/sdeath.wav");
precache_sound ("shambler/shurt2.wav");
precache_sound ("shambler/sidle.wav");
precache_sound ("shambler/ssight.wav");
precache_sound ("shambler/melee1.wav");
precache_sound ("shambler/melee2.wav");
precache_sound ("shambler/smack.wav");
// dumptruck_ds mobot.qc END

// CEV fish bite sound
precache_sound ("fish/bite.wav");

// CEV minigrenade model
precache_model ("progs/mervup.mdl");

// CEV superduperspike model
precache_model ("progs/lspike.mdl");

// CEV bullet projectile model from AD
precache_model ("progs/ad/proj_diam2.mdl");
};

//----------------------------------------------------------------------
// DetectKnownRelease
// This detects whether the current map is from a known release for which
// a backwards-compatibility hack should be applied, and sets the
// known_release global accordingly. -- iw
//----------------------------------------------------------------------
void() world_detect_known_release =
{
local string release_name;

known_release = KNOWN_RELEASE_NOT;
release_name = "";

if (mapname == "dm1" || mapname == "dm2" || mapname == "dm3" ||
mapname == "dm4" || mapname == "dm5" || mapname == "dm6" ||
// include the remaining standard DM maps -- CEV
mapname == "aerowalk" || mapname == "ztndm3" ||
// back to id1
mapname == "e1m1" || mapname == "e1m2" || mapname == "e1m3" ||
mapname == "e1m4" || mapname == "e1m5" || mapname == "e1m6" ||
mapname == "e1m7" || mapname == "e1m8" ||
mapname == "e2m1" || mapname == "e2m2" || mapname == "e2m3" ||
mapname == "e2m4" || mapname == "e2m5" || mapname == "e2m6" ||
mapname == "e2m7" ||
mapname == "e3m1" || mapname == "e3m2" || mapname == "e3m3" ||
mapname == "e3m4" || mapname == "e3m5" || mapname == "e3m6" ||
mapname == "e3m7" ||
mapname == "e4m1" || mapname == "e4m2" || mapname == "e4m3" ||
mapname == "e4m4" || mapname == "e4m5" || mapname == "e4m6" ||
mapname == "e4m7" || mapname == "e4m8" ||
mapname == "end" ||
(mapname == "start" && world.message == "Introduction"))
{
known_release = KNOWN_RELEASE_ID1;
release_name = "id1";
}
else if (mapname == "jamx_artistical" || mapname == "jamx_bloodshot" ||
mapname == "jamx_fw" || mapname == "jamx_hcm" ||
mapname == "jamx_ionous" || mapname == "jamx_jcr" ||
mapname == "jamx_kalebclark" || mapname == "jamx_mafon" ||
// mapname == "jamx_mugwump" || // dummy map
mapname == "jamx_naitelveni" || mapname == "jamx_newhouse" ||
mapname == "jamx_pinchy" || mapname == "jamx_strwrk" ||
mapname == "jamx_ukko" || mapname == "jamx_yoder" ||
(mapname == "start" && world.message == "An Unending Dusk"))
{
known_release = KNOWN_RELEASE_FUNC_MAPJAMX;
release_name = "func_mapjamx";
}
else if (mapname == "dmd0" || mapname == "dmd1" || mapname == "dmd2" ||
mapname == "dmd3" || mapname == "dmd4" || mapname == "dmd5" ||
mapname == "dmd6" || mapname == "dmd7" || mapname == "dmd8" ||
mapname == "dmd9" || (mapname == "start" &&
world.message == "Deathmatch Dimension"))
{
known_release = KNOWN_RELEASE_DMD;
release_name = "Deathmatch Dimension";
}
else if (mapname == "q3ctf1" || mapname == "q3ctf2" ||
mapname == "q3ctf3" || mapname == "q3ctf4" ||
mapname == "q3ctf5" ||
mapname == "q3dm0" || mapname == "q3dm1" ||
mapname == "q3dm2" || mapname == "q3dm3" ||
mapname == "q3dm4" || mapname == "q3dm5" ||
mapname == "q3dm6" || mapname == "q3dm7" ||
mapname == "q3dm8" || mapname == "q3dm9" ||
mapname == "q3dm10" || mapname == "q3dm11" ||
mapname == "q3dm12" || mapname == "q3dm13" ||
mapname == "q3dm14" || mapname == "q3dm15" ||
mapname == "q3dm16" || mapname == "q3dm17" ||
mapname == "q3dm18" || mapname == "q3dm19" ||
mapname == "q3tourney1" || mapname == "q3tourney2" ||
mapname == "q3tourney3" || mapname == "q3tourney4" ||
mapname == "q3tourney5" || mapname == "q3tourney6" ||
mapname == "q3tourney6_ctf" ||
mapname == "pro-q3dm13" || mapname == "pro-q3dm6" ||
mapname == "pro-q3tourney2" || mapname == "pro-q3tourney4")
{
known_release = KNOWN_RELEASE_QUAKE3;
release_name = "Quake 3";
}
else if (mapname == "e5m1" || mapname == "e5m2" || mapname == "e5m3" ||
mapname == "e5m4" || mapname == "e5m5" || mapname == "e5m6" ||
mapname == "e5m7" || mapname == "e5m8" || mapname == "e5dm" ||
mapname == "e5start" || (mapname == "start" &&
world.message == "Dimension Of The Past"))
{
known_release = KNOWN_RELEASE_DOTP;
release_name = "Dimension Of The Past";
}

if (release_name != "")
dprint (sprintf("WARNING: progs.dat detected a map from %s "
"(%g), attempting to behave compatibly\n",
release_name, known_release));
};

//----------------------------------------------------------------------
float(entity e, vector offset) world_surface_type =
{
if (known_release == KNOWN_RELEASE_NOT)
return SURFACE_UNKNOWN;

if (e.pm_flags & PMF_WALLJUMPED)
return SURFACE_UNKNOWN;

local string tex = "";
local float surfnum = 0;

if (e.classtype != CT_PLAYER)
{
// trace to the ground entity, get the surface
// number we're standing on, then get the texture
// name on that surface. traceline will do fine.
traceline (e.origin, e.origin + offset, 0, e);
surfnum = getsurfacenearpoint (trace_ent, trace_endpos);
tex = getsurfacetexture (trace_ent, surfnum);
#if 0
dprint (sprintf("world_surface_type: trace ent %s, "
"surface id %g, texture %s\n",
trace_ent.classname, surfnum, tex));
#endif
}
else
{
// we have reliable access to the ground entity
// already, no need to trace -- CEV
surfnum = getsurfacenearpoint (e.groundentity,
e.origin + offset);
tex = getsurfacetexture (e.groundentity, surfnum);
#if 0
dprint (sprintf("world_surface_type: ground ent %s, "
"surface id %g, texture %s\n",
e.groundentity.classname, surfnum, tex));
#endif
}

switch (known_release)
{
case KNOWN_RELEASE_ID1:
// see compat/quake1.qc -- CEV
return id1_surface_type (tex);
case KNOWN_RELEASE_DOTP:
// reuse id1 surface checks -- CEV
return id1_surface_type (tex);
default:
return SURFACE_UNKNOWN;
}
};
#endif

#if defined(CSQC) || defined(SSQC)
/*QUAKED worldspawn (0 0 0) ?
Only used for the world entity.

Optionally set reset_items to one of the following values:
0: don't reset the player's inventory
1: reset to shotgun, axe, and 25 shells
2: reset to axe only

message(string) : "Level name"

worldtype(choices) : "Ambience" : 0 =
0 : "Medieval"
1 : "Runic (metal)"
2 : "Present (base)"

sounds(integer) : "CD track to play" : 0

light(integer) : "Ambient light" : 0 : "Set a global minimum light level of 'n' across the whole map. This is an easy way to eliminate completely dark areas of the level, however you may lose some contrast as a result, so use with care. Default 0"

reset_items(choices) : "Reset the player's inventory on spawn" : 0 =
0 "Don't reset the player's inventory"
1 "Reset to shotgun, axe, and 25 shells"
2 "Reset to axe only"

_sunlight(integer) : "Sunlight" : 0 : "Set the brightness of the sunlight coming from an unseen sun in the sky. Sky brushes (or more accurately bsp leafs with sky contents) will emit sunlight at an angle specified by the _sun_mangle key. Default 0"

_sun_mangle(string) : "Sun mangle (Yaw pitch roll)" : "0 -90 0" : "Specifies the direction of sunlight using yaw(x), pitch(y) and roll(z) in degrees. Yaw specifies the angle around the Z-axis from 0 to 359 degrees and pitch specifies the angle from 90 (straight up) to -90 (straight down). Roll has no effect, so use any value (e.g. 0). Default is straight down (0 -90 0)"

_sunlight_penumbra(integer) : "Sunlight penumbra in degrees" : 0 : "Specifies the penumbra width, in degrees, of sunlight. Useful values are 3-4 for a gentle soft edge, or 10-20+ for more diffuse sunlight. Default is 0"

_sunlight_color(color255) : "Sunlight color R G B" : "255 255 255" : "Specify red(r), green(g) and blue(b) components for the colour of the sunlight. RGB component values are between 0 and 255 (between 0 and 1 is also accepted). Default is white light (255 255 255)"

_sunlight2(integer) : "Sunlight 2 brightness" : 0 : "Set the brightness of a large dome of lights positioned around the map (16K unit radius). Useful for simulating higly diffused light (e.g. cloudy skies) in outdoor areas. Default 0"

_sunlight2_color(color255) : "Sunlight 2 color R G B" : "255 255 255" : "Specifies the colour of _sunlight2, same format as _sunlight_color. Default is white light (255 255 255)"

_sunlight3(integer) : "Sunlight 3 brightness" : 0 : "Same as _sunlight2 but creates lights on the bottom hemisphere. Default 0"

_sunlight3_color(color255) : "Sunlight 3 color R G B" : "255 255 255" : "Specifies the colour of _sunlight3, same format as _sunlight_color. Default is white light (255 255 255)"

_dist(integer) : "Global light scale" : 1 : "Scales the fade distance of all lights by a factor of n. If n is more than 1 lights fade more quickly with distance and if n is less than 1, lights fade more slowly with distance and light reaches further"

_range(float) : "Global light range" : "0.5" : "Scales the brightness range of all lights without affecting their fade discance. Values of n more than 0.5 makes lights brighter and n less than 0.5 makes lights less bright. The same effect can be achieved on individual lights by adjusting both the 'light' and 'wait' attributes"

_anglescale(float) : "Light angle scale" : "0.5" : "Sets a scaling factor for how much influence the angle of incidence of sunlight on a surface has on the brightness of the surface. n must be between 0.0 and 1.0. Smaller values mean less attenuation, with zero meaning that angle of incidence has no effect at all on the brightness. Default 0.5"

_dirt(integer) : "Dirt mapping (AO)" : -1 : "1 enables dirtmapping (ambient occlusion) on all lights, borrowed from q3map2. This adds shadows to corners and crevices. You can override the global setting for specific lights with the _dirt light entity key or _sunlight_dirt, _sunlight2_dirt, and _minlight_dirt worldspawn keys. Default is no dirtmapping (-1)"

_sunlight_dirt(integer) : "Sunlight dirt" : -1 : "1 enables dirtmapping (ambient occlusion) on sunlight, -1 to disable (making it illuminate the dirtmapping shadows). Default is to use the value of '_dirt'"

_sunlight2_dirt(integer) : "Sublight 2 dirt" : -1 : "1 enables dirtmapping (ambient occlusion) on sunlight2, -1 to disable. Default is to use the value of '_dirt'"

_minlight_dirt(integer) : "Minlight dirt" : -1 : "1 enables dirtmapping (ambient occlusion) on minlight, -1 to disable. Default is to use the value of '_dirt'"

_dirtmode(integer) : "Dirt mode" : 0 : "Choose between ordered (0, default) and randomized (1) dirtmapping."

_dirtdepth(integer) : "Dirt depth" : 128 : "Maximum depth of occlusion checking for dirtmapping, default 128."

_dirtscale(integer) : "Dirt scale" : 1 : "Scale factor used in dirt calculations, default 1. Lower values (e.g. 0.5) make the dirt fainter, 2.0 would create much darker shadows"

_dirtgain(integer) : "Dirt gain" : 1 : "Exponent used in dirt calculation, default 1. Lower values (e.g. 0.5) make the shadows darker and stretch further away from corners"

_gamma(integer) : "Lightmap gamma" : 1 : "Adjust brightness of final lightmap. Default 1, >1 is brighter, <1 is darker"

fog(string) : "Fog Command" : : "ENGINE only 'console command' for setting fog parameters, Density/R/G/B example = (0.05 0.3 0.3 0.3)."

fog_density(string) : "Fog Density example = (0.05)"

fog_color(string) : "Fog Color R/G/B example = (0.3 0.3 0.3)"

sky(string) : "Sky Texture" : : "Must have compatible skybox textures in gfx/env folder."
*/
void() worldspawn =
{
#ifdef SSQC
world_detect_known_release ();

// new spawnflags for all entities -- iw
InitNewSpawnflags ();

// read per-map latched cvars -- CEV
world_latched_cvars ();

lastspawn = world;
InitBodyQue ();
#endif

self.classname = "world";
self.classtype = CT_WORLD;

// custom map attributes
if (self.model == "maps/e1m8.bsp" && self.skip_id1_overrides == 0)
{
cvar_set ("sv_gravity", "100");
world_gravity = 100.0;
}
else
{
cvar_set ("sv_gravity", "800");
world_gravity = 800.0;
}

#ifdef SSQC
// No cutscene is active during worldspawn. Drake -- dumptruck_ds
cutscene = 0;

// Spike via dumptruck_ds || not read-only yet...
world_sounds = &world.sounds;

// the area based ambient sounds MUST be the first precache_sounds

// player precaches; get weapon precaches
world_weapon_precache ();

// sounds used from C physics code
precache_sound_land (self, "demon/dland2.wav"); // landing thud
precache_sound ("misc/h2ohit1.wav"); // landing splash

// setup precaches always needed
precache_sound ("misc/null.wav"); // empty sound
precache_sound ("items/itembk2.wav"); // item respawn sound
precache_sound ("player/plyrjmp8.wav"); // player jump
precache_sound ("player/jump01.ogg"); //
precache_sound ("player/jump02.ogg"); //
precache_sound ("player/jump03.ogg"); //
precache_sound ("player/jump04.ogg"); //
precache_sound ("player/land.wav"); // player landing
precache_sound ("player/land2.wav"); // player hurt landing
precache_sound ("player/drown1.wav"); // drowning pain
precache_sound ("player/drown2.wav"); // drowning pain
precache_sound ("player/gasp1.wav"); // gasping for air
precache_sound ("player/gasp2.wav"); // taking breath
precache_sound ("player/h2odeath.wav"); // drowning death

// player footstep sounds -- CEV
precache_sound ("player/stepdirt1.ogg");
precache_sound ("player/stepdirt2.ogg");
precache_sound ("player/stepdirt3.ogg");
precache_sound ("player/stepdirt4.ogg");
precache_sound ("player/stepdirt5.ogg");
precache_sound ("player/stepmetal1.ogg");
precache_sound ("player/stepmetal2.ogg");
precache_sound ("player/stepmetal3.ogg");
precache_sound ("player/stepmetal4.ogg");
precache_sound ("player/stepmetal5.ogg");
precache_sound ("player/stepmetal6.ogg");
precache_sound ("player/stepmetal7.ogg");
precache_sound ("player/stepmetal8.ogg");
precache_sound ("player/stepmetal9.ogg");
precache_sound ("player/stepstone1.ogg");
precache_sound ("player/stepstone2.ogg");
precache_sound ("player/stepstone3.ogg");
precache_sound ("player/stepstone4.ogg");
precache_sound ("player/stepstone5.ogg");
precache_sound ("player/stepstone6.ogg");
precache_sound ("player/stepwade1.ogg");
precache_sound ("player/stepwade2.ogg");
precache_sound ("player/stepwater1.ogg");
precache_sound ("player/stepwater2.ogg");
precache_sound ("player/stepwater3.ogg");
precache_sound ("player/stepwater4.ogg");
precache_sound ("player/stepwood1.ogg");
precache_sound ("player/stepwood2.ogg");
precache_sound ("player/stepwood3.ogg");
precache_sound ("player/stepwood4.ogg");
precache_sound ("player/slide.ogg");
precache_sound ("player/slidestart.ogg");

precache_sound ("misc/talk.wav"); // talk
precache_sound ("player/teledth1.wav"); // telefrag
precache_sound ("misc/r_tele1.wav"); // teleport sounds
precache_sound ("misc/r_tele2.wav");
precache_sound ("misc/r_tele3.wav");
precache_sound ("misc/r_tele4.wav");
precache_sound ("misc/r_tele5.wav");
precache_sound ("items/ammo_pickup.ogg"); // ammo pick up
precache_sound ("items/backpack_pickup.wav"); // backpack up
precache_sound ("items/weapon_pickup.ogg"); // weapon up
precache_sound ("items/armor1.wav"); // armor up
precache_sound ("weapons/lhit.wav"); // lightning
precache_sound ("weapons/lstart.wav"); // lightning start

// iw -- fix powerup cheat sounds
// noticed this in Copper so why not? -- ds
// sounds used by cheats
precache_sound ("items/suit2.wav"); // suit (finish)
precache_sound ("items/protect2.wav"); // pent (finish)
precache_sound ("items/protect3.wav"); // pent (protect)
precache_sound ("items/inv2.wav"); // ring (finish)
precache_sound ("items/inv3.wav"); // ring (idle)
precache_sound ("items/damage2.wav"); // quad (finish)
precache_sound ("items/damage3.wav"); // quad (attack)
// iw -- END

precache_sound ("misc/power.wav"); // lightning for boss

// player gib sounds
precache_sound ("player/gib.wav"); // player gib sound
precache_sound ("player/udeath.wav"); // player gib sound
precache_sound ("player/tornoff2.wav"); // gib sound

// player pain sounds
precache_sound ("player/pain1.wav");
precache_sound ("player/pain2.wav");
precache_sound ("player/pain3.wav");
precache_sound ("player/pain4.wav");
precache_sound ("player/pain5.wav");
precache_sound ("player/pain6.wav");

// player death sounds
precache_sound ("player/death1.wav");
precache_sound ("player/death2.wav");
precache_sound ("player/death3.wav");
precache_sound ("player/death4.wav");
precache_sound ("player/death5.wav");

// ax sounds
precache_sound ("weapons/ax1.wav"); // ax swoosh
precache_sound ("player/axhit1.wav"); // ax hit meat
precache_sound ("player/axhit2.wav"); // ax hit world

precache_sound ("player/h2ojump.wav"); // player jumping into water
precache_sound ("player/slimbrn2.wav"); // player enter slime
precache_sound ("player/inh2o.wav"); // player enter water
precache_sound ("player/inlava.wav"); // player enter lava
precache_sound ("misc/outwater.wav"); // leaving water sound

precache_sound ("player/lburn1.wav"); // lava burn
precache_sound ("player/lburn2.wav"); // lava burn

precache_sound ("misc/water1.wav"); // swimming
precache_sound ("misc/water2.wav"); // swimming

precache_model ("progs/player.mdl");
// Invisible -- Drake -- dumptruck_ds
precache_model ("progs/s_null.spr");
// Invisible -- Drake -- dumptruck_ds
// precache_model ("progs/null_256.spr");
precache_model ("progs/eyes.mdl");
precache_model ("progs/h_player.mdl");
precache_model ("progs/gib1.mdl");
precache_model ("progs/gib2.mdl");
precache_model ("progs/gib3.mdl");

precache_model ("progs/s_bubble.spr"); // drowning bubbles
precache_model ("progs/s_explod.spr"); // sprite explosion

precache_model ("progs/v_axe.mdl");
precache_model ("progs/v_shot.mdl");
precache_model ("progs/v_nail.mdl");
precache_model ("progs/v_rock.mdl");
precache_model ("progs/v_shot2.mdl");
precache_model ("progs/v_nail2.mdl");
precache_model ("progs/v_rock2.mdl");

precache_model ("progs/bolt.mdl"); // for lightning gun
precache_model ("progs/bolt2.mdl"); // for lightning gun
precache_model ("progs/bolt3.mdl"); // for boss shock
precache_model ("progs/lavaball.mdl"); // for testing

precache_model ("progs/missile.mdl");
precache_model ("progs/grenade.mdl");
precache_model ("progs/spike.mdl");
// dumptruck_ds added w_spike due to errors
// with custom_mdls in precache_proj_model in wizard.qc
// precache_model ("progs/w_spike.mdl");
// this is on hold for now head and body are working
precache_model ("progs/s_spike.mdl");

precache_model ("progs/backpack.mdl");

precache_model ("progs/zom_gib.mdl");

precache_model ("progs/v_light.mdl");

// dumptruck_ds needed for DropStuff
precache_model ("progs/w_s_key.mdl");
precache_model ("progs/w_g_key.mdl");
precache_sound ("misc/medkey.wav");
precache_sound ("misc/runekey.wav");
precache_model ("progs/m_s_key.mdl");
precache_model ("progs/m_g_key.mdl");
precache_sound2 ("misc/basekey.wav");
precache_model2 ("progs/b_s_key.mdl");
precache_model2 ("progs/b_g_key.mdl");
precache_model ("progs/health/pd_vial.mdl"); // DropVial -- dumptruck_ds
precache_sound ("items/r_item1.wav");
precache_sound ("items/shard_pickup.ogg"); // DropShard - dumptruck_ds
precache_sound ("items/respawn.ogg"); // CEV
precache_model ("progs/armshr.mdl");

// Setup light anim tables. 'a' is total darkness, 'z' is maxbright.

// 0 normal
lightstyle (0, "m");

// 1 FLICKER (first variety)
lightstyle (1, "mmnmmommommnonmmonqnmmo");

// 2 SLOW STRONG PULSE
lightstyle (2, "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba");

// 3 CANDLE (first variety)
lightstyle (3, "mmmmmaaaaammmmmaaaaaabcdefgabcdefg");

// 4 FAST STROBE
lightstyle (4, "mamamamamama");

// 5 GENTLE PULSE 1
lightstyle (5,"jklmnopqrstuvwxyzyxwvutsrqponmlkj");

// 6 FLICKER (second variety)
lightstyle (6, "nmonqnmomnmomomno");

// 7 CANDLE (second variety)
lightstyle (7, "mmmaaaabcdefgmmmmaaaammmaamm");

// 8 CANDLE (third variety)
lightstyle (8, "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa");

// 9 SLOW STROBE (fourth variety)
lightstyle (9, "aaaaaaaazzzzzzzz");

// 10 FLUORESCENT FLICKER
lightstyle (10, "mmamammmmammamamaaamammma");

// 11 SLOW PULSE NOT FADE TO BLACK
lightstyle (11, "abcdefghijklmnopqrrqponmlkjihgfedcba");

// styles 32-62 are assigned by the light program for switchable lights

// 63 testing
lightstyle (63, "a");
#endif
};
#endif

#ifdef SSQC
//======================================================================
// BODY QUE
//======================================================================

//----------------------------------------------------------------------
void() bodyque =
{
// just here so spawn functions don't complain after the world
// creates bodyques
};

//----------------------------------------------------------------------
void() InitBodyQue =
{
bodyque_head = spawn ();
bodyque_head.classname = "bodyque";
bodyque_head.owner = spawn ();
bodyque_head.owner.classname = "bodyque";
bodyque_head.owner.owner = spawn ();
bodyque_head.owner.owner.classname = "bodyque";
bodyque_head.owner.owner.owner = spawn ();
bodyque_head.owner.owner.owner.classname = "bodyque";
bodyque_head.owner.owner.owner.owner = bodyque_head;
};

//----------------------------------------------------------------------
// CopyToBodyQue -- make a body que entry for the given ent so the ent
// can be respawned elsewhere
//----------------------------------------------------------------------
void(entity ent) CopyToBodyQue =
{
bodyque_head.angles = ent.angles;
bodyque_head.model = ent.model;
bodyque_head.modelindex = ent.modelindex;
bodyque_head.frame = ent.frame;
bodyque_head.colormap = ent.colormap;
bodyque_head.movetype = ent.movetype;
bodyque_head.velocity = ent.velocity;
bodyque_head.flags = 0;
setorigin (bodyque_head, ent.origin);
setsize (bodyque_head, ent.mins, ent.maxs);
bodyque_head = bodyque_head.owner;
};
#endif

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

Log world.qc

Date Commit Message Author + -
2024-11-20 pmove refactor into prepoc macros, view bobbing cev +2 -2
2024-09-17 Ice, improved stairs, other movement changes cev +4 -2
2024-07-17 pmove changes, smooth crouching cev +1 -1
2024-06-26 pmove fixes, GL now a faux tribolt, wall climbing cev +4 -3
2024-06-15 Major update, committing as-is, will have bugs cev +169 -22
2024-04-05 Player footsteps, shareware monsters, misc? cev +9  
2024-03-24 2nd pass refactor, rework QC class structure cev +92 -220
2024-02-27 Bullet projectile, pmove changes, misc cev +4  
2024-02-18 Client/player, projectiles, entrypoints refactor cev +23 -21
2024-01-09 Continue OO / Class-based refactor cev +19  
2023-12-09 Start OO / class-based refactor, work on items cev +205 -67
2023-12-02 More refactoring & moving, begin adding mdls & snd cev +5 -5
2023-11-06 First draft client prediction, pmove changes, misc cev +138 -139
2023-10-13 New movement code based on SV_RunClientCommand cev +621 -621
2023-10-13 Rename "qc-server" dir to "qc" cev +621  

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