for the sake of understanding here is the test conversation tree that i use :
the problem i have is if i put a "SendMessage(PersoLoadGame,,DM)" in the node 01 and then put "Tyran= [var = Tyran]" in the nodes 02 and 07, then the variable value is correct on the node 07 but not in the node 02. In 02 it show the default value in the Variable's section of the editor
BUT
when doing the SAME except putting the sequence command in the start node, then even in the node 02 i have the correct value .... and i don't know why
it's not a big problem but it can be one if i don't understand why, maybe i'm doing something wrong ?
PS : I'm also using a savegame command in the sequence of the last node in order to save the variables values
and the save and load methods are the follows:
Code: Select all
void PersoSaveGame()
{
string savedVariables = PixelCrushers.DialogueSystem.PersistentDataManager.GetSaveData();
// (Now you need to save the string. For example:)
PlayerPrefs.SetString("Variables", savedVariables);
Debug.Log("save completed");
}
void PersoLoadGame()
{
if (PlayerPrefs.HasKey("Variables"))
{
string savedVariables = PlayerPrefs.GetString("Variables");
PixelCrushers.DialogueSystem.PersistentDataManager.ApplySaveData(savedVariables);
Debug.Log("Load 1 completed");
}
else
{ // (We don't have any save data, so just reset to initial state:)
PixelCrushers.DialogueSystem.DialogueManager.ResetDatabase();
Debug.Log("Load 2 completed");
}
}