playMaker

Author Topic: Check if a game object has an FSM named "Banana" [SOLVED]  (Read 440 times)

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 789
    • View Profile
    • Fat Pug Studio
Check if a game object has an FSM named "Banana" [SOLVED]
« on: November 15, 2017, 07:10:24 AM »
Hi guys,

i have an FSM which is present in some object and in some not (let's call that FSM "Banana"), but every object has an FSM which needs to check if the object has FSM named "Banana" or not on itself so it can continue doing it's stuff.

Any idea on how to do this? I suppose Has Component should do, but i probably got some more stuff to write in the component field since there are few FSM's on that object.
« Last Edit: November 24, 2017, 08:35:10 AM by krmko »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 3504
    • View Profile
    • jinxtergames
Re: Check if a game object has an FSM named "Banana"
« Reply #1 on: November 15, 2017, 08:06:55 AM »
Hi,
Get component will get the fsm component but not the fsm name.
So maybe a different way can be used.

I have tested a bit with "get/set fsm" actions, and "send event" actions here is my result.

If the Fsm "Banana" exists it will get the variable if the variable name is available.
If the variable name is not on the fsm, there is no result.

If the Fsm "Banana" does not exists it will check only to the 1st Fsm.
If the variable exists the other fsms are ignored.
If the variable exists it will get the value.


For 'Send event by name' :
If an fsm name is set then it will only send the event to the named fsm.
If fsm name is empty it will send to all fsms (can be helpful is some cases)

same goes for 'Send Event' but you 1st need to select one Fsm to set the Variable and then erase the fsm name.

Gustav

  • Playmaker Newbie
  • *
  • Posts: 31
    • View Profile
    • Pyrit
Re: Check if a game object has an FSM named "Banana"
« Reply #2 on: November 15, 2017, 08:51:49 AM »
There is also a GetFsmName action on the Ecosystem. :)

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 789
    • View Profile
    • Fat Pug Studio
Re: Check if a game object has an FSM named "Banana"
« Reply #3 on: November 15, 2017, 09:31:28 AM »
Hmmm, i just checked it out on ecosystem. Ok, i can get an fsm name, but  how will that help me? I'm afk btw so i'm a bit senseless :D
« Last Edit: November 15, 2017, 09:36:53 AM by krmko »

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 789
    • View Profile
    • Fat Pug Studio
Re: Check if a game object has an FSM named "Banana"
« Reply #4 on: November 24, 2017, 08:31:57 AM »
I figured it out in the end, thanks for directions and help  ;D