SaveLoad V.2 - Save and Load your Game in Blender Game Engine

MRN, all you have to do is have a script that is running on the items you spawn so it can look up and asign Variables to what you want saved. I would wright it myself instead of trying some other persons script/‘work’ trying to make it do exactly what you want it to. I would make “Classes” for the items and the Types you want to spawn and keep. Like Weapons would be at the top of the list braking into more Classes with different Damage and speed Variables.
So if you drop a Item you’d want to save it’s Rotation, Location, and if it was moving. So that would be X,Y,Z. in a # value for each making a total of 9 Variables for each item you want to reload in a Level or scene.

It only worked once. When I play my game it will always go back to the only time the save worked. Now, even if I save, it’ll jump back to that same time when I play it.

Do you think it would be possible if you could add a way to save object color?

Given that you change that using Python / logic bricks, why not control this via a property, and save that property using the saveload script?

Added save support to logic state, removed something with life conversion to seconds.

hi there , so i wass wundring if you can make a save system that can save game levels "position rootion and ect on moultepll blocks , like ps, or xbox game,s it,ll be awesome if you did it

now i not remember the old code , :mad::slight_smile:
about the new and about the style , ok, the code must be readable first of all i agree with that, and low “LOC” is not an enemy of that, at the inverse.(this depend also from the skill of the reader)
ideally each line should be more “heavy” as possible (without become unreadable)
in my opinion “LOC” is a pretty good tool (not in absolute of course)

if a code is complex it still complex in all case.
in the worse case become a giant mess, in the best still complex , you agree?
try to write the same code, one condensed(but readable) and one not condensed , then see what is the more readable/easy.

you new code

it give error at line 115, since attempt to assign a float or None ,

  1. obj = scene.addObject(reference, spawn_point, obj_life)

solved with this:
obj = scene.addObject(reference, spawn_point, int(0 if obj_life is None else obj_life))

i use 2.74 (i suppose in a more recent version not give this error)

then there any support for the parent/children?
if a obj change parent and is saved , then do mess when loaded.

there are many case anyway that i think are not solvable, i not know if worth really try to “save all” …

PS: this was surely avoidable
from mathutils import Quaternion
:stuck_out_tongue:

Thanks bro I owe you (please don’t quote this)!!!

Thank you, agoose77. Thanks for updating the script, now it saves the objects added in the scene.

What’s the license, if I can ask?

i wonder if this works with a game made with upbge 0.3.0??