How do I make a Dye? - Catman-232/Homebrewery GitHub Wiki
-
First things first, go into Homebrewery's own HomebreweryFiles > Template folder and Copy the Template_DyeItem folder
-
Paste the template item folder into HomebreweryFiles > Dye
Rename the folder to something smart like'your username'_Dye_'name of the thing'
-
Inside the folder you will see icon.png and param.txt
icon.png is a 32x32px sprite you can use to represent the item however you like, feel free to edit the spray can sprite made by Remedy (puckuchu) if you want!
param.txt contains the details the game needs in order to define the item and what it contextually does, so in this case the Dye's Hue, saturation, brightness and contrast adjustments.
{
"_dyeParams": {
"_hue": 0.0,
"_saturation": 1.0,
"_brightness": 0.0,
"_contrast": 1.0
},
"_itemName": "This text is the Dye's display name",
"_itemDescription": "This text goes in the space beneath the Dye's name"
}
Edit the text within the speech marks ("") to change the text the item displays in-game.
"_itemName": "Very Cool Dye",
"_itemDescription": "This Dye is very Cool!"
Now for the fun part...
With the default settings, many dyeable pieces of gear will have this kind of green colouring.
This is because the "_hue" setting is a Hue Shift effect which uses green as the default point, this is important to know for gear textures mostly.
Speak to Skrit, around the back of Sally's shop, and get the "TEST Dye" to help with visualising what the settings actually do to gear.
While you have this dye applied, you can press the following keys to shift the values of the dye:
(These hotkeys work as long as no UI is currently open)
-
(dash) - nudges the "_hue" setting by +1, starts at 0, and after passing 360 it loops back around to -360.
Shift + -
(dash) - as above but nudges the "_hue" setting by +15.
=
(equals) - nudges the "_saturation" setting by 0.1, starts at 1, and after passing 2 it loops back around to 0.
[
(left bracket) - nudges the "_brightness" setting by 0.1, starts at 0, and after passing 1 it loops back around to -1.
]
(right bracket) - nudges the "_contrast" setting by 0.1, starts at 1, and after passing 2 it loops back around to 0.
The mod will log the current values in the console output for convenience.
Here's the same piece of gear from above but with "_hue" set to 180.
Here's "_saturation" set to 2, and then 0
Here's "_brightness" set to 0.5, and then -0.5
Here's "_contrast" set to 1.8, and then 0.2
Whatever values you want the dye to use, put them into the item's param.txt
Just keep them within the ranges:
Hue: -360 to 360
Saturation: 0 to 2
Brightness: -1 to 1
Contrast: 0 to 2
"_dyeParams": {
"_hue": 240.0,
"_saturation": 1.1,
"_brightness": -0.2,
"_contrast": 1.1
}
And hopefully it will look the way you expect it to when you use it!
[!CAUTION]
Important Things to note about Custom Dyes!
Custom dyes are quite volatile! Kiseff did not implement any sanity check for the Armor Dye array, to clamp a given index to actually be inside the array. Vanilla players will not have the same size array as you will have with custom dyes, so if you are currently using a custom dye, your armor dye index is outside of the vanilla Armor Dye array. Calling an array index that is not inside the array causes an Exception that breaks the code, in this case it breaks the functions which are responsible for armor displaying. This Exception happens constantly and might cause issues for other players, vanilla players won't know except for your gear being invisible to them.
Anyone with BepInEx and the console log open will see the Exception error flooding the window for as long as someone has an outside of array Dye applied (I have however added a patch to HB to suppress this issue locally to prevent the error spam, but this DOES NOT stop it for vanilla players). This issue can also affect you if you delete many Dye items you have, or you uninstall the mod entirely. Your save file does not get validated to determine that the Dye index is actually inside the array, so your gear will break until you use a vanilla Dye item.
I've made Skrit offer all vanilla Dye items so you can easily access them to remove any custom Dye you have applied. I would recommend NOT using custom Dyes if you are playing on public servers or with players who do not use any mods. If you are among friends who all have Homebrewery installed, and have all the same items, then you should be fine to use them.
If you open your character's save file in a text editor you will see it's Json formatted, and the properties for the Dye index are not very far in. You can set these to be 0 here to reset them if you wanted to.
This is a snippet of the save file, from the beginning
"_nickName": "Minnie Armstrong",
"_version": "Beta 1.6.2b",
"_currency": 20251,
"_appearanceProfile": {
"_setRaceTag": "Poon",
"_setEye": 9,
"_setMouth": 1,
"_setHairStyle": 3,
"_setEar": 9,
"_setTail": 3,
"_setMisc": 0,
"_displayBoobs": true,
"_isLeftHanded": false,
"_voicePitch": 0.7350000143051148,
"_helmDyeIndex": 3,
"_chestDyeIndex": 3,
"_legsDyeIndex": 3,
"_capeDyeIndex": 3,
The four properties at the bottom there