Изменения

м
Замена текста — «tt>» на «samp>»
Строка 1: Строка 1:  
← [[Модификации:Индекс|Индекс]]
 
← [[Модификации:Индекс|Индекс]]
{{Переведите}}
+
 
 
На этой странице объясняется, как игра хранит и использует данные [[Праздники|фестивалей]]. Это расширенное руководство для разработчиков модов.
 
На этой странице объясняется, как игра хранит и использует данные [[Праздники|фестивалей]]. Это расширенное руководство для разработчиков модов.
   −
==Data file==
+
==Файл данных==
Each festival has a data file located at <tt>Content/Data/Festivals/&lt;season&gt;&lt;day of month&gt;</tt>. The game uses this asset to determine whether there's a festival today (if the asset exists), where and when it happens, and NPC placement/dialogue/behavior.
+
У каждого фестиваля есть файл данных, расположенный в <samp>Content/Data/Festivals/&lt;season&gt;&lt;day of month&gt;</samp>. Игра использует этот файл, чтобы определить, будет ли сегодня фестиваль (если файл существует), где и когда он произойдёт, а также размещение/диалог/поведение NPC.
   −
===Raw data===
+
===Данные===
The festival data file can be [[Modding:Editing XNB files#unpacking|unpacked for editing]]. For example, here's the raw data from <tt>Content/Data/Festivals/fall27</tt> as of {{version|1.5.4}} for reference:
+
Файл данных фестиваля может быть [[Модификации:Редактирование_XNB_файлов#Распаковывание и упаковывание ресурсов|распакован для редактирования]]. Например, вот данные из <samp>Content/Data/Festivals/fall27</samp> начиная с {{version|1.5.4}} для справки:
{{collapse|Data|content=<syntaxhighlight lang="json">
+
{{collapse|Данные|content=<syntaxhighlight lang="json">
 
{
 
{
 
   "name": "Spirit's Eve",
 
   "name": "Spirit's Eve",
Строка 59: Строка 59:  
</syntaxhighlight>}}
 
</syntaxhighlight>}}
   −
===Format===
+
===Формат===
{| class="wikitable"
+
{|class="wikitable"
 
|-
 
|-
! field key
+
! Ключ поля
! explanation
+
! Описание
 
|-
 
|-
| <tt>name</tt>
+
| <samp>name</samp>
| The festival name. This is used in display text like the calendar tooltip or the festival-is-ready message.
+
| Название фестиваля. Используется в отображаемом тексте, таком как всплывающая подсказка календаря или сообщение о готовности к фестивалю.
 
|-
 
|-
| <tt>conditions</tt>
+
| <samp>conditions</samp>
| When and where the festival takes place. The format is <tt>{{t|location}}/{{t|start time}} {{t|end time}}</tt>, where {{t|location}} is the internal location name and the times are specified in 26-hour format (i.e. 600 for 6am to 2600 for 2am).
+
| Когда и где проходит фестиваль. В формате <samp>{{t|location}}/{{t|start time}} {{t|end time}}</samp>, где {{t|location}} это расположение внутри указанной локации и время в 26-часовом формате (т.е. 600 для 6 утра и 2600 для 2 ночи).
 
|-
 
|-
| <tt>shop</tt>
+
| <samp>shop</samp>
| The items the festival shop sells. See ''[[#Shop format|shop format]]'' below.
+
| Товары, которые продает фестивальный магазин. Смотри ''[[#Формат магазина|формат магазина]]'' ниже.
 
|-
 
|-
| <tt>set-up</tt>
+
| <samp>set-up</samp>
| The [[Modding:Event data|event script]] that's run when the player first enters the festival. This includes moving the player to the festival map. This field supports [[#Year variants|year variants]].
+
| [[Модификации:События|Скрипт события]] запускается, когда игрок впервые попадает на фестиваль. Включает в себя перемещение игрока на карту фестиваля. Это поле поддерживает [[#Варианты года|варианты года]].
 
|-
 
|-
| <tt>Set-Up_additionalCharacters</tt>
+
| <samp>Set-Up_additionalCharacters</samp>
| NPCs to spawn when the festival loads. This is specified as four space-delimited fields in the form <tt>{{t|NPC name}} {{t|tile X}} {{t|tile Y}} {{t|facing direction}}</tt>, repeated for each NPC to add with a <code>/</code> between each NPC. The {{t|facing direction}}</tt> can be one of <tt>up</tt> or <tt>0</tt>, <tt>down</tt> or <tt>2</tt>, <tt>left</tt> or <tt>3</tt>, and <tt>right</tt> or <tt>1</tt>. These are additional to the NPCs spawned via the [[#Map|map file]]. For example, this adds Abigail and Leah side-by-side facing down: <syntaxhighlight lang="javascript">"Set-Up_additionalCharacters": "Abigail 15 6 down/Leah 16 6 down"</syntaxhighlight>
+
| NPC, которые будут появляться при загрузке фестиваля. Указывается в виде четырех полей, разделенных пробелами, в форме<samp>{{t|NPC name}} {{t|tile X}} {{t|tile Y}} {{t|facing direction}}</samp>, повторяется для каждого NPC, для разделения NPC используется разделитель <code>/</code>. {{t|facing direction}}</samp> может быть одним из следующих значений: <samp>up</samp> или <samp>0</samp>, <samp>down</samp> ил <samp>2</samp>, <samp>left</samp> или <samp>3</samp>, и <samp>right</samp> или <samp>1</samp>. Они являются дополнительными к NPC, порожденным через [[#Карта|файл карты]]. Например, для добавления Абигейл и Леи рядом друг с другом лицом вниз нужно написать следующее: <syntaxhighlight lang="javascript">"Set-Up_additionalCharacters": "Abigail 15 6 down/Leah 16 6 down"</syntaxhighlight>
 
|-
 
|-
| <tt>{{t|NPC name}}_spouse</tt>
+
| <samp>{{t|NPC name}}_spouse</samp>
| The [[Modding:Dialogue#Format|dialog line]] the named NPC will say when the player talks to them, if they're married to the player. This field supports [[#Year variants|year variants]].
+
| [[Модификации:Диалоги#Формат|Диалоговая строка]], указанный NPC сообщит, когда игрок поговорит с ними, женаты ли они на игроке. Поддерживает [[#Варианты года|варианты года]].
 
|-
 
|-
| <tt>{{t|NPC name}}</tt>
+
| <samp>{{t|NPC name}}</samp>
| The [[Modding:Dialogue#Format|dialog line]] the named NPC will say when the player talks to them, if <tt>{{t|NPC name}}_spouse</code></tt> doesn't exist or apply. This field supports [[#Year variants|year variants]].
+
| [[Модификации:Диалоги#Формат|Диалоговая строка]], указанный NPC сообщит, когда игрок поговорит с ними, если <samp>{{t|NPC name}}_spouse</code></samp> не существует или не используется. Поддерживает [[#Варианты года|варианты года]].
 
|}
 
|}
   −
Any other entry is [[Modding:Event data|event data]] for a cutscene during the festival. In some cases like the [[Luau]], these are linked together when played in the game.
+
Любая другая запись используется [[Модификации:События|event data]] для роликов во время фестиваля. В некоторых случаях, таких как [[Луау]], они связаны друг с другом.
   −
===Year variants===
+
===Варианты года===
Several fields allow annual variants (documented in the table above). These work by prefixing <tt>_y{{t|year variant}}</tt> to the key, where the {{t|year variant}} is an incrementing number starting at 1 with no upper limit. For example, two entries <tt>set-up_y1</tt> and <tt>set-up_y2</tt> will alternate (<tt>set-up_y1</tt> in year 1, <tt>set-up_y2</tt> in year 2, <tt>set-up_y1</tt> in year 3, etc). If year variants are defined for a key, the original key is ignored (e.g. <tt>set-up</tt> will never be used if <tt>set-up_y*</tt> entries are defined).
+
Несколько полей допускают варианты года (смотри в таблице выше). Они работают с помощью префикса <samp>_y{{t|year variant}}</samp>, Где {{t|year variant}} увеличивающееся число, начинающимся с 1, без верхнего предела. Например, две записи <samp>set-up_y1</samp> and <samp>set-up_y2</samp> будут чередоваться (<samp>set-up_y1</samp> в 1 годы, <samp>set-up_y2</samp> во 2 году, <samp>set-up_y1</samp> в 3 году, и т.д.). Если для ключа определены варианты года, исходный ключ игнорируется (например, <samp>set-up</samp> никогда не будет использоваться, если <samp>set-up_y*</samp> записи определены).
   −
===Shop format===
+
===Формат магазина===
The shop data for a festival is stored as four space-separated values in the format <tt>{{t|item type}} {{t|item ID}} {{t|cost}} {{t|count available}}</tt>, which is repeated for each item. Field formats:
+
Данные магазина для фестиваля хранятся в виде четырех значений, разделенных пробелами, в формате <samp>{{t|item type}} {{t|item ID}} {{t|cost}} {{t|count available}}</samp>, который повторяется для каждого элемента. Форматы полей:
   −
{| class="wikitable"
+
{|class="wikitable"
 
|-
 
|-
! field
+
! Поле
! explanation
+
! Описание
 
|-
 
|-
 
| {{t|item type}}
 
| {{t|item type}}
| The item type. The valid values are <tt>B</tt> or <tt>Boots</tt> (boots), <tt>BL</tt> or <tt>Blueprint</tt> (blueprint), <tt>BBL</tt>, <tt>BBl</tt> or <tt>BigBlueprint</tt> (big blueprint), <tt>BO</tt> or <tt>BigObject</tt> (bigcraftable object), <tt>F</tt> (furniture), <tt>H</tt> or <tt>Hat</tt> (hat), <tt>O</tt> or <tt>Object</tt> (object), <tt>R</tt> or <tt>Ring</tt> (ring), or <tt>W</tt> or <tt>Weapon</tt> (weapon).
+
| Тип предмета. Допустимыми значениями являются <samp>B</samp> или <samp>Boots</samp> (ботинки), <samp>BL</samp> или<samp>Blueprint</samp> (чертежи), <samp>BBL</samp>, <samp>BBl</samp> или <samp>BigBlueprint</samp> (большие чертежи), <samp>BO</samp> или <samp>BigObject</samp> (большой объект, пригодный для изготовления), <samp>F</samp> (мебель), <samp>H</samp> или <samp>Hat</samp> (шляпа), <samp>O</samp> или <samp>Object</samp> (объект), <samp>R</samp> или<samp>Ring</samp> (кольцо), или <samp>W</samp> или <samp>Weapon</samp> (оружие).
 
|-
 
|-
| <tt>{{t|item id}}</tt>
+
| <samp>{{t|item id}}</samp>
| The item's spritesheet index.
+
| ID элемента в спрайт-листе.
 
|-
 
|-
| <tt>{{t|cost}}</tt>
+
| <samp>{{t|cost}}</samp>
| The purchase price in gold. For seeds, this is modified based on the [[Multiplayer#Profit margins|profit margin]].
+
| Цена покупки в золоте. Для семян это модифицировано на основе [[Совместная_игра#Маржа|маржи]].
 
|-
 
|-
| <tt>{{t|count available}}</tt>
+
| <samp>{{t|count available}}</samp>
| How many of that item can be purchased from the shop, or <tt>-1</tt> for unlimited.
+
| Сколько этих товаров можно приобрести в магазине, или <samp>-1</samp> для неограниченного количества.
 
|}
 
|}
   −
==Map==
+
==Карта==
Many festivals use a separate [[Modding:Maps|map file]] located in the <tt>Content/Maps</tt> folder. The map to use is specified in the [[#Data file|data file]]'s <tt>set-up</tt> field using the <tt>changeToTemporaryMap</tt> command.
+
Многие фестивали используют отдельные [[Модификации:Карты|файлы карты]] расположенные в папке <samp>Content/Maps</samp>. Карта для использования указана в [[#Файл данных|файле данных]] <samp>set-up</samp> поле, использующее команду <samp>changeToTemporaryMap</samp>.
   −
===Spawned NPCs===
+
===Создание NPC===
{{note box|'''This is fragile and not recommended for custom NPCs or festivals.'''<br />Consider using the [[#Data file|data file]]'s <tt>Set-Up_additionalCharacters</tt> field instead.}}
+
{{note box|'''Это хрупко и не рекомендуется для пользовательских NPC или фестивалей.'''<br />Рассмотрите возможность использования [[#Файл данных|файлов данных]] поля <samp>Set-Up_additionalCharacters</samp> вместо этого.}}
   −
NPCs can be added to festivals using map tile indexes on a specific layer. This is enabled in the [[#Data file|data file]]'s <tt>set-up</tt> field using the <tt>loadActors {{t|layer name}}</tt> command. For each tile which exists on the layer, the tile index is mapped to the NPC's index in the <tt>Data\NPCDispositions</tt> asset multiplied by four, with an offset which determines the facing direction (0 = up, 1 = right, 2 = down, or 3 = left).
+
NPC можно добавлять на фестивали, используя индексы тайлов карты на определенном слое. Это включено в [[#Файл данных|файле данных]] <samp>set-up</samp> поле, использующее команду <samp>loadActors {{t|layer name}}</samp>. Для каждого тайла, существующего на слое, индекс тайла сопоставляется с индексом NPC в <samp>Data\NPCDispositions</samp>, умноженный на четыре, со смещением, которое определяет направление поворота (0 = вверх, 1 = вправо, 2 = вниз, или 3 = влево).
   −
For example, let's say the layer has a tile with tilesheet index 61. That's the NPC at index <tt>61 / 4 = 15</tt> in <tt>Data\NPCDispositions</tt>, i.e. the 16th NPC, i.e. Leah. The offset is <tt>61 % 4 = 1</tt>, so she's facing right. When the festival is loaded, Leah will be added to that tile position facing right.
+
Например, предположим, что слой содержит тайл с индексом равным 61. NPC в индексе <samp>61 / 4 = 15</samp> в <samp>Data\NPCDispositions</samp>, т.е. 16-й NPC, т.е. Лея. Смещение равно <samp>61 % 4 = 1</samp>, так что она смотрит направо. Когда фестиваль будет загружен, Лея будет добавлена в положение тайла, смотрящей вправо.
   −
==Hardcoded logic==
+
==Жестко закодированная логика==
Several vanilla events have hardcoded scripted logic in the game code. For example, Lewis judging the farmer's grange display at the [[Stardew Valley Fair]] is handled in the game code, not the content assets documented here.
+
Несколько событий ванилы имеют жестко запрограммированную логику сценария в игровом коде. Например, Льюис, оценивающий выставку на [[Ярмарка долины Стардью|Ярмарке долины Стардью]]обрабатывается в коде игры, а не в ресурсах контента, описанных выше.
   −
The [[Night Market]] is also handled differently from other festivals. While there are separate Night Market maps, the NPC data doesn't exist on these. Instead, NPCs dynamically enter and leave the festival via schedule data.
+
[[Ночной рынок]] также обрабатывается иначе, чем на других фестивалях. Хотя существуют отдельные карты ночного рынка, данных NPC на них не существует. Вместо этого NPC динамически входят и покидают фестиваль с помощью данных расписания.
    
[[Category:Модификации]]
 
[[Category:Модификации]]
[[en:Modding:Festival]]
+
 
 +
[[en:Modding:Festival data]]