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 / game saving methods???????

Author
Message
Feugsy
20
Years of Service
User Offline
Joined: 1st Nov 2004
Location: Australia
Posted: 6th Feb 2005 08:27
i dont understand how to use saving functions such as dat files and such!!! i cant read arrays or whatever you are supposed to be reading from them and i have absolutely no clue! is there an easy to understand tutorial about how to use these fuctions?

much appreciated

Timespliiters 2 rocks!
Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 6th Feb 2005 12:58
Are you asking how you would store save game data into a file, and saving data into variable\arrays?

If you are trying to save game data, then you would write the data to a file. Like the person's hp or position in the 3D world.

The answer to the great question of life, the universe and everything is 42.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 6th Feb 2005 16:17
Remember, the only formats that are already set out for you are the Save/Load Array command ones, and they simply do what they say - Save the Array to a file, and Load the Array from a file.

Other than that, use the File commands to write your data into an empty file, however you see fit.

To load it back in, just do exactly the same thing again, but this time, read the data from the file

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 7th Feb 2005 22:25
Quote: "Save/Load Array command ones"

Aren't the save array commands only in DBP?

The answer to the great question of life, the universe and everything is 42.
Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 8th Feb 2005 00:08
The array commands are in DBC too, not just DBPro. When I save data I usally save it too an empty file.

Here's an example:


That's a very extended version, but it works. If you need me to write something shorter or need help just ask.

Feugsy
20
Years of Service
User Offline
Joined: 1st Nov 2004
Location: Australia
Posted: 21st Feb 2005 15:21
ummmm is there any tutorials arounnd that show this sort of thing? because this is really eluding me. if anyone would make this simpler just post on this thread or email me if ya can at [email protected]

cheers if anyone can help

Timespliiters 2 rocks!
Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 1st Mar 2005 23:17
Well if the other way was too much for ya, here's an easier way:



That's a much easier way, but for some reason I like the other way better. This way will work just fine, try it and let me know if you need any help .

Feugsy
20
Years of Service
User Offline
Joined: 1st Nov 2004
Location: Australia
Posted: 16th Mar 2005 15:45
hey
i have figured most of it out now thanx. one last thing, is there any way of storing non integer numbers such as 1.495 for example

cheers it all helped me out

Timespliiters 2 rocks!
Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 17th Mar 2005 05:30 Edited at: 17th Mar 2005 05:33
I don't think the Save\Load Array commands don't work with real numbers, only integers. That may be the original reason why I started using the file commands instead .

If you still don't understand the file saving method, then look here: http://forum.thegamecreators.com/?m=forum_view&t=50179&b=10

Hope that helps .

blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 19th Mar 2005 01:43
Why don't you just make a float array?

Like:

Dim DecimalThingy#(34)

Or something?

The '#' is the key here.

Mr Blanky - This Time, It's Personal
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 19th Mar 2005 07:01
.......I've used Save/Load Array with all data types. Try making them all string arrays and you can treat them like custom types. Just know which indexes to convert to ints and floats.

Crazy Donut Productions
Current Project: A Redneck game

Login to post a reply

Server time is: 2025-05-31 05:41:53
Your offset time is: 2025-05-31 05:41:53