main() { precacheFX(); } precacheFX() { level._effect["fire"] = loadfx ("fx/fire/tinybon.efx"); maps\mp\_fx::loopfx("fire", (2544, 184, -88), 0.6); level._effect["smoke"] = loadfx ("fx/smoke/ash_smoke.efx"); maps\mp\_fx::loopfx("smoke", (2544, 184, -88), 0.7); } windowBreakInit() { //Breakable Windows Multiplayer Script by n00bCODmapper /************************************************** ************************* This script is a a heavy modification of the _window.gsc file that comes with CoD. This modification was necessary to make breakable windows work in multiplayer. ************************************************* ***************************/ windows = getentarray("window","targetname"); //find everything with targetname "window" if(isdefined(windows)) //if there were window triggers found { windowfx = loadfx ("fx/impacts/glass_shatter2.efx"); //define the glass effect for(i=0;ixdist) //window is aligned along the x axis, windows running along z axis will not work because of this. { direction = vectornormalize(xendorg-window.origin); //creates a vector perpendicular to the window for the width of the effect. Note that the width of the trigger will affect how far glass flies. ycount = (int)(ydist)/spacing; //determines how many effects along y axis (rounds down) if(!(ycount)) ycount = 1; //must have at least 1 zcount = (int)(zdist)/spacing; //determines how many effects along z axis (rounds down) if(!(zcount)) zcount = 1; //must have at least 1 ystart = window.origin[1]+((ydist - (ycount*spacing))/2); //Since the effect has a pretetermined size, make the amount of error equal on both sides. zstart = window.origin[2]+((zdist - (zcount*spacing))/2); //Since the effect has a pretetermined size, make the amount of error equal on both sides. //Determine where center points are for glass effect. for(x=0;x 95) { return ("bigbreak"); } totaldamage += amount; //window accumulates damage if(totaldamage > 150) //The trigger has been set off break; } return ("smallbreak"); } //Necessary function for Breakable Windows Multiplayer Script vectormultiply(vec, dif) //used to enhance the direction vector so glass flies farther { vec = (vec[0] * dif, vec[1] * dif, vec[2] * dif); return vec; } /*****To Do List**** Make windows Z axis capable. Make windows able to run diagonally. Make effects sequence start in middle and spiral out to edges. Get rid of having to create an origin key or simplify use of origin key. - I know how to do these but it will take time. Watch the tutorial thread this was originally posted on for updates to address these things. ********************/ // Original by lordblank // Rewritten by Snake Shift elevatorInit() { level.elevatorDown = false; // elevator starts at bottom: true/false level.elevatorMoving = false; // elevator is not currently moving thread elevator_start(); } elevator_start() { elevator = getentarray ("elevatorswitch","targetname"); if ( isdefined(elevator) ) for (i = 0; i < elevator.size; i++) elevator[i] thread elevator_think(); } elevator_think() { while (1) { self waittill ("trigger"); if(!level.elevatorMoving) thread elevator_move(); } } elevator_move() { elevatormodel = getent ("elevatormodel", "targetname"); level.elevatorMoving = true; speed = 4; height = 272; wait (1); if (level.elevatorDown) // moves to top { elevatormodel moveZ (height, speed); elevatormodel waittill ("movedone"); level.elevatorDown = false; } else { // moves to bottom elevatormodel moveZ (height - (height * 2), speed); elevatormodel waittill ("movedone"); level.elevatorDown = true; } level.elevatorMoving = false; }