-
-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting variables in dictionaries or arrays not working. #2195
Comments
Hello, please try again with the latest commit on the |
Hi, thank you for your response. I tried updating to the latest commit, and sadly no change. I did however try to force the entry of the variable by adding it into the timeline-file manualy with code. This gave the error: I also wanted to add that yes, this code works from any other gd-script in the game and I have spellchecked it anyway :) |
Hey @Pynthare The access to arrays and dictionaries is for now limited to this syntax So you should be able to do what you want with: I have created a new separate feature request (#2197) for that syntax so we can track the missing functionality there. |
The problem
Describe the bug
I am using a singleton dictionary to store the information for each quest that is currently in my game. I can fetch information from this dictionary without problem e.g: "if {Quest.quests["shipHullRepairPart1"].status} == 0:" and it works flawlessly.
However, when tring to SET a variable e.g: "set {Quest.quests["shipHullRepairPart1"].status} = 1", dialogic just trows a tantrum in the output log:
Dialogic: Expression failed to parse: Expected expression.
[Dialogic] Failed parsing variable/expression ''.
This also appears when tring to use other parts, like using a variable to minus itself using another variable:

If I look in the timeline files this is not even saved correcly:
"set {{Itemresource.inventoryResources[0].amountOwned}} -= {}"
To Reproduce
Steps to reproduce the behavior:
Try setting any variable in a dictionary or .
Expected behavior
I would expect dialogic to set the variables and save the entered variables.
System (please complete the following information):
Am I missing something supidly obvious?
The text was updated successfully, but these errors were encountered: