Dustin Diamond
07-29-2006, 04:52 PM
Ok guys, I've figured out a couple ways of shortening the fuse time. The principles illustrated in this tutorial ONLY apply to bombs NOT used for objectives/flags. That means only for bombs used for other actions in a map, like blowing up a wall, destroying mg nests, opening new pathways, etc. Currently, you cannot adjust the fuse time for objective points and still have it capture the flag.
Here's the vmf, bsp, and countdown timer files. I suggest reading this post and then playing the map before getting into the vmf.
http://hosted.filefront.com/DustinDiamond/1688082
This vmf utilizes all 3 of the Outputs for the dod_bomb_target entity, OnBombExploded, OnBombPlanted, and OnBombDefused (as described here (http://developer.valvesoftware.com/wiki/Dod_bomb_target)). As a side note, the other 2 outputs listed on the wiki do NOT work, I tried.
It basically works like this:
OnBombPlanted catches when the tnt has been placed. You simply wait however long you want the fuse to be, then Kill the bomb entity and make your own explosion. Sounds simple, right? Well sort of. Defusing is a pain, and I've addressed 4 different ways of handling it.
First, here are some important things I've discovered about the bombs:
- Defusing takes 3 seconds
- Bombs can be planted and defused from 62 units or less from the center of the bomb entity (even through walls)
- Bombs blow with an explosive magnitude of 200
- The center of the dod_bomb_target entity should be 2 units from the wall for correct model positioning (so it's not floating)
OK, on to the 4 walls in the map. I've made it so either team can plant AND defuse. Starting from the right:
First, the stone wall has a 3 second fuse. I made a 3 second countdown sprite that shows over the bomb once it is planted to know when it blows (see below for the countdown files). 3 seconds is useful since it's also the exact amount of time it takes to defuse, so if someone tries to defuse, it'll blow the same instant the defuse is complete. Unfortunately, 3 seconds doesn't give you much time to get the heck outta there.
On to the second wall, the brick one. This wall has a 5 second fuse (and 5 sec countdown). Using the basic formula from above, the 5 seconds starts with OnBombPlanted. The problem with this is even if the bomb is defused, the countdown continues and it blows up after 5 seconds regardless. Try it out. Plant the bomb, then defuse (hint: continue holding E to immediately defuse). You'll have 2 seconds to run. This could be useful if you dont want the other team to defuse, but it's not so elegant. See the fourth wall for a better solution.
Now to the third wall, the orange one. This also has a 5 second fuse, but you CAN defuse it. Most of the outputs from the bomb entity were moved to a logic_relay to take advantage of its CancelPending function. OnBombPlanted triggers the logic_relay. If the bomb is defused, OnBombDefused cancels the pending outputs of the relay (like the explosion) and hides the countdown. (Note: FireOnlyOnce is set to No for all actions of this wall, since they need to be repeatable).
Finally, the fourth wall, the grey one. This wall gets around the defusing in a more elegant manner. It has a 5 second fuse. The player can defuse the bomb, but once the bomb is defused, an identical model of the bomb (models/weapons/w_tnt.mdl) is enabled having it's own sparks (env_sparks), so it looks like it's still going. Time keeps ticking and the bomb will blow. While it's a little complex, it looks better than the second wall.
Other things:
In the right corner, behind the bomb depot is a grid of bomb points. I find this useful for determining the alignment of the dod_bomb_target entity, since we cant see it in hammer. EDIT: This is no longer the case, since the det code has been added to Hammer.
The bombs can be planted and defused from 62 units or less from the center of the dod_bomb_target entity. What does this mean? Well since the center of the bomb entity should be 2 units from the wall for correct alignment, you better make the wall at least 61 unit thicks if you dont want people planting or defusing from the other side of the wall (61 units for the wall plus 2 units to the dod_bomb_target center is greater than 62). Try it out - the grey wall is 60 units thick and you CAN plant from behind the wall. The orange wall is 61 units thick and you CANNOT plant from behind it.
The tower is a regular bomb objective with the super long fuse, but only takes 1 bomb.
So that's it. Have fun!
Peace out,
Dustin Diamond
Here's the vmf, bsp, and countdown timer files. I suggest reading this post and then playing the map before getting into the vmf.
http://hosted.filefront.com/DustinDiamond/1688082
This vmf utilizes all 3 of the Outputs for the dod_bomb_target entity, OnBombExploded, OnBombPlanted, and OnBombDefused (as described here (http://developer.valvesoftware.com/wiki/Dod_bomb_target)). As a side note, the other 2 outputs listed on the wiki do NOT work, I tried.
It basically works like this:
OnBombPlanted catches when the tnt has been placed. You simply wait however long you want the fuse to be, then Kill the bomb entity and make your own explosion. Sounds simple, right? Well sort of. Defusing is a pain, and I've addressed 4 different ways of handling it.
First, here are some important things I've discovered about the bombs:
- Defusing takes 3 seconds
- Bombs can be planted and defused from 62 units or less from the center of the bomb entity (even through walls)
- Bombs blow with an explosive magnitude of 200
- The center of the dod_bomb_target entity should be 2 units from the wall for correct model positioning (so it's not floating)
OK, on to the 4 walls in the map. I've made it so either team can plant AND defuse. Starting from the right:
First, the stone wall has a 3 second fuse. I made a 3 second countdown sprite that shows over the bomb once it is planted to know when it blows (see below for the countdown files). 3 seconds is useful since it's also the exact amount of time it takes to defuse, so if someone tries to defuse, it'll blow the same instant the defuse is complete. Unfortunately, 3 seconds doesn't give you much time to get the heck outta there.
On to the second wall, the brick one. This wall has a 5 second fuse (and 5 sec countdown). Using the basic formula from above, the 5 seconds starts with OnBombPlanted. The problem with this is even if the bomb is defused, the countdown continues and it blows up after 5 seconds regardless. Try it out. Plant the bomb, then defuse (hint: continue holding E to immediately defuse). You'll have 2 seconds to run. This could be useful if you dont want the other team to defuse, but it's not so elegant. See the fourth wall for a better solution.
Now to the third wall, the orange one. This also has a 5 second fuse, but you CAN defuse it. Most of the outputs from the bomb entity were moved to a logic_relay to take advantage of its CancelPending function. OnBombPlanted triggers the logic_relay. If the bomb is defused, OnBombDefused cancels the pending outputs of the relay (like the explosion) and hides the countdown. (Note: FireOnlyOnce is set to No for all actions of this wall, since they need to be repeatable).
Finally, the fourth wall, the grey one. This wall gets around the defusing in a more elegant manner. It has a 5 second fuse. The player can defuse the bomb, but once the bomb is defused, an identical model of the bomb (models/weapons/w_tnt.mdl) is enabled having it's own sparks (env_sparks), so it looks like it's still going. Time keeps ticking and the bomb will blow. While it's a little complex, it looks better than the second wall.
Other things:
In the right corner, behind the bomb depot is a grid of bomb points. I find this useful for determining the alignment of the dod_bomb_target entity, since we cant see it in hammer. EDIT: This is no longer the case, since the det code has been added to Hammer.
The bombs can be planted and defused from 62 units or less from the center of the dod_bomb_target entity. What does this mean? Well since the center of the bomb entity should be 2 units from the wall for correct alignment, you better make the wall at least 61 unit thicks if you dont want people planting or defusing from the other side of the wall (61 units for the wall plus 2 units to the dod_bomb_target center is greater than 62). Try it out - the grey wall is 60 units thick and you CAN plant from behind the wall. The orange wall is 61 units thick and you CANNOT plant from behind it.
The tower is a regular bomb objective with the super long fuse, but only takes 1 bomb.
So that's it. Have fun!
Peace out,
Dustin Diamond