Skip to content

Prefix quest files (not dirs) with quest name - #1357

Merged
manuq merged 2 commits into
mainfrom
wjt/prefix-quest-files-not-dirs-with-quest-name
Oct 15, 2025
Merged

manuq merged 2 commits into
mainfrom
wjt/prefix-quest-files-not-dirs-with-quest-name

Conversation

@wjt

@wjt wjt commented Oct 15, 2025 •

Copy link
Copy Markdown
Member

Previously, bootstrapping a quest named "dennis" would copy scenes/quests/story_quests/NO_EDIT/1_NO_EDIT_stealth/NO_EDIT_stealth_components/NO_EDIT_stealth.dialogue to scenes/quests/story_quests/dennis/1_stealth/stealth_components/stealth.dialogue.

This doesn't match what we have been teaching students to do by hand, which is to name
scenes/quests/story_quests/dennis/1_dennis_stealth/dennis_stealth_components/dennis_stealth.dialogue.

Compromise on including the quest name in the filename, to make it always visible when the filename is shown, but not in the intermediate folders:
scenes/quests/story_quests/dennis/1_stealth/stealth_components/dennis_stealth.dialogue.

This does have the disadvantage that if a learner names their quest “It was the best of time, it was the worst of times” then all the filenames will begin with it_was_the_best_of_times_it_was_the_worst_of_times, and if they want to change this they have to rename ~66 files, whereas with the previous behaviour, they would only have to rename the quest's root folder of their quest.

@wjt
wjt requested a review from jgbourque October 15, 2025 12:10
@github-actions

Copy link
Copy Markdown

Play this branch at https://endlessm.github.io/threadbare/branches/endlessm/wjt/prefix-quest-files-not-dirs-with-quest-name.

(This launches the game from the start, not directly at the change(s) in this pull request.)

@jgbourque

Copy link
Copy Markdown
Contributor

For a future consideration(not now) , to address this inflexibility with names, we could explore allowing the learner to select the folders they'd like to auto-copy/rename (still with an option or check box to copy all if desired). This would allow teams to have the option to incrementally grab what they need instead of all at once. "What would you like for your StoryQuest? Choose from the list, give us a name for your SQ and we will take it from there".

@wjt

wjt commented Oct 15, 2025

Copy link
Copy Markdown
Member Author

@jgbourque but for now - shall we change the behaviour in the way implemented here?

@wjt wjt linked an issue Oct 15, 2025 that may be closed by this pull request
@jgbourque

Copy link
Copy Markdown
Contributor

For now I think we should:

"Compromise on including the quest name in the filename, to make it always visible when the filename is shown, but not in the intermediate folders:
scenes/quests/story_quests/dennis/1_stealth/stealth_components/dennis_stealth.dialogue."

With a fairly tight character limit to remove the possibility of super long filenames throughout the learner SQ folder.

wjt added 2 commits October 15, 2025 17:49
Previously, bootstrapping a quest named "dennis" would copy
scenes/quests/story_quests/NO_EDIT/1_NO_EDIT_stealth/NO_EDIT_stealth_components/NO_EDIT_stealth.dialogue
to
scenes/quests/story_quests/dennis/1_stealth/stealth_components/stealth.dialogue.

This doesn't match what we have been teaching students to do by hand, which is to name
scenes/quests/story_quests/dennis/1_dennis_stealth/dennis_stealth_components/dennis_stealth.dialogue.

Compromise on including the quest name in the filename, to make it
always visible when the filename is shown, but not in the intermediate
folders:
scenes/quests/story_quests/dennis/1_stealth/stealth_components/dennis_stealth.dialogue.

This does have the disadvantage that if a learner later chooses to rename their
quest, they now have to rename every file rather than just its root folder.
Currently, if someone calls their StoryQuest “Hurrah! Another Year, Surely This
One Will Be Better Than the Last; The Inexorable March of Progress Will Lead Us
All to Happiness” the resulting quest is stored in a folder called (line-wrapped
for legibility):

scenes/quests/story_quests/hurrah_another_year_surely_this_one_will_be_better_
than_the_last_the_inexorable_march_of_progress_will_lead_us_all_to_happiness

Introduce a new field to the dialog which allows editing the folder name.
Pre-populate it with the generated name whenever the title is changed. Set a
maximum length on the field and truncate the generated name to that length, too.
Add some new validation for problems that would previously be impossible. (This
splits the validation function awkwardly in two; we can refactor this later,
sorry.)

This has the added bonus that if someone tries to name a quest “Sueños de
Helado”, the generated folder will still be `sue_os_de_helado`, but the creator
can manually edit it to `suenios_de_helado`.
@wjt
wjt force-pushed the wjt/prefix-quest-files-not-dirs-with-quest-name branch from 64b6cd5 to 3096737 Compare October 15, 2025 16:49
@wjt

wjt commented Oct 15, 2025

Copy link
Copy Markdown
Member Author

OK, I implemented something slightly more than that.

The folder name is now truncated to 20 characters:

image

But you can edit the generated folder name! This means that if it's truncated in an awkward place, you can fix it. So “Susan and the Missing Moon” would be susan_and_the_missin:

image

But you could change it to e.g. susan_moon:

image

@wjt
wjt marked this pull request as ready for review October 15, 2025 16:53
@wjt
wjt requested a review from a team as a code owner October 15, 2025 16:53
@wjt

wjt commented Oct 15, 2025

Copy link
Copy Markdown
Member Author

I chose the limit of 20 characters because el_juguete_perdido is 18 characters and that seems OK.

@wjt
wjt requested review from jgbourque and removed request for jgbourque October 15, 2025 16:54

@manuq manuq left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, I'm looking forward for an ice cream dreams story quest!

bg_color = Color(0, 0, 0, 1)

[node name="StoryQuestDialogue" type="Window"]
oversampling_override = 1.0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentional?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No - but Godot really really wants to set this whenever I open and save the scene.

@manuq
manuq merged commit f8d0f1c into main Oct 15, 2025
6 checks passed
@manuq
manuq deleted the wjt/prefix-quest-files-not-dirs-with-quest-name branch October 15, 2025 17:29
@jgbourque

Copy link
Copy Markdown
Contributor

This is great thanks @wjt

@wjt

wjt commented Oct 16, 2025

Copy link
Copy Markdown
Member Author

@jgbourque @Stregoica777 I suggest that (in your guide and on Discord perhaps) you ask mentors/students to make sure to sync their fork before trying to use this tool. And if they don't have the separate "folder name" and "full path" fields, stop: they might be using the older version that doesn't copy the challenges.

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

Successfully merging this pull request may close these issues.

Extend template instantiation tool

3 participants