Tables question
I have a table with 2 columns (lets say x and y) and about 20 rows (1-20). Is there a simple way so that if the user input matches the value in x they receive the value in y?
And by "simple way" I guess I meaning avoiding writing a rule for each of the 20 lines?
Thanks
And by "simple way" I guess I meaning avoiding writing a rule for each of the 20 lines?
Thanks
Best Answer
-
tatiang Posts: 11,949
There is no built-in behavior for searching a table. You can write a loop to do it, which works fine if your table is on the small side (e.g. 20 rows). See my post in this thread for an example using a timer: https://forums.gamesalad.com/discussion/41887/i-can-make-a-loop-in-the-gs. Replace the log debugging statement with a rule that checks the "x" table cell value based on the value of self.Loop Counter as the table row.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Answers