Panel falling after animation

Avatar
Konke
161 Posts
Posted Aug 21, 2015
Hi! I'm trying to get a wall panel to drop once the panel arm's animation is complete. Basically what I'm trying to do is that once the player triggers the output, the panel follows the panel arm's animation till it gets into place. Once the panel is in it's place I want to clear the parent so that the panel can drop from the panel arm.

I've tried working with func_physbox but I can't seem to make it work. Do you know how to help me, or at least redirect me to a official map so I can see how the devs have made it (I can't come up with any map that does this, right now)? Thanks in advance!

Advertisement
Registered users don't see ads! Register now!
Avatar
GameBurger
93 Posts
Posted Aug 21, 2015
Replied 9 hours later
This could be a pretty harsh solution, but works if nothing else does.

Create a func_brush and attach it to the panel arm. Then create an identical func_physbox, tick the "disable motion" flag on it and disable the physbox itself on spawn, then place it at the ending position of the original panel brush.

The trick is to kill/disable the panel brush after the animation is done and enable the physbox at the same time so that it would spawn the very same looking panel at the same place at the same time the brush is killed seamlessly replacing it. Then just enable physbox's motion whenever you feel like it should fall off the panel.

This is a pretty dirty solution in my opinion, but if nothing else works - might as well go for it.

Avatar
Konke
161 Posts
Posted Aug 22, 2015
Replied 11 hours later
I know what you mean and I will give it a try. The problem is that I don't really understand, or at least get the func_physbox different commands to work the way I wish. Do you know of any good guide that would cover something like my request? I checked VDC for more information but didn't find anything that covers more than I already can see in Hammer.
Avatar
GameBurger
93 Posts
Posted Aug 24, 2015
Replied 2 days later

Konke wrote:
I know what you mean and I will give it a try. The problem is that I don't really understand, or at least get the func_physbox different commands to work the way I wish. Do you know of any good guide that would cover something like my request? I checked VDC for more information but didn't find anything that covers more than I already can see in Hammer.

Consult the Valve Developer func_physbox page to learn more about it.

Avatar
TeamSpen210
608 Posts
Posted Aug 24, 2015
Replied 1 hour later
What you actually want is a phys_convert. This transforms the specified entity into a physics object when triggered. (prop_physics or func_physbox, depending on entity type).

Prop_dynamics have a OnAnimationDone output which you might want to use to time the conversion. Alternately, in the prop_dynamic properties switch to the model tab, and then choose your animation there. That way you can drag the slider to figure out how many frames the animation has. Divide that number by 24 to get the number of seconds the animation plays.

You might want to also use an env_physexplosion to give the panel an invisible nudge to make it look like it's being flung away. Set it to only affect the func_brush (so it doesn't affect nearby cubes or the like). Output-wise, you want to ClearParent the brush, trigger the phys_convert, and then Explode the env_physexplosion with a 0.01 second delay between each output. You might also want to use a func_clip_vsphyics brush running along one edge of the panel (a few units below, sticking out about 1 unit) for the panel to bounce off of and make it rotate. Put the physexplosion off-center as well, to make the spin of the panel more random.

Advertisement
Registered users don't see ads! Register now!
Avatar
Konke
161 Posts
Posted Aug 25, 2015
Replied 10 hours later

TeamSpen210 wrote:
What you actually want is a phys_convert. This transforms the specified entity into a physics object when triggered. (prop_physics or func_physbox, depending on entity type).

Prop_dynamics have a OnAnimationDone output which you might want to use to time the conversion. Alternately, in the prop_dynamic properties switch to the model tab, and then choose your animation there. That way you can drag the slider to figure out how many frames the animation has. Divide that number by 24 to get the number of seconds the animation plays.

You might want to also use an env_physexplosion to give the panel an invisible nudge to make it look like it's being flung away. Set it to only affect the func_brush (so it doesn't affect nearby cubes or the like). Output-wise, you want to ClearParent the brush, trigger the phys_convert, and then Explode the env_physexplosion with a 0.01 second delay between each output. You might also want to use a func_clip_vsphyics brush running along one edge of the panel (a few units below, sticking out about 1 unit) for the panel to bounce off of and make it rotate. Put the physexplosion off-center as well, to make the spin of the panel more random.

Thanks! I will surly check it out!