So my game is saving everything right, but loading is not so hot. all my objects load fine and my positions but when I try to load a state the state does not change, so if a trigger box has been hit already and i turn off the trigger zone with a state, the state is set to zero next time I reload a saved game. here is how I started my saves and loads
the longs are my states
thanks for any help on this
edit, I tryed changing them to floats but still no state change.
function loadgame()
if file exist("save.dat")=1
open to read 1,"save.dat"
for x=1 to 5000
if object exist (x)
read float 1,x#
read float 1,y#
read float 1,z#
read float 1,ax#
read float 1,ay#
read float 1,az#
read float 1,c1#
read float 1,c2#
read float 1,c3#
read long 1,game1percent
read long 1,coloff1
position object x,x#,y#,z#
position camera 0,c1#,c2#,c3#
xrotate object x,ax#
yrotate object x,ay#
zrotate object x,az#
endif
next x
close file 1
endif
endfunction loadgame
function savegame()
if file exist("save.dat")=1 then delete file "save.dat"
open to write 1,"save.dat"
for x=1 to 5000
if object exist (x)
x#=object position x(x)
y#=object position y(x)
z#=object position z(x)
ax#=object angle x(x)
ay#=object angle y(x)
az#=object angle z(x)
c1#=camera position x(0)
c2#=camera position y(0)
c3#=camera position z(0)
write float 1,x#
write float 1,y#
write float 1,z#
write float 1,ax#
write float 1,ay#
write float 1,az#
write float 1,c1#
write float 1,c2#
write float 1,c3#
write long 1,game1percent
write long 1,coloff1
endif
next x
wait 3000
text 350,350,"saved successsully"
close file 1
endfunction savegame

Logo by The Next