func_tank + func_breakable, help please Created 16 years ago2008-05-17 10:41:52 UTC by zuker zuker

Created 16 years ago2008-05-17 10:41:52 UTC by zuker zuker

Posted 16 years ago2008-05-17 10:41:52 UTC Post #250069
hello, im a new mapper.
i did a tank that shoots at people, now i want people to be able to destroy it by shooting at the turret, how do i do that?
Posted 16 years ago2008-05-17 11:15:05 UTC Post #250070
Wrong forum. If this is a question for HL1 games/mods, post in the HL1 engine forum, else, the Source forum.

My guess is HL1.

There's not need to make a new thread in any of those forums at this point, as a moderator can move this thread.

Ok, so the turret is the func_tank. Place in an invisible brush over the turret so that the turret is actually inside the brush, and turn into a func_breakable. Set its properties such as name and amount of damage. Also specify a name in the Target on Break property, something like mm_ftank_destroyed.
Now place a multimanager, and name it mm_ftank_destroyed.
Also place a trigger_relay and name it rl_kill_turret. Set the kill property to the name of the turret.
In the multimanager, add a new keyvalue:
Key: rl_kill_turret
Value: 0

If you don't know how to use multimanager, check out tutorials and/or Entity Guides.

Now add another trigger_relay and name it rl_kill_fbreakable. Set the kill property to the name of the invisible func_breakable.
In the multimanager add another keyvalue:
Key: rl_kill_fbreakable
Value: 0

Thats it. Now here's what will happen:

When you fire at the turret, you're actually hitting the func_breakable. When the func_breakable breaks, it immediately triggers the multimanager, which triggers the two trigger_relays. One will kill (remove) the turret, and the other one will kill the invisible func_breakable.
You can add more keyvalues to the multimanager if you wan't to have fire (env_sprite), sound (ambient_generic) and perhaps a shake (env_shake) to make it more realistic.
The Mad Carrot The Mad CarrotMad Carrot
Posted 16 years ago2008-05-17 13:56:19 UTC Post #250075
ok thanks mate, it worked well exept, how do i make the func_breakable brush invisible?
Posted 16 years ago2008-05-17 14:07:12 UTC Post #250076
Use the NULL texture. This texture is invisible in the game, but visible in Hammer, and works on both brush entities and solid brushes. If you can't find this texture, make sure you have zhlt.wad loaded in Hammer. This wad file is included in the latest release of ZHLT (version 3.4) You can find this version of ZHLT on my site.

Make sure you WADinclude zhlt.wad if you plan to release your map.
The Mad Carrot The Mad CarrotMad Carrot
Posted 16 years ago2008-05-18 00:16:35 UTC Post #250103
An alternative if you want a tank that you can't somehow blow up with bullets :P place lots of little 2x2 unit brushes around the tank and make them all a single func_breakable and use the same method as muzzleflash said. This way, explosions damage them because of the blast radius and the chance of hitting one with a bullet is slim.
Posted 16 years ago2008-05-18 06:31:13 UTC Post #250110
thanks guys, and there is a special flag for "explosion only" in the func_breakable :)
You must be logged in to post a response.