This script allows you to add custom page conditions to your events using comments and conditional branches. You can add an unlimited number of custom page conditions as long as your event page has room for more commands.
A “page condition” is a condition that determines whether the page will be “selected”. For example, if your page required switch 1 to be ON, then it will be skipped while that switch is OFF.
A page will only be selected if all page conditions and custom page conditions are satisfied. This allows you to easily set up complicated activation conditions using built-in functionality. This applies to all events, including troop events and common events.
Script: download here
Place this script below Materials and above Main
If you are using the “negated conditional branches” script, this script must be placed under it.
- Page Conditions by Sinweaver
Insert this script below Materials and above Main.
To create a custom event condition, first create a comment with the string
Then create a conditional branch command after the comment.
This conditional branch will be converted into a page condition, and will
be deleted from the command list. Note that any commands inside conditional
branch will also be deleted, for performance reasons.
Troop Page Conditions
For troop events, if you specify custom page conditions, they will be checked at the beginning of each turn (excluding turn 0) if no built-in condition has been applied. This is a workaround because the default engine does not check any conditions if no built-in condition is specified.
Common Event Conditions
For common events to run automatically, the trigger must be set to auto-run or parallel. Since the trigger requires a switch by default, you can use a dummy switch that is always true if you don’t need the switch condition to run your common event. Otherwise, there is no way to determine whether you actually need the switch or not.
Negated Conditional Branches
If you have installed support for negated conditional branches, you can use them as page conditions by writing both tags into the same comment.
<negate condition> <page condition>