Modding Help Why can't I use generic abilities to unrandom melee weapons?

Discussion in 'Starbound Modding' started by The1Chosen, Jun 4, 2019.

  1. The1Chosen

    The1Chosen Void-Bound Voyager

    Hello, guys. I tried to make a broadsword with generic (blinkslash) ability, but got nil this:

    [02:34:59.486] [Error] Could not instantiate item '[blinker, 1, {}]'. (LuaException) Error code 2, [string "/scripts/util.lua"]:553: bad argument #1 to 'pairs' (table expected, got nil)
    stack traceback:
    [C]: in ?
    [C]: in function '_ENV.pairs'
    [string "/scripts/util.lua"]:553: in field 'mergeTable'
    [string "/items/buildscripts/buildunrandweapon.lua"]:28: in function <[string "/items/buildscripts/buildunrandweapon.lua"]:6>


    But in-game can be spawned a lot of random broadswords with this ability, so there should be the way to make one not random, isn't it?

    {
    "itemName" : "blinker",
    "price" : 2000,
    "level" : 6,
    "maxStack" : 1,
    "rarity" : "Rare",
    "description" : "description not available.",
    "shortdescription" : "Blinker",
    "tooltipKind" : "sword",
    "category" : "broadsword",
    "twoHanded" : true,
    "itemTags" : ["weapon","melee","broadsword"],

    "inventoryIcon" : "blinker.png",

    "animation" : "/items/active/weapons/melee/broadsword/combobroadsword.animation",
    "animationParts" : {
    "handle" : "blinkerh.png",
    "blade" : "blinkerb.png"
    },
    "animationCustom" : { },

    "scripts" : ["/items/active/weapons/melee/meleeweapon.lua"],

    "elementalType" : "physical",

    "primaryAbilityType" : "broadswordcombo",
    "primaryAbility" : {
    "fireTime" : 0.67,
    "baseDps" : 12
    },

    "altAbilityType" : "blinkslash",

    "builder" : "/items/buildscripts/buildunrandweapon.lua"
    }


    Sorry if this question has already been asked, I tried to search on forum and this is the only I've got:
    https://community.playstarbound.com...ly-generic-item-instead-of-mod-weapon.119876/

    I would like to know how to use generic abilities, thanks in advance.
     
  2. projectmayhem

    projectmayhem Spaceman Spiff

    Try changing the elementalType to something else. Im having a hard time remembering, but i think ive had this issue before. I think its looking for the elemental types table, but since you have physical, its not finding anything.


    EDIT

    Im pretty sure this is the issue. If you look at the blinkslash it says this..


    Code:
        "damageConfig" : {
          "damageSourceKind" : "<elementalType>broadsword",
          "baseDamage" : 20,
          "knockback" : 20,
          "knockbackMode" : "facing",
          "timeout" : 0.5,
          "timeoutGroup" : "alt"
        },
        "elementalConfig" : {
          "fire" : {
            "damageConfig" : { "statusEffects" : [ "burning" ] }
          },
          "ice" : {
            "damageConfig" : { "statusEffects" : [ "frostslow" ] }
          },
          "poison" : {
            "damageConfig" : { "statusEffects" : [ "weakpoison" ] }
          },
          "electric" : {
            "damageConfig" : { "statusEffects" : [ "electrified" ] }
          }
        },
    Now, it should be looking for physicalbroadsword as the damage kind... but there isnt a damage kind for that. So that would probably be the issue.
     
    The1Chosen likes this.
  3. The1Chosen

    The1Chosen Void-Bound Voyager

    Yes, now that works. Thank you for help.
     

Share This Page