Create explosion destruction

Simulacron

L-3: Simulated Member
aa
Feb 17, 2016
313
326
As you can read in the title, I want to create a explosion. The particle system, the sound and the shake for the explosion is already set up, but how can I create the effect of destruction, caused by the explosion, like flying away barrels or some kind of destruction on the enviroment(missing walls...)
 

Freyja

aa
Jul 31, 2009
2,994
5,813
This is done by importing your map into a 3d modelling software and simulating the explosion, then baking it into one big model animation to play in your map.

If you're interested, I'd reccomend 3ds max and the rayfire plugin as I believe that's what valve and most of the community use.
 

Simulacron

L-3: Simulated Member
aa
Feb 17, 2016
313
326
This is done by importing your map into a 3d modelling software and simulating the explosion, then baking it into one big model animation to play in your map.

If you're interested, I'd reccomend 3ds max and the rayfire plugin as I believe that's what valve and most of the community use.
Thanks for this information, I didn't know that you need a extra programm to do this
 

Crowbar

Spiritual preprocessor
aa
Dec 19, 2015
1,455
1,297
Basically, you can make the flying barrels prop/func_tracktrain and that stuff, but that's harder to debug though it gives you some funny things to do like these barrels killing players, etc
 

Muddy

Muddy
aa
Sep 5, 2014
2,575
4,592
Basically, you can make the flying barrels prop/func_tracktrain and that stuff, but that's harder to debug though it gives you some funny things to do like these barrels killing players, etc
I imagine that would look too weird and unrealistic to be worth the trouble
 

Crowbar

Spiritual preprocessor
aa
Dec 19, 2015
1,455
1,297
That's why I don't recommend this way, besides it being harder if you have animating skills.
 

Idolon

they/them
aa
Feb 7, 2008
2,107
6,116
If you're just dealing with flying objects (no object deformation), you could rig stuff up with Source's physics engine. Everything needs to be a prop_dynamic from the start, which you can physics-ify with phys_convert. Alternatively, you can disable prop_dynamics and swap them with prop_physics equivalents when you need to throw them, which should give you more control over the exact physical properties of each object.

(I don't know that you can set phys_convert objects to not collide with players, so the swapping method is probably what you'd want to use.)

As for actually throwing objects, env_physexplosion is your friend.

This method is faster and more versatile than a baked animation, but it's also more expensive (multiplayer servers don't like physics) and isn't predictable. I don't recommend it for a _final version, but you can probably get away with it in an early beta.
 

henke37

aa
Sep 23, 2011
2,075
515
I wouldn't worry too much about colliding with players since noone is going to complain when someone else gets hit by flying debre.
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,696
2,580
Plus anyone close enough to get hit by it is probably going to die from the trigger_hurt anyway.
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,696
2,580
I wonder what's the farthest a piece of debris actually flies in any of the stock explosions and actually lands on a walkable surface. My TF2-having computer is currently in a flesh-meltingly hot part of the house so I can't look into it right now.

It would be intensely cool if your explosion did send something heavy flying at a spot players could conceivably be, and put a trigger_hurt there that's set to go off at the exact moment the object lands there. 99% of the time it won't do anything, but the one time a player happens to get caught in that spot, their mind will be blown by your foresight.
 

Crowbar

Spiritual preprocessor
aa
Dec 19, 2015
1,455
1,297
Why not parent the trigger to the object so it also can hit a random stickyjumping demo? I'd love to be killed in such a way
Edit oh wait your way also works with animations, like sane people would do it. Weeeeell u can make a trigger move along but that's hard an I don't really know if it's worth it tbh
 

Idolon

they/them
aa
Feb 7, 2008
2,107
6,116
You could parent the trigger to an attachment point on the prop (same method used for the articulating panel arms in Portal 2).