Line 131: |
Line 131: |
| | | |
| ===Schedule points=== | | ===Schedule points=== |
− | <source lang="yaml"> | + | 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: |
− | <time> <map> <coord x y> <position> <animation> <Strings>
| + | : <tt>{{t|time}} {{o|location}} {{t|tileX}} {{t|tileY}} {{o|facingDirection}} {{o|animation}} {{o|dialogue}}</tt> |
− | </source> | |
| | | |
− | * {{t|time}} is the time at which the schedule event begins, in military time (24 hour format, no colon)
| + | 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>dialogue</tt>, but you can't skip <tt>animation</tt> and then specify <tt>dialogue</tt>). |
− | * {{o|map}} is the map on which the target location is
| |
− | * {{o|coord x y}} is the x and y coordinates of the target location, without a comma
| |
− | * {{o|position}} The direction the NPC actor shall face once reaching the target location.
| |
− | * {{o|animation}} (optional): is the animation the NPC actor will execute at reaching the target location.
| |
− | * {{o|Strings}} (optional): This is managed from strings/schedule/<NPC Name>. A specific format must be followed!
| |
| | | |
− | At {{t|time}} the NPC begins to travel to the target location. Once there, {{o|animation}} is executed until the next schedule event begins. There is possibly no limit to how many schedule events one schedule entry may contain.
| + | {| class="wikitable" |
| + | |- |
| + | ! field |
| + | ! description |
| + | |- |
| + | | <tt>time</tt> |
| + | | The time at which the schedule event begins, in military time (24 hour format, no colon). |
| + | |- |
| + | | <tt>location</tt> |
| + | | <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> |
| + | |- |
| + | | <tt>tileX</tt><br /><tt>tileY</tt> |
| + | | The X and Y [[Modding:Modder Guide/Game Fundamentals#Tiles|tile coordinates]] the NPC should walk towards. |
| + | |- |
| + | | <tt>facingDirection</tt> |
| + | | ''(optional)'' The direction to face after reaching the destination. Defaults to down. |
| + | |- |
| + | | <tt>animation</tt> |
| + | | ''(optional)'' The animation to play when the NPC reaches the destination. |
| + | |- |
| + | | <tt>dialogue</tt> |
| + | | <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>).</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". |
| + | |} |
| | | |
− | Strings format: {{o|\"Strings\\schedule\\NPC:schedule.000\"}} Where NPC is the chosen NPC file you are accessing in Strings/schedule. 'schedule' depends on the schedule itself.
| + | For example, consider this schedule entry in Abigail's schedule: |
| + | <pre>1300 Town 47 87 0 "Strings\\schedules\\Abigail:marriage_Mon.001"</pre> |
| | | |
− | If you are using "spring" then you must put spring.000, ect. Depending on how many times you have the schedule manage dialogue.
| + | At 13:00 (1pm), Abigail will begin walking to tile (47, 87) in the Town location. When she reaches it, she'll face direction 0 (up) and say "''Hey, @. I like to relax here... it's so peaceful.''" |
− | | |
− | (If you have three "spring" scheduled dialogues.. each must be spring.000, spring.001, and spring.002). | |
− | | |
− | Full Example Coding: {{o|1030 SeedShop 20 5 1 \"Strings\\schedules\\Abigail:Sun.000\"}}
| |
− | | |
− | This means in Abigail's {{t|Sun}} schedule, she will go to her mother's room at 1030 and access {{o|Sun.000}} which reads {{t|"Sun.000": "We're hiding in here so we don't have to talk to anyone.",}}
| |
| | | |
| ==Potential issues== | | ==Potential issues== |