Modding:Objects: Difference between revisions
imported>Pathoschild update link |
imported>Pathoschild adjust page post-split, remove outdated info, remove history (woefully incomplete and probably not worth trying to backfill) |
||
| Line 1: | Line 1: | ||
← [[Modding:Items|Items]] | ← [[Modding:Items|Items]] | ||
This page explains how the game stores and parses item data. | This page explains how the game stores and parses object-type item data. For items in general, see [[Modding:Items]]. | ||
== | ==Overview== | ||
Objects are the default type for items in inventories or | Objects are the default type for items in inventories or in the world. Depending on their data, they can be placed, picked up, eaten, sold to shops, etc. | ||
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 [[/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 [[/Object sprites|a table of sprites and their corresponding indexes]]. | ||
==Data format== | |||
The object data in <samp>Data/Objects</samp> consists of a string → model lookup, where... | The object data in <samp>Data/Objects</samp> consists of a string → model lookup, where... | ||
* The key is the unqualified [[Modding:Common data field types#Item ID|item ID]]. | * The key is the unqualified [[Modding:Common data field types#Item ID|item ID]]. | ||
* The value is a model with the fields listed below. | * The value is a model with the fields listed below. | ||
===Basic info=== | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| Line 26: | Line 26: | ||
|- | |- | ||
| <samp>Type</samp> | | <samp>Type</samp> | ||
| The item's general type, like Arch (artifact) or Minerals. The vanilla types are: Litter, | | The item's general type, like Arch (artifact) or Minerals. The vanilla types are: <samp>Basic</samp>, <samp>Arch</samp> (artifact), <samp>Litter</samp> (e.g. debris), <samp>Minerals</samp>, <samp>Quest</samp>, <samp>Crafting</samp>, <samp>Fish</samp>, <samp>Cooking</samp>, <samp>Seeds</samp>, <samp>Ring</samp>, <samp>interactive</samp>, and some placeholder values like <samp>asdf</samp>. | ||
'''Caution:''' adding custom items with the <samp>Arch</samp> type is inadvisable as it often leads to [[Artifact Spot|artifact spot]]s becoming broken and not giving any items. | |||
|- | |- | ||
| <samp>Category</samp> | | <samp>Category</samp> | ||
| Line 35: | Line 37: | ||
|} | |} | ||
===Appearance=== | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| Line 48: | Line 50: | ||
|} | |} | ||
===Edibility=== | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| Line 127: | Line 129: | ||
|} | |} | ||
===Geodes & artifact spots=== | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| Line 176: | Line 178: | ||
|} | |} | ||
===Context tags & exclusions=== | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| Line 201: | Line 203: | ||
|} | |} | ||
===Advanced=== | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| Line 211: | Line 213: | ||
|} | |} | ||
=== | ==Unobtainable items== | ||
The spritesheet and data 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. | |||
==See also== | ==See also== | ||
* [[Modding: | * [[Modding:Items]] for item data in general | ||
[[Category:Modding]] | [[Category:Modding]] | ||
[[ru:Модификации:Объекты]] | [[ru:Модификации:Объекты]] | ||
Revision as of 21:01, 15 December 2024
← Items
This page explains how the game stores and parses object-type item data. For items in general, see Modding:Items.
Overview
Objects are the default type for items in inventories or in the world. Depending on their data, they can be placed, picked up, eaten, sold to shops, etc.
They have their data in Data/Objects (Data/ObjectInformation prior to 1.6), their icon sprites in Maps/springobjects, and their code in StardewValley.Object. See a table of sprites and their corresponding indexes.
Data format
The object data in Data/Objects consists of a string → model lookup, where...
- The key is the unqualified item ID.
- The value is a model with the fields listed below.
Basic info
| field | purpose |
|---|---|
| Name | The internal item name. |
| DisplayName Description |
A tokenizable string for the item's in-game display name and description. |
| Type | The item's general type, like Arch (artifact) or Minerals. The vanilla types are: Basic, Arch (artifact), Litter (e.g. debris), Minerals, Quest, Crafting, Fish, Cooking, Seeds, Ring, interactive, and some placeholder values like asdf.
Caution: adding custom items with the Arch type is inadvisable as it often leads to artifact spots becoming broken and not giving any items. |
| Category | The item category. |
| Price | (Optional) The price when sold by the player. This is not the price when bought from a shop. Default 0. |
Appearance
| field | purpose |
|---|---|
| Texture | The asset name for the texture containing the item's sprite. Defaults to Maps/springobjects. |
| SpriteIndex | The sprite's index within the Texture, where 0 is the top-left sprite. |
Edibility
| field | purpose | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Edibility | (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. | ||||||||||||||||||||||||||||||||||
| IsDrink | (Optional) Whether to drink the item instead of eating it. Default false. | ||||||||||||||||||||||||||||||||||
| Buffs | (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:
|
Geodes & artifact spots
| field | purpose | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| GeodeDrops GeodeDropsDefaultItems |
(Optional) The items that can be dropped when breaking open this item as a geode. Specifying either or both fields automatically enables geode behavior for this item.
You can specify one or both fields:
If both fields are specified, each geode will choose between them with an equal 50% chance. If GeodeDrops is specified but no entries match, the geode will use the GeodeDropsDefaultItems regardless of whether it's true. | ||||||||||
| ArtifactSpotChances | (Optional) If this is an artifact (i.e. the Type field is Arch), the chance that it can be found by digging artifact spots in each location.
This consists of a string → model lookup, where:
|
Context tags & exclusions
| field | purpose |
|---|---|
| ContextTags | (Optional) The custom 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:
"ContextTags": [ "color_yellow", "fish_ocean", "fish_upright", "season_summer" ]
|
| CanBeGivenAsGift | (Optional) Whether this item can be gifted to NPCs. Default true. |
| CanBeTrashed | (Optional) Whether this item can be trashed from the player's inventory. Default true. |
| ExcludeFromRandomSale | (Optional) Whether to exclude this item from shops when selecting random items to sell. Default false. |
| ExcludeFromFishingCollection ExcludeFromShippingCollection |
(Optional) Whether to exclude this item from the fishing/shipping collection and their respective effect on the perfection score. Default false, in which case the normal requirements apply (e.g. artifacts are always excluded from the shipping collection). |
Advanced
| field | purpose |
|---|---|
| CustomFields | (Optional) The custom fields for this entry. |
Unobtainable items
The spritesheet and data 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.
See also
- Modding:Items for item data in general