[Tutorial+Example] Saving and Loading done EASY!

Learn to use DS Game Maker by Example.

Re: [Tutorial+Example] Saving and Loading done EASY!

Postby Paul » March 14th, 2012, 7:31 pm

Is it possible to save multiple variables?
Paul
 
Posts: 47
Joined: July 23rd, 2011, 3:21 pm

Re: [Tutorial+Example] Saving and Loading done EASY!

Postby BLsquared » March 14th, 2012, 10:30 pm

You can using structures the long way, or you can use arrays. You can save them just like a variable.
You may call me BLsquared, Commodore, or TexasBatman. Preferably BLsquared.
My avatar was made by this guy: http://christianmanga.com/smf/index.php ... bum;in=374

"Every puzzle has an answer." - Professor Layton
"In war, there is indeed no substitute for victory." - Douglas MacArthur
"Love and Peace!" - Vash the Stampede
"It's High Noon!" - McCree
Member of Memefefe's Squad
User avatar
BLsquared
 
Posts: 997
Joined: August 10th, 2011, 4:39 pm
Location: United States of America

Re: [Tutorial+Example] Saving and Loading done EASY!

Postby Haloflooder » March 24th, 2012, 9:20 pm

When I tried your example on my NDSL TT. The screen just stays white when the TT is booting into the boot menu. When I put the codes in my game, TT loads fine but when I boot my game, the screen just stays black. Is it just my TT not working or is this example too old for DSGM 5.12?
Haloflooder
 
Posts: 2
Joined: March 24th, 2012, 9:16 pm

Re: [Tutorial+Example] Saving and Loading done EASY!

Postby Foxi4 » March 28th, 2012, 1:28 am

The example is just fine, it's likely that whatever menu you're using doesn't understand ARVG protocol. Try launching it using Homebrew Menu from Drunken Coders.

http://devkitpro.org/wiki/Homebrew_Menu
Current Projects:

FalloutDS: Postponed until proper libraries are created, 10%
Foxi_Lib: A completely revised version of NitroSprites[FINAL], NitroBackgrounds and NitroText[FINAL], 40%
Foxi4
 
Posts: 1221
Joined: December 31st, 2010, 3:25 am

Re: [Tutorial+Example] Saving and Loading done EASY!

Postby Haloflooder » March 28th, 2012, 5:54 am

Thanks, that fixed everything :)
Haloflooder
 
Posts: 2
Joined: March 24th, 2012, 9:16 pm

Re: [Tutorial+Example] Saving and Loading done EASY!

Postby EgoTrip » June 14th, 2012, 12:05 pm

I am having trouble following this, the explanation has been everything but clear and concise.

Say I have some variables called Chocolate, Level, Record1, Record2, and Banana.

Exactly how do I 1: get the game to load these variables when the game starts, ie in a Title screen control object create event.

2: save the variables when they need saving, such as when a level is complete, ie in a Level control object.

Thanks in advance. The quicker this is sorted the quicker I can release the next version of my game. This is the only thing missing in the engine.
EgoTrip
 
Posts: 80
Joined: June 5th, 2012, 3:04 pm

Re: [Tutorial+Example] Saving and Loading done EASY!

Postby Nobody » June 14th, 2012, 12:54 pm

are you asking how to do the actual saving code or how to make the game to where it saves and loads when it needs to?
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: [Tutorial+Example] Saving and Loading done EASY!

Postby EgoTrip » June 14th, 2012, 3:24 pm

the code
EgoTrip
 
Posts: 80
Joined: June 5th, 2012, 3:04 pm

Re: [Tutorial+Example] Saving and Loading done EASY!

Postby Nobody » June 14th, 2012, 5:58 pm

all you really need is a copy and paste. First create the struct of everything you want to save, and then change 'save_data" to the name of the struct
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: [Tutorial+Example] Saving and Loading done EASY!

Postby EgoTrip » June 14th, 2012, 7:14 pm

If I could follow it I would, but I need a specific example relating to specific variables as put in my previous post. I can get it to work by copying it as it is, but after that, when I attempt to incorporate my own variables it just keeps throwing up error messages.
EgoTrip
 
Posts: 80
Joined: June 5th, 2012, 3:04 pm

Re: [Tutorial+Example] Saving and Loading done EASY!

Postby Foxi4 » June 14th, 2012, 11:24 pm

EgoTrip wrote:If I could follow it I would, but I need a specific example relating to specific variables as put in my previous post. I can get it to work by copying it as it is, but after that, when I attempt to incorporate my own variables it just keeps throwing up error messages.

Simply add your variables to the attached structure and you're done - there's really nothing mind-boggling here to speak of. All you need to take note of are Types of variables - u8/s8 for unsigned/signed 8-bit, u16/s16 for signed/unsigned 16-bit (INTEGER in DSGM), bool for Boolean, char for single Characters, char name[lenght] for strings.
Current Projects:

FalloutDS: Postponed until proper libraries are created, 10%
Foxi_Lib: A completely revised version of NitroSprites[FINAL], NitroBackgrounds and NitroText[FINAL], 40%
Foxi4
 
Posts: 1221
Joined: December 31st, 2010, 3:25 am

Re: [Tutorial+Example] Saving and Loading done EASY!

Postby Buck_7 » June 14th, 2012, 11:35 pm

What are the difference bewtween unsigned, and signed???16-bit intger?
User avatar
Buck_7
 
Posts: 1459
Joined: February 19th, 2011, 1:44 am

Re: [Tutorial+Example] Saving and Loading done EASY!

Postby EgoTrip » June 15th, 2012, 12:22 am

Give me an example please, using my variable names, because I cant get the stupid thing to work. I am missing something really obvious here, but for the life of me I just cant see it.

Integers are whole numbers, ie no decimal places. Signed is -127 to 127, unsigned is 0 to 255, 16 bit is -32768 to 32767, and 0 to 65535
EgoTrip
 
Posts: 80
Joined: June 5th, 2012, 3:04 pm

Re: [Tutorial+Example] Saving and Loading done EASY!

Postby Buck_7 » June 15th, 2012, 12:38 am

I don't know if this helps or not, but I had this example...
User avatar
Buck_7
 
Posts: 1459
Joined: February 19th, 2011, 1:44 am

Re: [Tutorial+Example] Saving and Loading done EASY!

Postby Foxi4 » June 15th, 2012, 1:59 am

I just realized something - are you testing your code on an emulator and are you sure that you properly initialized FAT? You can't use both FAT and NitroFS at the same time - you have to switch between those two.
Current Projects:

FalloutDS: Postponed until proper libraries are created, 10%
Foxi_Lib: A completely revised version of NitroSprites[FINAL], NitroBackgrounds and NitroText[FINAL], 40%
Foxi4
 
Posts: 1221
Joined: December 31st, 2010, 3:25 am

Re: [Tutorial+Example] Saving and Loading done EASY!

Postby thelastcaveman » June 23rd, 2012, 1:12 am

Is it possible to save and then load a variable with a preview of the save data. You know like save files have images attached to them etc...(how many characters in your party, location etc...)
thelastcaveman
 
Posts: 13
Joined: November 4th, 2011, 10:57 pm
Location: In my own world

Re: [Tutorial+Example] Saving and Loading done EASY!

Postby Nobody » June 23rd, 2012, 4:32 am

it is possible, but you'd still have to load from a file first. Say you had three save files you can choose from. You could make a 4th to store the overview of the three save files. So when you go to select a save file you will load the data from this 4th file that contains your location and ect. for each of the save files. Then you'd output these results with text and/or pictures
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: [Tutorial+Example] Saving and Loading done EASY!

Postby MrElephant » March 17th, 2015, 12:09 am

Can anyone reupload this file?
User avatar
MrElephant
 
Posts: 10
Joined: November 24th, 2014, 2:23 am

Previous

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest

cron