GameSalad

Howdy, Stranger!

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

Need IAP Bug Fixed ASAP

I currently have an IAP issue I have not been able to get any help with nor fix myself. If you are well versed in IAP please respond here or message me. I have carefully watched video tutorials by @Braydon_SFX‌ as well as @The_Gamesalad_Guru‌. I have also gone over the IAP in the cookbook. For some reason my IAP will not work correctly. FYI, I am using tables for IAP which is what the cook book and the tutorials recommend. I have consumable and non consumable set up. I am having the issues when I adhoc test on my iphone. I have save attributes for both types of IAP. However when I close out the app and reopen it is when I have issues. I have load atributes for both types of save atributes. However if I have my non consumable load attribute behavior on it will unlock the non consumable when reopening the app. This of course is not desirable as game players are supposed to purchase these locked items. If I have it off, when I actually buy the non consumable, leave the app, and then reopen, it will of course not load and will revert back to off. This of course would be horrible as a game player is not going to want to purchase again what they already purchased. If you think you can help me out respond here or pm me and we can discuss details such as your rate and anything else. Thanks!

«1

Comments

  • DuesDues Posts: 1,159Member

    Could you post some screenshots of your rules? Might be easier to spot the problem :)

    You say that it will unlock "locked" content. That means the save is triggered somewhere. Sure you have not set anything to true or 1 where it should be off or 0?

  • motorcycle boymotorcycle boy Posts: 429Member

    @Dues said:
    Could you post some screenshots of your rules? Might be easier to spot the problem :)

    You say that it will unlock "locked" content. That means the save is triggered somewhere. Sure you have not set anything to true or 1 where it should be off or 0?

    Attached pics of main menu and main game screen. It's possible that I have something set incorrectly as I have not gone scene by scene actor by actor to check other than the actors I know are used in this. Maybe I'll do that check though.

  • motorcycle boymotorcycle boy Posts: 429Member

    Haha! I just made a project with nothing but IAP functions and am experiencing the same problem. Obviously I'm missing something with the coding or something's wrong with GS on my mac in regard to IAPs

  • motorcycle boymotorcycle boy Posts: 429Member

    I've narrowed down the problem to when I click on a "home" button. Once the scene changes to the home screen the boolean changes to true for the unlock all tools IAP. It does this even when no IAP has been purchased. I included a picture of the home button actor's rules.

  • motorcycle boymotorcycle boy Posts: 429Member

    Here is how I have things set up. Main Scene and purchase scene. Two IAPS. game.coins (integer) and Unlock all (boolean) I have display actors on the main scene and the purchase scene. In the purchase scene off screen I have an actor that says every 0 seconds save game.coins and game.unlockall. I don't even have to make a purchase so the issues is not in the IAP actor. When I click the home button, game.unlock all boolean is now displayed as true on the main scene. I have save attributes in the home button actor but those did no good. So I switched the save attributes to off screen and still no good. Home buttons rules are when touch is pressed, save attributes, then after .5 seconds change scene. game.unlock all boolean will turn true either method I use. Ok tell me how simple of a a rule it is that I'm missing. I'm ready to feel like an idiot so hit me with it people!

  • motorcycle boymotorcycle boy Posts: 429Member

    Well apparently I'm destined to go in circles indefinitely. I got the boolean to save but when closing out the app on my phone and having purchased IAP's they both revert back to their locked state. Oy vay!!!

  • motorcycle boymotorcycle boy Posts: 429Member

    Please please please would someone please send me an IAP template that works for you that doesn't use tables for IAP? I'll give you a big hug.

  • colandercolander Posts: 1,610Member
    edited June 2014
  • motorcycle boymotorcycle boy Posts: 429Member

    @colander said:
    Have a look at GameSaladGuru's vids IAP 1 to 3

    Watched those multiple times. Doesn't work for me for some reason. I mean IAP works in the game but when I leave my app and go back into my app from my phone the IAPs are not saved. I have save and load attributes in the proper places as far as I can tell. I've been having this issue for two weeks or so now and cannot release my app.

  • KillerPenguinStudiosKillerPenguinStudios Posts: 1,291Member

    I would recommend using tables and save and load the table rather than using the save and load attributes. They are much more reliable!

  • motorcycle boymotorcycle boy Posts: 429Member

    @KillerPenguinStudios said:
    I would recommend using tables and save and load the table rather than using the save and load attributes. They are much more reliable!

    Thanks for that tip. I do use save table for my non consumable which is what I learned in game salad guru's videos. But I just use a save attribute for my coins table and regular load attributes for the main screen. What's the best method for loading a table? How would that be best set up?

  • KillerPenguinStudiosKillerPenguinStudios Posts: 1,291Member

    When the app launches I would have the load table in a timer that say's: after 0.01 seconds (run to completion) load table. Also, I would have the save table in a timer as well that say's: every 0.01 seconds save table. You need to make sure that is happening in all your scenes you need it. Hope that makes sense.

  • motorcycle boymotorcycle boy Posts: 429Member

    @KillerPenguinStudios said:
    When the app launches I would have the load table in a timer that say's: after 0.01 seconds (run to completion) load table. Also, I would have the save table in a timer as well that say's: every 0.01 seconds save table. You need to make sure that is happening in all your scenes you need it. Hope that makes sense.

    Thanks that does make sense except that I don't see a "load TB" behavior. Are you referring to the "load attribute" behavior? Because if I use that I can choose a key and pick the table from my game attributes. Just want to make sure I have that clear.

  • motorcycle boymotorcycle boy Posts: 429Member

    @KillerPenguinStudios said:
    I would recommend using tables and save and load the table rather than using the save and load attributes. They are much more reliable!

    I don't see an option for the "load table" you refer to. What behavior is this called for loading the table?

  • scottharrrules43scottharrrules43 Tulsa, OklahomaPosts: 694Member, PRO

    It auto loads. All you have to do is save the table

  • motorcycle boymotorcycle boy Posts: 429Member

    @scottharrrules43 said:
    It auto loads. All you have to do is save the table

    ah got it! Thanks for that I'll try that.

  • colandercolander Posts: 1,610Member

    I am unclear as to what the problem is. When I set up consumable IAP's I saved whatever amount they bought of an item to a table cell in my IAP table. When the player used any or all of it it was subtracted from that cell and if they bought more it was added to that cell.

    You must use a boolean for all IAP purchases if the purchase fails it will be set to false if it is successful it will be set to true. If the purchase is true have a rule that says When game.bMyIAPBooleanAttribute = true then save whatever amount of coins they bought to your table. Use a change attribute action to update your coins attribute and a change table action to update your table and a save table action to save it.

    When your game first starts have an actor off screen and load all your game attributes from tables just like you would from load attributes. Unless there is a bug in GS it should be Job done.

  • motorcycle boymotorcycle boy Posts: 429Member

    @KillerPenguinStudios‌ @scottharrrules43‌ I set up tables to save every 0.01 seconds on every scene but IAP's are still not saved when I close the app and open it back up. I make purchases with both types and they revert back to being locked upon re-opening of the app. I'm going to try what @colander‌ has just mentioned.

  • motorcycle boymotorcycle boy Posts: 429Member

    @colander said:
    I am unclear as to what the problem is. When I set up consumable IAP's I saved whatever amount they bought of an item to a table cell in my IAP table. When the player used any or all of it it was subtracted from that cell and if they bought more it was added to that cell.

    You must use a boolean for all IAP purchases if the purchase fails it will be set to false if it is successful it will be set to true. If the purchase is true have a rule that says When game.bMyIAPBooleanAttribute = true then save whatever amount of coins they bought to your table. Use a change attribute action to update your coins attribute and a change table action to update your table and a save table action to save it.

    When your game first starts have an actor off screen and load all your game attributes from tables just like you would from load attributes. Unless there is a bug in GS it should be Job done.

    The problem is IAP's revert back to a locked state when I close and reopen the app on my phone. I'll try your method though to see if it works.

  • colandercolander Posts: 1,610Member
    edited June 2014

    You have to return it to false after you update your table for the next purchase. Remember your customer/user might want to make several purchases one after another. If you don't reset it to false it will either not work again until he closes the game and restarts it or it will keep topping him up for free.

    Think of it as a trigger/switch and use it as a rule condition. Then inside the rule increase the number of coins in a table and any attribute that uses them in the game. And reset the boolean back to false as the last action before the rule finishes.

  • colandercolander Posts: 1,610Member
    edited June 2014
  • KillerPenguinStudiosKillerPenguinStudios Posts: 1,291Member

    Sorry @dreichelt‌, I'm on vacation doing a lot of work and need sleep. Wasn't thinking straight when I was saying to load the table. But yes, the saved table will be updated automatically.

  • motorcycle boymotorcycle boy Posts: 429Member
    edited June 2014

    @colander‌ thank you very much. Your method worked like a charm. When I make the purchases, close the app, and open it up they are still unlocked according to what was purchased. Only thing is the coins revert back to the purchased amount no matter how many were used in the game. I think you mentioned above how to alter that. Thanks again!

  • colandercolander Posts: 1,610Member
    edited June 2014

    In Creator it won't save it is not the same environment you will need to test it in Ad Hoc on a device. Also anytime coins are spent you need to update and save your table so at all times it has the latest count and it is saved.

    I have attached another version with a send coins button to demonstrate this. It is subtracting a random number of coins from the iCoins attribute and saving the result to the tblIAP table.

  • motorcycle boymotorcycle boy Posts: 429Member

    @colander said:
    In Creator it won't save it is not the same environment you will need to test it in Ad Hoc on a device. Also anytime coins are spent you need to update and save your table so at all times it has the latest count and it is saved.

    I have attached another version with a send coins button to demonstrate this. It is subtracting a random number of coins from the iCoins attribute and saving the result to the tblIAP table.

    Wow thanks again for the new sample project. Yup I tested in creator first and then I test on my iphone 5 adhocing. It was during the adhoc where I would find out nothing would save. I think I'll be able to finish getting my three games set up tonight so that I can submit tomorrow. Much thanks.

  • KillerPenguinStudiosKillerPenguinStudios Posts: 1,291Member

    Just to throw this out there, in should work in creator. When in creator and you press play to test the app, instead of hitting back to go out of play testing then play again, if you press the restart button next to the pause button, it's like closing out the app then reopening it and you can see if the stuff saved properly or not. Hope that makes sense!

  • colandercolander Posts: 1,610Member

    @KillerPenguinStudios good info, I didn't know that the reset button didn't reset everything. I mean I just assumed it saved the user the trouble of closing and reopening Preview.

  • KillerPenguinStudiosKillerPenguinStudios Posts: 1,291Member

    @colander said:
    KillerPenguinStudios good info, I didn't know that the reset button didn't reset everything. I mean I just assumed it saved the user the trouble of closing and reopening Preview.

    HAHAHA! I can def understand that!

  • motorcycle boymotorcycle boy Posts: 429Member
    edited June 2014

    @KillerPenguinStudios said:
    Just to throw this out there, in should work in creator. When in creator and you press play to test the app, instead of hitting back to go out of play testing then play again, if you press the restart button next to the pause button, it's like closing out the app then reopening it and you can see if the stuff saved properly or not. Hope that makes sense!

    Oh wow I had no idea that's an awesome tip! I always have to go through the whole publish then download onto my app for adhoc testing process. That will save a lot of time.

Sign In or Register to comment.