Hello, this is my first post on this forum and I'm new to modding. So far, I've already been able to make crafting stations, throwables, and one melee weapon. I wanted to know if certain weapon abilities/animations only work on weapons in their class. For example, can a hammer use the spin ability for spears? Can spears use a hammer's animations? Anything would be helpful, thanks!
You can mix and match most of them as you like. Only thing I've heard (emphasis on heard, I haven't tried it myself so don't know for sure) is that Staff and Wand abilities tend to not work on other weapons.
I believe the general concept is that the abilities rely on code present in the "script" value chosen for the weapon. Here is the line from a broadsword Code: "scripts" : ["/items/active/weapons/melee/meleeweapon.lua"] a rocket launcher: Code: "scripts" : ["/items/active/weapons/ranged/gun.lua"] and a wand Code: "scripts" : ["/items/active/weapons/staff/staff.lua"] Since most melee weapons use this same script any melee abilities should be compatible, same within ranged weapons, and same within the staff types, but not across these categories. With a well placed custom Lua script you could change the behavior of your weapon to literally anything you want, but this is the behavior limitations in place when just utilizing JSON.
@IHart is right, you cannot mix and match different class abilities, putting gun/staff abilities on a melee weapon will cause game errors, resulting in either the weapon not loading at all or the game instantly crashing at startup. In order to make the spin ability work on a hammer you'd probably want to grab the animation file for a spear that uses the spin and transfer the values on its own animation file very carefully over to your weapon's animation file. I had issues with making a weapon like this before (because I was kind of learning this on my own), I made a sword that has both the axe's and broadsword's abilities (axe cleave and sword combo). If you take the time you can even make unique and special abilities, you don't want to start with that kind of stuff though.
I see, thank you all for the advice! Hopefully I'll be able to figure it out and get better at making mods.