How to sum tables with rule:

Or 200.
I have made a rule for sum all rows from a table, example, sum all scores from each level.
I have made an actor with two attrib, one index and one real.
Level --- 1 --- index
Total Score --- 0 --- Real
If you have 100 levels:
Rule:
When self.level < 100
Timer,, every 0.1
change attrib self.total to total+(tablecellvalue(game.table.score, self.level,1))
change attirb self.level. to self.level-1

I hope you like it.
I have drop this actor on one scene to see scores and tweet
Can we made it better?
Sign In or Register to comment.