#define MAXGRASS 584 #define MAX_PLACERS 17 namespace para1 { float ripcord_a_done = 0; float ripcord_b_done = 0; float grass_total = 0; entity zlight1, zlight2, zlight3, zlight4, zlight5; vector vec_ripcord_1; void player_init() { //is this necessary sys.cacheSoundShader ("sound/machinery/camera/1shot_stop.ogg"); //sys.trigger($player_lock); $player1.setWorldOrigin ($player_tele_dest.getWorldOrigin()); //teleport player to playerbody model. $player1.bind($player_tele_dest); //$func_mover_1.sway( 28, 0, '40 0 0' );//para guy } /* //didnt sound too good void heart_rapid() { while (1) { $heart_rapid_null1.startSoundShader ("sound/player/heartbeat_dying.ogg", SND_CHANNEL_VOICE ); sys.wait(0.4); } } */ //get a random 0 or 1 float macro_neg() { float bool_num; bool_num = int(sys.random(2)); return bool_num; } //this function places the grass down in a random fashion. void grass_init() { float i; for ( i=64; i <= MAXGRASS; i++ ) { entity ent; ent = sys.getEntity( "func_static_" + i ); if (ent) { vector ranvec, finalvec; float grass_placer_num; entity grass_placer; grass_placer_num = int(sys.random(MAX_PLACERS)) + 1; grass_placer = sys.getEntity( "grass_placer_" + grass_placer_num ); if (grass_placer) { ranvec = grass_placer.getWorldOrigin(); } if (macro_neg()) { ranvec_x += sys.random(96); } else { ranvec_x -= sys.random(96); } if (macro_neg()) { ranvec_y += sys.random(96); } else { ranvec_y -= sys.random(96); } sys.trace( ranvec, ranvec + ('0 0 -2048'), '0 0 0', '0 0 0', MASK_SOLID, $player1 ); finalvec = sys.getTraceEndPos(); if (finalvec) { ent.setWorldOrigin(finalvec); } } /* //necessary for randomization (?) //sys.wait(0.11); if (macro_neg()) { sys.waitFrame(); } else { sys.waitFrame(); sys.waitFrame(); } */ } } void macro_grassrotate(entity ent) { //get the angle difference between the grass & player vector vec; vec = ent.getWorldOrigin() - $player1.getWorldOrigin(); vec = sys.VecToAngles(vec); //only rotate on y axis vec_x = 0; vec_z = 0; //rotate the grass ent.setAngles(vec); } void grassrotate() { while (1) { float i; //make sure to rotate the vines too. +10. //loop through all the grass entities for ( i=20; i <= (MAXGRASS + 10); i++ ) { entity ent; ent = sys.getEntity( "func_static_" + i ); if (ent) { macro_grassrotate( ent ); } } sys.waitFrame(); } } void tele_to_rock() { $rock_buckle.bind($para_mover); $rock_body1.bind($para_mover); $rock_body2.bind($para_mover); $para_mover.sway( 2, 0, '0 4 0' ); $rock_buckle.sway( 8, 0, '8 0 0' ); sys.trigger($fov_3); $para_string_1.sway( 1, 0, '0 -2 0' ); $para_string_2.sway( 1, 0, '0 -2 0' ); $para_string_3.sway( 1, 0, '0 -2 0' ); $para_string_4.sway( 1, 0, '0 -2 0' ); $para_string_5.sway( 1, 0, '0 -2 0' ); thread grassrotate(); //move player. $player1.unbind(); sys.trigger($rock_tele); sys.waitFrame(); //$player1.bind($rock_tele); $player1.bind($para_mover); //sys.wait(2); //$player1.unbind(); sys.wait(2.7); //how long does title screen show?.... //enable the parachute release buckle. $rock_buckle_static.setKey("hudname","Release buckle"); $rock_buckle_static.setKey("hudrelay","para1::rock_buckle_script"); $player1.startSoundShader ("sound/vo/alpha_labs2/scientist_saved_2.ogg", SND_CHANNEL_VOICE ); } void ripcord_a_script() { if (ripcord_b_done == 0) { sys.trigger($snd_heart2); $snd_heart2.remove(); sys.trigger($snd_heart3); sys.trigger($fov_2); } $ripcord_a_static.setKey ("hudrelay", "" );//disables the entity's USE feature $ripcord_a_static.setKey ("hudname", ""); //temporarily disable it. $ripcord_b_static.setKey ("hudrelay", "" );//disables the entity's USE feature sys.wait(0.1); $ripcord_a.startSoundShader ("sound/machinery/camera/1shot_stop.ogg", SND_CHANNEL_VOICE ); $ripcord_a.sway( 0, 0, '1 0 0' ); $ripcord_a.restorePosition(); $ripcord_a.time (0.2); $ripcord_a.move (FORWARD, 5); sys.waitFor($ripcord_a); if (ripcord_b_done == 0) { $ripcord_a.move (FORWARD, -5); sys.waitFor($ripcord_a); sys.wait(0.2); $ripcord_a.startSoundShader ("sound/machinery/camera/1shot_stop.ogg", SND_CHANNEL_VOICE ); $ripcord_a.move (FORWARD, 5); sys.waitFor($ripcord_a); $ripcord_a.move (FORWARD, -5); sys.waitFor($ripcord_a); $ripcord_a.startSoundShader ("sound/machinery/camera/1shot_stop.ogg", SND_CHANNEL_VOICE ); $ripcord_a.move (FORWARD, 5); sys.waitFor($ripcord_a); $ripcord_a.move (FORWARD, -5); sys.waitFor($ripcord_a); $ripcord_a.startSoundShader ("sound/machinery/camera/1shot_stop.ogg", SND_CHANNEL_VOICE ); $ripcord_a.move (FORWARD, 5); sys.waitFor($ripcord_a); //vo: blaaugurgh sonuvabitch parachute aint opening $player1.startSoundShader ("sound/vo/enpro/17_son_of_bitch.ogg", SND_CHANNEL_VOICE ); //$ripcord_a.move (FORWARD, -6.5); //sys.waitFor($ripcord_a); $ripcord_b_static.setKey("hudrelay", "para1::ripcord_b_script"); } else { $info_player_start_1.setGuiParm("titlescreen", 1); sys.killthread("para1::heart_rapid"); tele_to_rock(); } $ripcord_a_static.setKey("hudname", "Reserve Parachute A (broken)"); ripcord_a_done = 1; } void ripcord_b_script() { if (ripcord_a_done == 0) { sys.trigger($snd_heart2); $snd_heart2.remove(); sys.trigger($snd_heart3); sys.trigger($fov_2); } $ripcord_b_static.setKey ("hudrelay", "" );//disables the entity's USE feature $ripcord_b_static.setKey ("hudname", ""); //temporarily disable it. $ripcord_a_static.setKey ("hudrelay", "" );//disables the entity's USE feature sys.wait(0.1); $ripcord_b.startSoundShader ("sound/machinery/camera/1shot_stop.ogg", SND_CHANNEL_VOICE ); $ripcord_b.sway( 0, 0, '1 0 0' ); $ripcord_b.restorePosition(); $ripcord_b.time (0.2); $ripcord_b.move (FORWARD, 5); sys.waitFor($ripcord_b); if (ripcord_a_done == 0) { $ripcord_b.move (FORWARD, -5); sys.waitFor($ripcord_b); sys.wait(0.2); $ripcord_b.startSoundShader ("sound/machinery/camera/1shot_stop.ogg", SND_CHANNEL_VOICE ); $ripcord_b.move (FORWARD, 5); sys.waitFor($ripcord_b); $ripcord_b.move (FORWARD, -5); sys.waitFor($ripcord_b); $ripcord_b.startSoundShader ("sound/machinery/camera/1shot_stop.ogg", SND_CHANNEL_VOICE ); $ripcord_b.move (FORWARD, 5); sys.waitFor($ripcord_b); $ripcord_b.move (FORWARD, -5); sys.waitFor($ripcord_b); $ripcord_b.startSoundShader ("sound/machinery/camera/1shot_stop.ogg", SND_CHANNEL_VOICE ); $ripcord_b.move (FORWARD, 5); sys.waitFor($ripcord_b); $player1.startSoundShader ("sound/vo/enpro/17_son_of_bitch.ogg", SND_CHANNEL_VOICE ); $ripcord_b.move (FORWARD, -6.5); sys.waitFor($ripcord_b); $ripcord_a_static.setKey("hudrelay", "para1::ripcord_a_script"); } else { $info_player_start_1.setGuiParm("titlescreen", 1); sys.killthread("para1::heart_rapid"); tele_to_rock(); } $ripcord_b_static.setKey("hudname", "Reserve Parachute B (broken)"); ripcord_b_done = 1; } void ripcord_1_script() { //bctemp //tele_to_rock(); //return; //end bctemp $ripcord_1_mover.setKey ("hudrelay", "" );//disables the entity's USE feature $ripcord_1_mover.setKey ("hudname", ""); //sys.print("GO BOTS GO\n"); sys.wait(0.1); $ripcord_1_mover.startSoundShader ("sound/machinery/camera/1shot_stop.ogg", SND_CHANNEL_VOICE ); //$ripcord_1_mover.sway( 0, 0, '0 0 0' ); //hmm, my custom dll ZONKS OUT if I keep this line in. why? //bct $ripcord_1_mover.restorePosition(); $ripcord_1_mover.setAngles(vec_ripcord_1); //restore its original angles, so it can MOVE-FORWARD correctly $ripcord_1_mover.sway( 0, 0, '1 0 0' ); //i guess this works. $ripcord_1_mover.time (0.4); $ripcord_1_mover.move (FORWARD, 5); sys.waitFor($ripcord_1_mover); $ripcord_1_mover.move (FORWARD, -5); sys.waitFor($ripcord_1_mover); sys.wait(0.3); sys.trigger($fov_1); $ripcord_1_mover.startSoundShader ("sound/machinery/camera/1shot_stop.ogg", SND_CHANNEL_VOICE ); $ripcord_1_mover.time (0.24); $ripcord_1_mover.move (FORWARD, 5); sys.waitFor($ripcord_1_mover); $ripcord_1_mover.move (FORWARD, -5); sys.waitFor($ripcord_1_mover); sys.wait(0.1); $ripcord_1_mover.startSoundShader ("sound/machinery/camera/1shot_stop.ogg", SND_CHANNEL_VOICE ); sys.trigger($snd_heart); sys.trigger($snd_heart2); $ripcord_1_mover.time (0.24); $ripcord_1_mover.move (FORWARD, 5); sys.waitFor($ripcord_1_mover); $ripcord_1_mover.move (FORWARD, -5); sys.waitFor($ripcord_1_mover); sys.wait(0.1); $ripcord_1_mover.startSoundShader ("sound/machinery/camera/1shot_stop.ogg", SND_CHANNEL_VOICE ); $ripcord_1_mover.time (0.17); $ripcord_1_mover.move (FORWARD, 5); sys.waitFor($ripcord_1_mover); $ripcord_1_mover.move (FORWARD, -8); sys.waitFor($ripcord_1_mover); //vo: what the hell?! $player1.startSoundShader ("sound/vo/enpro/15_what_the_hell.ogg", SND_CHANNEL_VOICE ); $ripcord_1_mover.setKey("hudname", "Parachute Ripcord (broken)"); $ripcord_a_static.setKey("hudrelay", "para1::ripcord_a_script"); $ripcord_b_static.setKey("hudrelay", "para1::ripcord_b_script"); /* //trying to move the rotation axis point... this doesnt work vector oldorigin; oldorigin = $ripcord_1_mover.getOrigin(); oldorigin += ('-3 0 0'); $ripcord_1_mover.setOrigin(oldorigin); */ } void para_macro(entity ent) { ent.sway( sys.random(64), 0, '0 48 0' ); ent.speed(sys.random(512)+768); ent.moveTo($para_target); } void drop_equipment() { //drop yer linen, start your grinnin //drop your equipment. vector vecthrow; //forward vecthrow_x = sys.random(128) + 128; //left vecthrow_y = sys.random(128) + 32; $moveable_flashlight.show(); //unhide it. sys.trigger($moveable_flashlight); //drop it. $moveable_flashlight.setLinearVelocity(vecthrow); //throw it. $moveable_flashlight.setAngularVelocity('32 64 16'); //spin it. //forward vecthrow_x = sys.random(128) + 128; //left vecthrow_y = sys.random(128) + 32; $moveable_mg.show(); //unhide it. sys.trigger($moveable_mg); //drop it. $moveable_mg.setLinearVelocity(vecthrow); //throw it. $moveable_mg.setAngularVelocity('32 64 16'); //spin it. //forward vecthrow_x = sys.random(128) + 128; //left vecthrow_y = sys.random(128) + 32; $moveable_clip1_static.show(); //unhide it. sys.trigger($moveable_clip1); //drop it. $moveable_clip1.setLinearVelocity(vecthrow); //throw it. $moveable_clip1.setAngularVelocity('32 64 16'); //spin it. //forward vecthrow_x = sys.random(128) + 128; //left vecthrow_y = sys.random(128) + 32; $moveable_clip2.show(); //unhide it. sys.trigger($moveable_clip2); //drop it. $moveable_clip2.setLinearVelocity(vecthrow); //throw it. $moveable_clip2.setAngularVelocity('32 64 16'); //spin it. //forward vecthrow_x = sys.random(128) + 128; //left vecthrow_y = sys.random(128) + 32; $moveable_pistol.show(); //unhide it. sys.trigger($moveable_pistol); //drop it. $moveable_pistol.setLinearVelocity(vecthrow); //throw it. $moveable_pistol.setAngularVelocity('32 64 16'); //spin it. } /* void player1_ohgod() { $player1.startSoundShader ("sound/vo/alpha_labs2/scientist_attacked_1.ogg", SND_CHANNEL_VOICE ); sys.wait(0.6); $player1.stopSound(SND_CHANNEL_VOICE,false); } */ void turnonlight(entity lightent, entity bindent) { lightent.setWorldOrigin(bindent.getWorldOrigin() + '0 0 16'); sys.waitFrame(); lightent.bind(bindent); lightent.fadeInLight(0.7); } void rock_buckle_script() { $rock_buckle_static.remove(); sys.wait(0.17); $rock_buckle.startSoundShader ("sound/ed/chainsaw/pull_zip.ogg", SND_CHANNEL_VOICE ); $rock_buckle.time(0.3); $rock_buckle.move(FORWARD, 1); sys.waitFor($rock_buckle); $rock_buckle.move(FORWARD, -1); sys.waitFor($rock_buckle); sys.wait(0.3); $player1.startSoundShader ("sound/cinematics/admin/case_unlock.ogg", SND_CHANNEL_VOICE ); sys.wait(0.1); //$para_mover.sway( 0, 0, '0 0 0' ); $para_mover.time(0.3); $para_mover.move(DOWN,56); sys.waitFor($para_mover); //drop stuff. drop_equipment(); //thread player1_ohgod(); $para_mover.time(0.1); $para_mover.move(UP,56); sys.waitFor($para_mover); $para_mover.time(0.07); $para_mover.move(DOWN,14); sys.waitFor($para_mover); $para_mover.time(0.04); $para_mover.move(UP,14); sys.waitFor($para_mover); $para_mover.time(0.07); $para_mover.move(DOWN,7); sys.waitFor($para_mover); $para_mover.time(0.04); $para_mover.move(UP,7); sys.waitFor($para_mover); sys.wait(0.7); $player1.startSoundShader ("sound/cinematics/admin/case_unlock.ogg", SND_CHANNEL_VOICE ); sys.wait(0.3); $player1.unbind(); //player fall sys.wait(0.3); $rock_body1.remove(); $rock_body2.remove(); $rock_buckle.remove(); sys.wait(2.5); $moveable_clip1.setKey ("hudname", "5.7x28mm clips (2x)"); $moveable_clip1.setKey ("hudrelay", "para1::moveable_clip1_pickup"); $moveable_clip2.setKey ("hudname", "Canteen (full)"); $moveable_clip2.setKey ("hudrelay", "para1::moveable_clip2_pickup"); $moveable_mg.setKey ("hudname", "FN P90 submachine gun (damaged)"); $moveable_mg.setKey ("hudrelay", "para1::moveable_mg_pickup"); $moveable_flashlight.setKey ("hudname", "Anglehead flashlight"); $moveable_flashlight.setKey ("hudrelay", "para1::moveable_flashlight_pickup"); $moveable_pistol.setKey ("hudname", "Colt .45 (empty)"); $moveable_pistol.setKey ("hudrelay", "para1::moveable_pistol_pickup"); sys.trigger($target_enableweapons_player); turnonlight($zlight1, $moveable_pistol); turnonlight($zlight2, $moveable_flashlight); turnonlight($zlight3, $moveable_clip1); turnonlight($zlight4, $moveable_clip2); turnonlight($zlight5, $moveable_mg); //bc /* $zlight1.setWorldOrigin($moveable_pistol.getWorldOrigin() + '0 0 16'); sys.waitFrame(); $zlight.bind($moveable_pistol); $zlight1.fadeInLight(0.7); */ } void moveable_pistol_pickup() { $zlight1.unbind(); $zlight1.fadeOutLight(1.7); $moveable_pistol.remove(); $player1.startSoundShader ("sound/ed/sfx/multiplayer/weapon_pickup.wav", SND_CHANNEL_VOICE ); sys.trigger($video_colt); sys.trigger($item_counter); } void moveable_flashlight_pickup() { $zlight2.unbind(); $zlight2.fadeOutLight(1.7); $moveable_flashlight.remove(); $player1.startSoundShader ("sound/ed/sfx/multiplayer/weapon_pickup.wav", SND_CHANNEL_VOICE ); //$player1.enableWeapon(); //sys.trigger($target_enableweapons_player); //sys.waitFrame(); sys.trigger($weapon_flashlight_player); sys.trigger($video_flashlight); sys.trigger($item_counter); } void moveable_clip1_pickup() { $zlight3.unbind(); $zlight3.fadeOutLight(1.7); $moveable_clip1.remove(); $moveable_clip1_static.remove(); //$player1.startSoundShader ("sound/ed/sfx/multiplayer/weapon_pickup.wav", SND_CHANNEL_VOICE ); $player1.startSoundShader ("sound/ed/bfg/bfg_raise.wav", SND_CHANNEL_VOICE ); //sys.trigger($video_clip); sys.trigger($item_counter); } void moveable_clip2_pickup() { $zlight4.unbind(); $zlight4.fadeOutLight(1.7); $moveable_clip2.remove(); //$player1.startSoundShader ("sound/ed/sfx/multiplayer/weapon_pickup.wav", SND_CHANNEL_VOICE ); $player1.startSoundShader ("sound/items/pickup_adrenaline.ogg", SND_CHANNEL_VOICE ); sys.trigger($video_canteen); sys.trigger($item_counter); } void moveable_mg_pickup() { $zlight5.unbind(); $zlight5.fadeOutLight(1.7); $moveable_mg.remove(); $player1.startSoundShader ("sound/ed/sfx/multiplayer/weapon_pickup.wav", SND_CHANNEL_VOICE ); sys.trigger($video_p90); sys.trigger($item_counter); } void briefing_script() { //sys.music ("music_intro"); $player1.startSoundShader("music_intro", SND_CHANNEL_VOICE); sys.fadeOut ('0 0 0',0.7); sys.wait (0.75); sys.trigger($pentagon_lock); sys.waitFrame(); sys.trigger($pentagon_room); sys.fadeIn ('0 0 0',0.43); } void endscript() { sys.trigger($pentagon_lock);//unlock player. sys.waitFrame(); sys.trigger($item_pda_1); sys.waitFrame(); sys.trigger($endlev); } void grass_place(entity ent, float radius, float howmuch) { float i; if (ent) { for ( i=(grass_total + 1); i <= (grass_total + howmuch); i++ ) { vector ranvec, finalvec; ranvec = ent.getWorldOrigin(); if (macro_neg()) { ranvec_x += sys.random(radius); } else { ranvec_x -= sys.random(radius); } if (macro_neg()) { ranvec_y += sys.random(radius); } else { ranvec_y -= sys.random(radius); } sys.trace( ranvec, ranvec + ('0 0 -512'), '0 0 0', '0 0 0', MASK_SOLID, $player1 ); finalvec = sys.getTraceEndPos(); if (finalvec) { //boy would a SWITCH function would be real handy right now. float inum; inum = int(sys.random(4)); if (inum == 0) { sys.setSpawnArg("skin","skins/grass_plasma_a.skin"); } else if (inum == 1) { sys.setSpawnArg("skin","skins/grass_plasma_b.skin"); } else if (inum == 2) { sys.setSpawnArg("skin","skins/grass_plasma_c.skin"); } else { sys.setSpawnArg("skin","skins/grass_plasma_d.skin"); } string grassname; grassname = "autograss_" + i; sys.setSpawnArg("name", grassname); sys.setSpawnArg("noclipmodel","1"); sys.setSpawnArg("solid","0"); sys.setSpawnArg("origin", finalvec + ('0 0 8')); sys.setSpawnArg("model","models/particles/plasma_bolt/plasma_bolt.lwo"); sys.spawn("func_static"); } //sys.wait(0.07); } grass_total += (howmuch); } } void macro_grass_autorotate(entity ent) { //get the angle difference between the grass & player vector vec; vec = ent.getWorldOrigin() - $player1.getWorldOrigin(); vec = sys.VecToAngles(vec); //only rotate on y axis vec_x = 0; vec_z = 0; vec_y += 90; //rotate the grass ent.setAngles(vec); } void grass_autorotate() { while (1) { float i; for ( i=1; i <= grass_total; i++ ) { entity ent; ent = sys.getEntity( "autograss_" + i ); if (ent) { thread macro_grass_autorotate( ent ); } //sys.print( "numnow " + i + " \n"); } sys.waitFrame(); } } void main() { //hudgui parms must be manually set at spawn-time $info_player_start_1.setGuiParm("titlescreen", 0); //ach, doom3 does NOT seem to destroy persistant args between //when new games (or manually changing maps thru console). //therefore, manually clear the persistant args in the intromap. sys.clearPersistantArgs(); vec_ripcord_1 = $ripcord_1_mover.getAngles(); $ripcord_1_mover.sway( 128, 0, '24 16 48' ); $ripcord_a.sway( 48, 0, '4 24 24' ); $ripcord_b.sway( 64, 0, '16 8 8' ); //the little glows around inventoryitems sys.setSpawnArg("texture", "lights/biground1"); sys.setSpawnArg("start_off", "1"); sys.setSpawnArg("light_radius", "24 24 384"); sys.setSpawnArg("_color", "0.47 0.78 1"); $zlight1 = sys.spawn("light"); sys.setSpawnArg("texture", "lights/biground1"); sys.setSpawnArg("start_off", "1"); sys.setSpawnArg("light_radius", "24 24 384"); sys.setSpawnArg("_color", "0.47 0.78 1"); $zlight2 = sys.spawn("light"); sys.setSpawnArg("texture", "lights/biground1"); sys.setSpawnArg("start_off", "1"); sys.setSpawnArg("light_radius", "24 24 384"); sys.setSpawnArg("_color", "0.47 0.78 1"); $zlight3 = sys.spawn("light"); sys.setSpawnArg("texture", "lights/biground1"); sys.setSpawnArg("start_off", "1"); sys.setSpawnArg("light_radius", "24 24 384"); sys.setSpawnArg("_color", "0.47 0.78 1"); $zlight4 = sys.spawn("light"); sys.setSpawnArg("texture", "lights/biground1"); sys.setSpawnArg("start_off", "1"); sys.setSpawnArg("light_radius", "24 24 384"); sys.setSpawnArg("_color", "0.47 0.78 1"); $zlight5 = sys.spawn("light"); para_macro($para_1); para_macro($para_2); para_macro($para_3); para_macro($para_4); para_macro($para_5); thread grass_init(); float grassthread; //grass_place: nameofthecenterpoint, radius, amountofgrass grassthread = thread grass_place($grasser_1, 300, 256); sys.waitForThread( grassthread ); //patch of grass where you land. grassthread = thread grass_place($grasser_2, 64, 48); sys.waitForThread( grassthread ); thread grass_autorotate(); }