How can I create a table loop?

3absh3absh Member Posts: 601
edited December 2016 in Working with GS (Mac)

So here's the deal..
I have a sword that changes colors every level increase then loops all over and starts again every 10 levels.
This is the rule i came up with and it works except for one little issue

The problem with this loop is that Mod(10,10) equals Zero
and since there is not Row Zero in the table that has the color value of the sword then sword simply stays at color of row number 9

How can I use the Mod function for 10 referenced values on a table?

Comments

  • 3absh3absh Member Posts: 601

    In other words how can I do a cycle while skipping that Mod(10,10) = zero

  • 3absh3absh Member Posts: 601

    After about an hour of helplessly staring at the screen and scratching my head I finally found the solution

  • HopscotchHopscotch Member, PRO Posts: 2,782
    edited December 2016

    @abuabed84

    I doubt your solution is working at higher levels.

    Rather do the following (assuming your player levels start at 1):

    tableCellValue( game.TBLswordColors, mod(game.PlayerLVL-1, 10)+1, 3)

  • 3absh3absh Member Posts: 601

    @Hopscotch Thank you

Sign In or Register to comment.