Variables not setting!
Posted: Tue Mar 08, 2022 6:43 pm
This seems like an absurdly basic and simple task, and yet it doesn't seem to be working for me.
I have a simple conversation that, near the end, it sets a boolean value:
Variable editor:
Conversation node Sequence:
Then, in C# code, after the conversation is completed, I check the value of that boolean:
C# Query Code:
Which gives me...
C# Query result:
What am I missing?
I got to this point because the save system didn't seem to be working, but it seems that the VARIABLE system is not working. At least, I don't see changed values outside of the conversation.
If I set the variable inside the conversation and then use it as a condition within the conversation, it works fine. But I'm trying to store the conversation state so the next time it comes up, it behaves differently than the first time.
Edwin!
I have a simple conversation that, near the end, it sets a boolean value:
Variable editor:
Code: Select all
IntroductionComplete, initial value=false, Boolean
Code: Select all
SetVariable(IntroductionComplete, true);
C# Query Code:
Code: Select all
string savedVariables = PersistentDataManager.GetSaveData();
C# Query result:
Code: Select all
03-08 17:34:02.464 24350 24373 I Unity : ### Variable={Alert="", IntroductionComplete=false}; ...
I got to this point because the save system didn't seem to be working, but it seems that the VARIABLE system is not working. At least, I don't see changed values outside of the conversation.
If I set the variable inside the conversation and then use it as a condition within the conversation, it works fine. But I'm trying to store the conversation state so the next time it comes up, it behaves differently than the first time.
Edwin!