Modding Help Coloring Furniture

Discussion in 'Starbound Modding' started by Tentacle_Sashimi, Aug 26, 2017.

  1. Tentacle_Sashimi

    Tentacle_Sashimi Scruffy Nerf-Herder

    I used to use "directives":"?replace" to change the color of furniture while still keeping my game vanilla friendly.

    Now, all I see in the objects code regarding color is the following, "image" : "woodencouch2.png:<color>",

    Is there any way to customize furniture color anymore? Does anyone here still do that? Again, trying to keep my game vanilla friendly. Any feedback is appreciated!
     
  2. Errors4l

    Errors4l Spaceman Spiff

    <color> is replaced with the "color" parameter of your object. You can simply replace the "directives" key name with "color".
    Note that the syntax for a proper object image is "image.png:frame?directives". This means you might have to include the frame name at the start of your color parameter ("woodencouch2.png:?directives" is incorrect). Although omitting the frame seems to work fine on objects that have no frames, you may run into issues when recoloring animated objects.
     
    Tentacle_Sashimi likes this.
  3. Tentacle_Sashimi

    Tentacle_Sashimi Scruffy Nerf-Herder

    Sorry, I don't think I quite understand what the proper syntax would be if I were to try and change the color of the example image. Would I still be using the hex color codes and "?replace" ?

    Also, despite this couch being seemingly non-animated, there is still a .frames file in the asset folder.
     
  4. Tentacle_Sashimi

    Tentacle_Sashimi Scruffy Nerf-Herder

    the proper syntax was literally "image" : "woodencouch2.png:red",

    no idea why i was overthinking this, lol

    Thank you for your help!
     
  5. Tentacle_Sashimi

    Tentacle_Sashimi Scruffy Nerf-Herder

    As a side question, I noticed that when I removed the mod from the mod directory, this item went back to its default color.

    Not that big of a surprise but the old StarCheat app used to enable one to keep a single objects color changed w/o the use of mods.

    Is there still a way to do this to your knowledge?
    Is keeping the modded syntax of "image" : "woodencouch2.png:red", vanilla compatable if someone else were to join my game w/o that mod? or would their game crash?
     
  6. Errors4l

    Errors4l Spaceman Spiff

    Some objects use the "retainObjectParametersInItem" parameter, so that the parameters persist when breaking the object (and placing it down again). I'm not sure if this applies to all objects.

    You can use directives just like this:
    Code:
    /spawnitem woodencouch2 1 '{"color":"default?setcolor=ffffff"}'
    Note that I added default here, referring to the frame name found in woodenbed2.frames.
     
    Tentacle_Sashimi likes this.
  7. Tentacle_Sashimi

    Tentacle_Sashimi Scruffy Nerf-Herder

    I found exactly what I was looking for! As long as you get all of the exact hex codes for each of the colors in the default image, you can still "?replace" a color for an individual object, for example:

    /spawnitem woodencouch2 1 '{"color":"default?replace;435999=ffffff"}'

    This turns (part) of the example object white. keep stringing that pattern along and you will have your vanilla friendly custom color object.

    You probably know this, but just in case someone else stumbles onto this I hope this thread is helpful. Thanks again for the help!
     
    Errors4l likes this.
  8. Errors4l

    Errors4l Spaceman Spiff

    The syntax for multiple replaces is "?replace;from=to;from=to". The repeating part is ";from=to", and you can use this as many times as you want, so there's no need to add multiple "?replace" parts.
    You can actually find most of the supported directives on the wiki: https://starbounder.org/Modding:Image_Processing_Directives

    If you're on Windows, you could take a look at https://github.com/Silverfeelin/Starbound-DirectiveGenerator. This tool creates replace directives to turn an image into a recolored version of the same image. That means you can just recolor a copy of the image in your favorite image editor (Paint.NET, GIMP, Photoshop), without having to worry about the hex colors.
     
    Tentacle_Sashimi likes this.

Share This Page