playMaker

Author Topic: Restore FSM State / Save FSMs and load when loading scene  (Read 12789 times)

Nimred

  • Playmaker Newbie
  • *
  • Posts: 4
    • Timecraft Games
Re: Restore FSM State / Save FSMs and load when loading scene
« Reply #15 on: September 24, 2015, 05:50:43 AM »
Hi there,

I actually took another look at the problem today and noticed that while the "ActiveState" of an FSM cannot be modified, the "StartState" can...

I did a quick test, and successfully jumped to a chosen state in Awake(), without going through the true start state.

Code: [Select]
myFSM.Fsm.StartState = "State 3";
In order to use this for real, I will just make some scripts to regularly save to a file the current states of all ingame FSMs, and possibly also global and local variables, which are also modifiable.

I'm glad there's a solution after all :)


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Restore FSM State / Save FSMs and load when loading scene
« Reply #16 on: September 24, 2015, 06:34:59 AM »
Hi,

 I am waiting for 1.8 to go public so that I do one action that works always, else it would be tricky.

 Please bump me when 1.8 will be out ok? thanks for your patience :)

Bye,

 Jean

haikugames

  • Playmaker Newbie
  • *
  • Posts: 25
Re: Restore FSM State / Save FSMs and load when loading scene
« Reply #17 on: March 31, 2016, 03:12:25 AM »
Hello, as 1.8 is in a very stable beta, I was wondering if it will be possible to create this action.  Thanks!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Restore FSM State / Save FSMs and load when loading scene
« Reply #18 on: March 31, 2016, 09:03:01 AM »
Hi,
With "Easy save" you can save all and load all (local and Global)
BUT the problem is that it does not do this on "Awake"
and the actions are not editable.
I asked moodkie if he can add a 'on awake' option on his actions.

So for now i made a "PlayerPrefs Get String on Awake" Action
so you can load a string on awake and i made a "set Fsm Start State"
to set a fsm start state on awake. and this seems to work :)

i will add them on the EcoSystem after some more testing

shadowof047

  • Playmaker Newbie
  • *
  • Posts: 16
Re: Restore FSM State / Save FSMs and load when loading scene
« Reply #19 on: September 20, 2016, 04:47:54 PM »
Bump ,

I'm also interested in this . an action which loads the fsm state would be great .

haikugames

  • Playmaker Newbie
  • *
  • Posts: 25
Re: Restore FSM State / Save FSMs and load when loading scene
« Reply #20 on: June 01, 2017, 03:37:57 PM »
I don't suppose there is any update to this :) We still want to save and load FSM states.

Alatriste

  • Full Member
  • ***
  • Posts: 193
Re: Restore FSM State / Save FSMs and load when loading scene
« Reply #21 on: September 22, 2018, 01:45:27 PM »
Any update on this?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Restore FSM State / Save FSMs and load when loading scene
« Reply #22 on: October 04, 2018, 03:39:27 AM »
Hi,

 I just made it, it's now on the Ecosystem: 'SetFsmStartState'

 Bye,

 Jean

Alatriste

  • Full Member
  • ***
  • Posts: 193
Re: Restore FSM State / Save FSMs and load when loading scene
« Reply #23 on: November 07, 2018, 06:29:10 AM »
Awesome! Thanks!

Alatriste

  • Full Member
  • ***
  • Posts: 193
Re: Restore FSM State / Save FSMs and load when loading scene
« Reply #24 on: November 18, 2018, 07:31:55 AM »
Quote
I just made it, it's now on the Ecosystem: 'SetFsmStartState'


Is that the name of the action? I cannot find it in the Ecosystem.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Restore FSM State / Save FSMs and load when loading scene
« Reply #25 on: November 19, 2018, 03:29:19 AM »
Hi,

Right... I forgot to enable it for the ecosystem, now you can get it. Sorry about that :)

Bye,

 Jean