Updating Your App: How It Effects Saved Attributes

osucowboy18osucowboy18 Member Posts: 1,307
edited September 2012 in Working with GS (Mac)
Hey everyone,

Ok, so I'm working on an update to one of our apps in which I am referencing the value of an attribute created and stored in the first version of the app. When the user updates the app on their device, will that attribute (integer) be overwritten?

Basically what I'm wanting to do is make one of our paid apps free, starting with this update. But, if the user downloaded the first, paid version, I obviously want them to have the unlocked version and not have to pay twice for it. In the first version of the app, I included an attribute that keeps track of how many times the app has been opened, and saves that value at launch every time. The default value for this attribute is zero. So, in my loading scene, In the updated version, I've added a rule that says:

If game.AppLaunchCount = 0
User gets free version of app

Otherwise if game.AppLaunchCount > 0
User gets pro version of app

I also have a new variable introduced in the updated version of the game that only allows the rule above to run once - the very first time the new version is opened to determine which version (free or paid) the user will get.

Do you see any issues with this setup? Is this kind of logic something GameSalad supports between versions of apps available on the App Store? Any feedback would be great! Thanks everyone.

- Alex

Comments

  • ultimaultima Member, PRO Posts: 1,207
    as long as you use save/load feature you have to assign a save key to the values. and they'll be on the device. I find it easier to save all the attribute to the table and saving the table.. no messy attributes or keys to remember.
  • osucowboy18osucowboy18 Member Posts: 1,307
    Thanks for the response @ultima! I am using the Save / Load attributes correctly in both the first and new versions. So with that being said, would I be able to access and reference an attribute's value that was saved before the user downloaded the update in the updated version of the app?
  • ultimaultima Member, PRO Posts: 1,207
    i'm not sure what you mean by access and reference an attribute's value . you can't access anything on the users's device remotely. but you can anticipate user's input and build responses preemptively.. meaning you can't make a GS game do what you didn't assign it to do, or assign new actions before an update is made... Does that make sense?

    Say I want to know if user pressed A or B(before update). I assigned game.button, assigned a save key/load key for the first version while game.button didn't do anything yet, just want to use it for future reference.... and after an update, I added new rules ..check if game.button = A display "hello world" .. and the new version would have retained the game.button value(in this case "A") from previous version and display a "hello world" for the user. but not before the user updates, because GS games can't access external servers just yet.

    hope i'm helping.
  • osucowboy18osucowboy18 Member Posts: 1,307
    @ultima: Sorry about that, it's getting late here so I guess I'm a little more tired than I thought :)

    But you did answer my question. Basically, I wanted to make sure, in your example, that game.button would not lose it's value (if saved and loaded correctly) after an update. I hope that makes sense, and thanks for your help!

    - Alex
Sign In or Register to comment.