How do you load the actual Merc 2 level format files, or how do I store the data in a file then load it?
The answer to the former is there's a text file which contains all the data I need - level heightmap, texture map etc. I use the
read string command to read this data in then I interpret it.
The answer for the latter is pretty much the same - I use the file commands to load the necessary data in then I interpret it. So, for example if the file was:
[level name]
wasteland
[grass]
yes
Then I'd do something like
open to read 1,"level.txt"
read string 1,temp$ : `the "[level name] bit is just there to remind me what data it is and serves no purpose - put it in a dummy variable
read string 1,levelname$ : `read the level name
read string 1,temp$ : `again discard the "[grass]" bit
read string 1,grass$ : `read whetehr there is grass or not
`if there is grass load it
if grass$ = "yes" then goSub loadgrass
hope it helps