playMaker

Author Topic: (Solved)How can I have more than one "START" states in a FSM?  (Read 389 times)

jjll

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
(Solved)How can I have more than one "START" states in a FSM?
« on: October 31, 2018, 04:24:10 AM »
Hi,

I'm pretty new to Playmaker. I'm currently watching an awesome tutorial by awesome Jinxter Games:
In the tutorial, it looks like it has more than one "START" states in a FSM (you can see the FSM from 0:38). I have looked everywhere but couldn't find out how to do it.
Anyone has any ideas please? A screenshot is attached.

I am using the latest Unity 2018.2.14f1 and latest Playmaker 1.9.0

« Last Edit: November 03, 2018, 12:41:13 PM by jjll »

daniellogin

  • Junior Playmaker
  • **
  • Posts: 99
    • View Profile
Re: How can I have more than one "START" states in a FSM?
« Reply #1 on: October 31, 2018, 05:49:33 AM »
Those are called "Global Transitions"

So just to nit pick (which may help understanding) they are not "start" states. There can only be 1 start. The literal start (first) state that will *always* play as soon as the FSM starts.

However there are other ways to jump in to an FSM or detour it to a different track. That is the Global Transitions (indicated in your picture).

They are helpful for if you have functions which are carried out in one FSM but are triggered by another one. So for example you may have an FSM which keeps track of health to update the UI or what ever else. So maybe the main track (linked off the actual Start) will be to update the UI, but then it just stops or loops back on that one track. So then you want something that happens in another FSM (like a explosion collision or something) to affect the health, so in that explosion FSM you do a "Send Event" action which is directed at the health FSM. Maybe it will point to a Global Transition called 'exploded' or something which is a whole different track (not transitioned to from the Start track) which say does an Int Add to reduce the health then finishes by transitioning back to the Start track.

So one last thing; you may be thinking at some point, what if I don't want anything to happen after it starts until a global transition? So you just hook up a single blank state to the Start. Call it something like Idle or what ever. So the FSM starts and does nothing until a global transition kicks it off. You may also flow off from all tracks to an 'Idle' state to keep things tidy and have the FSM only moved when prodded (like your example picture).

This is a bit of a text wall, but do you get it now? Maybe google "global transition" for more instructions on how to make them and how they work.
« Last Edit: October 31, 2018, 05:58:25 AM by daniellogin »

jjll

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Re: How can I have more than one "START" states in a FSM?
« Reply #2 on: October 31, 2018, 06:21:16 AM »
Thank you so much Daniellogin!
Now I get it!
It's very helpful! Again thanks for taking time to reply me with this long text wall, much appreciated!

 
Those are called "Global Transitions"

So just to nit pick (which may help understanding) they are not "start" states. There can only be 1 start. The literal start (first) state that will *always* play as soon as the FSM starts.

However there are other ways to jump in to an FSM or detour it to a different track. That is the Global Transitions (indicated in your picture).

They are helpful for if you have functions which are carried out in one FSM but are triggered by another one. So for example you may have an FSM which keeps track of health to update the UI or what ever else. So maybe the main track (linked off the actual Start) will be to update the UI, but then it just stops or loops back on that one track. So then you want something that happens in another FSM (like a explosion collision or something) to affect the health, so in that explosion FSM you do a "Send Event" action which is directed at the health FSM. Maybe it will point to a Global Transition called 'exploded' or something which is a whole different track (not transitioned to from the Start track) which say does an Int Add to reduce the health then finishes by transitioning back to the Start track.

So one last thing; you may be thinking at some point, what if I don't want anything to happen after it starts until a global transition? So you just hook up a single blank state to the Start. Call it something like Idle or what ever. So the FSM starts and does nothing until a global transition kicks it off. You may also flow off from all tracks to an 'Idle' state to keep things tidy and have the FSM only moved when prodded (like your example picture).

This is a bit of a text wall, but do you get it now? Maybe google "global transition" for more instructions on how to make them and how they work.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4216
    • View Profile
    • jinxtergames
Re: How can I have more than one "START" states in a FSM?
« Reply #3 on: October 31, 2018, 02:47:24 PM »
Hi.

Here is a tutorial about Global transitions and global events :


You should also check out the User Tutorials Wiki Page.

You can find many tutorials there :)

jjll

  • Playmaker Newbie
  • *
  • Posts: 6
    • View Profile
Re: How can I have more than one "START" states in a FSM?
« Reply #4 on: November 03, 2018, 12:42:32 PM »
Thank you very much! Your tutorials are very useful!
Hi.

Here is a tutorial about Global transitions and global events :


You should also check out the User Tutorials Wiki Page.

You can find many tutorials there :)