table search function inside of a random function
CMR Interactive
Member, PRO Posts: 13
hi there. i am trying to streamline my code and was wondering if anyone have tried using a table search function inside of a random function?
Comments
It should work as long as it's a small table. I would imagine the random function parameters would be evaluated extremely quickly but perhaps adding a tableSearch function inside would cause it to pause for evaluation? I'm doubtful so you'll just have to try it.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Honestly, it's better to just separate out the evaluations:
Change attribute game.foundRow to tableSearch(blah blah blah)
Change attribute game.randomResult to random(1,game.foundRow)
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User