Changing table value causes score to stop working.

mikefilippimikefilippi Member, PRO Posts: 18

Everything works great, the score goes up when its supposed to, until I try to change my table value to the new high score. The round after a high score is achieved and the game updated the table, the score doesn't work, it just stays at 0. But the next round works fine. Its only when you get a high score and the table value tries to change. I don't have the table value attached to anything, I even made a new table to make sure. I also tried making a new score counter, and same thing. Anything I try to save wont work the following round.

Comments

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    Try changing the order so that the "change table value" is first in the rule.

    It might be that the behavior does not have time to fire, because the condition for the rule becomes false right after you change game.highscore to game.score.

    Mental Donkey Games
    Website - Facebook - Twitter

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Or you could put all of the behaviors in an After 0 seconds Timer with run to completion checked.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • mikefilippimikefilippi Member, PRO Posts: 18

    @MentalDonkeyGames said:
    Try changing the order so that the "change table value" is first in the rule.

    It might be that the behavior does not have time to fire, because the condition for the rule becomes false right after you change game.highscore to game.score.

    didn't work

    @tatiang said:
    Or you could put all of the behaviors in an After 0 seconds Timer with run to completion checked.

    this didn't work either.

    I'm at a loss.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    I see you are loading in game.score to the table. When do you reset game.score back to zero and also I don't see a save table behavior?

  • mikefilippimikefilippi Member, PRO Posts: 18

    @Lost_Oasis_Games said:
    I see you are loading in game.score to the table. When do you reset game.score back to zero and also I don't see a save table behavior?

    The save feature is in another rule.

    And when you lose, a "reset" actor spawns and when you press it, it resets everything including the scene. The new value should have been input already and I don't see how that could effect it.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited March 2016

    Put all those behaviors that are in the rule above in a for .3 second timer, with run to completion checked, as the rule is cutting off as soon as you change game.highscore as then that changes game.score and game.highscore to be an equal value. Also note in preview the value you change the table to only stays during preview and not when you stop preview. Once you stop preview the attribute return to default value.

  • mikefilippimikefilippi Member, PRO Posts: 18

    @Lost_Oasis_Games said:
    Put all those behaviors that are in the rule above in a for .3 second timer, with run to completion checked.

    This didn't work either.

    I have an old game I made with the exact same rules and it works perfect. I'm starting to think its a glitch with this specific game only. Is there a way to transfer everything to a new project and see if that works?

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    @mikefilippi said:

    @Lost_Oasis_Games said:
    Put all those behaviors that are in the rule above in a for .3 second timer, with run to completion checked.

    This didn't work either.

    I have an old game I made with the exact same rules and it works perfect. I'm starting to think its a glitch with this specific game only. Is there a way to transfer everything to a new project and see if that works?

    I believe there is an issue with table's and display text.

  • mikefilippimikefilippi Member, PRO Posts: 18

    @Lost_Oasis_Games said:

    I believe there is an issue with table's and display text.

    An issue with Gamesalad, or with my rules?

  • mikefilippimikefilippi Member, PRO Posts: 18
    edited March 2016

    I was able to get it to work by instead of having the table update only when the score is higher than the high score, I just set a timer to update every second.

    EDIT: Never mind, that didn't work. But I added another scene that acts as a buffer and that seemed to work. So now when you lose, instead of just resetting the scene, it goes to the buffer scene, where a timer sends it straight back to the game.

    EDIT 2: Okay, now it happens sometimes, sometimes not. I can't find any rhyme or reason. This is getting very frustrating.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    @mikefilippi said:
    I was able to get it to work by instead of having the table update only when the score is higher than the high score, I just set a timer to update every second.

    EDIT: Never mind, that didn't work. But I added another scene that acts as a buffer and that seemed to work. So now when you lose, instead of just resetting the scene, it goes to the buffer scene, where a timer sends it straight back to the game.

    EDIT 2: Okay, now it happens sometimes, sometimes not. I can't find any rhyme or reason. This is getting very frustrating.

    That's because there is an issue on Windows creator and display text and tables. The display text doesn't update to the new value. Your code was correct except for the order of it. Here is how to check it without display text. Use the log debug behavior and put it in a temp actor on scene do when touch is pressed, put the log debug in there and the table cell value of the highscore go up to window and bring up the debug view window.

Sign In or Register to comment.