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 Discussion / Saving your game

Author
Message
Bio Fox
20
Years of Service
User Offline
Joined: 11th Nov 2004
Location: The BioFox Bunker
Posted: 17th Mar 2005 10:05
I'm making a text adventure with db and want to be able to save at any point of the game. How can i do this?

Rook Takes Pawn Productions... "Now if only we could get that accursed bishop!"
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 17th Mar 2005 15:05
It depends on how your game logic works. If progress is tracked via what "rooms" the player has completed then you simply need to write a text file describing the status of completion for each room in a particular save game. Or, if it works more linearly, just store a value representing the current room the player is on.

If you base the progression on item collection write a file describing the inventory of the player.

For each method (or if you combine the two) you will need to also store the current location of the player.

You may need to redesign some of the logic for your text adventure in order to do this, I find it easy to write separate functions for each area with IF statements checking how the player interacts with the area, then when you load everything in you can just call the function relating to the current location of the player.


As far as loading the saved game goes you will want arrays for completed rooms or collected items and use the values stored in them for figuring out how the player is interacting with the adventure.

Crazy Donut Productions
Current Project: A Redneck game
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 18th Mar 2005 08:17
Well im not exactly sure how you do it, but when i used to make these i would have things like my inventory, my position in the world and things i had effected all in arrays, these can be saved with the 'save array' command and then loaded back in at a later date.
YOud have to work out how it would fit into your game though as like 'Bear Crazy' said, it depends on how your game logic works.
Good Luck
Bio Fox
20
Years of Service
User Offline
Joined: 11th Nov 2004
Location: The BioFox Bunker
Posted: 25th Mar 2005 09:47
Thanks

Rook Takes Pawn Productions... "Now if only we could get that accursed bishop!"

Login to post a reply

Server time is: 2025-05-31 05:47:56
Your offset time is: 2025-05-31 05:47:56