func_button can't be used multiple times. -solved-

Avatar
Brainstone
401 Posts
Posted Feb 23, 2012
The outputs of my func_button:

OnPressed-->prop_dynamic-->SetAnimation-->start delay: 0
OnPressed--!self-->lock delay: 0
OnPressed-->prop_dynamic-->SetAnimation-->idle delay: 10
OnPressed--!self-->unlock delay: 10

However, the prop_dynamic doesn't animate when I press the button the second time after 10 seconds.

Anybody knows why?

Advertisement
Registered users don’t see ads! Register now!
Avatar
josepezdj
2,386 Posts
Posted Feb 23, 2012
Replied 51 minutes later

Brainstone, this is what VDC specifically says about the func_button:
(https://developer.valvesoftware.com/wiki/Func_button)

"Bug: Do not lock while pressed; it will not return when unlocked."

Could it simply be a bug?

What exactly are you setting this button for exactly? Anyway, I guess what you want is to prevent the interruption of the prop_dynamic animation, right? Well, 3 things:

  1. Maybe the fact that the button itself is the one that fires its own outputs is causing a conflict... you could try introducing a couple of logic_relays mediating there, and use any settings as the following ones for example:

Func_button (set "Delay before Reset" to 10 secs):
OnPressed > Relay_1 > Trigger
OnOut > Relay_2 > Trigger

Relay_1:
OnTrigger > Relay_2 > CancelPending / delay 0.00
OnTrigger > [prop_dynamic_name] > SetAnimation > [whatever] / delay 0.20

Relay_2:
OnTrigger > Relay_1 > CancelPending / delay 0.00
OnTrigger > [prop_dynamic_name] > SetAnimation > [idle?] / delay 0.20

  1. Also you can set the delay before reset to -1 (so it stays), and use an external logic_timer for the reset instead. Then, stop the logic_timer when you want the button to be unlock again.

  2. Maybe you are using a bad output for the prop_dynamic: "Start"?? isn't it "Open" or "Close" or "whatever" instead?

Avatar
greykarel
225 Posts
Posted Feb 23, 2012
Replied 4 minutes later
VCD/ func_button article/ third line :
Bug: Do not lock while pressed; it will not return when unlocked.
EDIT: josepezdj has better reaction then me :lol:
Advertisement
Registered users don’t see ads! Register now!
Avatar
Brainstone
401 Posts
Posted Feb 23, 2012
Replied 35 minutes later
:redface: Sorry guys, I looked in the VDC, but read over the line.