Modding Help Trying to make a melee weapon. What am I doing wrong?

Discussion in 'Starbound Modding' started by Vinderex, Dec 26, 2016.

  1. Vinderex

    Vinderex Pangalactic Porcupine

    UPDATE! I've managed to figure it out on my own. Didn't have a config patch (or know I needed it. :rofl:)


    Hello everyone! I'm pretty new to modding, and this is my first time attempting a weapon that's more than just an appearance change or small stat adjustment. I've run into a wall now though, and need help figuring out what I'm missing or doing wrong.

    Test files can be found here: https://www.dropbox.com/s/18z5mvigpa5rzkf/testrapiers.rar?dl=0 and I've also posted the code below.
    The weapon's called Broken Epee, and it can be crafted with just a few pixels.

    Now, here's what I'm wanting to happen:
    • One handed
    • Attacks forward only. Not aimable.
    • Idle arm position slightly forward, with the weapon pointing diagonally forward, similar the standard en garde / on guard stance in fencing.
    • The weapon should be capable of a 6 hit combo: thrust, slash, low thrust, high thrust, slash, thrust. The last hit in the combo should deal the most damage, while the slashes should be the least damaging.
    Now, what's actually happening... It's just stuck in this position, not doing anything at all.
    rapierBlooper.png

    And here's some code...
    Code:
    {
      "globalTagDefaults" : {
        "paletteSwaps" : ""
      },
    
      "animatedParts" : {
        "stateTypes" : {
          "swoosh" : {
            "default" : "idle",
            "states" : {
              "idle" : {
              },
              "fire" : {
                "frames" : 3,
                "cycle" : 0.1,
                "mode" : "transition",
                "transition" : "idle"
              },
              "fire2" : {
                "frames" : 3,
                "cycle" : 0.1,
                "mode" : "transition",
                "transition" : "idle"
              },
              "fire3" : {
                "frames" : 3,
                "cycle" : 0.1,
                "mode" : "transition",
                "transition" : "idle"
              },
              "fire4" : {
                "frames" : 3,
                "cycle" : 0.1,
                "mode" : "transition",
                "transition" : "idle"
              },
              "fire5" : {
                "frames" : 3,
                "cycle" : 0.1,
                "mode" : "transition",
                "transition" : "idle"
              },
              "fire6" : {
                "frames" : 3,
                "cycle" : 0.1,
                "mode" : "transition",
                "transition" : "idle"
              }
            }
          }
        },
    
        "parts" : {
          "blade" : {
            "properties" : {
              "zLevel" : 0,
              "centered" : true,
              "image" : "<partImage><paletteSwaps>?<directives>?<bladeDirectives>",
              "offset" : [0, 1.875],
              "transformationGroups" : ["weapon"],
              "rotationCenter" : [0, 0],
              "damageArea" : [ [-0.7, -1.0], [-0.7, 2.5], [0.5, 2.5], [0.5, -1.0] ]
            }
          },
          "handle" : {
            "properties" : {
              "zLevel" : 1,
              "centered" : true,
              "image" : "<partImage><paletteSwaps>?<directives>",
              "offset" : [0, 1.875],
              "transformationGroups" : ["weapon"],
              "rotationCenter" : [0, 0]
            }
          },
          "swoosh" : {
            "properties" : {
              "zLevel" : -1,
              "centered" : true,
              "transformationGroups" : ["swoosh"],
              "rotationCenter" : [0, 0]
            },
    
            "partStates" : {
              "swoosh" : {
                "idle" : {
                  "properties" : {
                    "image" : ""
                  }
                },
                "fire" : {
                  "properties" : {
                    "image" : "/items/active/weapons/melee/broadsword/swoosh3/<elementalType>swoosh.png:<frame>",
                    "offset" : [3.5, 0],
                    "damageArea" : [[-4.75, 1.5], [3, 1], [3, -1], [-4.75, -1.5]]
                  }
                },
                "fire2" : {
                  "properties" : {
                    "image" : "/items/active/weapons/melee/broadsword/swoosh2/<elementalType>swoosh.png:<frame>",
                    "offset" : [5.0, 1.0],
                    "damageArea" : [[-4, 1], [2.5, 1], [2.5, -2], [-4, -2]]
                  }
                },
                "fire3" : {
                  "properties" : {
                    "image" : "/items/active/weapons/melee/broadsword/swoosh3/<elementalType>swoosh.png:<frame>",
                    "offset" : [3.5, 0],
                    "damageArea" : [[-4.75, 1.5], [3, 1], [3, -1], [-4.75, -1.5]]
                  }
                },
                "fire4" : {
                  "properties" : {
                    "image" : "/items/active/weapons/melee/broadsword/swoosh3/<elementalType>swoosh.png:<frame>",
                    "offset" : [3.5, 0],
                    "damageArea" : [[-4.75, 1.5], [3, 1], [3, -1], [-4.75, -1.5]]
                  }
                },
                "fire5" : {
                  "properties" : {
                    "image" : "/items/active/weapons/melee/broadsword/swoosh2/<elementalType>swoosh.png:<frame>",
                    "offset" : [5.0, 1.0],
                    "damageArea" : [[-4, 1], [2.5, 1], [2.5, -2], [-4, -2]]
                  }
                },
                "fire6" : {
                  "properties" : {
                    "image" : "/items/active/weapons/melee/broadsword/swoosh3/<elementalType>swoosh.png:<frame>",
                    "offset" : [3.5, 0],
                    "damageArea" : [[-4.75, 1.5], [3, 1], [3, -1], [-4.75, -1.5]]
                  }
                }
              }
            }
          }
        }
      },
    
      "transformationGroups" : {
        "weapon" : {},
        "swoosh" : {}
      },
    
      "particleEmitters" : {
        "physicalswoosh" : {
          "active" : false,
          "transformationGroups" : ["swoosh"],
          "emissionRate" : 1,
          "burstCount" : 1,
          "particles" : []
        },
        "fireswoosh" : {
          "active" : false,
          "transformationGroups" : ["swoosh"],
          "emissionRate" : 50,
          "burstCount" : 4,
          "particles" : [
            { "particle" : "fireswoosh1"},
            { "particle" : "fireswoosh2"},
            { "particle" : "fireswoosh3"}
          ]
        },
        "electricswoosh" : {
          "active" : false,
          "transformationGroups" : ["swoosh"],
          "emissionRate" : 50,
          "burstCount" : 3,
          "particles" : [
            { "particle" : "electricswoosh1"},
            { "particle" : "electricswoosh2"},
            { "particle" : "electricswoosh2"}
          ]
        },
        "poisonswoosh" : {
          "active" : false,
          "transformationGroups" : ["swoosh"],
          "emissionRate" : 50,
          "burstCount" : 3,
          "particles" : [
            { "particle" : "poisonswoosh1"},
            { "particle" : "poisonswoosh2"},
            { "particle" : "fireswoosh2"}
          ]
        },
        "iceswoosh" : {
          "active" : false,
          "transformationGroups" : ["swoosh"],
          "emissionRate" : 50,
          "burstCount" : 3,
          "particles" : [
            { "particle" : "iceswoosh1"},
            { "particle" : "iceswoosh2"},
            { "particle" : "iceswoosh3"}
          ]
        }
      },
    
      "sounds" : {
        "fire" : [ ],
        "fire2" : [ ],
        "fire3" : [ ],
        "fire4" : [ ],
        "fire5" : [ ],
        "fire6" : [ ]
      }
    }
    

    rapiercombo.weaponability
    Code:
    {
      "animationParts" : { },
      "animationCustom" : {
        "sounds" : {
          "fire" : [ "/sfx/melee/swing_spear.ogg" ],
          "fire2" : [ "/sfx/melee/swing_shortsword.ogg" ],
          "fire3" : [ "/sfx/melee/swing_spear.ogg" ],
          "fire4" : [ "/sfx/melee/swing_shortsword.ogg" ],
          "fire5" : [ "/sfx/melee/swing_broadsword.ogg" ],
          "fire6" : [ "/sfx/melee/swing_spear.ogg" ]
        }
      },
    
      "ability" : {
        "name" : "Combo Slash",
        "type" : "broadswordcombo",
        "scripts" : ["/items/active/weapons/melee/meleecombo.lua"],
        "class" : "MeleeCombo",
    
        "comboSteps" : 6,
    
        "flashTime" : 0.15,
        "flashDirectives" : "fade=FFFFFFFF=0.15",
    
        "swooshOffsetRegions" : [
          [0.75, 0.0, 4.25, 5.0],
          [3.0, -0.5, 6.5, 2.0],
          [1.5, -1.0, 5.5, 1.0]
        ],
    
        // cooldown time multiplier for steps after the first, compounded per combo step
        "comboSpeedFactor" : 0.7,
    
        "edgeTriggerGrace" : 0.25,
    
        "fireTime" : 0.8,
        "baseDps" : 11.5,
    
        "damageConfig" : {
          "damageSourceKind" : "spear",
          "statusEffects" : [ ],
          "knockbackMode" : "facing",
          "timeout" : 0.5
        },
        "stepDamageConfig" : [
          {
            "baseDamageFactor" : 1.0,
            "knockback" : 10
          },
          {
            "baseDamageFactor" : 0.6,
            "knockback" : 5
          },
          {
            "baseDamageFactor" : 0.8,
            "knockback" : 7
          },{
            "baseDamageFactor" : 0.8,
            "knockback" : 7
          },
          {
            "baseDamageFactor" : 0.6,
            "knockback" : 5
          },
          {
            "baseDamageFactor" : 1.5,
            "knockback" : 25
          }
        ],
    
        "stances" : {
          "idle" : {
            "armRotation" : -45,
            "weaponRotation" : 30,
            "allowRotate" : false,
            "allowFlip" : true
          },
          "windup1" : {
            "duration" : 0.15,
            "armRotation" : -150,
            "weaponRotation" : 55,
            "twoHanded" : false,
    
            "allowRotate" : false,
            "allowFlip" : true
          },
          "fire1" : {
            "duration" : 0.15,
            "armRotation" : 0,
            "weaponRotation" : -90,
            "twoHanded" : false,
    
            "allowRotate" : false,
            "allowFlip" : true
          },
          "wait1" : {
            "duration" : 0.1,
            "armRotation" : -15,
            "weaponRotation" : -75,
            "allowRotate" : false,
            "allowFlip" : true,
            "twoHanded" : true
          },
          "windup2" : {
            "duration" : 0.15,
            "armRotation" : -15,
            "weaponRotation" : -60,
            "weaponOffset" : [0, 0],
            "twoHanded" : true,
            "allowFlip" : true,
            "allowRotate" : false
          },
          "fire2" : {
            "duration" : 0.2,
            "armRotation" : -150,
            "weaponRotation" : 55,
            "weaponOffset" : [0, 0],
            "twoHanded" : true,
            "allowFlip" : true,
            "allowRotate" : false
          },
          "wait2" : {
            "duration" : 0.2,
            "armRotation" : -150,
            "weaponRotation" : 55,
            "weaponOffset" : [0, 0],
            "allowRotate" : false,
            "allowFlip" : true,
            "twoHanded" : true
          },
          "windup3" : {
            "duration" : 0.15,
            "armRotation" : -150,
            "weaponRotation" : 55,
            "twoHanded" : false,
    
            "allowRotate" : false,
            "allowFlip" : true
          },
          "fire3" : {
            "duration" : 0.15,
            "armRotation" : -10,
            "weaponRotation" : -90,
            "twoHanded" : false,
    
            "allowRotate" : false,
            "allowFlip" : true
          },
          "wait3" : {
            "duration" : 0.1,
            "armRotation" : -15,
            "weaponRotation" : -75,
            "allowRotate" : false,
            "allowFlip" : true,
            "twoHanded" : true
          },
          "windup4" : {
            "duration" : 0.15,
            "armRotation" : -150,
            "weaponRotation" : 55,
            "twoHanded" : false,
    
            "allowRotate" : false,
            "allowFlip" : true
          },
          "fire4" : {
            "duration" : 0.15,
            "armRotation" : 10,
            "weaponRotation" : -90,
            "twoHanded" : false,
    
            "allowRotate" : false,
            "allowFlip" : true
          },
          "wait4" : {
            "duration" : 0.1,
            "armRotation" : -5,
            "weaponRotation" : -75,
            "allowRotate" : false,
            "allowFlip" : true,
            "twoHanded" : true
          },
          "windup5" : {
            "duration" : 0.15,
            "armRotation" : -15,
            "weaponRotation" : -60,
            "weaponOffset" : [0, 0],
            "twoHanded" : true,
            "allowFlip" : true,
            "allowRotate" : false
          },
          "fire5" : {
            "duration" : 0.2,
            "armRotation" : -180,
            "weaponRotation" : 55,
            "weaponOffset" : [0, 0],
            "twoHanded" : true,
            "allowFlip" : true,
            "allowRotate" : false
          },
          "wait5" : {
            "duration" : 0.2,
            "armRotation" : -180,
            "weaponRotation" : 55,
            "weaponOffset" : [0, 0],
            "allowRotate" : false,
            "allowFlip" : true,
            "twoHanded" : true
          },
          "windup6" : {
            "duration" : 0.15,
            "armRotation" : -150,
            "weaponRotation" : 55,
            "twoHanded" : true,
    
            "allowRotate" : false,
            "allowFlip" : true
          },
          "fire6" : {
            "duration" : 0.5,
            "armRotation" : 0,
            "weaponRotation" : -90,
            "twoHanded" : true,
    
            "allowRotate" : false,
            "allowFlip" : true
          }
        }
      }
    }
    

    starterrapier.activeitem
    Code:
    {
      "itemName" : "starterrapier",
      "price" : 500,
      "level" : 1,
      "maxStack" : 1,
      "rarity" : "Common",
      "description" : "This epee has seen better days...",
      "shortdescription" : "Broken Epee",
      "tooltipKind" : "sword",
      "category" : "shortsword",
      "twoHanded" : false,
      "itemTags" : ["weapon", "melee", "shortsword"],
    
      "inventoryIcon" : "tier0rapier.png",
    
      "animation" : "comborapier.animation",
      "animationParts" : {
        "handle": "",
        "blade" : "tier0rapier.png"
      },
      "animationCustom" : { },
    
      "scripts" : ["/items/active/weapons/melee/meleeweapon.lua"],
    
      "elementalType" : "physical",
    
      "primaryAbilityType" : "rapiercombo",
      "primaryAbility" : {
        "fireTime" : 0.5,
        "baseDps" : 7.0
      },
    
      "builder" : "/items/buildscripts/buildunrandweapon.lua"
    }
    


    Thanks a lot in advance to anyone willing to help! ^.^
     
    Last edited: Dec 26, 2016
  2. IHart

    IHart Scruffy Nerf-Herder

    i encountered the same issue and solution, felt pretty silly.
     

Share This Page