Please or Register to create posts and topics.

Is there a way to make bombs bounce?

I want to make a bomb (futbol) bounce off of repulsion gel instead of exploding when it hits it. Is there a way to do this through the editor?

I believe that bombs exploding on impact is hardcoded into models (just like an exploding barrel in hl2). The only way I see round it is to make your own, and incorporate different type of entities in order to duplicate the effect.

Technically there is no way to determine whether or not paint is on a surface (or whether an object hits some sort of gel) therefore I believe that making it bounce instead of exploding may be extremely difficult (unless all the paint is predefined and you can incorporate some sort of trigger that disables the object breaking etc.)

Instead of making yourself do a lot of extra work, try changing the method the bombs go towards their destination. (A excursion funnel or trigger_pushes etc.)

?????????????????????????????TWP Releases | My Workshop

I'm not sure but isn't there a property which makes the futbol not explode? And then it only explodes on trigger? Or maybe a flag?

Mostly lurking

One option for detecting when it stops that comes to mind is to constantly check the speed (NOT THE VELOCITY) and check for sudden changes in that, ignoring if it is held by the player.The speed check would not be triggered by a change in direction, but would be triggered by stopping.

Ok, so I made custom physics entity which behaves pretty much like a bomb and allows me to control when it explodes, but I still need a way to determine if it collided with paint.

chickenmobile wrote:
Technically there is no way to determine whether or not paint is on a surface (or whether an object hits some sort of gel)

I'm thinking there has to be a way to check if something hit paint since it works for other objects. Maybe we don't have access to it though or it is hard-coded into certain object.

chickenmobile wrote:
Instead of making yourself do a lot of extra work, try changing the method the bombs go towards their destination. (A excursion funnel or trigger_pushes etc.)

I'd really like to have it bounce since it is sort of the main idea behind the map.

If you can make it set off a trigger, you might be able to disable the bomb when it start touches the trigger over the gel, and then enable the bomb when it end touches?

Maps(Newest to Oldest): Storming the Castle / The Amazing Race / Wreaked / Mental Breakdown / Lost In Transition / Split / Mind Lock
Mapping Since May 21, 2011

I tried a few things here, and while I don't have a perfect answer, there are some ideas to check out.

First idea was trying to set the base material as Metal.Bouncey, but that seems to have been removed since Left4Dead2... so that was a no go.

Second was using exploding comanion cubes, since well... they're already paintable.
You can make them explode on impact by doing:
ent_fire !picker addoutput "ontakedamage !self,break"
ent_fire !picker addoutput "propdata 9"
ent_fire !picker addoutput "explodedamage 50"
ent_fire !picker addoutput "exploderadius 100"
ent_fire !picker addoutput "physdamagescale 0.8"

Third idea was just to use the futbol.mdl model, and load a prop_physics_paintable.
That way at least you have some control over things.

The trouble with those two approaches though is that when something lands in paint, it still takes the same damage as if it had just hit a brick wall. So you can't just work out how much health is needed on the object.

To get around this, you can do something like

-Launch the bomb at the paint at a shallow angle... if there's no paint, you can blow it up with a trigger, or have a logic relay doing "ontrigger break after 6 seconds". If there is paint, it will bounce really high, and blow up when it lands, and you can cancel the timer by doing "myrelay cancelpending".
This sort of relies on you having tight control over where the bomb goes though, and means you only really get once bounce.

Then I stumbled upon a nice idea...
If you parent one object to another.. the child doesn't collide with stuff. So why not put a prop_physics_paintable *inside* the bomb, and make that its parent.
That way, all you see is the bomb... but the sliiightly smaller sphere inside does the collisions and paint bouncing. Want some good news? Futbol.mdl fits inside perfectly.

This way you can have multiple bounces, explosions, and the cool trail that the bomb has.
It can all be done automatically with 2 spawners.... something like this:

bombspawner forcespawn
parentballspawner forcespawn
bomb setparent parentball
parent sethealth 100 (or whatever)
parent wake
explodeTrigger trigger (6 seconds)

Parent:
Flags - "Start Asleep" //--required or the objects will collide the milisecond they're spawned and not be inside eachother.
Explosion Radius - 50
Explosion Damage - 50

Child:
Flags - "Start Asleep"
Explodeontouch No

It's not perfect.. far from it, but at least it gives you some control over what's happening.
Chances are you'll have to use a trigger here or there to decide where your bomb should spawn, and it'll be more of a time-bomb than an explode-on-impact-bomb, but it's a start.
Failing that it wouldn't be too difficult to write a .nut script that blows it up when it's near certain targets. (Quick scriptthink function)

Lastly, here's the .VMF with a couple of those ideas and some paint in it.
Hope that helps!