Attribute Changes When Game Restarts
ShineHouseGames
Member, PRO Posts: 100
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
Are you loading the attribute when the game starts?
Yes
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.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
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.
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?
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
@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.
Others helped me when I started 4 years ago so I just pass it on.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS