Rapid button pressing
Quote from KenJeKenny!? on June 22, 2011, 8:06 pmHey guys! Yet another qeustion!
At the moment i have 4 panels opening up on when a normal floor button is pressed and they also close when unpressed.
I set this up using logic_relay's sending SetAnimation outputs and i have tried all kind's of delays, i tried sending both relay's a CancelPending input on trigger, Allow fast retrigger is not flagged and i also tried some other things and searched the forum/googled alot but i cannot get it to work properly...
the panels keep going crazy when you jump up and down on the button for example...Current situation: (2 panels only)
NWS_cEWZTnkHow to fix this!? :S
Thanks in advance!
Hey guys! Yet another qeustion!
At the moment i have 4 panels opening up on when a normal floor button is pressed and they also close when unpressed.
I set this up using logic_relay's sending SetAnimation outputs and i have tried all kind's of delays, i tried sending both relay's a CancelPending input on trigger, Allow fast retrigger is not flagged and i also tried some other things and searched the forum/googled alot but i cannot get it to work properly...
the panels keep going crazy when you jump up and down on the button for example...
Current situation: (2 panels only)
NWS_cEWZTnk
How to fix this!? :S
Thanks in advance!
Quote from Kasc on June 22, 2011, 8:11 pmNot tried this myself but when it's been asked before it usually involves the SetPlayBackRate (?) to -1 option for model inputs.
Not tried this myself but when it's been asked before it usually involves the SetPlayBackRate (?) to -1 option for model inputs.
Quote from Marlovious on June 22, 2011, 8:20 pmI had this same issue in a map I'm working on. I was able to fix it by having the open relay disable the close relay on start and then re-enabling the close after the animation finished and vice versa for the close relay.
something like:
open_rl > ontrigger > close_rl > disable > 0.0
do the animation...
open_rl > ontrigger > close_rl > enable > 2.0and
close_rl > ontrigger > open_rl > disable > 0.0
close_rl > ontrigger > open_rl > enable >2.0
I had this same issue in a map I'm working on. I was able to fix it by having the open relay disable the close relay on start and then re-enabling the close after the animation finished and vice versa for the close relay.
something like:
open_rl > ontrigger > close_rl > disable > 0.0
do the animation...
open_rl > ontrigger > close_rl > enable > 2.0
and
close_rl > ontrigger > open_rl > disable > 0.0
close_rl > ontrigger > open_rl > enable >2.0
Quote from KenJeKenny!? on June 22, 2011, 8:26 pmKasc wrote:Not tried this myself but when it's been asked before it usually involves the SetPlayBackRate (?) to -1 option for model inputs.This solves most of the problem... if i get off while the animation is halfway it returns to its original state in a fluid move... but strafing on and off the button still makes it go wild a bit...
atm i have on pressed SetAnimation (by default arms are on idle animation) and on unpressed SetPlaybackRate -1.
Marlovious wrote:I had this same issue in a map I'm working on. I was able to fix it by having the open relay disable the close relay on start and then re-enabling the close after the animation finished and vice versa for the close relay.
something like:
open_rl > ontrigger > close_rl > disable > 0.0
do the animation...
open_rl > ontrigger > close_rl > enable > 2.0and
close_rl > ontrigger > open_rl > disable > 0.0
close_rl > ontrigger > open_rl > enable >2.0I tried something similair to that... but if you get off the button before the animation is done... the button will trigger the unpressed relay which is then disabled... so the panel/door stays open/closed and does not return to it's original state.
This solves most of the problem... if i get off while the animation is halfway it returns to its original state in a fluid move... but strafing on and off the button still makes it go wild a bit...
atm i have on pressed SetAnimation (by default arms are on idle animation) and on unpressed SetPlaybackRate -1.
something like:
open_rl > ontrigger > close_rl > disable > 0.0
do the animation...
open_rl > ontrigger > close_rl > enable > 2.0
and
close_rl > ontrigger > open_rl > disable > 0.0
close_rl > ontrigger > open_rl > enable >2.0
I tried something similair to that... but if you get off the button before the animation is done... the button will trigger the unpressed relay which is then disabled... so the panel/door stays open/closed and does not return to it's original state.
Quote from Marlovious on June 22, 2011, 8:30 pmI guess I'll have to play with it more. I'll get back to you.
I guess I'll have to play with it more. I'll get back to you.
Quote from Marlovious on June 22, 2011, 8:56 pmGot it working correctly. Just change the delay's to what you need them to do.
Got it working correctly. Just change the delay's to what you need them to do.
Quote from Kasc on June 22, 2011, 9:04 pmYou need to set up some variables with branches or counters, whichever you prefer.
The button needs to do different things depending on what's currently happening.
i.e.
If the panel is open then it needs to set a close animation and visa versa.
If the panel is opening and the button is Unpressed then it needs to set the playback rate to -1.The next part is a bit harder:
If the panel is closing and the button is pressed, and it's not doing a reversed animation then the panel needs have it's playback rate set to -1.
If the panel is closing and the button is pressed, and it is doing a reversed animation then the panel needs to have its playback rate set back to 1.
p.s. All the while you need to be setting the correct default animation.
It's certainly not easy, the way doors open and close are really good examples of what you want, but it's a shame they are controlled within an entity rather than in an instance!
You need to set up some variables with branches or counters, whichever you prefer.
The button needs to do different things depending on what's currently happening.
i.e.
If the panel is open then it needs to set a close animation and visa versa.
If the panel is opening and the button is Unpressed then it needs to set the playback rate to -1.
The next part is a bit harder:
If the panel is closing and the button is pressed, and it's not doing a reversed animation then the panel needs have it's playback rate set to -1.
If the panel is closing and the button is pressed, and it is doing a reversed animation then the panel needs to have its playback rate set back to 1.
p.s. All the while you need to be setting the correct default animation.
It's certainly not easy, the way doors open and close are really good examples of what you want, but it's a shame they are controlled within an entity rather than in an instance!
Quote from Kasc on June 22, 2011, 9:10 pmAnother way I did a similar thing, which was not as clean but is certainly easier, was to only allow the panel to open/close it if was closed/opened through the setting of branches named is_closed and is_open.
The button changes branches named panel_wants_to_open and panel_wants_to_close accordingly.
A listener then triggers the panel to close if panel_is_open and panel_wants_to_close are true.
Another listener triggers the panel to open if panel_is_closed and panel_wants_to_open are both true.
Another way I did a similar thing, which was not as clean but is certainly easier, was to only allow the panel to open/close it if was closed/opened through the setting of branches named is_closed and is_open.
The button changes branches named panel_wants_to_open and panel_wants_to_close accordingly.
A listener then triggers the panel to close if panel_is_open and panel_wants_to_close are true.
Another listener triggers the panel to open if panel_is_closed and panel_wants_to_open are both true.
Quote from Marlovious on June 22, 2011, 9:33 pmKasc wrote:Another way I did a similar thing, which was not as clean but is certainly easier, was to only allow the panel to open/close it if was closed/opened through the setting of branches named is_closed and is_open.The button changes branches named panel_wants_to_open and panel_wants_to_close accordingly.
A listener then triggers the panel to close if panel_is_open and panel_wants_to_close are true.
Another listener triggers the panel to open if panel_is_closed and panel_wants_to_open are both true.
That's pretty much what my example does. The listener controls everything.
Button > branch1 (true for pressed, false for unpressed)
open and close relays > branch 2(set to false if the panel is moving, true when it isn't)
both relays disable eachother while the panel is movingThe listener
onfalse -panel not moving and button not pressed - fire close relay
ontrue -panel not moving and button pressed - fire open relay
onmixed -panel moving and button changed position - delay and test self. This will not allow anything to happen until the panel has stopped moving.
The button changes branches named panel_wants_to_open and panel_wants_to_close accordingly.
A listener then triggers the panel to close if panel_is_open and panel_wants_to_close are true.
Another listener triggers the panel to open if panel_is_closed and panel_wants_to_open are both true.
That's pretty much what my example does. The listener controls everything.
Button > branch1 (true for pressed, false for unpressed)
open and close relays > branch 2(set to false if the panel is moving, true when it isn't)
both relays disable eachother while the panel is moving
The listener
onfalse -panel not moving and button not pressed - fire close relay
ontrue -panel not moving and button pressed - fire open relay
onmixed -panel moving and button changed position - delay and test self. This will not allow anything to happen until the panel has stopped moving.
Quote from Kasc on June 22, 2011, 9:56 pmIt's not very user friendly though, I did download but decided after a quick glance I couldn't be bothered to work out what was going on
It's not very user friendly though, I did download but decided after a quick glance I couldn't be bothered to work out what was going on ![]()
