Game Save

I tried posting this in the python forum but nobody responded. I am trying to find a way to be able to save my game. I’m going to have checkpoints in my game where when the player reaches one, it saves. Anyone? Help?

What about asking in the Q&A of the Blender Game Engine?

I would like to know this as well

There’s already an topic posted about saving a game. I thought someone has posted a python script about this. Just use the search page. :stuck_out_tongue:

Depending on how much you want to save, making save points can be very easy or quite complicated.

Looking for tutorials on python file I/O would be a good place to start. Then you have to decide what information needs saving, and work out a way to load it back from the file.

You mean like save propertys and positions??
And load propertys and positions
I wont to do that to but I am not getting the script to work.
(I dont have the script anny more My comp crashed :frowning: )

I found that script in the forum that you made. I records the position of the character. here it is
https://blenderartists.org/forum/viewtopic.php?t=14374&highlight=save+game

I also came up with an idea for making saved games, but Im not sure that blender supports it.

Ok here goes. The python script could save by export an excutable file of the game that has the position of the character were it left off. At the menu page the load button can load that certain exe, and your right back were you saved from.

I think this is a good idea. I might as well get started learning python and make a script that does this.But there might be problem making it, there aren’t any functions that support it. So you can think what you want I don’t know It’s just an idea.

heres one for saving properties

http://www.zerooneentertainment.org/blengine/blends/saveload.blend

hey blengine, very nice save and load information demo… i think its very useful

but is there a way to “lock” or hide the information. because if i made the saves a “highscore”, ppl would cheat and just change the text file. or ppl would change there ammo amount.

thanks if you or anyone else can think of something :smiley:

but is there a way to “lock” or hide the information. because if i made the saves a “highscore”, ppl would cheat and just change the text file. or ppl would change there ammo amount.

yeah, in the instructions i explained how you can change the extension of the save file to anything you want, like “highscore.sl” or somehting… good chances are people will just consider it as a file they cant open

if you want something more complex, im sure there you can make it in code somehow

I found that script in the forum that you made. I records the position of the character. here it is
https://blenderartists.org/forum/viewtopic.php?t=14374&highlight=save+game

I also came up with an idea for making saved games, but Im not sure that blender supports it.

Ok here goes. The python script could save by export an excutable file of the game that has the position of the character were it left off. At the menu page the load button can load that certain exe, and your right back were you saved from.

I think this is a good idea. I might as well get started learning python and make a script that does this.But there might be problem making it, there aren’t any functions that support it. So you can think what you want I don’t know It’s just an idea.[/quote]
Thx But I cant get it to load in real time :wink:

Does someone have a script to save pos and load pos?.
(I have one from someones web site but it doesent work :-? )

I found that script in the forum that you made. I records the position of the character. here it is
https://blenderartists.org/forum/viewtopic.php?t=14374&highlight=save+game

I also came up with an idea for making saved games, but Im not sure that blender supports it.

Ok here goes. The python script could save by export an excutable file of the game that has the position of the character were it left off. At the menu page the load button can load that certain exe, and your right back were you saved from.

I think this is a good idea. I might as well get started learning python and make a script that does this.But there might be problem making it, there aren’t any functions that support it. So you can think what you want I don’t know It’s just an idea.[/quote]
I dont know much about python aither but im learning .I have made some scripts :wink:

http://www.zerooneentertainment.org/blengine/blends/saveload.blend

here, check the blend again… it includes saving and loading position into the same script… read the instructions again, i added a lil section at the bottom

edit::
ok i threw in rotation saving/loading too, and changed the savefile extension to savefile.gxl to show you that any extension can be used

THX blengine Your the BEST!!!
:smiley: :smiley: .

Uh, blengine, there’s one problem. When I try to have the file saved it give this error int the console:

PYTHON SCRIPT ERROR:
Traceback (most recent call last):
     File: "saveme", line 23, in ?
AttributeError: pos

I have it so that when you press F2 it runs the saveme script.
The object running it is an empty which copies the player’s properties constantly.

It also gives this error when I try to load:

PYTHON SCRIPT ERROR:
Traceback (most recent call last):
    File: "loadonme", line 10, in ?
    File: "<string>", line 1
        GameLogic.Text =^

SyntaxError: invalid syntax

I got that to but I fixed it

In the script it says

 =="OBPlane":

That is the name of the object.(that have to be the name of the object)

I dont know much about it but something

Yeah, I changed it to my object’s name (OBArmature) and it’s still not working.

oh yeah, and when it writes the file, It writes it to my desktop, not my blender directory.

When you make it an .exe it workes