-
Notifications
You must be signed in to change notification settings - Fork 258
Allow quests to contain 0-6 threads, not always 3 #1860
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
|
Play this branch at https://play.threadbare.game/branches/endlessm/wjt/variable-threads-in-quests. (This launches the game from the start, not directly at the change(s) in this pull request.) |
206bc1e to
507ee8b
Compare
Previously if you deep-linked to a scene via the URL hash, and the scene was not the current scene of the previously-saved state, GameState.current_quest would be unset. Similarly, if you ran a specific scene from the editor with F6, GameState.current_quest would be unset. This is unhelpful: it would be useful to be able to rely on GameState.current_quest being set if the current scene is part of a quest. Add a function to walk up the folder hierarchy to find the quest that a scene belongs to. Call this in two cases: 1. When the game first loads, in the same codepath that disables saving state if the starting scene is not the default scene. This handles the F6-in-editor case. 2. When switching scenes via the URL hash. This handles the web-based deep linking case. It is a bit annoying that these two cases are separate. Perhaps in future we can change the web wrapper to pass --scene to the engine on startup.
Previously we assumed that all quests required the player to collect exactly 3 threads. This has proven to be limiting in practice: some stories are best told with fewer threads, other more. Add a threads_to_collect field to quest.gd, defaulting to 3, which can be set between 0 and 6, inclusive. Rewrite the story_quest_progress scene/script to dynamically add the correct number of slots for the current quest. In the case where the quest has no threads, hide it. If no quest is set, this is an error: log a warning and stop. Anchor it to the top-right in the HUD scene. Adjust the Eternal Loom logic, which previously allowed presenting threads to the loom only if the number of threads collected is at least 3, to compare to the number of threads in the current quest. If there is no quest, or if its threads_to_collect is zero, do not allow taking threads to the loom. Resolves #1234
Previously we required that quests contain three threads: Memory, Imagination, Spirit, in that order. As a result we simplified the persisted state to just count how many had been collected so far. Now we have relaxed this requirement. Store the exact types of thread collected.
507ee8b to
6ec3976
Compare
manuq
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.
This looks great. Nice sorcery in the last commit to guess the quest.
| title = "Placeholder" | ||
| description = "A quest to hold scenes that don't yet have a permanent home." | ||
| first_scene = "uid://d2ejk3qrh0fo3" | ||
| threads_to_collect = 2 |
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.
The dialogue removed in this 1st commit was granting 2 threads (imagination, spirit). But yes I see that it wasn't updated when the ink_combat_round_6.tscn added a 4th thread. So the threads to collect are indeed 2.
| GameState.current_quest | ||
| and GameState.current_quest.threads_to_collect > 0 | ||
| and GameState.items_collected().size() >= GameState.current_quest.threads_to_collect |
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.
👍
Previously we assumed that all quests required the player to collect exactly 3 threads. This has proven to be limiting in practice: some stories are best told with fewer threads, other more.
Add a field to
quest.gdto customise this. Make the HUD react to this field. Guess the quest when deep-linking to a scene (via URL hash, or F6 in editor) so that the HUD can rely onGameState.current_questbeing set.Resolves #1234