Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / save and load example

Author
Message
mihaid
12
Years of Service
User Offline
Joined: 24th Feb 2012
Location:
Posted: 1st Aug 2012 17:17
Hello,

I red theory about save and load game in dark basic professional, but please i need a real example, not the minimum simplified example.
I have a game where I pick up many tools, and need to save the player position and tools at a moment. Who can give me an example from a game???

Mihai

Mihai
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 1st Aug 2012 17:54
Quote: "I red theory about save and load game in dark basic professional"

I think you might be in the wrong forum. This one is for the App Game Kit.

Cheers,
Ancient Lady
AGK Community Tester
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 1st Aug 2012 20:01
don't know dark basic but i think a good format to save something in is xml format.
something similar to this



Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 2nd Aug 2012 11:49
3d point in space - good call forgot about that...

This was answered in the relavent thread and can be locked now

DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 8th Aug 2012 19:05
Saving game data seems a difficult task to some. I wrote a little guide for DB awhile back using save array, which for me in DB is the easiest method to use. It saves opening and closing files etc.
AGK has no save array command so you are pretty much stuck with the file commands. Still it is easy enough to do. I have no problem doing a small tutorial if enough people want one, but have assumed most here already know how to do this.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 8th Aug 2012 19:38 Edited at: 8th Aug 2012 19:40
I have no trouble, in either Tier, creating a file within the game (options or scores) and then reading the file again.

But, you do have to do things manually to store and retrieve the data.

I have code in both Tier 1 and Tier 2 for doing some file extraction stuff.

Tier 1:


Tier 2 (gotta love OOP!).
ta_oops.h:


ta_oops.cpp:


ta_file.h:


ta_file.cpp:


Cheers,
Ancient Lady
AGK Community Tester

Login to post a reply

Server time is: 2024-04-27 19:09:20
Your offset time is: 2024-04-27 19:09:20