I have done it
I used a Type to do it...
type blockType
object_id as integer
obxx as integer
obyy as integer
endtype
block_data as blockType [10]
//block_data [ 1 ].object_id = 1
//block_data [ 1 ].obxx = 10
//block_data [ 1 ].obyy = 10
blockid as integer = 1
do
if GetRawMouseLeftPressed()
CreateObjectBox(blockid,10,10,10)
SetObjectPosition(blockid,GetRawMouseX(),GetRawMouseY(),0)
block_data[blockid].object_id = blockid
block_data[blockid].obxx = GetRawMouseX()
block_data[blockid].obyy = GetRawMouseY()
blockid = blockid + 1
endif
SetCameraPosition(1,512,384,-500)
SetCameraLookAt(1,512,384,0,0)
for i = 1 to 10
print ( str(block_data [ i ].object_id) + " , " + str(block_data [ i ].obxx )+ " , " + str(block_data [ i ].obyy ) )
print(GetRawMouseX())
next i
if GetRawKeyPressed(asc("S"))
file = OpenToWrite("save.txt")
for i = 1 to 10
WriteInteger(file,block_data [ i ].object_id)
WriteInteger(file,block_data [ i ].obxx)
WriteInteger(file,block_data [ i ].obyy)
next i
CloseFile(file)
endif
if GetRawKeyPressed(asc("L"))
loadfile = OpenToRead("save.txt")
for i = 1 to 10
valueaa as integer
valuebb as integer
valuecc as integer
valueaa = ReadInteger(loadfile)
valuebb = ReadInteger(loadfile)
valuecc = ReadInteger(loadfile)
blockid = valueaa
CreateObjectBox(blockid,10,10,10)
SetObjectPosition(valueaa,valuebb,valuecc,0)
block_data[blockid].object_id = valueaa
block_data[blockid].obxx = valuebb
block_data[blockid].obyy = valuecc
blockid = blockid + 1
next i
CloseFile(loadfile)
endif
sync ( )
loop
This is just a small version. I just need to blow it up to handle 10000 Types rather than 10.
I hope my computer doesn't tell me to go #%$ myself.
Nick