Hi! i was wondering if there is a way to save your game and then load it later. what i mean is if you create a game is there a way for who ever plays the game to save it, exit the progam, comback later,and load your game, and continue from where that person saved?
You can save object properties with python, you can also use a method called pickling to save an object. There are a few tutorials in the tutorials section, but mostly you will need to learn python. One method would be to save the scene you were last in and the object properties of that scene, then read them back in and open to that scene and assign the saved values to the objects of the scene. You may also need to save position, etc. On a simpler system, save the level that person was at and have them return to the level at startup. In that case they would have to start the level over.
As fireside said;
Saving a game at any given instance will require a certain level of python. You would need a script to create a “state file”, which would contain all the objects properties (within a certain instance).
Although you can implement a “password system” which is much simpler, and requires no external “state file”.
A password system will work good for games that are broken into levels (such as puzzlers), but for more open-ended adventure games, you’d need the Python mentioned.
How would i make it so you save,then start at the beginning of the level. and is there a way to just save the main charactors property?
Because in the game im making is going to be fairly long, and the main charactor has to collect weapons, ammo, health, and natiral resorsces to power equipment. If i just save the main charactors property would the value remain?
P.S. where would i lern what i need to know about python to do this?
here is a .blend and it allows you to save exit then load the game back and load it again.
here you go bud have fun!
http://depositfiles.com/files/142612/SaveloadSkript.blend.html
Thankyou but i dont think it works for some reason or i dont know how to use it correctly. Could you give some instructions to the .blend please?
yea sure i think its S to save and L to load
I have a Save and load example file in my signature, click the link in my sig. The file is called S-L.blend.zip I believe.
Without some knowledge of python, these things will confuse you more than help you. You need a python tutorial. There are many good ones on the web. You will be able to use it to improve your game writing, save games, and all round be a better person;). There are all kinds of people that want a quick script, and they end up not getting anywhere. Take some time, go through a tutorial, then ask questions and you’ll be able to understand the help your being offered.
do you know any good, solid tutorials for python?
There’s the non-programmers tutorial. It will get you through the things you need pretty fast. It doesn’t cover handling objects, but that’s pretty easy and really just involves the naming the object, putting a period, and naming a function or property.
http://honors.montana.edu/~jjc/easytut/easytut/
It’s important to type in all the examples for any tutorial and actually run the scripts. The temptation is to think that you don’t need to do that.
Alternatively, you can start with a byte of python:
That gives me an idea;
What do you think about a tutorial that uses all the python examples to do something significant in the BGE. That way individuals could learn not only python, but also how to use it with the BGE py API.
I know it seems redundant to you and me, but I bet there are alot of beginners who would kill for such a “unifying” tutorial.
yea that would be cool
I think ogre has such a feature
social:Great idea
What do you think about a tutorial that uses all the python examples to do something significant in the BGE. That way individuals could learn not only python, but also how to use it with the BGE py API.
I think it’s a great idea. One advantage would be that a person also gets used to debugging in Blender. Otherwise, they usually end up using some python IDE and then have to get used to using Blender’s console. They would also get more used to the Blender game objects at the same time. The problem, of course, is getting around to writing something like that.
do you know any good, solid tutorials for python?
a good one covers the basics
http://blenderartists.org/forum/showthread.php?t=70294
thanks for all the python tutitorials. they are really helping.