Save/load attribute does nothing

Hey there,

I have a table (myTable) with just 1 column and 1 row (small for now so I can get that to work) that cell will hold coins the player accrues over each game play. It's currently set to 20.

I have an actor called game over which will update the table then switch scene after a few seconds. It has an attribute self .Bank, which I use to load the cell into, then add any coins collected during game. I then want to save this updated Attribute back to cell 1,1

Once game is over;

Load Attribute
key :tableCellValue(game.myTable,1,1)
Attribute :self.Bank

Change attribute
self.Bank
To: self.Bank + game.PlayerCoins

Save attribute
Attribute : self.Bank
Key :tableCellValue(game.myTable, 1,1)

No matter how many times I fiddle with this it doesn't work. I don't type the table name in, I use the attribute selector. I have no idea what I'm doing wrong.

If I'm doing it wrong, how can I go about saving a few stats like total coins, total enemies killed ever, max level reached to a table which will persist after app closes and how would I then access them. Sounds pathetic but it's been a few hours now of no joy and it doesn't seem right to me.

Thanks in advance

Comments

  • jigglybeanjigglybean Member Posts: 1,584

    One question. Is this happening with continuous play? So you play a level, gather coins, die, return to main menu and play again, only to discover that your collected coins have not loaded?

    Or - Are you exiting the GS viewer, doing something, then restarting the GS viewer? If you are doing this, it won't save anything as it treats this as a new game. The first method above is the way to check if this works.

    Make sure that you load attributes are on the first scene/loading page.

    Like Balls? Then click here! We've 100 coming soon

  • sebmat86sebmat86 Member Posts: 339

    Hey! Im not sure if this post is of any help to you, but I know I had some issues with save/load once and searched the forums for answers.

    Just a couple of excerpts found on the forum:

    @Big_Dave‌
    "Solution attempt:
    Type all "keys" new into all behaviors. Dont use the "e" expression editor. Use the text field.
    One case of used expression editor could prevent all other load/save from working properly. As I experienced that one missing sound file can mess up all sound of the game too."

    @jonmulcahy‌
    "The only rule you need to follow is never use the expression editor (the little e) to enter the key you want to save. always type it directly in."

    And these guys might be of further help too, @Daftbomb‌. Hopefully its OK for you that I tagged you guys here. If not, then sorry Dave and Jon!

    Check out @The_Gamesalad_Guru‌ on youtube, as well as TSB´s channel:

    Have you tried any free save/load templates? I believe that @DeepBlueApps‌ might have templates of that sort at: http://www.deepblueapps.com/category/gstemplates/

    Hope this helps or gets you started on solving the problem. Good luck!
    /Seb

  • DaftbombDaftbomb Member Posts: 36

    Thank you for the replies, it is with continuous game play. Throughout multiple lives and game overs without stopping the preview.

    Still unable to get save/load to work. However did manage to work around the problem using change table value.

    I'm curious, when I save table and then quit the preview, am I to expect it leaves the table as original because it's just preview. And if I were to run on a device it would actually save those values?

Sign In or Register to comment.