I'm not sure if this is exactly what you are asking for but here it goes!
Save a matrix:
dim mtx(1,50,50)
for x=0 to 50
for z=0 to 50
mtx(1,x,z)=get matrix height(1,x,z)
next x
next z
save array "test.mtx",mtx(0)
To load a matrix:
dim mtx(1,50,50)
load array "test.mtx",mtx(0)
for x=0 to 50
for z=0 to 50
set matrix height 1,x,z,mtx(1,x,z)
next x
next z
update matrix 1
To save objects:
open to write 1,"test.lvl"
for object=1 to maximum_object
if object exist(object)=1
px#=object position x(object)
py#=object position y(object)
pz#=object position z(object)
sx#=object size x(object)
sy#=object size y(object)
sz#=object size z(object)
ax#=object angle x(object)
ay#=object angle y(object)
az#=object angle z(object)
write float 1,px#
write float 1,py#
write float 1,pz#
write float 1,sx#
write float 1,sy#
write float 1,sz#
write float 1,ax#
write float 1,ay#
write float 1,az#
endif
next object
close file 1
To load objects:
open to read 1,"test.lvl"
for object=1 to maximum_object
make object cube object,50
read float 1,px#
read float 1,py#
read float 1,pz#
read float 1,sx#
read float 1,sy#
read float 1,sz#
read float 1,ax#
read float 1,ay#
read float 1,az#
position object object,px#,py#,pz#
rotate object object,ax#,ay#,az#
scale object object sx#,sy#,sz#
next object
close file 1
I think that lot works as a basis.
Fix it and edit it to meet your needs.
Hope that helps.