Cannot retrieve or set Dialogic 2 internal variables #2496
-
I am very new to Godot and programming, but in essence I'm trying to use Godot/Dialogic to make a simple visual novel with dice-based stat checks. I have written code for the dice rolling mechanic that appears to output the kinds of results I'm looking for according to print(), but every attempt I have made at get_variable or set_variable in order to change a "rolled outcome" variable pre-defined within Dialogic has either returned a "failed to parse" error, returned "null" as the value, or "tried setting non-existent variable 'rolled outcome'". I have seen prior questions in this forum regarding this issue answered with some version of
But when I try to do that I get an error saying that I am trying to assign a String value to a Node. I know just enough to understand that Dialogic is storing its variables within some sort of array, but that's pretty much where my understanding of how to find or access them ends. Any help untangling this would be very appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Figured out the problem: When using Dialogic 2's set_variable and get_variable functions within Godot, I was trying to do this -
However, by default Dialogic appends "Var" to the front of the String of the name of any variable defined within it via the Variables tab, so what ended up working was -
As for the rest, I had thought I needed to have my dice rolling function output something other than a null value because I didn't understand how signals worked yet. Dialogic.VAR.variable_was_set.emit('new value") worked just fine after those changes. |
Beta Was this translation helpful? Give feedback.
Figured out the problem:
When using Dialogic 2's set_variable and get_variable functions within Godot, I was trying to do this -
However, by default Dialogic appends "Var" to the front of the String of the name of any variable defined within it via the Variables tab, so what ended up working was -
As for the rest, I had thought I needed to have my dice rolling function output something other than a null value because I didn't understand how signals worked yet. Dialogic.VAR.variable_was_set.emit('new value") worked just fine after those changes.