How to save game on computer?

Talk about making games.

How to save game on computer?

Postby Sondise » Sat Dec 22, 2007 6:19 pm

How to save game on computer? I need it because my game has 82 levels ( :shock: ).
User avatar
Sondise
 
Posts: 94
Joined: Thu Nov 01, 2007 11:04 pm
Location: South america
Score: 0 Give a positive score

Re: How to save game on computer?

Postby asmodeus » Sun Dec 23, 2007 1:57 pm

Either you use variables that you save in groups (screenshot) and use the loadVars() and saveVars() functions or you use a file.
Attachments
screenshot.png
User avatar
asmodeus
 
Posts: 483
Joined: Thu Oct 11, 2007 5:04 pm
Location: Germany
Score: 43 Give a positive score

Re: How to save game on computer?

Postby Sondise » Sun Dec 23, 2007 3:45 pm

i didn't understand. Could explain better please? :mrgreen:
User avatar
Sondise
 
Posts: 94
Joined: Thu Nov 01, 2007 11:04 pm
Location: South america
Score: 0 Give a positive score

Re: How to save game on computer?

Postby Spidy » Sun Dec 23, 2007 4:41 pm

asmodeus wrote:Either you use variables that you save in groups (screenshot) and use the loadVars() and saveVars() functions or you use a file.


he is not saying that he said mean i reach in level 13 than i saved the game then i close it then again i run the game and load the game
Image
VOTE FOR MY SIGNATURE PLEASE.......THANK YOU
User avatar
Spidy
 
Posts: 935
Joined: Tue Aug 14, 2007 1:28 pm
Location: http://www.inatonibai.com
Score: 38 Give a positive score

Re: How to save game on computer?

Postby asmodeus » Sun Dec 23, 2007 5:09 pm

If you want to save in which stage you are, create a variable and call it stage. Save it in a group and call it mygroup.
If you are in stage 1, set the variable to 1.
Code: Select all
stage = 1;

If you want to save it use this code:
Code: Select all
saveVars("myfile", "mygroup");

You can write any name instead of myfile. To load the variable use this code:
Code: Select all
loadVars("myfile", "mygroup");

I hope this helps. :D
User avatar
asmodeus
 
Posts: 483
Joined: Thu Oct 11, 2007 5:04 pm
Location: Germany
Score: 43 Give a positive score

Re: How to save game on computer?

Postby Sondise » Sun Dec 23, 2007 6:32 pm

Ok, but how can I explain to the program, the variable number (1, 2,...)
User avatar
Sondise
 
Posts: 94
Joined: Thu Nov 01, 2007 11:04 pm
Location: South america
Score: 0 Give a positive score

Re: How to save game on computer?

Postby Letchford » Sun Dec 23, 2007 10:20 pm

It loads them and there values. Not just the variables! So when you load a variable it is loading the value too! :D
Image
Letchford
 
Posts: 34
Joined: Mon Jun 18, 2007 4:13 am
Score: 2 Give a positive score

Re: How to save game on computer?

Postby Sondise » Sun Dec 23, 2007 10:47 pm

What's "myfile"?
User avatar
Sondise
 
Posts: 94
Joined: Thu Nov 01, 2007 11:04 pm
Location: South america
Score: 0 Give a positive score

Re: How to save game on computer?

Postby Spidy » Mon Dec 24, 2007 8:06 am

Sondise wrote:What's "myfile"?

put there your stage file.
Image
VOTE FOR MY SIGNATURE PLEASE.......THANK YOU
User avatar
Spidy
 
Posts: 935
Joined: Tue Aug 14, 2007 1:28 pm
Location: http://www.inatonibai.com
Score: 38 Give a positive score

Re: How to save game on computer?

Postby Sondise » Mon Dec 24, 2007 1:47 pm

Could anybody send me a demo, please, I'm not understanding! Please!
User avatar
Sondise
 
Posts: 94
Joined: Thu Nov 01, 2007 11:04 pm
Location: South america
Score: 0 Give a positive score

Re: How to save game on computer?

Postby makslane » Mon Dec 24, 2007 1:51 pm

Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: How to save game on computer?

Postby asmodeus » Mon Dec 24, 2007 2:02 pm

Here is an example.
Attachments
example.zip
(19.07 KiB) Downloaded 115 times
User avatar
asmodeus
 
Posts: 483
Joined: Thu Oct 11, 2007 5:04 pm
Location: Germany
Score: 43 Give a positive score

Re: How to save game on computer?

Postby Sondise » Mon Dec 24, 2007 4:59 pm

Yeah, but I wouldn't like to save the actor's positions, i'd like to save its progress in game, for example, in each level there's a crystal and a gem. If i catch the crystal, an actor who blocks the other level will be destroyed, if I close, I'll still have the crystal and the actor destroyed. If I catch the gem, I'll have the gem, and that's it. :?:
User avatar
Sondise
 
Posts: 94
Joined: Thu Nov 01, 2007 11:04 pm
Location: South america
Score: 0 Give a positive score

Re: How to save game on computer?

Postby Sondise » Mon Dec 24, 2007 5:02 pm

just, it, not the lives, or energy, just progress.
User avatar
Sondise
 
Posts: 94
Joined: Thu Nov 01, 2007 11:04 pm
Location: South america
Score: 0 Give a positive score

Re: How to save game on computer?

Postby asmodeus » Mon Dec 24, 2007 5:05 pm

Create a variable and call it got_diamond. If you caught the diamond, change the value to 1.
Code: Select all
got_diamond = 1;
saveVars(...);

If you start the game use this code:
Code: Select all
loadVars(...);
if(got_diamond==1) DestroyActor("diamond");
User avatar
asmodeus
 
Posts: 483
Joined: Thu Oct 11, 2007 5:04 pm
Location: Germany
Score: 43 Give a positive score

Next

Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron