playMaker

Author Topic: Fsm Name field > update when field changed elsewhere  (Read 1546 times)

amaranth

  • Full Member
  • ***
  • Posts: 172
    • View Profile
Fsm Name field > update when field changed elsewhere
« on: August 15, 2012, 02:57:54 PM »
I'm not sure if it would be easy to implement, but it would be nice if the Fsm Name field would update when I change the name of the FSM the field is referencing.

Current:
Step 1-8: Create FSM 1-8
Step 9-15: On FSM 1-7, add Set Fsm Game Object > Game Object: Use Owner > Fsm Name: Click Button (I select this from list)
Step 16: Go to FSM 8 and change FSM name to Click Red Button.
Step 17-23: Return to FSM 1-7 and select Click Red Button.
Step 24: Play game.

My workaround to problem:
Step 1-8: Create FSM 1-8
Step 9: Create global variable called "FSM: Click Button"
Step 10-16: On FSM 1-7, add Set Fsm Game Object > Game Object: Use Owner > Fsm Name: FSM: Click Button (Global Variable)
Step 17: Go to FSM 8 and change FSM name to Click Red Button.
Step 18: Go to global variable and change FSM name. Updates automatically for FSM 1-8.
Step 19: Play game.

Possible solution that requires less steps:
Step 1-8: Create FSM 1-8
Step 9-15: On FSM 1-7, add Set Fsm Game Object > Game Object: Use Owner > Fsm Name: FSM: Click Button (Global Variable)
Step 16: Go to FSM 8 and change FSM name to Click Red Button.
Step 17: Play game.

 

k0fe

  • Playmaker Newbie
  • *
  • Posts: 1
    • View Profile
Re: Fsm Name field > update when field changed elsewhere
« Reply #1 on: November 26, 2019, 01:17:42 PM »
Bumping old thread to know if there are any updates on the problem? Maybe there is a better workaround without using the global variables?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14684
  • Official Playmaker Support
    • View Profile
Re: Fsm Name field > update when field changed elsewhere
« Reply #2 on: November 28, 2019, 11:04:20 PM »
Hi,

You could use a gameobject with an fsm, and use GetFsmXXX to access a local variable.

 you can create a singleton in your scene and store all your data you don't want as globals in there, tag that singleton, and use Find Gameobject action ( searching only by tag to be fast),

 Bye,

 Jean