Changes

→‎Item references: add mention of qualified vs unqualified format in data assets, start table by asset
Line 87: Line 87:     
===Item references===
 
===Item references===
Item references throughout the game code now use the <samp>ItemID</samp> (and sometimes <samp>QualifiedItemID</samp>) instead of the <samp>ParentSheetIndex</samp>. Since the <samp>ItemID</samp> is identical to the index for existing vanilla items, most data assets are unaffected by this change. For example, here's from <samp>Data/NPCDispositions</samp> with one custom item:
+
Item references throughout the game code now use the <samp>ItemID</samp> instead of the <samp>ParentSheetIndex</samp>. Since the <samp>ItemID</samp> is identical to the index for existing vanilla items, most data assets are unaffected by this change. For example, here's from <samp>Data/NPCDispositions</samp> with one custom item:
 
<syntaxhighlight lang="json">
 
<syntaxhighlight lang="json">
 
"Universal_Like": "-2 -7 -26 -75 -80 72 395 613 634 635 636 637 638 724 459 Example.ModID_watermelon"
 
"Universal_Like": "-2 -7 -26 -75 -80 72 395 613 634 635 636 637 638 724 459 Example.ModID_watermelon"
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
Unless otherwise noted, unqualified item IDs will produce [[Modding:Object data|objects]]. Some assets let you override that by specifying a <samp>QualifiedItemID</samp> value instead. For example, you can add <code>(O)128</code> to the gift taste list to explicitly add for an object. Here's a partial list of data assets and their supported item ID formats:
 +
 +
{| class="wikitable"
 +
|-
 +
! data asset
 +
! item ID format
 +
|-
 +
| [[Modding:Recipe data|<samp>Data/CraftingRecipes</samp><br /><samp>Data/CookingRecipes</samp>]]
 +
| &#32;
 +
* Ingredients: both supported.
 +
* Output: set field 2 to the unqualified item ID, and field 3 to one of <samp>true</samp> (bigcraftable) or <samp>false</samp> (object) or an item type identifier like <samp>BC</samp>.
 +
|-
 +
| [[#Custom fruit trees|<samp>Data/fruitTrees</samp>]]
 +
| &#32;
 +
* Fruit: both supported.
 +
* Sapling: unqualified only.
 +
|-
 +
| [[Modding:Gift taste data|<samp>Data/NPCGiftTastes</samp>]]
 +
| Both supported, but only <samp>(O)</samp> items can be gifted.
 +
|}
    
===Define a custom item===
 
===Define a custom item===
translators
8,447

edits