Is there any way to make triggers with programming language constructs like “if-then-else” or “do-while” loops?
The trigger system is designed primarily for accessibility and does not support higher-level programmer constructs directly. By using switches and keeping in mind that triggers are executed in order, it is possible to do an if-then-else. A do-while is more difficult, but can be done if time is not critical (a single trigger will not fire more than once every 2 game seconds) and the expected number of iterations is small.