Quote: " Care to share? lol"
Yeah ok
The UDT Array that goes with these snippets (decypher it yourself
):
type F-Level
ob as integer Rem The object number for the level item - 2 Bytes
ex as integer Rem 1 if the item exists, 0 if not - 2 Bytes
w as float Rem Width - 4 Bytes
h as float Rem Height - 4 Bytes
d as float Rem Depth - 4 Bytes
Px as float Rem X position - 4 Bytes
Py as float Rem Y position - 4 Bytes
Pz as float Rem Z position - 4 Bytes
t as integer Rem Texture number - 2 Bytes
u as float Rem Horizontal texture spread - 4 Bytes
v as float Rem Verticle texture spread - 4 Bytes
col as integer Rem The collision type - 1 is slide, 2 is special slide for floors
phy as integer
endtype
dim lvl(0) as F-Level
Loading:
function load(lvl$)
if memblock exist(1) then delete memblock 1
open to read 1,"Levels/level"+lvl$+".ft1"
read memblock 1,1
close file 1
adr=0
for a=1 to 1000
lvl(a).ob = memblock word(1,adr)
lvl(a).ex = memblock word(1,adr+2)
lvl(a).w = memblock float(1,adr+4)
lvl(a).h = memblock float(1,adr+8)
lvl(a).d = memblock float(1,adr+12)
lvl(a).Px = memblock float(1,adr+16)
lvl(a).Py = memblock float(1,adr+20)
lvl(a).Pz = memblock float(1,adr+24)
lvl(a).t = memblock word(1,adr+28)
lvl(a).u = memblock float(1,adr+30)
lvl(a).v = memblock float(1,adr+34)
lvl(a).col = memblock word(1,adr+38)
lvl(a).phy = a
inc adr,40
next a
endfunction
Saving:
function save(lvl$)
Rem The size is 40000 because I was saving 1000 entries, 40 is one in this case (as adr shows when it is incremented :P)
size=40000
make memblock 1,size
adr=0
for a=1 to 1000
write memblock word 1,adr,lvl(a).ob
write memblock word 1,adr+2,lvl(a).ex
write memblock float 1,adr+4,lvl(a).w
write memblock float 1,adr+8,lvl(a).h
write memblock float 1,adr+12,lvl(a).d
write memblock float 1,adr+16,lvl(a).Px
write memblock float 1,adr+20,lvl(a).Py
write memblock float 1,adr+24,lvl(a).Pz
write memblock word 1,adr+28,lvl(a).t
write memblock float 1,adr+30,lvl(a).u
write memblock float 1,adr+34,lvl(a).v
write memblock word 1,adr+38,lvl(a).col
inc adr,40
next a
Rem saving
if file exist("Levels/level"+lvl$+".ft1") then delete file "Levels/level"+lvl$+".ft1"
open to write 1,"Levels/level"+lvl$+".ft1"
write memblock 1,1
close file 1
delete memblock 1
endfunction
Your welcome