I've discovered something interesting and I'm not quite sure what's going on.
I'm doing this to tell the program in the future what kind of object to make in the game:
function createObject(objType)
Rem Find object number
objID = find free object()
Rem Determine what object to make
select objType
case 1: Rem A cube
make object box objID, 5, 5, 5
position object objID, object position x(cursor), editLevel, object position z(cursor)
array insert at bottom OBJ(objID)
OBJ().objType = 1
endcase
case 2: Rem A sphere
make object sphere objID, 5
position object objID, object position x(cursor), editLevel, object position z(cursor)
array insert at bottom OBJ(objID)
OBJ().objType = 2
endcase
endselect
Rem Increase object amount variable
amountOfObjects = amountOfObjects + 1
endfunction
I'm using the
array insert at bottom command with the objID variable to assign the index, and then I tried to do the same with my
OBJ().objType = 1 or 2 line of code, but it would ONLY work if I typed it without the objID variable in it, and yet when I loaded the array back into the program and printed the information all of the correct info was there! How is that possible? Do I really only need to tell the program what index to use in the
array insert at bottom command?