djcev.com

//

Git Repos / fte_dogmode / qc / world.qc

Last update to this file was on 2024-04-05 at 14:18.

Show world.qc

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

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

const float KNOWN_RELEASE_NOT = 0; // known_release values -- iw
const float KNOWN_RELEASE_ID1 = 1;
const float KNOWN_RELEASE_FUNC_MAPJAMX = 2;

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

//======================================================================
// 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

float world_airstep; // latched cvars, reset on world spawn
float world_bigcoords;
float world_clrun;
float world_gravity;
float world_maxvelocity;
float world_nostep;
float world_standardphysics;
float world_walljump;
float world_clforwardspeed;
float world_clsidespeed;

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

#ifdef SSQC
.string wad;
.string map;
.float worldtype; // 0=medieval 1=metal 2=base
.float skip_id1_overrides;
#endif

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

#ifdef SSQC
void() world_latched_cvars;
void() world_weapon_precache;
void() world_detect_known_release;
void() worldspawn;
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_clrun = autocvar (cl_run, FALSE);
world_gravity = autocvar (sv_gravity, 800.0);
world_maxvelocity = autocvar (sv_maxvelocity, 10000.0);
world_nostep = autocvar (pm_nostep, FALSE);
world_standardphysics = autocvar (pm_standardphysics, FALSE);
world_walljump = autocvar (pm_walljump, TRUE);

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

#ifdef SSQC
//----------------------------------------------------------------------
// world_weapon_precache -- was W_Precache; called by worldspawn
//----------------------------------------------------------------------
void() world_weapon_precache =
{
precache_sound ("weapons/r_exp3.wav"); // new 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

// 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" ||
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";
}

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";
}

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

/*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 =
{
world_detect_known_release ();

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

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

lastspawn = world;
InitBodyQue ();
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;
}

// 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 ("items/itembk2.wav"); // item respawn sound
precache_sound ("player/plyrjmp8.wav"); // player jump
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 ("steps/foot1.wav");
precache_sound ("steps/foot2.wav");
precache_sound ("steps/foot3.wav");
precache_sound ("steps/foot4.wav");
precache_sound ("steps/foot5.wav");
precache_sound ("steps/foot6.wav");
precache_sound ("steps/foot7.wav");

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 ("weapons/lock4.wav"); // ammo pick up
precache_sound ("weapons/pkup.wav"); // 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/armor_shard_q3.wav"); // DropShard - dumptruck_ds
precache_sound ("items/item_respawn_q3.wav");// 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");
};

//======================================================================
// 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

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