testing my game

sswisehauptsswisehaupt Member, PRO Posts: 76

My game keeps track of totals and high scores. When i tested it kept track a few times when reloading. Then for some reason it reset all scores to zero when reloaded again. So every so often when it is reloaded it resets. How can I fix it.

Comments

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

    @sswisehaupt said:
    My game keeps track of totals and high scores.

    How? Are you using Save and Load Attribute behaviors? Are you using Tables with Save Table behaviors?

    When i tested it kept track a few times when reloading. Then for some reason it reset all scores to zero when reloaded again.

    Is this in Creator or on a mobile device?

    How can I fix it.

    It would help to see the rules you are using.

  • sswisehauptsswisehaupt Member, PRO Posts: 76

    @tatiang I save my totals to a table

  • sswisehauptsswisehaupt Member, PRO Posts: 76

    @tatiang On an ipad

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

    @tatiang said:
    It would help to see the rules you are using.

    Honestly, there is no way I can help you fix the problem if I can't see the problem itself. Short of posting screenshots or the project file itself, which you're welcome to do (upload either to a file-sharing site and then post the link here), you may want to do some troubleshooting along the lines of checking table values at various points in your game and also looking through your rules to see where you are resetting those values. Tables don't ever reset their values unless you restart the app. So if there are changing to zero, you have a behavior somewhere that is doing that. The trick is to find it.

  • sswisehauptsswisehaupt Member, PRO Posts: 76

    @tatiang Thanks Ill check it. If not successful will send to you. Thanks

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

    As a rule, I never destroy an actor and then place rules or behaviors after the destroy behavior. I always put the destroy behavior at the end/bottom of the rule.

    I also can't tell from your screenshot what your Change Attribute behaviors do.

    Is there a reason you're using the PurchaseTable instead of creating a new table?

    The table screenshot link isn't working for me...

  • sswisehauptsswisehaupt Member, PRO Posts: 76

    @tatiange no reason for me using the purchase table. Should I create a new table instead. I am attaching another table screenshot
    https://www.dropbox.com/s/s0a8auxqv4p4jjf/Table 2015-05-15 14.02.03.png?dl=0

  • sswisehauptsswisehaupt Member, PRO Posts: 76

    @tatiange my change attribute behaviors:

    game.newclownfish to game.newclownfish+1

    game.totalclownfish to game.totalclownfish+1

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

    The PurchaseTable is a built-in table to IAPs. Do not use it for anything but that. Create a new table instead.

    The bigger problem is that your Change Table Value and Save Table behaviors are outside of your rule. Behaviors that are outside of any rules will trigger immediately and only once when the scene is loaded.

  • sswisehauptsswisehaupt Member, PRO Posts: 76

    @tatiange Is this better
    https://www.dropbox.com/s/rmqk58g2gc7zggm/Screenshot 2015-05-15 14.48.35.png?dl=0

    Thanks for all your help on this.

    If I want to destroy this actor is it is not touched should I put that rule after or before the rule i just sent to you. Basically, after 5 seconds, destroy actor.

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

    That looks better but you're still using the PurchaseTable. :(

    The destroy after 5 seconds rule can go anywhere... it doesn't really matter because it's not ordered (it doesn't have to check the time either before or after something else happens). It would look like this:

    Timer After 5 seconds
         Destroy Actor

    It doesn't actually need a rule condition since the Timer has a built-in condition (self.Time ≥ 5)

  • sswisehauptsswisehaupt Member, PRO Posts: 76
    edited May 2015

    @tatiang I'm setting up new table now. Thanks so very much for you time.

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

    You're welcome!

Sign In or Register to comment.