Page 1 of 2

Problem with Explosions

Posted: Tue Feb 11, 2003 12:08 am
by TheShiznaeSpe
in this script, i'm trying to get walls to explode

i'm using the setthread command on the triggers so that it starts up the exploding scripts-everything works even, except that when it says the bomb should have gone off-it hasn't

-the bomb removes and everything, but the walls don't blow

any ideas?

Code: Select all

//Title: Fort Vaux
// Architecture: TheShiznaeSpe
// Scripting: TheShiznaeSpe

main:

setcvar "g_obj_alliedtext1" "Protect the bunker" 
setcvar "g_obj_alliedtext2" "and"
setcvar "g_obj_alliedtext3" "protect the fort."
setcvar "g_obj_axistext1" "Blow the walls"
setcvar "g_obj_axistext2" "and"
setcvar "g_obj_axistext3" "infiltrate the bunker."

setcvar "g_scoreboardpic" "none"

level waittill prespawn

exec global/ambient.scr MP_Malta_DM

end

level waittill spawn

level.script = maps/obj/Fort_Vaux.scr

//level waittill roundstart //comment out for testing

level.dmrespawning = 1
level.dmroundlimit = 20
level.clockside = allies

thread german_victory
thread french_victory

explode_gate:

	iprintlnbold_noloc "Bomb has been set, the main gate will blow in 5 seconds..."
	wait 1
	iprintlnbold_noloc "4"
	wait 1
	iprintlnbold_noloc "3"
	wait 1
	iprintlnbold_noloc "2"
	wait 1
	iprintlnbold_noloc "1"
	wait 1

	exec global/exploder.scr::explode 1
	
	iprintlnbold_noloc "Gate blown!"
	
	$gatebomb remove
	
end

explode_wall_back:
	
	iprintlnbold_noloc "Bomb has been set, the back wall will blow in 5 seconds..."
	wait 1
	iprintlnbold_noloc "4"
	wait 1
	iprintlnbold_noloc "3"
	wait 1
	iprintlnbold_noloc "2"
	wait 1
	iprintlnbold_noloc "1"
	wait 1

	exec global/exploder.scr::explode 2

	iprintlnbold_noloc "There goes the back wall!"
	
	$backbomb remove

end

explode_wall_side:
	
	iprintlnbold_noloc "Bomb has been set, the side wall will blow in 5 seconds..."
	wait 1
	iprintlnbold_noloc "4"
	wait 1
	iprintlnbold_noloc "3"
	wait 1
	iprintlnbold_noloc "2"
	wait 1
	iprintlnbold_noloc "1"
	wait 1
	
	exec global/exploder.scr::explode 3
	
	iprintlnbold_noloc "CHARGE, THE FLANK IS EXPOSED!"

	$sidebomb remove

end

german_victory:

	$bunker_trigger waittill trigger
	
	while(1)
	{
		self waittill trigger
		local.triggerer = parm.other
		if(local.triggerer.dmteam == "axis")
			break
		wait 0.1
	}
	
iprintlnbold_noloc "The Germans have infiltrated the bunker!"	
teamwin axis

end

french_victory:

	level waittill allieswin
	
iprintlnbold_noloc "The German offensive has been impeded!"
	
end

Posted: Tue Feb 11, 2003 1:59 am
by mohaa_rox
Did you set your wall as a script object with #set xx and the destroyed one with a script objective #set xx? And an fx will do good too.

Posted: Tue Feb 11, 2003 3:04 am
by TheShiznaeSpe
ya, i'll email ya the map file tomorrow

Posted: Tue Feb 11, 2003 3:11 am
by mohaa_rox
Cool. For the TC?

Posted: Tue Feb 11, 2003 7:12 am
by jv_map
Make sure you don't have a script_model (targetname exploderfire) without a model anywhere :wink:.

Posted: Wed Feb 12, 2003 12:51 pm
by TheShiznaeSpe
nope, i double checked the models, but still no explosion

is the script ok?

Posted: Wed Feb 12, 2003 4:40 pm
by jv_map
I really don't understand why you typed an 'end' in the middle of your main thread :roll:.

Posted: Thu Feb 13, 2003 10:39 pm
by TheShiznaeSpe
aha! it's from an earlier script to injure players in a radius, i'll test later

Posted: Thu Feb 20, 2003 1:19 pm
by mohaa_rox

Code: Select all

//Title: Fort Vaux 
// Architecture: TheShiznaeSpe 
// Scripting: TheShiznaeSpe 

main: 

setcvar "g_obj_alliedtext1" "Protect the bunker" 
setcvar "g_obj_alliedtext2" "and" 
setcvar "g_obj_alliedtext3" "protect the fort." 
setcvar "g_obj_axistext1" "Blow the walls" 
setcvar "g_obj_axistext2" "and" 
setcvar "g_obj_axistext3" "infiltrate the bunker." 

setcvar "g_scoreboardpic" "none" 

level waittill prespawn 

exec global/ambient.scr MP_Malta_DM 

end 

level waittill spawn 

level.script = maps/obj/Fort_Vaux.scr 

//level waittill roundstart //comment out for testing 

level.dmrespawning = 1 
level.dmroundlimit = 20 
level.clockside = allies 

thread german_victory 
thread french_victory 

explode_gate: 

[color=red]$triggername1 waitthread global/exploder.scr::explode 1[/color] // where $triggername1 is your trigger name
   iprintlnbold_noloc "Bomb has been set, the main gate will blow in 5 seconds..." 
   wait 1 
   iprintlnbold_noloc "4" 
   wait 1 
   iprintlnbold_noloc "3" 
   wait 1 
   iprintlnbold_noloc "2" 
   wait 1 
   iprintlnbold_noloc "1" 
   wait 1 

   exec global/exploder.scr::explode 1 
    
   iprintlnbold_noloc "Gate blown!" 
    
   $gatebomb remove 
    
end 

explode_wall_back: 
   
   iprintlnbold_noloc "Bomb has been set, the back wall will blow in 5 seconds..." 
   wait 1 
   iprintlnbold_noloc "4" 
   wait 1 
   iprintlnbold_noloc "3" 
   wait 1 
   iprintlnbold_noloc "2" 
   wait 1 
   iprintlnbold_noloc "1" 
   wait 1 

   exec global/exploder.scr::explode 2 

   iprintlnbold_noloc "There goes the back wall!" 
    
   $backbomb remove 

end 

explode_wall_side: 
    

   iprintlnbold_noloc "Bomb has been set, the side wall will blow in 5 seconds..." 
   wait 1 
   iprintlnbold_noloc "4" 
   wait 1 
   iprintlnbold_noloc "3" 
   wait 1 
   iprintlnbold_noloc "2" 
   wait 1 
   iprintlnbold_noloc "1" 
   wait 1 
    
   exec global/exploder.scr::explode 3 
    
   iprintlnbold_noloc "CHARGE, THE FLANK IS EXPOSED!" 

   $sidebomb remove 

end 

german_victory: 

   $bunker_trigger waittill trigger 
    
   while(1) 
   { 
      self waittill trigger 
      local.triggerer = parm.other 
      if(local.triggerer.dmteam == "axis") 
         break 
      wait 0.1 
   } 
    
iprintlnbold_noloc "The Germans have infiltrated the bunker!"    
teamwin axis 

end 

french_victory: 

   level waittill allieswin 
    
iprintlnbold_noloc "The German offensive has been impeded!" 
    
end
Add the same for the rest. If it's wrong, check the tuts on bombing, @ Nemesis' page or Bjarne.

Posted: Thu Feb 20, 2003 11:10 pm
by TheShiznaeSpe
the problem is not that the thread doesn't start, it's that after the script counts down, the bomb just doesn't explode

Posted: Thu Feb 20, 2003 11:36 pm
by Bjarne BZR
If you look in the file obj_dm.scr ( In global in pak0.pk3 ) and the method bomb_explode: you will see that the standard behaviour of calling:

Code: Select all

$bomb_targetname thread global/obj_dm.scr::bomb_thinker
of an exlosion does more than just

Code: Select all

exec global/exploder.scr::explode
look in the file to see how its done...

( I really dont know but this is my guess. Slap me if I'm barking up the wrong tree here... )

Posted: Fri Feb 21, 2003 3:38 am
by TheShiznaeSpe
this isn't a bomb thinker for an obj, it's just a bomb that can be set (not defused) and it blows the wall

Posted: Fri Feb 21, 2003 6:22 am
by mohaa_rox
Did you set the correct stuff for the bomb? Give me the map, I'll take a look. Don't worry, I'm in the same mod as you.

Posted: Fri Feb 21, 2003 9:18 pm
by TheShiznaeSpe
ok, i'm sending now

Posted: Sat Feb 22, 2003 3:40 am
by mohaa_rox
I'll try my old bombing trick and see.