Изменения

Перейти к навигации Перейти к поиску
м
Замена текста — «tt>» на «samp>»
Строка 1: Строка 1:  
← [[Модификации:Индекс|Индекс]]
 
← [[Модификации:Индекс|Индекс]]
{{Переведите}}
     −
This page explains how the game stores and parses object data. This is an advanced guide for mod developers.
+
На этой странице объясняется, как игра хранит и анализирует данные объектов. Это расширенное руководство для разработчиков модов.
    
==Источник==
 
==Источник==
Object data is stored in <tt>Content\Data\ObjectInformation.xnb</tt>, which can be [[Modding:Editing XNB files#unpacking|unpacked for editing]]. Here's the raw data as of {{version|1.5.1}} for reference:
+
Объекты хранятся в <samp>Content\Data\ObjectInformation.xnb</samp>, могут быть [[Модификации:Редактирование_XNB_файлов#Редактирование распакованных данных|извлечены для редактирования]]. Вот исходные данные по состоянию на {{version|1.5.1}} для примера:
   −
{{collapse|Data|content=<syntaxhighlight lang="json">
+
{{collapse|Данные|content=<syntaxhighlight lang="json">
 
{
 
{
 
   "0": "Weeds/0/-1/Basic/Weeds/A bunch of obnoxious weeds.",
 
   "0": "Weeds/0/-1/Basic/Weeds/A bunch of obnoxious weeds.",
Строка 714: Строка 713:  
</syntaxhighlight>}}
 
</syntaxhighlight>}}
   −
==Format==
+
==Формат==
===Rings===
+
===Кольца===
Objects with parent sheet indexes 516–534 (<tt>Ring.ringLowerIndexRange</tt> through <tt>Ring.ringUpperIndexRange</tt>) or 801 (wedding ring) are parsed by the <tt>Ring</tt> constructor and contain six fields:
+
Объекты с ID 516–534 (<samp>Ring.ringLowerIndexRange</samp> через <samp>Ring.ringUpperIndexRange</samp>) или 801 (обручальное кольцо) считаются <samp>Кольцами</samp>, конструктор содержит шесть полей:
   −
{| class="wikitable"
+
{|class="wikitable"
 
|-
 
|-
! index
+
! Индекс
! field
+
! Поле
! example value
+
! Пример значения
 
|-
 
|-
 
| 0
 
| 0
| name
+
| Наименование
 
| ''Burglar's Ring''
 
| ''Burglar's Ring''
 
|-
 
|-
 
| 1
 
| 1
| price<br /><small>(if sold by player)</small>
+
| Цена<br /><small>(если продано игроком)</small>
 
| ''1500''
 
| ''1500''
 
|-
 
|-
 
| 2
 
| 2
| edibility<br /><small>(always "-300")</small>
+
| Съедобность<br /><small>(always "-300")</small>
 
| ''-300''
 
| ''-300''
 
|-
 
|-
 
| 3
 
| 3
| type<br /><small>(always "Ring")</small>
+
| Тип<br /><small>(всегда "Ring")</small>
 
| ''Ring''
 
| ''Ring''
 
|-
 
|-
 
| 4
 
| 4
| display name<br /><small>(specific to language file)</small>
+
| Отображаемое имя<br /><small>(специфично для языкового файла)</small>
 
| ''Burglar's Ring''
 
| ''Burglar's Ring''
 
|-
 
|-
 
| 5
 
| 5
| description
+
| Описание
 
| ''Monsters have a greater chance of dropping loot.''
 
| ''Monsters have a greater chance of dropping loot.''
 
|}
 
|}
   −
Rings have a hardcoded category -96 (<tt>Object.ringCategory</tt>), but this has no effect on how they're parsed.
+
Кольца имеют жестко заданную категорию -96 (<samp>Object.ringCategory</samp>), но это никак не влияет на то, как они анализируются.
   −
===Other objects===
+
===Другие объекты===
All other objects contain at least six fields:
+
Все остальные объекты содержат не менее шести полей:
   −
{| class="wikitable"
+
{|class="wikitable"
 
|-
 
|-
! index
+
! Индекс
! field
+
! Поле
! example value
+
! Пример значения
 
|-
 
|-
 
| 0
 
| 0
| name
+
| Наименование
 
| ''Glacierfish''
 
| ''Glacierfish''
 
|-
 
|-
 
| 1
 
| 1
| price<br /><small>(if sold by player)</small>
+
| Цена<br /><small>(если продано игроком)</small>
 
| ''1000''
 
| ''1000''
 
|-
 
|-
 
| 2
 
| 2
| edibility
+
| Съедобность
 
| ''10''
 
| ''10''
 
|-
 
|-
 
| 3
 
| 3
| type and category
+
| Тип и категория
 
| ''Fish -4''
 
| ''Fish -4''
 
|-
 
|-
 
| 4
 
| 4
| display name<br /><small>(specific to language file)</small>
+
| Отображаемое наименование<br /><small>(специфично для языкового файла)</small>
 
| ''Glacierfish''
 
| ''Glacierfish''
 
|-
 
|-
 
| 5
 
| 5
| description
+
| Описание
 
| ''Builds a nest on the underside of glaciers.''
 
| ''Builds a nest on the underside of glaciers.''
 
|}
 
|}
   −
Some entries have more fields, but most of the extra fields seem to be ignored.
+
Некоторые записи содержат больше полей, но большинство дополнительных полей, похоже, игнорируются.
   −
====Food &amp; Drink====
+
====Еда и питьё====
If the value in index 6 is "food" or "drink" then the numbers in index 7 represent the buffs given when the food/drink is consumed. The value in index 8 is the duration of the buff(s).  
+
Если значение в индексе 6 равно "food" или "drink", числа в индексе 7 представляют баффы, данные при употреблении пищи/напитка. Значение в индексе 8 - продолжительность баффа(ов).  
   −
'''Buff Duration Number Calculation:'''
+
'''Расчет продолжительности баффа:'''
Where X is equal to how many minutes you want the buff to last, and Y is the value in index 8.
+
Где X равно тому, сколько минут вы хотите, чтобы бафф длился, а Y-значение в индексе 8.
    
(X minutes * 60) / 0.7 = Y
 
(X minutes * 60) / 0.7 = Y
   −
''Note that the buff duration shown on-screen in the game will always be 1 second less than the above calculation.''
+
''Обратите внимание, что продолжительность баффа, отображаемая на экране в игре, всегда будет на 1 секунду меньше, чем в приведенном выше расчете.''
   −
'''Health/Energy/Edibility:'''
+
'''Здоровье/Энергия/Съедобность:'''
The 'Edibility' number determines how much health and energy is restored.
+
Число 'Съедобности' определяет, сколько здоровья и энергии восстанавливается.
   −
For X being the value in index 2 (Edibility):
+
Для X, являющегося значением в индексе 2 (Съедобность):
   −
Energy Restored = X * 2.5
+
Восстановление энергии = X * 2.5
   −
Health Restored (value shown on tooltip) = X * 2.5 * 0.4
+
Восстановление здоровья (значение показано во всплывающей подсказке) = X * 2.5 * 0.4
<br />Health Restored (actual amount gained) = X * 2.5 * 0.45
+
<br />Восстановление здоровья (фактическая полученная сумма) = X * 2.5 * 0.45
      −
From the constructor in <tt>Buff.cs</tt>, the numbers in index 7 (separated by spaces) are:
+
От конструктора в <samp>Buff.cs</samp>, числа в индексе 7 (разделенные пробелами) являются:
 
{|class="wikitable"
 
{|class="wikitable"
 
|-
 
|-
!Index
+
!Индекс
!Buff Given
+
!Полученный бафф
 
|-
 
|-
 
|0
 
|0
|Farming
+
|Фермерство
 
|-
 
|-
 
|1
 
|1
|Fishing
+
|Рыбная ловля
 
|-
 
|-
 
|2
 
|2
|Mining
+
|Горное дело
 
|-
 
|-
 
|3
 
|3
|Digging (unimplemented)
+
|Раскопки(нереализовано)
 
|-
 
|-
 
|4
 
|4
|Luck
+
|Удача
 
|-
 
|-
 
|5
 
|5
|Foraging
+
|Собирательство
 
|-
 
|-
 
|6
 
|6
|Crafting (unimplemented)
+
|Крафтинг (нереализовано)
 
|-
 
|-
 
|7
 
|7
|Max Energy
+
|Максимум энергии
 
|-
 
|-
 
|8
 
|8
|Magnetism
+
|Магнетизм
 
|-
 
|-
 
|9
 
|9
|Speed
+
|Скорость
 
|-
 
|-
 
|10
 
|10
|Defense
+
|Защита
 
|-
 
|-
 
|11
 
|11
|Attack
+
|Атака
 
|}
 
|}
   −
Items that have a number in the "Crafting" field display buggy information in-game (''e.g.'', Bean Hotpot prior to version 1.4). Items that have a number in the "Attack" field display the Attack icon and a number, but no description. It's unclear how these buffs work (if at all).
+
Предметы, у которых есть номер в поле "Crafting", отображают информацию об ошибках в игре (''например'', Горшочек с фасолью до версии 1.4). Элементы, у которых есть номер в поле "Атака", отображают значок атаки и номер, но без описания. Неясно, как работают эти баффы (если вообще работают).
   −
Note: The "Tipsy" Buff (from Beer, Wine, Mead, and Pale Ale) and the "Oil of Garlic" buff (from Oil of Garlic) are handled in the game code (<tt>BuffsDisplay::tryToAddDrinkBuff()</tt>), rather than through <tt>ObjectInformation.xnb</tt>. The complete [[Health]] regen given by consuming a [[Life Elixir]] is also handled in <tt>tryToAddDrinkBuff</tt>.
+
Примечание: Бафф "Подвыпивший" (от Пива, Вина, Меда и Светлого эля) и бафф "Чесночное масло" (от Чесночного масла) обрабатываются в игровом коде(<samp>BuffsDisplay::tryToAddDrinkBuff()</samp>), скорее, чем через <samp>ObjectInformation.xnb</samp>. Полная [[Здоровье|регенерация здоровья]], полученная при потреблении [[Эликсир жизни|эликсира жизни]] также обрабатывается в <samp>tryToAddDrinkBuff</samp>.
   −
====Geodes====
+
====Жеоды====
For the 4 types of geodes (item #535, 536, 537, and 749) there is approximately a 50% chance that the game will use the information in index 6 to determine what item you receive when breaking the geode open at the Blacksmith. (See <tt>Utility::getTreasureFromGeode()</tt>.)
+
Для 4 типов жеод (предмет #535, 536, 537, и 749) существует примерно 50% вероятность того, что игра будет использовать информацию в индексе 6, чтобы определить, какой предмет вы получите, когда откроете жеоду у Кузнеца. (Смотри <samp>Utility::getTreasureFromGeode()</samp>.)
   −
The numbers in index 6 represent other object numbers from <tt>ObjectInformation.xnb</tt>.
+
Числа в индексе 6 представляют номера других объектов из <samp>ObjectInformation.xnb</samp>.
   −
==Sprites==
+
==Спрайты==
The item IDs in <tt>Content\Data\ObjectInformation.xnb</tt> correspond to the sprites in the <tt>Content\Maps\springobjects.xnb</tt> spritesheet. The sprites are numbered from the top left starting with zero. see [[Modding:Object data/Sprites]] for a table of sprites and their corresponding item IDs.
+
ID элементов в <samp>Content\Data\ObjectInformation.xnb</samp> соответствуют спрайтам в <samp>Content\Maps\springobjects.xnb</samp> спрайт-листе. Спрайты нумеруются слева сверху, начиная с нуля. Смотри [[Модификации:Объекты/Спрайты]] для таблицы спрайтов и соответствующих им ID элементов.
   −
The spritesheet and data both have items that can't normally be found in the player inventory (like twigs and lumber), and some sprites have no corresponding item data. There are also multiple entries for ''weeds'' and ''stone'' corresponding to different sprites, but the player can only normally obtain one ''stone'' item (index 390) and no ''weeds'' items.
+
В таблице спрайтов и данных есть предметы, которые обычно нельзя найти в инвентаре игрока (например, Место для артефакта и мусор), а у некоторых спрайтов нет соответствующих данных о предметах. Есть также несколько записей для ''Сорняков'' и ''Камней'' соответствует разным спрайтам, но игрок обычно может получить только один ''Камень'' (ID 390) и не может получить ''Сорняки''.
   −
==Categories==
+
==Категории==
Most items have a category, represented by a negative integer separate from the type name. In code, you can get an item's category value from <tt>item.Category</tt>, and its translated name from <tt>item.getCategoryName()</tt>. Here are the valid categories:
+
Большинство элементов имеют категорию, представленную отрицательным целым числом, отдельным от имени типа. В коде вы можете получить значение категории предмета из <samp>item.Category</samp>, и его переведенное название <samp>item.getCategoryName()</samp>. Вот допустимые категории:
   −
{| class="wikitable sortable"
+
{|class="wikitable sortable"
 
|-
 
|-
! value
+
! Значение
! internal constant
+
! Внутренняя константа
! English translation
+
! Перевод на английский язык
 
|-
 
|-
 
| -2
 
| -2
| <tt>Object.GemCategory</tt>
+
| <samp>Object.GemCategory</samp>
 
| Mineral
 
| Mineral
 
|-
 
|-
 
| -4
 
| -4
| <tt>Object.FishCategory</tt>
+
| <samp>Object.FishCategory</samp>
 
| Fish
 
| Fish
 
|-
 
|-
 
| -5
 
| -5
| <tt>Object.EggCategory</tt>
+
| <samp>Object.EggCategory</samp>
 
| Animal Product
 
| Animal Product
 
|-
 
|-
 
| -6
 
| -6
| <tt>Object.MilkCategory</tt>
+
| <samp>Object.MilkCategory</samp>
 
| Animal Product
 
| Animal Product
 
|-
 
|-
 
| -7
 
| -7
| <tt>Object.CookingCategory</tt>
+
| <samp>Object.CookingCategory</samp>
 
| Cooking
 
| Cooking
 
|-
 
|-
 
| -8
 
| -8
| <tt>Object.CraftingCategory</tt>
+
| <samp>Object.CraftingCategory</samp>
 
| Crafting
 
| Crafting
 
|-
 
|-
 
| -9
 
| -9
| <tt>Object.BigCraftableCategory</tt>
+
| <samp>Object.BigCraftableCategory</samp>
 
|  
 
|  
 
|-
 
|-
 
| -12
 
| -12
| <tt>Object.mineralsCategory</tt>
+
| <samp>Object.mineralsCategory</samp>
 
| Mineral
 
| Mineral
 
|-
 
|-
 
| -14
 
| -14
| <tt>Object.meatCategory</tt>
+
| <samp>Object.meatCategory</samp>
 
| Animal Product
 
| Animal Product
 
|-
 
|-
 
| -15
 
| -15
| <tt>Object.metalResources</tt>
+
| <samp>Object.metalResources</samp>
 
| Resource
 
| Resource
 
|-
 
|-
 
| -16
 
| -16
| <tt>Object.buildingResources</tt>
+
| <samp>Object.buildingResources</samp>
 
| Resource
 
| Resource
 
|-
 
|-
 
| -17
 
| -17
| <tt>Object.sellAtPierres</tt>
+
| <samp>Object.sellAtPierres</samp>
 
|  
 
|  
 
|-
 
|-
 
| -18
 
| -18
| <tt>Object.sellAtPierresAndMarnies</tt>
+
| <samp>Object.sellAtPierresAndMarnies</samp>
 
| Animal Product
 
| Animal Product
 
|-
 
|-
 
| -19
 
| -19
| <tt>Object.fertilizerCategory</tt>
+
| <samp>Object.fertilizerCategory</samp>
 
| Fertilizer
 
| Fertilizer
 
|-
 
|-
 
| -20
 
| -20
| <tt>Object.junkCategory</tt>
+
| <samp>Object.junkCategory</samp>
 
| Trash
 
| Trash
 
|-
 
|-
 
| -21
 
| -21
| <tt>Object.baitCategory</tt>
+
| <samp>Object.baitCategory</samp>
 
| Bait
 
| Bait
 
|-
 
|-
 
| -22
 
| -22
| <tt>Object.tackleCategory</tt>
+
| <samp>Object.tackleCategory</samp>
 
| Fishing Tackle
 
| Fishing Tackle
 
|-
 
|-
 
| -23
 
| -23
| <tt>sellAtFishShopCategory</tt>
+
| <samp>sellAtFishShopCategory</samp>
 
|  
 
|  
 
|-
 
|-
 
| -24
 
| -24
| <tt>Object.furnitureCategory</tt>
+
| <samp>Object.furnitureCategory</samp>
 
| Decor
 
| Decor
 
|-
 
|-
 
| -25
 
| -25
| <tt>Object.ingredientsCategory</tt>
+
| <samp>Object.ingredientsCategory</samp>
 
| Cooking
 
| Cooking
 
|-
 
|-
 
| -26
 
| -26
| <tt>Object.artisanGoodsCategory</tt>
+
| <samp>Object.artisanGoodsCategory</samp>
 
| Artisan Goods
 
| Artisan Goods
 
|-
 
|-
 
| -27
 
| -27
| <tt>Object.syrupCategory</tt>
+
| <samp>Object.syrupCategory</samp>
 
| Artisan Goods
 
| Artisan Goods
 
|-
 
|-
 
| -28
 
| -28
| <tt>Object.monsterLootCategory</tt>
+
| <samp>Object.monsterLootCategory</samp>
 
| Monster Loot
 
| Monster Loot
 
|-
 
|-
 
| -29
 
| -29
| <tt>Object.equipmentCategory</tt>
+
| <samp>Object.equipmentCategory</samp>
 
|  
 
|  
 
|-
 
|-
 
| -74
 
| -74
| <tt>Object.SeedsCategory</tt>
+
| <samp>Object.SeedsCategory</samp>
 
| Seed
 
| Seed
 
|-
 
|-
 
| -75
 
| -75
| <tt>Object.VegetableCategory</tt>
+
| <samp>Object.VegetableCategory</samp>
 
| Vegetable
 
| Vegetable
 
|-
 
|-
 
| -79
 
| -79
| <tt>Object.FruitsCategory</tt>
+
| <samp>Object.FruitsCategory</samp>
 
| Fruit
 
| Fruit
 
|-
 
|-
 
| -80
 
| -80
| <tt>Object.flowersCategory</tt>
+
| <samp>Object.flowersCategory</samp>
 
| Flower
 
| Flower
 
|-
 
|-
 
| -81
 
| -81
| <tt>Object.GreensCategory</tt>
+
| <samp>Object.GreensCategory</samp>
 
| Forage
 
| Forage
 
|-
 
|-
 
| -95
 
| -95
| <tt>Object.hatCategory</tt>
+
| <samp>Object.hatCategory</samp>
 
|  
 
|  
 
|-
 
|-
 
| -96
 
| -96
| <tt>Object.ringCategory</tt>
+
| <samp>Object.ringCategory</samp>
 
|  
 
|  
 
|-
 
|-
 
| -98
 
| -98
| <tt>Object.weaponCategory</tt>
+
| <samp>Object.weaponCategory</samp>
 
|  
 
|  
 
|-
 
|-
 
| -99
 
| -99
| <tt>Object.toolCategory</tt>
+
| <samp>Object.toolCategory</samp>
 
|  
 
|  
 
|}
 
|}
   −
Here's a dump of the vanilla items for each category as of {{version|1.4.3}}:
+
Вот список ванильных предметов для каждой категории по состоянию на {{version|1.4.3}}:
{{collapse|Items with numeric categories|content=<syntaxhighlight lang="yaml">
+
{{collapse|Предметы с числовыми категориями|content=<syntaxhighlight lang="yaml">
 
-81: Cave Carrot, Chanterelle, Common Mushroom, Daffodil, Dandelion, Hazelnut, Holly, Leek, Morel, Purple Mushroom, Red Mushroom, Sap, Snow Yam, Spring Onion, Wild Horseradish, Winter Root
 
-81: Cave Carrot, Chanterelle, Common Mushroom, Daffodil, Dandelion, Hazelnut, Holly, Leek, Morel, Purple Mushroom, Red Mushroom, Sap, Snow Yam, Spring Onion, Wild Horseradish, Winter Root
 
-80: Blue Jazz, Crocus, Fairy Rose, Poppy, Summer Spangle, Sunflower, Sweet Pea, Tulip
 
-80: Blue Jazz, Crocus, Fairy Rose, Poppy, Summer Spangle, Sunflower, Sweet Pea, Tulip

Навигация