Need help with some coding - ceiling rocks

Oct 6, 2008
1,948
446
Hi,

I've been toying around with an idea but can't seem to get it to work right.

I want to place some rock models into the ceiling and on shoot or damage I want them to fall to the ground and crush anyone below.

Here's what I've done so far:

I've tried the same payload type of system - ie. on trigger break constraint hoping it will fall - doesn't work

Also in another test for the above - rocks also seem to get stuck in the ceiling and don't fall.

Rock Mass - the rocks I'm using are from forest hey have a mass of 1 so not sure if this has anything to do with hem not falling - I set the mass modifier for inertia to the same as a payload cart and it seems to fall faster but only when I used it in the fashion below.

I have the rock sitting on a func_brush - on trigger, disable brush, rocks fall.

I haven't been killed my the rocks yet ...

I'm using a physics object.

A thought that just came into my head would be to use a func_breakable and have the rock attach to that but not sure if it will fall.

How do I set the damage as well?

Any ideas?
 

xzzy

aa
Jan 30, 2010
815
531
You can parent a trigger_hurt to a physics object, and it works as a proof of concept.

But in my experience it's pretty glitchy.. it tests okay in a single player game, but once you take it online everything goes to hell. Granted in my case I was trying to disable the damage component based on the velocity of the physics object which only adds to the opportunity for things to not work right, but it illustrated to me that TF2 just can't handle physics based interactions all that well if it's going over the network.

It doesn't help that most of the physics information seems like it has to go into the qc file.. as near as I can tell, the values you can set in Hammer get completely ignored in game.

It's also possible I just don't know what I'm doing!


But at this point if I were to attempt putting environmental deaths into a map, I'd model a custom animation and choreograph trigger_hurts to sync up with it.. either by enabling/disabling the hurt on demand, or parenting it to a train.
 
Oct 6, 2008
1,948
446
thank xzzy - how would you get the train working / breaking so the rock drops?
 

xzzy

aa
Jan 30, 2010
815
531
Well the visual portion of rocks falling would be an animation done in Blender or whatever modeling program you prefer. This is how Valve does all of their explosions, because it looks good and doesn't stress the game (it's entirely client side so the server doesn't have to send anything over the network).

The damage portion would be func_hurts you attach to a train to "follow" the rock falling animation. This would require a bunch of entity work to get everything to fire at the right time. Won't be perfect but it will be reliable.