Making shields that work!

Discussion in 'Starbound Modding' started by James Phrost, Dec 11, 2013.

Thread Status:
Not open for further replies.
  1. James Phrost

    James Phrost Space Hobo

    1 - Make a new mod folder in your assets folder.


    [​IMG]


    2. Go to \Starbound\assets\items\shields\randomgenerated and copy the "default.frames" and one each of the config and generatedshield files and put them in your NewShieldMod folder. Also, create another folder inside your NewShieldMod folder; I'll name it NewShield. This is going to be the KIND of shield.
    [​IMG]

    3. Inside that NewShield folder, add another folder and name it "images." Then go look at the pictures of the different shields and pick one that you like. If you're good at changing the look of the shields feel free to do that too! I suck at it so I'll just pick the glitchlord shield.

    Copy your png into your "Starbound\assets\NewShieldMod\NewShield\images" folder.

    [​IMG]


    4.Now, if you open up your "glitchlord.generatedshield" file, you'll get something that looks like this:

    Code:
    {
      "name" : "glitchlordshield",
      "kind" : "glitchstrong",
    
      "rarity" : "rare",
      "palette" : [
        { }
      ],
    
      "hitSound" : "/sfx/melee/shield_block_metal2.wav",
    
      "baseline" : {
        "recoil" : 0.2,
        "knockbackPower" : 10,
        "knockbackDamageKind" : "",
        "statusEffects" : [
          { "kind" : "Encumbered" },
          { "kind" : "EnergyRegenSuppressed" },
          { "kind" : "Shield", "amount" : 10 }
        ],
        "shieldPoly" : [ [-8, 0], [-8, 12], [8, 20], [8, -24], [-8, -12] ],
        "damagePoly" : [ [-8, 0], [8, 18], [8, -18] ]
      },
        "nameGenerator" : "glitchstrongshieldnames.config:namegen"
    }
    
    Now here's what we want to do:

    Name - change this to whatever you want your shield called
    kind - change this to the name of the folder inside of your "NewShieldMod" folder. In this case I will change it to "NewShield".

    Also change the name of your two configuration files to what you want your shield called.

    [​IMG]



    5. Add your shield to the player.config under tier1, or wherever you want to put it...

    However it isn't as simple as just putting the normal { "item" : "holyshield" }, " name in. If you look at the very bottom of tier 1 you will see this long item string which is used to craft the Basic Shield from an anvil.

    { "item" : "generatedshield", "count" : 1, "data" : { "definition" : "startershield", "level" : 1 } }

    Looking at this, the "generatedshield" is telling it to spawn a shield. "startershield" is the "name" of the shield to spawn. I'm not sure if level affects anything, but I like to set it to 10.

    So we're going to change this string so that it looks more in line with the stuff in our "NewShieldMod" folder.

    Code:
     "tierBlueprintsUnlockedMessage" : "New blueprints have been unlocked.",
      "blueprintOnPickupMessage" : "New blueprint available.",
      "defaultBlueprints" : {
        "tier1" : [
          { "item" : "generatedshield", "count" : 1, "data" : { "definition" : "holyshield", "level" : 10 } },
         { "item" : "copperarmorchest" },
          { "item" : "copperarmorpants" },
          { "item" : "darkwoodmaterial" },
          { "item" : "yarnspinner" },
    6. Now that that's done, let's make our recipe...

    Copy the basicshield.recipe from Starbound\assets\recipes\starter\anvil and put it into a new folder called "recipes" in your "NewShieldMod" folder.

    THEN, change it to look like this:


    Code:
    {
      "input" : [
       
        { "item" : "money", "count" : 1 }
      ],
      "output" : { "item" : "generatedshield", "count" : 1, "data" : { "definition" : "holyshield", "level" : 10 } },
      "groups" : [ "plain", "armor", "all" ]
    }
    This will make you able to craft it with your "C"rafting menu for only 1 pixel. If you wanted to make it at an anvil, just replace "plain" with "anvil" or whatever else your heart desires.


    7. With what we have done so far, our shield should be craftable in the game without even having to make a new character, but let's make our shield actually WORK!

    Open up the "holyshield.generatedshield" file

    Code:
    {
      "name" : "holyshield",
      "kind" : "NewShield",
    
      "rarity" : "rare",
      "palette" : [
        { }
      ],
    
      "hitSound" : "/sfx/melee/shield_block_metal2.wav",
    
      "baseline" : {
        "recoil" : 0.2,
        "knockbackPower" : 10,
        "knockbackDamageKind" : "",
        "statusEffects" : [
          { "kind" : "Encumbered" },
          //{ "kind" : "Protection", "amount" : 100 },
          //{ "kind" : "EnergyShield", "amount" : 100 },
          //{ "kind" : "EnergyRegenSuppressed" },
          { "kind" : "Shield", "amount" : 100 }
        ],
        "shieldPoly" : [ [-8, 0], [-8, 12], [8, 20], [8, -24], [-8, -12] ],
        "damagePoly" : [ [-8, 0], [8, 18], [8, -18] ]
      },
        "nameGenerator" : "holyshieldname.config:namegen"
    }
    
    Change the "amount" next to shield to 100. This should increase the amount of damage it blocks or something.
    If you put two // before something, it will comment it out. In this case, I'm eliminating the suppressed energy regen that occurs when you hold your shield out. If left on, your energy would slowly drain until the monster attacks would get through. This way, your energy will just keep regenerating.

    You could also comment out "encumbered" so that your guy will move normal speed even while blocking. You could add health, or cold resistance. you could add damage buffs or glow, or jump boost to this shield. Or pretty much anything really. The world is your oyster through mods.


    8. Now, for the last thing. Remember that "holyshieldnames.config" file that we copied over? Well, we're going to make use of it now.

    This is only if you want to give a specific name to your shield.

    Open it up and we get something like this:

    Code:
    {
      "namegen" : [
        { "mode" : "alts" },
        [
          { "mode" : "serie" },
          [ { "mode" : "alts" }, "Infernal Machine ", "Terror ", "Golden ", "Holy ", "Divine ", "Transcended ", "Delightful ", "Royal ", "Glorious ", "Adorable ", "Terminator " ],
          [ { "mode" : "alts" }, "Blocker", "Deflector", "Guard", "Shield", "Buckler", "Cover", "Protector", "Kill-stopper", "Arrowguard", "Dinnertray", "Smasheriser", "Coverer", "Annoyance", "Bladeblocker", "Hammerhalter", "Axeaffector", "Spearstopper", "Daggerdeflector" ]
        ]
      ]
    }
    
    If left like this, your shield will have a different name every time you craft it. If you want it to have a SPECIFIC name, all you need to do is take out everything you don't want, and add a name that you do want.

    If I want this shield to be called a "Holy Shield" when I craft it, all I have to do is change it to this:

    Code:
    {
      "namegen" : [
        { "mode" : "alts" },
        [
          { "mode" : "serie" },
          [ { "mode" : "alts" }, "Holy " ],
          [ { "mode" : "alts" }, "Shield" ]
        ]
      ]
    }
    Also, make sure that in your "holyshield.generatedshield" file, you make sure the name generator is pointing to the name of your shieldnames.config file. Check it out:

    [​IMG]

    Now every time it is crafted, the prefix will be "Holy" and the suffix will be "Shield".

    Holy Shield.

    Let's see if it works!!

    [​IMG]

    There's our shield. Unfortunately I am not really sure how to change the description.. :x

    Let's test it out!

    [​IMG]


    Great success! :)
     
  2. connery0

    connery0 Void-Bound Voyager

    Is there any way to make the shield recepy learned on pickup or does it have to be in player.config?
     
  3. Pelagius

    Pelagius Scruffy Nerf-Herder

    hmm comes up as perfectly generic item?
     
    Last edited: Dec 29, 2013
  4. connery0

    connery0 Void-Bound Voyager

    Did you make sure the level of the shield is the same in all files? I think that's what I did wrong at first
     
  5. Pelagius

    Pelagius Scruffy Nerf-Herder

    exactly which files? assets or something more outside of that directory? also we were suppost to overwrite the startershield in player.config or do we leave it there as startershield and make a copy then editing that line with our shields name?
     
    Last edited: Dec 29, 2013
  6. connery0

    connery0 Void-Bound Voyager

    you don't have to edit the normal player.config anymore, it would be better to make a new player.config in the mod folder and put this in it
    Code:
    {
        "__merge" : [],
        "defaultBlueprints" : {
            "__merge" : [],
            "tier1": [
                { "item" : "generatedshield", "count" : 1, "data" : { "definition" : "noxreactor", "level" : 10 } },
            ]
        }
    }
    obviously with your shield name instead of "noxreactor"
    (this adds your shield to the tier 1 recepys witout giving you trouble with other mods or anything else)
    here you use "level":(number) and the recepy also has level in it
    I also have { "kind" : "Shield", "amount" : 10 } in the .generateshield file but I don't know if the shield amount has to be the same as the level
     
  7. Pelagius

    Pelagius Scruffy Nerf-Herder

    im still getting it as a generic item, however i do want to think you for the _merge code
     
    Last edited: Dec 29, 2013
  8. connery0

    connery0 Void-Bound Voyager

    I think it should have the same name as the item yeah, if for nothing else then to make sure that it doesn't conflict with whatever you are copying it from
    (edit: if you upload the folder you are making the modded item in I could just look for the problem)
     
  9. Pelagius

    Pelagius Scruffy Nerf-Herder

    k where you like me to upload it? to be of easiest convenience to you?
     
  10. Pelagius

    Pelagius Scruffy Nerf-Herder

  11. connery0

    connery0 Void-Bound Voyager

    wow, I'm sure glad I asked you for the files this could have gone on for a while
    the good new is, it works.
    Knipsel.PNG

    and now for evertying that was wrong
    first off, the code I gave you
    Code:
    {
        "__merge" : [],
        "defaultBlueprints" : {
            "__merge" : [],
            "tier1": [
                { "item" : "generatedshield", "count" : 1, "data" : { "definition" : "noxreactor", "level" : 10 } },
            ]
        }
    }
    had a "," at the end because I copied it from my files and I had multiple items that had to be merged. a "," with nothing after it will just give a problem though (every problem makes the compiler give up on it and replace it with the generic object)

    the next thing is that your generatedshield-file said
    "nameGenerator" : "pelagiusshieldname.config:namegen"
    but your file was called pelagiusshieldname
    s.config
    AND to be even more precise it was called pelagiusshieldnames.config.config
    you see, windows usualy hides file extensions like .png .doc .config and so on, so when you change the name to pelagiusshieldnames.config, there still is a hidden .config behind it.
    (you can make windows show the extensions and save yourself some trouble in the map options)

    your image file was also called 4.png.png double extensions, but it also should have been called 1.png otherwise you would just get a invisible sprite.

    there was also a extra { in the generatedshield file you can see if you have typos or anything here http://jsonlint.com/ just copy the content and click validate.

    also I think // doesn't work in this language so if you don't want anything you should just delete it instead of putting // in front of it.

    (I also made the map structure resemble the map structure in assets, I don't know if it's nececary but I made the change before I found the other problems, and it'll be clearer if you add new stuff)

    tl:dr: there were a bunch of errors and the fixed version is the zip I uploaded.
    just drop the folder in starbound/mods (I even added a .modinfo file)
     

    Attached Files:

  12. Pelagius

    Pelagius Scruffy Nerf-Herder

    lol such is programming that i make a tiny mistake :rofl: btw the whole point in me taking interest in this was to see if i could add health regen to the shield but before i try how would u recommend i go about doing it?
     
  13. Pelagius

    Pelagius Scruffy Nerf-Herder



    question, in the generated shield file for say EnergyRegenSuppressed which the op and i wanted out of the shield do i just delete that line?
     
  14. connery0

    connery0 Void-Bound Voyager

    yeah just delete it, make you that the one above and below are still seperated by ONE comma and it should be fine (or if it's only one thing left make sure there are no commas in front and behind)

    I'm not sure how to make it regen your health, but I'd gues you add some sort of health regen to the status efects (the part you want to remove energy regen supressed from)
     
  15. Pelagius

    Pelagius Scruffy Nerf-Herder

    i present the wonder shield it gives all effects of stim (healing,jump,speed, and glow) just block with it. p.s. have a boast tek or the jump effect will probs kill you when u hit the ground. also i would like to think connery for helping :3
     

    Attached Files:

    Last edited: Dec 30, 2013
    connery0 likes this.
  16. Pelagius

    Pelagius Scruffy Nerf-Herder

    while the shield stops pretty much everything be warned it does not stop smoke projectiles like healinggas etc if anyone can help with that plz do. :l
     
Thread Status:
Not open for further replies.

Share This Page