playMaker

Author Topic: send event on a new FSM[SOLVED]  (Read 2663 times)

IIKII

  • Full Member
  • ***
  • Posts: 137
  • Lonely developer
    • Patreon
send event on a new FSM[SOLVED]
« on: January 14, 2015, 03:20:03 AM »
Hi,

I realized that if i want to send a event to another fsm, that event would not work if it does not has a start state assigned to it.

The problem is that now i have to make a new FSM for this one event.

Is there any other way?
« Last Edit: January 19, 2015, 02:58:00 AM by jeanfabre »
Support me on Patreon for free adventure games and development insights - https://www.patreon.com/koexstudio

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: send event on a new FSM
« Reply #1 on: January 14, 2015, 07:03:34 AM »
Every FSM has a Start State so I'm not really sure what is happening here?
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

IIKII

  • Full Member
  • ***
  • Posts: 137
  • Lonely developer
    • Patreon
Re: send event on a new FSM
« Reply #2 on: January 14, 2015, 08:36:57 AM »
I have this action that send event to a listener state. But the listener state has to connect to a start state for it to work, thus creating a new FSM for this one listener. My inspector will be 'crowded' with a bunch of FSM...

I want to put this listener state into one existing FSM but it will not work because it needs to connect to the start state of that existing FSM.

I am wondering if there's a way to put all these into one FSM instead of making new FSM which can be quite crowded.

Hope it makes sense..
Support me on Patreon for free adventure games and development insights - https://www.patreon.com/koexstudio

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: send event on a new FSM
« Reply #3 on: January 14, 2015, 02:47:41 PM »
Pictures are always good.  Windows comes with snipping tool.  It makes it easier for people to see what you are talking about.

You can create a 'Global tranisiton'.  Make a transition and click the box next to it.  Then on the editor, for the transition select global transition and seletthe one you made.  There will be a new black rectangle pop up.

So you have the start state with an empy box assigned to it.  this always gets run.  However, the global transition do not.  you trigger them from a 'send event'.  you can have many global transitions on a single FSM.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: send event on a new FSM
« Reply #4 on: January 14, 2015, 03:39:57 PM »
i am not sure what you mean, but maybe this can help

IIKII

  • Full Member
  • ***
  • Posts: 137
  • Lonely developer
    • Patreon
Re: send event on a new FSM
« Reply #5 on: January 15, 2015, 02:32:53 AM »
I have a global event setup named 'hurt' but it wasn't being called.
Support me on Patreon for free adventure games and development insights - https://www.patreon.com/koexstudio

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: send event on a new FSM
« Reply #6 on: January 15, 2015, 06:56:02 PM »
it can't be called this way, because the state must be active when called
(when play is pressed you can see the green around the state, that is the active state)

right click on hurt and delete it, then right click on injured listener, select "Add Global Transition", select hurt. it will stand now Above injured listener state

this way it can always be called regardless where your current state is.

IIKII

  • Full Member
  • ***
  • Posts: 137
  • Lonely developer
    • Patreon
Re: send event on a new FSM
« Reply #7 on: January 15, 2015, 09:41:59 PM »
Thank you, i thought i am doing it correctly. Now it works
Support me on Patreon for free adventure games and development insights - https://www.patreon.com/koexstudio