With how finicky the UI script parser is with doing multiple things in a single statement, I almost never try anymore.
If you can do something like:
result = bool1 ? val1 : bool2 ? val2 : bool3 ? val3 : bool4 ? val4 : badresult
... it's news to me. I'd personally just make it multiple lines of code like:
result = badresult
result = bool1 ? val1 : result
result = bool2 ? val2 : result
result = bool3 ? val3 : result
result = bool4 ? val4 : result
I've been disillusioned by the scripting engine so much that I don't try to write elegant code in it at all. I just do what I know will work and leave the headaches alone. If I really need it to be one line, I just replace every visual newline with the XML entities for new lines, "
". Otherwise known as, "\r\n".
|