Page 1 of 2

Exploding Tanks not disappearing!

Posted: Sat Jul 05, 2003 5:38 am
by GI Morpheus
I'm having a problem with my tanks not disappearing. After setting up a tank to blowup, the original non-destroyed tank is not disappearing, after being replaced by the destroyed version. I get both versions in the same location. Everything works fine for BMX bikes or Opel trucks, but those darn panzers just won't go away. Here is the info for each entity:

classname=vehicle_german_panzer-tank-europe
model=vehicles/panzer_tank_europe.tik
targetname=exploder
testanim=idle
scale=1.0
#set=1
origin=-5494.00 -2236.00 64.00
angles=0 90 0

classname=vehicle_german_panzer_iv_european_destroyed
model=vehicles/panzer_iv_eud.tik
targetname=explodersmashed
testanim=idle
scale=1.0
#set=1
origin=-5482.00 -2214.00 58.00
angles=0 90 0

classname=fx_explosion_tank
model=emitters/explosion_tank.tik
targetname=exploderfire
testanim=idle
scale=1.0
#set=1
origin=-5496.00 -2120.00 160.00

classname=trigger_multiple
health=200
targetname=explodertrigger
spawnflags=128 (damage)
#set=1

"exec global/exploder.scr" is in the map.scr file

Can anyone shed some light on this?

explode

Posted: Sat Jul 05, 2003 6:09 am
by tltrude
How are you setting off the explosion?

exec global/exploder.scr::explode 1

Search your .map file with wordpad for the targetname "exploder". You may have a hidden extra one. A lot of thing will stop an exploder from working. Sometimes it is other scripts that overwrite a variable in the exploder script. So, try stopping the other scripts from loading, or move the exploder script loading line so it loads last.

Umm... Like this?

Posted: Sat Jul 05, 2003 7:12 am
by GI Morpheus
tlTrude,

Umm.. I'm using this:

exec global/exploder.scr

and that's it. I have other #set numbers working fine (like an opel truck at #3 and a BMW bike at #4). It just seems to be the tanks. I don't think it's a scripting issue, since I'm only using the line above. I'm not using "::explode 1" in the above line. Why do I need to? Isn't each explosion set off by it's own trigger? I followed the "Nemesis" tutorial at:
http://users.1st.net/kimberly/Tutorial/blowup.htm

Did I miss something?

trigger

Posted: Sun Jul 06, 2003 11:26 am
by tltrude
Ok, you are using a trigger and that's fine. The line I put will set it off in the script if you, for example, wanted it to be bombed by a plane.

For your non-disappearing tank you need to check the targetnames again. Anything with the name "exploder" and #set 1 should vanish when the #set 1 exploder is triggered. Your trigger has to be targetnamed explodertrigger and have #set 1 as well.

It probably wouldn't hurt to review the text at the top of the exploder.scr file. Here is a tutorial map on bombers and it has lots of exploders you can study.

http://pages.sbcglobal.net/tltrude/Temp/test_bomber.zip

Image

Trigger

Posted: Tue Jul 08, 2003 4:35 am
by GI Morpheus
tltrude,

Here's what I don't get (after looking at your test bomb file). The sherman tank is just one piece (tank and cannon). But the german tanks seem to have 2 pieces the tank and the cannon. However when I drop a german (panzer or tiger) without the cannon, it seems to have a cannon on top during the game. I noticed that you had a seperate cannon on top of yours in the test bomb file.

Image

How is this supposed to work?

Posted: Tue Jul 08, 2003 10:02 am
by bdbodger
The reason you see the turret in the game is because of this line in panzer_tank.tik
// Spawn and attach the parts
spawnturret 0 "vehicles/panzer_cannon.tik"
//spawnturret 1 "vehicles/panzer_smgun.tik"
if you need to script the tank to fire the animations are in the Panzer_cannon.tik and you will do something like this

$mypanzer thread fireme

fireme:
local.gun = self QueryTurretSlotEntity 0
local.gun anim fire
end

This HAS to be simple!

Posted: Thu Jul 10, 2003 5:13 pm
by GI Morpheus
Look guys, I don't need an animated tank. I just want to be able to blowup a static german tank. Since I don't add a cannon to the tank in the first place, I don't have a cannon to call as an exploder object. Does this mean that I HAVE to add a cannon to every german tank and call it as an exploder object just to make it disappear? I don't get this, It has to be simple. How is everybody else doing this? Here's an example:

Image

Posted: Thu Jul 10, 2003 9:14 pm
by Alcoholic
you have to do this to the original tank.

$brandnewtank.cannon = $brandnewtank queryturretslotentity 0

if ($brandnewtank.cannon) //if the cannon exists
{
$brandnewtank.cannon remove
}


remember, the cannon is a seperate entity attached to the tank. when you remove the chasis, you have to remove the cannon too. the commands up above return the cannon, so you can remove it.

Posted: Thu Jul 10, 2003 9:15 pm
by Alcoholic
also, if you were wondering, the sherman tank is only used as a static model, it doesnt drive or have animating treads or shoots or anything, thats why the turret is already there.

Tiki

Posted: Fri Jul 11, 2003 6:15 am
by tltrude
You may need to make a new tiki file/shader file just for your tanks. I also had a hard time finding a static german tank. Either the wheels were moving or the thing is in two parts. So, your best bet is to just spawn the two parts and them give them both the exploder name and set number. Making the wheels stop could be a problem. Maybe you can put the panzer skin on a tank that has wheels that can be stopped--using a new tiki.

Posted: Fri Jul 11, 2003 2:11 pm
by bdbodger
The global/exploder.scr usually asks you to use script_objects but in this case you are useing models so maybe you need to use a script_model for the tanks with a Key:model and Value:vehicles/panzer_tank_europe.tik
In your original post you said the classname=vehicle_german_panzer-tank-europe maybe it should be classname=script_model

Posted: Fri Jul 11, 2003 2:25 pm
by mohaa_rox
and as for brushes, we use script_objects for exploders/explodersmashed

Tanks

Posted: Mon Jul 14, 2003 2:25 am
by GI Morpheus
OK Guys,

I used the script objects, and they work fine. The only problem is the tank treads are animated and moving. Using "testanim=idle" doesn't have anything to do with the treads. Since the tanks are sitting on rail cars, I can't have them animating. Is there a way to stop the animation, or is there a way to create a new model skin, or tiki, or shader to stop the animation? Hasn't anyone else done this before?

tik

Posted: Mon Jul 14, 2003 10:46 am
by tltrude
A new tik file is the way to go. But, you will probably need to make new shaders for the wheels--ones that don't move. Which tank is it?

surface treads shader tiger_treads
surface wheelfront shader frontwheel
surface innerwheel shader innerwheel
surface outerwheel shader outerwheel
surface wheelback shader backwheel

Here is one of the shaders for a tigertank wheel:

Code: Select all

backwheel
{
	qer_editorimage	textures/models/vehicles/tigertank/backwheel.tga
	{
		map textures/models/vehicles/tigertank/backwheel.tga
		rgbGen lightingSpherical
		//tcmod rotate fromEntity 0 2 0 -20
		tcmod rotate 5 0 20  // <--this line is why it rotates
	}
}
There may be wheel shaders that don't move already, but they were not used in a tiki file. So, all you would have to do is change the shader name in the new tik file.

Posted: Wed Jul 16, 2003 11:13 pm
by LT.BARNES
dude jus add this to it like i think above the tank remove or wateva...jus add this to it

$bomb4 remove
$bomb4 thread global/vehicles_thinkers.scr::tank_killed


$bomb is jus the targetname of me bomb.

put your targetname here... and add this

thread global/vehicles_thinkers.scr::tank_killed