How should the output IF-structures format be? I looked at the official mission scripts for bil.scr (those that came with compiler) and noticed they used a format similar to:
Code: Select all
IF ((((counter1 = 1)
AND (counter2 = 1) )
AND ((counter3 = 1) OR (counter5 = 1)) )
AND (counter4 = 1) )
// code here.
When i took some time to think about it, i thought it makes sense: the braces after IF command tells how many checks total that one IF structure has! brilliant! and after the IF command the AND/OR commands will tell how many sub-commands does it have at that line! i added space before the last brace for each line except the first IF because then i can debug and check that the first braces count after AND/OR is same as the braces count at end of that line.
What do you think?
Other news: i made indentations (and extra lines padding) for the subroutines, at same time i found out that you can use RETURN command inside WHILE_EXEC loop (and probably for WHILE loop as well), it seems to terminate the loop.
Here is how the indentations look like from decompiled script:
[mis]THREAD_TRIGGER trigger18 = THREAD_WAIT_FOR_CHAR_IN_CAR (p1, auto60, function18:)
START_BASIC_KF_TEMPLATE (trigger18, 4311, auto60, p1, TANK_GUN)
bonus2 = START_BONUS_CHECK (NO_ZONE, 3600, 30, 0, CAR, NOT_EXCLUSIVE, BY_ROCKET_LAUNCHER, TANK, NONE)
DO_BASIC_KF_TEMPLATE (bonus2, timer1, 120, onscreen1, savecount107, 30, 4311, p1, LIVES, 1)
THREAD_TRIGGER trigger19 = THREAD_WAIT_FOR_CHAR_IN_CAR (p1, auto61, function19:)
START_BASIC_KF_TEMPLATE (trigger19, 4312, auto61, p1, CAR_MACHINE_GUN)
bonus3 = START_BONUS_CHECK (NO_ZONE, 3600, 60, 0, CHAR, NOT_EXCLUSIVE, BY_GUN, JEEP, NO_OCCUPATION)
DO_BASIC_KF_TEMPLATE (bonus3, timer1, 120, onscreen1, savecount107, 60, 4312, p1, LIVES, 1)
edit: tested mis highlighter.