saving and loading scores through tables

Hi all

Right now, I want to move way from attributes and use tables to control game scores. I have had a play but for some reason all the scores match! So game.score(table name) row (1), col(1) all have the same score down to row 8, despite the rules saying otherwise.

Am I missing something or can anyone point me to a good video on how to make this work? Otherwise I will hire someone but as I am off for 2 days, thought I would give it a whirl myself

cheers

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

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    Made a quick demo for you, might help.

    Darren.
  • jigglybeanjigglybean Member Posts: 1,584
    Hey Darren many thanks for the demo. Unfortunately, its not what I am trying to do (but it will come in handy for controlling levels, so thanks).

    The problem I have right now is
    If I kill enemy type A, I want that kill to count as 1 and if enemy type A is killed x5 in a row, I want the table to count it and keep check, so it would have a kill count of 6.

    Then, I can display the text from the table - Enemy A=6 kills.

    tried the change column value, tried saving after each kill. It counts the 1 kill but doesnt add on the additional kills, despite having +1 after it. :(

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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Another demo for you.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • jigglybeanjigglybean Member Posts: 1,584

    thanks tait, I will have a look in the morning. All brain drained after trying this most of the day. Especially when you're so close, but yet so far lol

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

  • jigglybeanjigglybean Member Posts: 1,584

    @tatiang @DeepBlueApps‌

    Thanks for your help thus far guys. I really can't believe that something so simple just appears to be pretty complex.

    From both your demos, the key ingredient is missing - the string to link the table to the counting of kills.

    For some unknown reason, in both demos, I cant edit or see your tables but the demos work.

    Image and video hosting by TinyPic

    If one of you could be so kind to copy and paste the missing change table data I think this is where I am going wrong.

    cheers

    G

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

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    You write info to a table just like you would to a game level attribute. The only difference is you use a change table value behavior instead of a change attribute the expression is the same just write the expression in the value section of the table behavior. Table cells are just like game level attributes except the are not part of the active scan. Just have to remember to use a save table behavior to do a permanent overwrite.

  • jigglybeanjigglybean Member Posts: 1,584

    Thats where the problem is Dave. For some unknown reason, the scores arent accumulating. It's not really a high score, but its old game+new game = overall score. I think the problem is currently that the table is saving over the old score without adding it, and, when I kill more than 2, it doesn't add them up either.

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

  • UtopianGamesUtopianGames Member Posts: 5,692

    If you want it to count up still when you press on other enemies delete the bottom rule in tatiangs demo "touch is outside".

    Darren.

  • jigglybeanjigglybean Member Posts: 1,584
    edited March 2014

    Dont laugh......I have managed to get it to work and found the problem

    Despite adding the code in my prototype, for some reason the actor was unlocked in the actual scene so nothing was getting updated! Therefore, it was counting a kill, then counting the old way(which I removed from the prototype).

    And to make matters worse, it was actually adding 2 spaces between the coma. I dont know if that made a difference as well overall.

    So after a LONG 2 days, thanks very much. It was simple, it's just I needed a beer to get me through to the end!

    Thanks very much @Taitian and Darren @DeepBlueApps for your help. /phew!

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

  • UtopianGamesUtopianGames Member Posts: 5,692
    edited March 2014

    Haha well at least you cracked it well done and it sounds like you deserve that beer, think i will have 1 or 3 tonight.

    Darren.

  • jigglybeanjigglybean Member Posts: 1,584

    LOL indeed. one question though. Will I still need to add a Load Attribute at the splash screen to load the table with the saved scores up? Or is there now no need?

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

  • stueynetstueynet TorontoMember Posts: 166

    @tatiang said:
    Another demo for you.

    Tatiang sorry for opening an old thread, and @jigglybean‌ sorry for hijacking your thread. My only question is, since you are saving the table, what happens if you add more levels in future versions? How do you handle that given your game only has the one table? I started a thread to try and understand this issue here:

    http://forums.gamesalad.com/discussion/67070/storing-level-attributes-and-level-scores-in-tables#latest

    My Latest GS Game - Tiny Spirit
    My First GS Game - Dashing Ralph

  • jigglybeanjigglybean Member Posts: 1,584
    edited April 2014

    It shouldn't make any difference if you add extra levels. Providing the coding is on all the hero/enemy or whatever it is that generates your scoring.

    But if scores are linked to levels, then you will need to add a second row/column depending on your layout to accommodate that score

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

Sign In or Register to comment.