Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: LestatTom on November 14, 2013, 07:31:23 AM
-
I use Playmaker for story flow and want to implement savegames. My problem ist, when loading the savegame, I want to jump directly into a specific state (and not walk through the fsm by repeating all events). How can I do this?
-
If you know what state you want to reach, you can add a global event to that state. And then when you fire the send event action from an "event manager for example" you will be able to reach the specific state.
Hope it help
Yaniv
-
Are you trying to save during long conversations or trying to store where the player is in a conversational relationship with an npc they can interact with?
-
I use playmaker to create a story flow. So each state in the fsm symbolizes a specific point in the story flow (and this enables the player to buy specific items, etc.) and I send events to the fsm and do some custom checks ("Has the player XXX $, etc.).
Currently I have 30 states in which the player can be and I save that state. I created 30 Events that directly link from the initial state to each of the story states. But it's not very suitable, it creates a chaos of transitions. Setting a state by name would be perfect.
I attached a (partly blurred) screenshot - it works but it's far from being nice and usable.
-
Have you checked out Get FSM State and Get Previous State Name?
-
I did, but as far as I found out, they are all readonly properties. I can retrieve a state by name, I also can check whether this state is currently active. But I haven't found any method that allows me to change the active state directly
-
You could sync up the State and Event names, then fire an event by name (from what was stored at the save).. Get Last Event may be something.
I think you can store the event or state name and use that to reach the correct state. You could make a string that each state changes to its triggering event's name, so you just load game and fire that event name immediately.