Modding Help Failed Attempts at Dagger Mod... (Solved)

Discussion in 'Starbound Modding' started by ImHereForTheMods, Feb 2, 2017.

  1. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    So, I'm trying to make a mod, that brings over some of the old racial weapons from pre-1.0.

    ATM, all I've got is an avian tier 1 dagger (which I've been having the worst time with.
    Whenever I fix one thing, something else breaks...

    So uhm, the problem, at this moment is this:

    [19:20:22.459] [Error] Could not instantiate item '[aviantier1daggers, 1, {}]'. (LuaException) Error code 2, [string "/luas/buildunrandweapon.lua"]:46: attempt to index a nil value (field 'primaryAttack')
    stack traceback:
    [C]: in metamethod '__index'
    [string "/luas/buildunrandweapon.lua"]:46: in function <[string "/luas/buildunrandweapon.lua"]:5>
    [19:20:22.459] [Info] Root: Loaded ItemDatabase in 11.7391 seconds
    [19:20:22.816] [Info] Root: Loaded CollectionDatabase in 9.64429 seconds
    [19:20:24.720] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 256
    [19:20:32.634] [Info] UniverseServer: Acquiring universe lock file
    [19:20:32.636] [Info] UniverseServer: Loading settings
    [19:20:32.642] [Info] UniverseServer: Starting UniverseServer with UUID: 22cbf40f03ddb97e725b8e56e3c5c7cd
    [19:20:32.664] [Info] UniverseServer: Logged in player 'Matlan' locally
    [19:20:32.664] [Info] UniverseServer: Logged in account '<anonymous>' as player 'Matlan' from address local
    [19:20:32.712] [Info] UniverseServer: Reviving player at ClientShipWorld:19f4526ad2f0a0a744d99acfced12373
    [19:20:32.712] [Info] UniverseServer: Client 'Matlan' <1> (local) connected
    [19:20:32.719] [Info] UniverseClient: Joined server as client 1
    [19:20:32.777] [Info] UniverseServer: Loading client ship world ClientShipWorld:19f4526ad2f0a0a744d99acfced12373
    [19:20:33.153] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 64
    [19:20:33.153] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 128
    [19:20:33.166] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 256
    [19:20:33.166] [Info] detected supported OpenGL texture size 16384, using atlasNumCells 256
    [19:20:33.279] [Info] UniverseServer: Warping player 1 to ClientShipWorld:19f4526ad2f0a0a744d99acfced12373=1051.04.1024
    [19:20:36.570] [Error] Could not instantiate item '[aviantier1daggers, 1, {}]'. (LuaException) Error code 2, [string "/luas/buildunrandweapon.lua"]:46: attempt to index a nil value (field 'primaryAttack')
    stack traceback:
    [C]: in metamethod '__index'
    [string "/luas/buildunrandweapon.lua"]:46: in function <[string "/luas/buildunrandweapon.lua"]:5>


    I opened up the buildunrandweapon.lua and went to line 46, and there is says:
    config.tooltipFields.dpsLabel = util.round(config.primaryAttack.baseDps * config.damageLevelMultiplier, 1)
    Cool, so not much idea what to make of that, except that maybe it can't find the baseDPS for the primary attack?

    In my .activeitem file for the mod it looks like this:

    {
    "itemName": "aviantier1daggers",
    "price": 100,
    "maxStack": 1,
    "rarity": "Common",
    "description": "The Pecker. A tiny dagger that feels like a peck.",
    "shortdescription": "The Pecker",
    "tooltipKind": "sword",
    "category": "dagger",
    "twoHanded": false,
    "itemTags": ["weapon", "melee", "dagger"],
    "level": 1,
    "inventoryIcon": "icon/daggericon.png",

    "animation": "dagger.animation",
    "animationParts": {
    "blade": "aviantier1dagger.png",
    "handle": ""
    },



    "scripts": ["luas/meleeweapon.lua"],


    "elementalType": "physical",

    "aimOffset": 0.0,



    "primaryAbility" : {
    "scripts" : ["luas/meleeslash.lua"],
    "class" : "MeleeSlash",
    "fireTime" : 0.3,
    "baseDps" : 9,
    "damageConfig" : {
    "knockback" : 10
    },
    "stances" : {
    "idle" : {
    "armRotation" : -90,
    "weaponRotation" : -10,
    "weaponOffset" : [0.8, 2.25],

    "allowFlip" : true,
    "allowRotate" : true
    },
    "windup" : {
    "duration" : 0.05,
    "armRotation" : -20,
    "weaponRotation" : -20,
    "weaponOffset" : [0.8, 2.25],

    "allowFlip" : true,
    "allowRotate" : false
    },
    "fire" : {
    "duration" : 0.2,
    "armRotation" : -135,
    "weaponRotation" : 40,
    "weaponOffset" : [0.8, 2.5],

    "allowFlip" : true,
    "allowRotate" : false
    }
    }
    },



    "critChance": 2,
    "critBonus": 6,
    "builder": "/luas/buildunrandweapon.lua"

    }

    Hopefully someone can help me figure this out, I have verified this with JSONLint, and it says it's valid, so, that shouldn't be an issue.

    Also
     
  2. IHart

    IHart Scruffy Nerf-Herder

    fullpath requires a leading slash. (in the value for scripts and primaryability/scripts is missing this)
    what version of starbound are you running? mine does not have a "luas" directory
     
    ImHereForTheMods likes this.
  3. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    You mean like, with : "scripts": ["luas/meleeweapon.lua"],

    it should be :

    "scripts": ["/luas/meleeweapon.lua"], ?

    I just made a file folder called luas in my mod as somewhere to put all the lua files I supposedly need, can I do it like that? I read somewhere the file names didn't matter, but I dunno.

    Im using starbound v1.2.2.
     
  4. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    So, I changed the .lua script parts to have a leading slash, like so:


    {
    "itemName": "aviantier1daggers",
    "price": 100,
    "maxStack": 1,
    "rarity": "Common",
    "description": "The Pecker. A tiny dagger that feels like a peck.",
    "shortdescription": "The Pecker",
    "tooltipKind": "sword",
    "category": "dagger",
    "twoHanded": false,
    "itemTags": ["weapon", "melee", "dagger"],
    "level": 1,
    "inventoryIcon": "icon/daggericon.png",

    "animation": "dagger.animation",
    "animationParts": {
    "blade": "aviantier1dagger.png",
    "handle": ""
    },



    "scripts": ["/luas/meleeweapon.lua"],


    "elementalType": "physical",

    "aimOffset": 0.0,



    "primaryAbility" : {
    "scripts" : ["/luas/meleeslash.lua"],
    "class" : "MeleeSlash",
    "fireTime" : 0.3,
    "baseDps" : 9,
    "damageConfig" : {
    "knockback" : 10
    },
    "stances" : {
    "idle" : {
    "armRotation" : -90,
    "weaponRotation" : -10,
    "weaponOffset" : [0.8, 2.25],

    "allowFlip" : true,
    "allowRotate" : true
    },
    "windup" : {
    "duration" : 0.05,
    "armRotation" : -20,
    "weaponRotation" : -20,
    "weaponOffset" : [0.8, 2.25],

    "allowFlip" : true,
    "allowRotate" : false
    },
    "fire" : {
    "duration" : 0.2,
    "armRotation" : -135,
    "weaponRotation" : 40,
    "weaponOffset" : [0.8, 2.5],

    "allowFlip" : true,
    "allowRotate" : false
    }
    }
    },



    "critChance": 2,
    "critBonus": 6,
    "builder": "/luas/buildunrandweapon.lua"

    }

    Still having the same problem, exact same error...

    [11:20:11.729] [Error] Could not instantiate item '[aviantier1daggers, 1, {}]'. (LuaException) Error code 2, [string "/luas/buildunrandweapon.lua"]:46: attempt to index a nil value (field 'primaryAttack')
    stack traceback:
    [C]: in metamethod '__index'
    [string "/luas/buildunrandweapon.lua"]:46: in function <[string "/luas/buildunrandweapon.lua"]:5>
    [11:20:32.105] [Error] Could not instantiate item '[aviantier1dagger, 1, {}]'. (ItemException) No such item 'aviantier1dagger'
    [11:20:38.875] [Error] Could not instantiate item '[aviantier1daggers, 1, {}]'. (LuaException) Error code 2, [string "/luas/buildunrandweapon.lua"]:46: attempt to index a nil value (field 'primaryAttack')

    Not sure what to make of it atm...

    Thanks in advance.
     
  5. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    Ok, so I actually just went and moved all the scripts to :

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

    and removed "builder": "/luas/buildunrandweapon.lua" all together.

    seems to work now, but want to know now... How to make it colorable? In 1.2.2?

    It had the script :


    "colorOptions" : [
    /* GREY */
    { "ffca8a" : "b5b5b5", "e0975c" : "808080", "a85636" : "555555", "6f2919" : "303030" },
    /* BLACK */
    { "ffca8a" : "838383", "e0975c" : "555555", "a85636" : "383838", "6f2919" : "151515" },
    /* GREY */
    { "ffca8a" : "b5b5b5", "e0975c" : "808080", "a85636" : "555555", "6f2919" : "303030" },
    /* WHITE */
    { "ffca8a" : "e6e6e6", "e0975c" : "b6b6b6", "a85636" : "7b7b7b", "6f2919" : "373737" },
    /* RED */
    { "ffca8a" : "f4988c", "e0975c" : "d93a3a", "a85636" : "932625", "6f2919" : "601119" },
    /* ORANGE */
    { "ffca8a" : "ffd495", "e0975c" : "ea9931", "a85636" : "af4e00", "6f2919" : "6e2900" },
    /* YELLOW */
    { "ffca8a" : "ffffa7", "e0975c" : "e2c344", "a85636" : "a46e06", "6f2919" : "642f00" },
    /* GREEN */
    { "ffca8a" : "b2e89d", "e0975c" : "51bd3b", "a85636" : "247824", "6f2919" : "144216" },
    /* BLUE */
    { "ffca8a" : "96cbe7", "e0975c" : "5588d4", "a85636" : "344495", "6f2919" : "1a1c51" },
    /* PURPLE */
    { "ffca8a" : "d29ce7", "e0975c" : "a451c4", "a85636" : "6a2284", "6f2919" : "320c40" },
    /* PINK */
    { "ffca8a" : "eab3db", "e0975c" : "d35eae", "a85636" : "97276d", "6f2919" : "59163f" },
    /* BROWN */
    { "ffca8a" : "ccae7c", "e0975c" : "a47844", "a85636" : "754c23", "6f2919" : "472b13" }
    ],

    I had removed that since it had been making JSON errors, but now I brought it back, and it doesn't seem to be, BUT, it ain't doing anything at all.
    Here's how I got it set up now...


    {
    "itemName": "aviantier1daggers",
    "price": 100,
    "maxStack": 1,
    "rarity": "Common",
    "description": "The Pecker. A tiny dagger that feels like a peck.",
    "shortdescription": "The Pecker",
    "tooltipKind": "sword",
    "category": "dagger",
    "twoHanded": false,
    "itemTags": ["weapon", "melee", "dagger"],
    "level": 1,
    "inventoryIcon": "daggericon.png",

    "animation": "dagger.animation",
    "animationParts": {
    "blade": "aviantier1dagger.png",
    "handle": ""
    },

    "colorOptions" : [
    /* GREY */
    { "ffca8a" : "b5b5b5", "e0975c" : "808080", "a85636" : "555555", "6f2919" : "303030" },
    /* BLACK */
    { "ffca8a" : "838383", "e0975c" : "555555", "a85636" : "383838", "6f2919" : "151515" },
    /* GREY */
    { "ffca8a" : "b5b5b5", "e0975c" : "808080", "a85636" : "555555", "6f2919" : "303030" },
    /* WHITE */
    { "ffca8a" : "e6e6e6", "e0975c" : "b6b6b6", "a85636" : "7b7b7b", "6f2919" : "373737" },
    /* RED */
    { "ffca8a" : "f4988c", "e0975c" : "d93a3a", "a85636" : "932625", "6f2919" : "601119" },
    /* ORANGE */
    { "ffca8a" : "ffd495", "e0975c" : "ea9931", "a85636" : "af4e00", "6f2919" : "6e2900" },
    /* YELLOW */
    { "ffca8a" : "ffffa7", "e0975c" : "e2c344", "a85636" : "a46e06", "6f2919" : "642f00" },
    /* GREEN */
    { "ffca8a" : "b2e89d", "e0975c" : "51bd3b", "a85636" : "247824", "6f2919" : "144216" },
    /* BLUE */
    { "ffca8a" : "96cbe7", "e0975c" : "5588d4", "a85636" : "344495", "6f2919" : "1a1c51" },
    /* PURPLE */
    { "ffca8a" : "d29ce7", "e0975c" : "a451c4", "a85636" : "6a2284", "6f2919" : "320c40" },
    /* PINK */
    { "ffca8a" : "eab3db", "e0975c" : "d35eae", "a85636" : "97276d", "6f2919" : "59163f" },
    /* BROWN */
    { "ffca8a" : "ccae7c", "e0975c" : "a47844", "a85636" : "754c23", "6f2919" : "472b13" }
    ],


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



    "elementalType": "physical",

    "aimOffset": 0.0,



    "primaryAbility" : {
    "scripts" : ["/items/active/weapons/melee/meleeslash.lua"],
    "class" : "MeleeSlash",
    "fireTime" : 0.3,
    "baseDps" : 9,
    "damageConfig" : {
    "knockback" : 10
    },
    "stances" : {
    "idle" : {
    "armRotation" : -90,
    "weaponRotation" : -10,
    "weaponOffset" : [0.8, 2.25],

    "allowFlip" : true,
    "allowRotate" : true
    },
    "windup" : {
    "duration" : 0.05,
    "armRotation" : -20,
    "weaponRotation" : -20,
    "weaponOffset" : [0.8, 2.25],

    "allowFlip" : true,
    "allowRotate" : false
    },
    "fire" : {
    "duration" : 0.2,
    "armRotation" : -135,
    "weaponRotation" : 40,
    "weaponOffset" : [0.8, 2.5],

    "allowFlip" : true,
    "allowRotate" : false
    }
    }
    },



    "critChance": 2,
    "critBonus": 6


    }

    So, is there a new script or something to use for coloring? For 1.2.2, or this is it? and if this is it, why doesn't it work?

    Also, in-game, it doesn't show damage per swing or rate of fire numbers? I tested it though, and it does 3 damage, so that part works fine.
    (Image): http://imgur.com/a/ySbYe

    Any help would be appreciated. =)
     
  6. IHart

    IHart Scruffy Nerf-Herder

    Instead of duplicating the scripts just refer to the ones that are already in the games files.
     
    ImHereForTheMods likes this.
  7. IHart

    IHart Scruffy Nerf-Herder

    I dont know anything about coloring. armors are dyeable, maybe start there.
    your builder is missing.
     
    ImHereForTheMods likes this.
  8. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    Aight, so, I don't need to have those luas in my mod's files?


    I'll have a look at some armor, see if I can reference something there.

    So that's what that does... I thought it just built randomized weapons (which mine is not) I'll try re-adding that, and hopefully it doesn't mess it up again.

    Thanks so much for the help so far!
     
  9. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    So, just an update, I tried what you said, and put a link back to the builder script thing, and the numbers show up now! Thanks so much!

    Maybe I'll just take my dyeable issues to another post since that is another issue.

    But thanks so much for the help!
     

Share This Page