Scripting: Using "If"
-
Hoping someone can provide examples of using If in a script.
Per Section 16.5.12 Boolean Functions of the Technical Manual
Example 1: If the function prior [to] If returns TRUE, the next code line will be executed. Code Line Code Line (returns TRUE) If Code Line (executed) Code Line
I have tried the following as a test: what I’m expecting is that I’m ejected when I hit the pickle.
SimCommand SimPickle If SimCommandPress SimEject
and
If SimCommandPress SimPickle SimCommandPress SimEject
with both resulting in immediate ejection; no wait for my hitting the pickle.
I tried running both formats in either a mission.run or mission.txt file, and only the .run results in ejection, so if someone would also address what’s needed to get a mission.txt to execute.
-
So turns out I did not read the beginning of the Scripting chapter carefully enough:
All this time I was trying to get my script to work with the .tac mission. I just had to change the extension to .trn, and presto! Script works!