Hello All,
2011-11-04:
bugfix
SaveLoader is compatible with BGE 2.49b AND BGE 2.5+ !
updated to 2.7
- Bugfix: Symptom: Missing objects after loading. Problem: Instances are not found in BGE 2.59+. Solution: Corrected name search
- corrected logmessage
updated to 2.6
- Bugfix: If a prepared Scene did not need to get restored the contained instance objects are not removed anymore.
updated to 2.5
- added makeSingleObject - it does not really belong to the saveLoad but it is necessary to remove any doublicate objects
- added clearAllStores to clear all stored storage.
updated to 2.4
- added autoload and reset
updated to 2.3
- now Python 3.0/BGE 2.5x compatible (remains 2.49 compatible)
- aliases for BGE callable methods for a better overview
- moved BGE callable methods to the top of the file
- some refactorings for reduced complexity
updated to 2.2
- Bugfix: local excluded are now usable when saving. (where ignored before)
- Parented objects will not become ghosts (as default).
- Add logic to identify armature objects. Children of this objects will not be reparented. It is not possible to do armature parenting or bone parenting while running the BGE.
Here you can find the old version SaveLoader 1.1
2010-06-25:
- updated to 2.1 - fixed a bug when loading parented objects.
- updated the demo file - Ctrl. saveLoad now refers to the script. For simple load save (with <L> and <S>) just append this object to your file.
after heavy work the new version 2.0 of the SaveLoader is ready for release.
There are some changes especially on the API, the file format and the internal storage.
The saved files are still pyhton scripts, but not compatible with 1.1.
The most important improvement is that it is possible to make savepoints and load them from another scene. I will explain how it works in a later post.
The SaveLoader has no dependencies to the controllerLib anymore. So only SaveLoad.py is needed.
You can find the module in the attached Demo:
It is a little portal demo. With the arrow keys the ship can be moved.
When colliding with a white sphere you can collect points.
When driving over the colored squares the scene switches to another scene saving the current scene state.
With <S> the current game state is saved to a file.
With <L> the saved game state is restored. If the current scene is not the current scene at save time, the loaded scene will be started.
With <0> you can reset the game back to start to by pass autoload.
Most important rule:
—> Never, never, never store or restore an object/scene within the same frame more than once <—
It is not possible to determine which one would be first.
The setup is quite simple. See the next posts for a small tutorial or check out this video tutorial. The important part starts at 01:55:
Update:
Added an auto load option (see SaveLoader.autoLoad).
Added a reset to default option (see SaveLoader.loadDefault) with <0>.
Renamed all Saveloader objects.
Required:
SaveLoad.master - carries the Python file and deals with preloaded storage (required)
Portal related:
SaveLoad.storePlayer - stores/restores the player object (previously called ship)
SaveLoad.storeScene - stores/restores the non-player objecs
Saving/Loading:
SaveLoad.manual - complete store/restore with <s>/<l>.
SaveLoad.autoLoad - complete restore of a saved game at startup.
SaveLoad.loadDefault - removes the complete storage and reloads the scene <0>.
SaveLoaderDemo.blend
or go to the last posts of this thread.
Have fun
Monster