Skip to content

Problems with variables from main script. #2646

@ZephyyKylin

Description

@ZephyyKylin

The problem

Describe the bug
In the main script... I have a variable defined and trying to access the variable, I get an error. I'm pretty sure I'm reading the documentation correctly. Here's my code.

var testy_testy = Dialogic.VAR.random_events.test_test
func _ready() -> void:
    Dialogic.start(testy_testy)

And in the Dialogic plugin editor thing I have random_events as a folder, and test_test as a variable.

The error that appears is

Invalid access to property or key 'random_events' on a base object of type 'null instance'.

And when I try to get more info on the error, the error changes to this.

E 0:00:02:451   DialogicGameHandler.gd:395 @ get_subsystem(): Node not found: "VAR" (relative to "Dialogic").
  <C++ Error>   Method/function failed. Returning: nullptr
  <C++ Source>  scene/main/node.cpp:1877 @ get_node()
  <Stack Trace> DialogicGameHandler.gd:395 @ get_subsystem()
                DialogicGameHandler.gd:147 @ @VAR_getter()
                world.gd:9 @ @implicit_new()

Which is what makes me think this is a bug of some kind.

To Reproduce

  1. Go to main game script.
  2. Define a variable as a variable you have in Dialogic according to the docs
  3. Try to run that string as a Dialogic.start()
  4. See error.

Expected behavior
I expected the Dialogic.start() to replace the variable, in this case, the test_test variable with the string in the Dialogic editor.
Essentially, run the specific timeline I have as that test_test variable.

Screenshots
If applicable, add screenshots to help explain your problem.

System (please complete the following information):

  • OS: Windows
  • Godot Version: 4.4.1
  • Dialogic Version: 2.0 alpha 16

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions