Quote: "is a .data file a 3d map? i alwais use .x "
If I was loading an .x object I would use the load object command.
Open to read and open to write allow you to build your own files.
You can read & write strings$, integers, floats#. Anything you want and to any level. You can write a string like "My data file format" and then read it in like thus:
read string 1,fileType$
if fileType$="My data file format" then goto processMyDataFile
Reading and writting floats can be used to read and write positional data like spawn points, object position and rotation...
open to read 1,"map1.data"
repeat
read string 1,command$
if command$="playerObject"
read float 1,x
read float 1,y
read float 1,z
read float 1,a
read float 1,b
read float 1,c
entil file end(1)
close file 1
Tie that in with an editor, or even a simple 'save game' option and it would be written
open to read 1,"map1.data"
write string 1,"playerObject"
write float 1,x
write float 1,y
write float 1,z
write float 1,a
write float 1,b
write float 1,c
close file 1
It isn't .x or .bsp or anything else, it is yours. The simple task of reading the string "playerObject" from the file does not load a player object, it simply lets you know that the data following it is x/y/z and a/b/c information that you can then use to place an object down.
open to read and open to write allow you to control the contents of your own file. You can use entirely string information if you want (using str$() and val() to convert numbers to string and vice versa) and that would let you create a file with the extension .ini that could be edited in notepad, or you could give it the extension .txt.
You could even call it .exe and make it look like an .exe but unless you actually sit there and replicate the contents of an .exe file with write byte it wont execute. It is just holding whatever data you put into the file.
Pneumatic Dryll
