Checking a Table Value before Changing It

dominic.koponendominic.koponen Member Posts: 22
edited May 2012 in Tech Support
Hello All,

So I have an actor that is a button which controls whether the music is on/off. My question is: Can I "check" what a TABLE value is before I decide to change it? I know you can check for an attribute in the attributes list, but can you check for it if its INSIDE a table?

For example: I want it to have a rule that says if the touch is pressed AND x-attribute is true (Music is on), then change table value to false (turn music off). And vice-versa, if the touch is pressed and x-attribute is false (Music is off), then change table value to true (Turn the music back on). I understand you can check what you want if the attribute is in the attributes list, but it doesn't seem that you can check any attributes that reside in the table.

When I try and create a rule to do this now, I seem to be getting the ability to only check the table name? Which does not seem to have any functionality for me. Any help will be greatly appreciated!

Thanks!

Answers

  • dominic.koponendominic.koponen Member Posts: 22
    make an attribute and enter its valse as what you want to check for say its 1

    attribute game.check set to 1

    rule if game.check is = to table cell value(table,row,col)

    but there is as much better way for on off button


    cheers

    Thank you guys both! You guys rock! Tshirtbooth, is the video tutorial the "better" way I should use? I want this music on/off option to be changeable from different places in the app. Therefore, I was hoping to use a table, which is more organized than just having a huge list of attributes.
  • dominic.koponendominic.koponen Member Posts: 22
    Ah I see! I feel like an idiot... haha I did not know there was a game.audio.musicvolume attribute built in. I was making this way too complicated. I was trying to avoid using the attributes section for organizational purposes but this makes things a lot easier. Thanks guys, the help is much appreciated!!!
Sign In or Register to comment.