hohfchns / DialogueQuest

A Dialogue System for Godot 4
MIT License
19 stars 2 forks source link

Unable to get DialogueQuest to Run #9

Closed GaryTheEnchanter closed 1 month ago

GaryTheEnchanter commented 1 month ago

Hello!

I thought I'd try DialogueQuest, but I'm afraid I seem to be unable to get it to run. I'm on a linux system with Godot 4.2.2.stable.

I created a fresh project and installed the addon and immediately saw the following errors in the console:

Godot Engine v4.2.2.stable.flathub (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors. res://addons/dialogue_quest/scripts/godot/project_settings.gd:12 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. modules/gdscript/gdscript.cpp:2726 - Failed to load script "res://addons/dialogue_quest/scripts/godot/project_settings.gd" with error "Parse error". (User) res://addons/dialogue_quest/scripts/systems/character/resources/character.gd:22 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. modules/gdscript/gdscript.cpp:2726 - Failed to load script "res://addons/dialogue_quest/scripts/systems/character/resources/character.gd" with error "Parse error". (User) res://addons/dialogue_quest/scripts/systems/character/character_db.gd:11 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/character/character_db.gd:15 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/character/character_db.gd:15 - Parse Error: Cannot infer the type of "dq_dir" variable because the value doesn't have a set type. modules/gdscript/gdscript.cpp:2726 - Failed to load script "res://addons/dialogue_quest/scripts/systems/character/character_db.gd" with error "Parse error". (User) res://addons/dialogue_quest/scripts/systems/dqd/dialogue_player.gd:64 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/dqd/dialogue_player.gd:93 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/dqd/dialogue_player.gd:124 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/dqd/dialogue_player.gd:145 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/dqd/dialogue_player.gd:196 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/dqd/dialogue_player.gd:241 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/dqd/dialogue_player.gd:243 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/dqd/dialogue_player.gd:245 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/dqd/dialogue_player.gd:248 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/dqd/dialogue_player.gd:251 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/dqd/dialogue_player.gd:332 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/dqd/dialogue_player.gd:335 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/dqd/dialogue_player.gd:349 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/dqd/dialogue_player.gd:360 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. modules/gdscript/gdscript.cpp:2726 - Failed to load script "res://addons/dialogue_quest/scripts/systems/dqd/dialogue_player.gd" with error "Parse error". (User) res://addons/dialogue_quest/scripts/systems/settings/settings.gd:42 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/settings/settings.gd:51 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. modules/gdscript/gdscript.cpp:2726 - Failed to load script "res://addons/dialogue_quest/scripts/systems/settings/settings.gd" with error "Parse error". (User) res://addons/dialogue_quest/scripts/systems/sound/sounds.gd:9 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/sound/sounds.gd:14 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/sound/sounds.gd:20 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. modules/gdscript/gdscript.cpp:2726 - Failed to load script "res://addons/dialogue_quest/scripts/systems/sound/sounds.gd" with error "Parse error". (User) res://addons/dialogue_quest/scripts/ui/dialogue/components/dialogue_box.gd:191 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/ui/dialogue/components/dialogue_box.gd:194 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/ui/dialogue/components/dialogue_box.gd:201 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/ui/dialogue/components/dialogue_box.gd:204 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. modules/gdscript/gdscript.cpp:2726 - Failed to load script "res://addons/dialogue_quest/scripts/ui/dialogue/components/dialogue_box.gd" with error "Parse error". (User) res://addons/dialogue_quest/scripts/systems/settings/settings.gd:42 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/settings/settings.gd:51 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/character/character_db.gd:11 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/character/character_db.gd:15 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/character/character_db.gd:15 - Parse Error: Cannot infer the type of "dq_dir" variable because the value doesn't have a set type. res://addons/dialogue_quest/scripts/systems/sound/sounds.gd:9 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/sound/sounds.gd:14 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/systems/sound/sounds.gd:20 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/scripts/dialogue_quest_interface.gd:-1 - Compile Error: modules/gdscript/gdscript.cpp:2726 - Failed to load script "res://addons/dialogue_quest/scripts/dialogue_quest_interface.gd" with error "Parse error". (User) res://addons/dialogue_quest/scripts/godot/project_settings.gd:12 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/dialogue_quest.gd:-1 - Compile Error: modules/gdscript/gdscript.cpp:2726 - Failed to load script "res://addons/dialogue_quest/dialogue_quest.gd" with error "Compilation failed". (User)

I then enabled the plugin in Godot and saw the following errors:

res://addons/dialogue_quest/scripts/godot/project_settings.gd:12 - Parse Error: Identifier "DialogueQuest" not declared in the current scope. res://addons/dialogue_quest/dialogue_quest.gd:-1 - Compile Error: modules/gdscript/gdscript.cpp:2726 - Failed to load script "res://addons/dialogue_quest/dialogue_quest.gd" with error "Compilation failed". (User) Add Autoload res://addons/dialogue_quest/dialogue_quest.gd:12 - Invalid call. Nonexistent function 'prepare' in base 'GDScript'.

I went into settings to add the data directory, but the DialogueQuest setting wasn't there. I did notice if I closed Godot and reopened the project, the setting appeared, so I set the data directory like the documentation said to.

I then created a scene with the structure mentioned in the documentation. I noticed that when I added DQDialogueBox, that it's a tool and thus constantly generates the following error in my console:

res://addons/dialogue_quest/scripts/ui/dialogue/components/dialogue_box.gd:64 - Invalid get index 'visible_characters' (on base: 'null instance').

I tried running the scene I created without even trying to play a dialogue, but it errors out on this line: https://github.com/hohfchns/DialogueQuest/blob/ac6b5bc398325b1af1006d7409ad18567c3a2544/addons/dialogue_quest/scripts/systems/dqd/dialogue_player.gd#L73 Godot says that it "Cannot call method 'hide' on a null value.".

Here's the test project after I did all the above: DialogueQuestTest.zip

I downloaded DialogueQuestTester and that works, but at first glance it's not obvious what difference in mine is causing it not to work. It seems like a neat plugin, I wish I was clever and/or patient enough to get it to work. I hope all this is helpful for you and wish you well on your future gamedev endeavors.

hohfchns commented 1 month ago

Hi, I see your confusion.

The errors are safe to ignore, as they are a result of the addon not being enabled before startup, most of the tool scripts use the DialogueQuest Autoload which is only available once the plugin is enabled.

The scene you have provided does not work because the DialogueBox, ChoiceMenu, etc. Are meant to be instantiated as scenes and not as script instances (apart from DialogueQuestPlayer, which is an inconsistency that has been / wil be fixed in v0.6.0-rc2).

You can find the scenes under the paths: res://addons/dialogue_quest/prefabs/ui/dialogue/components/dialogue_box/dialogue_box.tscn res://addons/dialogue_quest/prefabs/ui/dialogue/components/choice_menu/choice_menu.tscn

I will definitely update the documentation to address these possible points of confusion, thank you for opening an issue!

hohfchns commented 1 month ago

For the record, here is the project in a working state: DialogueQuestTest_working.zip

The script instances have been switched to scene instances

hohfchns commented 1 month ago

Another issue - The Cannot call method 'hide' on a null value. is a bug with the order of the components in the scene not being considered (DQDialoguePlayer attempts to use DQDialogueBox before it is ready).

I will fix it :)

hohfchns commented 1 month ago

Another issue - The Cannot call method 'hide' on a null value. is a bug with the order of the components in the scene not being considered (DQDialoguePlayer attempts to use DQDialogueBox before it is ready).

I will fix it :)

Fixed in commit befe17e9152c5e841d70d1115879e50bf5b961c8