Tutorial Custom Armor & Clothing v1.2.3

Discussion in 'Starbound Modding' started by projectmayhem, Apr 15, 2017.

  1. projectmayhem

    projectmayhem Ketchup Robot

    Here is a short tutorial on making custom armor and clothing.

    For your first Armor or Clothing, its best to use a guideline.

    What you want to do is go into Items/Armor/Biome/Tar/Tar and copy those files into your folder for your actual armor. The Tar files are good template, as they closely resemble a nude human, so its easy to see exactly what parts your armor is covering. So, for example, this tutorial uses stormtrooper armor from my mod. I copied the tar files to items/armor/stormtrooper/tier1. I use tier1 since I have multiple tiers of armors.


    Now, rename tar.chest tar.legs and tar.head to match whatever you are calling your armor. So my example, stormtrooperchest.chest stormtrooperlegs.legs and stormtrooperhelm.head

    [​IMG]

    I like adding the chest/legs/helm after my items so I can tell at a glance which one is which, since I don't like List/Detail view in my folders.

    Now, open up your .chest file. Here you find all the infomation for just the chest piece of your armor.
    Here is my stormtrooper.chest

    Code:
    {
      "itemName" : "SWMstormtrooperchest",
      "price" : 2500,
      "inventoryIcon" : "icons.png:chest",
      "maxStack" : 1,
      "rarity" : "Rare",
      "category" : "chestwear",
      "description" : "Stormtrooper Chest",
      "shortdescription" : "Stormtrooper Chest",
      "tooltipKind" : "armor",
    
      "maleFrames" : {
        "body" : "chest.png",
        "backSleeve" : "bsleeve.png",
        "frontSleeve" : "fsleeve.png"
      },
    
      "femaleFrames" : {
        "body" : "chest.png",
        "backSleeve" : "bsleeve.png",
        "frontSleeve" : "fsleeve.png"
      },
    
    
      "level" : 1,
      "leveledStatusEffects" : [
        {
          "levelFunction" : "standardArmorLevelPowerMultiplierMultiplier",
          "stat" : "powerMultiplier",
          "baseMultiplier" : 1.25
        },
        {
          "levelFunction" : "standardArmorLevelProtectionMultiplier",
          "stat" : "protection",
          "amount" : 0.5
        },
        {
          "levelFunction" : "standardArmorLevelMaxEnergyMultiplier",
          "stat" : "maxEnergy",
          "amount" : 4
        },
        {
          "levelFunction" : "standardArmorLevelMaxHealthMultiplier",
          "stat" : "maxHealth",
          "amount" : 4
        }
      ],
    
      "itemTags" : [ "tier1armour" ]
      }
    
    


    The "itemName" is the actual items name, not whatever you called the chest file. So my stormtrooper chest is called SWMstormtrooperchest. It's good to use some kind of mod tag on all your items, so they do not conflict with any other mod. For example, my Star Wars mod can run along with other Star Wars mods, since my strormtrooper armor won't have the same "itemName" as theirs. This is also what you type in to spawn the item. /spawnitem SWMstormtroopchest will spawn this chest.

    "description" is what appears on the right side of the crafting window / marchant window, below the mannequin showing off the armor. I kept mine simple with Stormtrooper Chest, though you can be detailed such as, "Armor worn by assault/policing troops of the Galactic Empire. "

    "shortdescription" is what appearson the left side of the crafting menu, the name hover over to see the materials needed to craft it. This should be as short as possible, so it all fits on one line.

    "maleFrames" sets the paths for male version of the armor
    "femaleFrames" sets the paths for the female version of the armor
    In most cases, the arms will be the same, chest will be different. I kept the same chest for both my male and females.

    "level" sets the items level

    "leveledStatusEffects" sets the Power, Protection, Energy and Health gains. If you want purely cosmetic items, you can leave this out.

    "itemTags" sets the tags for the item. I always use tiers for mine, since its a progression mod.


    Now go through and edit the Head and Leg files, renaming the "itemName" and setting any properties you want.


    Now, you can use a graphics editor like GIMP or Paint.net to edit the armor graphic files. The best thing to do is create a new layer over the existing one, color in the armor how you want it to look, then delete the original layer, leaving only your layer.

    Next, open the icon.png and draw your icons for the armor set.

    Now, we create recipes. These should be in your recipes folder. Here is what my stormtrooper.recipe file looks like

    {
    "input" : [
    { "item" : "ironbar", "count" : 5 },
    { "item" : "fabric", "count" : 5 },
    { "item" : "string", "count" : 1 }
    ],
    "output" : { "item" : "SWMstormtrooperchest", "count" : 1 },
    "groups" : [ "swm","armor" ]
    }

    Everything should be pretty self explanatory except the "groups" part. The groups define where it is crafted. Use "plain" for open hand crafting, "campfire" for campfire, etc. Mine uses the swm tag to let the game know its only craftable at my crafting station that has the "swm" tag. Then "armor" lets it know that it needs to be in the tab that is tagged as armor.

    Create a recipe for each armor part. Head, Chest and Legs. For cosmetic items, most mods I've seen use
    {"item" : "money", "count" : 1}
    So that all the cosmetic items cost 1 pixel.


    Now that we have Armor files, and recipes, we need to patch the player.config so that we know the recipe. In your mods root folder, create a file called player.config.patch
    [
    {"op" : "add","path" : "/defaultBlueprints/tier1/-","value" : { "item" : "SWMstormtrooperchest" }},
    {"op" : "add","path" : "/defaultBlueprints/tier1/-","value" : { "item" : "SWMstormtrooperhelm" }},
    {"op" : "add","path" : "/defaultBlueprints/tier1/-","value" : { "item" : "SWMstormtrooperlegs" }}
    ]

    Change the "item" to match your mods item names. Remember, each one needs a "," after it, except the last one.


    You should now be able to /spawnitem your items in, and craft them at whatever station you assigned them too.
     
    Last edited: Apr 15, 2017
  2. IHart

    IHart Scruffy Nerf-Herder

    That first step is not only unnecessary, but harmful to mod compatibility. When your mod loads into the game it's files merge with the default assets. Including your own version of any default files overwrites the originals and any patches made to them, this is called a "dirty edit".
     
    Errors4l and projectmayhem like this.
  3. projectmayhem

    projectmayhem Ketchup Robot


    Removed First step, thank you :)
     
  4. Modelzero

    Modelzero Void-Bound Voyager

    [Deleted because I figured out it was the bonus effects causing the issues]
     
    Last edited: Apr 26, 2017
  5. AtomicPegasus

    AtomicPegasus Void-Bound Voyager

    What does the "effect sources" mean in the helmet file, is it necessary?
     
  6. big boy

    big boy Yeah, You!

    I am completely inexperienced with coding of any sort.
    well now I know that it ain't that hard
    this was very helpful
    thank you
     

Share This Page