@SolusHunter
Ok, I've recreated your code and built the attached APK with the AppGameKit deployment page on their site, but I've been unable to produce the same issue you are having on two separate android devices, an Archos tablet (4.0) and a Samsung galaxy note 2 (android 4.2). Try the attached .apk - the first time it is run is should show all settings as zero and say "CLICK TO SAVE AND RELOAD", and when you touch the screen it loads some default created settings. On each subsequent run it will load the settings it creates on it's first run, and should say so. (It's a very quick job and you may need to force close the app as it's not coded to end normally, depends on the device).
I had to fill out your code a bit, but below is exactly what I used:
rem
rem AGK Application
rem
rem A Wizard Did It!
global highscore, highestlevel, lastscore, skipintro, musicon, soundon
highscore=0
highestlevel=0
lastscore=0
skipintro=0
musicon=0
soundon=0
loaded=0
if getfileexists("fallingdown.cfg")=0
rem create some entries and them save them off if a settings file is not present
highscore=10000
highestlevel=2
lastscore=5600
skipintro=1
musicon=1
soundon=1
savesettings()
rem clear the settings again to show that loading is working
highscore=0
highestlevel=0
lastscore=0
skipintro=0
musicon=0
soundon=0
else
loadsettings()
loaded=1
endif
repeat
print ("Current settings")
print ("Highscore = "+str(highscore))
print ("Highest level = "+str(highestlevel))
print ("Last score = "+str(lastscore))
print ("Intro skipped? = "+str(skipintro))
print ("Music setting = "+str(musicon))
print ("Sound setting = "+str(soundon))
if loaded=0
print ("CLICK TO SAVE AND RELOAD.")
else
print ("THESE SETTINGS WERE LOADED.")
endif
sync()
until getpointerpressed()=1
print ("Current settings")
print ("Highscore = "+str(highscore))
print ("Highest level = "+str(highestlevel))
print ("Last score = "+str(lastscore))
print ("Intro skipped? = "+str(skipintro))
print ("Music setting = "+str(musicon))
print ("Sound setting = "+str(soundon))
print (" ")
loadsettings()
print ("LOADED SETTINGS")
print ("Current settings")
print ("Highscore = "+str(highscore))
print ("Highest level = "+str(highestlevel))
print ("Last score = "+str(lastscore))
print ("Intro skipped? = "+str(skipintro))
print ("Music setting = "+str(musicon))
print ("Sound setting = "+str(soundon))
sync()
do
loop
function loadSettings()
openToRead(1,"fallingdown.cfg")
highscore=val(readline(1))
highestlevel=val(readline(1))
lastScore=val(readline(1))
skipIntro=val(readline(1))
musicOn=val(readline(1))
soundOn=val(readline(1))
closeFile(1)
endfunction
function saveSettings()
openToWrite(1,"fallingdown.cfg")
writeLine(1,str(highscore))
writeLine(1,str(highestlevel))
writeLine(1,str(lastscore))
writeLine(1,str(skipintro))
writeLine(1,str(musicon))
writeLine(1,str(soundon))
closeFile(1)
endfunction
Not 100% what issue you are having, but if the attached apk doesn't work as I've specified then it must be your particular device, in which case Paul may want a catlog of it running or something. If the attached does work, and that doesn't help you solve the issue, you'll need to post more code as the issue you have must lay elsewhere in your code (or perhaps even your compiler is corrupted?).