Modding Help Making clothing dye-able...

Discussion in 'Starbound Modding' started by kittentamer, Feb 23, 2016.

  1. kittentamer

    kittentamer Existential Complex

    I think I can figure this out, but I'm going to post my findings (and questions!) here since a quick search didn't find a guide. I'm typing this as I troubleshoot with editing the Firefly Big Box o'Loot to be dye-able.
    I know you need to have options in the .chest files and such, I'm guessing the order is how the game decides which color it dyes to? This is what I find in the base game assets:

    Code:
      "colorOptions" : [
        /* BLUE */
        { "ffca8a" : "96cbe7", "e0975c" : "5588d4", "a85636" : "344495", "6f2919" : "1a1c51" },
        /* BLACK */
        { "ffca8a" : "838383", "e0975c" : "555555", "a85636" : "383838", "6f2919" : "151515" },
        /* GREY */
        { "ffca8a" : "b5b5b5", "e0975c" : "808080", "a85636" : "555555", "6f2919" : "303030" },
        /* WHITE */
        { "ffca8a" : "e6e6e6", "e0975c" : "b6b6b6", "a85636" : "7b7b7b", "6f2919" : "373737" },
        /* RED */
        { "ffca8a" : "f4988c", "e0975c" : "d93a3a", "a85636" : "932625", "6f2919" : "601119" },
        /* ORANGE */
        { "ffca8a" : "ffd495", "e0975c" : "ea9931", "a85636" : "af4e00", "6f2919" : "6e2900" },
        /* YELLOW */
        { "ffca8a" : "ffffa7", "e0975c" : "e2c344", "a85636" : "a46e06", "6f2919" : "642f00" },
        /* GREEN */
        { "ffca8a" : "b2e89d", "e0975c" : "51bd3b", "a85636" : "247824", "6f2919" : "144216" },
        /* BLUE */
        { "ffca8a" : "96cbe7", "e0975c" : "5588d4", "a85636" : "344495", "6f2919" : "1a1c51" },
        /* PURPLE */
        { "ffca8a" : "d29ce7", "e0975c" : "a451c4", "a85636" : "6a2284", "6f2919" : "320c40" },
        /* PINK */
        { "ffca8a" : "eab3db", "e0975c" : "d35eae", "a85636" : "97276d", "6f2919" : "59163f" },
        /* BROWN */
        { "ffca8a" : "ccae7c", "e0975c" : "a47844", "a85636" : "754c23", "6f2919" : "472b13" }
    
      ]

    The top one is obviously the 'this is the default color' picked from below. In typing this I figured out the codes underneath. It is broken down into four colors that you use to make the sprites, then what color you want the dye to change them to! Notice how "ffca8a","e0975c","a85636", and "6f2919" are in each row. Woo, learned something new! If you use those 4 colors in your sprites, then you can make them dye-able if you include this code in the .chest, .leg, .head or .back file.

    If you previously have made sprites for something, use the color picker to find the color codes for what you currently have (and hope you only used 4 colors!) and use those in the top row of color codes. I'm not sure if it would break the game to have more then four or if you could add to the list so long as you followed the format.
    Code:
    { "colorused" : "colordyed", "colorused" : "colordyed" }
    I need to do some massive sprite coloring/code editing to test this out, but this seems the basic information needed. Sorry if I'm reposting something someone already did and I hope this helps more then just me! =p
     
    Marinebeast likes this.
  2. lazarus78

    lazarus78 The Waste of Time

    Order is indeed important. IE the first line is the default color as you guessed, and the next line is black. Albiet you dont NEED to use black colors, they could be pink, but in game, you would use black dye to get that set of colors, which is why it is important to follow the colors already set.

    Having more than 4 colors set won't break the game either. Each line is basically saying "Wherever you find X color, replace it with Y" and it moves down the line till it is done.
     
  3. kittentamer

    kittentamer Existential Complex

    I'm glad to hear it, because I have some outfits I can't fit into 4 colors...then I just have the fun of having to fill out colors for the whole range of dyes as well. xD
     
    lazarus78 likes this.
  4. AmazonValkyrie

    AmazonValkyrie Spaceman Spiff

    I'm glad I came across this topic, as it's something I've wanted to approach with my mod work. I'm wondering though, can you mod completely custom dyes for the color strings or do we have to follow their basic setup/naming convention for each dye in tying it with "BLUE", "BLACK", and so on? As in if I wanted a dye color set with Jade and gold colors, could I name it as such and make a custom dye, or would I have to tie it to an existing color title? Hope that question makes sense >_<
     
  5. lazarus78

    lazarus78 The Waste of Time

    Dyes use an array index number to tell what color set to use. IE the default color is index 0 (Arrays start with 0), red is index 4, etc. So in theory, you could just add a new line with your new colors and have your dye item point to that index number. How the game would react to this if you tried to use it on something that does not have that index, I have no clue. IIRC it just wont do anything.

    Example dye item:
    Code:
    {
      "itemName" : "blackdye",
      "rarity" : "Common",
      "inventoryIcon" : "blackdye.png",
      "description" : "This coloured dye can be applied to a piece of armour or clothing with a right-click.",
      "shortdescription" : "Black Dye",
    
      "dyeColorIndex" : 1,
    
      "radioMessagesOnPickup" : [ "pickupdye" ],
    
      "scripts" : [ "/scripts/augments/dye.lua" ]
    }
    
    
    They are located in items\generic\dyes
     
    L3W and AmazonValkyrie like this.

Share This Page