Skip to content
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

Invalid get index 'Styles' (on base: 'Nil'), don't know how to solve #2118

Open
zxcdevlop opened this issue Feb 27, 2024 · 2 comments
Open

Comments

@zxcdevlop
Copy link

zxcdevlop commented Feb 27, 2024

this happened when i wanted to test out my dialogic game using "play timeline"; the game didn't run and it gave out this
it also seems to say it's coming from line 9 but I don't know what to fix there

i did some googling and i found out that "invalid get index 'styles'" means I incorrectly called something
the (on base: 'nil') means it can't find the data

here's the code from the script:

extends Control

func _ready() -> void:
	print("[Dialogic] Testing scene was started.")
	if !ProjectSettings.get_setting('internationalization/locale/test', "").is_empty():
		print("Testing locale is: ", ProjectSettings.get_setting('internationalization/locale/test'))
	$PauseIndictator.hide()

	var scene: Node = DialogicUtil.autoload().Styles.load_style(DialogicUtil.get_editor_setting('current_test_style', ''))
	if not scene is CanvasLayer:
		if scene is Control:
			scene.position = get_viewport_rect().size/2.0
		if scene is Node2D:
			scene.position = get_viewport_rect().size/2.0

	randomize()
	var current_timeline: String = DialogicUtil.get_editor_setting('current_timeline_path', null)
	if !current_timeline:
		get_tree().quit()
	DialogicUtil.autoload().start(current_timeline)
	DialogicUtil.autoload().timeline_ended.connect(get_tree().quit)
	DialogicUtil.autoload().signal_event.connect(recieve_event_signal)
	DialogicUtil.autoload().text_signal.connect(recieve_text_signal)

func recieve_event_signal(argument:String) -> void:
	print("[Dialogic] Encountered a signal event: ", argument)

func recieve_text_signal(argument:String) -> void:
	print("[Dialogic] Encountered a signal in text: ", argument)

func _input(event:InputEvent) -> void:
	if event is InputEventKey and event.pressed and event.keycode == KEY_ESCAPE:
		DialogicUtil.autoload().paused = !DialogicUtil.autoload().paused
		$PauseIndictator.visible = DialogicUtil.autoload().paused`


	if (event is InputEventMouseButton
	and event.is_pressed()
	and event.button_index == MOUSE_BUTTON_MIDDLE):
		var auto_skip: DialogicAutoSkip = DialogicUtil.autoload().Inputs.auto_skip
		var is_auto_skip_enabled := auto_skip.enabled

		auto_skip.disable_on_unread_text = false
		auto_skip.enabled = !is_auto_skip_enabled

anyone know how to fix? I'm new to dialogic and godot

@MHGray
Copy link

MHGray commented Mar 1, 2024

I believe this is an issue with the test scene script. I'm also new to Dialogic, so I don't know how I would go about fixing it, but I'm providing some more detailed info on how to reproduce the issue.

Steps to reproduce:
New Godot Project -> Add Dialogic Addon as per https://docs.dialogic.pro/getting-started.html#1-installation--activation -> Enter Styles Tab -> Add new premade style -> Add Speaker Textbox Style (happens on any of them) -> Click the "test style" button in the upper right hand corner -> Script breaks on line 17 of the test style scene
image

image

image

image

Specific error:

E 0:00:02:0127   DialogicUtil.gd:150 @ get_editor_setting(): Couldn't find the given section "DES" and key "current_timeline_path", and no default was given.
  <C++ Error>    Condition "p_default.get_type() == Variant::NIL" is true. Returning: Variant()
  <C++ Source>   core/io/config_file.cpp:86 @ get_value()
  <Stack Trace>  DialogicUtil.gd:150 @ get_editor_setting()
                 test_timeline_scene.gd:17 @ _ready()

Godot Version: 4.2.1.stable
Dialogic Version: 2.0 (From the release page)

@BlobbyJan87
Copy link

Hey, I had this same exact issue and i fixed it by reinstalling the plugin in a new empty project. I made the project and closed godot before moving the addon folder into it then i enabled the plugin and it all worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants