Modding Help Problem modding certain alt abilities onto custom weapons

Discussion in 'Starbound Modding' started by AmazonValkyrie, Jan 7, 2016.

  1. AmazonValkyrie

    AmazonValkyrie Spaceman Spiff

    So I've been peeking at the weapon files lately, in hopes of making custom weapons with the new special, secondary abilities. I haven't been able to find the proper files that reference those abilities. I know that it's only randomly generated & two handed weapons that support those abilities, but I just haven't been able to find the files in the assets. Does anyone know where all the related files for those functions/abilities and weapons can be found?

    And on a side note, does anyone know if one can make custom randomly generated weapons for mods? I've been trying to figure out how to do that as well, but have been unable as of yet to get my test custom ones to work. Any advice at all is welcome and appreciated!
     
  2. Riuny

    Riuny Big Damn Hero

    File directory has been changed for the weapons with secondary abilities.
    All of them can be found in following directory

    ~/items/active/weapons/~
     
    AmazonValkyrie and The | Suit like this.
  3. lazarus78

    lazarus78 The Waste of Time

    Totally is. I did it for my own weapon sets.

    Just look in the previously mentioned folder location and take a peek at the relevant json files.
     
    AmazonValkyrie likes this.
  4. AmazonValkyrie

    AmazonValkyrie Spaceman Spiff

    Thanks, guys! You've both been very helpful ^_^ Final question: How lua savvy would one have to be to make custom alt-abilties for weaponry?
     
  5. AmazonValkyrie

    AmazonValkyrie Spaceman Spiff

    So I was working on a few custom weapons and for some reason some of the alt abilities (listed below) I've designated don't work. They give me an error message in the log (posted below with file setup), and make the item appear as a "Perfectly Generic Item." Now when I switch the weapon to another alt ability (like "spin" or "flurry" ) they work fine. I was wondering if anyone might know why this might be happening? I figured I might be missing something in my files or perhaps those alt abilities aren't currently functional?

    The alt abilities that give me this error are as follows: "rocketspear", "elementalspin", "traildash", "travelingslash"

    Weapon file setup:
    Code:
    {
      "itemName" : "nibelungtier1spear",
      "price" : 160,
      "level" : 1,
      "maxStack" : 1,
      "rarity" : "Legendary",
      "description" : "The ancient spear of Purification.",
      "shortdescription" : "Spear of the Nibelung",
      "tooltipKind" : "sword",
      "weaponType" : "Spear",
      "twoHanded" : true,
      "itemTags" : ["weapon","melee","spear"],
    
      "inventoryIcon" : "nibelungtier1spear.png",
    
      "animation" : "/items/active/weapons/melee/spear/tieredspear.animation",
      "animationParts" : {
        "blade" : "/items/active/weapons/melee/tiered/spear/nibelungtier1spear.png"
      },
      "animationCustom" : {
        "sounds" : {
          "fire" : [ "/sfx/melee/swing_spear.ogg" ]
        }
      },
    
      "scripts" : ["/items/active/weapons/melee/spear/spear.lua"],
    
      "elementalType" : "physical",
    
      "aimOffset" : -1.0,
      "primaryAttack" : {
        "fireTime" : 0.9,
        "baseDps" : 11.11,
        "damageConfig" : {
          "damageSourceKind" : "spear",
          "statusEffects" : [ ],
          "knockbackMode" : "aim",
          "knockback" : 30,
          "timeoutGroup" : "primary"
        },
        "holdDamageMultiplier" : 0.1,
        "holdDamageConfig" : {
          "timeoutGroup" : "hold",
          "timeout" : 0.5
        }
      },
    
      "stances" : {
        "idle" : {
          "armRotation" : -90,
          "weaponRotation" : 0,
          "twoHanded" : false,
          "weaponOffset" : [0, 0.5],
    
          "allowRotate" : true,
          "allowFlip" : true
        },
        "windup" : {
          "duration" : 0.1,
          "armRotation" : -110,
          "weaponRotation" : 20,
          "twoHanded" : true,
          "weaponOffset" : [0, 0.5],
    
          "allowRotate" : false,
          "allowFlip" : false
        },
        "fire" : {
          "duration" : 0.3,
          "armRotation" : -20,
          "weaponRotation" : -70,
          "twoHanded" : true,
          "weaponOffset" : [0, 2.5],
    
          "allowRotate" : false,
          "allowFlip" : false
        },
        "hold" : {
          "armRotation" : -30,
          "weaponRotation" : -60,
          "twoHanded" : true,
          "weaponOffset" : [0, 2.0],
    
          "allowRotate" : true,
          "allowFlip" : true
        }
      },
    
      "palette" : "/items/active/weapons/colors/tier1melee.weaponcolors",
    
      "altAbilitySource" : "/items/active/weapons/melee/altabilities/spear/spin/spin.altability",
    
      "builder" : "/items/buildscripts/buildunrandweapon.lua"
    }
    
    Error Code:
    Code:
    [19:25:48.644] Error: Could not instantiate item '[nibelungtier1spear, 1, {}]'. (LuaException) Error code 2, [string "/scripts/util.lua"]:374: bad argument #1 to 'pairs' (table expected, got nil)
    [19:25:50.848] Error: Could not instantiate item '[nibelungtier1spear, 1, {}]'. (LuaException) Error code 2, [string "/scripts/util.lua"]:374: bad argument #1 to 'pairs' (table expected, got nil)
     
  6. Riuny

    Riuny Big Damn Hero

    Do you still have old weapon file within your mod?
    If that is the case, you have to remove it first.
    Problem might occur if you have old weapon file and new weapon file with same name in the same mod.
     
  7. AmazonValkyrie

    AmazonValkyrie Spaceman Spiff

    No, I only have the one. But the thing is the weapon works, but only using certain alt abilities. If I designate one of the ones I listed in the first post (like rocketspear), I get that error message and the item appears as a perfectly generic item. But if I designate "spin" as it's alt ability, the weapon works and loads correctly.
     
  8. lazarus78

    lazarus78 The Waste of Time

    Oh god, I had that error too in my early days of working with the activeitem format... Let me ponder how I resolved it and I'll get back to you.
     
    AmazonValkyrie likes this.
  9. AmazonValkyrie

    AmazonValkyrie Spaceman Spiff

    Thank you! I really appreciate it, and anticipate your advice ^_^
     
    lazarus78 likes this.
  10. lazarus78

    lazarus78 The Waste of Time

    OK OK I remember now. Some of the alt abilities are tied to the elemental damage types only. Is the spin attack. Your damage type is set to physical, which the spin attack does not have a "physical" version of.

    The lua error is saying it can't "pair" the damage type to an appropriate version of the selected alt ability.
     
    AmazonValkyrie likes this.

Share This Page