GameSalad

Howdy, Stranger!

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

Attribute Changes When Game Restarts

ShineHouseGamesShineHouseGames Posts: 100Member, PRO
edited July 2015 in Working with GS (Mac)

For some odd reason, when I close my game and reopen it, one boolean attribute decidedly turns on despite there being no code to trigger it.

More specifically, it's an in-app purchase that buys you an extra feature in the game, and is only referred to (and works well) in this one instance:

Yet, whenever the game is restarted, the filthyUnlocked variable becomes true even though the PurchaseTable doesn't change. Has anyone had similar issues or a method they've used to resolve this?

Thanks!

Comments

  • RabidParrotRabidParrot Formally RabidParrot. Posts: 956Member

    Are you loading the attribute when the game starts?

  • ShineHouseGamesShineHouseGames Posts: 100Member, PRO

    @RabidParrot said:
    Are you loading the attribute when the game starts?

    Yes

  • The_Gamesalad_GuruThe_Gamesalad_Guru Posts: 9,909Member

    Do you have the identical key including the uppercase in the load behavior. This is why I reccomend using simple numbers as keys not long strings.

  • ShineHouseGamesShineHouseGames Posts: 100Member, PRO

    @The_Gamesalad_Guru said:
    Do you have the identical key including the uppercase in the load behavior. This is why I reccomend using simple numbers as keys not long strings.

    Yep, exactly the same. What's weird to me is that the attribute changes at all? It's not just not saving, but it's turning true despite no rules changing it.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Posts: 9,909Member
    edited July 2015

    When a behavior is exposed outside a rule it will execute as it has no rules to stop if from doing so. Plus attributes don't get saved in preview when exiting. Also be sure you have the load attributes at the beginning aka first scene. A way to check to see if somewhere you're changing it is to try and delete it and a popup will tell you all the places you are affecting this attribute.

    Also what way are you testing it, adhoc, viewer, creator preview?

  • ShineHouseGamesShineHouseGames Posts: 100Member, PRO

    @The_Gamesalad_Guru, you should get paid for your advice in the forums—thanks for this.

    Pretty creative way to determine where the attribute is. I checked and it's only in the buyButton and the loader object as I had assumed.

    This issue appears on GS iOS Viewer, Adhocs, and through TestFlight, so there's clearly a conflict within my own setup. My Confirm_Purchase rule is the only location where the attribute could change and that itself is not in a rule, if that's what you mean.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Posts: 9,909Member

    Others helped me when I started 4 years ago so I just pass it on.

Sign In or Register to comment.