Files

Blitz3D Forums/Blitz3D Beginners Area/Files

David819(Posted 2003) [#1]
Hi how can i place game data into like a .dat file and also be able to read then in that file.
please help.


soja(Posted 2003) [#2]
Look up OpenFile/Writefile & CloseFile in the docs, along with all the commands under "File/Stream" in the 2D Category.

A short example:
f=WriteFile("test.dat")
WriteLine(f, "Line 1")
CloseFile(f)

It creates/overwrites a file called "test.dat" and puts one line into it: "Line 1".


WolRon(Posted 2003) [#3]
Check out my tutorial in the Tutorial forum...


David819(Posted 2003) [#4]
I dont think you understand me, what i mean was to make a .dat file like the makers of oni did and place 3d models into that .dat files and be able to read the models out of it without having to extract them.


soja(Posted 2003) [#5]
They just wrote data to a file. That they happened to put a ".dat" extension on it has no bearing. I think your question is more along the lines of "what is the 3D model format that the makers of Oni used?" I have no idea.


rdodson41(Posted 2003) [#6]
Basically the file that oni (whatever that is) put in has a lot of lines with raw data. Ex:

Height=100
Width=75
Depth=50
R=255
G=255
B=255

Headx=20
Heady=30
Headz=40

Legx=40
Legy=30
Legz=20

Etc. etc.

This is just how i do it, but there may be some other way that I don't know. Hope it helps!

-Rich05


David819(Posted 2003) [#7]
well what i am meaning is not the data like the scale, colour, hieght and such and you are going onto the .raw subject what i mean is like for example .3ds models have objects in them that make up that model which when you call it in the programing language it takes all of those objects and then makes the 3d model but what i mean is simulare basically i want to make .b3d models and then put them into the .dat file and then load the .dat files and read each 3d model out when needed.