Line 648: |
Line 648: |
| | | |
| ===Context tags=== | | ===Context tags=== |
− | A ''context tag'' is an arbitrary data label attached to items. These can produce various effects in-game, or may be informational only. Context tags are case-insensitive. | + | A ''context tag'' is an arbitrary data label attached to items. These can produce various effects in-game, or may be informational only. Context tags are case-insensitive. The game generates some tags based on the game data (like the item quality), and others are defined in <samp>Data/Objects</samp>. |
− | | |
− | The game generates some tags based on the game data (like the item quality), and others are defined in the <samp>Data/ObjectContextTags</samp> data asset (which consists of a string→string dictionary, where the key is the item's internal name ''or'' the alternative ID matching the <samp>id_{{t|type}}_{{t|identifier}}</samp> tag, and the value is a comma-delimited list of tags to add). | |
| | | |
| Here's an ''incomplete'' list of context tags added or used in the base game. Mods can add custom context tags, which aren't listed here. | | Here's an ''incomplete'' list of context tags added or used in the base game. Mods can add custom context tags, which aren't listed here. |
Line 724: |
Line 722: |
| </dd> | | </dd> |
| | | |
− | <dt>Context tags from <samp>Data/ObjectContextTags</samp>:</dt> | + | <dt>Color tags:</dt> |
| <dd> | | <dd> |
| {| class="wikitable" | | {| class="wikitable" |
Line 778: |
Line 776: |
| |- | | |- |
| | <samp>geode_crusher_ignored</samp> | | | <samp>geode_crusher_ignored</samp> |
− | | Prevents breaking this item open in a [[Geode Crusher|geode crusher]], even if the item has geode fields in [[#Custom objects|<samp>Data/Objects</samp>]]. | + | | Prevents breaking this item open in a [[Geode Crusher|geode crusher]], even if the item has geode fields in [[Modding:Items#Objects|<samp>Data/Objects</samp>]]. |
| |- | | |- |
| | <samp>item_type_{{t|type}}</samp> | | | <samp>item_type_{{t|type}}</samp> |
Line 807: |
Line 805: |
| </dd> | | </dd> |
| | | |
− | <dt>Context tags which affect [[#Custom machines|machine processing]]:</dt> | + | <dt>Context tags which affect [[Modding:Machines|machine processing]]:</dt> |
| <dd> | | <dd> |
| {| class="wikitable" | | {| class="wikitable" |
Line 843: |
Line 841: |
| |- | | |- |
| | <samp>fish_legendary</samp><br /><samp>fish_legendary_family</samp> | | | <samp>fish_legendary</samp><br /><samp>fish_legendary_family</samp> |
− | | Marks the fish as a [[Fish#Legendary Fish|legendary fish]] or [[Quests#Extended Family|legendary fish family]]. These are purely informational; the legendary fish behavior is determined by data fields like <samp>CatchLimit</samp> or <samp>IsBossFish</samp> in [[#Custom locations|<samp>Data/Locations</samp>]]. | + | | Marks the fish as a [[Fish#Legendary Fish|legendary fish]] or [[Quests#Extended Family|legendary fish family]]. These are purely informational; the legendary fish behavior is determined by data fields like <samp>CatchLimit</samp> or <samp>IsBossFish</samp> in [[Modding:Location_data|<samp>Data/Locations</samp>]]. |
| |- | | |- |
| | <samp>geode</samp> | | | <samp>geode</samp> |
− | | ''(Added automatically)'' Marks the item as a [[Minerals#Geodes|geode]] item, which can be broken open at [[Blacksmith|Clint's blacksmith shop]] or using a [[Geode Crusher|geode crusher]]. This is added automatically if the geode fields are present in [[#Custom objects|<samp>Data/Objects</samp>]]. | + | | ''(Added automatically)'' Marks the item as a [[Minerals#Geodes|geode]] item, which can be broken open at [[Blacksmith|Clint's blacksmith shop]] or using a [[Geode Crusher|geode crusher]]. This is added automatically if the geode fields are present in [[Modding:Items#Objects|<samp>Data/Objects</samp>]]. |
| |- | | |- |
| | <samp>id_{{t|item id}}</samp> | | | <samp>id_{{t|item id}}</samp> |
− | | ''(Added automatically)'' The [[#Custom items|qualified item ID]], like <samp>id_(o)128</samp>. This can be used to match or exclude an item by ID using context tags. Any spaces in the ID are replaced with underscores, and single quotes are removed. | + | | ''(Added automatically)'' The [[Modding:Common_data_field_types#Item_ID|qualified item ID]], like <samp>id_(o)128</samp>. This can be used to match or exclude an item by ID using context tags. Any spaces in the ID are replaced with underscores, and single quotes are removed. |
| |- | | |- |
| | <samp>is_machine</samp> | | | <samp>is_machine</samp> |
− | | ''(Added automatically)'' Indicates the item has [[#Custom machines|machine logic]]. This is added automatically based on <samp>Data/Machines</samp>. | + | | ''(Added automatically)'' Indicates the item has [[Modding:Machines|machine logic]]. This is added automatically based on <samp>Data/Machines</samp>. |
| |- | | |- |
| | <samp>machine_input</samp> | | | <samp>machine_input</samp> |
Line 867: |
Line 865: |
| </dl> | | </dl> |
| | | |
− | Some game data also references context tags in a generic way. For example, you can add custom tags for an item to <samp>Data/ObjectContextTags</samp>, then reference them in the fish pond data. Specifically: | + | Some game data also references context tags in a generic way. For example, you can add custom tags to an item, then reference them in the fish pond data. Specifically: |
| | | |
| {| class="wikitable" | | {| class="wikitable" |
Line 886: |
Line 884: |
| | In <samp>Data/NPCGiftTastes</samp>, used to set character likes and dislike for every item using the context tag. | | | In <samp>Data/NPCGiftTastes</samp>, used to set character likes and dislike for every item using the context tag. |
| |} | | |} |
− |
| |
| | | |
| The <samp>debug listtags</samp> [[Modding:Console commands|console command]] lists all the tags of the item being held. | | The <samp>debug listtags</samp> [[Modding:Console commands|console command]] lists all the tags of the item being held. |