Page 1 of 2

How to save datas with your own name?

PostPosted: Mon Dec 17, 2007 2:29 pm
by regine
I want to save some variables in an data, for that you can make your own name and i want to have a function where you can enter the name of this data to reload the vars again.

Re: How to save datas with your own name?

PostPosted: Mon Dec 17, 2007 2:44 pm
by Kalladdolf
when you create or edit a variable, there is a button that says "save group".
you click on it and write a name of a group you'd like to save it in.
then when you want to save a variable, in script editor pick the function "saveVars".
then you get to pick which group to save and in which file.
just enter a filename (for example: "variables").
then it will (when the action is executed) create a file (in the same folder as the game) called "variables.dat".
all the variables in this specific group are saved there.
to load the variables, just pick loadVars and pick which group to reload.
don't forget: the .dat file is in the same folder as the game.

hope this helps

Re: How to save datas with your own name?

PostPosted: Mon Dec 17, 2007 2:46 pm
by regine
Yes, i know, but i want that the user can make a own name for the data it saves.

Re: How to save datas with your own name?

PostPosted: Mon Dec 17, 2007 2:48 pm
by Kalladdolf
yeah, like I said: name it like you want...
it can be "variables.dat", or "regine.dat"...
doesn't matter.

Re: How to save datas with your own name?

PostPosted: Mon Dec 17, 2007 2:51 pm
by regine
no i want something like this:

Example:

User1 wants to save it with the name blabla.dat
User2 wants to save it with the name hello and goodbye.dat
Then the game saves the data from user 1 under the name blabla
and for user2 it saves it with the name hello and goodbye

do you understand now?

i mean that the user can enter a name for the data inside of the game, so that he dont needs to change the script of the game.

Re: How to save datas with your own name?

PostPosted: Mon Dec 17, 2007 3:00 pm
by Kalladdolf
so you don't want to enter the data name while programming with GE, but when u are running your GE-made program?

Re: How to save datas with your own name?

PostPosted: Mon Dec 17, 2007 3:02 pm
by regine
yes

Re: How to save datas with your own name?

PostPosted: Mon Dec 17, 2007 3:08 pm
by Kalladdolf
first create a textbox, name it textbox1 (or how u want)
then when it comes to save the vars:
Code: Select all
saveVars(textbox1.text, "myvars");

"myvars" is just the save group.

Re: How to save datas with your own name?

PostPosted: Mon Dec 17, 2007 3:09 pm
by regine
ok i will try it

thank you very much

Re: How to save datas with your own name?

PostPosted: Mon Dec 17, 2007 3:12 pm
by Kalladdolf
no problem.
looks like you want to make your game run with user accounts and stuff?

Re: How to save datas with your own name?

PostPosted: Mon Dec 17, 2007 3:19 pm
by regine
yes i want to do that, but it doesnt saves anything?
but since i installed Ge 1.3.9 many of my gamedatas dont save anything...

do you know a solution for that problem?

Edit: well, now i made a loading function and it works, but i cant find the data in the windows explorer, but it is important to find the data for me, because at the moment iam doing a level editor.

Re: How to save datas with your own name?

PostPosted: Mon Dec 17, 2007 3:31 pm
by Kalladdolf
regine wrote:but since i installed Ge 1.3.9 many of my gamedatas dont save anything...

well, one problem could be, that the file wasn't named correctly in the script editor...
but that sounds odd... maybe there's some bug?
do you think it really it is because of the version 1.3.9?

regine wrote:but i cant find the data in the windows explorer.

huh?
funny... I tried it and it works...
it's always in the same folder as the game file.
but it works correctly? well, that makes sure there is no bug in your code.
did you overwrite something or hidden all the .dat files?
(crazy, but it can happen)

Re: How to save datas with your own name?

PostPosted: Mon Dec 17, 2007 3:33 pm
by regine
No, i didnt overwrite something and i didnt hid the .dat files

Re: How to save datas with your own name?

PostPosted: Mon Dec 17, 2007 3:40 pm
by Kalladdolf
that sounds very, really weird.
just like I said with me it works
(you know, before I post codes, I test them on my test.ged)

Re: How to save datas with your own name?

PostPosted: Mon Dec 17, 2007 3:50 pm
by regine
Now, i made some tests more, and the load function always loads the last level i made with this editor, whatever i type into the field.

If i would send you the data, could you look at it? But it will be in German language.