Rapid button pressing
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!
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
Kasc 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.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.
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!
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.
Kasc 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 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.
Kasc wrote:
How are you doing this?
http://www.youtube.com/watch?v=Q5na8Llhk8k
Marlovious wrote:
If the models are still clipping the panels, try making the panels a little thicker.
Yeh but i want them to be lined up with the floor once they are down... and in order to do that it has to be as thin as possible... it's 1 unit wide right now and only 1 unit lower then the floor when it is done.
No more ugly animation resets or panels/arms sticking out EVER!
It's all in the manner that you trigger the animation...
This is how i finally fixed it:
Set the prop_dynamic's DefaultAnimation to a "idle" animation that has the starting position you want (I'm using makeramp_06close_idle in this example). And make sure Hold animation is set to yes!
prop_floor_button
OnPressed > Button_OnPressed_Relay > Trigger > 0.10 delay
OnPressed > Button_OnUnPressed_Relay > CancelPending > 0.10 delay !!!
OnUnPressed > Button_OnUnPressed_Relay > Trigger > 0.10 delay
Button_OnPressed_Relay
OnTrigger > Panel_01 > SetAnimation > makeramp_06close > 0.10 delay ( FIRE ONCE ! ) !!!
OnTrigger > Panel_02 > SetAnimation > makeramp_06close > 0.20 delay ( FIRE ONCE ! ) !!!
OnTrigger > Panel_03 > SetAnimation > makeramp_06close > 0.30 delay ( FIRE ONCE ! ) !!!
OnTrigger > Panel_04 > SetAnimation > makeramp_06close > 0.40 delay ( FIRE ONCE ! ) !!!
OnTrigger > Panel_01 > SetPlaybackRate > 1 > 0.10 delay !!!
OnTrigger > Panel_02 > SetPlaybackRate > 1 > 0.20 delay !!!
OnTrigger > Panel_03 > SetPlaybackRate > 1 > 0.30 delay !!!
OnTrigger > Panel_04 > SetPlaybackRate > 1 > 0.40 delay !!!
Button_OnUnPressed_Relay
OnTrigger > Panel_01 > SetPlaybackRate > -1 > 0.10 delay
OnTrigger > Panel_02 > SetPlaybackRate > -1 > 0.20 delay
OnTrigger > Panel_03 > SetPlaybackRate > -1 > 0.30 delay
OnTrigger > Panel_04 > SetPlaybackRate > -1 > 0.40 delay
I watched some tutorial videos before and during the creating of these panels and all of them have 1 relay set a animation and the another relay set the playbackrate to -1. This will however create problems when triggering buttons really fast. But not if you do it the above way. The outputs marked with !!! are what is different from most tutorials and works in cases like these.
Some animations show the weight of certain panels very well.
Like a heavy panel dropping 90 degrees out of a ceiling, the "out" animation drops the panel quite quickly, but the "in" animation first shows the arm being put under tension before actually moving the panel itself.
The "makeramp_xx" animations show this very well