Way to save textNumbers and variables in .sav file?

Talk about making games.

Way to save textNumbers and variables in .sav file?

Postby bat78 » Sat Mar 23, 2013 9:46 pm

Hello, it wasn't explained so far a bit more clean, so i was wondering does someone know, how i can save my own variable's values and textNumbers values.
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: Way to save textNumbers and variables in .sav file?

Postby MrJolteon » Sun Mar 24, 2013 10:57 am

You can do it with saveVars.
*Waits for someone to come with a much better way to do it.*
Join us on Discord!
Game Editor 2
These are the best ways to reach me these days


Your local Community Janitor, always lurking in the shadows...
User avatar
MrJolteon
 
Posts: 2326
Joined: Sat Aug 09, 2008 3:25 pm
Location: Stranded under endless sky
Score: 105 Give a positive score

Re: Way to save textNumbers and variables in .sav file?

Postby bat78 » Sun Mar 24, 2013 12:36 pm

I Know right this command, but not sure how to use it. Do not know the syntax. And does i have to define the text Numbers like variables?
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: Way to save textNumbers and variables in .sav file?

Postby skydereign » Sun Mar 24, 2013 6:07 pm

bat78 wrote:And does i have to define the text Numbers like variables?

You can't save textNumbers directly, so you need to create variables for them anyway. You should be doing this already, as relying on textNumber is a bad idea. As for the syntax of saveVars, you can search it on this page. http://game-editor.com/docs/script_reference.htm
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Way to save textNumbers and variables in .sav file?

Postby bat78 » Sun Mar 24, 2013 10:09 pm

well, i just declared the number like a variable and i made it to auto save/load the numbers and the amount of actor's xvelocity. I had to think a little.
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: Way to save textNumbers and variables in .sav file?

Postby Hblade » Mon Mar 25, 2013 3:02 am

you can use the FILE method like so:
Code: Select all
void SaveInfo(char*FNAME)
{
    FILE* file=fopen(FNAME, "wr");
    if(file!=NULL)
    {
        fprintf(file, "First text here, use %d to make a var", var1);
    }
    fclose(file);
}




Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Way to save textNumbers and variables in .sav file?

Postby bat78 » Mon Mar 25, 2013 7:48 am

Looks Complicated a bit. I am not sure but:
Code: Select all
void SaveInfo(char*FNAME) <- custom function accepting 2 parameters?
{
    FILE* file=fopen(FNAME, "wr"); <- does i have to point the file name using fname first, must be relative to game directory too?
    if(file!=NULL) <- does ! is operator for  "Is NOT"
    {
        fprintf(file, "First text here, use %d to make a var", var1); -> does fprintf, fclose, fname.. adds "f" with will mean format?
    }
    fclose(file);
}


It gives me two errors:
Code: Select all
Error line 2: Illegal function definition in ex213744816069441
Error line 10: Expected ;
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: Way to save textNumbers and variables in .sav file?

Postby Hblade » Mon Mar 25, 2013 8:04 am

yes it stands of is not, and on FILE * you can replace "FNAME" with what ever you want for the file extention, example: "MySomething.file" with quotes :)
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Way to save textNumbers and variables in .sav file?

Postby bat78 » Mon Mar 25, 2013 8:19 am

Can u give me an example, using custom names already, it keeps return me those errors.
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: Way to save textNumbers and variables in .sav file?

Postby Hblade » Mon Mar 25, 2013 6:04 pm

look at AME (advanced Map Editor) or SME
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Way to save textNumbers and variables in .sav file?

Postby bat78 » Mon Mar 25, 2013 7:09 pm

Only completely silly person that don't spend decent time on game-editor wouldn't understand the saving for that time, thanks :D :p
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: Way to save textNumbers and variables in .sav file?

Postby lcl » Mon Mar 25, 2013 7:45 pm

bat78 wrote:Only completely silly person that don't spend decent time on game-editor wouldn't understand the saving for that time, thanks :D :p

That was irony I presume? :lol:
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Way to save textNumbers and variables in .sav file?

Postby bat78 » Mon Mar 25, 2013 8:10 pm

lmao It's a matter fact yea! :lol:
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: Way to save textNumbers and variables in .sav file?

Postby Hblade » Tue Mar 26, 2013 11:15 pm

lol sorry
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest