Modding Help Adding IgnoresDef to a melee weapon?

Discussion in 'Starbound Modding' started by MetaFace, Mar 6, 2017.

  1. MetaFace

    MetaFace Guest

    So the projectileParameter section allows one to add the damageType to guns, but I was wondering how to tell the game how to do the same thing in a melee. Since there is no parameter section and the lua for melee seems to not consider the implementation of a parameter "json join" function like in the lua for guns. This may be simple, but I can't see it right away... once again, any help is appreciated.

    Just to make this a little clearer, I want to add
    Code:
    "damageType" : "IgnoresDef"
    to the json in my melee weapon so it does direct damage to the target (like npc's) without taking armor into consideration (these are weapons to create balance against a set of armor I added earlier).
     
  2. Inf_Wolf14

    Inf_Wolf14 Parsec Taste Tester

    Have you tried implementing it just to see?

    Melee weapons also use projectiles like guns in many cases, so its should be completely valid to define projectile parameters, or even specific damage configs (depending on the ability you are altering).

    I know I've used cases like those in my own weapons before. (Not specifically to ignore defense, but the same processes to do so.)
     
  3. MetaFace

    MetaFace Guest

    I've tried to a point, this weapon however doesn't use any kind of projectile, so it seems a little more complicated than that, I'm over looking something like always and I can't see it.
     
  4. MetaFace

    MetaFace Guest

    As a double post, I grabbed some code:
    Code:
    sb.jsonMerge(self.projectileParameters, projectileParams or {})
    This is the code which I believe gets the projectile's parameters, but I don't think such code exists in the melee weapon's lua. I, again, am probably just not seeing the obvious.
     
  5. Inf_Wolf14

    Inf_Wolf14 Parsec Taste Tester

    I suppose then its up to what your weapon is.

    If you wouldn't mind, could we see what weapon it is you are working with? It'll be a tad easier than just suggesting solutions based on prior experience. :)
     
  6. MetaFace

    MetaFace Guest

    Let's just say for the time being that I'm using this weapon as my test item (aka I haven't started entirely on the weapon that uses this):
    Code:
    {
      "itemName" : "metasword",
      "price" : 150000,
      "level" : 6,
      "maxStack" : 1,
      "rarity" : "Legendary",
      "description" : "A sword too big for a normal man...",
      "shortdescription" : "Meta's Greatsword",
      "tooltipKind" : "sword",
      "category" : "broadsword",
      "twoHanded" : true,
      "itemTags" : ["weapon","melee","broadsword"],
    
      "inventoryIcon" : "metasword.png",
    
      "animation" : "/items/active/weapons/meta/MetaGreatSword/metasword.animation",
      "animationParts" : {
        "handle" : "",
        "blade" : "metasword.png"
      },
      "animationCustom" : {
        "sounds" : {
          "physicalTravelSlash" : ["/sfx/melee/ixodoomclaw_web2.ogg"],
          "fire" : ["/sfx/melee/swing_hammer.ogg"],
          "physicalimpact" : [ "/sfx/melee/shockwave_physical_slam.ogg" ]
        }
      },
    
      "scripts" : ["/items/active/weapons/melee/meleeweapon.lua"],
    
      "elementalType" : "physical",
    
      "primaryAbilityType" : "axecleave",
      "primaryAbility" : {
        "fireTime" : 1.0,
        "baseDps" : 26,
        "stances" : {
          "idle" : {
            "allowRotate" : false,
            "weaponRotation" : 0,
            "weaponOffset" : [-0.125, 5.5]
          },
          "windup" : {
            "twoHanded" : true,
            "allowRotate" : false,
            "weaponRotation" : -70,
            "weaponOffset" : [-0.125, 5.5]
          },
          "fire" : {
            "twoHanded" : true,
            "allowRotate" : false,
            "armRotation" : -35,
            "weaponRotation" : -75,
            "weaponOffset" : [-0.125, 5.5]
          }
        }
      },
    
      "altAbilityType" : "greatslashcombo",
    
      "builder" : "/items/buildscripts/buildunrandweapon.lua"
    }
    
    So no projectiles, just a standard axe cleave. If there is anything else you need to see I can put them here or even if you need the whole item.

    Edit:
    Also note this weapon is a mess since I've left it alone for quite awhile, it's more or less a temporarily abandoned item for now.
     
  7. Inf_Wolf14

    Inf_Wolf14 Parsec Taste Tester

    Alright, I see what you're working with. Yeah, the axe cleave uses part point damage so projectiles are out unless you replace, or create a modified version of the code.

    I can't do a whole lot to help at this point (My computer's power supply died, and I'm still fixing it), but I would check the scripts for the axe cleave ability and determine if it has any hooks for a damage config in the JSON.
    If not, you may be best off to create a modified version of the ability and creating those hooks.



    (Sorry for my inability to help at the moment...)
     
  8. MetaFace

    MetaFace Guest

    I saw that, I'm not sure exactly how to do it, but I think I have a clue, I think it has something to do with jsonmerge() function from before (as in the lua this is the ONLY point where projectileParameters is referenced), of course with some edits I think it should work with melee.

    Sadly I don't always like working with lua.
     

Share This Page