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 / RPG saving and loading

Author
Message
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 9th May 2004 19:26
Okie how do I save and load a game from a txt file?
and it save all the person's stuff on one file so there a file for each player but one?

A 1 man team
Jobyman
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location:
Posted: 10th May 2004 01:23
well saving and loading is actually quite easy once you get to grips wth it.
Basically you open a file


open to write 1,"filename.txt"

dont use the make file command. i dont know what that command is tehre for. it will just mess up

then youjust rwite all your data to this file using the:
write string
write float
write real

etc.

make sure you note the order tho
maybe make a rem somewhere
like before the open to write command do this

remstart
Player name - STRING
Player HP - Float
remend

because when it comes to loading you have to do the exact opposite of what ytou did to save. You use OPEN TO READ. then you READ string instead of WRITE. and you have to read the stuff in the same order as you wrote it.

Hope that clears it up for you. Im terrible at explaining tho so if you dont get it then ask again.

Everyone is a comedian...

Login to post a reply

Server time is: 2024-11-26 16:28:00
Your offset time is: 2024-11-26 16:28:00