Toggle prop_button

Avatar
Lostprophetpunk
409 Posts
Posted Aug 12, 2011
Heya there,

Is there a way to make a prop_button toggle? Such as once pressed, does something. Then when pressed again, it does something else?

Just trying to wonder how this could be done, as I have no idea.

Advertisement
Registered users don’t see ads! Register now!
Avatar
Rubrica
305 Posts
Posted Aug 12, 2011
Replied 6 minutes later
Create a logic_branch and send it an input of ToggleTest each time the button is press, and add outputs to it for OnTure and OnFalse. For more than two possible cases, you'll want to use a combination of math_counter and logic_case.
Avatar
Lostprophetpunk
409 Posts
Posted Aug 12, 2011
Replied 30 minutes later

Rubrica wrote:
Create a logic_branch and send it an input of ToggleTest each time the button is press, and add outputs to it for OnTure and OnFalse. For more than two possible cases, you'll want to use a combination of math_counter and logic_case.

Thanks for the help. =]

However, I have encountered another problem. The prop_button toggles a panel that moves up/down. When it is in the 'up' state I place a ball on it, when I toggle it to the 'down' state...the ball stays there in mid-air.

All of the settings for the panel animations etc are correct.

Avatar
Vordwann
767 Posts
Posted Aug 12, 2011
Replied 4 minutes later
A ball as in... a companion sphere? The only thing i can think of is make sure your physics type in the panel model isn't "bounding box" and instead is Not Solid or vPhysics.
Avatar
Marise
249 Posts
Posted Aug 12, 2011
Replied 1 minutes later
Are you parenting an invisible brush to the panel? If you were to use the wrong attachment point, the brush would not move with the panel, and would hold the ball up.
Avatar
Lostprophetpunk
409 Posts
Posted Aug 12, 2011
Replied 27 minutes later

Marise wrote:
Are you parenting an invisible brush to the panel? If you were to use the wrong attachment point, the brush would not move with the panel, and would hold the ball up.

I have parented it to the panel, and used the correct panel_attach to go with it. Unless you need a different one for an invisible brush?

@Vordmann, Yeah, a sphere. Sorry. The setting is set to 'not solid' for the animation and panel side to it.

Avatar
Vordwann
767 Posts
Posted Aug 12, 2011
Replied 1 hour later
Post the .vmf or something... if nothing else works you could parent the ball to a path_track for a short time to make it "fall"...
Avatar
Skotty
671 Posts
Posted Aug 12, 2011
Replied 44 minutes later
You could activate a trigger_push with a really small force, maybe 10. Direction downwards. This should reactivate the spheres physic for a second and it will fall down.
Avatar
Marise
249 Posts
Posted Aug 12, 2011
Replied 2 hours later

Lostprophetpunk wrote:
I have parented it to the panel, and used the correct panel_attach to go with it. Unless you need a different one for an invisible brush?

It's the same attachment point for any brush. However, some panels use panel_top as the attachment point. You could test if it's attaching by temporarily changing the brush texture to something visible, and see if it moves with the panel.

Advertisement
Registered users don’t see ads! Register now!
Avatar
Lostprophetpunk
409 Posts
Posted Aug 12, 2011
Replied 2 hours later

Marise wrote:
It's the same attachment point for any brush. However, some panels use panel_top as the attachment point. You could test if it's attaching by temporarily changing the brush texture to something visible, and see if it moves with the panel.

I know the brush is attached, as I put the button next to the panel, stood on it and pressed it, I went up with the panel and came back down when toggled.

The brush stays on the panel as it doesn't get stuck in mid air.