You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error on game start after just installing the addon: DialogicGameHandler.gd: Node not found: "Inputs" and "Portraits" (relative to "/root/Dialogic")
#2222
Closed
hsandt opened this issue
May 8, 2024
· 2 comments
· Fixed by #2223
Describe the bug
Just after installing the addon, and making sure that it's enabled (you may first have to go through initial setup errors mentioned in #2221), you still get the same errors each time you start the game, in any scene, although you haven't done anything yet.
This is because the addon spawns a Dialogic node in any case, however I didn't expect it to cause errors until I actually try to play some dialogues. The runtime errors on start are:
I checked the Remote scene tree and Inputs and Portraits nodes are present. But using breakpoints, I see that they appear too late, after the get_node call.
To Reproduce
Steps to reproduce the behavior:
Install addon and make sure it's enabled
Run game from any scene
See errors
Expected behavior
Inputs and Portraits nodes should be ready to avoid error
Screenshots
Errors in Debugger:
Remote tree when Inputs node is requested:
System (please complete the following information):
OS: Linux Ubuntu 22.04
Godot Version: v4.2.2.stable.official [15073afe3]
Dialogic Version: v2 alpha 13
Solutions
Workaround
What you tried to get the feature working
Possible fixes
I identified the issue coming from module dependency order: Text is loaded before Inputs, but Text requires the Inputs as subsystem.
I went up the call tree to identify how the order was determined:
And found out that the last method relies on native:
Error list_dir_begin()
Initializes the stream used to list all files and directories using the get_next() function, closing the currently opened stream if needed. Once the stream has been processed, it should typically be closed with list_dir_end().
Affected by include_hidden and include_navigational.
Note: The order of files and directories returned by this method is not deterministic, and can vary between operating systems. If you want a list of all files or folders sorted alphabetically, use get_files() or get_directories().
It is not deterministic and therefore my system could have an issue while other developers don't have any.
To fix this, we can:
make the order deterministic of dependency order
loads all modules in a first step, then only request their subsystems in a second phase (what we often do in games when an entity depends or affects another entity)
The text was updated successfully, but these errors were encountered:
Thanks! This has been reported on discord recently too, I'll try to push a fix. We should call these in post_install() instead of ready, which works like the second option you suggested.
Thanks! This has been reported on discord recently too, I'll try to push a fix. We should call these in post_install() instead of ready, which works like the second option you suggested.
Yes, I just found post_install in the meantime and moved both collect methods there:
collect_text_effects()
collect_text_modifiers()
The second one, collect_text_modifiers(), may not trigger a bug right now, but it may later if we add a node-based modifier, so this looks safer and more consistent.
So it works with this workaround, and should make an easy PR! (but you can also check all occurrences of get_node in _ready methods too, if there are any)
I'm not on the Discord but I'll be notified if you update this issue.
hsandt
added a commit
to hsandt/lospec-jam-2-scaled-down-adventures
that referenced
this issue
May 8, 2024
The problem
Describe the bug
Just after installing the addon, and making sure that it's enabled (you may first have to go through initial setup errors mentioned in #2221), you still get the same errors each time you start the game, in any scene, although you haven't done anything yet.
This is because the addon spawns a Dialogic node in any case, however I didn't expect it to cause errors until I actually try to play some dialogues. The runtime errors on start are:
3 times, and
E 0:00:00:0860 DialogicGameHandler.gd:346 @ get_subsystem(): Node not found: "Portraits" (relative to "/root/Dialogic").
<C++ Error> Method/function failed. Returning: nullptr
<C++ Source> scene/main/node.cpp:1651 @ get_node()
DialogicGameHandler.gd:346 @ get_subsystem()
subsystem_text.gd:321 @ collect_text_effects()
subsystem_text.gd:390 @ _ready()
DialogicGameHandler.gd:355 @ add_subsystem()
DialogicGameHandler.gd:334 @ collect_subsystems()
DialogicGameHandler.gd:137 @ _ready()
1 time
I checked the Remote scene tree and Inputs and Portraits nodes are present. But using breakpoints, I see that they appear too late, after the
get_node
call.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Inputs and Portraits nodes should be ready to avoid error
Screenshots
Errors in Debugger:
Remote tree when
Inputs
node is requested:System (please complete the following information):
Solutions
Workaround
What you tried to get the feature working
Possible fixes
I identified the issue coming from module dependency order: Text is loaded before Inputs, but Text requires the Inputs as subsystem.
I went up the call tree to identify how the order was determined:
DialogicGameHandler.collect_subsystems() DialogicUtil.get_indexers() DialogicUtil.listdir(path, ...)
And found out that the last method relies on native:
Error list_dir_begin()
It is not deterministic and therefore my system could have an issue while other developers don't have any.
To fix this, we can:
The text was updated successfully, but these errors were encountered: