Tables question

jiffwjiffw Member Posts: 42
edited June 2012 in Working with GS (Mac)
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

Best Answer

  • tatiangtatiang Posts: 11,949
    Accepted Answer
    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.



Answers

  • fadamionfadamion Member, PRO Posts: 309
    I think you will need 20, but i would need to know more about what you are doing like what is the user input (key , k returns f?) What is the user input?
Sign In or Register to comment.