Bug with tables (SOLVED)
mrcracker101
Member, PRO Posts: 6
so on this game im working on, has a record high score and a total score using tables. I discovered a bug when updating the game to a newer version, it no longer saves your record high score. I had to create a "Clear Score" in the app for a temp fix. This ONLY happens after updating the game. Installing a fresh copy or using the "clear score" button then playing, doesnt have this bug.
NOTE: anytime a table value is changed during gameplay, it then saves the table immediately after the change. This action happens MANY times as things are destroyed. Could this be creating it? not sure.
code:
If "Score" is higher than "Record Score"(cellvalue,table,col,row)
change table value(table,col,row) to "Score"
Save table
Comments
@mrcracker101
Firstly, maybe you just wrote it here incorrectly, but the row is addressed before the column in the table functions and behaviors. In your examples above you have them the wrong way round.
This may be your issue.
Otherwise you would need to post some screen shots of your code.
Secondly, I would not save the table on every change, the system saves the whole table out, this can cause some stutter in your game play. Rather only save at the end of a level, at a check point, etc.
Changing values in the table with the Change Table Value behavior is OK though.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
i just wrote it wrong, not in the editor to check so i guessed. As for it saving too much, thats the only thing i could think of. Ill change this and report back as soon as i can. Thanks for your input.
Do you have "save table attribute" in a timer behavior?
I have noticed that Some times save attribute don't work if is put in a timer behavior.
Try to remove timer if you use it.
@Hopscotch
@JPGamesFactory
Table bug fixed, here are images on what i did. Also, i noticed a nice performance boost when i changed the table to only save when the game is pause and the level is over.
Original Code
New Code
Thanks again for everyone's help.