Obj exploder thingy: HEEEEEEELP

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

Moderator: Moderators

Post Reply
The Porcelain Aardvark
Lance Corporal
Posts: 16
Joined: Sun Sep 01, 2002 4:55 pm

Obj exploder thingy: HEEEEEEELP

Post by The Porcelain Aardvark »

I have an exploder type arrangement in my map and it works fine... I make the brushes and the smashed brushes and make them script_objects blah blah yadda yadda...

My other bomb doesn't work. I used exactly the same technique, only this time instead of using brushes to create the script_objects, I gave them models, vis. vehicles/shermantank.tik and vehicles/shermantank_damaged.tik

Now, I found another way of blowing up a model and THAT works: the problem there is, the model shermantank_damaged.tik has a different local origin to shermantank.tik

The upshot of all this is that if I use the method that changes the model of the object, the tank appears to pounce across the room, and if I use the method with two script_objects it doesn't work at all, even though it is constructed exactly the same as the one that DOES work... :?

My script all seems to be in order... Can anyone help?
The Porcelain Aardvark
Lance Corporal
Posts: 16
Joined: Sun Sep 01, 2002 4:55 pm

Post by The Porcelain Aardvark »

:cry: I still can't get it to work and I know it can be done cos it happens in the training map!
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

vehicles_thinkers

Post by jv_map »

I'm not sure how it works, but you may want to take a look at the 'global/vehicles_thinkers.scr' script file. It handles explosions of all vehicles in the game, primarily of the ones in m5l2, when the player is driving around in a tank himself.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Post by tltrude »

I had the exact same problem:

http://dynamic4.gamespy.com/~mohrad/php ... .php?t=151

I fixed it by making both the exploder1 tank and the exploder1smashed tank into script objects. Then I added these lines to my script:

level waittill prespawn

$exploder1smashed hide

and...

// --------------------------------------------
// "Bomb 1 Exploded"
// --------------------------------------------

bomb1_exploded local.bomb1:

while (local.bomb1.exploded != 1)
wait .1
iprintlnbold_noloc "Axis have destroyed the Sherman tank!"
$exploder1smashed show
$exploder1fire anim start

end


The visible tank is just name exploder1 and vanishes when it blows. The explodersmashed tank appears when the bomb expoldes, but it is not named explodersmashed, as you can see above. I hope that works for you!!!
Last edited by tltrude on Thu Sep 19, 2002 6:53 am, edited 1 time in total.
Tom Trude,

Image
The Porcelain Aardvark
Lance Corporal
Posts: 16
Joined: Sun Sep 01, 2002 4:55 pm

Post by The Porcelain Aardvark »

So your solid model had targetname exploder1 and your smashed had targetname exploder1smashed?

Does that work? :)

In fact, could I trouble you to post your script because you seem to have done it all in the script rather than in the map itself..?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

sure

Post by tltrude »

Yes, the normal looking tank is named exploder1 and the bomb for it ($bomb1) has "target exploder1" in its entity properties. There is a lot of extra junk in this script because the tank fires at 8 random spots and stops firing when it is blown up. $random_tankfire is a fx fire_good emitter at the end of the barrel. $exploder1fire is a smoke emitter. I also added #set 2 to all the tank stuff, but I don't think it was really needed. The other objective is a well cover and it uses the normal exploder.scr names.



// SaharaTheMovie
// Map and Script by Tom Trude (tltrude), USA
// Wombat_Moveit script by Dennis Wyatt (Wombat), Australia

main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Defend the"
setcvar "g_obj_alliedtext2" "well and"
setcvar "g_obj_alliedtext3" "Lulubelle!!"
setcvar "g_obj_axistext1" "Destroy the tank,"
setcvar "g_obj_axistext2" "and open"
setcvar "g_obj_axistext3" "the well!!"

setcvar "g_scoreboardpic" "Sahara"

level waittill prespawn

level.farplane = 7000
level.farplanecolor = (.85 .55 .35)
$world farplane 7000
$world farplane_color (.85 .55 .35)

//*** Precache Dm Stuff
exec global/DMprecache.scr

level.script = maps/obj/SaharaTheMovie.scr
exec global/ambient.scr m4l1
exec global/exploder.scr

thread explodetrucks
$exploder solid
$exploder1smashed hide

level waittill spawn

level.bomb_damage = 300
level.bomb_explosion_radius = 256
level.defusing_team = "allies"
level.planting_team = "axis"
level.targets_to_destroy = 2
level.dmrespawning = 1 // 1 or 0
level.dmroundlimit = 6 // round time limit in minutes
level.clockside = allies // set to axis, allies, kills, or draw
level.wait_after_explode = 6

//prep
$random_tankfire anim stop
$exploder1fire anim stop
$truck1 anim idlenolights
$truck2 anim idlenolights
$truck4 anim idlenolights
$truck5 anim idlenolights
$truck6 anim idlenolights


level waittill roundstart

thread random_explode_setup

$bomb1.trigger_name = $trigger2
$bomb1.target.target = $trigger2
$bomb1.explosion_fx = "models/emitters/explosion_tank.tik"
$bomb1.explosion_sound = "explode_tank1"

$bomb2.trigger_name = $triggerbomb2
$bomb2.target.target = $exploder

$bomb1 thread global/obj_dm.scr::bomb_thinker
$bomb2 thread global/obj_dm.scr::bomb_thinker

$bomb1 thread allies_win_timer
thread axis_win_bomb

thread bomb1_exploded $bomb1
thread bomb2_exploded $bomb2

end

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

allies_win_timer:

level waittill allieswin

end

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

axis_win_bomb:

while(level.targets_destroyed < level.targets_to_destroy)
waitframe

teamwin axis
end

// --------------------------------------------
// "Bomb 1 Exploded"
// --------------------------------------------

bomb1_exploded local.bomb1:

while (local.bomb1.exploded != 1)
wait .1
iprintlnbold_noloc "Axis have destroyed the Sherman tank!"
$random_tankfire remove
$lulubelle_origin remove
$exploder1smashed show
$exploder1fire anim start

end

// --------------------------------------------
// "Bomb 2 Exploded"
// --------------------------------------------

bomb2_exploded local.bomb2:

while (local.bomb2.exploded != 1)

wait .1
thread global/exploder.scr::explode 1
$well_speaker playsound explode_water2
iprintlnbold_noloc "Axis have renewed their water supply!!"

end


// --------------------------------------------
// Random sand Explosions
// --------------------------------------------

random_explode_setup:

thread random_explode1
thread random_explode2
thread random_explode3
thread random_explode4
thread random_explode5
thread random_explode6
thread random_explode7
thread random_explode8

end

random_explode1:


wait (randomfloat 4 + 16)

if ($bomb1.exploded == 1)
{
goto end_random
}
$lulubelle_origin playsound tank_snd_fire2
$random_tankfire anim start
$random_explode1_origin playsound arty_leadinmp1

wait 1

$random_tankfire anim stop
$random_explode1 anim start
radiusdamage $random_explode1_origin 256 384
wait 5
goto random_explode1

end

random_explode2:


wait (randomfloat 7 + 21)

if ($bomb1.exploded == 1)
{
goto end_random
}
$lulubelle_origin playsound tank_snd_fire2
$random_tankfire anim start
$random_explode2_origin playsound arty_leadinmp1

wait 1

$random_tankfire anim stop
$random_explode2 anim start
radiusdamage $random_explode2_origin 256 384
wait 5
goto random_explode2

end

random_explode3:


wait (randomfloat 11 + 22)

if ($bomb1.exploded == 1)
{
goto end_random
}
$lulubelle_origin playsound tank_snd_fire2
$random_tankfire anim start
$random_explode3_origin playsound arty_leadinmp1

wait 1

$random_tankfire anim stop
$random_explode3 anim start
radiusdamage $random_explode3_origin 256 384
wait 5
goto random_explode3

end

random_explode4:


wait (randomfloat 12 + 24)

if ($bomb1.exploded == 1)
{
goto end_random
}
$lulubelle_origin playsound tank_snd_fire2
$random_tankfire anim start
$random_explode4_origin playsound arty_leadinmp1

wait 1

$random_tankfire anim stop
$random_explode4 anim start
radiusdamage $random_explode4_origin 256 384
wait 5
goto random_explode4

end

random_explode5:


wait (randomfloat 15 + 30)

if ($bomb1.exploded == 1)
{
goto end_random
}
$lulubelle_origin playsound tank_snd_fire2
$random_tankfire anim start
$random_explode5_origin playsound arty_leadinmp1

wait 1

$random_tankfire anim stop
$random_explode5 anim start
radiusdamage $random_explode5_origin 256 384
wait 5
goto random_explode5

end

random_explode6:


wait (randomfloat 5 + 15)

if ($bomb1.exploded == 1)
{
goto end_random
}
$lulubelle_origin playsound tank_snd_fire2
$random_tankfire anim start
$random_explode6_origin playsound arty_leadinmp1

wait 1

$random_tankfire anim stop
$random_explode6 anim start
radiusdamage $random_explode6_origin 256 384
wait 5
goto random_explode6

end


random_explode7:

wait (randomfloat 8 + 16)

if ($bomb1.exploded == 1)
{
goto end_random
}
$lulubelle_origin playsound tank_snd_fire2
$random_tankfire anim start
$random_explode7_origin playsound arty_leadinmp1

wait 1

$random_tankfire anim stop
$random_explode7 anim start
radiusdamage $random_explode7_origin 256 384
wait 5
goto random_explode7

end

random_explode8:

wait (randomfloat 4 + 8)

if ($bomb1.exploded == 1)
{
goto end_random
}
$lulubelle_origin playsound tank_snd_fire2
$random_tankfire anim start
$random_explode8_origin playsound arty_leadinmp1

wait 1.3

$random_tankfire anim stop
$random_explode8 anim start
radiusdamage $random_explode8_origin 256 384
wait 5
goto random_explode8

end


//--------------------------------------------
// truck exploder threads
//--------------------------------------------

explodetrucks:

$truck_trigger waittill trigger

$truck1 thread global/Wombat_moveit.scr::moveit $truck1_moveto vehicles/opeltruck_d.tik 25

$truck2 waitthread global/Wombat_moveit.scr::moveit $truck2_moveto vehicles/opeltruck_d.tik 25
$truck2 thread global/Wombat_moveit.scr::moveit $truck2_moveto2 vehicles/opeltruck_d.tik 25


end

end_random:

end
Tom Trude,

Image
The Porcelain Aardvark
Lance Corporal
Posts: 16
Joined: Sun Sep 01, 2002 4:55 pm

Post by The Porcelain Aardvark »

I'm still having problems :( I can't set the bomb now. it says "waittil trigger trigger1" (I renamed your trigger2 to trigger1 and changed the script too :)) and then "failed cansee check" in the console when I try to use the bomb
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

it says "waittil trigger trigger1"
What does say that? If your script does, I think it should be
$trigger1 waittill trigger
ScorpioMidget
Lance Corporal
Posts: 21
Joined: Thu Jun 13, 2002 9:57 am
Location: Notts, UK
Contact:

Post by ScorpioMidget »

IF your getting that debug messages (which is inside the exploder code), it means that although you can set trigger (and indeed have) you can't see the actual bomb.

This is usually because it's hiden by a bounding box of nearby object.

So move the bomb a little away from nearby objects, recompile, and it should be a ok.


Had this exact problem on an Omaha obj map i just fixed for SniperSnake and FilmyGuy.
ScorpioMidget
Still has a soft spot for Mohaa.
The Porcelain Aardvark
Lance Corporal
Posts: 16
Joined: Sun Sep 01, 2002 4:55 pm

Post by The Porcelain Aardvark »

I found it :) the bomb was inside the bounding box of the tank itself, so I had to create a convenient nearby wall so I had somewhere else to put the bomb

It works great now :D thanks for your help y'all :) All I need to do now is the architecture
Post Reply