Here are the instructions (there simpler then they look):
Follow steps 1 and 2 for every object you want to save!
step 1:
Attach the GlobalOB2.py script to an always sensor set to run only once and add a str property named “Props”.
Now lets say you have 2 properties on that object you wan’t to save, one called “HP” and an other called “Ammo”. To save them you need to give the property you just created called “Props” the value [“HP”,“Ammo”]. Let’s say you had another property called “Weapon” to save it also you just have to add it like this [“HP”,“Ammo”,“Weapon”] do you get how it works?
It doesn’t matter what order you put them in.
If you don’t wan’t it to save any properties, only the position and orientation give “Props” the value []
step 2:
Open the script SaveLoad2.py in the script window and set the name of the save file you want:
filename = "namehere.save"
step 3:
Now to save and load the game choose an object to attach the SaveLoad2.py script with an always sensor.
Give the object two int properties one called “Save” and an other called “Load”.
Whenever the property “Save” equals 1 the script will save the game.
Whenever the property “Load” equals 1 the script will load the game.
You could set up logic bricks so “Save” equals 1 when you press “s” and “Load” equals 1 when you press “l”
It doesn’t matter how you make “Save” and “Load” equal 1.
Now save your game and it should work fine.
If you were running it inside blender the savefile will be wherever blender is located. If you were running an exe of your game it will be wherever the exe is.
Please tell me if these instructions are clear or if they are too hard to follow.
On linux it still seems to want to use my 2.2 python instead of the 2.0.1 python I really dont have any idea how to fix this! I can import os and everything just not cPickle…
I can’t download your script cos its still offline, but it sounds interresting. I’ve already written my own savegame script which works in a similar way, except it uses a lot of global variables in python.
But the thing I really like about mine is that it encodes the savegame data so that players can’t cheat by editing it!
Lookin forward 2 havin a look at your script if/when you get it back online again.