Changes

Jump to navigation Jump to search
m
Text replacement - "tt>" to "samp>"
Line 4: Line 4:     
==Raw data==
 
==Raw data==
Schedule data is stored in <tt>Content/Characters/schedules/*.xnb</tt> files (one per character), which can be [[Modding:Editing XNB files#unpacking|unpacked for editing]]. Here's the raw data for Abigail as of {{version|1.5.1}} for reference:
+
Schedule data is stored in <samp>Content/Characters/schedules/*.xnb</samp> files (one per character), which can be [[Modding:Editing XNB files#unpacking|unpacked for editing]]. Here's the raw data for Abigail as of {{version|1.5.1}} for reference:
    
{{collapse|Data|content=<syntaxhighlight lang="json">
 
{{collapse|Data|content=<syntaxhighlight lang="json">
Line 35: Line 35:     
Notes:
 
Notes:
* 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. <samp>Mon</samp> is not the same as <samp>mon</samp>).
* The game's logic for schedule keys is in <tt>NPC::getSchedule</tt>.
+
* The game's logic for schedule keys is in <samp>NPC::getSchedule</samp>.
    
===Marriage schedules===
 
===Marriage schedules===
Line 46: Line 46:  
! summary
 
! summary
 
|-
 
|-
| <tt>marriage_{{t|season}}_{{t|day of month}}</tt>
+
| <samp>marriage_{{t|season}}_{{t|day of month}}</samp>
| Applies on the given date.<br /><small>Example: <tt>marriage_spring_26</tt></small>
+
| Applies on the given date.<br /><small>Example: <samp>marriage_spring_26</samp></small>
 
|-
 
|-
| <tt>marriageJob</tt>
+
| <samp>marriageJob</samp>
 
| Used by Harvey on Tuesday/Thursday, Maru on Tuesday/Thursday, Penny on Tuesday/Wednesday/Friday.
 
| Used by Harvey on Tuesday/Thursday, Maru on Tuesday/Thursday, Penny on Tuesday/Wednesday/Friday.
 
|-
 
|-
| <tt>marriage_{{t|day of week}}</tt>
+
| <samp>marriage_{{t|day of week}}</samp>
| Applies on the given day of week when not raining.<br /><small>Example: <tt>marriage_Mon</tt></small>
+
| Applies on the given day of week when not raining.<br /><small>Example: <samp>marriage_Mon</samp></small>
 
|}
 
|}
   Line 64: Line 64:  
! summary
 
! summary
 
|-
 
|-
| <tt>{{t|season}}_{{t|day of month}}</tt>
+
| <samp>{{t|season}}_{{t|day of month}}</samp>
| Applies on the given date.<br /><small>Example: <tt>spring_15</tt></small>
+
| Applies on the given date.<br /><small>Example: <samp>spring_15</samp></small>
 
|-
 
|-
| <tt>{{t|day of month}}_{{t|hearts}}</tt>
+
| <samp>{{t|day of month}}_{{t|hearts}}</samp>
| Applies on the given day of month if ''any'' player has at least that many [[friendship|hearts]] with the NPC. If multiple schedules apply, the one with the highest heart number is used.<br /><small>Example: <tt>11_6</tt></small>
+
| Applies on the given day of month if ''any'' player has at least that many [[friendship|hearts]] with the NPC. If multiple schedules apply, the one with the highest heart number is used.<br /><small>Example: <samp>11_6</samp></small>
 
|-
 
|-
| <tt>{{t|day of month}}</tt>
+
| <samp>{{t|day of month}}</samp>
| Applies on the given day of month.<br /><small>Example: <tt>16</tt></small>
+
| Applies on the given day of month.<br /><small>Example: <samp>16</samp></small>
 
|-
 
|-
| <tt>bus</tt>
+
| <samp>bus</samp>
 
| For [[Pam]] only, applies if the bus is repaired.
 
| For [[Pam]] only, applies if the bus is repaired.
 
|-
 
|-
| <tt>rain2</tt>
+
| <samp>rain2</samp>
 
| 50% chance of applying on rainy days.
 
| 50% chance of applying on rainy days.
 
|-
 
|-
| <tt>rain</tt>
+
| <samp>rain</samp>
 
| Applies on rainy days.
 
| Applies on rainy days.
 
|-
 
|-
| <tt>{{t|season}}_{{t|day of week}}_{{t|hearts}}</tt>
+
| <samp>{{t|season}}_{{t|day of week}}_{{t|hearts}}</samp>
| Applies in the given season and day of week, if ''any'' player has at least that many [[friendship|hearts]] with the NPC. If multiple schedules apply, the one with the highest heart number is used.<br /><small>Example: <tt>spring_Mon_6</tt></small>
+
| Applies in the given season and day of week, if ''any'' player has at least that many [[friendship|hearts]] with the NPC. If multiple schedules apply, the one with the highest heart number is used.<br /><small>Example: <samp>spring_Mon_6</samp></small>
 
|-
 
|-
| <tt>{{t|season}}_{{t|day of week}}</tt>
+
| <samp>{{t|season}}_{{t|day of week}}</samp>
| Applies in the given season and day of week.<br /><small>Example: <tt>spring_Mon</tt></small>
+
| Applies in the given season and day of week.<br /><small>Example: <samp>spring_Mon</samp></small>
 
|-
 
|-
| <tt>{{t|day of week}}</tt>
+
| <samp>{{t|day of week}}</samp>
| Applies in the given day of week.<br /><small>Example: <tt>Mon</tt></small>
+
| Applies in the given day of week.<br /><small>Example: <samp>Mon</samp></small>
 
|-
 
|-
| <tt>{{t|season}}</tt>
+
| <samp>{{t|season}}</samp>
| Applies in the given season.<br /><small>Example: <tt>spring</tt></small>
+
| Applies in the given season.<br /><small>Example: <samp>spring</samp></small>
 
|-
 
|-
| <tt>spring_{{t|day of week}}</tt>
+
| <samp>spring_{{t|day of week}}</samp>
| Applies (in any season) on the given day of week.<br /><small>Example: <tt>spring_Mon</tt></small>
+
| Applies (in any season) on the given day of week.<br /><small>Example: <samp>spring_Mon</samp></small>
 
|-
 
|-
| <tt>{{t|season}}_{{t|day of week}}_{{t|hearts}}</tt>
+
| <samp>{{t|season}}_{{t|day of week}}_{{t|hearts}}</samp>
| Applies in the given season, if ''any'' player has at least that many [[friendship|hearts]] with the NPC. If multiple schedules apply, the one with the highest heart number is used.<br /><small>Example: <tt>spring_Mon_6</tt></small>
+
| Applies in the given season, if ''any'' player has at least that many [[friendship|hearts]] with the NPC. If multiple schedules apply, the one with the highest heart number is used.<br /><small>Example: <samp>spring_Mon_6</samp></small>
 
|-
 
|-
| <tt>spring</tt>
+
| <samp>spring</samp>
 
| Always applies.
 
| Always applies.
 
|}
 
|}
Line 108: Line 108:     
===Initial commands===
 
===Initial commands===
A script may have one initial command as the first field in the script, before the first <tt>/</tt> character. The <tt>GOTO</tt> command can also appear in the next two fields after <tt>MAIL</tt>, or the next field after <tt>NOT</tt>.
+
A script may have one initial command as the first field in the script, before the first <samp>/</samp> character. The <samp>GOTO</samp> command can also appear in the next two fields after <samp>MAIL</samp>, or the next field after <samp>NOT</samp>.
    
{| class="wikitable"
 
{| class="wikitable"
Line 115: Line 115:  
! description
 
! description
 
|-
 
|-
| <tt>GOTO {{t|key}}</tt>
+
| <samp>GOTO {{t|key}}</samp>
| (Note: this line only applies if <tt>GOTO</tt> is the first command. If it's not, see <tt>GOTO</tt> below.)<br />End the current script and load the schedule with the given key instead. If the key is "season", the current season name is used instead. If the schedule doesn't exist or can't be parsed, the <tt>spring</tt> schedule will be used instead.<br /><small>Example: <tt>GOTO spring</tt></small>
+
| (Note: this line only applies if <samp>GOTO</samp> is the first command. If it's not, see <samp>GOTO</samp> below.)<br />End the current script and load the schedule with the given key instead. If the key is "season", the current season name is used instead. If the schedule doesn't exist or can't be parsed, the <samp>spring</samp> schedule will be used instead.<br /><small>Example: <samp>GOTO spring</samp></small>
 
|-
 
|-
| <tt>NOT friendship {{t|npc name}} {{t|hearts}}</tt>
+
| <samp>NOT friendship {{t|npc name}} {{t|hearts}}</samp>
| End the current script if ''any'' player ''does'' have at least that many [[friendship|hearts]] with any of the named NPCs (can list multiple). If the script is ended, the <tt>spring</tt> schedule is used instead.<br /><small>Example: <tt>NOT friendship Sebastian 6 Abigail 3</tt> (script ends if any player has 6+ hearts with Sebastian and/or 3+ hearts with Abigail).</small>
+
| End the current script if ''any'' player ''does'' have at least that many [[friendship|hearts]] with any of the named NPCs (can list multiple). If the script is ended, the <samp>spring</samp> schedule is used instead.<br /><small>Example: <samp>NOT friendship Sebastian 6 Abigail 3</samp> (script ends if any player has 6+ hearts with Sebastian and/or 3+ hearts with Abigail).</small>
 
|-
 
|-
| <tt>NOT</tt>
+
| <samp>NOT</samp>
| Command ignored if the next word is not <tt>friendship</tt>.
+
| Command ignored if the next word is not <samp>friendship</samp>.
 
|-
 
|-
| <tt>MAIL {{t|letter ID}}</tt>
+
| <samp>MAIL {{t|letter ID}}</samp>
| Runs the next command if the player did ''not'' receive the given letter ID or world state ID (see <tt>HasFlag</tt> in the [https://github.com/Pathoschild/StardewMods/tree/develop/ContentPatcher Content Patcher documentation]); else continues from the command after that.<br /><small>Example: <tt>MAIL ccVault/GOTO spring/GOTO summer</tt> (runs <tt>GOTO spring</tt> if the bus is repaired, or <tt>GOTO summer</tt> if it isn't; not limited to <tt>GOTO</tt> commands).</small>
+
| Runs the next command if the player did ''not'' receive the given letter ID or world state ID (see <samp>HasFlag</samp> in the [https://github.com/Pathoschild/StardewMods/tree/develop/ContentPatcher Content Patcher documentation]); else continues from the command after that.<br /><small>Example: <samp>MAIL ccVault/GOTO spring/GOTO summer</samp> (runs <samp>GOTO spring</samp> if the bus is repaired, or <samp>GOTO summer</samp> if it isn't; not limited to <samp>GOTO</samp> commands).</small>
 
|-
 
|-
| <tt>GOTO {{t|key}}</tt>
+
| <samp>GOTO {{t|key}}</samp>
| (Note: this line only applies if <tt>GOTO</tt> is after <tt>NOT</tt> or <tt>MAIL</tt>. If it's not, see <tt>GOTO</tt> above.)<br />End the current script and load the schedule with the given key instead. If the key is "season", the current season name is used instead. If the key is "NO_SCHEDULE", the NPC has no schedule for the day. If the schedule doesn't exist or can't be parsed, the game crashes (or shows an error if playing with SMAPI).<br /><small>Example: <tt>GOTO NO_SCHEDULE</tt></small>
+
| (Note: this line only applies if <samp>GOTO</samp> is after <samp>NOT</samp> or <samp>MAIL</samp>. If it's not, see <samp>GOTO</samp> above.)<br />End the current script and load the schedule with the given key instead. If the key is "season", the current season name is used instead. If the key is "NO_SCHEDULE", the NPC has no schedule for the day. If the schedule doesn't exist or can't be parsed, the game crashes (or shows an error if playing with SMAPI).<br /><small>Example: <samp>GOTO NO_SCHEDULE</samp></small>
 
|}
 
|}
    
===Schedule points===
 
===Schedule points===
 
The rest of the schedule script consists of slash-delimited entries, each containing space-separated fields which specify a start time, destination, and what to do when the NPC reaches it:
 
The rest of the schedule script consists of slash-delimited entries, each containing space-separated fields which specify a start time, destination, and what to do when the NPC reaches it:
: <tt>{{t|time}} {{o|location}} {{t|tileX}} {{t|tileY}} {{o|facingDirection}} {{o|animation}} {{o|dialogue}}</tt>
+
: <samp>{{t|time}} {{o|location}} {{t|tileX}} {{t|tileY}} {{o|facingDirection}} {{o|animation}} {{o|dialogue}}</samp>
   −
If the <tt>location</tt> field is omitted, the rest of the fields are parsed as normal. The other optional fields must be in sequential order (e.g. you can skip <tt>animation</tt> and <tt>dialogue</tt>, but you can't skip <tt>facingDirection</tt> and then specify <tt>animation</tt> and <tt>dialogue</tt>). The exception is <tt>dialogue</tt>. The <tt>dialogue</tt> can be specified without the <tt>animation</tt>.
+
If the <samp>location</samp> field is omitted, the rest of the fields are parsed as normal. The other optional fields must be in sequential order (e.g. you can skip <samp>animation</samp> and <samp>dialogue</samp>, but you can't skip <samp>facingDirection</samp> and then specify <samp>animation</samp> and <samp>dialogue</samp>). The exception is <samp>dialogue</samp>. The <samp>dialogue</samp> can be specified without the <samp>animation</samp>.
    
{| class="wikitable"
 
{| class="wikitable"
Line 142: Line 142:  
! description
 
! description
 
|-
 
|-
| <tt>time</tt>
+
| <samp>time</samp>
| The time at which the schedule event begins, in military time (24 hour format, no colon). The time may be preceded with the single character '<tt>a</tt>' to indicate that the event should end (that is, the NPC should arrive at the destination) at the given time. In this case, the game will calculate when the event needs to begin. However, the event will never begin before the time specified for the previous event.
+
| The time at which the schedule event begins, in military time (24 hour format, no colon). The time may be preceded with the single character '<samp>a</samp>' to indicate that the event should end (that is, the NPC should arrive at the destination) at the given time. In this case, the game will calculate when the event needs to begin. However, the event will never begin before the time specified for the previous event.
    
In the unmodified game, this is only used to synchronise Emily's and Sandy's schedules on Fall 15.
 
In the unmodified game, this is only used to synchronise Emily's and Sandy's schedules on Fall 15.
 
|-
 
|-
| <tt>location</tt>
+
| <samp>location</samp>
| <p>''(optional)'' The location name the NPC should walk towards. If omitted, defaults to the [[Bus Stop|bus stop]] (if married to a player) or their default location.</p><p>'''Note:''' the game has special logic for unlockable locations. If this is JojaMart/Railroad and it's not available yet, the game gets the replacement destination from the first entry in the <tt>{{t|location}}_Replacement</tt> schedule if available; otherwise it switches to the <tt>default</tt> schedule if available, else <tt>spring</tt>. If this is CommunityCenter and it's not available yet, the game switches to the <tt>default</tt> schedule if available, else <tt>spring</tt>.</p>
+
| <p>''(optional)'' The location name the NPC should walk towards. If omitted, defaults to the [[Bus Stop|bus stop]] (if married to a player) or their default location.</p><p>'''Note:''' the game has special logic for unlockable locations. If this is JojaMart/Railroad and it's not available yet, the game gets the replacement destination from the first entry in the <samp>{{t|location}}_Replacement</samp> schedule if available; otherwise it switches to the <samp>default</samp> schedule if available, else <samp>spring</samp>. If this is CommunityCenter and it's not available yet, the game switches to the <samp>default</samp> schedule if available, else <samp>spring</samp>.</p>
 
|-
 
|-
| <tt>tileX</tt><br /><tt>tileY</tt>
+
| <samp>tileX</samp><br /><samp>tileY</samp>
 
| The X and Y [[Modding:Modder Guide/Game Fundamentals#Tiles|tile coordinates]] the NPC should walk towards.
 
| The X and Y [[Modding:Modder Guide/Game Fundamentals#Tiles|tile coordinates]] the NPC should walk towards.
 
|-
 
|-
| <tt>facingDirection</tt>
+
| <samp>facingDirection</samp>
 
| ''(optional)'' The direction to face after reaching the destination. The possible values are 0 (up), 1 (right), 2 (down), and 3 (left). Defaults to down.
 
| ''(optional)'' The direction to face after reaching the destination. The possible values are 0 (up), 1 (right), 2 (down), and 3 (left). Defaults to down.
 
|-
 
|-
| <tt>animation</tt>
+
| <samp>animation</samp>
| ''(optional)'' The animation to play when the NPC reaches the destination. This must be a key that appears in the <tt>Content/Data/animationDescriptions.xnb</tt> file. Each key entry has three parts: pre animation/looping animation/post animation. The numbers on them refer to the [[Modding:NPC data#Overworld sprites|overworld sprite frame]]. The pre animation will play after arriving at the schedule point. Then the looping animation will loop until the end of schedule time. Finally, the post animation will play before moving on to the next schedule point. Note that each frame is around 120ms so duplicates of frame is used to get desired looking animation.
+
| ''(optional)'' The animation to play when the NPC reaches the destination. This must be a key that appears in the <samp>Content/Data/animationDescriptions.xnb</samp> file. Each key entry has three parts: pre animation/looping animation/post animation. The numbers on them refer to the [[Modding:NPC data#Overworld sprites|overworld sprite frame]]. The pre animation will play after arriving at the schedule point. Then the looping animation will loop until the end of schedule time. Finally, the post animation will play before moving on to the next schedule point. Note that each frame is around 120ms so duplicates of frame is used to get desired looking animation.
 
|-
 
|-
| <tt>dialogue</tt>
+
| <samp>dialogue</samp>
| <p>''(optional)'' The dialogue the NPC should use when they reach their destination. This must be an [[Modding:Modder Guide/APIs/Content|asset name]] and entry key in this exact format (including quotes): <tt>"assetName:key"</tt>. Any slashes in the asset name should be double backslashes (<tt>\\</tt>). The format of the entry key doesn't matter, it just needs to match one in the file.</p><p>For example, <tt>"Strings\\schedules\\Abigail:Sun.000"</tt> means "open the file at <tt>Strings\schedules\Abigail.xnb</tt> and get the text of the <tt>Sun.000</tt> key".
+
| <p>''(optional)'' The dialogue the NPC should use when they reach their destination. This must be an [[Modding:Modder Guide/APIs/Content|asset name]] and entry key in this exact format (including quotes): <samp>"assetName:key"</samp>. Any slashes in the asset name should be double backslashes (<samp>\\</samp>). The format of the entry key doesn't matter, it just needs to match one in the file.</p><p>For example, <samp>"Strings\\schedules\\Abigail:Sun.000"</samp> means "open the file at <samp>Strings\schedules\Abigail.xnb</samp> and get the text of the <samp>Sun.000</samp> key".
 
|}
 
|}
  
107,325

edits

Navigation menu