Changes

Jump to navigation Jump to search
→‎Context tags: add info from Modding:Migrate to Stardew Valley 1.6 (main author Pathoschild, Atravita, with formatting fixes by Margotbean)
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.
+
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 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).
 
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).
Line 760: Line 760:  
| <samp>color_black</samp>, <samp>color_gray</samp>, <samp>color_dark_gray</samp>, <samp>color_white</samp>, <samp>color_iron</samp>, <samp>color_prismatic</samp>
 
| <samp>color_black</samp>, <samp>color_gray</samp>, <samp>color_dark_gray</samp>, <samp>color_white</samp>, <samp>color_iron</samp>, <samp>color_prismatic</samp>
 
|}
 
|}
 +
|}
 +
 +
<dt>Tags added in 1.6:</dt>
 +
<dd>
 +
{| class="wikitable"
 +
|-
 +
! context tag
 +
! effect
 +
|-
 +
| <samp>campfire_item</samp>
 +
| Marks the item as a [[campfire]]. If the item also has the <samp>torch_item</samp> context tag, when it's placed in the world and turned on...
 +
* campfire flames are drawn over it;
 +
* if the item is [[Modding:Items#Big craftables|big craftable]], light is emitted from its center instead of the top.
 +
|-
 +
| <samp>fish_pond_ignore</samp>
 +
| Prevents players from adding this fish to [[Fish Pond|fish ponds]], even if it would otherwise match an entry in <samp>Data/FishPondData</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>]].
 +
|-
 +
| <samp>item_type_{{t|type}}</samp>
 +
| For an [[Modding:Items#Objects|object-type item]], the type value from the 'type and category' field. (Non-object items always have the exact tag <samp>item_type_</samp> with nothing after the last underscore.) This is automatic and shouldn't be set manually. The tag is checked in a few places (''e.g.'' the [[museum]] to check if an item is an artifact or mineral), but most of the game won't be affected.
 +
|-
 +
| <samp>museum_donatable</samp><br /><samp>not_museum_donatable</samp>
 +
| Set whether the item can be donated to the [[museum]], overriding the vanilla logic.
 +
|-
 +
| <samp>not_giftable</samp>
 +
| Prevents players from gifting this item to NPCs, who'll ignore the item entirely (e.g. as if you were holding a tool).
 +
 +
This only affects gift-giving, it doesn't affect non-gift logic like quest goals or special order objectives. If the NPC also has a <samp>reject_*</samp> dialogue for the item, the dialogue takes priority.
 +
|-
 +
| <samp>not_placeable</samp><br /><samp>placeable</samp>
 +
| Sets whether the item can be placed on the ground.
 +
|-
 +
| <samp>prevent_loss_on_death</samp>
 +
| Indicates the item can't be [[Adventurer's Guild#Item Recovery Service|lost when the player dies]].
 +
|-
 +
| <samp>sign_item</samp>
 +
| Marks the item as a [[Crafting#Signs|sign]], which lets player display items on it or place it on a [[Fish Pond|fish pond]] to show the fish count.
 +
|-
 +
| <samp>torch_item</samp>
 +
| Marks the item as a [[torch]], which lets the player turn it on/off to emit light.
 +
 +
See also <samp>campfire_item</samp>.
 +
|}
 +
</dd>
 +
 +
<dt>Context tags which affect [[#Custom machines|machine processing]]:</dt>
 +
<dd>
 +
{| class="wikitable"
 +
|-
 +
! context tag
 +
! effect
 +
|-
 +
| <samp>crystalarium_banned</samp>
 +
| When applied to a gem or mineral item, prevents players from placing it in a [[crystalarium]].
 +
|-
 +
| <samp>keg_juice</samp><br /><samp>keg_wine</samp>
 +
| Allows processing the item in a [[keg]] to produce a juice or wine variant.
 +
|-
 +
| <samp>preserves_jelly</samp><br /><samp>preserves_pickle</samp>
 +
| Allows processing the item in a [[Preserves Jar|preserves jar]] to produce a jelly or pickled variant.
 +
|-
 +
| <samp>seedmaker_banned</samp>
 +
| When applied to a seed item, prevents players from placing it in a [[Seed Maker|seed maker]].
 +
|-
 +
| <samp>tapper_item</samp>
 +
| Marks the item as a [[tapper]] or [[Heavy Tapper|heavy tapper]].
 +
|-
 +
| <samp>tapper_multiplier_{{t|multiplier}}</samp>
 +
| The multiplier applied to the tapper production speed. For example, <samp>2</samp> will make items take half their base time (''i.e.'' each item will finish in <sup>base time</sup>/<sub>speed multiplier</sub>). Defaults to 1 if omitted.
 +
|}
 +
</dd>
 +
 +
 +
<dt>Informational tags which have no effect on the game logic:</dt>
 +
<dd>
 +
{| class="wikitable"
 +
|-
 +
! context tag
 +
! effect
 +
|-
 +
| <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>]].
 +
|-
 +
| <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>]].
 +
|-
 +
| <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.
 +
|-
 +
| <samp>is_machine</samp>
 +
| ''(Added automatically)'' Indicates the item has [[#Custom machines|machine logic]]. This is added automatically based on <samp>Data/Machines</samp>.
 +
|-
 +
| <samp>machine_input</samp>
 +
| ''(Added automatically)'' Whether the item is a machine which accepts items from the player. This is added automatically based on the machine's fields in <samp>Data/Machines</samp>:
 +
* if <samp>HasInput</samp> is true;
 +
* ''or'' if any output rules have an <samp>ItemPlacedInMachine</samp> trigger.
 +
|-
 +
| <samp>machine_output</samp>
 +
| ''(Added automatically)'' Whether the item is a machine which produces items for the player to collect. This is added automatically based on the machine's fields in <samp>Data/Machines</samp>:
 +
* if <samp>HasOutput</samp> is true;
 +
* ''or'' if it has any output rules.
 
|}
 
|}
 
</dd>
 
</dd>
138

edits

Navigation menu