[ 5 posts ]  Reply to topicPost new topic 
Author Message
 [es]
 Post subject: Alternative for the save feature of GM
PostPosted: Sat Dec 25, 2010 5:39 am 
User avatar
I'm just a little adorable kitty :3
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

There's an alternative way to save your game without using the saving feature of GM or INI's?

_________________
Image ImageImageImageImageImageImage Image
~ Supernova / Drawerkirby (2) / Gato / Neweegee (2) (3) ~
"shy guys are wall plugs confirmed" - Vitiman on Club Saturn Ex
Image
 
Top
Offline 
 User page at mfgg.net
 
 [at]
 Post subject: Re: Alternative for the save feature of GM
PostPosted: Sat Dec 25, 2010 6:12 am 
Real horses don't run into trees
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
Think of your own file format and use GM's binary or text file functions to save and load to that.

e.g. if you have a metroidvania game and all you need to save is your current save room and the amount of coins you found, your file is saved like

Code:
file = file_bin_open_write(filename);
file_bin_write_byte(file,roomID);
file_bin_write_byte(file,coins);
file_bin_close(file);


and you load by extracting these values exactly the same way:

Code:
file = file_bin_open_read(filename);
roomID = file_bin_read_byte(file);
coins = file_bin_read_byte(file);
file_bin_close(file);

// And then you do stuff with the info you just retrieved, such as:
room_goto(roomID);


Code is made up on the spot, thus, no guarantee that it works, and it's only an example for using the gml file handling functions.

_________________
Guinea 2013 Reference (1) | 11 (1) | 10 (1) | 08/09 (1, 2)
 
Top
Offline 
 User page at mfgg.net
 
 [es]
 Post subject: Re: Alternative for the save feature of GM
PostPosted: Sat Dec 25, 2010 1:16 pm 
User avatar
I'm just a little adorable kitty :3
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

This will work with GM Lite?

_________________
Image ImageImageImageImageImageImage Image
~ Supernova / Drawerkirby (2) / Gato / Neweegee (2) (3) ~
"shy guys are wall plugs confirmed" - Vitiman on Club Saturn Ex
Image
 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Alternative for the save feature of GM
PostPosted: Sun Dec 26, 2010 7:17 pm 
User avatar
Your local psychic.
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

Well the Help file doesn't list a restriction on any of the binary file functions, so it looks like it will.

_________________
Zero Kirby, your local psychic. Check out my game reviews! Latest review: The Legend of Zelda: Breath of the Wild

Falcon Punch is the result of the Sun heating fists. It drives the Blue Falcon. Heating causes destruction of water into the pain, where it then hurts, creating rain. Rain creates flowing water in tears, which can then be converted into other forms through more pain.


scaled image
Mario's Sticker Stage - Finished adding Jump Stickers!, 26%
 
Top
Offline 
 User page at mfgg.net
 
 [at]
 Post subject: Re: Alternative for the save feature of GM
PostPosted: Sun Jan 02, 2011 6:36 am 
Real horses don't run into trees
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
Mason wrote:
Yoink. A question though. I have a game where certain enemies die and never come back when you leave the room (sounds bad but it isn't if you've played it) so should I have some variables like goombas_goombaway=8 or something? I don't see instance_number working with multiple rooms (but it would create the goombas_* variable) and they are persistent rooms.


Just saving the amount of enemies left won't do, I mean you want to save the status (there or not there) for each individual goomba, wouldn't you?
Thus you'd need an individual true/false value for each goomba, which would e.g. be an array (Although, since GM arrays are 32 bit, this may boost the size of your save file a lot)

_________________
Guinea 2013 Reference (1) | 11 (1) | 10 (1) | 08/09 (1, 2)
 
Top
Offline 
 User page at mfgg.net
 
« Previous topic | Next topic »
Display posts from previous:  Sort by  
 [ 5 posts ]  Reply to topicPost new topic 


Who is online

Users browsing this topic: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group