Jump to content

Modding:Boots: Difference between revisions

From Stardew Valley Wiki
imported>Pathoschild
split from Modding:Items; attribution: Pathoschild (main author), Falseroku (update for 1.6 + example)
 
imported>Pathoschild
adjust page post-split, add some high-level info
Line 1: Line 1:
← [[Modding:Items|Items]]
← [[Modding:Items|Items]]


==Boots==
This page explains how the game stores and parses boots-type item data. For items in general, see [[Modding:Items]].
===Data format===
 
You can create/edit [[Footwear|boots]] by editing the <samp>Data/Boots</samp> asset. This consists of a string → string dictionary, where...
==Overview==
* The key is the unqualified [[Modding:Common_data_field_types#Item_ID|item ID]].
Boots are items which can be equipped in the player's [[boots]] slot. These change the player sprite and may provide buffs.
 
They have their data in <samp>Data/Boots</samp>, their sprites in <samp>Maps/springobjects</samp> (item) and <samp>Characters/Farmer/shoeColors</samp> (shoe color) by default, and their code in <samp>StardewValley.Boots</samp>.
 
==Data format==
The boots data in <samp>Data/Boots</samp> consists of a string → string dictionary, where...
* The key is the [[Modding:Common data field types#Item ID|unqualified item ID]].
* The value is a slash-delimited string with the fields listed below.
* The value is a slash-delimited string with the fields listed below.


Line 54: Line 60:
|}
|}


The boots data in <samp>Data/Boots</samp> consists of a string → string dictionary with entries like this:
==Example==
 
You can add a custom boots item using [[Modding:Content Patcher|Content Patcher]] like this:
<syntaxhighlight lang="json">
  "511": "Dark Boots/Made from thick black leather./250/4/2/7"
</syntaxhighlight>


A custom entry might look something like this:
{{#tag:syntaxhighlight|<nowiki>
 
<syntaxhighlight lang="json">
{
{
   "Format": "2.2.0",
   "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
   "Changes": [
   "Changes": [
    // load textures
     {
     {
      "LogName": "Load boots texture",
       "Action": "Load",
       "Action": "Load",
       "Target": "{{ModId}}/Boots, {{ModId}}/BootsColor",
       "Target": "{{ModId}}/Boots, {{ModId}}/BootsColor",
       "FromFile": "assets/{{TargetWithoutPath}}.png"
       "FromFile": "assets/{{TargetWithoutPath}}.png" // `assets/Boots.png` and `assets/BootsColor.png`
     },
     },
    // add data
     {
     {
      "LogName": "Add boots to boots data",
       "Action": "EditData",
       "Action": "EditData",
       "Target": "Data/Boots",
       "Target": "Data/Boots",
       "Entries": {
       "Entries": {
         "{{ModId}}_OPBoots": "Overpowered Boots/These boots are totally broken!/1000000/100/100/8/Overpowered Boots/{{ModId}}\\BootsColor/0/{{ModId}}\\Boots"
         "{{ModId}}_OverpoweredBoots": "Overpowered Boots/These boots are totally overpowered!/1000000/100/100/8/Overpowered Boots/{{ModId}}\\BootsColor/0/{{ModId}}\\Boots"
       }
       }
     }
     }
   ]
   ]
}
}</nowiki>|lang=javascript}}
</syntaxhighlight>


==See also==
* [[Modding:Items]] for item data in general


[[Category:Modding]]
[[Category:Modding]]

Revision as of 23:23, 15 December 2024

← Items

This page explains how the game stores and parses boots-type item data. For items in general, see Modding:Items.

Overview

Boots are items which can be equipped in the player's boots slot. These change the player sprite and may provide buffs.

They have their data in Data/Boots, their sprites in Maps/springobjects (item) and Characters/Farmer/shoeColors (shoe color) by default, and their code in StardewValley.Boots.

Data format

The boots data in Data/Boots consists of a string → string dictionary, where...

  • The key is the unqualified item ID.
  • The value is a slash-delimited string with the fields listed below.
index field effect
0 Name The internal item name (and display name in English).
1 Description The translated item description shown in-game.
2 Price Unused. The actual price is calculated as (added defence × 100) + (added immunity × 100).
3 Added Defense A defense bonus applied to the player while equipped.
4 Added Immunity An immunity bonus applied to the player while equipped.
5 Color Index The boots color index within the Color Texture, where 0 is the top-left set, if present, otherwise the Characters/Farmer/shoeColors spritesheet.
6 Display Name 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.

Example

You can add a custom boots item using Content Patcher like this:

{
  "Format": "2.8.0",
  "Changes": [
    // load textures
    {
      "Action": "Load",
      "Target": "{{ModId}}/Boots, {{ModId}}/BootsColor",
      "FromFile": "assets/{{TargetWithoutPath}}.png" // `assets/Boots.png` and `assets/BootsColor.png`
    },

    // add data
    {
      "Action": "EditData",
      "Target": "Data/Boots",
      "Entries": {
        "{{ModId}}_OverpoweredBoots": "Overpowered Boots/These boots are totally overpowered!/1000000/100/100/8/Overpowered Boots/{{ModId}}\\BootsColor/0/{{ModId}}\\Boots"
      }
    }
  ]
}

See also