main local.origin0 local.origin1 local.origin2 local.origin3 local.origin4 local.origin5 local.origin6 local.origin7 local.origin8 local.origin9: level.spot_bbomb[0] = ( local.origin0 ) + ( 0 0 30 ) level.spot_bbomb[1] = ( local.origin1 ) + ( 0 0 30 ) level.spot_bbomb[2] = ( local.origin2 ) + ( 0 0 30 ) level.spot_bbomb[3] = ( local.origin3 ) + ( 0 0 30 ) level.spot_bbomb[4] = ( local.origin4 ) + ( 0 0 30 ) level.spot_bbomb[5] = ( local.origin5 ) + ( 0 0 30 ) level.spot_bbomb[6] = ( local.origin6 ) + ( 0 0 30 ) level.spot_bbomb[7] = ( local.origin7 ) + ( 0 0 30 ) level.spot_bbomb[8] = ( local.origin8 ) + ( 0 0 30 ) level.spot_bbomb[9] = ( local.origin9 ) + ( 0 0 30 ) local.random = randomint(level.spot_bbomb.size ) local.randomold = local.random local.trig = spawn trigger_use local.trig.origin = level.spot_bbomb[local.random] local.trig setsize ( -30 -30 -20 ) ( 30 30 50 ) local.trig setthread boomerweenie //local.trig message "*** You Got A Bomb! ***" local.trig wait 0 local.trig delay 0 local.trig.pickedup = 0 local.rocket1 = spawn script_model local.rocket1 model "AMMO/us_bomb.tik" local.rocket1.origin = level.spot_bbomb[local.random] local.rocket1.scale = 1.2 //local.rocket1 light 0 0 1 130 //local.rocket1 rotatey 50 //local.rocket1 time 10 local.rocket1 notsolid //local.rocket1 thread Rotatex // after an unknown amount of map time, the trigger model might stop rotating. flickerrotate.scr fixes this issue. level waittill spawn local.rocket1.targetname = ("giantbomb_weapon" + local.rocket1.entnum) exec global/flickerrotate.scr local.rocket1.targetname ( 0 0 0.75 ) 125 10 10 25 while(1) { local.trig waittill trigger //local.rocket1 hide local.trig nottriggerable waitframe // allows local.trig.pickedup to update first local.randomold = local.random local.random = randomint(level.spot_bbomb.size ) if(local.randomold == local.random) { local.random = randomint(level.spot_bbomb.size) if(local.randomold == local.random) { local.random = randomint(level.spot_bbomb.size) if(local.randomold == local.random) { local.random = randomint(level.spot_bbomb.size) if(local.randomold == local.random) { local.random = randomint(level.spot_bbomb.size) if(local.randomold == local.random) { local.random = randomint(level.spot_bbomb.size) } } } } } if(local.trig.pickedup != 0) { local.rocket1.origin = level.spot_bbomb[local.random] local.trig.origin = level.spot_bbomb[local.random] } local.trig.pickedup = 0 //local.rocket1 show local.trig triggerable } end Rotatex: while(self) { self.angles = (self.angles + ( 05 -03 07 )) self light (randomfloat 10 / 100) (randomfloat 10 / 100) (randomfloat 25 / 100 + 0.75) 125 waitframe } end boomerweenie: local.player=parm.other if(local.player.whileloop != 1) { local.player thread itemnotattached_fix } if(local.player.isfiredboomerweenie == 1) { local.player iprint "Cannot pick up. You are holding something already." self.pickedup = 0 self message "" end } self.pickedup = 1 self message "*** You Got A Bomb! ***" local.player.isfiredboomerweenie = 1 local.player iprint "*** Hold USE & Left/Right-click to throw a bomb. ***" //local.player playsound plantbomb1 local.random2 = randomint(4) if(local.random2 == 0) { local.player playsound bombpickup1 } if(local.random2 == 1) { local.player playsound bombpickup2 } if(local.random2 == 2) { local.player playsound bombpickup3 } if(local.random2 == 3) { local.player playsound bombpickup4 } //huddraw_alpha 102 0 //huddraw_virtualsize 102 1 //huddraw_alpha 102 .8 //huddraw_font 102 "verdana-12" //huddraw_color 102 0 0 .5 //huddraw_rect 102 -200 232 200 14 //huddraw_string 102 "Giant Bomb: Equipped" local.thing = spawn script_object local.thing model AMMO/us_bomb.tik local.thing.scale = 0.35 //0.2 local.thing attach local.player "Bip01 R Hand" //"tag_weapon_left" local.thing.angles = ( 45 90 0 ) //( 0 90 45 ) local.holdtime = 0 while (isalive local.player && (local.player.fireheld == 0 || local.player.useheld == 0 )) wait .1 if(local.player.dmteam == "spectator" || local.player.health <= 0) { local.laser21 remove local.laser22 remove local.thing remove local.player.isfiredboomerweenie = 0 local.player.istake=0 //huddraw_string 102 "" } if(local.player.isfiredboomerweenie == 0) end local.groundtarget = spawn script_origin //targetname "bombweap_groundtarget" local.groundspot_target = spawn script_origin //targetname "bombweap_groundspot_target" local.fwd_vec = angles_toforward local.player.viewangles local.start = local.player gettagposition "Bip01 Head" local.range = 20240 //huddraw_string 102 "Giant Bomb: Launched" local.groundtarget.origin = trace (local.start + local.fwd_vec * 64) (local.start + local.fwd_vec * local.range ) local.sin = (waitthread global/math.scr::sine local.player.angles[1]) * 25 // spawns bomb 25 units in front of player, to avoid collision with player's head. local.cos = (waitthread global/math.scr::cosine local.player.angles[1]) * 25 // somehow "notsolid" doesn't fix that issue. if(local.fwd_vec[2] < 0.00 && local.fwd_vec[2] > -0.20) { local.pitchangle = (local.fwd_vec[2] * -90) } // point the bomb upwards or downwards, based on player's pitch angle. if(local.fwd_vec[2] <= -0.20) { local.pitchangle = (local.fwd_vec[2] * -90) - 15 } if(local.fwd_vec[2] >= 0.00 && local.fwd_vec[2] < 0.20) { local.pitchangle = (local.fwd_vec[2] * -90) } if(local.fwd_vec[2] >= 0.20) { local.pitchangle = (local.fwd_vec[2] * -90) + 15 } local.laser21 = spawn script_model targetname ("bigbombweap" + local.player.entnum) // make sure these targetnames are different (for blowing up planes), local.laser21 model "AMMO/us_bomb.tik" // then have a for-loop checking $player.size times for bigbombs. local.laser21.origin = local.start + ( local.cos local.sin 10 ) local.laser21.angles = local.player.angles + ( 0 90 local.pitchangle ) // player.angles[2] and player.viewangles[2] are always 0; need to find it elsewhere. local.laser21.scale = 3 // fwd_vec[2] = 0 when player looks horizontal, -0.999 looking down, 0.999 looking up. local.laser21 notsolid // multiply fwd_vec[2] by -90 to get pitch-angle (Z-angle). No need to equate sin^-1( fwd_vec[2] ). local.laser21 light 1 0 0 285 local.laser22 = spawn script_model local.laser22 model "items/cigarette.tik" local.laser22.scale = 0.001 local.laser22.origin = local.laser21.origin local.laser22 notsolid local.laser22 light .125 0 .433 785 local.laser22 glue local.laser21 local.thing remove local.laser21 physics_off local.laser22 physics_off local.showspot = 1 local.laser21 playsound firetouch1 local.laser21 loopsound timer01 //snd_b_zing12 local.laser22 loopsound fireplace1 //snd_b_zing9 local.laser21 thread movestuck_fix local.groundtarget.origin local.laser21 local.laser22 local.groundtarget local.groundspot_target local.laser21 time 1.5 // speed of bomb after launching from player. local.laser21 moveto local.groundtarget.origin local.laser21 waitmove local.Exp21 = spawn "fx/scriptbazookaexplosion.tik" local.Exp22 = spawn "animate/fx_mortar_dirt.tik" local.Exp21.origin = local.groundtarget.origin local.Exp21.scale = 1.7 local.Exp21 light 1 0 0 600 local.Exp21 anim start local.Exp22.origin = local.groundtarget.origin local.Exp22.scale = 1.7 local.Exp22 light 1 .5 0 600 local.Exp22 anim start local.Exp23 = spawn script_model local.Exp23 model "fx/barrel_gas_destroyed.tik" local.Exp23.origin = local.groundtarget.origin + ( 0 0 35 ) local.Exp23.scale = 1 local.Exp23 anim idle //huddraw_string 102 "Giant Bomb: Exploded" wait 0.05 local.random2 = randomint(2) if(local.random2 == 0) { local.Exp21 playsound gastank_explo1 } if(local.random2 == 1) { local.Exp21 playsound gastank_explo2 } waitframe local.Exp21 anim stop local.Exp22 anim stop local.Exp23 anim dummy local.Exp21 remove local.Exp22 remove local.Exp23 remove local.laser21 stoploopsound local.laser22 stoploopsound local.laser21 remove local.laser22 remove huddraw_string 102 "" local.groundtarget remove local.groundspot_target remove local.player.isfiredboomerweenie=0 end //////////////////////////////////////////////////////////////////////// itemnotattached_fix: // only fixes "isfiredboomerweenie" after player dies or changes team. self.whileloop = 1 local.team = self.dmteam while(isalive self && self.dmteam == local.team && self.dmteam != "spectator") { wait 0.1 } self.isfiredboomerweenie = 0 self.whileloop = 0 end //////////////////////////////////////////////////////////////////////// movestuck_fix local.origin local.laser21 local.laser22 local.groundtarget local.groundspot_target: local.n = 0 // if bomb is fired at a tank entity, for example, sometimes the bomb will get stuck inside the tank and never blow up. while(self.origin != local.origin) // when the bomb takes too long to explode, this thread forces the bomb to explode and reset the trigger. { if(local.n == 4) // 4 * (wait 0.5) = 2 seconds. { local.Exp21 = spawn "fx/scriptbazookaexplosion.tik" local.Exp22 = spawn "animate/fx_mortar_dirt.tik" local.Exp21.origin = self.origin // local.origin explodes bomb at groundspot origin, not at current bomb's origin (self). local.Exp21.scale = 1.7 local.Exp21 light 1 0 0 600 local.Exp21 anim start local.Exp22.origin = self.origin local.Exp22.scale = 2 local.Exp22 light 1 .5 0 600 local.Exp22 anim start //huddraw_string 102 "Giant Bomb: Exploded" wait 0.05 local.random3 = randomint(2) if(local.random3 == 0) { local.Exp21 playsound gastank_explo1 } if(local.random3 == 1) { local.Exp21 playsound gastank_explo2 } wait .1 local.Exp21 anim stop local.Exp22 anim stop local.Exp21 remove local.Exp22 remove local.laser21 stoploopsound local.laser22 stoploopsound local.laser21 remove local.laser22 remove //huddraw_string 102 "" local.groundtarget remove local.groundspot_target remove end } if(local.n >= 4 || local.laser21.origin == NIL) { end } // run the n==4 if-statement only once, then end. // also end if $bigbombweap has been removed already. local.n++ wait 0.5 } end