playMaker

Author Topic: Buffered States  (Read 3534 times)

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 318
Buffered States
« on: July 08, 2011, 04:29:38 PM »
Another allegedly simple question from moi:

I have an FSM with a branching states, which leads to two child-states, which in turn return to the original when they're complete. 

Child-stateA is triggered by holding a key and walking through a trigger.

Child-stateB is triggered by only holding the same key (and not moving).

I will trigger child-stateA by holding the key down and moving through the trigger.  I will release the key at this time and persist in this state for several seconds.  Then I will hit another key to exit from child-StateA and return to the parent state.  As soon as I do this, the FSM goes through the parent state and immediately jumps to child-StateB, as though I had been holding the key the whole time.

It appears as though it's buffering my actions, which is unexpected.

It's worth mentioning that I use "key" as a general term.  I'm using joystick buttons at this time.

Any ideas?

LordShaggy

  • 1.2 Beta
  • Junior Playmaker
  • *
  • Posts: 50
Re: Buffered States
« Reply #1 on: July 08, 2011, 05:00:51 PM »
I'm back!

First, you need to be more clear about keys. Is it the same or is it a different key. You do say, another key, but how are you reading that key information.   Does the system itself recognize that key as something different or is the input the same?

Do me a favor, try not using joystick for a moment and actually separate this functions into two separate keyboard keys.  A & B

Also, you need to describe what result you want from my answer.  Right now, I dunno if key meaning moving or not.  It's so generic it's hard to replicate.

I would also recommend looking hard at your checks.  Like, why does it persist in your state after you let go of the key?  Do you not care or check if the key has been released?   

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 318
Re: Buffered States
« Reply #2 on: July 08, 2011, 05:50:17 PM »
Sorry for the clarity. 

It seems it is a check I missed.  I don't know where or how yet, I just ended every state in that branch with a cancellation of input feedback, and it fixed the issue.  Now I'll just pick it apart again and see how it failed the first few times. 

Thank you for the reply and help.

LordShaggy

  • 1.2 Beta
  • Junior Playmaker
  • *
  • Posts: 50
Re: Buffered States
« Reply #3 on: July 08, 2011, 08:46:55 PM »
If you ever want to grab me on skype. I'm down.   I love helping out! =).   

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 318
Re: Buffered States
« Reply #4 on: July 08, 2011, 08:58:57 PM »
Thanks dude.  I will PM you!