Okay. Here's what the code does:
You start with nothing. Go to the Star "Omni0". When you arrive on the planet, it will say: [TITLE "Page 5 Global"]: "Match on conditions 0 and 4 - removing a lookfrog, adding a threep." You will end up with a Cenotaph, a Codex, a Lummox, a Bee, and Threep. It will not say anything more (and the nova will go off in two days at a different star, and 200 days at the star you are currently at.)
Here is what happens when you visit the 'Omni0' star system:
PAGE 0 runs --
REQ0 verifies you are visiting for the first time.
You are given a brain.
You are given a brass time capsule.
You are given a cenotaph.
You are given a codex.
The next page is then automatically evaluated. (My personal experience is that even putting in a ACTN BREAK doesn't stop this from happening.)
PAGE 1 runs --
REQ0 verifies again that you are still visiting for the first time. (You still are.)
You are given a Lummox.
The nova is set to go off in 2 days.
Some text is put into the display buffer, but is not yet displayed.
The next page is then automatically evaluated.
PAGE 2 runs --
REQ0 verifies again that you are still visiting for the first time. (You still are.)
REQ1 verifies that you have the brain. You didn't have it at the start of the quest, but you received the brain in PAGE 0. It is fine with that, evidently, because the conditions are evaluated as they happen. Big surprise for me.
The Brain (received in PAGE 0) is taken away.
You are given a lookfrog.
The nova is set to go off, once again, in 2 days. This is a duplicate that has no ill effect.
Some text is put into the display buffer, but is not yet displayed.
The next page is then automatically evaluated.
PAGE 3 runs --
REQ0 verifies again that you are still visiting for the first time. (You still are.)
REQ1 verifies that you have the brass time capsule. You didn't have it at the start of the quest, but you received the brain in PAGE 0. It is fine with that.
The brass time capsule (received in PAGE 0) is taken away.
You are given a piranha bee.
The nova is set to go off in 2 days... on a completely different star than the one you are currently at.
Some text is put into the display buffer, but is not yet displayed.
PAGE 4 runs --
REQ0 verifies again that you are still visiting for the first time. (You still are.)
REQ1 verifies that you have the toy robot. YOU DO NOT! You were never given that.
The page is skipped.
PAGE 5 runs --
REQ0 verifies again that you are still visiting for the first time. (You still are.)
REQ1 verifies that you have the lookfrog. You didn't have it at the start of the quest, but you received the brain in PAGE 2. It is fine with that.
The lookfrog (received in PAGE 2) is taken away.
You are given a threep.
The nova is set to go off in 200 days on the star you are currently at. (We previously set it to 2 days.)
Some text is put into the display buffer.
Because you are out of pages, the last item in the display buffer is displayed (page 5). All the other things printed in the previous pages never happened. Any nova setting that was changed? The previous settings won't happen. The nova will go off in 200 days in the current system (and the one in the other system will still go off in 2 days).
All of the items added and removed in all of the (successful) pages [all but page 4] happened just fine. Just the text that goes along with them will never be displayed. This is probably why they want you to use GOTOs for multi-page texts.
The big items to take away from the example:
CONDITIONS are evaluated each moment they are called inside of the page. They are not evaluated ahead of time. So the result of a condition can actually change and be processed immediately by the next page that matches.
All pages are evaluated, from the first page to the last page. (I read somewhere that the numbering of PAGES is just a human label -- so be very careful to always keep your pages in order, and also never skip a number.)
If multiple pages match, they will all be processed. Variable assignments from each page will be processed. Commands to removing and add inventory items will always be processed.
But if multiple pages display text, only the final text box will be the one displayed.
Some commands will behave differently, depending. If you set STAR 0 to explode in 2 days, then set STAR 0 to explode in 200 days, it will explode in 200 days.
If you set STAR 0 to explode in 2 days, and STAR 1 to explode in 2 days, and STAR 0 again to explode, this time in 200 days, then STAR 0 will explode in 200 days (you LAST instruction for that star) and STAR 1 will explode in 2 days.
I think this goes a long ways to explain why people are running into some really strange quest bugs. They can be executing multiple PAGEs and not even know it, because only the text/box from the final PAGE will display, but everything else in between (mostly) still processes.
Here is the code I used for this test. You should be able to plug it into a vanilla mod with no tweaking other than putting it into the game.ini file. NOTE: RUN ON A MEDIUM MAP OR LARGER. THIS WILL CRASH (because of two created stars) ON A SMALL MAP!
Code:
FLAG event always
KEYS unstablestar2
STAR 0
STRT msq_yellow
STRN Omni0
PLNC grassland
FLAG nearby
END STAR
STAR 1
FLAG nearby
END STAR
CONDITION 0
TYPE explore
STR0 0
END CONDITION
CONDITION 1
TYPE haveitem
STR0 it_brain
END CONDITION
CONDITION 2
TYPE haveitem
STR0 it_brasstc
END CONDITION
CONDITION 3
TYPE haveitem
STR0 it_toyrobot
END CONDITION
CONDITION 4
TYPE haveitem
STR0 lf_lookfrog
END CONDITION
PAGE 0
REQ0 0
ITEM it_brain
ITEM it_brasstc
ITEM it_cenotaph
ITEM it_codex
END PAGE
PAGE 1
REQ0 0
ITEM lf_lummox
NOVA 0 2 0 msq_yellow toxic1
TITL PAGE 1 Global
TEXT Match on Condition 0 - adding a lummox!
SCOR 200 strategic
ACTN break
END PAGE
PAGE 2
REQ0 0
REQ1 1
REMV it_brain
ITEM lf_lookfrog
NOVA 0 2 0 msq_yellow toxic1
TITL PAGE 2 Global
TEXT Match on conditions 0 and 1 - removing a brain, adding a lookfrog!
SCOR 200 strategic
ACTN break
END PAGE
PAGE 3
REQ0 0
REQ1 2
REMV it_brasstc
ITEM lf_piranbee
NOVA 1 2 0 msq_yellow toxic1
TITL PAGE 3 Global
TEXT Match on conditions 0 and 2 - removing a brain, adding a piranabee!
SCOR 200 strategic
ACTN break
END PAGE
PAGE 4
REQ0 0
REQ1 3
REMV it_toyrobot
ITEM lf_windbag
NOVA 0 2 0 msq_yellow toxic1
TITL PAGE 4 Global
TEXT Match on conditions 0 and 3 - this should not happen, but if it does, adding a windbag.
SCOR 200 strategic
ACTN break
END PAGE
PAGE 5
REQ0 0
REQ1 4
REMV lf_lookfrog
ITEM lf_threep
NOVA 0 200 0 msq_yellow toxic1
TITL PAGE 5 Global
TEXT Match on conditions 0 and 4 - removing a lookfrog, adding a threep!
SCOR 200 strategic
ACTN break
END PAGE
You wouldn't believe how frustrating, but how educational the process of trial and error (getting to this point) was.