Jump to specific node for loading my progress

Fri 19. Jul 2019, 13:55

Dear community, dear support,

I am working on an almost completed university project as a C# programmer in Unity. For our gameplay it is imperative that we are able to save and load the progress of the current flowtraversal. Basically it's going to be a mobile app in which players should be able to traverse through the storyline. However, I can't find any way to make my flowgraph to jump to any specific point. My idea was, to save the technical name of the current node and use this string as an identifier to jump back, once the app is restarted. How would I achieve that? How would I be able to jump to a specific node with my flowplayer? What would be the best approach?

I would really love to hear some answers on this as the deadline approaches and I am getting desperate.

All the best,

Nicolas

EDIT: I just found an older post where someone asked a similar question and appearantly jumping to a specific node can be achieved by FlowPlayer.StartOn. I will test this asap.
Last edited by nicolas90 on Fri 19. Jul 2019, 14:37, edited 1 time in total.
nicolas90
 
Posts: 3
Joined: Sun 16. Sep 2018, 09:40

Re: Jump to specific node for loading my progress

Fri 19. Jul 2019, 14:28

Hi nicolas90,

thats easy to do, you just set the StartOn property to something different, which you can query beforehand from the database.

This could look like this:
Code: Select all
var myFlowPlayer = GetComponent<ArticyFlowPlayer>();
myFlowPlayer.StartOn = ArticyDatabase.GetObject("Chapter_3");


But remember if you want to save your flow session, you probably want to store your Global Variables as well.

Code: Select all
// saving
Dictionary<string, Object> globalVars = ArticyDatabase.DefaultGlobalVariables.Values;
MyCustomSaveMethod(globalVars); // save in an appropriate format for your game (Binary, json, database etc.)

// loading
Dictionary<string, Object> globalVars = MyCustomLoadMethod();
ArticyDatabase.DefaultGlobalVariables.Values = globalVars;
// from this point on, the state is restored and you just need to reset the StartOn as above


Hope that helps

Best regards

Nico
Nico Probst
Senior Software Engineer | Articy | LinkedIn
User avatar
[Articy] Nico Probst
Articy Staff
Articy Staff
 
Posts: 217
Joined: Wed 23. Nov 2011, 09:45
Location: Bochum

Return to articy:draft Unity Importer

Who is online

Users browsing this forum: No registered users and 14 guests

Who We Are
Contact Us
Social Links