Modding Help Hammer doesn't hit ground? (Solved)

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

  1. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    So, I'm now working on bringing back the racial hammers, but, small problem, when I use it, it doesn't actually hit the ground. Which is sorta weird.

    Image : https://imgur.com/a/kcpWp

    I don't know why this is happening, but how do I fix this?

    Here is my .activeitem file.

    Code:
    {
        "itemName": "aviantier1hammerbasic",
        "price": 150,
        "maxStack": 1,
        "rarity": "Common",
        "description": "The Carver. A sword perfect for carving meat.",
        "shortdescription": "The Carver",
        "tooltipKind": "sword",
        "category": "hammer",
        "twoHanded": true,
        "itemTags": ["weapon", "melee", "shortsword"],
        "level": 1,
        "inventoryIcon": "hammericon1.png",
    
        "animation": "hammer.animation",
        "animationParts": {
            "blade": "aviantier1hammer.png",
            "handle": ""
        },
       
          "animationCustom" : {
        "sounds" : {
          "fire" : [ "/sfx/melee/swing_hammer.ogg" ]
        }
      },
    
    
    
    
      "scripts" : ["/items/active/weapons/melee/meleeweapon.lua"],
    
    
    
        "elementalType": "physical",
    
        "aimOffset": 0.0,
       
      "colorOptions" : [
        /* GREY */
        { "E0975C" : "B5B5B5", "A85636" : "5B5B5B" },
        /* BLACK */
        { "E0975C" : "555555", "A85636" : "333333" },
        /* WHITE */
        { "E0975C" : "EAEAEA", "A85636" : "CCCCCC" }
    
      ],   
       
       
       
       
       
      "primaryAbilityType" : "hammersmash",
      "primaryAbility" : {
        "fireTime" : 1.2,
        "baseDps" : 11.5,
        "damageConfig" : {
          "knockback" : 16,
          "statusEffects" : [ "bleedingshort" ]
        }
      },
     
     
        "baseWeaponRotation" : 10,
      "stances" : {
        "idle" : {
          "armRotation" : -90,
          "weaponRotation" : -10,
          "weaponOffset" : [-2.9, 2.0],
    
          "allowRotate" : false,
          "allowFlip" : true
        },
        "windup" : {
          "duration" : 0.8,
          "armRotation" : 90,
          "weaponRotation" : -10,
          "twoHanded" : true,
          "weaponOffset" : [0, 0],
    
          "allowRotate" : false,
          "allowFlip" : true,
    
          // Windup animation
          "idleHammerAngle" : -20,
          "windupHammerAngle" : 0,
          "dropHammerAngle" : 90,
          "bounceHammerAngle" : 55,
         
          "minWindup" : 0.7,
          "windupBaseAngle" : -90,
          "windupAngleRange" : 140
        },
        "preslash" : {
          "duration" : 0.025,
          "armRotation" : 55,
          "weaponRotation" : -45,
          "twoHanded" : true,
          "weaponOffset" : [2.0, 2.0],
    
          "allowRotate" : false,
          "allowFlip" : false
        },
        "fire" : {
          "duration" : 0.4,
          "armRotation" : -45,
          "weaponRotation" : -175,
          "twoHanded" : true,
          "smashTimer" : 1.5,
          "weaponOffset" : [1.0, 3.0],
    
          "allowRotate" : false,
          "allowFlip" : false
        }
          },
    
        "altAbilityType" : "physicalshockwave",
    
      "builder" : "/items/buildscripts/buildunrandweapon.lua",
            "critChance": 2,
            "critBonus": 6
           
           
    
    }
    So, if anyone can point me towards how to fix this, I would very much appreciate it, thanks in advance!
     
  2. Cyel

    Cyel Scruffy Nerf-Herder

    Would it be because you took the old hammer file, that were made before the hammer / combat system rework? Or maybe your aviantier1hammer.png image doesn't follow the usual hammer shapes? Since you didn't provided your aviantier1hammer.png, I couldn't really play with it, but I believe it's "just" a weaponRotation / armRotation value error?
     
    ImHereForTheMods likes this.
  3. MetaFace

    MetaFace Guest

    It's a good point. Have you looked at a hammer and observed it closely? This could be hit box size or really and number of things, like the most probably cause is something in the weapon's animation file. May we see the animation file?
     
  4. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    You could be right, I may have used the old hammer file, is that an issue? I was thinking it could have been. One fix I was contemplating was moving the image down / around in the png file for the hammer.

    Also, that whole base weapon rotation thing doesn't actually seem to do anything, I removed it, and nothing really different happened. So dunno bout that.

    I will try playing around with the hammer png file, see if that helps, thanks for the help / reply! =)
     

    Attached Files:

  5. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    Aight, if you wanna see the animation file, here it is :


    Code:
    {
      "globalTagDefaults" : {
        "paletteSwaps" : ""
      },
    
      "animatedParts" : {
        "stateTypes" : {
          "swoosh" : {
            "default" : "idle",
            "states" : {
              "idle" : {
              },
              "fire" : {
                "frames" : 3,
                "cycle" : 0.07,
                "mode" : "transition",
                "transition" : "idle"
              }
            }
          }
        },
    
        "parts" : {
          "blade" : {
            "properties" : {
              "centered" : true,
              "zLevel" : 1,
              "image" : "<partImage><paletteSwaps><directives>",
              "transformationGroups" : ["weapon"],
              "rotationCenter" : [0, 0],
              "damageArea" : [[-1, 0.25], [-1, 1.5], [1.5, 1.75], [1.5, 0.0]],
              "groundImpactPoly" : [ [1, 1.75],  [1, 0.0],  [2, 0.0],  [2, 1.75] ]
            }
          },
          "handle" : {
            "properties" : {
              "centered" : true,
              "image" : "<partImage><paletteSwaps><directives>",
              "offset" : [0, 0],
              "transformationGroups" : ["weapon"],
              "rotationCenter" : [0, 0]
            }
          },
          "swoosh" : {
            "properties" : {
              "zLevel" : -1,
              "centered" : true,
              "offset" : [-2.0, 1.5],
              "transformationGroups" : ["swoosh"],
              "rotationCenter" : [0, 0]
            },
    
            "partStates" : {
              "swoosh" : {
                "idle" : {
                  "properties" : {
                    "image" : ""
                  }
                },
                "fire" : {
                  "properties" : {
                    "image" : "/items/active/weapons/melee/hammer/swoosh/<elementalType>swoosh.png:<frame>",
                    "damageArea" : [[-3.5, 2], [-2.5, 3], [1, 3], [3, 1.75], [4, -0.25], [4, -2.25], [3, -3.25], [0, -2.5]]
                  }
                }
              }
            }
          }
        }
      },
    
      "transformationGroups" : {
        "weapon" : {},
        "swoosh" : {}
      },
    
      "particleEmitters" : {
        "physicalswoosh" : {
          "active" : false,
          "transformationGroups" : ["swoosh"],
          "emissionRate" : 50,
          "offsetRegion" : [-2.0, 0.0, 1.5, 5.0],
          "particles" : [
          ]
        },
        "fireswoosh" : {
          "active" : false,
          "transformationGroups" : ["swoosh"],
          "emissionRate" : 50,
          "offsetRegion" : [-2.0, 0.0, 1.5, 5.0],
          "particles" : [
            { "particle" : "fireswoosh1"},
            { "particle" : "fireswoosh2"},
            { "particle" : "fireswoosh3"},
            { "particle" : "fireswoosh1"},
            { "particle" : "fireswoosh2"},
            { "particle" : "fireswoosh3"}
          ]
        },
        "electricswoosh" : {
          "active" : false,
          "transformationGroups" : ["swoosh"],
          "emissionRate" : 50,
          "offsetRegion" : [-2.0, 0.0, 1.5, 5.0],
          "particles" : [
            { "particle" : "electricswoosh1"},
            { "particle" : "electricswoosh2"},
            { "particle" : "electricswoosh2"}
          ]
        },
        "poisonswoosh" : {
          "active" : false,
          "transformationGroups" : ["swoosh"],
          "emissionRate" : 50,
          "offsetRegion" : [-2.0, 0.0, 1.5, 5.0],
          "particles" : [
            { "particle" : "poisonswoosh1"},
            { "particle" : "poisonswoosh2"},
            { "particle" : "fireswoosh2"},
            { "particle" : "poisonswoosh1"},
            { "particle" : "poisonswoosh2"},
            { "particle" : "fireswoosh2"}
          ]
        },
        "iceswoosh" : {
          "active" : false,
          "transformationGroups" : ["swoosh"],
          "emissionRate" : 50,
          "offsetRegion" : [-2.0, 0.0, 1.5, 5.0],
          "particles" : [
            { "particle" : "iceswoosh1"},
            { "particle" : "iceswoosh2"},
            { "particle" : "iceswoosh3"},
            { "particle" : "iceswoosh1"},
            { "particle" : "iceswoosh2"},
            { "particle" : "iceswoosh3"}
          ]
        },
        "groundImpact" : {
          "transformationGroups" : ["weapon"],
          "particles" : [
            {
              "count" : 1,
              "particle" : {
                "type" : "animated",
                "mode" : "LoopForever",
                "animation" : "/animations/jumpsmoke/jumpsmoke.animation",
                "fade" : 0.9,
                "destructionAction" : "shrink",
                "destructionTime" : 0.4,
                "position" : [1.0, 0.75],
                "offsetRegion" : [0, 0, 0, 0],
                "initialVelocity" : [0, 0],
                "finalVelocity" : [0, 0],
                "approach" : [5, 5],
                "timeToLive" : 0.4
              }
            }
          ]
        }
      },
    
      "sounds" : {
        "fire" : [ ],
        "groundImpact" : [ "/sfx/melee/hammer_hit_ground3.ogg", "/sfx/melee/hammer_hit_ground4.ogg" ]
      }
    }
    
    Was pretty sure I took it from 1.2.2, but could have been the beta version of the hammer.animation.
     
  6. MetaFace

    MetaFace Guest

    So is this animation based off an old weapon as well? Because the issue might be right in front of you, I'd look at a hammer that is in game and compare the animation files. (I personally hate that most issues are due to something in the animation file, which sucks for people who are getting started because it isn't something to be taken lightly.) I'd compare right now, but I don't have any comparison files right now.
     
    ImHereForTheMods likes this.
  7. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    To be honest, I don't know, what I do know is that I'm using the hammer.animation from 1.2.2 (assets\_unpacked\items\active\weapons\melee\hammer\hammer.animation)
    I am using an old hammer, tiered avian hammer, (brick on a stick), and trying to bring it back to work with 1.2.2, and it is from, some beta version, before combat update I would presume..

    I have compared to some hammers from fracking universe for reference, and even copied the layout, to use.
    I can't really see in the files for 1.2.2 that there is really any hammer to reference, as they are tiered, and not unique.

    So, that's what I know.

    Thanks for the help so far! =)
     
  8. MetaFace

    MetaFace Guest

    The tungsten hammer is a "unique" (as in non-procedure) hammer, it may provide something, may provide some insight into hammers, because I don't understand randomly generated weapon's layout I usually find the boss/unique/non-procedure weapons and observe/copy all the little silly things I need.

    Other than that I'm not too sure about any other hammers that'd help at all. Seems a little lacking really, like the devs need to add some unique hammers.
     
    ImHereForTheMods likes this.
  9. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    Hmm, I'll have a look at that thanks! Same here on procedural weapons...

    I am totally with you on there not being enough unique hammers, which is part of why I'm doing this, hah.
    Plus I really like the tiered racial stuff.

    May have a go at editing the .animation file, and see if that does anything.
    Just like, changing some of the offsets, and stuff.

    Thanks again!
     
    MetaFace likes this.
  10. IHart

    IHart Scruffy Nerf-Herder

    In your case it's actually the ability config not the animation file determining where the hammer goes. Look at the fields defined in "fire"
    Code:
        "fire" : {
          "duration" : 0.4,
          "armRotation" : -45,
          "weaponRotation" : -175,
          "twoHanded" : true,
          "smashTimer" : 1.5,
          "weaponOffset" : [1.0, 3.0],
    
          "allowRotate" : false,
          "allowFlip" : false
        }
    editing the arm rotation, weapon rotation and weapon offset will change where the hammer winds up at the end of its swing.
    To understand these values face your character right. Arm rotation is in degrees counter-clockwise from the horizontal, with the center of rotation at the shoulder and 0 degrees being the arm outstretched directly in front of the character. Weapon rotation is in degrees counter-clockwise from the angle of the arm at any moment with the center of rotation at the hand and 0 being the weapon facing directly at the shoulder. Weapon offset is a shift measured in in blocks, so a magnitude of 1 translates to an 8 pixel shift. This value is read as [ x , y ] but not the x/y of the character, rather the x/y of the weapon when upright. So in your idle stance with the weapon horizontal a posiitive x shift would translate to a downward movement and a positive y shift would translate to a right-ward movement.
     
  11. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    Aight, I'll have a go at changing that then. If 1 is an 8 pixel shift, that might explain why it looked like when I changed it it did nothing.
    Thanks for the help!
     
  12. IHart

    IHart Scruffy Nerf-Herder

  13. IHart

    IHart Scruffy Nerf-Herder

    8 game-pixels not screen pixels.
     
  14. MetaFace

    MetaFace Guest

    I can't even remember the standard arm rotation... This definitely is something I always overlook, in that case the same assets can help, but I feel like this is a small... one by one edit, testing values, restarting until it is right.
     
  15. IHart

    IHart Scruffy Nerf-Herder

    Do not fear, it quickly becomes very intuitive.
     
  16. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    Well, I have changed it up..
    "fire" : {
    "duration" : 0.4,
    "armRotation" : -45,
    "weaponRotation" : -175,
    "twoHanded" : true,
    "smashTimer" : 1.5,
    "weaponOffset" : [10.0, 10.0],

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

    but when I go in-game, even with extreme values like 10, nothing seems to have changed.

    Still doesn't hit the ground, so am confused.
     
  17. MetaFace

    MetaFace Guest

    I remember having to spend a lengthy period on adjusting arm and item rotation, fiddle until you understand what is what, then you can fix just about anything wrong.
     
  18. IHart

    IHart Scruffy Nerf-Herder

    this means there is a different error in your file, i'm gunna see if i cant find it
     
  19. MetaFace

    MetaFace Guest

    Did you remember to do the basics?
    1.) save files
    2.) restart game
    3.)edit and repeat

    plus it seems you didn't touch weapon rotation, offset alone won't help.

    Edit:
    still wishing I was on my computer with all my files, would have looked at them to find a quicker solution.
     
  20. ImHereForTheMods

    ImHereForTheMods Cosmic Narwhal

    Yes. I did that. Do you have to re-craft the hammer each time? caus I haven't done that.

    Also, I've now changed the rotations to something ridiculous, and it's exactly the same. Which is weird.

    Code:
    "fire" : {
          "duration" : 0.4,
          "armRotation" : -180,
          "weaponRotation" : -1,
          "twoHanded" : true,
          "smashTimer" : 1.5,
          "weaponOffset" : [10.0, 10.0],
    
          "allowRotate" : false,
          "allowFlip" : false
        }
    Thanks for the help though, and, yes, I understand.

    Here is my .activeitem file again :
    Code:
    {
        "itemName": "aviantier1hammerbasic",
        "price": 150,
        "maxStack": 1,
        "rarity": "Common",
        "description": "The Carver. A sword perfect for carving meat.",
        "shortdescription": "The Carver",
        "tooltipKind": "sword",
        "category": "hammer",
        "twoHanded": true,
        "itemTags": ["weapon", "melee", "shortsword"],
        "level": 1,
        "inventoryIcon": "hammericon1.png",
    
        "animation": "hammer.animation",
        "animationParts": {
            "blade": "aviantier1hammer.png",
            "handle": ""
        },
       
          "animationCustom" : {
        "sounds" : {
          "fire" : [ "/sfx/melee/swing_hammer.ogg" ]
        }
      },
    
    
    
    
      "scripts" : ["/items/active/weapons/melee/meleeweapon.lua"],
    
    
    
        "elementalType": "physical",
    
        "aimOffset": 0.0,
       
      "colorOptions" : [
        /* GREY */
        { "E0975C" : "B5B5B5", "A85636" : "5B5B5B" },
        /* BLACK */
        { "E0975C" : "555555", "A85636" : "333333" },
        /* WHITE */
        { "E0975C" : "EAEAEA", "A85636" : "CCCCCC" }
    
      ],   
       
       
       
       
       
      "primaryAbilityType" : "hammersmash",
      "primaryAbility" : {
        "fireTime" : 1.2,
        "baseDps" : 11.5,
        "damageConfig" : {
          "knockback" : 16,
          "statusEffects" : [ "bleedingshort" ]
        }
      },
        "baseWeaponRotation" : 10,
      "stances" : {
        "idle" : {
          "armRotation" : -90,
          "weaponRotation" : -10,
          "weaponOffset" : [-2.9, 2.0],
    
          "allowRotate" : false,
          "allowFlip" : true
        },
        "windup" : {
          "duration" : 1.8,
          "armRotation" : 90,
          "weaponRotation" : -10,
          "twoHanded" : true,
          "weaponOffset" : [0, 0],
    
          "allowRotate" : false,
          "allowFlip" : true,
    
          // Windup animation
          "idleHammerAngle" : -20,
          "windupHammerAngle" : 0,
          "dropHammerAngle" : 90,
          "bounceHammerAngle" : 55,
         
          "minWindup" : 0.7,
          "windupBaseAngle" : -90,
          "windupAngleRange" : 140
        },
        "preslash" : {
          "duration" : 0.025,
          "armRotation" : 55,
          "weaponRotation" : -45,
          "twoHanded" : true,
          "weaponOffset" : [2.0, 2.0],
    
          "allowRotate" : false,
          "allowFlip" : false
        },
        "fire" : {
          "duration" : 0.4,
          "armRotation" : -180,
          "weaponRotation" : -1,
          "twoHanded" : true,
          "smashTimer" : 1.5,
          "weaponOffset" : [10.0, 10.0],
    
          "allowRotate" : false,
          "allowFlip" : false
        }
          },
    
        "altAbilityType" : "physicalshockwave",
    
      "builder" : "/items/buildscripts/buildunrandweapon.lua",
            "critChance": 2,
            "critBonus": 6
           
           
    
    }
     

Share This Page