Modding:Hat data

From Stardew Valley Wiki
Revision as of 17:31, 25 December 2018 by Pathoschild (talk | contribs) (→‎Raw data: update)
Jump to navigation Jump to search

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".