-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It is currently impossible to test external package loading from within the editor #16798
Comments
I've actually ran into this issue. It seems there is a issue with the way the .pck file packs the assets. it will give free access to files but locks folders. check this #15801 |
PetePete1984 said in the discord that while load_resource_pack is undocumented it uses PackedData::add_path which is supposed to be additive, so it seems like it is indeed a bug, maybe in PackedData::add_path? |
I figured out what's causing this, the problem is that the ProjectSettings singleton sets DirAccess::make_default<DirAccessPack>(DirAccess::ACCESS_RESOURCES); Because it makes all newly created DirAccess instances be DirAccessPack it only loads from resource packs, and since we are running in the editor we don't really have a resource pack. load() doesn't use DirAccess, that's why it has no issues loading from both I am not sure how this can be tackled, if it even can, if I knew I would fix it myself. |
Might be useful to add that it works in export mode, where all access to files is through Packs; where it breaks is if you try to use both Packs and the filesystem, ie. in the editor. |
I originally proposed to use a hybrid of all three if we are using a mix, but I am not sure if there's a better way. |
If |
@eon-s The problem comes when mixing them both, once a package is loaded |
When adding a directory path to the inventory of the pack, an empty file name was being added to the file list. That made `Directory.get_ntext()` signal end-of-list too early so that files in a subdirectory were missed. Fixes godotengine#15801. Helps with godotengine#16798.
I have changed the title to a more descriptive one |
When adding a directory path to the inventory of the pack, an empty file name was being added to the file list. That made `Directory.get_ntext()` signal end-of-list too early so that files in a subdirectory were missed. Fixes godotengine#15801. Helps with godotengine#16798.
@EIREXE Can you still reproduce this bug in Godot 3.2.1 or 3.2.2beta4? |
Yes, this is still an issue, the engine's design still has this problem. DirAccess still doesn't allow for mixed loading from PCK and editor FS. |
Still a problem with Godot 3.2.3 and 3.2.2 from what I found. I made a minimal test case to report it as bug, before I found this issue. func _ready():
var packer = PCKPacker.new();
packer.pck_start("res://pack.pck");
packer.flush(true);
ProjectSettings.load_resource_pack("pack.pck")
var dir = Directory.new()
assert(dir.open("res://dir") == OK, "Could not open the folder 'dir'.") |
Godot version: 3.0 Release
OS/device including version: Windows
Issue description:
When loading resource packs using ProjectSettings.load_resource_pack one would assume the content from the resource pack is added to the virtual filesystem, this does work but it also breaks other things, I now present three cases.
In each of the following cases the pck has a folder structure of Content/ModTest and two files in that folder, modtest.png and project.json, modtest.png is a picture of Godette and project.json is some text data.
The game itself has two folders inside the Content folder, BaseContent and TestContent.
1st case: Directly loading resource using load(): This works exactly as expected, no issues about it.
2nd case: Iterating a directory using Directory.list_dir: It doesn't work, only the files and folders from the newly loaded pck file seem to be found, this is my method:
In this case only ModTest is found, this doesn't seem right to me.
Output when ProjectSettings.load_resource_pack is used:
ModTest
Output when it's not used:
3rd case: trying to find files using the file browser: This only seems to find the game's base content, but none of the newly loaded pck content.
I have also tried removing the project configuration from the package, it doesn't change anything.
The text was updated successfully, but these errors were encountered: