-
-
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
Issues with ProjectSettings.load_resource_pack(pack) when running the project from the editor #19815
Comments
You cannot use directory with resource packs, files are there but the virtual filesystem lose references. See #7845. |
I already checked this. The files aren't there unless I load the game's main .pck over top of itself, and even the global Presume my main game pack (let's say # No `ProjectSettings.load_resource_pack("current_pack.pck")` here!
ProjectSettings.load_resource_pack("other_pack.pck") Then attempting to ProjectSettings.load_resource_pack("current_pack.pck") At which point |
#16798 seems to be the closest to what issue I'm having. Though |
It's been nearly a month since anything was done with this issue. Is it being marked as a bug? Or should I close it? |
Patience, some issues can be stalled longer and devs are now doing checks and tagging, etc. before alpha. |
I am up against the same hurdle. Anyone found a way round? I would like to have a menu/init scene at the root and then offer various scenes that can be downloaded as a zip from a server. I got everything set and can download, save in user:// etc. However once I do a load_resource_pack it overwrites the menu/init, so no way to go back to it again! Any suggestions/work arounds or any update on fixes? By the way, great engine, I keep finding new things that have a lot of thought behind them. It constantly surprises me with how well planned it is overall. Thanks |
Don't mean to answer my own question but I found a way round for now. Not great but seem to work.
So essentially I could cycle between the menu and various loadable packs. However this probably won't let me use a single globals file for singletons. I guess one can store the necessary global data to user://transition_file and reload it on change. Thanks |
So I tested this today with a build of the master branch, and while the issue I described seems to occur when running a project from the editor... running an exported version of the project (I used However, this still leaves the issue of why it happens when running the project from the editor. I'm surprised (and admittedly, feel a little stupid) that I didn't think of trying an exported version before I made this issue -- or at any point before now. |
I know this is a late reply, but the reason why this works is that godot has no problem loading multiple pcks, the problem comes when you mix the editor filesystem type and pcks, that's when pcks replace the tree. |
Can anyone still reproduce this bug in Godot 3.2.3 or any later release? If yes, please ensure that an up-to-date Minimal Reproduction Project (MRP) is included in this report (a MRP is a zipped Godot project with the minimal elements necessary to reliably trigger the bug). You can upload ZIP files in an issue comment with a drag and drop. |
It's not really a bug, it's a design problem, it's still present in 3.2.3 |
Issue is still present in 3.5.stable.mono. I'm wrinting an RPG game with a few GBs of resources already. I expect much more. Currently, everything is present under a single folder. Since I'm the sole dev, from time to time I'm rewriting and remaking sizeable chunks of things. But, at the same time, some resources are fine as they are and I would like to prevent them from being reimported or changed by mistake, to not lose time. I just had a thought, why not simply pack some of my Item or Monster resources (just textures, models and sounds) into standalone PCKs, remove from res:// and load on startup? So almost like NuGet packages, but with resources. Then boom - a single PCK, when loading from editor, made stuff in my main res:// structure unavailable. Well, I know it works if exported game, but it prevents development within the editor. Mind you, I don't need the resources to even be accessible IN the editor itself, I just need everything to be accessible from a game started in editor, as I have most things defined in JSON (so, for example, monsters.json defines a monster script and specifies resource paths). The scenarios this allows are:
Of course, if one had access to resources in the packs from editor itself, it would be even better! |
Actually, it seems mono version can deal with this easily! You just have to use .NET Framework's System.IO types (File and Directory) instead of Godot's, whenever you're running an editor build. For example, if I wanted to scan for my json files after loading a PCK in editor build, I'd get nothing. But it works if I just do this:
Works like a charm and now I can start moving most of my stuff to immutable PCKs. Great! |
I'm also seeing this issue. I'd recommend that this be called out in the documentation such as:
As it's unclear from the docs about this behavior. Is there any workaround for this to make it work in the editor? I'm trying to add mod loading to my game, and needing to do a full compile of the game to test each step would get painful. |
Godot version:
v3.0.4 stable + PR 19708 (because it fixes my touchscreen issues)
OS/device including version:
Surface Pro 4, running Windows 10 Home v1709 (Fall Creator's Update)
Issue description:
ProjectSettings.load_resource_pack('pack.pck')
seems to replace the entireres://
structure rather than add to it upon its first use (edit: only when running from the editor; see comment for details). After the first use, any new loads will add to the current file list.To give you some examples (presume
current_pack.pck
is the game's main file pack):In order to still have access to my main pack's files, I have to load my game's pck first:
I would expect to be able to use
ProjectSettings.load_resource_pack("other_pack.pck")
alone and still have access to the files fromcurrent_pack.pck
, without needing to loadcurrent_pack.pck
over itself.Steps to reproduce:
N/A, though here is some code you can use to check the
res://
structure after loading:Minimal reproduction project:
N/A (you can use the demo project repository for this -- just export a couple or five to .pck files and replace
current_pack.pck
andother_pack.pck
in the script above with appropriate paths)The text was updated successfully, but these errors were encountered: