Table cell value not working properly

As you can see in my video below, the first time I run my game and collect the yellow items, the collected (purple box) shows 3 on the menu dropping down.
When I go back to my level select, it shows 1, but if I do it all over again it works like its supposed to and shows 3.

Any ideas?

http://img405.imageshack.us/img405/4558/oa9imhvdzwkodxznlvkxyc.mp4

Im writing to a table using this setup

Image Hosted by ImageShack.us

Image Hosted by ImageShack.us

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Check that 2nd condition. game.stars > 0,0?
    Image is to see what the character is in between the 0's.
    Either case, if it is checking if game.stars > 0 just make the right hand side value 0 and not 0.0
  • DuesDues Member Posts: 1,159
    @CodeMonkey

    It wont let me have just 0 it changes it to 0,0 by itself.
    Not sure if I actually need that, but it doesn't work without it either
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited July 2013
    Put the save behavior in a after .02 timer with runto completion checked as you're changing the table variable condition you address and before the save executes it is now = to not > than anymore this cuts off the rule before it has a chance to execute the save. This is what I mean when I say think in logic and run through the execution in your head. I picked that up right away.
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Maybe a timer(with the every setting and run to completion) around the 2 inner behaviors to make sure they run. Maybe the top rule still thinks it is true even after you change the table value so it doesn't run the behavior again.
    You can also move the Save Table behavior to the otherwise part of the rule to make sure it runs. Right now the Save Table behavior runs after the Change Table Value behavior runs, which should make the conditions false and cut off the running of behaviors.
  • DuesDues Member Posts: 1,159
    Thanks @CodeMonkey and @FryingBaconStudios
    I'll try this. My logic skills ain't the best, but I'm working hard on it :)
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Take it in steps so when looking at a problem ask yourself what is happening when. even write it out. So when I looked at it I said okay these are the variables he's addressing and this one is > okay and then i look and see the variable you're writing too matches the one you're comparing so I look back up at the rule and say now it's equal to. Here is a tip, think about the logic and not the GUI. Don't think in terms of behavoirs and rules but in variable conditions and positions. There are only two states in a system ON or OFF either a condition is met and it turn on or it hasn't been met and it turn Off.
Sign In or Register to comment.