okay just made this code could you check it that it would work i dont know if it will compile i haven't tried but can you check it can you like dry run it.
ohh and the load function would be in a different program but working on the same file as was saved by the save function
input "Sorry guys but at the moment you need to type in the object name which should be in the levels directory already",file$
load object "levels\"+file$,1
type aier
number as integer
px1 as integer
py1 as integer
pz1 as integer
px2 as integer
py2 as integer
pz2 as integer
px3 as integer
py3 as integer
pz3 as integer
px4 as integer
py4 as integer
pz4 as integer
endtype
type block
number as integer
x as integer
y as integer
z as integer
type as integer
endtype
type basic
x as integer
y as integer
z as integer
endtype
Dim AIing(0) as aier
Dim blocker(0) as block
Dim startpos(0) as basic
Dim endpos(0) as basic
Dim Health(0) as basic
Dim paths$(0)
path$(0)=file$
do
` stuff there to enter values
` do not done yet as you can see
if spacekey()=1 then save()
sync
loop
function save()
cls
input "Please enter name of level",file$
if file open(1)=1 then close file 1
open to write "levels\"file$+".lev",1
AIinglen=Array count(AIing(0))
write word 1,AIinglen
for x = 0 to Array count(AIing(0))
write word 1,AIing(x).number
write word 1,AIing(x).px1
write word 1,AIing(x).py1
write word 1,AIing(x).pz1
write word 1,AIing(x).px2
write word 1,AIing(x).py2
write word 1,AIing(x).pz2
write word 1,AIing(x).px3
write word 1,AIing(x).py3
write word 1,AIing(x).pz3
write word 1,AIing(x).px4
write word 1,AIing(x).py4
write word 1,AIing(x).pz4
next x
Blockerlen=Array count(Blocker(0))
write word 1,Blockerlen
for x = 0 to Array count(blocker(0))
write word 1,blocker(x).number
write word 1,blocker(x).x
write word 1,blocker(x).y
write word 1,blocker(x).z
write word 1,blocker(x).type
next x
write word 1,startpos(x).x
write word 1,startpos(x).y
write word 1,startpos(x).z
write word 1,endpos(x).x
write word 1,endpos(x).y
write word 1,endpos(x).z
Healthlen=Array count(Health(0))
write word 1,Healthlen
for x = 0 to Array count(Health(0))
write word 1,Health(x).x
write word 1,Health(x).y
write word 1,Health(x).z
next x
write string 1,paths$(0)
close file 1
endfunction
function load()
cls
input "Please enter name of level",file$
if file open(1)=1 then close file 1
if file exist("levels\"file$+".lev")=1
open to read "levels\"file$+".lev",1
read word 1,AIinglen
dim AIing(AIinglen) as AIer
for x = 0 to Array count(AIing(0))
read word 1,AIing(x).number
read word 1,AIing(x).px1
read word 1,AIing(x).py1
read word 1,AIing(x).pz1
read word 1,AIing(x).px2
read word 1,AIing(x).py2
read word 1,AIing(x).pz2
read word 1,AIing(x).px3
read word 1,AIing(x).py3
read word 1,AIing(x).pz3
read word 1,AIing(x).px4
read word 1,AIing(x).py4
read word 1,AIing(x).pz4
next x
read word 1,Blockerlen
dim Blocker(Blockerlen) as Block
for x = 0 to Array count(blocker(0))
read word 1,blocker(x).number
read word 1,blocker(x).x
read word 1,blocker(x).y
read word 1,blocker(x).z
read word 1,blocker(x).type
next x
Dim startpos(0) as basic
Dim endpos(0) as basic
read word 1,startpos(0).x
read word 1,startpos(0).y
read word 1,startpos(0).z
read word 1,endpos(0).x
read word 1,endpos(0).y
read word 1,endpos(0).z
read word 1,Healthlen
dim Health(Healthlen) as Basic
for x = 0 to Array count(Health(0))
write word 1,Health(x).x
write word 1,Health(x).y
write word 1,Health(x).z
next x
dim path$(0)
read string 1,paths$(0)
close file 1
endfunction
cheers
Plugged

Work Hard; Play Harder ;
