Working with tables
Can someone please help me understand tables. I have a game where i have figured out how to save/load attributes and it works fine, even did testing on my phone. The problem is that i still have alot more to add into the game. what i want to do is if some types in a name it saves the "text attribute". I have it working. But i dont understand how to put all my information into a table and just load the table. so that way i dont have 50 load attributes at the beginning of my game. I would like to learn how to use the tables. From what i read it saves alot on load times for the app and everything. So to help point me in the right direction i basically want to save a keyboard input to a table cell value. Is that possible? when i click on "change table cell value. Im not sure what i need to put in "table (assume table name) what row, what column, those i understand, but i dont understand what to put into the "Value Column" because i am wanting to save a keyboard input. Also, how do i load the table at the start of the game? i do not see a load table function. Thanks in advance. I know this is along plea for help, but ive never used tables and heard they are the way to go, so i just want help understanding them. Thanks again.
Comments
The best way to learn about tables is to watch videos about them and don't over think it. There is no load table function. Anything you want GS to do you have to tell it to do it. It doesn't know what you want loaded from a table. Any attributes you need loaded to run the game must be loaded from the table with the Change Attribute action. Place an actor off screen on your first scene call it "Load Attributes" and load them all there.
In many cases you don't even need attributes you can read directly from the table. When you do this use notes. Attributes have meaningful names table addresses don't and it can make it hard to trouble shoot later if you don't make notes.
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
So i cannot save a keyboard input function to a table and then load it later when the app is closed and reopened without using attributes? I know how to get the attributes save and load done, just thought it would be easier with tables...thanks
Hi @kipdev Yes, you can use Tables for saving and loading any sorts of attribute values.
To save a table, use the Save Table behaviour. If that's used, when the app is gone then running again on the device, that saved Table will still have your updated information.
So this is all fine, except for the following scenario:
Let's say you are using a Table for a game, and as the game progresses, you save all manner of attribute values to it, so the user can easily carry on from where they left off (as I previously described). But what if you've put a "New Game" button or similar? All of the original attribute values would no longer be there to start fresh (because they would have all been overwritten).
So if you do need the ability to start fresh at any future time, put all of your initial values into a Table as before but then make an empty Table as well.
When you want to start saving, use the Copy Table attribute to copy your master (first) table to this second table. So any changes are then made in this second table.
And when a user starts fresh, you copy the first master table over to the second one again, which overwrites any progress attributes there.
Might sound a bit complicated but it's not really - I think it's easier to understand when you've put this into practice, rather than have it explained to you in words...
I can't remember if there's much about info about Tables in the manual - http://gamesalad.com/manuals - although even if not, I strongly recommend you go through this - GSC has a few hidden features which you might not discover just by using it...
But there is certainly stuff about Tables in the Cookbook Tutorials - all of these tutorials are well worth going through - make sure you are signed in, then as you complete each tutorial, you'll earn points... https://help.gamesalad.com/hc/en-us/categories/200134158/
Finally, as @colander wrote, there are lots of video tutorials online to learn from.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps