Hi Tony,
I created a variable "Room_Interactions" in the Dialogue Manager. I have 2 conversations in my game and at a certain point I add 1 to the created variable: Variable["Room_Interactions"] = Variable["Room_Interactions"] + 1;
After that dialogue entry I created another node with the condition: Variable["Room_Interactions"] >= 2
So these nodes only get triggered if the player had both Conversations so the variable is 2. But for some reason it gets triggered every time.
Is there a way to see when a Variable gets changed? It doesn't get updated at runtime in the manager itself even when I check the "Watchers" checkmark.
What am I doing wrong?
Thank you for your help!
Variable doesn't get set correctly
Re: Variable doesn't get set correctly
Hi,
You can watch the runtime value of a variable in the Watches tab or Variable Viewer window.
In the Watches tab, select Menu > Add Runtime Variable -- or Add All Runtime Variables if you want to watch them all. Tick Auto Refresh to make the Watches tab automatically refresh the display of the variables' values.
You can watch the runtime value of a variable in the Watches tab or Variable Viewer window.
In the Watches tab, select Menu > Add Runtime Variable -- or Add All Runtime Variables if you want to watch them all. Tick Auto Refresh to make the Watches tab automatically refresh the display of the variables' values.
Re: Variable doesn't get set correctly
Thank you. Now I could check the variable change at runtime and I saw that it changes from 0 to 2 eventhough my script tells it to add 1: Variable["Interactions"] = Variable["Interactions"] + 1
Do you have any idea how this could happen?
Do you have any idea how this could happen?
Re: Variable doesn't get set correctly
Is the code running twice, perhaps in two entries?
Temporarily set the Dialogue Manager's Other Settings > Debug Level to Info, This will log Dialogue System activity to the Console. You can trace through to see when the variable changes.
Temporarily set the Dialogue Manager's Other Settings > Debug Level to Info, This will log Dialogue System activity to the Console. You can trace through to see when the variable changes.
Re: Variable doesn't get set correctly
I fixed it by putting the variable update at the start of the conversation. In the end of the dialogue it could branch in two directions and in both the variable would be updated... it's weird thought that it triggered two times even though the player could only go down one branch.
As long as it works now I'm happy.
Thank you for your help!
As long as it works now I'm happy.
Thank you for your help!
Re: Variable doesn't get set correctly
Was the code on your <START> node? If a Dialogue System Trigger's Actions > Start Conversation > Skip If No Valid Entries is ticked, it has to run the <START> node to determine if any of its children are currently valid. If it then starts the conversation, it will run the <START> node again as part of the actual conversation.