I’m wondering if it is possible to save and load objects added during runtime in UPBGE 3.0. Using the “Save Game” node saves the positions and names of all objects in the scene, including ones added during runtime. However, using the “Load Game” node only sets the positions of objects already in the scene- it does not respawn objects added at runtime. What’s the best way to go about doing this? I’m interested in creating a level editor but currently have no way of loading created levels since it uses objects added at runtime. Any help is much appreciated!
Here is an example scene if you’d like to see what I’m talking about. WASD moves the cube, Spacebar adds an object, Left Bracket saves, and Right Bracket loads, but you’ll see loading the game does not respawn added objects after restarting it. (Uses UPBGE 3.0, the Save/Load function does not appear to be working in the latest release) saveloadtest.blend (947.0 KB)
Write your own save/load script or look at mine and see hoe i’ve done it, for upbge higher then 2.5 you need to alter stuff, and better use bpy code to make it even faster.
In UPBGE 0.3 and higher it will only save the current Scene. To make it work to save all scenes you would have to modify the script to use some bpy code as Cotak mentioned.