Cambios

12 819 bytes añadidos ,  16:38 23 ene 2023
pushed edit blocked by new user mass edit filter
Línea 5: Línea 5:  
==Raw data==
 
==Raw data==
 
La información de horarios es guardada en <samp>Content/Characters/schedules/*.xnb</samp> (uno para cada personaje), los que pueden ser [[Modding:Editing XNB files#unpacking|descomprimidos para editar]]. Como ejemplo, esta es la información de Abigail (de la versión {{version|1.5.1}}):
 
La información de horarios es guardada en <samp>Content/Characters/schedules/*.xnb</samp> (uno para cada personaje), los que pueden ser [[Modding:Editing XNB files#unpacking|descomprimidos para editar]]. Como ejemplo, esta es la información de Abigail (de la versión {{version|1.5.1}}):
 +
 +
{{collapse|Data|content=<syntaxhighlight lang="json">
 +
{
 +
  "rain": "900 SeedShop 9 5 0/1100 SeedShop 13 20 0/1300 SeedShop 39 5 0/1500 SeedShop 7 9 2/1900 SeedShop 6 4 0/2200 SeedShop 1 9 3 abigail_sleep",
 +
  "rain2": "900 SeedShop 34 5 0/1100 SeedShop 9 17 3/1400 Saloon 42 17 2 abigail_sit_down/2000 SeedShop 1 9 3 abigail_sleep",
 +
  "winter_15": "900 SeedShop 39 5 0/1030 ScienceHouse 5 19 1/1430 Beach 30 34 2 \"Strings\\schedules\\Abigail:winter_15.000\"/2400 SeedShop 1 9 3 abigail_sleep",
 +
  "marriage_Mon": "830 SeedShop 6 19 0 \"Strings\\schedules\\Abigail:marriage_Mon.000\"/1300 Town 47 87 0 \"Strings\\schedules\\Abigail:marriage_Mon.001\"/1700 Saloon 33 18 0 \"Strings\\schedules\\Abigail:marriage_Mon.002\"/2030 BusStop -1 23 3",
 +
  "marriage_Fri": "800 SeedShop 36 9 0 \"Strings\\schedules\\Abigail:marriage_Fri.000\"/1100 Mountain 49 31 2 abigail_flute/1500 Saloon 42 17 2 abigail_sit_down \"Strings\\schedules\\Abigail:marriage_Fri.001\"/2030 BusStop -1 23 3",
 +
  "fall_Mon": "900 SeedShop 10 5 0/1100 Beach 13 39 2/1800 SeedShop 1 9 3 abigail_sleep",
 +
  "6": "900 SeedShop 39 5 0/1030 SeedShop 2 20 3/1500 Mountain 46 23 2 abigail_flute/2000 SeedShop 1 9 3 abigail_sleep",
 +
  "16": "GOTO 6",
 +
  "spring_4": "900 SeedShop 11 5 0 \"Strings\\schedules\\Abigail:spring_4.000\"/1230 Hospital 13 14 0 \"Strings\\schedules\\Abigail:spring_4.001\"/1330 Hospital 4 6 1 \"Strings\\schedules\\Abigail:spring_4.002\"/1600 SeedShop 10 5 0/2000 SeedShop 1 9 3 abigail_sleep",
 +
  "Sun": "900 SeedShop 4 5 0/1030 SeedShop 20 5 1 \"Strings\\schedules\\Abigail:Sun.000\"/1300 Forest 14 40 2/2000 SeedShop 1 9 3 abigail_sleep",
 +
  "11_6": "GOTO spring",
 +
  "25_6": "GOTO spring",
 +
  "11": "NOT friendship Sebastian 6/1000 SebastianRoom 5 4 2 abigail_sit_down/1700 SeedShop 1 9 3 abigail_sleep",
 +
  "25": "NOT friendship Sebastian 6/GOTO 11",
 +
  "Wed": "1000 ArchaeologyHouse 11 9 0/1800 Town 47 87 0/2200 SeedShop 1 9 3 abigail_sleep",
 +
  "Fri": "900 SeedShop 34 5 0/1100 SeedShop 9 17 3/1500 Saloon 42 17 2 abigail_sit_down/2100 SeedShop 1 9 3 abigail_sleep",
 +
  "fall": "900 SeedShop 39 5 0/1030 SeedShop 2 20 3/1300 BusStop 22 5 2/1700 SeedShop 3 6 0 abigail_videogames/1930 SeedShop 1 9 3 abigail_sleep",
 +
  "winter": "900 SeedShop 39 5 0/1030 ScienceHouse 5 19 1/1430 SeedShop 3 6 0 abigail_videogames/1930 SeedShop 1 9 3 abigail_sleep",
 +
  "summer": "900 SeedShop 39 5 0/1030 Railroad 30 45 0/1400 Mountain 49 31 1/1740 SeedShop 3 6 0 abigail_videogames/1930 SeedShop 1 9 3 abigail_sleep",
 +
  "spring": "900 SeedShop 39 5 0/1030 SeedShop 2 20 3/1300 Town 73 54 2/1630 SeedShop 3 6 0 abigail_videogames/1930 SeedShop 1 9 3 abigail_sleep"
 +
}
 +
</syntaxhighlight>}}
    
==Clave/nombre de horario==
 
==Clave/nombre de horario==
 
Cada horario tiene un nombre, para decidir cuándo se aplica. Debe seguir el siguiente formato (no es dinámico). Si múltiples horarios coinciden, el juego usará el primero de estos.
 
Cada horario tiene un nombre, para decidir cuándo se aplica. Debe seguir el siguiente formato (no es dinámico). Si múltiples horarios coinciden, el juego usará el primero de estos.
 +
 
Notas:
 
Notas:
 
* La mayoría de texto diferencia las mayúsculas (''e.j.,'' <samp>Mon</samp> no es lo mismo que <samp>mon</samp>).
 
* La mayoría de texto diferencia las mayúsculas (''e.j.,'' <samp>Mon</samp> no es lo mismo que <samp>mon</samp>).
Línea 29: Línea 55:  
| Se aplica ese día si no está lloviendo.<br /><small>Ejemplo: <samp>marriage_Mon</samp></small>
 
| Se aplica ese día si no está lloviendo.<br /><small>Ejemplo: <samp>marriage_Mon</samp></small>
 
|}
 
|}
 +
 +
===Horarios normales===
 +
These schedules apply to any non-marriage NPC. If none of these keys match, they won't have a schedule for that day.
 +
 +
{| class="wikitable"
 +
|-
 +
! syntax
 +
! summary
 +
|-
 +
| <samp>{{t|season}}_{{t|day of month}}</samp>
 +
| Applies on the given date.<br /><small>Example: <samp>spring_15</samp></small>
 +
|-
 +
| <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: <samp>11_6</samp></small>
 +
|-
 +
| <samp>{{t|day of month}}</samp>
 +
| Applies on the given day of month.<br /><small>Example: <samp>16</samp></small>
 +
|-
 +
| <samp>bus</samp>
 +
| For [[Pam]] only, applies if the bus is repaired.
 +
|-
 +
| <samp>rain2</samp>
 +
| 50% chance of applying on rainy days.
 +
|-
 +
| <samp>rain</samp>
 +
| Applies on rainy days.
 +
|-
 +
| <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: <samp>spring_Mon_6</samp></small>
 +
|-
 +
| <samp>{{t|season}}_{{t|day of week}}</samp>
 +
| Applies in the given season and day of week.<br /><small>Example: <samp>spring_Mon</samp></small>
 +
|-
 +
| <samp>{{t|day of week}}</samp>
 +
| Applies in the given day of week.<br /><small>Example: <samp>Mon</samp></small>
 +
|-
 +
| <samp>{{t|season}}</samp>
 +
| Applies in the given season.<br /><small>Example: <samp>spring</samp></small>
 +
|-
 +
| <samp>spring_{{t|day of week}}</samp>
 +
| Applies (in any season) on the given day of week.<br /><small>Example: <samp>spring_Mon</samp></small>
 +
|-
 +
| <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: <samp>spring_Mon_6</samp></small>
 +
|-
 +
| <samp>spring</samp>
 +
| Always applies. This schedule is also used as a default in some cases. DO NOT REMOVE THIS ENTRY. THAT WILL BREAK THE GAME.
 +
|-
 +
| <samp>default</samp>
 +
| Also used as a default sometimes. It's okay for this one to not exist, spring will be used instead.
 +
|}
 +
 +
==Schedule script==
 +
Each schedule entry value has an arbitrary number of slash-delimited schedule commands matching one of the formats below.
 +
 +
===Initial commands===
 +
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"
 +
|-
 +
! command
 +
! description
 +
|-
 +
| <samp>GOTO {{t|key}}</samp>
 +
| (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. The key does not need to be one of the standard keys and can be any arbitrary string. 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>
 +
|-
 +
| <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 <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>
 +
|-
 +
| <samp>NOT</samp>
 +
| Command ignored if the next word is not <samp>friendship</samp>.
 +
|-
 +
| <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 <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 summer</samp> if the bus is repaired, or <samp>GOTO spring</samp> if it isn't; not limited to <samp>GOTO</samp> commands).</small>
 +
|-
 +
| <samp>GOTO {{t|key}}</samp>
 +
| (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===
 +
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:
 +
: <samp>{{t|time}} {{o|location}} {{t|tileX}} {{t|tileY}} {{o|facingDirection}} {{o|animation}} {{o|dialogue}}</samp>
 +
 +
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"
 +
|-
 +
! field
 +
! description
 +
|-
 +
| <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 '<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.
 +
|-
 +
| <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 <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>
 +
|-
 +
| <samp>tileX</samp><br /><samp>tileY</samp>
 +
| The X and Y [[Modding:Modder Guide/Game Fundamentals#Tiles|tile coordinates]] the NPC should walk towards.
 +
|-
 +
| <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.
 +
|-
 +
| <samp>animation</samp>
 +
| ''(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. <br /><br />There are a few special animations. <samp>sleep</samp> anywhere in an animation name causes the NPC to go to sleep (which, among other things, prevents players from gifting or talking to the NPC while the animation is active.) The specific animation <samp>NPCName_sleep</samp> (with the NPCName fully lowercased) automatically used by spouses when they turn in for the night, and by NPCs coming home from Ginger Island. <samp>square_X_Y_facing</samp> causes NPCs to make random movements in a rectangle of at most X by Y (it can be less), centered at the schedule point. They will occasionally pause and face the <samp>facing</samp> direction. <samp>change_beach</samp> and <samp>change_normal</samp> cause NPCs to change into and out of their beach outfits, and is used by Ginger Island resort schedules.
 +
|-
 +
| <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): <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".
 +
|}
 +
 +
For example, consider this schedule entry in Abigail's schedule:
 +
<pre>1300 Town 47 87 0 "Strings\\schedules\\Abigail:marriage_Mon.001"</pre>
 +
 +
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.''"
 +
 +
==Potential issues==
 +
* Using a time of 600 (when the day starts) for an event may not work. Try using 610 if you want an event early in the morning and the NPC doesn't move if you use 600.
 +
 +
[[Category:Modding]]
 +
 +
[[en:Modding:Schedule data]]
 +
[[ru:Модификации:Расписание]]
105 900

ediciones