Changes

→‎Event changes: expand info on multilining
Line 7,014: Line 7,014:  
<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>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 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:
+
<li>Event commands now trim surrounding whitespace, so they can be multilined for readability. Line breaks must be before or after the <samp>/</samp> delimiter. For example:
 
<syntaxhighlight lang="js">
 
<syntaxhighlight lang="js">
 
"SomeEventId/": "
 
"SomeEventId/": "
     none/-1000 -1000/farmer 5 7 0/
+
     none/
    skippable/
+
    -1000 -1000/
    viewport 5 7 10/
+
    farmer 5 7 0/
 
     ...
 
     ...
 
"
 
"
</syntaxHighlight></li>
+
</syntaxHighlight>
 +
This can be also combined with the [[Modding:Event data#Comments|comment syntax]] to add notes. For example:
 +
<syntaxhighlight lang="js">
 +
"SomeEventId/": "
 +
    none/            -- music/
 +
    -1000 -1000/    -- initial viewport position/
 +
    farmer 5 7 0/    -- actor positions/
 +
    ...
 +
"
 +
</syntaxHighlight>
 +
</li>
 
<li>Added new event commands:
 
<li>Added new event commands:
 
{| class="wikitable"
 
{| class="wikitable"
translators
8,404

edits