-
Notifications
You must be signed in to change notification settings - Fork 258
Rename template to NO_EDIT #1243
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
Conversation
|
Test build no longer available. |
wjt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote the same PR the other day but the reason I didn't file it is that the next time you open the project after switching to this branch, you'll get:
Here's what's in the console:
ERROR: res://addons/storyquest_bootstrap/plugin.gd:166 - Parse Error: Could not resolve external class member "STORY_QUEST_TEMPLATE".
ERROR: modules/gdscript/gdscript.cpp:3022 - Failed to load script "res://addons/storyquest_bootstrap/plugin.gd" with error "Parse error".
ERROR: res://scenes/menus/storybook/components/storybook_page.gd:51 - Parse Error: Could not resolve external class member "sprite_frames".
ERROR: res://scenes/menus/storybook/components/storybook.gd:0 - Compile Error: Failed to compile depended scripts.
ERROR: modules/gdscript/gdscript.cpp:3022 - Failed to load script "res://scenes/menus/storybook/components/storybook.gd" with error "Parse error".
ERROR: res://scenes/menus/storybook/components/animated_texture_rect.gd:15 - Parse Error: Preload file "res://scenes/quests/story_quests/template/template_player_components/template_player.tres" does not exist.
ERROR: modules/gdscript/gdscript.cpp:3022 - Failed to load script "res://scenes/menus/storybook/components/animated_texture_rect.gd" with error "Parse error"
If you re-enable the plugin and then reload the project, the dialogue is not shown but I still see these errors:
ERROR: res://scenes/menus/storybook/components/storybook_page.gd:51 - Parse Error: Could not resolve external class member "sprite_frames".
ERROR: res://scenes/menus/storybook/components/storybook.gd:0 - Compile Error: Failed to compile depended scripts.
ERROR: res://addons/storyquest_bootstrap/plugin.gd:0 - Compile Error: Failed to compile depended scripts.
ERROR: modules/gdscript/gdscript.cpp:3022 - Failed to load script "res://addons/storyquest_bootstrap/plugin.gd" with error "Compilation failed".
| compress/uastc_level=0 | ||
| compress/rdo_quality_loss=0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you write this PR with Godot 4.5? These properties are added by that version. When I try to edit the project in 4.4 it removes them again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you write this PR with Godot 4.5? These properties are added by that version. When I try to edit the project in 4.4 it removes them again.
Ugh yes sorry, I fixed it now.
82f52f1 to
89fb0bb
Compare
wjt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still get this when I open the project after switching to this branch:
Unable to load addon script from path: 'res://addons/storyquest_bootstrap/plugin.gd'. This might be due to a code error in that script.
Disabling the addon at 'res://addons/storyquest_bootstrap/plugin.cfg' to prevent further errors.
In the Output tab I see:
ERROR: res://addons/storyquest_bootstrap/plugin.gd:166 - Parse Error: Could not resolve external class member "STORY_QUEST_TEMPLATE".
ERROR: modules/gdscript/gdscript.cpp:3022 - Failed to load script "res://addons/storyquest_bootstrap/plugin.gd" with error "Parse error".
And indeed when I save, project.godot is modified to disable the plugin.
I'll see if I can fix this
When we rename the template directory (in a future commit) the plugin fails to load if the directory has been previously loaded into the editor before the rename: > ERROR: res://addons/storyquest_bootstrap/plugin.gd:166 - Parse Error: > Could not resolve external class member "STORY_QUEST_TEMPLATE". > > ERROR: modules/gdscript/gdscript.cpp:3022 - Failed to load script > "res://addons/storyquest_bootstrap/plugin.gd" with error "Parse > error". and the editor shows an error dialogue & disables it. I think the problem is some combination of: - storybook.gd is not a @tool script. - It preload()s a bunch of files from the template - But the editor is still reimporting resources at the point where the plugin loads & tries to access fields of storybook.gd The best solution I have found is to avoid using Storybook in the storyquest_bootstrap plugin: - Hardcode the `quest.tres` filename again. - Construct the path to the template quest resource based on the TEMPLATE_PATH (already hardcoded here) and the quest filename (as above).
Previously, this class defaulted to showing the template player, by path. Our convention is to preload by uid:// in scripts to avoid needing to update every script when we rename a resource. But more to the point: TextureRect does not display anything by default; and this is meant to be an animated version of that standard Control.
89fb0bb to
7df8fd3
Compare
|
I edited this branch to add 2 patches before the rename:
|
wjt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we try the re-name for this upcoming UTP iteration, because it's unlikely that the duplication tool will be solid before then? That way we can compare and see if we get any decrease in the number of files inadvertently edited?
Can you clarify whether, by “the re-name”, you meant:
- Rename
scenes/quests/story_quests/template/0_template_intro/template_intro_components/template_intro.dialoguetoscenes/quests/story_quests/NO_EDIT/0_template_intro/template_intro_components/template_intro.dialogue(which is what @manuq has implemented here) - Rename
scenes/quests/story_quests/template/0_template_intro/template_intro_components/template_intro.dialoguetoscenes/quests/story_quests/NO_EDIT/0_NO_EDIT_intro/NO_EDIT_intro_components/NO_EDIT_intro.dialogue
|
@hydrolet clarified on Slack that it is option 2 that she wants. I would tend to agree that there's no point in just renaming the folder: if you only have 1 scene or dialogue file open, its path is not shown in the tab, only the filename. So I think we should do the more thorough renaming as in 2. |
OK! Let me work on it. |
|
@wjt I added 2 fixup commits. Could you review? In |
This will hopefully help contributors with accidental changes. Adjust the following files to the renamed directory: - .pre-commit-config.yaml - addons/storyquest_bootstrap/plugin.gd - project.godot
05e2282 to
06e1627
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, let's see if this helps!
| "components_path": "/0_template_intro/template_intro_components/", | ||
| "dialogue_path": "/0_template_intro/template_intro_components/template_intro.dialogue", | ||
| "image_path": "0_template_intro/template_intro_components/template_intro_image.png", | ||
| "scene_path": "/0_{prefix}_intro/{prefix}_intro.tscn".format({"prefix": TEMPLATE_PREFIX}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally think that the repeated .format({"prefix": TEMPLATE_PREFIX}) is much less legible than repeating NO_EDIT, even at the cost having to search-and-replace every line if we rename it again. But let's go with this for now.

This will hopefully help contributors with accidental changes.
animated_texture_rect.gd: Use UID path to preload the template sprite
frames resource file.
Adjust the following files to the renamed directory:
Resolve #1213