Ok, i tried it on my game, but it doesn't seem to save the global.attempts for some reason.
this is what i figured out:
I go in game, where the ini object is (persistent), which has the game start (to read the ini file) and game end (write ini file).
and then i have a controller that has the attempts of when i die, i click on the start button, to goto the game room(controller is placed in this room), so what i did was, in the controller, when the room ends, global.attempts = global.attempts + attempt.
so that can be from the beginning: 0 (global.attempts) + 4, would make global.attempts = 4.
then when i return back to the menu room. and goto the medal room. it does say the right ammount of global.attempts i have. then i go back to the menu. and click on the exit button to end the game, which means it should write global.attempts into the ini file, encrypted as seen in above reply code.
but when i re start the game, and goto the medals room, and click on the object, it says that the global.attempts = 0.
so i looked inside my ini file, and discovered 2 characters that cover my global.attempts. so that means that the game can't read my first character or something i guess. even though i left the codeword, as codeword, and the index to 9, so it should be correct.
short info:ini file name: attempttestv2.ini
rooms: menu(contains iniobject which is persistant), game(contains controller object), medal(contains medalscontroller)
objects: iniobject(game start, and game end, which code is above, var: global.attempts), controller (game end: (global.attempts = global.attempts + attempt), var: attempt), medalscontroller (when clicked on object, shows the ammount of global.attempts).
does anyone know what went wrong?
can anyone help me please, i really need to get this fixed.
thanks in advanced
Edited by DuTchEr95, 30 April 2012 - 03:03 PM.