Problem with Explosions

Post your scripting questions / solutions here

Moderator: Moderators

TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Problem with Explosions

Post 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
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post 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.
Live to map, not map to live.
-mohaa_rox, .map
moderator
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

ya, i'll email ya the map file tomorrow
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

Cool. For the TC?
Live to map, not map to live.
-mohaa_rox, .map
moderator
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Make sure you don't have a script_model (targetname exploderfire) without a model anywhere :wink:.
Image
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

nope, i double checked the models, but still no explosion

is the script ok?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

I really don't understand why you typed an 'end' in the middle of your main thread :roll:.
Image
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

aha! it's from an earlier script to injure players in a radius, i'll test later
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post 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.
Live to map, not map to live.
-mohaa_rox, .map
moderator
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post 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
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post 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... )
Admin .MAP Forums
Image
Head above heels.
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post 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
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post 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.
Live to map, not map to live.
-mohaa_rox, .map
moderator
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

ok, i'm sending now
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

I'll try my old bombing trick and see.
Live to map, not map to live.
-mohaa_rox, .map
moderator
Post Reply