Timed Floor Buttons

Avatar
Gemarakup
1,183 Posts
Posted Dec 16, 2012
I've been looking for this, but I can't find out how to make a prop_floor_button countdown when released so the object the button activates will turn off when countdown is finished. Can someone write how?
Advertisement
Registered users don’t see ads! Register now!
Avatar
innocentive
52 Posts
Posted Dec 16, 2012
Replied 17 minutes later
I understand that the entity activated by the prop_floor_button is deactivated by the button's output OnUnPressed, right? In that case you would just need to add the timer interval at the bottom of the outputs tab (i.e. After a delay of ... or so).

Now about a timer sound ... I can't give any Input.

Avatar
josepezdj
2,386 Posts
Posted Dec 16, 2012
Replied 9 minutes later
Could this be what you're looking for?
Avatar
Gemarakup
1,183 Posts
Posted Dec 16, 2012
Replied 8 minutes later
Look, you can't use delay, because, when the button is pressed then right afterwards released then pressed again, the second time pressing doesn't stop the delay countdown so it will turn off even though pressed unless you wait the delay before pressing again, and I don't want that to happen.
Avatar
Gemarakup
1,183 Posts
Posted Dec 16, 2012
Replied 2 minutes later

Quote:
Could this be what you're looking for?

I'm talking about prop_button_floor, not prop_button.

Avatar
innocentive
52 Posts
Posted Dec 16, 2012
Replied 24 minutes later
I see your point. Do the following:

Add a logic_timer that is enabled, set the refire interval, and add an output OnTimer that deactivates the entity that is activated by the button.
Then add two outputs to your button: 1. On Pressed -> activate entity; 2. OnPressed -> logic_timer ResetTimer.

That should work the way you want it to.

Avatar
FelixGriffin
2,680 Posts
Posted Dec 16, 2012
Replied 48 minutes later
You'll also want to enable the timer when the button's pressed and disable it when it finishes its countdow, otherwise it'll reset itself and keep going in a loop.
Avatar
greykarel
225 Posts
Posted Dec 16, 2012
Replied 5 hours later
Well, I've made somewhat similiar in my upcoming map. So, I've copypasted it in a little test map and edited for your request. In this map I deactivate a laser grid by the floor button and have it activated in 5 seconds after the button is released. There are countdown checker and sound as well. You can edit it for your need replacing laser with whatever you want and changing time interval. If you have any question feel free to PM me.
Attachments
timed_floor_button.zip
0.11 MB 49 downloads
Advertisement
Registered users don’t see ads! Register now!
Avatar
Gemarakup
1,183 Posts
Posted Dec 17, 2012
Replied 14 hours later
Alright, thanks.