Модификации:Фестивали: различия между версиями

Материал из Stardew Valley Wiki
Перейти к навигации Перейти к поиску
(correct en link)
Строка 3: Строка 3:
 
На этой странице объясняется, как игра хранит и использует данные [[Праздники|фестивалей]]. Это расширенное руководство для разработчиков модов.
 
На этой странице объясняется, как игра хранит и использует данные [[Праздники|фестивалей]]. Это расширенное руководство для разработчиков модов.
  
==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.
+
У каждого фестиваля есть файл данных, расположенный в <tt>Content/Data/Festivals/&lt;season&gt;&lt;day of month&gt;</tt>. Игра использует этот файл, чтобы определить, будет ли сегодня фестиваль (если файл существует), где и когда он произойдёт, а также размещение/диалог/поведение 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_файлов#Распаковывание и упаковывание ресурсов|распакован для редактирования]]. Например, вот данные из <tt>Content/Data/Festivals/fall27</tt> начиная с {{version|1.5.4}} для справки:
 
{{collapse|Data|content=<syntaxhighlight lang="json">
 
{{collapse|Data|content=<syntaxhighlight lang="json">
 
{
 
{
Строка 59: Строка 59:
 
</syntaxhighlight>}}
 
</syntaxhighlight>}}
  
===Format===
+
===Формат===
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field key
+
! Ключ поля
! explanation
+
! Описание
 
|-
 
|-
 
| <tt>name</tt>
 
| <tt>name</tt>
| The festival name. This is used in display text like the calendar tooltip or the festival-is-ready message.
+
| Название фестиваля. Используется в отображаемом тексте, таком как всплывающая подсказка календаря или сообщение о готовности к фестивалю.
 
|-
 
|-
 
| <tt>conditions</tt>
 
| <tt>conditions</tt>
| 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).
+
| Когда и где проходит фестиваль. В формате <tt>{{t|location}}/{{t|start time}} {{t|end time}}</tt>, где {{t|location}} это расположение внутри указанной локации и время в 26-часовом формате (т.е. 600 для 6 утра и 2600 для 2 ночи).
 
|-
 
|-
 
| <tt>shop</tt>
 
| <tt>shop</tt>
| The items the festival shop sells. See ''[[#Shop format|shop format]]'' below.
+
| Товары, которые продает фестивальный магазин. Смотри ''[[#Формат магазина|формат магазина]]'' ниже.
 
|-
 
|-
 
| <tt>set-up</tt>
 
| <tt>set-up</tt>
| 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>
 
| <tt>Set-Up_additionalCharacters</tt>
| 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, которые будут появляться при загрузке фестиваля. Указывается в виде четырех полей, разделенных пробелами, в форме<tt>{{t|NPC name}} {{t|tile X}} {{t|tile Y}} {{t|facing direction}}</tt>, повторяется для каждого NPC, для разделения NPC используется разделитель <code>/</code>. {{t|facing direction}}</tt> может быть одним из следующих значений: <tt>up</tt> или <tt>0</tt>, <tt>down</tt> ил <tt>2</tt>, <tt>left</tt> или <tt>3</tt>, и <tt>right</tt> или <tt>1</tt>. Они являются дополнительными к NPC, порожденным через [[#Карта|файл карты]]. Например, для добавления Абигейл и Леи рядом друг с другом лицом вниз нужно написать следующее: <syntaxhighlight lang="javascript">"Set-Up_additionalCharacters": "Abigail 15 6 down/Leah 16 6 down"</syntaxhighlight>
 
|-
 
|-
 
| <tt>{{t|NPC name}}_spouse</tt>
 
| <tt>{{t|NPC name}}_spouse</tt>
| 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>
 
| <tt>{{t|NPC name}}</tt>
| 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 сообщит, когда игрок поговорит с ними, если <tt>{{t|NPC name}}_spouse</code></tt> не существует или не используется. Поддерживает [[#Варианты года|варианты года]].
 
|}
 
|}
  
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).
+
Несколько полей допускают варианты года (смотри в таблице выше). Они работают с помощью префикса <tt>_y{{t|year variant}}</tt>, Где {{t|year variant}} увеличивающееся число, начинающимся с 1, без верхнего предела. Например, две записи <tt>set-up_y1</tt> and <tt>set-up_y2</tt> будут чередоваться (<tt>set-up_y1</tt> в 1 годы, <tt>set-up_y2</tt> во 2 году, <tt>set-up_y1</tt> в 3 году, и т.д.). Если для ключа определены варианты года, исходный ключ игнорируется (например, <tt>set-up</tt> никогда не будет использоваться, если <tt>set-up_y*</tt> записи определены).
  
===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:
+
Данные магазина для фестиваля хранятся в виде четырех значений, разделенных пробелами, в формате <tt>{{t|item type}} {{t|item ID}} {{t|cost}} {{t|count available}}</tt>, который повторяется для каждого элемента. Форматы полей:
  
 
{| 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).
+
| Тип предмета. Допустимыми значениями являются <tt>B</tt> или <tt>Boots</tt> (ботинки), <tt>BL</tt> или<tt>Blueprint</tt> (чертежи), <tt>BBL</tt>, <tt>BBl</tt> или <tt>BigBlueprint</tt> (большие чертежи), <tt>BO</tt> или <tt>BigObject</tt> (большой объект, пригодный для изготовления), <tt>F</tt> (мебель), <tt>H</tt> или <tt>Hat</tt> (шляпа), <tt>O</tt> или <tt>Object</tt> (объект), <tt>R</tt> или<tt>Ring</tt> (кольцо), или <tt>W</tt> или <tt>Weapon</tt> (оружие).
 
|-
 
|-
 
| <tt>{{t|item id}}</tt>
 
| <tt>{{t|item id}}</tt>
| The item's spritesheet index.
+
| ID элемента в спрайт-листе.
 
|-
 
|-
 
| <tt>{{t|cost}}</tt>
 
| <tt>{{t|cost}}</tt>
| The purchase price in gold. For seeds, this is modified based on the [[Multiplayer#Profit margins|profit margin]].
+
| Цена покупки в золоте. Для семян это модифицировано на основе [[Совместная_игра#Маржа|маржи]].
 
|-
 
|-
 
| <tt>{{t|count available}}</tt>
 
| <tt>{{t|count available}}</tt>
| How many of that item can be purchased from the shop, or <tt>-1</tt> for unlimited.
+
| Сколько этих товаров можно приобрести в магазине, или <tt>-1</tt> для неограниченного количества.
 
|}
 
|}
  

Версия 07:34, 6 сентября 2021

Индекс

Robin building.png
“Предстоит ещё много работы...”
— Робин

Неполный перевод

Эта статья или её часть до сих пор не переведены на русский язык. Вы можете оказать помощь в переводе путем ее редактирования.
Последний раз редактировалось Shtompel в 2021-09-06 07:34:01.

На этой странице объясняется, как игра хранит и использует данные фестивалей. Это расширенное руководство для разработчиков модов.

Файл данных

У каждого фестиваля есть файл данных, расположенный в Content/Data/Festivals/<season><day of month>. Игра использует этот файл, чтобы определить, будет ли сегодня фестиваль (если файл существует), где и когда он произойдёт, а также размещение/диалог/поведение NPC.

Данные

Файл данных фестиваля может быть распакован для редактирования. Например, вот данные из Content/Data/Festivals/fall27 начиная с 1.5.4 для справки:

Data 
{
  "name": "Spirit's Eve",
  "conditions": "Town/2200 2350",
  "shop": "BO 113 5000 1 O 746 750 5 BL 746 2000 1 BO 47 350 -1 F 2870 4000 -1",
  "set-up": "spirits_eve/-1000 -1000/farmer 12 54 1/changeToTemporaryMap Town-Halloween/loadActors Set-Up/advancedMove Maru true 0 2 2 0 0 3 -11 0 0 -7 5 0 0 2 4 0/advancedMove Alex true -4 0 4 4000 4 0 4 5000/advancedMove Jas true 1 1500 4 1000/advancedMove Pam true 0 1 1 5000 0 -1 1 5000/advancedMove Shane true -7 0 0 2 2 9000 0 -2 7 0 4 9000/advancedMove Demetrius true 3 18000 4 3000/addTemporaryActor Skeleton 16 32 30 59 2 false Monster/advancedMove Skeleton true 0 1 3 4000 2 0 0 -1 4 2000 -1 0 3 1000 2 2000 0 -1 4 4000 -1 0 0 1 2 5000/addTemporaryActor Skeleton 16 32 35 58 2 false Monster/playerControl halloween",
  "Abigail_spouse": "You'll have to tell me what's beyond, I can't go on... spiders...$s",
  "Leah_spouse": "I may have had a little too much pumpkin ale...",
  "Maru_spouse": "I'm confused... you go on ahead and let me figure this out.",
  "Penny_spouse": "Oh... These vapors... Hmmm... You look nice tonight.$l",
  "Haley_spouse": "I get scared easily... I think I'm just going to stay right here.$s",
  "Sebastian_spouse": "It would be interesting to have one of these on the farm.",
  "Sam_spouse": "Hey, I was wondering when you'd show up!$h",
  "Harvey_spouse": "Hi... I was hoping you'd find me here...$l",
  "Elliott_spouse": "Mmph... I believe I've eaten a few too many slices of pumpkin pie.",
  "Abigail": "I can't go on... spiders...$s",
  "Robin": "Well, winter's almost here. It's a great time to stockpile wood and stone.",
  "Demetrius": "I haven't seen Maru in hours... I hope she's alright.",
  "Maru": "I think I've already been this way... no, wait...$s#$e#I'm lost...$s",
  "Sebastian": "I have no idea how these skeletons are walking... creepy.#$e#It's pretty cool though.",
  "Pierre": "??",
  "Caroline": "I get scared very easily. I'll leave the haunted maze to the younger people.",
  "Linus": "Good show, old friend.",
  "Alex": "There's something weird over there. But how do I get to it?#$e#There's gotta be a secret passage somewhere around here.",
  "George": "Hmm... smoked turkey haunch? I guess this festival isn't all bad.$h",
  "Evelyn": "I wish Gus would include a vegetarian option. Some zucchini skewers, maybe?",
  "Lewis": "Good evening, @. Have you ventured into the haunted maze yet? It's quite spooky.#$e#That strange man who lives in the tower set it all up himself. He wouldn't let anyone near while he was working on it.",
  "Clint": "One of my iridium-infused maces would make quick work of these things.",
  "Emily": "Do you like the jack-o-lanterns? I carved them myself.",
  "Penny": "The vapor from this cauldron... it's making my head spin, but I can't seem to leave...$u",
  "Pam": "I'll come to any event with free grub! You won't see me in the haunted maze, though.",
  "Haley": "Eek! I'm too scared.$s",
  "Jodi": "Vincent's upset that I won't let him go into the haunted maze... but he's just a little boy!",
  "Kent": "Hey, @. Nice evening, isn't it?",
  "Sam": "That's odd... It's just a dead end up ahead.#$e#I could've sworn there was someone ahead of me when I went through the maze, though. Where'd they go?",
  "Leah": "Mm, hi. Sorry... mouth full of blackberries.",
  "Marnie": "Hi, @. Have you had a productive fall?#$e#It's starting to get quite cold... crops won't hold out for much longer.",
  "Elliott": "Why, hello @. It's chilly, isn't it?",
  "Gus": "It's a lot of fun to cook with pumpkin. Such an interesting fruit.",
  "Dwarf": "You say it's raining up above? *gasp*#$e#Rain... It's almost mythical to us. Some of us live our entire lives without ever experiencing it.",
  "Wizard": "The affairs of mundane folk matter little to me, but the elementals like a chance to see you up close.#$e#It was for them that I created this silly maze.",
  "Harvey": "Oh! You found me...$8#$b#The truth is, I got too scared so I came here to hide. Don't tell anyone.$s",
  "Shane": "Why is there no more pumpkin ale?",
  "Sandy": "I heard it's raining back home. Is that why you came here?$h#$e#I kind of miss the rain, actually...$s",
  "Jas": "But Aunt Marnie! I wanna go in the maze! I'm not scared!$s",
  "Vincent": "Mother won't let me go in the maze. *sob*$s",
  "Marlon": "Don't get too close to the cage.",
  "Leo": "%Leo's unblinking eyes are glued to the screen. You're unable to get his attention."
}

Формат

Ключ поля Описание
name Название фестиваля. Используется в отображаемом тексте, таком как всплывающая подсказка календаря или сообщение о готовности к фестивалю.
conditions Когда и где проходит фестиваль. В формате <location>/<start time> <end time>, где <location> это расположение внутри указанной локации и время в 26-часовом формате (т.е. 600 для 6 утра и 2600 для 2 ночи).
shop Товары, которые продает фестивальный магазин. Смотри формат магазина ниже.
set-up Скрипт события запускается, когда игрок впервые попадает на фестиваль. Включает в себя перемещение игрока на карту фестиваля. Это поле поддерживает варианты года.
Set-Up_additionalCharacters NPC, которые будут появляться при загрузке фестиваля. Указывается в виде четырех полей, разделенных пробелами, в форме<NPC name> <tile X> <tile Y> <facing direction>, повторяется для каждого NPC, для разделения NPC используется разделитель /. <facing direction> может быть одним из следующих значений: up или 0, down ил 2, left или 3, и right или 1. Они являются дополнительными к NPC, порожденным через файл карты. Например, для добавления Абигейл и Леи рядом друг с другом лицом вниз нужно написать следующее:
"Set-Up_additionalCharacters": "Abigail 15 6 down/Leah 16 6 down"
<NPC name>_spouse Диалоговая строка, указанный NPC сообщит, когда игрок поговорит с ними, женаты ли они на игроке. Поддерживает варианты года.
<NPC name> Диалоговая строка, указанный NPC сообщит, когда игрок поговорит с ними, если <NPC name>_spouse не существует или не используется. Поддерживает варианты года.

Любая другая запись используется event data для роликов во время фестиваля. В некоторых случаях, таких как Луау, они связаны друг с другом.

Варианты года

Несколько полей допускают варианты года (смотри в таблице выше). Они работают с помощью префикса _y<year variant>, Где <year variant> увеличивающееся число, начинающимся с 1, без верхнего предела. Например, две записи set-up_y1 and set-up_y2 будут чередоваться (set-up_y1 в 1 годы, set-up_y2 во 2 году, set-up_y1 в 3 году, и т.д.). Если для ключа определены варианты года, исходный ключ игнорируется (например, set-up никогда не будет использоваться, если set-up_y* записи определены).

Формат магазина

Данные магазина для фестиваля хранятся в виде четырех значений, разделенных пробелами, в формате <item type> <item ID> <cost> <count available>, который повторяется для каждого элемента. Форматы полей:

Поле Описание
<item type> Тип предмета. Допустимыми значениями являются B или Boots (ботинки), BL илиBlueprint (чертежи), BBL, BBl или BigBlueprint (большие чертежи), BO или BigObject (большой объект, пригодный для изготовления), F (мебель), H или Hat (шляпа), O или Object (объект), R илиRing (кольцо), или W или Weapon (оружие).
<item id> ID элемента в спрайт-листе.
<cost> Цена покупки в золоте. Для семян это модифицировано на основе маржи.
<count available> Сколько этих товаров можно приобрести в магазине, или -1 для неограниченного количества.

Map

Many festivals use a separate map file located in the Content/Maps folder. The map to use is specified in the data file's set-up field using the changeToTemporaryMap command.

Spawned NPCs

This is fragile and not recommended for custom NPCs or festivals.
Consider using the data file's Set-Up_additionalCharacters field instead.

NPCs can be added to festivals using map tile indexes on a specific layer. This is enabled in the data file's set-up field using the loadActors <layer name> command. For each tile which exists on the layer, the tile index is mapped to the NPC's index in the Data\NPCDispositions asset multiplied by four, with an offset which determines the facing direction (0 = up, 1 = right, 2 = down, or 3 = left).

For example, let's say the layer has a tile with tilesheet index 61. That's the NPC at index 61 / 4 = 15 in Data\NPCDispositions, i.e. the 16th NPC, i.e. Leah. The offset is 61 % 4 = 1, so she's facing right. When the festival is loaded, Leah will be added to that tile position facing right.

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.