-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Hello! Sorry if this is a bother, I don't... generally do feature requests, but as you'll see my attempt to make something PRable is a bit lacking. (I did try, though.)
Adding new content or changing existing content in the world in Cassette Beasts is extremely awkward presently.
The 'mod concept' that caused this request involved nudging an existing NPC out of the way of a door and installing a new entrance. While I know how to do this, it was on behalf of someone very new to Godot, and jumping into GDScript for relatively simple changes added a lot of complexity.
With this in mind, I'm suggesting a scene patching system based on chaining inherited scenes.
I have a prototype of what I'm thinking of at https://github.com/20kdc/CassetteBeasts-modutils/tree/scene-patching-test .
However, there are a few practical issues that make it hard to PR:
- Keeping all scenes that need modifying loaded at all times is probably not a good idea.
- My current API isn't really fleshed out.
- The patch order resolution hasn't been properly tested. It's been tested enough to confirm that the idea of "rebasing" a patch onto another patch works, but I'm not sure if there are any big scary things to worry about.
- Sometimes Godot will attempt to include nodes that shouldn't really be being changed.
It might be an idea to instead go with a workflow where a scene patch has a root of a custom node type, which manipulates the scene after construction (so it can use the existing hooks). (The issues with using class_name only matter for references from GDScript. Resources always use the file paths.)
This custom node type could use a tool script to spawn the original scene as a positioning aid, along with using, a 'virtual node tree' to hold new content and to accept trivial repositions (if the virtual node and target are, say, Spatial)
The problem with this is that unlike the inherited scene approach, it's the sort of thing where I'd really want confirmation from upstream as to how exactly to go about the fine details before something happens that can't be undone without breaking API compatibility down the road.