Line 6,984: |
Line 6,984: |
| | | |
| ===[[Modding:Event data|Event]] changes=== | | ===[[Modding:Event data|Event]] changes=== |
− | ====Major changes==== | + | ====High-level changes==== |
| + | * Event IDs are now [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string IDs]], so mods can use a unique key instead of hoping no other mod uses the same number. Unconditional events must have an empty precondition in their key (like <samp>"Example.ModId_EventName/"</samp>) to distinguish them from forks. |
| + | * Event/festival commands with a direction argument now allow both case-insensitive names (like <samp>up</samp>) and numeric values. |
| + | * C# mods can now add custom event preconditions & commands using <samp>Event.RegisterCustomPrecondition</samp> and <samp>Event.RegisterCustomCommand</samp> respectively. |
| + | * For C# mods, the new <samp>Event.fromAssetName</samp> field indicates which data asset (if any) the event was loaded from. |
| + | * Event script errors are now logged (in addition to being shown in the chatbox like before). |
| + | |
| + | ====Precondition changes==== |
| <ul> | | <ul> |
− | <li>Event IDs are now [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string IDs]], so mods can use a unique key instead of hoping no other mod uses the same number. Unconditional events must have an empty precondition in their key (like <samp>"Example.ModId_EventName/"</samp>) to distinguish them from forks.</li>
| + | <li>Added validation for preconditions. If a format or assumption is invalid, the game now logs a detailed error.</li> |
− | <li>Added validation for event preconditions & commands. If a format or assumption is invalid, the game now logs a detailed error and (if applicable) skips the command, instead of crashing or silently ignoring it. This also means event arguments are stricter (e.g. you can no longer set a true/false field to an invalid value, inner quotes in quoted arguments now need to be escaped, etc).</li> | + | <li>Event & preconditions are now quote-aware, so you can escape spaces and slashes in arguments like <code>/G "SEASON Spring"/</code>.</li> |
− | <li>Event commands & preconditions are now quote-aware, so you can escape spaces and slashes in arguments like <code>/speak "I'm running A/B tests"/</code>.</li> | |
− | <li>Event commands now trim surrounding whitespace, so they can be multilined for readability. For example:
| |
− | <syntaxhighlight lang="js">
| |
− | "SomeEventId/": "
| |
− | none/-1000 -1000/farmer 5 7 0/
| |
− | skippable/
| |
− | viewport 5 7 10/
| |
− | ...
| |
− | "
| |
− | </syntaxHighlight></li>
| |
− | <li>Festivals can now have a custom festival-started notification message by setting the <samp>startedMessage</samp> field in <samp>Data/Festivals/*</samp> to a [[Modding:Tokenizable strings|tokenizable string]].</li>
| |
− | <li>Event/festival commands with a direction argument now allow both case-insensitive names (like <samp>up</samp>) and numeric values.</li>
| |
− | <li>C# mods can now add custom event preconditions & commands using <samp>Event.RegisterCustomPrecondition</samp> and <samp>Event.RegisterCustomCommand</samp> respectively.</li>
| |
| <li>Added new preconditions: | | <li>Added new preconditions: |
| {| class="wikitable" | | {| class="wikitable" |
Line 7,012: |
Line 7,006: |
| | <samp>G</samp> | | | <samp>G</samp> |
| | Check the result of a [[Modding:Game state queries|game state query]], like <code>G !WEATHER Here Sun</code> for 'not sunny in this location'. | | | Check the result of a [[Modding:Game state queries|game state query]], like <code>G !WEATHER Here Sun</code> for 'not sunny in this location'. |
− | |} | + | |}</li> |
− | </li> | + | <li>The <samp>h</samp> precondition can now be used with any pet type. You can also omit the argument to check for a pet of any type.</li> |
| + | </ul> |
| + | |
| + | ====Command changes==== |
| + | <ul> |
| + | <li>Added validation for event commands. If a format or assumption is invalid, the game now logs a detailed error and (if applicable) skips the command, instead of crashing or silently ignoring it. This also means event arguments are stricter (e.g. you can no longer set a true/false field to an invalid value, inner quotes in quoted arguments now need to be escaped, etc).</li> |
| + | <li>Event commands are now quote-aware, so you can escape spaces and slashes in arguments like <code>/speak "I'm running A/B tests"/</code>.</li> |
| + | <li>Event commands now trim surrounding whitespace, so they can be multilined for readability. For example: |
| + | <syntaxhighlight lang="js"> |
| + | "SomeEventId/": " |
| + | none/-1000 -1000/farmer 5 7 0/ |
| + | skippable/ |
| + | viewport 5 7 10/ |
| + | ... |
| + | " |
| + | </syntaxHighlight></li> |
| <li>Added new event commands: | | <li>Added new event commands: |
| {| class="wikitable" | | {| class="wikitable" |
Line 7,124: |
Line 7,133: |
| |} | | |} |
| </li> | | </li> |
− | </ul>
| |
− |
| |
− | ====Improved preconditions====
| |
− | * The <samp>h</samp> precondition can now be used with any pet type. You can also omit the argument to check for a pet of any type.
| |
− |
| |
− | ====Improved commands====
| |
− | <ul>
| |
| <li>Fixed some commands assuming a boolean argument is true if present, regardless of its value. This affects the <samp>changeToTemporaryMap</samp>, <samp>emote</samp>, <samp>extendSourceRect</samp>, <samp>faceDirection</samp>, <samp>globalFade</samp>, <samp>globalFadeToClear</samp>, <samp>positionOffset</samp>, and <samp>warp</samp> commands.</li> | | <li>Fixed some commands assuming a boolean argument is true if present, regardless of its value. This affects the <samp>changeToTemporaryMap</samp>, <samp>emote</samp>, <samp>extendSourceRect</samp>, <samp>faceDirection</samp>, <samp>globalFade</samp>, <samp>globalFadeToClear</samp>, <samp>positionOffset</samp>, and <samp>warp</samp> commands.</li> |
| <li>Fixed some commands assuming any value except the exact case-sensitive string <samp>true</samp> is false. This affects the <samp>animate</samp>, <samp>glow</samp>, <samp>hideShadow</samp>, <samp>ignoreMovementAnimation</samp>, <samp>temporaryAnimatedSprite</samp>, <samp>temporarySprite</samp>, and <samp>viewport</samp> commands.</li> | | <li>Fixed some commands assuming any value except the exact case-sensitive string <samp>true</samp> is false. This affects the <samp>animate</samp>, <samp>glow</samp>, <samp>hideShadow</samp>, <samp>ignoreMovementAnimation</samp>, <samp>temporaryAnimatedSprite</samp>, <samp>temporarySprite</samp>, and <samp>viewport</samp> commands.</li> |
Line 7,208: |
Line 7,210: |
| </ul> | | </ul> |
| | | |
− | ====Festival-specific changes==== | + | ====Festival changes==== |
| + | * Festivals can now have a custom festival-started notification message by setting the <samp>startedMessage</samp> field in <samp>Data/Festivals/*</samp> to a [[Modding:Tokenizable strings|tokenizable string]]. |
| * Festivals now set the event ID to a value like <samp>festival_fall16</samp>, instead of <samp>-1</samp>. | | * Festivals now set the event ID to a value like <samp>festival_fall16</samp>, instead of <samp>-1</samp>. |
| * All in-festival data fields now support [[Modding:Festival data#Year variants|year variants]]. | | * All in-festival data fields now support [[Modding:Festival data#Year variants|year variants]]. |
| * Fixed NPCs getting duplicated in festivals if they're added to the <samp>set-up</samp> fields multiple times. Subsequent entries now move them instead. | | * Fixed NPCs getting duplicated in festivals if they're added to the <samp>set-up</samp> fields multiple times. Subsequent entries now move them instead. |
| * Fixed [[Modding:Festival data#Year variants|year variants]] for festival <samp>set-up</samp> field being appended to the main script instead of replacing it. | | * Fixed [[Modding:Festival data#Year variants|year variants]] for festival <samp>set-up</samp> field being appended to the main script instead of replacing it. |
− |
| |
− | ====Other changes====
| |
− | * For C# mods, the new <samp>Event.fromAssetName</samp> field indicates which data asset (if any) the event was loaded from.
| |
− | * Event script errors are now logged (in addition to being shown in the chatbox like before).
| |
| | | |
| ===[[Modding:Mail data|Mail]] changes=== | | ===[[Modding:Mail data|Mail]] changes=== |