obj explosive not setting

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
K.I.A.
Corporal
Posts: 27
Joined: Thu Feb 26, 2004 11:19 pm

obj explosive not setting

Post by K.I.A. »

I had this working, but in the process of fixing other problems, i somehow messed it up. I have an obj explosive made using the "Blow up that multiplayer objective" tutorial on this site. I had tested it and got some nice explosions. Then, after a few alterations to my map and script, I can no longer set my charge. I have checked repeatedly for typos (I have heard that some other mappers make typos from time to time, but never me :D ) and everything looked correct. I even remade the whole obj/explosive following the tutorial carefully; still no luck. I looked over my script and everything looks right to me, but I don't know much about scripting. Can someone telll me if the script is done properly? My explosive has the key/value targetname/tank_bomb

main:

setcvar "g_obj_alliedtext1" "Destroy the King Tiger"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" "Defend the King Tiger"
setcvar "g_obj_axistext2" "from the Allies"
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" "none"

level waittill prespawn

exec global/DMprecache.scr
level.script = maps/obj/chateauhq.scr
exec global/ambient.scr m4l1
thread global/exploder.scr::main

level waittill spawn

level.defusing_team = "axis"
level.planting_team = "allies"
level.targets_to_destroy = 1
level.bomb_damage = 200
level.bomb_explosion_radius = 256

level.dmrespawning = 0 // 1 or 0
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = axis // set to axis, allies, kills, or draw

//level waittill roundstart

$tank_bomb thread global/obj_dm.scr::bomb_thinker
thread allies_win_bomb
$tank_bomb thread axis_win_timer

end

// until called.

explode_bang:

exec global/exploder.scr::explode 1
radiusdamage $hurtobject 256 384

end

//*** --------------------------------------------
//*** "Axis Victory"
//*** --------------------------------------------

axis_win_timer:

level waittill axiswin

end

//*** --------------------------------------------
//*** "Allied Victory"
//*** --------------------------------------------

allies_win_bomb:

while(level.targets_destroyed < level.targets_to_destroy)
waitframe

teamwin allies
end


the backgound sound plays and explode_bang part of the script works, in case anyone needs to know.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

look at this from obj_team1.scr

thread allies_win_thread $flak88_weapon1_explosive


allies_win_thread local.bomb1:
while (local.bomb1.exploded != 1)
wait .1

teamwin allies
end

The obj_dm.scr sets the .exploded key of the bomb to 1 that is what it does

maybe try

thread allies_win_thread $tank_bomb

allies_win_thread local.bomb1:
while (local.bomb1.exploded != 1)
wait .1

teamwin allies
end


edit: ok I see that level.targets_destroyed is in pak6.pk3 obj_dm.scr not he one in pak0.pk3
Last edited by bdbodger on Mon Mar 08, 2004 11:29 am, edited 1 time in total.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

error

Post by tltrude »

Any errors in the console when you try to set it?
Tom Trude,

Image
K.I.A.
Corporal
Posts: 27
Joined: Thu Feb 26, 2004 11:19 pm

Post by K.I.A. »

nothing in console when i try to set.

as for the scripting, it did work at 1 point, so i am only looking for typos and those types of errors. if it does looks correct in syntax, then it must be a mapping problem.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

patch

Post by tltrude »

Bdbodger and I found out that you must have the mohaa patch installed for that tutorial to work. This is because they updated the obj_dm.scr script in the patch (pak6).
Tom Trude,

Image
K.I.A.
Corporal
Posts: 27
Joined: Thu Feb 26, 2004 11:19 pm

Post by K.I.A. »

i've got the bomb to set now. problem seems to be that there is a solid invisible box (bounding box?) around the tank. I have checked the non_solid box, but it doesn't make a difference. it sets fine when the explosive is away from the tank, but this is not a solution because solid box must go.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

is your tank a static vehicle or a normal vehicle and is it a script_model ?

I think you get the bounding box problem when you use a static tank not a normal tank .
K.I.A.
Corporal
Posts: 27
Joined: Thu Feb 26, 2004 11:19 pm

Post by K.I.A. »

bodger, you are right, it works when i dont use static tank, unfortunately the non static tanks available have animated treads, i think i may abandon the whole tank idea, too much trouble
BirdsofaFeather
Sergeant
Posts: 72
Joined: Sun Aug 24, 2003 3:49 am

Post by BirdsofaFeather »

I had to use a dirty script workaround to fix a problem with a v2 model doing the same thing. The bounding box of the v2 was too large to get close, but even if I checked the non-solid box the exploder script would make it solid again. So basically what I did was take just the v2 out of the exploder set and gave it a distinct targetname (and checked the non-solid box), keeping all the explosion effects and the exploder_smashed models the same. Then I ran a thread that checked to see if the bomb went off and hid the v2 as soon as it did. You could try this with the tank too if you want. The code looks like this:

Code: Select all

explosion_checker:

	while(1)
	{
		if (level.targets_destroyed == 1)
		{
			$v2 hide
			break
		}
		
		waitframe
	}

end
This works because immediatly as the bomb goes off the v2 disappears and the explosion effects still work. You could try subsituting the tank for this, see if it works. Just put "thread explosion_checker" somewhere after waittill roundstart.
Look! Up in the sky! It's a Bird! It's a Plane! It's......oh wait it's a bird.

<Your MOHAA Mapping Friend in the Sky ;)>
Post Reply