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.

Newcomers DBPro Corner / Saving and Loading games Problem.

Author
Message
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 1st Jul 2008 12:45
when the player saves the game im using this coding:


when the player loads im sing this coding:


the game saves OK but it wont load correctly
it thinks the values are 0

ill upload more details when i get home

Creators of Outscape
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 1st Jul 2008 13:17
It's good.

Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 1st Jul 2008 13:32
ill see if it works when i get home

Creators of Outscape
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 1st Jul 2008 19:18
no i have no problem in saving the game
just loading
my real code:




Creators of Outscape
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 1st Jul 2008 20:30
oh yea
but anyway no varibles do appear
my file:


Creators of Outscape
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 1st Jul 2008 22:33
ok fixed it you were right but there was another bug that i fixed (accidently =D)
is this possible:
do you know how to make a thing that searches through files to load?
im thinking of making a thing where it will save your games without replacing a current one.
then when you load you go through a thing to find the file

simalar to when you go to upload a game on these forums

Creators of Outscape
sinisterstuf
17
Years of Service
User Offline
Joined: 28th Mar 2007
Location: Namibia, Southern Africa
Posted: 3rd Jul 2008 02:46
I don't really know exactly what you're after or why but I do have some code for fileselecting which could be used in a load game function if you want it?
Surely if you want to save without overwriting you can just add to a number in a variable to get something like: 001.save, 002.save etc. or even the playername then a number like:
OPEN TO WRITE playername$+str$(savenumber)+".save"
then whenever you load the game you just have to get the last 3 characters before ".save" from the filename, convert them to an integer and store them in the savenumber variable. Then every time you save you increment the savenumber variable and save. You'll also need an algorithm to put 0s in front of short numbers.

Also, in your example you are saving only integer type data so why don't you save them that way (using READ/WRITE BYTE commands) instead of converting them to strings and back. This would decrease the number of variables (and code) required and probably also decrease filesize. Even if you don't want to do that you can still load the values directly into their varaibles without the intermediate string variables.

Sorry if I talked too much and wrote too little code
Did this help at all?

When the going get stuf,
the stuf get's sinister
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 3rd Jul 2008 09:31
sorry didnt say
i found a dll somewhere and it does what i wanted
it works find
thanksanyway

Creators of Outscape

http://forum.thegamecreators.com/?m=forum_view&t=132472&b=8

Login to post a reply

Server time is: 2024-09-27 16:26:10
Your offset time is: 2024-09-27 16:26:10