Help With Tables?

Hello :)

I have been desperately trying to make a star system through my game through tables, but i just cant seem to get it working properly. Basically, I have an attribute called "StarCounter" and every time a star is collected, the star counter increases by 1(There are 3 stars per level). Here is my code for the tables.

RULE:
When Game.StarCounter is > Than tableCellValue(Game.TbScores, WhatLevel ,1)...Change table value to:
Table:TB.Scores
Row: Self.WhatLevel
Column:1
Value: game.StarCounter

The TBscores is the table name for the code, and the WhatLevel attribute is just used to identify the level I am on.

What is happening in the game is that no matter how many stars I collect, the table value will go directly to 3 when i return to the level select. I know this because I am using a display actor using this code

Display Text: tableCellValue(Game.TbScores, WhatLevel, 1)

Can Anybody help me figure out what I am doing wrong? I have been trying to fix this for over 3 weeks with no luck. Thanks! :)

Comments

  • SingleSparqSingleSparq Member Posts: 1,339
    Hmmm I have pretty well the same set up and mine works. So when you collect one star does you test display show 3 at that exact moment? Or only after the level is finished? Is your rule to send your star amount to the table at the end of the level? And I presume the table your sending to is starting at 0.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    That's because you're not saving the table with the changes.
  • carlblanchetcarlblanchet Member Posts: 755
    edited November 2012
    There's a behaviour called 'Save Table'

    Do this:

    RULE:
    When Game.StarCounter is > Than tableCellValue(Game.TbScores, WhatLevel ,1)...Change table value to:
    Table:TB.Scores
    Row: Self.WhatLevel
    Column:1
    Value: game.StarCounter
    --Save Table: TB.Scores--
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    I just said that..lol
  • carlblanchetcarlblanchet Member Posts: 755
    edited November 2012
    @FryingBaconStudios i know but i added more info to it (just incase) ;) lol it's not everyone that knows how to save a table :P
  • jblb2424jblb2424 Member Posts: 65
    edited November 2012
    oh sorry i forgot to add i do have the save table attribute after the table code. That is why i am so puzzled ><
  • jblb2424jblb2424 Member Posts: 65
    And as a response to SingleSParq my star count is correct when playing the level...but when i go back to my main menu it changes to 3, no matter how many stars i get. And yes i am starting at zero. :)
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Doing a tables video today seems people need more comprehensive info.
  • jblb2424jblb2424 Member Posts: 65
    Hey guys:) Thanks for all the help so far! Through experimentation i found a pattern in the bug i have. In my level select all my levels start at a Star Count attribute of 0 as they should, and when i go into any level and complete it regardless of how many stars I get, it will automatically jump to 3 as i stated before. However, i found out that if i enter the level, return to level select, than renter the level, it works perfectly! Does anyone have any theories or suggestions?
  • jblb2424jblb2424 Member Posts: 65
    Never mind i fixed it! In case you were wondering, my Star.Count game attribute was set on 3 by mistake xD...Thanks for all your help!
  • carlblanchetcarlblanchet Member Posts: 755
    edited November 2012
    haha oh man :P
    glad you found the error! :D
Sign In or Register to comment.