Is this valid syntax?
MattButlerStudios
Member Posts: 486
I need to compare multiple player scores to find out if any of them are equal
Instead of doing:
game.Player1Score ≠ Player2Score
game.Player1Score ≠ Player3Score
game.Player1Score ≠ Player4Score
for all of the scores, would it be valid for me to put this in the expression editor?
game.Player1Score ≠ Player2Score,Player3Score,Player4Score
Comments
Try (Player2Score)or(Player3Score)or(Player4Score) here is a link to LUA operators you can use and how to use them in GS http://www.lua.org/pil/3.1.html
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
If you can get the logical operators to work as @colander suggested, that's a great way to go. If not, here's a demo that will check scores in a table.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@colander @tatiang Thanks a lot guys. I will try and see what works.
www.mbstudios.co | Free Stuff
@colander @tatiang After some testing, it does seem as if the (attribute)or(attribute)or(attribute) method did work. Thanks for the help!
www.mbstudios.co | Free Stuff