Skip to content

ProjectSettings.load_resource_pack is completely useless / broken and DESPERATELY needs a rewrite / multiple fixes #96298

@JHDev2006

Description

@JHDev2006

Tested versions

  • reproducible in all godot 4 versions, unsure about godot 3

System information

Godot v4.4.dev1 - Windows 10.0.22631 - GLES3 (Compatibility) - NVIDIA GeForce RTX 3070 Ti (NVIDIA; 31.0.15.4592) - AMD Ryzen 7 5800X 8-Core Processor (16 Threads)

Issue description

Using ProjectSettings.load_resource_pack() to achieve any kind of mod / addon support is totally useless. When using ProjectSettings.load_resource_pack() in the editor builds, all res:// files and folders that were previously there are now completely vanished, when using DirAccess.get_directories_at() or DirAccess.get_files_at(), meaning that testing mods or custom assets cannot be tested at all in the editor, In addition, adding files on export also seems to just, not work? files cannot be read by DirAccess, however, assets can be loaded in when the files in the pck are hardcoded in? While atleast that works, its means that any kind of dynamic file scanning, is basically impossible, meaning things like custom levels, etc are not possible. In addition, replacing files also doesnt work, as it seems to be because some files are loaded in before the pck can replace them, meaning they cannot be replaced at all? this means that things such as autoloaded or scenes that are preloaded cannot be replaced, alongside all instantiated scenes and scripts in there too, and so on. which can be incredibly frustrating and limiting for modders. This is even more confusing considering that the ResourceLoader has a flag, which allows it to basically replace what is already loaded in, using the REFRESH flag. So hopefully being able to allow for resources which are already loaded into to be replaced, would be incredibly helpful as well. However so long as the DirAccess issue is fixed, then id be more than happy already! Since myself and many others seem to almost be mislead by how the function works and its many limitations, it makes me wonder why there hasnt been a note in the documentation, at least explaining or making users aware of its current limitations and problems, or even marking the function as experimental or deprecated would be appriciated. Sorry that was a bit too long of a rant, but ive tried various different methods to try and allow for the function to work, but even then it still doesnt work as advertised, and ive lost all hope.****

Steps to reproduce

  • make any file to be exported as a pck, using the standard pck only export method, with only the file being selected in the resources tab, can be a png, tres, tscn, whatever

  • load the file using ProjectSettings.load_resource_pack()

  • try to find the file in the res://, where the original file now in the pck was placed using DirAccess, and notice how its no longer there. Alongside the fact that various other files are also just missing aswell?

  • cry

Minimal reproduction project (MRP)

resource_pack_test.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions