SaveLoad 2.0!

Okay, here is my second attempt at creating an easy to use saving and loading script: SaveLoad 2.0!

Download the 2 scripts: http://user1.7host.com/rhapsody/Downloads/SaveLoad2.zip

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?
http://user1.7host.com/rhapsody/Properties.jpg
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 :slight_smile: or if they are too hard to follow. :frowning:

Oh… cool! :smiley:
I like this! I’m going to start experimenting with this script… it will be very useful… [that is… if I start doing my game…]
Great work!

BTW: hehehe, look at our avatars… anything… similar??? :slight_smile:

NICE!!!

This is really really helpful ^^, I just have to fix the damn cPickle …becuase its not importing --. Anyways, i really like it.

Its not to hard to follow, but maybe for a newbie you may need more images

Got it!!! I really am greatful for the work that you put in. It is the
beauty of collaboration that makes this community shine.

Great job Lagan, hopefully people can make some good use of it.

It’s nice to see everyone working together to bring the quality up overall.

:smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley:
YAHOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!
This is just what I’ve been waiting for!

Will somebody tell me how to use python? :frowning:

Thanks for your comments everyone!

This is really really helpful ^^, I just have to fix the damn cPickle …becuase its not importing --. Anyways, i really like it.

You have to have python installed and your python path set.

BTW: hehehe, look at our avatars… anything… similar???

Yes, I’ve noticed that I have. :stuck_out_tongue:

wwwwwwwwooooooooooooo!!! just what i needed! :smiley: :stuck_out_tongue: i’m going to try it right now! :stuck_out_tongue:

Great work! A very useful script! :smiley: :smiley:
I hope this will make it easier to implement this feature in future games…

anybody got it to work? i couldn’t :frowning: please help!!! LOL :smiley:

nevermind guys…i got it to work!!! i’m going to test it some more.cya! :stuck_out_tongue: :stuck_out_tongue: :stuck_out_tongue:

Oh my, Lagan…this is the best saving script i have seen so far and it’s so easy!!! thanx man,awesome work! :stuck_out_tongue: :smiley:

ps: is there any way i can save the “namehere.save” on the same folder as the game?

ps: is there any way i can save the “namehere.save” on the same folder as the game?

Make an executable of your game and it will. :slight_smile:

oh,ok!LOL thanx. :smiley:

Lagan its not that:

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…

Well thats strange, since I’m not useing linux I can’t help you there… :frowning:

I can´t download the script “SaveLoad 2.0”… “The page cannot be found”… How can I download?

Thank you

I can´t download the script “SaveLoad 2.0”… “The page cannot be found”… How can I download?

I’m updating the script right now and I will upload it as soon as possible!

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! :wink:

Lookin forward 2 havin a look at your script if/when you get it back online again.

Keith. 8)

You can get it here:
http://www.dazzled.com/lagan/downloads.html

But the thing I really like about mine is that it encodes the savegame data so that players can’t cheat by editing it!

You must tell me how! Please!
I guess my saveload script “encodes” it. (cPickle sortof scrambles the data…)