This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

As the .pck file gets very big when I export my project to HTLM5 and takes a long time to load when integrated into a website, I decided to export several .pck files dividing the scenes, instead of exporting the entire game to a .pck file. So I published it on the website with an html file and several .pck.
I am trying to load the level2 .pck files for example, while executing level1 using "ProjectSettings.loadresourcepack (" res: //PCK/KitMission.pck ")"
to load the .pck at runtime, but it's not working. When I run the game on a web page and reach level 2, which should have been loaded on level 1, it says that it was not possible to load the scene

in Engine by (35 points)

load_resource_pack returns true on success. What does it return in your case? Also be aware that res:// in an exported project refers to the *.pck-file, i.e. you're trying to load a package within the main package. If you want to separate them, use user:// instead (and place the *.pck-files in the appropriate location).

1 Answer

+1 vote

Kindly save your pack to user folder like file.open("user://pack1.pck",File.write)
and then do the below

ProjectSettings.loadresourcepack ("user://pack1.pck");
then you load your scenes based on godot virtual url. like below
gettree().changescene("res://scenes/sceneunpackedfrompack1.tscn");

by (28 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.