#Load a new godot scene not present from compile
1 messages · Page 1 of 1 (latest)
What you want is likely along the lines of this: https://docs.godotengine.org/en/stable/tutorials/export/exporting_pcks.html
Using pck files, you can load a file into godot at runtime.
Use cases: Oftentimes one would like to add functionality to one's game after it has been deployed. Examples of this include... Downloadable Content: the ability to add features and content to one'...
For testing you should just be able to use load() normally with a system file path instead of a res:// path
Godot doesn't add any restrictions, you can access any files the OS will allow you to
so what i understand from this... the godot .exe is just a glorified launcher and the .pck file is the actual game (scripts, assets, structure, etc)?
It can read it all from a pck file, but it doesn't need to. It's just a more efficient way of packing it. But yes, I don't think there's any of your game stored inside the exe, it reads it all from other files. (Though it is a bit more than just a launcher. The entire engine itself that the game runs on is built into the exe.)
hmm interesting
hmm
so what if there's a resource used in the map file that's included in the main .pck, will godot use the main .pck or the map .pck?
IE like
enemy defined in main.pck, map uses an instance of the enemy in its .pck
does the map file contain the enemy (materials, models, scripts, etc) in the .pck
It's not a feature that I've used myself, but I believe you can choose. When you're exporting a pck file, you pick which resources you want to include:
If both contain a copy of the resource, it defaults to replacing it with the ones from the most recent pck, but there's an argument you can set to change this behaviour when you're loading the pck.
i'm trying to do it from the stance of space efficiency, i dont need the level file to store model data, etc on a pack that already exists. is there a way to trim this?
i dont want multiple level files to store model data, code, etc of* the same enemy ^^;
(if possible)
although tbh i could just use enemy spawners
or rather node spawners
Unless you're using it for patches, dlc, etc., you'll likely only have the one pck file, and Godot is smart enough to only store one copy unless you explicitly tell it to store more copies of a resource. A pck file is kind of like a zip, containing all of the game's resources.
And if you do plan on having more than one, you can use the menu I screenshotted above to tell it which ones to include. If you don't include them, it will still know to look for enemy.gd or whatever, it just won't have a copy of them stored. There's details here https://docs.godotengine.org/en/stable/tutorials/export/exporting_projects.html and here https://docs.godotengine.org/en/stable/tutorials/export/exporting_pcks.html
Why export?: Originally, Godot did not have any means to export projects. The developers would compile the proper binaries and build the packages for each platform manually. When more developers (a...
Use cases: Oftentimes one would like to add functionality to one's game after it has been deployed. Examples of this include... Downloadable Content: the ability to add features and content to one'...