Line 307: |
Line 307: |
| </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 the fields listed below. Fields 0–5 are used by rings and most other objects; fields 6–11 are only used for food buffs. The objects with keys 516–534 (<samp>Ring.ringLowerIndexRange</samp> through <samp>Ring.ringUpperIndexRange</samp>) and 801 (wedding ring) are hardcoded as rings. | + | For each entry in the data asset: |
| + | * The key (before the colon) is the item ID (saved as <samp>ParentSheetIndex</samp> in-code), and its sprite index within the [[Modding:Items/Object sprites|object spritesheet]]. |
| + | * The value (after the colon) is a slash-delimited string with the fields listed below. Fields 0–5 are used by rings and most other objects; fields 6–11 are only used for food buffs. The objects with keys 516–534 (<samp>Ring.ringLowerIndexRange</samp> through <samp>Ring.ringUpperIndexRange</samp>) and 801 (wedding ring) are hardcoded as rings. |
| | | |
| {| class="wikitable" | | {| class="wikitable" |
Line 323: |
Line 325: |
| | 1 | | | 1 |
| | price | | | price |
− | | The gold price of the item when sold by the player. | + | | The gold price of the item when sold by the player. This is not the price when bought from a shop. |
| |- | | |- |
| | 2 | | | 2 |
| | edibility | | | edibility |
− | | A numeric value that determines how much health (edibility × 2.5) and energy (edibility × 1.125) is restored. An item with an edibility of -300 can't be eaten. | + | | A numeric value that determines how much health (edibility × 2.5) and energy (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. | | This is ignored for rings. |
Line 336: |
Line 338: |
| * For a ring: the value <samp>Ring</samp>. Rings have a hardcoded category of -96 (<samp>Object.ringCategory</samp>). | | * For a ring: the value <samp>Ring</samp>. Rings have a hardcoded category of -96 (<samp>Object.ringCategory</samp>). |
| * For other objects: the item's type (string) and category (negative integer), separated by a space like <samp>Fish -4</samp>. | | * For other objects: the item's type (string) and category (negative integer), separated by a space like <samp>Fish -4</samp>. |
− | * The category names and negative integer values are listed in the [[#Categories|Common Data]] section.
| + | |
| + | See the [[#Categories|list of categories and their numeric values]]. |
| + | |
| + | The types aren't currently documented. The values used in <samp>Data/ObjectInformation</samp> are <samp>Ring</samp>, <samp>Fish</samp>, <samp>Arch</samp>, <samp>asdf</samp>, <samp>Seeds</samp>, <samp>Crafting</samp>, <samp>Quest</samp>, <samp>Basic</samp>, <samp>Cooking</samp>, and <samp>Minerals</samp>. |
| |- | | |- |
| | 4 | | | 4 |
| | display name | | | display name |
− | | The translated item name. | + | | The translated item name (not used when playing in English). |
| |- | | |- |
| | 5 | | | 5 |
Line 403: |
Line 408: |
| | 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. | | | 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. |
| |} | | |} |
− |
| |
− | For example, let's look at the <samp>"18": "Daffodil/30/0/Basic -81/Daffodil/A traditional spring flower that makes a nice gift."</samp> object data example for the [[Daffodil|daffodil item]]. The <samp>"18"</samp> string refers to the daffodil sprite at <samp>ParentSheetIndex</samp> of <samp>18</samp> for the [[Modding:Items/Object_sprites|objects category sprite sheet]]. The value string for the <samp>"18"</samp> key contains the rest of the item data.
| |
− |
| |
− | The <samp>Daffodil</samp> (at index 0) refers to the English name of the item and the string value used internally in Stardew Valley's source code for this item. The <samp>/</samp> slash following <samp>Daffodil</samp>separates the item name from the next piece of data, the price. The <samp>30</samp> price (at index 1) means this item goes for 30g when sold by the player. This is not the price of the item when sold by shops. The <samp>0</samp> (at index 2) is the edibility of daffodils, meaning it can be eaten but gives 0 health (0 x 2.5) and 0 energy (0 x 1.125).
| |
− |
| |
− | The <samp>Basic -81</samp> is the daffodil's type and category. Like all category values, the <samp>-81</samp> is a negative integer. The <samp>-81</samp> value can be found in the [[Modding:Items#Categories|Categories section]] of this documentation. The types listed in ''ObjectInformation.json'' file are <samp>Ring</samp>, <samp>Fish</samp>, <samp>Arch</samp>, <samp>asdf</samp>, <samp>Seeds</samp>, <samp>Crafting</samp>, <samp>Quest</samp>, <samp>Basic</samp>, <samp>Cooking</samp>, and <samp>Minerals</samp>. Currently, the different types are not documented and you have to see how they are used in the decompiled Stardew Valley source code.
| |
− |
| |
− | The next <samp>Daffodil</samp> is the translated display name shown to the player in-game. The data we're looking at is for the English version of Stardew Valley, so it is <samp>Daffodil</samp>. However, in the ''ObjectInformation.es-ES.json'' file for the Spanish translation, it is <samp>Narciso</samp>.
| |
− |
| |
− | Finally, <samp>A traditional spring flower that makes a nice gift.</samp> is the translated description of the object. In the ''ObjectInformation.es-ES.json'' file for the Spanish translation, it is <samp>Una flor tradicional de primavera popular como regalo.</samp>
| |
| | | |
| ===Notes=== | | ===Notes=== |