playMaker

Author Topic: Need help with sending FSM event  (Read 2157 times)

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Need help with sending FSM event
« on: December 05, 2014, 01:14:55 AM »
So I have a FSM setup for mouse input.  It goes through a series of pages in a scene for instructions.  The user clicks on 1 of the buttons and it changes pages.  I also want joystick support as well.  That way a person can press left, right, up or down on the keyboard as well and navigate though.  I figured out how to do this with 1 udlr per scene, but now have several pages.  So now it doesn't seem to work.  I have a 2nd game object that is a joystick manager.  It just sits there waiting for the joystick to trigger.  When it does, it sends a event message to the help screen manager.  the problem is that it won't fire the event.

So my 1st quest is this:  is the event supposed to fire off another event regardless of where it is?  What I mean is the help manager is on a event so can the joystick manager force the help manager to go to a different part of the FSM?  I am sure it does, but just wanted to verify.

So here is where I am at:  It seems to go though the joystick manager OK and fire off the FSM to the help manager.  The help manager is stuck on a state but when the event is sent, it does not change to that state-transition.

So looking at the pictures.
Capture.png show the joystick manager.  The trigger event and then 5 pages in yellow.  So the variable is set to 1,2,3,4 or 5 and then moves to the next state (goto page 1...)

capture3.png shows the 'goto page 1' in the joystick manager.  This shows the send event to the 'go-help-manager' and the FSM name.  There is a global event called 'joytrigger-page1'.  So this is supposed to send a event from the joystick manager to the help manager to trigger 'joytrigger-page1'

capture 2.png show the help manager.  You can see the 'joytrigger-page2' at the bottom left in grey.  It is suppose to pick up here and go to the 'vehicles all off'.  It does not.  On the right side of the screen shows the 4 joytrigger global events.


So any idea of why it doesn't tigger the 'joytrigger-page2' in capture2.jpg?



« Last Edit: December 05, 2014, 01:37:56 AM by wheretheidivides »

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: Need help with sending FSM event
« Reply #1 on: December 05, 2014, 01:31:22 AM »
more pics

pic5 shows the help manager with the title and fsm title of 'FSM'

pic6 shows the whole flowchart of the joystick manager (which seems to fire and go around just fine).

pic8 shows the flowchart of the help manager.  You can see its name and the FSM name

pic9 shows the state of the trigger.  I just have a wait for .1 sec there, but it doesn't work if nothing is there either.

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: Need help with sending FSM event
« Reply #2 on: December 05, 2014, 04:42:53 AM »
OK, so I figured it out.  the issue is that the joystick manager was sending an event to the help manager.  the help manager was on a state with a button waiting for input.  So I just added the transitions to that state.  It's a bit ugly to look at, but it works.

If you look a the picture, you'll see I added the 2 trigger events to the bottom of the states.  So each help page can go back 1 page or forward 1 page.  I had to do this for every page.  So page 1 would have a trigger to page 2 and one to go to page 5.