Make sure to copy the "glass21.pcx", "glass22.pcx", "glass1b.wav" to your levels work folder.
Setting up the window:
Place the "glass21.pcx" in your level, then click on its properties and set the Action "md_glass" and in the tilt box put a value of 1. Other wise the pcx will turn and face the player at what ever angle he is.
Use the scale box to size it to your needs.
**NOTE***
Make sure you do this with "glass21.pcx" the other is what it morphs to and will not need any input from you, the script handles that part.
Copy /////////////// Mad Dog's broken window //////////////////

bla, bla,
bla,....
to /////////////// end broken window ///////////////
then paste at the bottom of your levels script.


/////////////// Mad Dog's broken window //////////////////

SOUND glass_snd,<glass1b.wav>;

function md_break()

{

 if((EVENT_TYPE == EVENT_SCAN && indicator == _EXPLODE)

 || (EVENT_TYPE == EVENT_SHOOT && indicator == _GUNFIRE))

{

 if(MY._ARMOR <= 0)

{

  MY._HEALTH -= damage;

}

else

{

  MY._ARMOR -= damage;

}

 if(my._HEALTH<1)

{

  ent_morph(my,"glass22.pcx");

  PLAY_SOUND glass_snd,50;

  my.transparent=on;

  my.passable=on;

  my.frame=1;

 

    while(my.frame<10)

{

  my.frame+=time;

 if(my.frame<7) {my.lightrange+=10;}

else

{

  my.lightrange-=20;

  temp.x=my.x+random(30)-20;

  temp.y=my.y+random(30)-20;

  temp.z=my.z+random(30)-15;

    emit(1, temp.x, particle_smoke);

}

  wait(1); }}}}

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

action md_glass

{

  my.transparent=on;

  my._health=.09;

  my.ambient=99;

  my.event=md_break;

  my.enable_shoot=on;

}

/////////////// end broken window ///////////////