Difference between revisions of "Modding:Hat data"

From Stardew Valley Wiki
Jump to navigation Jump to search
(Update Hat IDs for version 1.3)
(→‎Raw data: update)
Line 4: Line 4:
  
 
==Raw data==
 
==Raw data==
Hat data is stored in <tt>Content\Data\Hats.xnb</tt>, which can be [[Modding:Editing XNB files#Getting started|unpacked using XNB Extract]]. Here's the raw data (as of v1.3) for reference:
+
Hat data is stored in <tt>Content\Data\hats.xnb</tt>, which can be [[Modding:Editing XNB files#unpacking|unpacked into a text file]]. Here's the raw data as of {{version|1.3.33}} for reference:
  
<source lang="yaml">
+
<source lang="json">
    0: "Cowboy Hat/The leather is old and cracked, but surprisingly supple. It smells musty./false/true" #!String
+
{
    1: "Bowler Hat/Made from smooth felt./false/true" #!String
+
  "0": "Cowboy Hat/The leather is old and cracked, but surprisingly supple. It smells musty./false/true",
    2: "Top Hat/A gentleman's classic./false/true" #!String
+
  "1": "Bowler Hat/Made from smooth felt./false/true",
    3: "Sombrero/A festively decorated hat made from woven straw./false/true" #!String
+
  "2": "Top Hat/A gentleman's classic./false/true",
    4: "Straw Hat/Light and cool, it's a farmer's delight./false/true" #!String
+
  "3": "Sombrero/A festively decorated hat made from woven straw./false/true",
    5: "Official Cap/Looks like it belonged to a postman or policeman. Either way, it's still very soft and smells okay./false/true" #!String
+
  "4": "Straw Hat/Light and cool, it's a farmer's delight./false/true",
    6: "Blue Bonnet/Harken back to simpler times with this prairie bonnet./false/true" #!String
+
  "5": "Official Cap/Looks like it belonged to a postman or policeman. Either way, it's still very soft and smells okay./false/true",
    7: "Plum Chapeau/Looks alright./false/true" #!String
+
  "6": "Blue Bonnet/Harken back to simpler times with this prairie bonnet./false/true",
    8: "Skeleton Mask/The red eyes are glowing mysteriously./true/true" #!String
+
  "7": "Plum Chapeau/Looks alright./false/true",
    9: "Goblin Mask/Freak out the neighborhood with this creepy mask. Rubber ear joints for effect./true/true" #!String
+
  "8": "Skeleton Mask/The red eyes are glowing mysteriously./true/true",
    10: "Chicken Mask/You'll be sure to get thim grinning with this one./true/true" #!String
+
  "9": "Goblin Mask/Freak out the neighborhood with this creepy mask. Rubber ear joints for effect./true/true",
    11: "Earmuffs/Keep your ears toasty. Lined with artisanal velvet from Castle Village./true/false" #!String
+
  "10": "Chicken Mask/You'll be sure to get thim grinning with this one./true/true",
    12: "Delicate Bow/Little pink jewels glisten as you examine it./true/false" #!String
+
  "11": "Earmuffs/Keep your ears toasty. Lined with artisanal velvet from Castle Village./true/false",
    13: "Tropiclip/It's shaped like a little palm tree./true/false" #!String
+
  "12": "Delicate Bow/Little pink jewels glisten as you examine it./true/false",
    14: "Butterfly Bow/This one is very soft./true/false" #!String
+
  "13": "Tropiclip/It's shaped like a little palm tree./true/false",
    15: "Hunter's Cap/The wool lining should stay warm deep into the forest./false/true" #!String
+
  "14": "Butterfly Bow/This one is very soft./true/false",
    16: "Trucker Hat/Mesh in the back to keep your head cool./false/true" #!String
+
  "15": "Hunter's Cap/The wool lining should stay warm deep into the forest./false/true",
    17: "Sailor's Cap/It's fresh and starchy./false/true" #!String
+
  "16": "Trucker Hat/Mesh in the back to keep your head cool./false/true",
    18: "Good Ol' Cap/A floppy old topper with a creased bill. Looks like it's been through a lot./false/true" #!String
+
  "17": "Sailor's Cap/It's fresh and starchy./false/true",
    19: "Fedora/A city-slicker's standard./false/true" #!String
+
  "18": "Good Ol' Cap/A floppy old topper with a creased bill. Looks like it's been through a lot./false/true",
    20: "Cool Cap/It looks really faded, but it used to be a vibrant blue./false/true" #!String
+
  "19": "Fedora/A city-slicker's standard./false/true",
    21: "Lucky Bow/The middle is made of solid gold./true/false" #!String
+
  "20": "Cool Cap/It looks really faded, but it used to be a vibrant blue./false/true",
    22: "Polka Bow/This one's sure to be turn heads./true/false" #!String
+
  "21": "Lucky Bow/The middle is made of solid gold./true/false",
    23: "Gnome's Cap/This gnome had a very large head./false/true" #!String
+
  "22": "Polka Bow/This one's sure to be turn heads./true/false",
    24: "Eye Patch/You can't tell if it's real or just from a costume shop./true/true" #!String
+
  "23": "Gnome's Cap/This gnome had a very large head./false/true",
    25: "Santa Hat/Celebrate the magical season./false/true" #!String
+
  "24": "Eye Patch/You can't tell if it's real or just from a costume shop./true/true",
    26: "Tiara/This one has a big amethyst encircled by gold./true/true" #!String
+
  "25": "Santa Hat/Celebrate the magical season./false/true",
    27: "Hard Hat/Keep your dome in one piece./false/true" #!String
+
  "26": "Tiara/This one has a big amethyst encircled by gold./true/true",
    28: "Sou'wester/The shape helps to keep sailors dry during storms./false/true" #!String
+
  "27": "Hard Hat/Keep your dome in one piece./false/true",
    29: "Daisy/A fresh spring daisy to put in your hair./true/false" #!String
+
  "28": "Sou'wester/The shape helps to keep sailors dry during storms./false/true",
    30: "Watermelon Band/The color scheme was inspired by the beloved summer melon./true/false" #!String
+
  "29": "Daisy/A fresh spring daisy to put in your hair./true/false",
    31: "Mouse Ears/Made from synthetic fibers./true/true" #!String
+
  "30": "Watermelon Band/The color scheme was inspired by the beloved summer melon./true/false",
    32: "Cat Ears/Whiskers included./true/true" #!String
+
  "31": "Mouse Ears/Made from synthetic fibers./true/true",
    33: "Cowgal Hat/The band is studded with fake diamonds./false/true" #!String
+
  "32": "Cat Ears/Whiskers included./true/true",
    34: "Cowpoke Hat/For dairy experts./false/true" #!String
+
  "33": "Cowgal Hat/The band is studded with fake diamonds./false/true",
    35: "Archer's Cap/Fashionable whether you're an archer or not./false/true" #!String
+
  "34": "Cowpoke Hat/For dairy experts./false/true",
    36: "Panda Hat/A lovely panda hat./false/true" #!String
+
  "35": "Archer's Cap/Fashionable whether you're an archer or not./false/true",
    37: "Blue Cowboy Hat/A denim cowboy hat in cool blue./false/true" #!String
+
  "36": "Panda Hat/A lovely panda hat./false/true",
    38: "Red Cowboy Hat/An eye-catching cowboy hat in red suede./false/true" #!String
+
  "37": "Blue Cowboy Hat/A denim cowboy hat in cool blue./false/true",
    39: "Cone Hat/A curiosity from a distant land./false/true" #!String
+
  "38": "Red Cowboy Hat/An eye-catching cowboy hat in red suede./false/true",
 +
  "39": "Cone Hat/A curiosity from a distant land./false/true"
 +
}
 
</source>
 
</source>
  

Revision as of 17:31, 25 December 2018

Index

This page explains how the game stores and parses hat data. This is an advanced guide for mod developers.

Raw data

Hat data is stored in Content\Data\hats.xnb, which can be unpacked into a text file. Here's the raw data as of 1.3.33 for reference:

{
  "0": "Cowboy Hat/The leather is old and cracked, but surprisingly supple. It smells musty./false/true",
  "1": "Bowler Hat/Made from smooth felt./false/true",
  "2": "Top Hat/A gentleman's classic./false/true",
  "3": "Sombrero/A festively decorated hat made from woven straw./false/true",
  "4": "Straw Hat/Light and cool, it's a farmer's delight./false/true",
  "5": "Official Cap/Looks like it belonged to a postman or policeman. Either way, it's still very soft and smells okay./false/true",
  "6": "Blue Bonnet/Harken back to simpler times with this prairie bonnet./false/true",
  "7": "Plum Chapeau/Looks alright./false/true",
  "8": "Skeleton Mask/The red eyes are glowing mysteriously./true/true",
  "9": "Goblin Mask/Freak out the neighborhood with this creepy mask. Rubber ear joints for effect./true/true",
  "10": "Chicken Mask/You'll be sure to get thim grinning with this one./true/true",
  "11": "Earmuffs/Keep your ears toasty. Lined with artisanal velvet from Castle Village./true/false",
  "12": "Delicate Bow/Little pink jewels glisten as you examine it./true/false",
  "13": "Tropiclip/It's shaped like a little palm tree./true/false",
  "14": "Butterfly Bow/This one is very soft./true/false",
  "15": "Hunter's Cap/The wool lining should stay warm deep into the forest./false/true",
  "16": "Trucker Hat/Mesh in the back to keep your head cool./false/true",
  "17": "Sailor's Cap/It's fresh and starchy./false/true",
  "18": "Good Ol' Cap/A floppy old topper with a creased bill. Looks like it's been through a lot./false/true",
  "19": "Fedora/A city-slicker's standard./false/true",
  "20": "Cool Cap/It looks really faded, but it used to be a vibrant blue./false/true",
  "21": "Lucky Bow/The middle is made of solid gold./true/false",
  "22": "Polka Bow/This one's sure to be turn heads./true/false",
  "23": "Gnome's Cap/This gnome had a very large head./false/true",
  "24": "Eye Patch/You can't tell if it's real or just from a costume shop./true/true",
  "25": "Santa Hat/Celebrate the magical season./false/true",
  "26": "Tiara/This one has a big amethyst encircled by gold./true/true",
  "27": "Hard Hat/Keep your dome in one piece./false/true",
  "28": "Sou'wester/The shape helps to keep sailors dry during storms./false/true",
  "29": "Daisy/A fresh spring daisy to put in your hair./true/false",
  "30": "Watermelon Band/The color scheme was inspired by the beloved summer melon./true/false",
  "31": "Mouse Ears/Made from synthetic fibers./true/true",
  "32": "Cat Ears/Whiskers included./true/true",
  "33": "Cowgal Hat/The band is studded with fake diamonds./false/true",
  "34": "Cowpoke Hat/For dairy experts./false/true",
  "35": "Archer's Cap/Fashionable whether you're an archer or not./false/true",
  "36": "Panda Hat/A lovely panda hat./false/true",
  "37": "Blue Cowboy Hat/A denim cowboy hat in cool blue./false/true",
  "38": "Red Cowboy Hat/An eye-catching cowboy hat in red suede./false/true",
  "39": "Cone Hat/A curiosity from a distant land./false/true"
}

Format

Hats have a hard-coded category of -95 (Hats.cs::Load)

Index Field Example Value
0 Name Trucker Hat
1 Description Mesh in the back to keep your head cool.
2 skipHairDraw false
3 ignoreHairstyleOffset true
4 Name (for language files other than English) Truckerhut

If skipHairDraw is "true", then the game will not change the character's hairstyle when they put on the hat. If set to "false", the player's hairstyle may change when they put on the hat.

If ignoreHairstyleOffset is set to "true", it means that the game will position the hat regardless of the hairstyle your character has. For instance, for a hat such as the Butterfly Bow, you will want to have it set to "false" so that the bow will adjust position to be attached to your character's chosen hairstyle. However, for something like the Eye Patch, that should be kept in the same position on your character's head no matter what hair you have chosen, so it should be set to "true".