GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Bug with tables (SOLVED)

mrcracker101mrcracker101 Posts: 6Member, PRO
edited November 2015 in Working with GS (PC)

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

  • HopscotchHopscotch Posts: 2,782Member, PRO
    edited November 2015

    @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.

  • mrcracker101mrcracker101 Posts: 6Member, PRO
    edited November 2015

    @Hopscotch said:
    @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.

    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.

  • JPGamesFactoryJPGamesFactory Posts: 174Member, PRO

    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.

  • mrcracker101mrcracker101 Posts: 6Member, PRO

    @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.

Sign In or Register to comment.