GameSalad

Save Table won't save

Brand new to GS, and I am banging my head against the wall trying to get this table to save.

Current code:
1 Actor reads from a table of 400 words (column 1)
2 Actor labels itself a random word
3 Actor marks that word as taken (column 2) using a simple Save Table behavior

I can't get the value in step 3 to actually save and persist, even though my mid-game display shows that it is actually being set correctly. I tried putting a timer in, even though the tutorial I watched didn't need one. Any tips?

Using the Mac Creator, no device currently.

Thanks!

Comments

  • Two.ETwo.E Posts: 356Member, PRO
    edited October 15

    Hi,

    Welcome to GS. Glad to see you are diving into tables.
    It seems you are following the process correctly.

    Could you post a screenshot of your behaviours, you might have a small error along
    the way.

    Edit: Just a quick note. The save functions in GS will only come into effect when you press the "Retry" button in the preview. If you exit the preview and then preview the game again, the game will not load any data that was previously saved (since it is a fresh start).

    Best,
    Two.E

  • dlinsalatadlinsalata Posts: 4Member

    (Oh, and I confirmed that I am putting the values in correctly by using a TableMergeValues to display the values.... it just isn't saving them after the game stops)

  • ArmellineArmelline Posts: 4,438Member, PRO

    Did you definitely select the correct table in the Save Table behaviour?

    Is there any way other logic is overwriting the third column after the game launches?

  • dlinsalatadlinsalata Posts: 4Member
    edited October 16

    Thanks for the quick replies!

    Link to screenshot is here. (Form won't let me upload for some reason).

    Yep, looks like the right table (just triple-checked), and I don't think there is anything else that's overwriting this - this is a very very basic program, so I have to assume I'm just mis-understanding how this works.

    Debugger log seems to indicate it's storing the value correctly:
    Log(Actor: Card): Word row:
    Log(Actor: Card): 163
    Log(Actor: Card): self.Word:
    Log(Actor: Card): Hollywood
    Log(Actor: Card): Stored value
    Log(Actor: Card): 1

  • Two.ETwo.E Posts: 356Member, PRO

    Can you explain what the problem is a bit more.

    Is the game still picking the same word that it shouldn't?

  • Two.ETwo.E Posts: 356Member, PRO
    edited October 16

    Here is a demo. It has notes included.

    What I think is happening, is that you are changing the value, and saving it correctly. The real problem is the words not being told they can not be selected again.

    Hope it helps.

  • dlinsalatadlinsalata Posts: 4Member

    Thanks Two.E! I'll check out the demo tomorrow and write back.

    To explain the problem a bit more: The game is picking the word just fine. What I'm trying to do is to modify the table so that any word that is picked gets a "1" in the column next to it. From what I can tell in the debugger, that is happening just fine. But when I go look at the table later (as in, I click to the table after running the program), the value has reverted to 0. Shouldn't it maintain state if I savetable?

    Thanks!

  • Two.ETwo.E Posts: 356Member, PRO

    Oh ok.

    As soon a you stop running the program, it will revert back its original state.
    Otherwise you will need to keep changing these values back to zero every time you want to test.

    As you said, it is working when the game is running, and if you press the "Restart" button in the viewer, it will still be a value of 1. The same will happen on a device.

    But as soon go back into the creator, it will not be saved because this is where you are creating the game, and testing.

    Best

  • pHghostpHghost London, UKPosts: 2,057Member

    Yes, when you go back to Creator, it goes to the original state of how you set things up. So when you then run the preview again, it is like you just installed it for the first time.

    On devices, the data gets saved.

Sign In or Register to comment.