Page 1 of 1

Highscore on iOS half-way working: Help Needed

PostPosted: Thu Feb 07, 2013 1:46 am
by kickstart
I know, my transfer to iOS is a never-ending process on this forum, I'm sorry. :roll:
Anyway, I have another problem, now that geplayer is working correctly. My highscore is completley working, and I know this only for one reason, for instance my unlockables run one high score achievements and they all work, even the LoadsVars and saveVars, however the highscore.textNumber does not work. It just displays zero. (It's default number.)

I considered what could be the proble, and was almost sure from multiple files being uploaded onto to geplayer, that mulitple j.file's (MY highscore file) could have been saved on my iPhone and confusing which to use, but the unlockables work flawlessly.

I can upload the .data file, or even the .ged, .exe, .dmg file if you want. Please help and soon there will be another clean and awesome iOS thanks to Game-Editor!!

:D

Re: Highscore on iOS half-way working: Help Needed

PostPosted: Thu Feb 07, 2013 2:55 am
by skydereign
When you go to save your hscore variable, you save it, and then set hscore. You should set it and then save. Now, you have four events tied to a collision event with the bee actor (same for hornet). You should compress those into a single collision event using script editor. Otherwise it becomes very hard to look through your game, as there are multiple actions triggering from the same event, all in different locations.

Re: Highscore on iOS half-way working: Help Needed

PostPosted: Thu Feb 07, 2013 3:09 am
by kickstart
I very much need to clean up my game. There's been multiple things like that since I gave you the file but I have not touched the high score. So what changes do I switch in the code to set it and then save it?

Re: Highscore on iOS half-way working: Help Needed

PostPosted: Thu Feb 07, 2013 3:11 am
by skydereign
JetpackGrizzly wrote: So what changes do I switch in the code to set it and then save it?

Aside from what I already told you, there isn't much more I can tell you. This should be simple enough for you to figure out. Whenever you go to save the hscore variable, you save it and then set it. You want to set hscore before saving it. It should be as simple as that. It doesn't make sense to save the variable (by default 0) and then set it, because you saved 0, and not the real hscore.

Re: Highscore on iOS half-way working: Help Needed

PostPosted: Thu Feb 07, 2013 3:15 am
by kickstart
Oh I understand this and will fix (Thank you!), but then why would the game save in windows is both .ged and .exe properly? It's strictly only .data on geplayer, and that's why I'm finding it strange.

Re: Highscore on iOS half-way working: Help Needed

PostPosted: Thu Feb 07, 2013 3:27 am
by skydereign
Ah, so really that change wasn't necessary... but for a bad reason. Your highscore actor constantly increases hscore, so if you quit before dying, it will still set the hscore to whatever value you had. As for the issue it doesn't save on device, not really sure. If everything else is working fine, perhaps try changing the file name to not use an extension (so perhaps just try "j" instead of "j.file").