Saving over locally saved tables
Here is the setup. I have a table called upgrades that stores all the upgrade items. Name, Image, Cost, and State. All of the upgrades are either true or false.
In the game, the user can buy and upgrade and then it changes the boolean State to true and saves the table. This has been working great. Here is the problem, when I go to add new upgrades to said table, on devices that have already bought upgrades, it doesn't see the new table data. On upgrades that have never purchased (and thus never locally saved the table), it works fine and the new items are sown available.
Obviously I set something up wrong here from the beginning but the problem is that now the game is in the wild and I want to add a new item for upgrade. Any thoughts on how I can get around this issue?
My Latest GS Game - Tiny Spirit
My First GS Game - Dashing Ralph
Comments
Let me clarify the issue a bit more succinctly. If I have a table of items that the user has acquired during the game, and I want to add a new item for them to possibly acquire, how can I make that happen? It seems that once the user hits save table, if I change the table in Creator, when the game loads for the user, it loads their locally saved version. So I need to add more to their locally saved version.
My Latest GS Game - Tiny Spirit
My First GS Game - Dashing Ralph
While an app is running, table data is stored temporarily. One the app quits, that table data is deleted. If you open the app again, the default table data will once again be available.
If you use a Save Table behavior, then the table data in its current state will be saved to the device. If you quit and re-open the app again, the table data will be the same as when it was last saved.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks @tatiang I figured as much. So the issue is that I am using the same table to save the state of the purchase of an upgrade with the other upgrade data. So now that I want to add a new upgrade to that table I have a problem. What I will have to do is create a new table just for storing the upgrade status for items and another table that I never save over which will simply house the menu of upgrades available and their various attributes.
The issue will be pushing he next upgrade. My thinking is that I will write some logic in the beginning to check if the user has any upgrades then copy those states to a new table which I will use going forward for managing state only. The attributes of the various upgrade items will be stored in another table which I will be sire to never run a save table method on.
Thanks again!
My Latest GS Game - Tiny Spirit
My First GS Game - Dashing Ralph
So for anybody following this thread I thought I would outline how I am going to deal with all the users who have amassed upgrades using the single table which is now saved locally on their devices.
Thanks for listening. Hopefully this helps others regarding the importance of understanding tables BEFORE you release your game .
My Latest GS Game - Tiny Spirit
My First GS Game - Dashing Ralph
You don't need to make all those rows. You could use the add row every time a purchase is made.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
The rows are not for individual transactions. They are for new purchasable items. So in my case you can buy something and it is turned on forever. The issue I had was that I wanted to add more items for sale. So now I have 2 tables:
tbl_menu (read only)
tbl_inventory
My Latest GS Game - Tiny Spirit
My First GS Game - Dashing Ralph