Copy Table Behavior not working
I have a table called "TB Questions" and "MasterTable" They both had 109 rows. I removed 1 row from the "Tb Question" table. On my actor that I have to click to start the game I have the following
When Actor Receives Touch is Pressed
Copy Table
Copy: MasterTable
To: TB Questions
I run the game. Click the actor to start and when I look at the " TB Questions" table, I still have only 108 rows. Shouldn't I have 109 rows?
When Actor Receives Touch is Pressed
Copy Table
Copy: MasterTable
To: TB Questions
I run the game. Click the actor to start and when I look at the " TB Questions" table, I still have only 108 rows. Shouldn't I have 109 rows?
Best Answer
-
KodeRiter722 Posts: 42
Its actually doing exactly what it should! :P The table is being saved persistently. If the user was to turn their game off and turn it back on that table would be saved with 3 rows and 5 columns. You will never see the actual table values changed in your gamesalad program. that's not the way it works. when you exit the preview that is not equivalent to the user restarting, that is equivalent to a completely fresh installation of the game. if you are looking to make a copy of a table to actually see in gamesalad, you need to do what the user above mentioned and copy the csv file.
Answers
But you can check inside GS that it is working by displaying the tableRowCount.
HC
The MasterTable will (or needs) to be copied to the TB Questions every time the user starts the game or replays the game.
I have the copy action on a actors receives touch is pressed (event)
Nothing happens. I manually deleted a row from the TB Questions table so I could make sure that the copy table action was working and the rows count would be equal in both. My TB Questions table is not over ridden by the MaserTable.
I made two tables. First one called Master with 5 ROWs and 3 COLs, the second is called Copy and only has 1 ROW and 1 COL.
Then I made an actor to show the ColCount and RowCount for Master showing: 3:5 and one actor showing the same for the Copy table showing: 1:1.
An actor with a rule: when pressed - copy Master to Copy.
When that is done the Copy ColCount and RowCount shows: 3:5.
You can download a copy of the GS-project here: http://dl.dropbox.com/u/12878764/Copy_Tables.zip
HC
I then turn back on the attribute action to start the game when the actor is clicked. Run the game. Check my TB Question table. Still no change in the number of rows.
I can't figure it out. I tried to post a picture of the rule, but I see that I have to have the picture hosted somewhere first. I'll try to do that in a few minutes. The copy table action looks super simple, but it is not working.
Thanks so much for all your input. I greatly appreciate it.
Kai
HC
If you want a copy of your Master table export it to .csv and import to your copy table.
HC
Am I missing something? I know how to export and import the csv files.
Is that how it's suppose to work? It's kind of like a temp table in SQL or a collection in c# or vb.net. That is what it looks like based on how it's working for me. I would have thought the "Save Table" action would have made that data in "Copy" table look just like the "Master" table. is this only during runtime that the data gets copied from one table to another table?
I'm trying to used the Copy Table action just like how it's described. To reset some quiz questions.
Immediately after copying the table, use a Save Table behavior on the TB Questions table. That will solve your problem. so it should look like this:
-When Actor Receives Touch is Pressed:
-Copy Table
-Copy: MasterTable
-To: TB Questions
-Save Table
-TB Questions
Let me know how that works for you....
This is a copy of the demo that @HenrikChristensen did and I modified.
THANKS so very much to all you guys!!