Modding Help Changing male/female armor frames?

Discussion in 'Starbound Modding' started by Sock_Bunny, Dec 9, 2016.

  1. Sock_Bunny

    Sock_Bunny Existential Complex

    Hi! : D
    Is it possible to spawn a chestplate that uses the male frames when a female character wears it?
     
  2. Ultimate sandvich

    Ultimate sandvich Scruffy Nerf-Herder

    Hi ^-^
    Yeah it is, you'll just need to change the "chestf.png" to "chestm.png" through patching. Let me give an example:
    This is the code for an armorset for any apex, male or female.

    Code:
    {
      "itemName" : "apexcommanderjacket",
      "price" : 75,
      "inventoryIcon" : "icons.png:chest",
      "maxStack" : 1,
      "rarity" : "Common",
      "category" : "chestwear",
      "description" : "A standard issue Apex commander jacket.",
      "shortdescription" : "Commander Jacket",
      "tooltipKind" : "armor",
    
      "maleFrames" : {
        "body" : "chestm.png",
        "backSleeve" : "bsleeve.png",
        "frontSleeve" : "fsleeve.png"
      },
    
      "femaleFrames" : {
        "body" : "chestf.png",
        "backSleeve" : "bsleeve.png",
        "frontSleeve" : "fsleeve.png"
      },
    
      "colorOptions" : [
        // RED
        { "ffca8a" : "f4988c", "e0975c" : "d93a3a", "a85636" : "932625", "6f2919" : "601119" },
        // 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" }
      ]
    }

    As you can see, there is a part:

    "femaleFrames"
    "body": "chestf.png"

    That's what determines how the frames look, so that's what has to change.
    You can easily do this through patching. First you'll have to create a folder structure in your mod folder similar to the structure where the item is situated, so in this case the file should be in -/yourmod/items/armors/apex/apexcommander
    Then, create a file called "apexcommander.chest.patch". This way, the game will know that it needs to edit the file called "apexcommander.chest".
    Now, open the file with any text editor you want, and then type the following code:
    Code:
    [
        {
            "op": "replace",
            "path": "/femaleFrames/body",
            "value": "chestm.png"
        }
    ]
    This tells the game to replace the "chestf.png", with the "chestm.png", which is the image used for the male frames.

    To test this in-game, you can just give yourself admin (/admin) rights and spawn the item (/spawnitem apexcommanderjacket) and try it out!

    If you have any other problems, be sure to ask :)

    EDIT: I tested to see if it actually worked, and it did as you can see:
    Starbound ex.PNG
    Starbound.PNG
     
    Last edited: Dec 9, 2016
  3. lazarus78

    lazarus78 The Waste of Time

    @Ultimate sandvich He asked about spawning in armor, not modding. Maybe he meant modding, but eh.

    As for spawning in, yes it is entirly possible through the use of directives. I can't recall the exact syntax for the command but google can be of some help.
     
  4. Ultimate sandvich

    Ultimate sandvich Scruffy Nerf-Herder

    Oh sorry, I misunderstood them. I'm not really familiar with spawning things other than to see whether my modded stuff works, but I think this link might help a bit, it's something I found on reddit. It explains the /spawnitem command more in depth
     
  5. C0bra5

    C0bra5 Oxygen Tank

    Some parts of the items that are spawned cannot be changed. Here is a basic rundown if why:

    The parameters you give to the items are not directly applied to the item, but to the parameters array that is a part of the object that describes what object the player is holding, also known as the itemDescriptor object kind.

    The hick is that some of the code used for the game won't actually apply or check for that parameters object. And the visual for the armor is one of them.

    There are plenty of other settings where the game doesn't check for the parameters array, like the visuals used by an object once it is on the ground, but things like the level of an armor or a weapon are checked and applied correctly.
     
  6. AlbertoRota

    AlbertoRota Scruffy Nerf-Herder

    Did you find a way to do this?
    I'm trying to do something similar and being able to override the "maleFrames" and "femaleFrames" parameters will be great (Seems not to work on "Spawnitem" command)

    For me will be great to be able to make an armor/hat to look like another just by pointing to the correct sprite.

    Overriding "image", "inventoryIcon" and "icon" works ok, but after that, the armor looks the same :(
     
  7. Sock_Bunny

    Sock_Bunny Existential Complex

    nope. sorry
     
    AlbertoRota likes this.

Share This Page