Can ChangeTableValue be a formula?

stevent88stevent88 Member, PRO Posts: 2

hi, so to avoid using loads of Game attributes i'm using a miscellaneous table to store various info. One value is the current score, so it starts as 0 and whenever an enemy dies I want a rule within the enemy actor to +1 to the score.

When I used a Game attribute the rule was simple- Change attribute, Score to Score+1

Now with ChangeTableValue, I choose the table, choose the correct row and column number. Then what do I set the Value field to? I thought it would be (tablecellvalue(find the score))+1 but that doesn't work.

I have a display showing the score at all times. If I set it the Score to start out at say 75, it stays on 75 until I kill an enemy, triggering my rule and then it changes the score to 0. If I set the Value in my ChangeTableValue to say 5, the game score starts at 75, then drops to 5 after one enemy is killed and stays there.

So I can make the rule change the score, it just wont let me enter a formula as the Value, is that correct?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @stevent88 said:
    I thought it would be (tablecellvalue(find the score))+1

    That's correct. Copy and paste the actual expression and post it here.

    When you're having a problem with your rules, show your rules.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    You may want to keep your values in columns so that you can change multiple ones with a single Change Table Value behavior.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Attached is a demo.

  • stevent88stevent88 Member, PRO Posts: 2

    I rage quite yesterday without saving. Tried this again today, exactly as I did it yesterday (or so I thought) and now it works! one of those things I guess, thanks for the help!

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Glad you got it working. Expressions in GameSalad are pretty unforgiving. Adding an extra space or capitalizing the wrong letter, for example, can mess everything up.

Sign In or Register to comment.