Changes

Jump to navigation Jump to search
m
Line 295: Line 295:  
With the {{nexus mod|3101|Console Code}} mod installed, you can run this command in the SMAPI console to see a list of objects by category:
 
With the {{nexus mod|3101|Console Code}} mod installed, you can run this command in the SMAPI console to see a list of objects by category:
   −
<pre>cs return string.Join(`\n`, Game1.objectInformation.Keys.Select(key => new StardewValley.Object(key, 1)).GroupBy(item => item.Category, item => item.Name).OrderByDescending(p => p.Key).Select(p => $`{p.Key}: {string.Join(`, `, p.OrderBy(name => name))}`));</pre>
+
<pre>cs return string.Join(`\n`, Game1.objectData.Keys.Select(key => new StardewValley.Object(key, 1)).GroupBy(item => item.Category, item => item.Name).OrderByDescending(p => p.Key).Select(p => $`{p.Key}: {string.Join(`, `, p.OrderBy(name => name))}`));</pre>
 
}}
 
}}
   Line 440: Line 440:  
Objects are the default type for items in inventories or placed in the world.
 
Objects are the default type for items in inventories or placed in the world.
   −
They have their data in <samp>Data/ObjectInformation</samp>, their icon sprites in <samp>Maps/springobjects</samp>, and their code in <samp>StardewValley.Object</samp>. See [[Modding:Items/Object sprites|a table of sprites and their corresponding indexes]].
+
They have their data in <samp>Data/Objects</samp> (<samp>Data/ObjectInformation</samp> prior to 1.6), their icon sprites in <samp>Maps/springobjects</samp>, and their code in <samp>StardewValley.Object</samp>. See [[Modding:Items/Object sprites|a table of sprites and their corresponding indexes]].
    
===Data format===
 
===Data format===
The object data in <samp>Data/ObjectInformation</samp> consists of an integer→string dictionary with entries like this:
+
The object data in <samp>Data/Objects</samp> consists of a string→ObjectData dictionary (where ObjectData is defined in the game code in <samp>GameData.Objects.ObjectData</samp>). It has entries like this<ref>See <samp>Data/Objects.xnb</ref>:
 
<syntaxhighlight lang="json">
 
<syntaxhighlight lang="json">
   "18": "Daffodil/30/0/Basic -81/Daffodil/A traditional spring flower that makes a nice gift."
+
"201": {
 +
  "Name": "Complete Breakfast",
 +
   "DisplayName": "[LocalizedText Strings\\Objects:CompleteBreakfast_Name]",
 +
  "Description": "[LocalizedText Strings\\Objects:CompleteBreakfast_Description]",
 +
  "Type": "Cooking",
 +
  "Category": -7,
 +
  "Price": 350,
 +
  "Texture": null,
 +
  "SpriteIndex": 201,
 +
  "Edibility": 80,
 +
  "IsDrink": false,
 +
  "Buffs": [
 +
    {
 +
      "Id": "Food",
 +
      "BuffId": null,
 +
      "IconTexture": null,
 +
      "IconSpriteIndex": 0,
 +
      "Duration": 600,
 +
      "IsDebuff": false,
 +
      "GlowColor": null,
 +
      "CustomAttributes": {
 +
        "FarmingLevel": 2.0,
 +
        "FishingLevel": 0.0,
 +
        "MiningLevel": 0.0,
 +
        "LuckLevel": 0.0,
 +
        "ForagingLevel": 0.0,
 +
        "MaxStamina": 50.0,
 +
        "MagneticRadius": 0.0,
 +
        "Speed": 0.0,
 +
        "Defense": 0.0,
 +
        "Attack": 0.0
 +
      },
 +
      "CustomFields": null
 +
    }
 +
  ],
 +
  "GeodeDropsDefaultItems": false,
 +
  "GeodeDrops": null,
 +
  "ArtifactSpotChances": null,
 +
  "ExcludeFromFishingCollection": false,
 +
  "ExcludeFromShippingCollection": false,
 +
  "ExcludeFromRandomSale": false,
 +
  "ContextTags": [
 +
    "color_yellow",
 +
    "food_breakfast"
 +
  ],
 +
  "CustomFields": null
 +
  }
 
</syntaxhighlight>
 
</syntaxhighlight>
    
For each entry in the data asset:
 
For each entry in the data asset:
* The key (before the colon) is the item ID and its sprite index within the [[Modding:Items/Object sprites|object spritesheet]] (saved as <samp>ParentSheetIndex</samp> in-code).
+
* The key (before the colon) is the unqualified item ID and its sprite index within the [[Modding:Items/Object sprites|object spritesheet]] (saved as <samp>ParentSheetIndex</samp> in-code).
* The value (after the colon) is a slash-delimited string with the fields listed below. Fields 0–5 are used by most object; fields 6–11 are only used for a select few items. The objects with keys 516–534 (<samp>Ring.ringLowerIndexRange</samp> through <samp>Ring.ringUpperIndexRange</samp>) and 801 (wedding ring) are hardcoded as rings.
+
* The value (after the colon) is the data pertaining to that object, with the fields listed below. The objects with keys 516–534 (<samp>Ring.ringLowerIndexRange</samp> through <samp>Ring.ringUpperIndexRange</samp>) and 801 (wedding ring) are hardcoded as rings.
    +
Field values are described below (Copied from [[Modding:Migrate to Stardew Valley 1.6]]):
 +
 +
====Basic info====
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! index
   
! field
 
! field
! effect
+
! purpose
 +
|-
 +
| <samp>Name</samp>
 +
| The internal item name.
 
|-
 
|-
!style="text-align: left;" colspan="3"| all objects
+
| <samp>DisplayName</samp><br /><samp>Description</samp>
 +
| A [[Modding:Tokenizable strings|tokenizable string]] for the item's in-game display name and description.
 
|-
 
|-
| 0
+
| <samp>Type</samp>
| name
+
| The item's general type, like <samp>Arch</samp> (artifact) or <samp>Minerals</samp>. The vanilla types are: Litter, Basic, Minerals, Quest, asdf, Crafting, Arch, fish, Cooking, Seeds, Ring, interactive
| The internal item name (and display name in English).
   
|-
 
|-
| 1
+
| <samp>Category</samp>
| price
+
| The [[Modding:Items#Categories|item category]].
| The gold price of the item when sold by the player. This is not the price when bought from a shop.
   
|-
 
|-
| 2
+
| <samp>Price</samp>
| edibility
+
| ''(Optional)'' The price when sold by the player. This is not the price when bought from a shop. Default 0.
| A numeric value that determines how much energy (edibility × 2.5) and health (edibility × 1.125) is restored. An item with an edibility of -300 can't be eaten, values from -299 to -1 reduce health & energy, and zero can be eaten but doesn't change health/energy.
+
|}
   −
This is ignored for rings.
+
====Appearance====
 +
{| class="wikitable"
 
|-
 
|-
| 3
+
! field
| type and category
+
! purpose
| &#32;
+
|-
This is the item's type (string) and, in most cases, a category (negative integer), separated by a space like <samp>Fish -4</samp>. For some types the category is omitted.
+
| <samp>Texture</samp>
 +
| The asset name for the texture containing the item's sprite. Defaults to <samp>Maps/springobjects</samp>.
 +
|-
 +
| <samp>SpriteIndex</samp>
 +
| The sprite's index within the <samp>Texture</samp>, where 0 is the top-left sprite.
 +
|}
   −
While [[#Categories|categories]] are frequently referenced in other parts of the game, types appear to be apocryphal data from early in the game's development. As such, some of them are not very well understood. The types used in <samp>Data/ObjectInformation</samp> and their purposes (as is currently understood) are as follows:
+
====Edibility====
*<samp>Ring</samp>, used for all rings, even the [[Wedding Ring]]. Category is ommitted, though every <samp>Ring</samp> type is automatically given the category <samp>-96</samp>.
+
{| class="wikitable"
*<samp>Fish</samp>, used not only for fish but all items gained through fishing. Always paired with <samp>-4</samp> for true fish or <samp>-20</samp> for junk items such as [[Joja Cola]].
  −
*<samp>Arch</samp>, used for artifacts, presumably standing for "archaeology." Category is ommitted, though every <samp>Arch</samp> type is automatically given the category <samp>0</samp>. Is ''not'' used for Gems or Minerals. '''Adding custom items of the <samp>Arch</samp> type is not recommended, as it can break all Artifact Spots in the game.'''
  −
*<samp>asdf</samp>, used for a handful of items the player isn't intended to ever have in their inventory, such as an Artifact Spot or Secret Note. Category is ommitted.
  −
*<samp>Seeds</samp>, used for seeds, starters, shoots, etc. Always paired with the category <samp>-74</samp>.
  −
*<samp>Crafting</samp>, used for a variety of crafted items. Notably, however, there are some non-craftable items with this type: all tree seeds, various "Weeds", the [[Dwarvish Translation Guide]], [[Coffee]], [[Stardrop]], [[Galaxy Soul]], [[Horse Flute]], and supply crates. Category is either ommitted or <samp>-8</samp>, <samp>-24</samp>, or <samp>-74</samp>.
  −
*<samp>Quest</samp>, used for quest items as well as [[Golden Coconut|Golden Coconuts]]. Category is ommitted.
  −
*<samp>Basic</samp>, a general type for a myriad of items.
  −
*<samp>Cooking</samp>, used for cooked items. Not used for cooking ingredients. Always paired with category <samp>-7</samp>.
  −
*<samp>Minerals</samp>, used for Gems and Minerals. Paired with categories <samp>-2</samp> or <samp>-12</samp>, respectively.
   
|-
 
|-
| 4
+
! field
| display name
+
! purpose
| The translated item name (not used when playing in English).
+
|-
 +
| <samp>Edibility</samp>
 +
| ''(Optional)'' A numeric value that determines how much energy (edibility × 2.5) and health (edibility × 1.125) is restored when this item is eaten. An item with an edibility of -300 can't be eaten, values from -299 to -1 reduce health and energy, and zero can be eaten but doesn't change health/energy. Default -300.
 
|-
 
|-
| 5
+
| <samp>IsDrink</samp>
| description
+
| ''(Optional)'' Whether to drink the item instead of eating it. Default false.
| The translated item description.
   
|-
 
|-
!style="text-align: left;" colspan="3"| miscellaneous
+
| <samp>Buffs</samp>
 +
| ''(Optional)'' The buffs to apply to the player when this item is eaten, if any. Default none.
 +
 
 +
This consists of a list of models with these fields:
 +
{| class="wikitable"
 
|-
 
|-
| 6
+
! field
| miscellaneous
+
! purpose
| &#32;
+
|-
* For a food or drink item, set this to <samp>food</samp> or <samp>drink</samp> respectively. This enables the remaining fields, and changes which animation/sound is played when the player consumes the item. Any other value is ignored.
+
| <samp>Id</samp>
* For a geode or geode-esque item ([[Artifact Trove|275]], [[Geode|535]], [[Frozen Geode|536]], [[Magma Geode|537]], or [[Omni Geode|749]]), this is a space-delimited list of object IDs. There's a roughly 50% chance that the geode item will drop one of these items (the other drops are hardcoded).
+
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for this entry within the list.
* For artifacts, this is a list of locations followed by a number less than 1. The game checks this field first when digging up an Artifact Spot. If nothing is randomly chosen from this list, the game checks the data in <samp>Data/Locations.xnb</samp>.
  −
* For fish and other fished items, this a string in the format of <samp>{{t|times}}^{{t|seasons}}</samp>, where {{t|times}} is a space-deliminated list of <samp>Day</samp> or <samp>Night</samp>, and {{t|seasons}} is the same with seasons instead. Appears to be unused or redundant, as the data for what times and seasons fish appear in is stored in <samp>Data/Fish.xnb</samp>.
   
|-
 
|-
| 7
+
| <samp>Duration</samp>
| miscellaneous 2
+
| ''(Optional if <samp>BuffId</samp> is set)'' The buff duration measured in in-game minutes. This can be set to <samp>-2</samp> for a buff that should last for the rest of the day.
|
  −
* For <samp>Arch</samp> or <samp>asdf</samp> type items, this can be one of the following types, the purpose of which is currently not understood:
  −
** <samp>Item {{t|number}} {{t|number}}</samp>
  −
** <samp>Debris {{t|number}} {{t|number}} {{t|number}}</samp>
  −
** <samp>Money {{t|number}} {{t|number}}</samp>
  −
** <samp>Decor {{t|number}} {{t|number}}</samp>
  −
** <samp>Seeds {{t|number}}</samp>
  −
** <samp>Recipe {{t|number}} {{t|recipe}} {{t|number}}</samp>
  −
** <samp>Note</samp>
  −
** For Dwarf Scrolls, this is always <samp>Set Dwarf 96 97 98 99</samp>.
  −
* For food and drinks, this is the bonuses to apply to the player's attribute when the item is consumed. This consists of a space-delimited list of these numbers:
  −
{|class="wikitable"
   
|-
 
|-
! index
+
| <samp>BuffId</samp>
! buff
+
| ''(Optional)'' The unique ID of a buff from [[#Custom buffs|<samp>Data/Buffs</samp>]] to apply, or <samp>null</samp> to ignore <samp>Data/Buffs</samp> and set the ID to <samp>food</samp> or <samp>drink</samp> depending on the item's <samp>IsDrink</samp> field.
 +
 
 +
If a buff from <samp>Data/Buffs</samp> is applied and you also specify other fields, here's how the buff data is combined:
 +
{| class="wikitable"
 
|-
 
|-
| 0
+
! field
| [[Skills#Farming|farming]]
+
! result
 
|-
 
|-
| 1
+
| <samp>Duration</samp><br /><samp>IconTexture</samp><br /><samp>SpriteIndex</samp><br /><samp>GlowColor</samp>
| [[Skills#Fishing|fishing]]
+
| If specified, the value in <samp>Data/Objects</samp> is used instead of the one in <samp>Data/Buffs</samp>. If omitted, defaults to the value from <samp>Data/Buffs</samp>.
 
|-
 
|-
| 2
+
| <samp>CustomAttributes</samp>
| [[Skills#Mining|mining]]
+
| The values from both entries are combined (e.g. +1 speed in <samp>Data/Objects</samp> and +1 speed in <samp>Data/Buffs</samp> results in +2 speed).
 
|-
 
|-
| 3
+
| <samp>IsDebuff</samp>
| ''unused''
+
| The value in <samp>Data/Objects</samp> is used.
 +
|}
 
|-
 
|-
| 4
+
| <samp>IsDebuff</samp>
| [[Luck|luck]]
+
| ''(Optional)'' Whether this buff counts as a debuff, so its duration should be halved when wearing a Sturdy Ring. Default false.
 
|-
 
|-
| 5
+
| <samp>IconTexture</samp>
| [[Skills#Foraging|foraging]]
+
| ''(Optional)'' The asset name for the icon texture to load. This must contain one or more 16x16 icons in a grid of any size. If omitted, the game will draw a default icon based on the <samp>BuffId</samp> and <samp>CustomAttributes</samp> fields.
 
|-
 
|-
| 6
+
| <samp>SpriteIndex</samp>
| ''unused''
+
| ''(Optional)'' The buff's icon index within the <samp>IconTexture</samp>, where 0 is the top-left icon. Default 0.
 
|-
 
|-
| 7
+
| <samp>GlowColor</samp>
| max [[energy]]
+
| ''(Optional)'' The glow color to apply to the player. See [[#Color fields|color format]]. Default none.
 
|-
 
|-
| 8
+
| <samp>CustomAttributes</samp>
| [[magnetism]]
+
| The custom buff attributes to apply, if any.
 +
 
 +
This consists of a model with any combination of these fields:
 +
{| class="wikitable"
 
|-
 
|-
| 9
+
! field
| [[speed]]
+
! purpose
 
|-
 
|-
| 10
+
| <samp>FarmingLevel</samp><br /><samp>FishingLevel</samp><br /><samp>ForagingLevel</samp><br /><samp>LuckLevel</samp><br /><samp>MiningLevel</samp>
| [[defense]]
+
| ''(Optional)'' An amount applied to the matching [[Skills|skill level]] while the buff is active. This can be negative for a debuff. Default 0.
 
|-
 
|-
| 11
+
| <samp>Attack</samp><br /><samp>Defense</samp><br /><samp>MagneticRadius</samp><br /><samp>MaxStamina</samp><br /><samp>Speed</samp>
| [[attack]]
+
| ''(Optional)'' An amount applied to the player's [[attack]], [[defense]], [[Magnetism|magnetic radius]], maximum [[Energy|stamina]], or [[speed]] while the buff is active. This can be negative for a debuff. Default 0.
 
|}
 
|}
 
|-
 
|-
| 8
+
| <samp>CustomFields</samp>
| buff duration
+
| ''(Optional)'' The [[#Custom data fields|custom fields]] for this entry.  
| How long the buffs provided by the previous field last, measured in real seconds (assuming [[Day Cycle#Time speed|the default time speed]]). The buff duration number shown in-game will always be one second less than the calculated value.
+
|}
 
|}
 
|}
 +
    
===Notes===
 
===Notes===
* Items that have a number in index 6 (the "Crafting" field) show 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).
+
* Prior to 1.6, items that have a number in index 6 (the "Crafting" field) showed buggy information in-game (''e.g.,'' Bean Hotpot prior to version 1.4). Items that had a number in the "Attack" field displayed the Attack icon and a number, but no description. It's unclear how these buffs work (if at all).
 
* '''Adding custom items with the <samp>Arch</samp> type is inadvisable as it often leads to Artifact Spots becoming broken and not giving any items.'''
 
* '''Adding custom items with the <samp>Arch</samp> type is inadvisable as it often leads to Artifact Spots becoming broken and not giving any items.'''
 
* Named [[buffs]] (like [[Oil of Garlic]], [[Life Elixir]], or [[Buffs#Tipsy|Tipsy]]) are implemented in code and can't be set in the food buff fields.
 
* Named [[buffs]] (like [[Oil of Garlic]], [[Life Elixir]], or [[Buffs#Tipsy|Tipsy]]) are implemented in code and can't be set in the food buff fields.
Line 578: Line 624:  
Big craftables are objects which can be placed in the world and are two tiles tall (instead of one like objects).
 
Big craftables are objects which can be placed in the world and are two tiles tall (instead of one like objects).
   −
They have their data in <samp>Data/BigCraftableInformation</samp>, their in-game sprites in <samp>TileSheets/Craftables</samp>, and their code in <samp>StardewValley.Object</samp> (with the <code>bigCraftable.Value = true</code> flag).
+
They have their data in <samp>Data/BigCraftables</samp> (<samp>Data/BigCraftablesInformation</samp> prior to 1.6), their in-game sprites in <samp>TileSheets/Craftables</samp>, and their code in <samp>StardewValley.Object</samp> (with the <code>bigCraftable.Value = true</code> flag).
    
===Data format===
 
===Data format===
The big craftables data in <samp>Data/BigCraftableInformation</samp> consists of an integer→string dictionary with entries like this:
+
The big craftables data in <samp>Data/BigCraftables</samp> consists of a string → model lookup, where...
 +
* The key is the unqualified [[#Custom items|item ID]].
 +
* The value is a model with the fields listed below.
    
<syntaxhighlight lang="json">
 
<syntaxhighlight lang="json">
   "19": "Oil Maker/50/-300/Crafting -9/Makes gourmet truffle oil./true/true/0/Oil Maker"
+
   "19": {
 +
    "Name": "Oil Maker",
 +
    "DisplayName": "[LocalizedText Strings\\BigCraftables:OilMaker_Name]",
 +
    "Description": "[LocalizedText Strings\\BigCraftables:OilMaker_Description]",
 +
    "Price": 50,
 +
    "Fragility": 0,
 +
    "CanBePlacedOutdoors": true,
 +
    "CanBePlacedIndoors": true,
 +
    "IsLamp": false,
 +
    "Texture": null,
 +
    "SpriteIndex": 19,
 +
    "ContextTags": null,
 +
    "CustomFields": null
 +
  }
 
</syntaxhighlight>
 
</syntaxhighlight>
   −
For each entry in the data asset, the key is the item's <samp>ParentSheetIndex</samp> and the value is a slash-delimited string with these fields:
+
Field values are described below (Copied from [[Modding:Migrate to Stardew Valley 1.6]]):
    +
====Basic info====
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! index
   
! field
 
! field
! effect
+
! purpose
 
|-
 
|-
| 0
+
| <samp>Name</samp>
| name
+
| The internal item name.
| The internal item name (and display name in English).
   
|-
 
|-
| 1
+
| <samp>DisplayName</samp><br /><samp>Description</samp>
| price
+
| A [[Modding:Tokenizable strings|tokenizable string]] for the item's in-game display name and description.
| The gold price when sold by the player.
   
|-
 
|-
| 2
+
| <samp>Price</samp>
| edibility
+
| ''(Optional)'' The price when sold by the player. This is not the price when bought from a shop. Default 0.
| See edibility for [[#Objects|object data]]. Always set to <samp>-300</samp> (inedible) for vanilla items.
+
|}
 +
 
 +
====Behavior====
 +
{| class="wikitable"
 
|-
 
|-
| 3
+
! field
| type and category
+
! purpose
| See type and category for [[#Objects|object data]]. Always set to <samp>Crafting -9</samp> for vanilla items.
   
|-
 
|-
| 4
+
| <samp>Fragility</samp>
| description
+
| ''(Optional)'' How the item can be picked up. The possible values are 0 (pick up with any tool), 1 (destroyed if hit with an axe/hoe/pickaxe, or picked up with any other tool), or 2 (can't be removed once placed). Default 0.
| The translated item description shown in-game.
   
|-
 
|-
| 5
+
| <samp>CanBePlacedIndoors</samp><br /><samp>CanBePlacedOutdoors</samp>
| outdoors
+
| ''(Optional)'' Whether the item can be placed indoors or outdoors. Default true.
| Whether the item can be placed outdoors (<samp>true</samp> or <samp>false</samp>).
   
|-
 
|-
| 6
+
| <samp>IsLamp</samp>
| indoors
+
| ''(Optional)'' Whether this is a lamp and should produce light when dark. Default false.
| Whether the item can be placed indoors (<samp>true</samp> or <samp>false</samp>).
+
|}
 +
 
 +
====Appearance====
 +
{| class="wikitable"
 
|-
 
|-
| 7
+
! field
| fragility
+
! purpose
| How the item is removed by tools. Possible values:
  −
{| class="wikitable"
   
|-
 
|-
! fragility
+
| <samp>Texture</samp>
! effect
+
| ''(Optional)'' The asset name for the texture containing the item's sprite. Defaults to <samp>TileSheets/Craftables</samp>.
 
|-
 
|-
| <samp>0</samp>
+
| <samp>SpriteIndex</samp>
| Pick up with any tool.
+
| ''(Optional)'' The sprite's index within the <samp>Texture</samp>, where 0 is the top-left sprite.
 +
|}
 +
 
 +
====Context tags====
 +
{| class="wikitable"
 
|-
 
|-
| <samp>1</samp>
+
! field
| Destroyed if hit with an [[Axes|axe]], [[Hoes|hoe]], or [[Pickaxes|pickaxe]]. Any other tool will pick it up.
+
! purpose
 
|-
 
|-
| <samp>2</samp>
+
| <samp>ContextTags</samp>
| Indestructible. The item can't be removed once placed.
+
| ''(Optional)'' The custom [[Modding:Items#Context tags|context tags]] to add for this item (in addition to the tags added automatically based on the other object data). This is formatted as a list; for example:
 +
<syntaxhighlight lang="json">
 +
"ContextTags": [ "light_source", "torch_item" ]
 +
</syntaxhighlight>
 
|}
 
|}
 +
 +
====Advanced====
 +
{| class="wikitable"
 
|-
 
|-
| 8
+
! field
| is lamp
+
! purpose
| Whether the item is a lamp and produces light when it's dark. This can be <samp>true</samp> (mark as lamp) or any other value (ignored).
   
|-
 
|-
| 9
+
| <samp>CustomFields</samp>
| display name
+
| ''(Optional)'' The [[Modding:Migrate_to_Stardew_Valley_1.6#Custom_data_fields|custom fields]] for this entry.  
| The translated display name (in non-English assets only).
   
|}
 
|}
   Line 868: Line 936:  
| 6
 
| 6
 
| placement restriction
 
| placement restriction
| Where the furniture can be placed. This may not work correctly in non-English languages—it may need to be placed before the display name.
+
| Where the furniture can be placed.  
 
{| class="wikitable sortable"
 
{| class="wikitable sortable"
 
|-
 
|-
Line 904: Line 972:  
</syntaxhighlight>
 
</syntaxhighlight>
   −
For each entry in the data asset, the key is the item's <samp>ParentSheetIndex</samp> and the value is a slash-delimited string with these fields:
+
Hats from the base game use the hat's <samp>ParentSheetIndex</samp> as its item ID.
 +
For each entry in the data asset, the key is the hat's item ID, and the value is a slash-delimited string with these fields:
    
{| class="wikitable"
 
{| class="wikitable"
Line 914: Line 983:  
| 0
 
| 0
 
| name
 
| name
| The internal item name (and display name in English).
+
| The internal item name.
 
|-
 
|-
 
| 1
 
| 1
Line 929: Line 998:  
|-
 
|-
 
| 4
 
| 4
 +
| tags
 +
| A space-separated list of "tags". These are separate from context tags, and used to contain miscellaneous information. Currently, the only tag used by the game is <samp>Prismatic</samp>, which marks a hat as prismatic and causes it to cycle through colors.
 +
|-
 +
| 5
 
| display name
 
| display name
| The translated item name shown in-game (for non-English assets only).
+
| The translated item name shown in-game.
 +
|-
 +
| 6
 +
| sprite index
 +
| The index in the hat spritesheet used to display this hat.
 +
|-
 +
| 7
 +
| texture name
 +
| The name of the game texture to use for the hat. If empty, the game will use the default hat sheet <samp>Characters/Farmer/hats</samp>
 
|}
 
|}
   −
Hats have a hard-coded category of -95 (<samp>Hats.cs::Load</samp>)
+
Hats have a hard-coded category of -95 (<samp>HatDataDefinition.cs::GetData</samp>)
    
==Tools==
 
==Tools==
Line 1,098: Line 1,179:     
[[ru:Модификации:Объекты]]
 
[[ru:Модификации:Объекты]]
 +
 +
==History==
 +
{{History|1.6|Objects are now stored in <samp>Data/Objects</samp> rather than <samp>Data/ObjectInformation</samp> and have a new format.}}
 +
{{History|1.6|Field 4 of hats is now used for tags, rather than displayName.}}
 +
{{History|1.6|Display name field is now used for all languages.}}
 +
{{History|1.6|Added Texture & texture index fields to all object data.}}
 +
{{History|1.6|All types of items now use string IDs.}}
translators
8,404

edits

Navigation menu