// Spawn a bangalore on the side of a wall. Provide a distance, horizontal and vertical, from bangalore's origin for the explosion emitters. Provide a damage radius. // Then by calling "bangalore_wallbomb.scr::blowup bomb2 5 250", the bangalore named "bomb2" explodes with 250 damage radius, and a pulsating ghost bangalore appears for 5 seconds. // Add a "1" parameter to turn off the pulsating ghost bangalore: "bangalore_wallbomb.scr::blowup bomb2 5 250 1". Add a "2" parameter instead, for only 8 seconds of pulsating. // Note: the horizontaldist value is a distance from whatever side the bangalore model's writing is facing: "Torpedo Bangalore M141". main local.name local.origin local.angles local.horizontaldist local.verticaldist: local.bangalore = spawn script_model targetname ("bangalore" + local.name) local.bangalore model "animate/bangalore.tik" local.bangalore.origin = local.origin local.bangalore.angles = local.angles // ( local.angles[0] local.angles[1] local.angles[2] ) local.bangalore notsolid local.sin = (waitthread global/math.scr::sine local.angles[1]) * local.horizontaldist local.cos = (waitthread global/math.scr::cosine local.angles[1]) * local.horizontaldist local.explosion = spawn script_model targetname ("bangexplode" + local.name) local.explosion model "fx/fx_truck_explosion.tik" local.explosion.origin = local.origin + ( local.cos local.sin local.verticaldist ) local.explosion.angles = local.angles local.explosion notsolid local.explosion.scale = 2 local.explosion anim aaaa local.debris = spawn script_model targetname ("bangdebris" + local.name) local.debris model "animate/explosion_bombwall.tik" local.debris.origin = local.origin + ( local.cos local.sin local.verticaldist ) local.debris.angles = local.angles local.debris notsolid local.debris anim idle end //////////////////////////////////////////////////////////////////////// blowup local.name local.offtime local.damageradius local.pulsatingoff: local.rtimedelay = (randomint(15) / 10.0) // randomize a decimal delay time before bangalore blows up. wait local.rtimedelay $("bangalore" + local.name).model = "animate/bangalore_pulsating_ghosting.tik" $("bangexplode" + local.name) anim idle $("bangdebris" + local.name) anim start if(local.pulsatingoff == 1) { $("bangalore" + local.name) hide } radiusdamage $("bangexplode" + local.name).origin 300 local.damageradius local.random1 = randomint(5) if(local.random1 == 0) { $("bangexplode" + local.name) playsound explode_building_small1 } if(local.random1 == 1) { $("bangexplode" + local.name) playsound explode_building_small2 } if(local.random1 == 2) { $("bangexplode" + local.name) playsound explode_building_small3 } if(local.random1 == 3) { $("bangexplode" + local.name) playsound explode_building_small4 } if(local.random1 == 4) { $("bangexplode" + local.name) playsound explode_building_small5 } waitframe //some emitters need to be turned back off immediately, otherwise player sees explosions again when going in/out of map bounds. $("bangexplode" + local.name) anim aaaa if(local.pulsatingoff != 2) { wait local.offtime } // default if(local.pulsatingoff == 2) { wait 8 $("bangalore" + local.name) hide // pulsates until emitter is done, about 8 seconds. wait (local.offtime - 8) } $("bangalore" + local.name).model = "animate/bangalore.tik" $("bangdebris" + local.name) anim idle if(local.pulsatingoff == 1 || local.pulsatingoff == 2) { $("bangalore" + local.name) show } end