Tutorial: Refactor NPC (Arun) to shared scene#2229
Merged
Conversation
|
Test build no longer available. |
Member
Author
@saspiers Try this: https://play.threadbare.game/branches/endlessm/wjt/tutorial-refactor-npc-arun-to-shared-scene/#res://scenes/quests/lore_quests/quest_000/6_grappling/tutorial_grappling.tscn |
Previously each instance of the NPC guide (1-2 per scene of the tutorial) was an instance of scenes/game_elements/characters/npcs/townie.tscn, configured with the same seed, and then further customised to vary his behaviour per-scene. His behaviours across all the scenes are simple: you can talk to him, and in response to some external event he walks along a path. Add a scene and script that contain TalkBehavior, PathWalkBehavior, and a small number of properties and a method to customise what he says and where he walks. Adjust all the tutorial scenes to use this common scene, reducing a lot of duplication. Fix the interact marker position to be above his head. This wasn't worth doing 8 times across 6 scenes but is worth doing for one instance of him! Take this opportunity to fix some folder names and scene filenames, and relocate the ruined house to a shared folder. I also couldn't resist adding a way to grapple back to the starting island so you can loop round again and collect any buttons you may have missed.
68ff4bf to
87540bb
Compare
manuq
approved these changes
May 20, 2026
Collaborator
manuq
left a comment
There was a problem hiding this comment.
Nice, I love that Arun now can recognize if you picked all the buttons or not.
Comment on lines
+33
to
+35
| dialogue = dialogue | ||
| dialogue_title = dialogue_title | ||
| path = path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously each instance of the NPC guide (1-2 per scene of the
tutorial) was an instance of
scenes/game_elements/characters/npcs/townie.tscn, configured with the
same seed, and then further customised to vary his behaviour per-scene.
His behaviours across all the scenes are simple: you can talk to him,
and in response to some external event he walks along a path.
Add a scene and script that contain TalkBehavior, PathWalkBehavior, and
a small number of properties and a method to customise what he says and
where he walks.
Adjust all the tutorial scenes to use this common scene, reducing a lot
of duplication.
Fix the interact marker position to be above his head. This wasn't worth
doing 8 times across 6 scenes but is worth doing for one instance of
him!
Take this opportunity to fix some folder names and scene filenames, and
relocate the ruined house to a shared folder.
I also couldn't resist adding a way to grapple back to the starting
island so you can loop round again and collect any buttons you may have
missed.