I’m intending to use FlowCanvas as a Quest Graph, to allow designers create and test quests for our RPG. As in any good RPG at some point a user will save the game, quit it and load the savegame later on.
How should I go about restoring the “state” of the FlowGraph? A quest might have multiple conditions and sub quests and upon loading I would like the graph to “continue” where it was left off. Is there some API that is helpful with that? Couldn’t find much help in the forum search.
Since FlowCanvas is based on event and thus the execution of the flow is taking place immediately when an event (node) takes place, there is not saving/restoring of graphs. However, there is saving and restoring of Blackboard variables, which you may potentially use for something like what you are after depending on your setup. The blackboard has an easy to use “Save(string key)” and “Load(string key)” methods which will save/load its variables to PlayerPrefs by default. Both Save and Load methods use the “Serialize” and “Deserialize” methods of Blackboard behind the scenes (which you could alternatively use for more custom save/load of variables).