Changes

Jump to navigation Jump to search
Removing my note about the torch_item context tag as the issue has been fixed in record time in the upcoming 1.6.9 update as per pathos (thank you, pathos!)
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 <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 732: Line 730:  
|-
 
|-
 
| <samp>color_*</samp>
 
| <samp>color_*</samp>
| The color produced by this item when the player [[Dyeing#Dye Pots|dyes clothing]] at [[2 Willow Lane|Emily's house]]. The context tag only affects which of the six color dye pots it can be placed in; for example, <samp>color_red</samp> and <samp>color_dark_red</samp> are both placed in the red pot, but they don't produce different colors.
+
| Color tags are used by a number of game functions, including when the player [[Dyeing#Dye Pots|dyes clothing]] at [[2 Willow Lane|Emily's house]], when tinting certain machine products such as [[Wine]] and [[Pickles]], and when displaying the [[Books|Book]] reading animation. For tinting purposes, each tag has a specific RGB value that is used, except when using Emily's Dye Pots, in which case they are grouped into one of the following categories.
    
{| class="wikitable"
 
{| class="wikitable"
Line 749: Line 747:  
|-
 
|-
 
| green
 
| green
| <samp>color_green</samp>, <samp>color_dark_green</samp>, <samp>color_lime</samp>, <samp>color_yellow_green</samp>, <samp>color_jade</samp>
+
| <samp>color_green</samp>, <samp>color_dark_green</samp>, <samp>color_lime</samp>, <samp>color_yellow_green</samp>, <samp>color_jade</samp>, <samp>color_sea_green</samp>
 
|-
 
|-
 
| blue
 
| blue
Line 756: Line 754:  
| purple
 
| purple
 
| <samp>color_purple</samp>, <samp>color_dark_purple</samp>, <samp>color_dark_pink</samp>, <samp>color_pale_violet_red</samp>, <samp>color_poppyseed</samp>, <samp>color_iridium</samp>
 
| <samp>color_purple</samp>, <samp>color_dark_purple</samp>, <samp>color_dark_pink</samp>, <samp>color_pale_violet_red</samp>, <samp>color_poppyseed</samp>, <samp>color_iridium</samp>
 +
|-
 +
| no color
 +
| <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 [[Modding:Items#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 [[Modding: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 [[Modding:Location_data|<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 [[Modding:Items#Objects|<samp>Data/Objects</samp>]].
 +
|-
 +
| <samp>id_{{t|item id}}</samp>
 +
| ''(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>
 +
| ''(Added automatically)'' Indicates the item has [[Modding: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>
 
</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 780: Line 883:  
| 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.
    
{{collapse|raw tag dump|content=Here's a list of context tags extracted from <samp>Data/ObjectContextTags</samp> that aren't listed above yet: <samp>alcohol_item</samp>, <samp>algae_item</samp>, <samp>ancient_item</samp>, <samp>beach_item</samp>, <samp>bomb_item</samp>, <samp>bone_item</samp>, <samp>book_item</samp>, <samp>ceramic_item</samp>, <samp>chicken_item</samp>, <samp>color_black</samp>, <samp>color_dark_gray</samp>, <samp>color_gray</samp>, <samp>color_iron</samp>, <samp>color_prismatic</samp>, <samp>color_white</samp>, <samp>cooking_item</samp>, <samp>cow_milk_item</samp>, <samp>cowboy_item</samp>, <samp>crop_year_2</samp>, <samp>dinosaur_item</samp>, <samp>doll_item</samp>, <samp>drink_item</samp>, <samp>dwarvish_item</samp>, <samp>dye_medium</samp>, <samp>dye_strong</samp>, <samp>egg_item</samp>, <samp>elvish_item</samp>, <samp>fertilizer_item</samp>, <samp>fish_bug_lair</samp>, <samp>fish_carnivorous</samp>, <samp>fish_crab_pot</samp>, <samp>fish_desert</samp>, <samp>fish_freshwater</samp>, <samp>fish_lake</samp>, <samp>fish_legendary</samp>, <samp>fish_mines</samp>, <samp>fish_night_market</samp>, <samp>fish_nonfish</samp>, <samp>fish_ocean</samp>, <samp>fish_pond</samp>, <samp>fish_river</samp>, <samp>fish_secret_pond</samp>, <samp>fish_semi_rare</samp>, <samp>fish_sewers</samp>, <samp>fish_swamp</samp>, <samp>fish_talk_demanding</samp>, <samp>fish_talk_rude</samp>, <samp>fish_talk_stiff</samp>, <samp>fish_upright</samp>, <samp>flower_item</samp>, <samp>food_bakery</samp>, <samp>food_breakfast</samp>, <samp>food_cake</samp>, <samp>food_party</samp>, <samp>food_pasta</samp>, <samp>food_salad</samp>, <samp>food_sauce</samp>, <samp>food_seafood</samp>, <samp>food_soup</samp>, <samp>food_spicy</samp>, <samp>food_sushi</samp>, <samp>food_sweet</samp>, <samp>forage_item</samp>, <samp>forage_item_beach</samp>, <samp>forage_item_cave</samp>, <samp>forage_item_desert</samp>, <samp>forage_item_mines</samp>, <samp>forage_item_secret</samp>, <samp>fossil_item</samp>, <samp>fruit_item</samp>, <samp>fruit_tree_item</samp>, <samp>furnace_item</samp>, <samp>ginger_item</samp>, <samp>goat_milk_item</samp>, <samp>golden_relic_item</samp>, <samp>honey_item</samp>, <samp>hunting_item</samp>, <samp>instrument_item</samp>, <samp>jelly_item</samp>, <samp>juice_item</samp>, <samp>large_egg_item</samp>, <samp>large_milk_item</samp>, <samp>light_source</samp>, <samp>machine_item</samp>, <samp>marine_item</samp>, <samp>mayo_item</samp>, <samp>medicine_item</samp>, <samp>milk_item</samp>, <samp>noble_item</samp>, <samp>ore_item</samp>, <samp>pickle_item</samp>, <samp>potion_item</samp>, <samp>prehistoric_item</samp>, <samp>quality_fertilizer_item</samp>, <samp>scroll_item</samp>, <samp>season_all</samp>, <samp>season_fall</samp>, <samp>season_spring</samp>, <samp>season_summer</samp>, <samp>season_winter</samp>, <samp>slime_egg_item</samp>, <samp>slime_item</samp>, <samp>statue_item</samp>, <samp>strange_doll_1</samp>, <samp>strange_doll_2</samp>, <samp>syrup_item</samp>, <samp>totem_item</samp>, <samp>toy_item</samp>, <samp>trash_item</samp>, <samp>tree_seed_item</samp>, <samp>wood_item</samp>.}}
 
{{collapse|raw tag dump|content=Here's a list of context tags extracted from <samp>Data/ObjectContextTags</samp> that aren't listed above yet: <samp>alcohol_item</samp>, <samp>algae_item</samp>, <samp>ancient_item</samp>, <samp>beach_item</samp>, <samp>bomb_item</samp>, <samp>bone_item</samp>, <samp>book_item</samp>, <samp>ceramic_item</samp>, <samp>chicken_item</samp>, <samp>color_black</samp>, <samp>color_dark_gray</samp>, <samp>color_gray</samp>, <samp>color_iron</samp>, <samp>color_prismatic</samp>, <samp>color_white</samp>, <samp>cooking_item</samp>, <samp>cow_milk_item</samp>, <samp>cowboy_item</samp>, <samp>crop_year_2</samp>, <samp>dinosaur_item</samp>, <samp>doll_item</samp>, <samp>drink_item</samp>, <samp>dwarvish_item</samp>, <samp>dye_medium</samp>, <samp>dye_strong</samp>, <samp>egg_item</samp>, <samp>elvish_item</samp>, <samp>fertilizer_item</samp>, <samp>fish_bug_lair</samp>, <samp>fish_carnivorous</samp>, <samp>fish_crab_pot</samp>, <samp>fish_desert</samp>, <samp>fish_freshwater</samp>, <samp>fish_lake</samp>, <samp>fish_legendary</samp>, <samp>fish_mines</samp>, <samp>fish_night_market</samp>, <samp>fish_nonfish</samp>, <samp>fish_ocean</samp>, <samp>fish_pond</samp>, <samp>fish_river</samp>, <samp>fish_secret_pond</samp>, <samp>fish_semi_rare</samp>, <samp>fish_sewers</samp>, <samp>fish_swamp</samp>, <samp>fish_talk_demanding</samp>, <samp>fish_talk_rude</samp>, <samp>fish_talk_stiff</samp>, <samp>fish_upright</samp>, <samp>flower_item</samp>, <samp>food_bakery</samp>, <samp>food_breakfast</samp>, <samp>food_cake</samp>, <samp>food_party</samp>, <samp>food_pasta</samp>, <samp>food_salad</samp>, <samp>food_sauce</samp>, <samp>food_seafood</samp>, <samp>food_soup</samp>, <samp>food_spicy</samp>, <samp>food_sushi</samp>, <samp>food_sweet</samp>, <samp>forage_item</samp>, <samp>forage_item_beach</samp>, <samp>forage_item_cave</samp>, <samp>forage_item_desert</samp>, <samp>forage_item_mines</samp>, <samp>forage_item_secret</samp>, <samp>fossil_item</samp>, <samp>fruit_item</samp>, <samp>fruit_tree_item</samp>, <samp>furnace_item</samp>, <samp>ginger_item</samp>, <samp>goat_milk_item</samp>, <samp>golden_relic_item</samp>, <samp>honey_item</samp>, <samp>hunting_item</samp>, <samp>instrument_item</samp>, <samp>jelly_item</samp>, <samp>juice_item</samp>, <samp>large_egg_item</samp>, <samp>large_milk_item</samp>, <samp>light_source</samp>, <samp>machine_item</samp>, <samp>marine_item</samp>, <samp>mayo_item</samp>, <samp>medicine_item</samp>, <samp>milk_item</samp>, <samp>noble_item</samp>, <samp>ore_item</samp>, <samp>pickle_item</samp>, <samp>potion_item</samp>, <samp>prehistoric_item</samp>, <samp>quality_fertilizer_item</samp>, <samp>scroll_item</samp>, <samp>season_all</samp>, <samp>season_fall</samp>, <samp>season_spring</samp>, <samp>season_summer</samp>, <samp>season_winter</samp>, <samp>slime_egg_item</samp>, <samp>slime_item</samp>, <samp>statue_item</samp>, <samp>strange_doll_1</samp>, <samp>strange_doll_2</samp>, <samp>syrup_item</samp>, <samp>totem_item</samp>, <samp>toy_item</samp>, <samp>trash_item</samp>, <samp>tree_seed_item</samp>, <samp>wood_item</samp>.}}
 +
 +
====ItemContextTagManager class====
 +
For C# mods, the <samp>ItemContextTagManager</samp> class simplifies working with item context tags and reduces repeated code.
 +
 +
This provides a few utility methods:
 +
{| class="wikitable"
 +
|-
 +
! method
 +
! effect
 +
|-
 +
| <code>GetBaseContextTags(id)</code>
 +
| Get the base context tags for an item based on its raw data in <samp>Data/Objects</samp> or <samp>Data/BigCraftables</samp>. This doesn't include dynamic tags added that are based on instance info (like quality), which you can get using <code>item.GetContextTags()</code>.
 +
|-
 +
| <code>DoesTagQueryMatch(query, tags)</code>
 +
| Get whether a context tag query matches the given tags. For example, <code>ItemContextTagManager.DoesTagQueryMatch("bone_item, !fossil_item", item.GetContextTags())</code> returns true if the item is a bone item but not a fossil (like the [[Bone Flute]]).
 +
|-
 +
| <code>DoAllTagsMatch(requiredTags, actualTags)</code><br /><code>DoAnyTagsMatch(requiredTags, actualTags)</code>
 +
| Get whether every (<samp>DoAllTagsMatch</samp>) or at least one (<samp>DoAnyTagsMatch</samp) required tag matches the actual item tags. This supports negated required tags like <samp>"!fossil_item"</samp> too.
 +
|-
 +
| <code>DoesTagMatch(requiredTag, actualTags)</code>
 +
| Get whether a single tag matches the actual item tags. This supports negated required tags like <samp>"!fossil_item"</samp> too.
 +
|-
 +
| <code>SanitizeContextTag(tag)</code>
 +
| ''(Specialized)'' Replace characters that may appear in item names so they're valid in context tags. For example, <code>SanitizeContextTag("Sam's Boombox")</code> returns <samp>sams_boombox</samp>.
 +
|}
    
==Objects==
 
==Objects==
Line 1,077: Line 1,204:     
==Boots==
 
==Boots==
Boots are items that can be equipped in the player's [[footwear]] slot.
  −
  −
They have their data in <samp>Data/Boots</samp>, their in-game sprites in <samp>Maps/springobjects</samp> (item sprite) and <samp>Characters/Farmer/shoeColors</samp> (shoe color), and their code in <samp>StardewValley.Objects.Boots</samp>.
  −
   
===Data format===
 
===Data format===
The boots data in <samp>Data/Boots</samp> consists of an integer→string dictionary with entries like this:
+
You can create/edit [[Footwear|boots]] by editing the <samp>Data/Boots</samp> asset. This consists of a string → string dictionary, where...
 
+
* The key is the unqualified [[Modding:Common_data_field_types#Item_ID|item ID]].
<syntaxhighlight lang="json">
+
* The value is a slash-delimited string with the fields listed below.
  "511": "Dark Boots/Made from thick black leather./250/4/2/7"
  −
</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:
      
{| class="wikitable"
 
{| class="wikitable"
Line 1,097: Line 1,216:  
|-
 
|-
 
| 0
 
| 0
| name
+
| Name
 
| The internal item name (and display name in English).
 
| The internal item name (and display name in English).
 
|-
 
|-
 
| 1
 
| 1
| description
+
| Description
 
| The translated item description shown in-game.
 
| The translated item description shown in-game.
 
|-
 
|-
 
| 2
 
| 2
| price
+
| Price
 
| '''Unused.''' The actual price is calculated as <samp>(''added defence'' × 100) + (''added immunity'' × 100)</samp>.
 
| '''Unused.''' The actual price is calculated as <samp>(''added defence'' × 100) + (''added immunity'' × 100)</samp>.
 
|-
 
|-
 
| 3
 
| 3
| added defense
+
| Added Defense
 
| A [[defense]] bonus applied to the player while equipped.
 
| A [[defense]] bonus applied to the player while equipped.
 
|-
 
|-
 
| 4
 
| 4
| added immunity
+
| Added Immunity
 
| An [[immunity]] bonus applied to the player while equipped.
 
| An [[immunity]] bonus applied to the player while equipped.
 
|-
 
|-
 
| 5
 
| 5
| color index
+
| Color Index
| The index of the boot color in the <samp>Characters/Farmer/shoeColors</samp> spritesheet.
+
| The boots color index within the Color Texture, where 0 is the top-left set, if present, otherwise the <samp>Characters/Farmer/shoeColors</samp> spritesheet.
 
|-
 
|-
 
| 6
 
| 6
| display name
+
| Display Name
 
| The translated item name shown in-game (for non-English assets only).
 
| The translated item name shown in-game (for non-English assets only).
 +
|-
 +
| 7
 +
| Color Texture
 +
| The asset name for the texture containing the boots color sprite.
 +
|-
 +
| 8
 +
| Sprite Index
 +
| The boots sprite index within the Texture, where 0 is the top-left set.
 +
|-
 +
| 9
 +
| Texture
 +
| The asset name for the texture containing the boots sprite.
 
|}
 
|}
   −
==Clothing==
+
The boots data in <samp>Data/Boots</samp> consists of a string → string dictionary with entries like this:
Clothing consists of cosmetic items that can be equipped in the player's [[Tailoring|pants and shirt]] slots.
     −
They have their data in <samp>Data/ClothingInformation</samp>, their in-game sprites in <samp>Characters/Farmer/pants</samp> & <samp>Characters/Farmer/shirts</samp>, and their code in <samp>StardewValley.Objects.Clothing</samp>.
+
<syntaxhighlight lang="json">
 +
  "511": "Dark Boots/Made from thick black leather./250/4/2/7"
 +
</syntaxhighlight>
   −
===Data format===
+
A custom entry might look something like this:
The clothing data in <samp>Data/ClothingInformation</samp> consists of an integer→string dictionary with entries like this:
      
<syntaxhighlight lang="json">
 
<syntaxhighlight lang="json">
   "1282": "Tomato Shirt/Tomato Shirt/A shirt that answers the big question: 'Tomatoes are'... (but the rest is smudged)./282/-1/50/255 0 0/false/Shirt/Sleeveless"
+
{
 +
   "Format": "2.2.0",
 +
  "Changes": [
 +
    {
 +
      "LogName": "Load boots texture",
 +
      "Action": "Load",
 +
      "Target": "{{ModId}}/Boots, {{ModId}}/BootsColor",
 +
      "FromFile": "assets/{{TargetWithoutPath}}.png"
 +
    },
 +
    {
 +
      "LogName": "Add boots to boots data",
 +
      "Action": "EditData",
 +
      "Target": "Data/Boots",
 +
      "Entries": {
 +
        "{{ModId}}_OPBoots": "Overpowered Boots/These boots are totally broken!/1000000/100/100/8/Overpowered Boots/{{ModId}}\\BootsColor/0/{{ModId}}\\Boots"
 +
      }
 +
    }
 +
  ]
 +
}
 
</syntaxhighlight>
 
</syntaxhighlight>
   −
For each entry in the data asset, the key is the item's <samp>ParentSheetIndex</samp> (offset by 1000 for shirts) and the value is a slash-delimited string with these fields:
+
==Pants==
 +
 
 +
===Data format===
 +
 
 +
You can create/edit [[Tailoring#Pants|pants]] by editing the <samp>Data/Pants</samp> asset. This consists of a string → model lookup, where...
 +
* The key is the unqualified [[Modding:Common_data_field_types#Item_ID|item ID]].
 +
* The value is a model with the fields listed below.
 +
 
 +
====Basic pants data====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>Name</samp>
 +
| ''(Optional)'' The internal name for the item. Default <samp>Pants</samp>.
 +
|-
 +
| <samp>DisplayName</samp><br /><samp>Description</samp>
 +
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] for the item's in-game display name and description. Defaults to the generic pants text (''Pants'' and ''A wearable pair of pants'').
 +
|-
 +
| <samp>Price</samp>
 +
| ''(Optional)'' The default price when the item is sold to the player in a shop. Default 50.
 +
|}
 +
 
 +
====Appearance====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>Texture</samp>
 +
| The asset name for the texture containing the pants' sprite. Defaults to <samp>Characters/Farmer/pants</samp>.
 +
|-
 +
| <samp>SpriteIndex</samp>
 +
| The pants' sprite index within the <samp>Texture</samp>, where 0 is the top-left set.
 +
|-
 +
| <samp>DefaultColor</samp>
 +
| ''(Optional)'' The dye color to apply to the sprite when the player hasn't [[dyeing|dyed]] it yet, if any. See [[Modding:Common_data_field_types#Color|color format]]. Default <samp>255 235 203</samp> (which matches the color of the cloth item).
 +
|-
 +
| <samp>CanBeDyed</samp>
 +
| ''(Optional)'' Whether the player can [[dyeing|dye]] these pants. Default false.
 +
|-
 +
| <samp>IsPrismatic</samp>
 +
| ''(Optional)'' Whether the pants continuously shift colors. This overrides <samp>DefaultColor</samp> and <samp>CanBeDyed</samp> if set. Default false.
 +
|}
 +
 
 +
====Other====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>CanChooseDuringCharacterCustomization</samp>
 +
| ''(Optional)'' Whether these pants can be selected on the character customization screen (e.g. when creating a character). Default false.
 +
|-
 +
| <samp>CustomFields</samp>
 +
| The [[Modding:Common_data_field_types#Custom_fields|custom fields]] for this entry.
 +
|}
 +
 
 +
==Shirts==
    +
===Data format===
 +
 +
You can create/edit [[Tailoring#Shirts|shirts]] by editing the new <samp>Data/Shirts</samp> asset. This consists of a string → model lookup, where...
 +
* The key is the unqualified [[Modding:Common_data_field_types#Item_ID|item ID]].
 +
* The value is a model with the fields listed below.
 +
 +
====Basic shirt data====
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! index
   
! field
 
! field
! effect
+
! purpose
 +
|-
 +
| <samp>Name</samp>
 +
| ''(Optional)'' The internal name for the item. Default <samp>Shirt</samp>.
 +
|-
 +
| <samp>DisplayName</samp><br /><samp>Description</samp>
 +
| ''(Optional)'' A [[Modding:Tokenizable strings|tokenizable string]] for the item's in-game display name and description. Defaults to the generic shirt text (''Shirt'' and ''A wearable shirt'').
 +
|-
 +
| <samp>Price</samp>
 +
| ''(Optional)'' The default price when the item is sold to the player in a shop. Default 50.
 +
|}
 +
 
 +
====Appearance====
 +
{| class="wikitable"
 
|-
 
|-
| 0
+
! field
| name
+
! purpose
| The internal item name (and display name in English).
   
|-
 
|-
| 1
+
| <samp>Texture</samp>
| display name
+
| The asset name for the texture containing the shirt's sprite. Defaults to <samp>Characters/Farmer/shirts</samp>.
| The translated item name shown in-game.
   
|-
 
|-
| 2
+
| <samp>SpriteIndex</samp>
| description
+
| The shirt's sprite index within the <samp>Texture</samp>, where 0 is the top-left set.
| The translated item description shown in-game.
   
|-
 
|-
| 3
+
| <samp>DefaultColor</samp>
| male index
+
| ''(Optional)'' The dye color to apply to the sprite when the player hasn't [[dyeing|dyed]] it yet, if any. See [[Modding:Common_data_field_types#Color|color format]]. Default none.
| The sprite index in the clothing spritesheet for male characters.
   
|-
 
|-
| 4
+
| <samp>CanBeDyed</samp>
| female index
+
| ''(Optional)'' Whether the player can [[dyeing|dye]] this shirt. Default false.
| The sprite index in the clothing spritesheet for female characters, or <samp>-1</samp> to use the male index.
   
|-
 
|-
| 5
+
| <samp>IsPrismatic</samp>
| price
+
| ''(Optional)'' Whether the shirt continuously shifts colors. This overrides <samp>DefaultColor</samp> and <samp>CanBeDyed</samp> if set. Default false.
| The price when purchased from shops.
   
|-
 
|-
| 6
+
| <samp>HasSleeves</samp>
| default color
+
| ''(Optional)'' Whether to draw shirt sleeves. Default true.
| The default color, specified in space-delimited RGB with each channel being an integer from 0 (no color) to 255 (full color). For example, <samp>255 0 0</samp> for full red.
+
|}
 +
 
 +
====Other====
 +
{| class="wikitable"
 
|-
 
|-
| 7
+
! field
| dyeable
+
! purpose
| Whether the clothing can be [[Dyeing|dyed]] (<samp>true</samp> or <samp>false</samp>).
   
|-
 
|-
| 8
+
| <samp>CanChooseDuringCharacterCustomization</samp>
| Type
+
| ''(Optional)'' Whether this shirt can be selected on the character customization screen (e.g. when creating a character). Default false.
| The clothing type. One of <samp>Pants</samp>, <samp>Shirt</samp>, or <s><samp>Accessory</samp></s> (unimplemented).
   
|-
 
|-
| 9
+
| <samp>CustomFields</samp>
| extra data
+
| The [[Modding:Common_data_field_types#Custom_fields|custom fields]] for this entry.
| A comma-delimited list of tags attached to the item (unrelated to [[#Context tags|context tags]]). The values recognized by the game are <samp>Prismatic</samp> (adds a shifting rainbow effect) and <samp>Sleeveless</samp> (disables drawing the sleeve color over the player's arms).
   
|}
 
|}
   Line 1,189: Line 1,410:  
Furniture are decorative items which can be placed in the world, including chairs which the player can sit on.
 
Furniture are decorative items which can be placed in the world, including chairs which the player can sit on.
   −
They have their data in <samp>Data/Furniture</samp>, their in-game sprites in <samp>TileSheets/furniture</samp>, and their code in <samp>StardewValley.Objects.Furniture</samp>.
+
They have their data in <samp>Data/Furniture</samp>, their in-game sprites in <samp>TileSheets/furniture</samp>, translations in <samp>Strings/Furniture</samp>, and their code in <samp>StardewValley.Objects.Furniture</samp>.
    
===Data format===
 
===Data format===
Line 1,312: Line 1,533:  
| 7
 
| 7
 
| display name
 
| display name
| The translated furniture name (in non-English data assets only).
+
| The translated furniture name, which allows [[Modding:Tokenizable strings|tokenizable strings]].
 +
|-
 +
| 8
 +
| sprite index
 +
| The sprite index within the spritesheet texture to draw.
 +
|-
 +
| 9
 +
| texture
 +
| ''(Optional)'' The asset name of the texture to draw. Defaults to <samp>TileSheets/furniture</samp>.
 +
|-
 +
| 10
 +
| off limits for random sale
 +
| ''(Optional)'' Whether to prevent this furniture from appearing in randomly generated shop stocks and the furniture catalogue. Default false.
 +
|-
 +
| 11
 +
| context tags
 +
| ''(Optional)'' A space-delimited list of [[Modding:Items#Context tags|context tags]] which apply to this furniture. Default none.
 
|}
 
|}
   Line 1,374: Line 1,611:  
[[Tools]] are items that can be swung or used by the player to perform some effect (e.g. dig dirt, chop trees, etc).
 
[[Tools]] are items that can be swung or used by the player to perform some effect (e.g. dig dirt, chop trees, etc).
   −
They have their in-game sprites in <samp>TileSheets/Tools</samp>, and their code in <samp>StardewValley.Tool</samp> and various subclasses like <samp>StardewValley.Tools.Axe</samp>.
+
They have their data in <samp>Data/Tools</samp>, their in-game sprites in <samp>TileSheets/Tools</samp>, and their code in <samp>StardewValley.Tool</samp> and various subclasses like <samp>StardewValley.Tools.Axe</samp>.
    
===Data format===
 
===Data format===
Tools are currently hardcoded and can't be edited by content packs.
+
 
 +
You can create/edit [[tools]] by editing the<samp>Data/Tools</samp> asset. This consists of a string → model lookup, where...
 +
* The key is the unqualified [[Modding:Common_data_field_types#Item_ID|item ID]].
 +
* The value is a model with the fields listed below.
 +
 
 +
====Basic tool data====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>ClassName</samp>
 +
| The name of the C# class to construct within the <code>StardewValley.Tools</code> namespace. The class must be a subclass of <samp>StardewValley.Tool</samp>, and have a constructor with no arguments. For example, given a value of <samp>Axe</samp>, the game will create <code>StardewValley.Tools.Axe</code> instances.
 +
 
 +
The main values are:
 +
* main tools (<samp>Axe</samp>, <samp>FishingRod</samp>, <samp>Hoe</samp>, <samp>MeleeWeapon</samp>, <samp>MilkPail</samp>, <samp>Pan</samp>, <samp>Pickaxe</samp>, <samp>Shears</samp>, <samp>Wand</samp>, and <samp>WateringCan</samp>);
 +
* a special <samp>GenericTool</samp> type which applies the <samp>Data/Tools</samp> data and only has generic logic, so C# mods can patch in their own logic;
 +
* and two tools cut from the game which may not work correctly (<samp>Lantern</samp> and <samp>Raft</samp>).
 +
|-
 +
| <samp>Name</samp>
 +
| The internal name to set for the tool item.
 +
|-
 +
| <samp>DisplayName</samp><br /><samp>Description</samp>
 +
| A [[Modding:Tokenizable strings|tokenizable string]] for the tool's in-game display name and description.
 +
|-
 +
| <samp>AttachmentSlots</samp>
 +
| ''(Optional)'' The number of attachment slots to enable on the tool. Note that only <samp>FishingRod</samp> tools have the code to render and use attachment slots. Default <samp>-1</samp>, which keeps the default value set by the tool class.
 +
|-
 +
| <samp>SalePrice</samp>
 +
| ''(Optional)'' The default price when the item is sold to the player in a shop. Defaults to <samp>-1</samp>, in which case you should set the price manually in shops.
 +
|-
 +
| <samp>CustomFields</samp>
 +
| The [[Modding:Common_data_field_types#Custom_fields|custom fields]] for this entry.
 +
|}
 +
 
 +
====Appearance====
 +
Note that drawing the tool correctly in the world (ie, while the player is trying to use it) will likely require custom code.
 +
 
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>Texture</samp>
 +
| The asset name for the texture containing the tool's sprite.
 +
|-
 +
| <samp>SpriteIndex</samp>
 +
| The tool's sprite index within the <samp>Texture</samp>, where 0 is the top row.
 +
|-
 +
| <samp>MenuSpriteIndex</samp>
 +
| ''(Optional)'' The sprite index within the <samp>Texture</samp> for the item icon. Defaults to <samp>SpriteIndex</samp>.
 +
|}
 +
 
 +
====Upgrades====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>UpgradeLevel</samp>
 +
| ''(Optional)'' The tool upgrade level. Default <samp>-1</samp>, which keeps the default value set by the tool class.
 +
|-
 +
| <samp>ApplyUpgradeLevelToDisplayName</samp>
 +
| ''(Optional)'' Whether to adjust the <samp>DisplayName</samp> for the usual upgrade levels. For example, the display name for a level one Axe changes to 'Copper Axe'. Default false.
 +
 
 +
The display name format in English is:
 +
{| class="wikitable"
 +
|-
 +
! upgrade level
 +
! display name format
 +
|-
 +
| 1
 +
| Copper {{t|display name}}
 +
|-
 +
| 2
 +
| Steel {{t|display name}}
 +
|-
 +
| 3
 +
| Gold {{t|display name}}
 +
|-
 +
| 4
 +
| Iridium {{t|display name}}
 +
|}
 +
|-
 +
| <samp>ConventionalUpgradeFrom</samp>
 +
| ''(Optional)'' If set, prepends an upgrade for the given tool ID to the <samp>UpgradeFrom</samp> field. This applies these rules (based on the <samp>UpgradeLevel</samp> field, not the upgrade level of the specified tool ID):
 +
 
 +
{| class="wikitable"
 +
|-
 +
! upgrade level
 +
! price
 +
! items needed
 +
|-
 +
| 1
 +
| {{price|2000}}
 +
| {{name|Copper Bar|5}}
 +
|-
 +
| 2
 +
| {{price|5000}}
 +
| {{name|Iron Bar|5}}
 +
|-
 +
| 3
 +
| {{price|10000}}
 +
| {{name|Gold Bar|5}}
 +
|-
 +
| 4
 +
| {{price|25000}}
 +
| {{name|Iridium Bar|5}}
 +
|}
 +
 
 +
For example, Iridium Axe specifies this value:
 +
<syntaxhighlight lang="js">
 +
"ConventionalUpgradeFrom": "(T)GoldAxe"
 +
</syntaxhighlight>
 +
|-
 +
| <samp>UpgradeFrom</samp>
 +
| ''(Optional)'' The requirements to buy this tool from Clint's [[Blacksmith#Upgrade Tools|blacksmith tool upgrade shop]]. If you specify multiple entries, the first one which matches will be applied.
 +
 
 +
This consists of a list of models with these fields:
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>Price</samp>
 +
| ''(Optional)'' The gold price to buy the upgrade. Defaults to 0.
 +
|-
 +
| <samp>RequireToolId</samp>
 +
| ''(Optional)'' If set, the [[Modding:Common_data_field_types#Item_ID|qualified or unqualified item ID]] for the tool that must be in the player's inventory for the upgrade to appear. The tool will be destroyed when the upgrade is purchased.
 +
|-
 +
| <samp>TradeItemId</samp>
 +
| ''(Optional)'' If set, the [[Modding:Common_data_field_types#Item_ID|qualified or unqualified item ID]] for an extra item that must be traded to upgrade the tool. (For example, many vanilla tools need metal bars.)
 +
|-
 +
| <samp>TradeItemAmount</samp>
 +
| ''(Optional)'' The number of <samp>TradeItemId</samp> required. Defaults to 1.
 +
|-
 +
| <samp>Condition</samp>
 +
| ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this upgrade is available. Defaults to always true.
 +
|}
 +
 
 +
For example, these are equivalent to the Steel Axe's upgrade settings:
 +
<syntaxhighlight lang="js">
 +
"UpgradeFrom": [
 +
    {
 +
        "RequireToolId": "(T)CopperAxe",
 +
        "Price": 5000,
 +
        "TradeItemId": "(O)335", // Iron Bar
 +
        "TradeItemAmount": 5
 +
    }
 +
]
 +
</syntaxhighlight>
 +
 
 +
If you want the tool to always be available, you can just omit the conditions. For example:
 +
<syntaxhighlight lang="js">
 +
"UpgradeFrom": [
 +
    {
 +
        "Price": 5000
 +
    }
 +
]
 +
</syntaxhighlight>
 +
 
 +
Note that Clint needs a few days to smith the new tool. If you want to sell the tool directly, [[Modding:Shops|add it to a regular shop]] instead.
 +
|}
 +
 
 +
====Game logic====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>CanBeLostOnDeath</samp>
 +
| Whether the player can [[Adventurer's Guild#Item Recovery Service|lose this tool when they die]]. Default false.
 +
|}
 +
 
 +
====Extensibility====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <samp>ModData</samp>
 +
| ''(Optional)'' The mod data values to set when the tool is created, accessible in C# code via the <samp>tool.modData</samp> dictionary. For example:
 +
<syntaxhighlight lang="js">
 +
"ModData": {
 +
    "PowerLevel": 9000
 +
}
 +
</syntaxhighlight>
 +
|-
 +
| <samp>SetProperties</samp>
 +
| ''(Optional)'' Set the value of arbitrary properties on the tool class. For example, this would disable the tool animation and require no stamina:
 +
<syntaxhighlight lang="js">
 +
"SetProperties": {
 +
    "InstantUse": true,
 +
    "IsEfficient": true
 +
}
 +
</syntaxhighlight>
 +
|}
    
==Weapons==
 
==Weapons==
Line 1,385: Line 1,818:     
===Data format===
 
===Data format===
The weapon data in <samp>Data/Weapons</samp> consists of an integer→string dictionary with entries like this:
+
The weapon data in <samp>Data/Weapons</samp> consists of a string → model lookup, where...
 +
* The key is the unqualified [[Modding:Common_data_field_types#Item_ID|item ID]] for the weapon.
 +
* The value is model with the fields listed below.
   −
<syntaxhighlight lang="json">
+
====Basic weapon info====
  "12": "Wooden Blade/Not bad for a piece of carved wood./3/7/1/0/0/0/0/3/-1/0/.02/3"
+
{| class="wikitable"
</syntaxhighlight>
+
|-
 +
! field
 +
! effect
 +
|-
 +
| <samp>Name</samp>
 +
| The internal weapon name.
 +
|-
 +
| <samp>DisplayName</samp><br /><samp>Description</samp>
 +
| A [[Modding:Tokenizable strings|tokenizable string]] for the translated display name & description.
 +
|-
 +
| <samp>Type</samp>
 +
| The weapon type. One of <samp>0</samp> (stabbing sword), <samp>1</samp> (dagger), <samp>2</samp> (club or hammer), or <samp>3</samp> (slashing sword).
 +
|}
   −
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:
+
====Appearance====
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! effect
 +
|-
 +
| <samp>Texture</samp>
 +
| The asset name for the spritesheet containing the weapon's sprite.
 +
|-
 +
| <samp>SpriteIndex</samp>
 +
| The index within the <samp>Texture</samp> for the weapon sprite, where 0 is the top-left sprite.
 +
|}
   −
; Melee weapons
+
====Stats====
: {| class="wikitable"
+
{| class="wikitable"
 
|-
 
|-
! index
   
! field
 
! field
 
! effect
 
! effect
 
|-
 
|-
| 0
+
| <samp>MinDamage</samp><br /><samp>MaxDamage</samp>
| name
+
| The minimum and maximum based damage caused when hitting a monster with this weapon.
| The internal weapon name (and display name in English).
   
|-
 
|-
| 1
+
| <samp>Knockback</samp>
| description
+
| ''(Optional)'' How far the target is pushed when hit, as a multiplier relative to a base weapon like the [[Rusty Sword]] (e.g. <samp>1.5</samp> for 150% of Rusty Sword's weight). Default 1.
| The translated item description shown in-game.
   
|-
 
|-
| 2<br />3
+
| <samp>Speed</samp>
| min damage<br />max damage
+
| ''(Optional)'' How fast the player can swing the weapon. Each point of speed is worth 40ms of swing time relative to 0. This stacks with the [[speed|player's weapon speed]]. Default 0.
| The minimum and maximum damage caused when hitting a monster with this weapon.
   
|-
 
|-
| 4
+
| <samp>Precision</samp>
| knockback
+
| ''(Optional)'' Reduces the chance that a strike will miss. Default 0.
| How far the target is pushed when hit, as a multiplier relative to a base weapon like the [[Rusty Sword]] (e.g. <samp>1.5</samp> for 150% of Rusty Sword's weight).
   
|-
 
|-
| 5
+
| <samp>Defense</samp>
| speed
+
| ''(Optional)'' Reduces damage received by the player. Default 0.
| How fast the player can swing the weapon. Each point of speed is worth 40ms of swing time relative to 0. This stacks with the [[speed|player's weapon speed]].
   
|-
 
|-
| 6
+
| <samp>AreaOfEffect</samp>
| added precision
+
| ''(Optional)'' Slightly increases the area of effect. Default 0.
| Reduces the chance that a strike will miss.
   
|-
 
|-
| 7
+
| <samp>CritChance</samp>
| added defence
+
| ''(Optional)'' The chance of a critical hit, as a decimal value between 0 (never) and 1 (always). Default 0.02.
| Reduces damage received by the player.
   
|-
 
|-
| 8
+
| <samp>CritMultiplier</samp>
| type
+
| ''(Optional)'' A multiplier applied to the base damage for a critical hit. This can be a decimal value. Default 3.
| The weapon type. One of <samp>0</samp> (stabbing sword), <samp>1</samp> (dagger), <samp>2</samp> (club or hammer), or <samp>3</samp> (slashing sword).
+
|}
 +
 
 +
====Game logic====
 +
{| class="wikitable"
 
|-
 
|-
| 9<br />10
+
! field
| base mine level<br />min mine level
+
! effect
| The base and minimum mine level, which affect [[#Mine container drops|mine container drops]].
   
|-
 
|-
| 11
+
| <samp>CanBeLostOnDeath</samp>
| added area of effect
+
| Whether the player can [[Adventurer's Guild#Item Recovery Service|lose this tool when they die]]. Default true.
| Slightly increases the area of effect.
   
|-
 
|-
| 12
+
| <samp>MineBaseLevel</samp><br /><samp>MineMinLevel</samp>
| critical chance
+
| ''(Optional)'' The base and minimum mine level, which affect [[#Mine container drops|mine container drops]]. Both default to -1, which disables automatic mine drops.
| The chance of a critical hit, as a decimal value between 0 and 1.
+
|}
 +
 
 +
====Advanced====
 +
{| class="wikitable"
 
|-
 
|-
| 13
+
! field
| critical damage
+
! effect
| A multiplier applied to the damage for critical hit.
   
|-
 
|-
| 14
+
| <samp>Projectiles</samp>
| display name
+
| ''(Optional)'' The projectiles fired when the weapon is used, which continue along their path until they hit a monster and cause damage. A separate projectile is fired for each entry in this list.
| The translated item name (in non-English assets only).
  −
|}
     −
; Slingshots
+
This consists of a list of models with these fields (one projectile will fire for each entry in the list):
: {| class="wikitable"
+
{| class="wikitable"
 
|-
 
|-
! index
   
! field
 
! field
 
! effect
 
! effect
 
|-
 
|-
| 0
+
| <samp>Id</samp>
| name
+
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for the projectile within the current weapon's data.
| The internal weapon name (and display name in English).
+
|-
 +
| <samp>Damage</samp>
 +
| ''(Optional)'' The amount of damage caused when the projectile hits a monster. Default 10.
 +
|-
 +
| <samp>Explodes</samp>
 +
| ''(Optional)'' Whether the projectile explodes when it collides with something. Default false.
 +
|-
 +
| <samp>Bounces</samp>
 +
| ''(Optional)'' The number of times the projectile can bounce off walls before being destroyed. Default 0.
 +
|-
 +
| <samp>MaxDistance</samp>
 +
| ''(Optional)'' The maximum tile distance the projectile can travel. Default 4.
 +
|-
 +
| <samp>Velocity</samp>
 +
| ''(Optional)'' The speed at which the projectile moves. Default 10.
 +
|-
 +
| <samp>RotationVelocity</samp>
 +
| ''(Optional)'' The rotation velocity. Default 32.
 +
|-
 +
| <samp>TailLength</samp>
 +
| ''(Optional)'' The length of the tail which trails behind the main projectile. Default 1.
 
|-
 
|-
| 1
+
| <samp>FireSound</samp><br /><samp>BounceSound</samp><br /><samp>CollisionSound</samp>
| description
+
| ''(Optional)'' The sound played when the projectile is fired, bounces off a wall, or collides with something. All three default to none.
| The translated item description shown in-game (for non-English assets only).
   
|-
 
|-
| 2&ndash;8
+
| <samp>MinAngleOffset</samp><br /><samp>MaxAngleOffset</samp>
| ''unused''
+
| ''(Optional)'' A random offset applied to the direction of the project each time it's fired. Both fields default to 0, in which case it's always shot at the 90° angle matching the player's facing direction.
|
   
|-
 
|-
| 9<br />10
+
| <samp>SpriteIndex</samp>
| base mine level<br />min mine level
+
| ''(Optional)'' The sprite index in the <samp>TileSheets/Projectiles</samp> asset to draw for this projectile. Defaults to 11 (a glowing-yellow-ball sprite).
| The base and minimum mine level, which affect [[#Mine container drops|mine container drops]].
   
|-
 
|-
| 11&ndash;13
+
| <samp>Item</samp>
| ''unused''
+
| ''(Optional)'' The item to shoot. If set, this overrides <samp>SpriteIndex</samp>.
|
+
 
 +
This consists of a list of models with these fields:
 +
{| class="wikitable"
 
|-
 
|-
| 14
+
! field
| display name
+
! effect
| The translated item description shown in-game (for non-English assets only).
+
|-
 +
| ''common fields''
 +
| See [[Modding:Item queries#Item spawn fields|item spawn fields]] for the generic item fields supported for ammo items.
 +
 
 +
If set to an [[Modding:Item queries|item query]] which returns multiple items, one of them will be selected at random.
 +
|}
 
|}
 
|}
    +
Note that these are magic projectiles fired when the weapon is used, they're not aimed directly like [[slingshot]] projectiles.
 +
|-
 +
| <samp>CustomFields</samp>
 +
| The [[Modding:Common_data_field_types#Custom_fields|custom fields]] for this entry.
 +
|}
 
Weapons have a hardcoded category of -98 (<samp>Object.weaponCategory</samp>).
 
Weapons have a hardcoded category of -98 (<samp>Object.weaponCategory</samp>).
   Line 1,495: Line 1,974:     
<ol>
 
<ol>
<li>Match weapons whose minimum mine level ([[#Format|field 10]]) is less than the current mine level.</li>
+
<li>Match weapons whose [[#Game logic|minimum mine level]] is less than the current mine level.</li>
<li>From that list, match weapons with a probability check based on the gap between the base mine level ([[#Format|field 9]]) and current mine level. The probability is a bell curve centered on the base mine level:
+
<li>From that list, match weapons with a probability check based on the gap between the [[#Game logic|base mine level]] and current mine level. The probability is a bell curve centered on the base mine level:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
24

edits

Navigation menu