Hey, Blackboard variables (and Global Blackboard variables) can be serialized and deserialized (save/load) to a string (text) format and thus a file, but there is no “all-in-one” node to achieve this, thus many smaller node will need to be used (for creating the file, serializing the blackboard, writing the string to the file etc), so this can become a bit complex. On the other hand, there is a simpler solution (which might or might not work in your case), that being the ability to save/load the blackboard variables to/from Unity’s PlayPrefs instead. This can be achieved with the ‘Blackboard.Save’ and ‘Blackboard.Load’ functions respectively. Thus to call those functions in flowcanvas, all you have to do is drag&drop the Blackboard into the flowscript Graph Editor as normal, and from the menu that will popup, select the ‘Blackboard/Save’ or ‘Blackboard/Load’ function. Both Save and Load functions require a “Key” parameter. This is simple a text to identify the save and will need to be unique and the same when you want to Save and Load the same blackboard. Having said all that, please note that Global Blackboards also have a “Dont Destroy On Load” option (which is checked by default). So, if your goal is to keep the variables consistent between scenes only, then you won’t really need any of the above. If the goal is to keep the variables consistent between entirely different game sessions instead (like a save/load system), then the solution stated above is indeed useful. Let me know if the above works for you. Thanks
That’s really great information, I feel like I’m on the right track! Using PlayerPrefs sounds very convenient, out of curiosity, how much work is involved with saving to an individual file instead of the registry? Can it still be done from FC, or might it require a custom script to handle the serialization? You mentioned creating the file, serializing the blackboard, writing the string to the file, is this reasonably simple to do within Flowcanvas?
Login
Register
By registering on this website you agree to our Privacy Policy.