Modding Help Waluigi's thousand-and-a-half questions!

Discussion in 'Starbound Modding' started by Wa.luigi.time, Sep 22, 2019.

  1. Wa.luigi.time

    Wa.luigi.time Subatomic Cosmonaut

    This is gonna be a thread where I post all of my modding questions so that I don't flood the thread list.
    (I recommend that you look at the most recent posts)
    Question 1:
    I'm making a simple hat mod in which I add some sunglasses.
    I can't figure out how to change the position of my sunglasses so that they properly align with the eyes.
    I messed around with several custom mask files and I tried moving the sprite itself but the glasses always end up a little too low on the face...
    So uh... How do position?
     
    Last edited: Sep 24, 2019
  2. terminalcaesura

    terminalcaesura Void-Bound Voyager

    Positioning is based on the 4 normal values you entered into your head.frames (or headm, headf, etc)

    So, if your code looks like this
    Code:
    {
      "image" : "head.png",
      "frameList" : {
        "normal" : [43, 0, 86, 43],
        "climb" : [43, 172, 86, 215] //Quick note! climbing was never implemented in starbound, so this area will (should) never actually mater, although i haven't really tested what setting the values out of bounds of deleting it altogether does, so change this at your own risk
      }
    }
    The game will take (43,0) as the upper left corner of your head wear and (86,43) as the lower right. This entire rectangle will be placed with it's center anchored on top of the bottom center (not true center!) of your character's head. Chances are this is the reason your glasses always end up a little low on the face.

    Here's what that region alone looks like, Note our character's head isn't actually totally center, but rather just above where the center would be. So, if we drew the glasses at the true center, it would appear too low.

    upload_2019-9-22_12-3-3.png


    I've attached a zip with the vanilla starbound head.frame and head.png positioning setup with the precise head position already drawn on if you want to use that as a template (just make sure you start drawing on a different layer)
     

    Attached Files:

    Last edited: Sep 22, 2019
    Wa.luigi.time likes this.
  3. Wa.luigi.time

    Wa.luigi.time Subatomic Cosmonaut

    Thanks for the help!
    And now for my next question:
    2:
    How do I make sure hair/fur/feathers/gas/attachments/fins show up behind a piece of headwear?
    I messed around with the mask file but I couldn't figure it out.
    Now I have sunglasses that make your character bald...
     
  4. terminalcaesura

    terminalcaesura Void-Bound Voyager

    Try making your mask file a completely white 43x43 image, that should force it to show everything under the head armor layer. You might need to make the area where the glasses go transparent not 100% sure.
     
    Wa.luigi.time likes this.
  5. Wa.luigi.time

    Wa.luigi.time Subatomic Cosmonaut

    Your idea worked perfectly!
    I made my third hat mod entirely through your help!
    [​IMG]
    But I have another question:
    Question 3:
    How do I make sure new characters know the crafting recipes for my hats?
    I have working recipes but no way to learn them...
     
  6. sirguylittle

    sirguylittle Void-Bound Voyager

    The easiest way is with a player.config.patch something like
    Code:
    [
      { "op" : "add", "path" : "/defaultBlueprints/tier1/-", "value" : { "item" : "hatname1" }},
      { "op" : "add", "path" : "/defaultBlueprints/tier1/-", "value" : { "item" : "hatname2" }}
    ]
    
    This will add hatname1 and hatname2 to the known recipes for all existing and new characters (just like they know how to craft timber for example)
     
    Wa.luigi.time likes this.
  7. Wa.luigi.time

    Wa.luigi.time Subatomic Cosmonaut

    Thanks to your help I now have 9 useless little hats in my collection but for my final one I want it to be dyeable!
    Can I set a starting colour for when you just finished crafting it?
     
  8. DrPvtSkittles

    DrPvtSkittles Parsec Taste Tester

    Yes!

    The first colour option is its default. Then the rest are the dye colours. For example one of my pieces has:

    Code:
      "colorOptions" : [
        // DEFAULT TEAL
        { "ffca8a" : "b1ffff", "e0975c" : "54fcfc", "a85636" : "00a8a8", "6f2919" : "008383" },
        // 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" }
      ]
    }
    
    Having said that, you caaaaaaaaaaaan change those dye colours to be whatever you want.
     
    Wa.luigi.time likes this.

Share This Page