purchase unlock not working?

Hey all,

In my game, I have 3 modes of play. 2 of the modes are locked until an item is purchased, and then they can be accessed.
The modes are locked by checking a boolean attribute, "game purchased". By default, it is false. If the player tries to access it without having purchased the game, a notification pops up and the button does not get pressed (by a change image behavior also attached to the "game purchased" attribute).

I have a scene where the player can purchase the item (accessed by "pausing" the main menu), with a button that confirms the purchase. In that button, I have the "in-app purchase item" behavior. It changes the boolean attribute for "game purchased". I then save that attribute to a key.

If the player goes back to the menu (where the attribute is loaded using the key to update "game purchased") to access one of the new modes, the notification does not pop up (which is correct). The change image behavior also gets called, because "game purchased" is now true. HOWEVER, the scene never changes to access the new mode.

The scene changes perfectly if I don't put it in the rule to check for "game purchased" to be true.

I can't figure out why this isn't working. ANY help would be greatly appreciated.

Comments

  • AdrenalineAdrenaline Member Posts: 523
    In addition to the above, there's is another related problem.

    If I select to purchase the game, and choose the SUCCESS option...then I go back to the menu and choose the game mode that was always free and available...upon returning to the menu after playing that mode, the game appears to be locked (unpurchased) again!
  • AdrenalineAdrenaline Member Posts: 523
    FIXED IT!

    It had to do with the fact that I was pausing the main menu to bring up the purchase option.

    I was using the alternative to timers in order to move between scenes (using a self attribute and the self time. I learned it from another post of these forums...good stuff!)

    So in my case, I was doing something like this:
    After the user presses a button, immediately show that it was pressed, but wait 0.5 seconds before switching scenes.

    Anyway, pausing the scene was causing the times to get all out of whack. In this case, I had to use a regular GameSalad timer and it all works beautifully now.
Sign In or Register to comment.