Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cannot retrieve or set Dialogic 2 internal variables #2496

Discussion options

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

Dialogic.VAR.your_variable = "new value"
// or maybe
Dialogic.VAR.your_variable = "value assigned within Dialogic"

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.

You must be logged in to vote

Figured out the problem:

When using Dialogic 2's set_variable and get_variable functions within Godot, I was trying to do this -

Dialogic.VAR.set_variable("name of my variable", new_value)

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 -

Dialogic.VAR.set_variable("Var name of my variable", new_value)

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.

Replies: 1 comment

Comment options

Figured out the problem:

When using Dialogic 2's set_variable and get_variable functions within Godot, I was trying to do this -

Dialogic.VAR.set_variable("name of my variable", new_value)

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 -

Dialogic.VAR.set_variable("Var name of my variable", new_value)

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.

You must be logged in to vote
0 replies
Answer selected by Asura-Kaishin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /