Question !

I need help with connecting my blender game to a data base to use the user’s same information that is needed to be saved to accomplish my goal in my game !
can any one please explain it to me in details because i search for it many times and i didn’t understand !?
Thanks in advance :slight_smile:

You can define libraries in Python and save and load their contents. Is that what you’re asking, or are you talking about networking?

Save huh. There are many ways to save information. My favourite is… a text file. Python has some nifty functions for that and I have some code snippets over in the resources section.

But you do need to know python to be able to do it.

@magnum am talking about saving the information of the user so that if he enter the game again he will find his information saved !
are these libraries permanent !? if so can you give me links to help define them please ?

@sdfgeoff i know python but i never used it for data base that’s why am asking
text file ! will the data be saved permanently ? if so can give some links to learn this way !
and where are the resources section that you are talking about !?

am asking about saving the information of the user by SQL or anything that allow him to find his information any time he open the game !

are these libraries permanent !? do you have any link to help me !?

OK, in python it’s called a dictionary. Here it is in the api:

http://www.blender.org/documentation/blender_python_api_2_61_0/bge.logic.html?highlight=global%20dict#bge.logic.globalDict

So you have whatever variables you need (player position, health, inventory) in dictionaries, and you can use a logic brick or script to save the dictionary. Then when you want to load the data, another logic brick or script can load the dictionary, but then you also need a script to get the values from the dictionary and apply them to the objects you want to load.

For example, you could have a save script that when you press a save button, the script gets the player position and saves that vector to a “Player” dictionary. Then you can make a load script for when you press a load button, the script loads the “Player” dictionary, and then sets the player position to the vector saved in the dictionary.