Can't get a Star counting system to log best results.
NilsVeidis
Member Posts: 12
Hello. I've been having a problem for quite a while and can't figure it out, no matter how many Youtube videos I watch.
My game is the common 3 star system and main achieving goal.
Each level contains 3 stars and they can be collected and be recorded in the Level Select area.
Currently, the problem is that on the level select tiles the best star count is not recorded, rather the most recent one.
game.Stars is my star counter.
My code after game.LevelComplete is set to true is:
When Game.Stars is > Than tableCellValue(Game.Table Stars, self.What Level Am I ,1)...Change table value to:
Table:Table Stars
Row: self.What Level Am I
Column:1
Value: game.Stars
and then after that I have "Save Table: TableStars"
Where the text is displayed the code for the Display Text is:
tableCellValue( game.Table Stars, self.What Level Am I,1)
All help is appreciated! Thanks guys.
My game is the common 3 star system and main achieving goal.
Each level contains 3 stars and they can be collected and be recorded in the Level Select area.
Currently, the problem is that on the level select tiles the best star count is not recorded, rather the most recent one.
game.Stars is my star counter.
My code after game.LevelComplete is set to true is:
When Game.Stars is > Than tableCellValue(Game.Table Stars, self.What Level Am I ,1)...Change table value to:
Table:Table Stars
Row: self.What Level Am I
Column:1
Value: game.Stars
and then after that I have "Save Table: TableStars"
Where the text is displayed the code for the Display Text is:
tableCellValue( game.Table Stars, self.What Level Am I,1)
All help is appreciated! Thanks guys.
Best Answer
-
HC_DK Posts: 92As @KevinCross already said, your code looks like it should.
Have you checked that the code in the actor on the scene is the same as the "original" actor?
I have experienced that eventhough I made changes in the "original" actor, the actor on the scene was not "updated". The scene actor was still LOCKED when this happened.
Hope you get the picture....
Answers
Apologies if you already knew this.
Okay so I tried both and the problem is still there.
I'll clarify what I want to happen, and what is happening.
What I want to happen: If I get 3 stars on level one log on the level 1 tile that I received 3 stars. If I reopen level one but only get 2 stars, the level tile still represents the best star count (3).
What is happening: If I get 2 stars on level one log on the level 1 tile that I received 2 stars. Then if I reopen level one and get 3 stars, the level tile represents that I got 3 stars. Then, if I reopen it again and get 2 this time, the level tile displays that I got 2 stars, rather than the greatest star count.
Figured it out. Thank you @HC_DK because when I put the rules of the "original" actor and the actor in scene I noticed one slight difference in order. This solved the issue.
Thanks for the help! Appreciate it a lot!
When Game.Stars is > Than tableCellValue(Game.Table Stars, self.What Level Am I ,1)...Change table value to:
Table:Table Stars
Row: self.What Level Am I
Column:1
Value: game.Stars
You may not be copying tables at all, and if that's the case then just ignore me. It looks like you've sorted it anywho,
http://forums.gamesalad.com/discussion/59702/resetting-stars-after-gameover#latest