Changes

Jump to navigation Jump to search
→‎Big craftables: add info from Modding:Migrate to Stardew Valley 1.6 (main author Pathoschild, with formatting fixes by Margotbean)
Line 624: 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/BigCraftables</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/BigCraftables</samp> consists of an integer→string dictionary with entries like this<ref>See <samp>Data/BigCraftables.xnb</samp></ref>:
+
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">
Line 646: Line 648:  
</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"
 
|-
 
|-
! Field
+
! field
! Data Type
+
! purpose
! Effect<ref>See <samp>GameData.BigCraftables.BigCraftableData</samp></ref>
   
|-
 
|-
| Name
+
| <samp>Name</samp>
| string
+
| The internal item name.
| The internal item name (and display name in English).
   
|-
 
|-
| DisplayName
+
| <samp>DisplayName</samp><br /><samp>Description</samp>
| string
+
| A [[Modding:Tokenizable strings|tokenizable string]] for the item's in-game display name and description.
| A tokenizable string for the item's translated display name.
   
|-
 
|-
| Description
+
| <samp>Price</samp>
| string
+
| ''(Optional)'' The price when sold by the player. This is not the price when bought from a shop. Default 0.
| A tokenizable string for the item's translated description.
+
|}
|-
+
 
| Price
+
====Behavior====
| integer
  −
| The gold price when sold by the player. This is not the price when bought from a shop.
  −
|-
  −
| Fragility
  −
| integer
  −
| How the item is removed by tools. Possible values:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! fragility
+
! field
! effect
+
! purpose
 
|-
 
|-
| <samp>0</samp>
+
| <samp>Fragility</samp>
| Pick up with any tool.
+
| ''(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.
 
|-
 
|-
| <samp>1</samp>
+
| <samp>CanBePlacedIndoors</samp><br /><samp>CanBePlacedOutdoors</samp>
| Destroyed if hit with an [[Axes|axe]], [[Hoes|hoe]], or [[Pickaxes|pickaxe]]. Any other tool will pick it up.
+
| ''(Optional)'' Whether the item can be placed indoors or outdoors. Default true.
 
|-
 
|-
| <samp>2</samp>
+
| <samp>IsLamp</samp>
| Indestructible. The item can't be removed once placed.
+
| ''(Optional)'' Whether this is a lamp and should produce light when dark. Default false.
 
|}
 
|}
 +
 +
====Appearance====
 +
{| class="wikitable"
 
|-
 
|-
| CanBePlacedOutdoors
+
! field
| boolean
+
! purpose
| Whether the item can be placed outdoors.
   
|-
 
|-
| CanBePlacedIndoors
+
| <samp>Texture</samp>
| boolean
+
| ''(Optional)'' The asset name for the texture containing the item's sprite. Defaults to <samp>TileSheets/Craftables</samp>.
| Whether the item can be placed indoors.
   
|-
 
|-
| IsLamp
+
| <samp>SpriteIndex</samp>
| boolean
+
| ''(Optional)'' The sprite's index within the <samp>Texture</samp>, where 0 is the top-left sprite.
| Whether the item is a lamp and produces light when it's dark.  
+
|}
 +
 
 +
====Context tags====
 +
{| class="wikitable"
 
|-
 
|-
| Texture
+
! field
| string
+
! purpose
| The asset name for the texture containing the item's sprite, or null for <samp>TileSheets/Craftables</samp>.
   
|-
 
|-
| SpriteIndex
+
| <samp>ContextTags</samp>
| integer
+
| ''(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:
| The sprite's index in the spritesheet.
+
<syntaxhighlight lang="json">
|-
+
"ContextTags": [ "light_source", "torch_item" ]
| ContextTags
+
</syntaxhighlight>
| <samp>List</samp> of strings
+
|}
| Thee custom [[#Context_tags|context tags]] to add for this item (in addition to the tags added automatically based on the other object data).
+
 
 +
====Advanced====
 +
{| class="wikitable"
 
|-
 
|-
| CustomFields
+
! field
| <samp>Dictionary</samp> of string keys to string values
+
! purpose
| Custom fields ignored by the base game, for use by mods.
   
|-
 
|-
 +
| <samp>CustomFields</samp>
 +
| ''(Optional)'' The [[Modding:Migrate_to_Stardew_Valley_1.6#Custom_data_fields|custom fields]] for this entry.
 
|}
 
|}
  
46

edits

Navigation menu