Open NightPotato opened 2 weeks ago
Blocking Resource.take_over_path() and adding an API endpoint would add more possibilities, like blocking some files from being overwritten and storing which ones were, so its possible to warn the user of mod collisions. Overall, I think this is the way to go about sandboxing mods.
If this was to get implemented then work to the inventory_component.tscn
would have to be done in order for us to use the Display Override
property as its currently limited to Scenes/Displays/
according to the wiki.
Is your feature request related to a problem? Please describe. Due top the nature of Godot and overwriting scripts if we have two mods
ModA
andModB
loaded. If they both contain a file calledutils.gd
then the last loaded script will be the contents ofutils.gd
.Describe the solution you'd like We could make each mod structure be like the following image. This structure would allow us to have two
utils.gd
scripts. We would need to implement a method of overwriting base game resources but this could be able to be done by using theResource.take_over_path()
method built into Godot.The full path within the runtime would be
res://mod_name/
which means that theutils.gd
script would be located atres://mod_name/scripts/utils.gd
. Fixing the overwrite issue.Additional context This structure can be used both in the mod project structure and implemented to the Mod Loader. This would also make having multiple mods within one godot project more efficient for the developers as we do not need to worry about the pathing in order to overwrite files. I will be commenting more about the
Resource.take_over_path()
method's usage shortly.This may implement a similar issue of
class_name
conflicts but those could be handle by having mod developers use prefixes forclass_name
likeclass_name pd_utils extends Node
. I will be looking into another change that could fix this issue as well.