Modding Help How to set weapon hitbox

Discussion in 'Starbound Modding' started by DraikNova, Jul 27, 2017.

  1. DraikNova

    DraikNova Spaceman Spiff

    I'm trying to make a very large weapon, a hammer to be precise. How do I set the hitbox to be larger than that of a default hammer? Looking at the Solus Katana, it seems to be part of the animation, but is there an easier way to define the hitbox than making an entire separate animation file for it?
     
  2. lazarus78

    lazarus78 The Waste of Time

    They have an animation file associated with weapons. In it, you can find the part for "damageArea" which defined the physical hit box, and hammers also have "groundImpactPoly", which is self explanitory.

    It also looks like weapons can have their own self defined "animationParts", which most likely can be set up the same way as the animation file, so you can have:
    Code:
    "animationParts" : {
            "parts" : {
                "blade" : {
                    "properties" : {
                        "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] ]
                    }
                }
            }
        },
    
    Would need testing though. I don't know if it will override the animation file, or if the animation file will override the weapon config. The point of the animation file was to not have to define all the same information in every single item that would otherwise have the same animation settings.
     
    MetaFace likes this.
  3. MetaFace

    MetaFace Guest

    Hitboxes are completely defined in the animation file for the weapon, first number is of course the x value and second is the y. The points I believe need to be defined clockwise, and of course in order. The x and y however are NOT actually along the correct axis, they are based off weapon rotation in the actual weapon file, I know this from spending and hour or so adjusting a hitbox for an oversized sword of mine.

    I don't have my computer on me so I can't give you a good explanation right now. As soon as I have my laptop somewhere with wifi I'll give you the most fantastic explanation I can.
     
  4. DraikNova

    DraikNova Spaceman Spiff

    That just causes Starbound to crash. Guess I'll just try copying the entire animation file of the randomly generated hammers and changing things as appropriate instead. Too bad that there's no way to just change that single value.
     
  5. lazarus78

    lazarus78 The Waste of Time

    Did you try to see why it crashes?

    The way they are set up now is actually more efficient. Why define the animation many times when you can just define it once and make everything reference that one animation? If you want something different, then you need to define it yourself.
     

Share This Page