#Load a new godot scene not present from compile

1 messages · Page 1 of 1 (latest)

glossy wing
#

This is mostly just for prototyping, but how would i add a godot scene for the game to launch at runtime (is that even possible?)

#

Load a new godot scene not present from compile

worldly vector
tacit reef
#

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

glossy wing
worldly vector
glossy wing
#

hmm interesting

glossy wing
#

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

worldly vector
#

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.

glossy wing
#

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

worldly vector
#

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

glossy wing
#

ah alr

#

so it is smart to not duplicate scene refs

#

yeah that works

#

thanks