Ok i have a small problem, i have managed to make my game save the player position and screen resolution, but i have a problem i can't get figure out how to save the player inventory..
this is how i make my inventory...
type Inventory
Itemname as String
Itemimage as integer
endtype
global dim Inv() as Inventory
...
if pick object (mousex(),mousey(),306,306)>0 and mouseclick()=1 and pck#<20
Objecttimer=50
load object "Interactives\HexKey.x",600
scale object 600,25,25,25
load bitmap "Icons\HexKey.bmp",1000
get image 1000,0,0,48,48 : delete bitmap 1000
InvName$ = "Hex-Key"
Itemimage = 1000
CreateInventory(InvName$,Itemimage)
InvUpdate()
endif
endif
...
Function InvUpdate()
for IT=0 to array count (INV())
if Inv(IT).Itemimage>0 then paste image Inv(IT).Itemimage,screen width()-64,y,1
inc y,45
next IT
endfunction
and this is my save file
function savegame()
If file exist("savegame.dat")=1 then delete file "savegame.dat"
open to write 1,"savegame.dat"
write float 1,x#
write float 1,z#
write float 1,y#
Write float 1,ResX
Write float 1,ResY
close file 1
NoKeys()
if file exist("savegame.dat")=1
ink rgb(0,225,0),0
repeat
center text 320,160, "Save succesfull! press any key to continue"
sync
until scancode() > 0
else
ink rgb(225,0,0),0
repeat
center text 320,160, "Save Un-Succesfull. press any key to continue"
sync
until scancode() > 0
endif
ENDFUNCTION
I can see from your smile, you're not here for the sunset
Windows 7 64 bit, AMD Phenom II x4 Black edition, 4 GB Ram, Radeon HD 4650, 540 GB HDD