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.

DarkBASIC Professional Discussion / How to close a finished DBpro game, and run it from THAT point on next play?

Author
Message
AJ Schaeffer
16
Years of Service
User Offline
Joined: 22nd Aug 2009
Location: Jacksonville,FL
Posted: 9th Aug 2010 07:18
Title says it all. Can it be done?

Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 9th Aug 2010 08:27
look into the file commands. You can save a file when you close the game, and load it when you open the game.


Is't life, I ask, is't even prudence, to bore thyself and bore thy students?
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 9th Aug 2010 09:42
You would have to save out each item, object, state etc for the game in hand, which can get complex if you haven't organized your data structures well. If you have neat types holding the data and are able to ressurect and create the objects neatly, then it should be possible. A lot of game have save points, like right at the start of a dungeon, or inbetween levels - these games usually just reset the level and start the game from there, so only saving the player information, rather than the position and state of everything in the game.

Once you can save your game, you can just intercept the quit routine so it 'autosaves', then the next time you start, just have a continue option.

Health, Ammo, and bacon and eggs!
AJ Schaeffer
16
Years of Service
User Offline
Joined: 22nd Aug 2009
Location: Jacksonville,FL
Posted: 9th Aug 2010 15:21
Would Dark Data help do this?

baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 9th Aug 2010 15:27
I don't have DarkData but some of the Matrix Utility plugin commands might help. It has "memory banks" which might be a useful way to store this kind of data...

DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 9th Aug 2010 18:23
Arrays are the simplest way.

http://s6.bitefight.org/c.php?uid=103081
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 10th Aug 2010 10:06
Quote: "Would Dark Data help do this?"

No. Dark data is kinda a databasing utility, all you need is a gave game. Just saving certain variables is all you need.

(Please don't be the kinda person who insists on buying a new unnecessary product just to solve a simple problem! )

My signature is NOT a moderator plaything! Stop changing it!
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 10th Aug 2010 19:23 Edited at: 10th Aug 2010 20:00
Yes Dark data is a little overkill for save game functions lol. Sort through all your variables, save needed ones into an array if they are not already in one. Save the array. Load the array and grab those variables out when restarting.

That basically saves some variables into the array save. You can retrieve those variables just as easily as it is to put them in.


http://s6.bitefight.org/c.php?uid=103081
Rich Dersheimer
AGK Developer
17
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 10th Aug 2010 19:36
And IanM's utilities give the ability to easily save a User Defined Type array. I'm using it to save my player state from session to session.

Login to post a reply

Server time is: 2026-07-25 08:54:36
Your offset time is: 2026-07-25 08:54:36