Modding Help Coloring Objects?

Discussion in 'Starbound Modding' started by AmazonValkyrie, Oct 26, 2016.

  1. AmazonValkyrie

    AmazonValkyrie Spaceman Spiff

    I was under the impression that coloring objects was a functioning feature in Starbound, mainly because multiple colors for many objects can be found in the image files. The paint tool has never been a feature I used, until today to test making my own color options for objects, only to find it's not working on objects, only tiles. I don't keep up too much with current discussions on the game, so I'm not sure if it's something CF plans to fully implement for their objects.

    Is there a simple way to make it functional? This is an incredible way for modders to make their objects more unique and varied, and I'm really itching to take advantage of color changes for objects. As always, any help or advice is greatly appreciated!
  2. lazarus78

    lazarus78 The Waste of Time

    There was a mod for it, but I don't think it works anymore. There was a feature for painting objects, but it was disabled/removed fr one reason or another way back yonder.

    Short answer, no there is no easy way of making it work.
  3. AmazonValkyrie

    AmazonValkyrie Spaceman Spiff

    Oh yeah, Mr Magical's Dye mod allowed for object color changing :/ We may never see an update to that, but hopefully CF adds this in, or that another skilled modder can put something similar together. I wish I knew where to start to do it myself >_< Nothing worth anything is easy to achieve.
  4. lazarus78

    lazarus78 The Waste of Time

    Id love for CF to re-add it. That way there is no chance of it not working due to a version change of the game. :rofl:
    AmazonValkyrie likes this.
  5. Errors4l

    Errors4l Spaceman Spiff

    *cracks knuckles* Directives time!

    It depends on the implementations of the objects you're trying to recolor. Animated objects require some nasty workarounds so I'm not even going to bother trying to explain that.

    Anyways, let's take a simple object as an example: "/objects/actionfigure/adultpoptop/".

    Opening the object file shows us the following image path: adultpoptopaf.png:<color>"
    is replaced with the "color" parameter of the object. This is what you'll have to use to recolor the object.

    Note that the format of a valid object image is:
    The frames file tells us this object has only one frame, named "default". This means our object image should be:
    "image.png:default?directives". EG: "image.png:default?setcolor=ffffff"
    Since there is no <frame> tag or anything alike, this means you'll have to account for it in your color parameter.
    The object color parameter would need to be "default?setcolor=ffffff" to make the image frame white.

    Without the default frame in place, the image would turn into "image.png:?setcolor=ffffff", which is incorrect (although apparently, after testing it, it seems to work for some objects?).

    For the actual directives there's a couple of tools. Two tools for windows I know of are:
    Recolor tool with interface (not tested by me for 1.x):
    Recolor tool for dragging and dropping recolored images:

    The easiest way to make these items obtainable, would be to add recipes with the different color parameters set inside the recipe (probably).

    I don't know to what extend it'd be possible to make an item that manipulates existing objects to update their parameters (namely color). If that is possible, it'd be possible to make a custom dye tool for recoloring objects.
    You might be able to use object.setConfigParameter(`String` key, `Json` value) to update it. Idk if updating the parameter will rerender the object though. This would require dyeable objects to be scripted and have a message handler set, that will run the functions. The scripted active item (dye tool) could then send a recolor message to the scripted object.

    As a side note, there's some parameter that makes broken objects keep their parameters, this is necessary to keep the colors. I think you're best off looking at the custom signs to see what this parameter is called and how to use it.
    Edit: the parameter to retain parameters is:
    "retainObjectParametersInItem" : true
    Last edited: Oct 26, 2016
    AmazonValkyrie likes this.

Share This Page