Modding Help Custom spear not working in game.

Discussion in 'Starbound Modding' started by PlatinumFrog, May 11, 2016.

Tags:
  1. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

    I'm making a simple mod that adds a custom spear to the game in .activeitem format, but when I spawn it in game using /spawnitem, it gives me a perfectlygeneric item. Maybe the pathing is incorrect in my player.config.patch, or maybe the directory for my .activeitem and .png isn't right. Can someone help firgure this out?
     
  2. lazarus78

    lazarus78 The Waste of Time

    Remember to always check your logs for errors as to why things don't work.

    If you want help with it, you need to post your log. Can't help otherwise.
     
  3. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

    Oh yeah, sorry I was in a hurry for something. Here it is:
    Error: Could not instantiate item '[firespear, 1, {}]'. (MapException) Key 'handle' not found in Map::get()

    It's talking about this:
    Code:
        "animationParts" : {
            "blade" : "/items/active/FSWeapons/spearBlade.png",
            "handle" : "/items/active/FSWeapons/spearHandle.png"
        },
    Since it doesn't like me adding my custom handle to that part of the code, where would I put it in the following code?:
    Code:
    {
        "itemName" : "firespear",
        "price" : 170,
        "level" : 6,
        "maxStack" : 1,
        "rarity" : "legendary",
        "description" : "Sharp end towards enemy.",
        "shortdescription" : "Fire Spear",
        "tooltipKind" : "sword",
        "weaponType" : "Spear",
        "twoHanded" : true,
        "itemTags" : ["weapon","melee","spear"],
    
        "inventoryIcon" : "firespearicon.png",
    
        "animation" : "/items/active/weapons/melee/spear/tieredspear.animation",
        "animationParts" : {
            "blade" : "/items/active/FSWeapons/spearBlade.png",
            "handle" : "/items/active/FSWeapons/spearHandle.png"
        },
        "animationCustom" : {
            "sounds" : {
                "fire" : [ "/sfx/melee/swing_spear.ogg" ]
            }
        },
    
        "scripts" : ["/items/active/weapons/melee/spear/spear.lua"],
    
        "elementalType" : "fire",
    
        "aimOffset" : -1.0,
        "primaryAttack" : {
            "fireTime" : 0.8,
            "baseDps" : 10.0,
            "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
            }
        },
    
        "altAbilitySource" : "/items/active/weapons/melee/altabilities/spear/rocketspear/rocketspear.altability",
    
        "builder" : "/items/buildscripts/buildunrandweapon.lua"
    }
     
  4. lazarus78

    lazarus78 The Waste of Time

    The animation file you have set doesn't use a "handle" image. Change it from tieredspear to just spear.
     
  5. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

    Oh ok thank you.
     
  6. lazarus78

    lazarus78 The Waste of Time

    If that doesn't work, you may need to do some customizing of an animation file. Simple enough.
     
  7. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

    It did work. But when I use the alternate ability, The head of my spear turns yellow. There is nothing in the log that is out of the ordinary.
     
  8. lazarus78

    lazarus78 The Waste of Time

    could you pack it up and send it over so I can take a look?
     
  9. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

  10. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

    Another problem you might find is that when you've attacked enemy with the fire spear, but you don't kill it, and then you stop using the fire spear, the next time you use it on that same enemy, you cant attack the enemy with the fire spear. How ever you can finish the enemy off with other weapons.
     
  11. lazarus78

    lazarus78 The Waste of Time

    What game version are you using?
     
  12. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

    Glad Giraffe update 3
     
  13. lazarus78

    lazarus78 The Waste of Time

    Well i don't see anything inharently wrong with it. On the bad news, the format changes a little bit in the next version, so you will have to remake it then.
     
  14. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

    ok, then it is a good thing coding and pixel art are my favorite things!
     
  15. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

    Also, do you mean the next version as in cheerful giraffe?
     
  16. lazarus78

    lazarus78 The Waste of Time

    Yes. It's not too much of a change, but enough to matter.
     
  17. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

    What exactly is going to change?
     

Share This Page