When you read the values in from the file, just assign the values to variables in your game. I always use strings in my text files, then just read the strings and use val() to convert them to variables.
Here is a little bit of code from my preferences reading and writing subroutines:
Reading:
if file exist("Data\Prefs.txt")
open to read 1,"Data\Prefs.txt"
read string 1,a$ : gridsize#=val(a$)
read string 1,a$ : numopp=val(a$)
read string 1,a$ : diff=val(a$)
read string 1,a$ : detail=val(a$)
read string 1,a$ : debrison=val(a$)
read string 1,a$ : lightson=val(a$)
read string 1,a$ : waveson=val(a$)
read string 1,a$ : smokeon=val(a$)
read string 1,a$ : sparkson=val(a$)
read string 1,a$ : chipset=val(a$)
read string 1,a$ : speed#=val(a$)
read string 1,a$ : autopost=val(a$)
read string 1,a$ : bugson=val(a$)
read string 1,a$ : cameraon=val(a$)
read string 1,a$ : mousemode=val(a$)
read string 1,a$ : forceon=val(a$)
read string 1,a$ : player=val(a$)
read string 1,a$ : rutype=val(a$)
read string 1,a$ : rudesign=val(a$)
close file 1
endif
Writing:
if file exist("Data\Prefs.txt") then delete file "Data\Prefs.txt"
open to write 1,"Data\Prefs.txt"
write string 1,str$(gridsize#)
write string 1,str$(numopp)
write string 1,str$(diff)
write string 1,str$(detail)
write string 1,str$(debrison)
write string 1,str$(lightson)
write string 1,str$(waveson)
write string 1,str$(smokeon)
write string 1,str$(sparkson)
write string 1,str$(chipset)
write string 1,str$(speed#)
write string 1,str$(autopost)
write string 1,str$(bugson)
write string 1,str$(cameraon)
write string 1,str$(mousemode)
write string 1,str$(forceon)
write string 1,str$(player)
write string 1,str$(rutype)
write string 1,str$(rudesign)
close file 1
For your last question: how is the area that you are trying to save defined? Is it just a rectangle? Or is it made up of blocks? I am sure there is a simple enough way of saving it.
Xander Moser - Bolt Software - Firewall
