Changes

Jump to navigation Jump to search
m
Fix History section to be H2 heading instead of H3
Line 443: Line 443:     
===Data format===
 
===Data format===
The object data in <samp>Data/Objects</samp> consists of a string→ObjectData dictionary (where ObjectData is defined in the game code in <samp>StardewValley.GameData.Objects.ObjectData</samp>). It has 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>StardewValley.GameData.Objects.ObjectData</samp>). It has entries like this<ref>See <samp>Data/Objects.xnb</ref>:
 
<syntaxhighlight lang="json">
 
<syntaxhighlight lang="json">
 
"201": {
 
"201": {
Line 498: Line 498:  
* 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.
 
* 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.
   −
1.6 Formatting:
+
Field values are described below:
    
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! field
+
! Field
! effect
+
! Data Type
 +
! Effect<ref>See <samp>StardewValley.GameData.Objects.ObjectData</samp></ref>
 
|-
 
|-
 
!style="text-align: left;" colspan="3"| all objects
 
!style="text-align: left;" colspan="3"| all objects
 
|-
 
|-
 
| Name
 
| Name
 +
| string
 
| The internal item name (and display name in English).
 
| The internal item name (and display name in English).
 
|-
 
|-
 
| DisplayName
 
| DisplayName
 +
| string
 
| A tokenizable string for the item's translated display name.
 
| A tokenizable string for the item's translated display name.
 
|-
 
|-
 
| Description
 
| Description
 +
| string
 
| A tokenizable string for the item's translated description.
 
| A tokenizable string for the item's translated description.
 
|-
 
|-
 
| Type
 
| Type
 +
| string
 
| The item's general type, like Arch (artifact) or Minerals.
 
| The item's general type, like Arch (artifact) or Minerals.
 
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/Objects</samp> and their purposes (as is currently understood) are as follows:
 
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/Objects</samp> and their purposes (as is currently understood) are as follows:
Line 531: Line 536:  
|-
 
|-
 
| Category
 
| Category
 +
| integer
 
| The item category, usually matching a constant like <samp>Object.flowersCategory</samp>. [[#Categories|Categories]] are either 0 (omitted category) or a negative integer. They are frequently referenced in other parts of the game.
 
| The item category, usually matching a constant like <samp>Object.flowersCategory</samp>. [[#Categories|Categories]] are either 0 (omitted category) or a negative integer. They are frequently referenced in other parts of the game.
 
|-
 
|-
 
| Price
 
| Price
 +
| integer
 
| The gold price of the item when sold by the player. This is not the price when bought from a shop.
 
| The gold price of the item when sold by the player. This is not the price when bought from a shop.
 
|-
 
|-
 
| Texture
 
| Texture
 +
| string
 
| The asset name for the texture containing the item's sprite, or null for Maps/springobjects.
 
| The asset name for the texture containing the item's sprite, or null for Maps/springobjects.
 
|-
 
|-
 
| SpriteIndex
 
| SpriteIndex
 +
| integer
 
| The sprite's index in the spritesheet.
 
| The sprite's index in the spritesheet.
 
|-
 
|-
 
| Edibility
 
| Edibility
 +
| integer
 
| A numeric value that determines how much energy (edibility × 2.5) and health
 
| 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
 
edibility × 1.125) is restored when this item is eaten. An item with an edibility
Line 551: Line 561:  
|-
 
|-
 
| IsDrink
 
| IsDrink
 +
| boolean
 
| Whether to drink the item instead of eating it. Ignored if the item isn't edible per its Edibility.
 
| Whether to drink the item instead of eating it. Ignored if the item isn't edible per its Edibility.
 
|-
 
|-
| Buffs  
+
| Buffs
| The buffs to apply to the player when this item is eaten, if any. Ignored if the item isn't edible per its Edibility. This field is a <samp>List</samp> of <samp>ObjectBuffData</samp>, stored in the game code in <samp>StardewValley.GameData.Objects.ObjectBuffData</samp>.
+
| <samp>List</samp> of <samp>ObjectBuffData</samp>, stored in the game code in <samp>StardewValley.GameData.Objects.ObjectBuffData</samp>.
 +
| The buffs to apply to the player when this item is eaten, if any. Ignored if the item isn't edible per its Edibility.
 
|-
 
|-
 
| GeodeDropsDefaultItems
 
| GeodeDropsDefaultItems
 +
| boolean
 
| If true, the item will drop a default item when broken as a geode. If GeodeDrops is also set, there's a 50% chance of choosing a value from that list instead.
 
| If true, the item will drop a default item when broken as a geode. If GeodeDrops is also set, there's a 50% chance of choosing a value from that list instead.
 
|-
 
|-
 
| GeodeDrops
 
| GeodeDrops
 +
| <samp>List</samp> of <samp>ObjectGeodeDropData</samp>, stored in the game code in <samp>StardewValley.GameData.Objects.ObjectGeodeDropData</samp>.
 
| The items that can be dropped when this item is broken open as a geode, or null.
 
| The items that can be dropped when this item is broken open as a geode, or null.
 
|-
 
|-
 
| ArtifactSpotChances
 
| ArtifactSpotChances
 +
| <samp>Dictionary</samp> of string keys and float values.
 
| If this is an artifact (i.e. Type is Arch), the chance that it can be found by digging artifact spots in each location.
 
| If this is an artifact (i.e. Type is Arch), the chance that it can be found by digging artifact spots in each location.
 
|-
 
|-
|}
+
| ExcludeFromFishingCollection
 
+
| boolean
 
+
| Whether to exclude this item from the fishing collection and perfection score.
Legacy from 1.5:
  −
 
  −
{| class="wikitable"
  −
|-
  −
! index
  −
! field
  −
! effect
  −
|-
  −
!style="text-align: left;" colspan="3"| all objects
  −
|-
  −
| 0
  −
| name
  −
| The internal item name (and display name in English).
  −
|-
  −
| 1
  −
| price
  −
| The gold price of the item when sold by the player. This is not the price when bought from a shop.
  −
|-
  −
| 2
  −
| edibility
  −
| 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.
  −
|-
  −
| 3
  −
| type and category
  −
| &#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.
  −
 
  −
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/Objects</samp> and their purposes (as is currently understood) are as follows:
  −
*<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>.
  −
*<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
  −
| display name
  −
| The translated item name (not used when playing in English).
  −
|-
  −
| 5
  −
| description
  −
| The translated item description.
  −
|-
  −
!style="text-align: left;" colspan="3"| miscellaneous
  −
|-
  −
| 6
  −
| miscellaneous
  −
| &#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.
  −
* 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).
  −
* 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
  −
| miscellaneous 2
  −
|
  −
* 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
  −
! buff
  −
|-
  −
| 0
  −
| [[Skills#Farming|farming]]
  −
|-
  −
| 1
  −
| [[Skills#Fishing|fishing]]
  −
|-
  −
| 2
  −
| [[Skills#Mining|mining]]
  −
|-
  −
| 3
  −
| ''unused''
  −
|-
  −
| 4
  −
| [[Luck|luck]]
   
|-
 
|-
| 5
+
| ExcludeFromShippingCollection
| [[Skills#Foraging|foraging]]
+
| boolean
 +
| Whether to exclude this item from the shipping collection and perfection score.
 
|-
 
|-
| 6
+
| ExcludeFromRandomSale
| ''unused''
+
| boolean
 +
| Whether to exclude this item from shops when selecting random items to sell.
 
|-
 
|-
| 7
+
| ContextTags
| max [[energy]]
+
| <samp>List</samp> of strings.
 +
| The custom [[#Context_tags|context tags]] to add for this item (in addition to the tags added automatically based on the other object data).
 
|-
 
|-
| 8
+
| CustomFields
| [[magnetism]]
+
| <samp>Dictionary</samp> of string keys and string values.
 +
| Custom fields ignored by the base game, for use by mods.
 
|-
 
|-
| 9
  −
| [[speed]]
  −
|-
  −
| 10
  −
| [[defense]]
  −
|-
  −
| 11
  −
| [[attack]]
  −
|}
  −
|-
  −
| 8
  −
| buff duration
  −
| 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).
+
* In 1.5, 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 1,216: Line 1,131:     
[[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.}}
46

edits

Navigation menu