GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

More efficient way to compare one value to multiple table cell values?

JG2019JG2019 Posts: 3Member, PRO

Hi,
I'm very new to this and trying to figure it all out but am stuck on one thing so far.

I am trying to kick off some change attribute behaviors if a certain game level attribute (a user entered word using keyboard entry) is found in a certain row, columns 1-8 of a table (with 15 columns) once a certain button is pressed.

How I have it set up is a rule for when (all) the button is pressed, with a rule inside of it for when (any) the attribute is what is in the table cell value for row 1 column 1 and then for row 1 column 2 and then for row 1 column 3, etc. to then kick off the behaviors. I'm wondering if there is a way to consolidate the checking of all the columns.

Is there anyway to use Table Search or Loop Over Table or even a range in Table Cell Value instead of a singular column to make this more efficient? I've watched the tutorial on Table Search and found a little bit on Loop Over Table but nothing I am trying seems to be working. Any guidance would be great! Thanks!

Best Answers

Answers

  • JG2019JG2019 Posts: 3Member, PRO

    Hi @tatiang ,
    Thanks for the quick reply. Just so I am understanding, TableSearch returns only the row or the column number the match is found in vs. true or false. So, I'd have to use that row/col number to equal true or false?

    Also, I am getting a "you don't have permission to do that" message from the link you sent. If it's this one:
    I have seen it and still had my questions. If it's something else, can you resend?

    Appreciate the demo. Thanks a bunch!

  • JG2019JG2019 Posts: 3Member, PRO

    Hi @tatiang ,
    Thanks for the follow up. I have it working, now. I was stuck on expecting it to return true (found) or false (not found) vs. a number value of WHERE it was found. Totally makes sense now. Appreciate your help!

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

    You're welcome! The glossary can be of use when learning about the various functions:

    https://help.gamesalad.com/gamesalad-cookbook/1-getting-started/1-11-glossary/

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.