Line 31: |
Line 31: |
| | | |
| ==Event preconditions== | | ==Event preconditions== |
− | Each event has a key which includes an event ID and any preconditions. Event preconditions include any number of the following arguments (separated by <tt>/</tt>). | + | Each event has a key which includes an event ID and any preconditions. Event preconditions include any number of the following arguments (separated by <tt>/</tt>). For example, Clint's Saloon heart event preconditions are <code>97/f Clint 750/t 1900 2300/d Tue Wed Thu Fri Sat Sun</code>, which (per the tables below) means ''event #97, requires 3 hearts with Clint, between 7pm and 11pm on Monday''. |
| | | |
| Notes: | | Notes: |
− | * ''Current player'' is the one playing the instance of the game doing the check. ''Host player'' is the main player running a multiplayer farm, or the current player if single-player.
| |
| * 'NPC name' means their internal English name, not the translatable display name. | | * 'NPC name' means their internal English name, not the translatable display name. |
| * Most text is case-sensitive (e.g. <tt>Mon</tt> is not the same as <tt>mon</tt>). | | * Most text is case-sensitive (e.g. <tt>Mon</tt> is not the same as <tt>mon</tt>). |
| + | * The 'char code' column is for convenience when looking at the decompiled code in <tt>GameLocation::checkEventPrecondition</tt>. |
| + | |
| + | ===Context=== |
| + | These check the current time, date, weather, etc. They're not player-specific. |
| | | |
| {| class="wikitable" | | {| class="wikitable" |
| |- | | |- |
− | ! char code¹ | + | ! char code |
| ! syntax | | ! syntax |
| ! precondition | | ! precondition |
Line 47: |
Line 50: |
| | <tt>A {{t|dialogue ID}}</tt> | | | <tt>A {{t|dialogue ID}}</tt> |
| | {{upcoming|1.3 beta|The special dialogue event with the given ID is in progress. Default values: █████████, <tt>cc_Boulder</tt>, <tt>cc_Bridge</tt>, <tt>cc_Bus</tt>, <tt>cc_Greenhouse</tt>, <tt>cc_Minecart</tt>, <tt>Introduction</tt>, <tt>joja_Begin</tt>. ''TODO:'' fill in details when public.}} | | | {{upcoming|1.3 beta|The special dialogue event with the given ID is in progress. Default values: █████████, <tt>cc_Boulder</tt>, <tt>cc_Bridge</tt>, <tt>cc_Bus</tt>, <tt>cc_Greenhouse</tt>, <tt>cc_Minecart</tt>, <tt>Introduction</tt>, <tt>joja_Begin</tt>. ''TODO:'' fill in details when public.}} |
− | |-
| |
− | | 67
| |
− | | <tt>C</tt>
| |
− | | Host player has not finished the [[community center]], or has not seen the grand reopening yet.
| |
− | |-
| |
− | | 68
| |
− | | <tt>D {{t|name}}</tt>
| |
− | | Current player is dating the given NPC name.
| |
| |- | | |- |
| | 70 | | | 70 |
Line 60: |
Line 55: |
| | Today is ''not'' a festival day. | | | Today is ''not'' a festival day. |
| |- | | |- |
− | | 72 | + | | 100 |
− | | <tt>H</tt> | + | | <tt>d {{t|day of week}}</tt> |
− | | {{upcoming|1.3 beta|Current player is the host player.}} | + | | Today is ''not'' one of the specified days (may specify multiple days). Valid values: Mon, Tue, Wed, Thu, Fri, Sat, Sun. |
| + | |- |
| + | | 114 |
| + | | <tt>r {{t|number}}</tt> |
| + | | A random probability check, where {{t|number}} is the probability between 0 and 1 (e.g. 0.2 for 20% chance). |
| + | |- |
| + | | 118 |
| + | | <tt>v {{t|name}}</tt> |
| + | | The specified NPC is not invisible (regardless of whether they're on-screen). |
| + | |- |
| + | | 119 |
| + | | <tt>w {{t|weather}}</tt> |
| + | | Current weather matches {{t|weather}}. Valid values: rainy, sunny. |
| + | |- |
| + | | 121 |
| + | | <tt>y {{t|year}}</tt> |
| + | | If {{t|year}} is 1, must be in the first year. Otherwise, year must be at least this value. |
| + | |- |
| + | | 122 |
| + | | <tt>z {{t|season}}</tt> |
| + | | Current season is ''not'' one of the specified values (may contain multiple seasons). |
| + | |} |
| + | |
| + | ===Current player=== |
| + | These check the current player (the one playing this instance of the game). |
| + | |
| + | {| class="wikitable" |
| |- | | |- |
− | | 72
| + | ! char code |
− | | <tt>Hn {{t|letter ID}}</tt>
| + | ! syntax |
− | | {{upcoming|1.3 beta|Same as #108 (letter), but check the host player.}}
| + | ! precondition |
| |- | | |- |
− | | 72 | + | | 68 |
− | | <tt>Hl {{t|letter ID}}</tt> | + | | <tt>D {{t|name}}</tt> |
− | | {{upcoming|1.3 beta|Same as #108 (letter), but check the host player.}} | + | | Current player is dating the given NPC name. |
| |- | | |- |
| | 74 | | | 74 |
Line 95: |
Line 116: |
| | <tt>c {{t|number}}</tt> | | | <tt>c {{t|number}}</tt> |
| | Current player has at least that many free inventory slots. | | | Current player has at least that many free inventory slots. |
− | |-
| |
− | | 100
| |
− | | <tt>d {{t|day of week}}</tt>
| |
− | | Today is ''not'' one of the specified days (may specify multiple days). Valid values: Mon, Tue, Wed, Thu, Fri, Sat, Sun.
| |
| |- | | |- |
| | 101 | | | 101 |
Line 151: |
Line 168: |
| | <tt>q {{t|dialogue ID}}</tt> | | | <tt>q {{t|dialogue ID}}</tt> |
| | Current player has chosen the given answer in a dialogue. May contain multiple dialogue IDs, in which case they must all have been selected. | | | Current player has chosen the given answer in a dialogue. May contain multiple dialogue IDs, in which case they must all have been selected. |
− | |-
| |
− | | 114
| |
− | | <tt>r {{t|number}}</tt>
| |
− | | A random probability check, where {{t|number}} is the probability between 0 and 1 (e.g. 0.2 for 20% chance).
| |
| |- | | |- |
| | 115 | | | 115 |
Line 167: |
Line 180: |
| | <tt>u {{t|day of month}}</tt> | | | <tt>u {{t|day of month}}</tt> |
| | Current day of month is one of the specified values (may contain multiple days). | | | Current day of month is one of the specified values (may contain multiple days). |
− | |-
| |
− | | 118
| |
− | | <tt>v {{t|name}}</tt>
| |
− | | The specified NPC is not invisible (regardless of whether they're on-screen).
| |
− | |-
| |
− | | 119
| |
− | | <tt>w {{t|weather}}</tt>
| |
− | | Current weather matches {{t|weather}}. Valid values: rainy, sunny.
| |
| |- | | |- |
| | 120 | | | 120 |
| | <tt>x {{t|event ID}} {{t|letter ID}}</tt> | | | <tt>x {{t|event ID}} {{t|letter ID}}</tt> |
| | For the current player: mark the specified ID as seen, add the specified letter to tomorrow's mail, then return false (so the event doesn't trigger). | | | For the current player: mark the specified ID as seen, add the specified letter to tomorrow's mail, then return false (so the event doesn't trigger). |
| + | |} |
| + | |
| + | ===Host player=== |
| + | These check the host player (the one running a multiplayer farm, not necessarily the current player). If single-player, this is always the current player. |
| + | |
| + | {| class="wikitable" |
| |- | | |- |
− | | 121 | + | ! char code |
− | | <tt>y {{t|year}}</tt> | + | ! syntax |
− | | If {{t|year}} is 1, must be in the first year. Otherwise, year must be at least this value. | + | ! precondition |
| + | |- |
| + | | 67 |
| + | | <tt>C</tt> |
| + | | Host player has not finished the [[community center]], or has not seen the grand reopening yet. |
| + | |- |
| + | | 72 |
| + | | <tt>H</tt> |
| + | | {{upcoming|1.3 beta|Current player is the host player.}} |
| + | |- |
| + | | 72 |
| + | | <tt>Hn {{t|letter ID}}</tt> |
| + | | {{upcoming|1.3 beta|Same as #108 (letter), but check the host player.}} |
| |- | | |- |
− | | 122 | + | | 72 |
− | | <tt>z {{t|season}}</tt> | + | | <tt>Hl {{t|letter ID}}</tt> |
− | | Current season is ''not'' one of the specified values (may contain multiple seasons). | + | | {{upcoming|1.3 beta|Same as #108 (letter), but check the host player.}} |
| |} | | |} |
− |
| |
− | <small>¹ For convenience when looking at the decompiled code in <tt>GameLocation::checkEventPrecondition</tt>.</small>
| |
− |
| |
− | For example, Clint's Saloon heart event preconditions are <code>97/f Clint 750/t 1900 2300/d Tue Wed Thu Fri Sat Sun</code>, which means ''event #97, requires 3 hearts with Clint, between 7pm and 11pm on Monday''.
| |
| | | |
| ==Event scripts== | | ==Event scripts== |