saving and loading scores through tables
jigglybean
Member Posts: 1,584
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
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
Darren.
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
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
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
@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.
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
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.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
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
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.
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
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.
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
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
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