-
-
Notifications
You must be signed in to change notification settings - Fork 224
Description
Is your feature request related to a problem? Please describe.
We run game-making workshops where learners learn through contributing to our game. One way they can contribute is to make a new level: a learner can duplicate a template scene, modify it to their needs, commit, and send us a pull request.
Suppose the template scene (res://template/level.tscn
, say) has a node which references a DialogueResource
(res://template/npc.dialogue
, say). The problem we face is that, to new Godot users, it's very surprising that if you duplicate res://template/level.tscn
, it does not duplicate the dialogue: the copied scene references the same dialogue file. So it's very common for the learner to accidentally modify the template dialogue rather than making a copy and modifying that.
We try to work around this by having the learner duplicate the whole res://template
directory to res://new_level
, and then open res://new_level/level.tscn
and update the DialogueResource reference to point to res://new_level/npc.dialogue
. This turns out to be almost worse if they forget to update the reference: now they can see that they've duplicated the dialogue in the FileSystem tree, so they think it's safe to modify; but if they open res://new_level/level.tscn
and click on the DialogueResource in the inspector, it edits the wrong file.
Describe the solution you'd like
For built-in resource types like SpriteFrames, it's possible to make them local to the scene they're used in, so that they're stored in the .tscn
file as a sub_resource
. Similarly for GDScript: it's possible to make a "built-in script" where the script text is stored as a sub_resource
in the scene file. In both cases, duplicating the scene also naturally duplicates the embedded resources: there is no surprising-to-newcomers linkage between the two.
It would be great if it were possible to do the same thing for dialogue: store it directly in the scene file. While this would be bad for reuse, and bad for editing in an external editor, etc. etc., it would be really great for our use-case of template scenes. (Having duplicated the scene, the level designer might later choose to save their implicitly-duplicated dialogue to a separate file; but the key point is that doing the simple thing would also be the right thing.)
Describe alternatives you've considered
We have a template-duplicating plugin that duplicates a folder containing a scene and various resources (including dialogue) and then rewrites the scene to reference the duplicates of each resource rather than the original. This is tedious to code, difficult to get right, and requires the learner to use Project → Tools → Create quest from template… rather than the really obvious "Scene → Save Scene As…" or right-click → "Duplicate" features that are built in.
Additional context
I don't actually know if this is possible 😄