A quick search pulled up, not much, really, so am gonna ask here. How would one go about giving, let's say, a spear an elemental alt ability? I know the part about changing the elemental type ( "elementalType" : "physical", ) to either, ice, fire, poison, or electric, and changing the alt ability to some one that is elemental - related, but then, what else is there to it? Are there any examples I could reference, mods, or other-wise? Cause, I am having trouble finding any. Thanks in advance!
This is from my mod Code: "altAbility" : { "name" : "Empowerment", "type" : "empowerment", "scripts" : ["/items/active/weapons/searing/cinder/empowerment.lua"], "class" : "Empowerment", "energyPerSecond" : 15, "projectileOffset" : [1, 0], "projectileType" : "firetravelingswoosh", "baseDamage" : 8, And this is from the rarespears.activeitem in the weapons folder Code: "altAbilities" : [ "blinkexplosion", "barrier", "elementalspin", "rocketspear" I don't use spears too often, but looking at these two, it seems you may need an altAbility classification, and then specify which one you want. If you see my mod's code, there are different codes for each element, such as "firetravelingswoosh" for the projectile of a broadsword. I haven't coded for a spear before, so excuse my lack of knowledge, but im sure you can just use some type of sub-code to set the type of "altAbility" to the "firespinswoosh", or "firerocketcharge" in the abilities folder, depending on the alt-ability you want. All of the elemental codes are in the spear section of the abilities folder in the main assets. Otherwise, i don't think there is any way to classify a weapon by a "single variable" such as labeling something as Ice and everything it does will be ice-related. Hope I could help, but not sure if I did anything
Thank you so much for the info! I'll have a go at what you said, once I can, and see how it works out!
So, I just implemented rocketspear with fire element, using your code (and changing it up a lil bit) and it works perfectly! Thank you so much! Here is my code, in case someone is interested : Code: { "itemName": "aviantier10spearbasic", "price": 160, "level": 10, "maxStack": 1, "rarity": "Common", "description": "Will of Kluex. A spear designed by Kluex himself.", "shortdescription": "Will of Kluex", "tooltipKind": "sword", "weaponType": "Spear", "twoHanded": true, "itemTags": ["weapon", "melee", "spear"], "inventoryIcon": "spearicon10.png", "animation": "/items/active/weapons/melee/spear/spear.animation", "animationParts": { "handle": "", "blade": "aviantier10spear.png" }, "animationCustom": { "animatedParts": { "parts": { "swoosh": { "properties": { "offset": [2.2, 0.05] } } } }, "sounds": { "fire": ["/sfx/melee/swing_spear.ogg"] } }, "scripts": ["/items/active/weapons/melee/meleeweapon.lua"], "elementalType": "fire", "aimOffset": -0.7, "primaryAbilityType": "spearstab", "primaryAbility": { "fireTime": 0.55, "baseDps": 11.5 }, "stances" : { "idle" : { "armRotation" : -45, "weaponRotation" : -10, "weaponOffset" : [0.3, 2.25], "allowFlip" : true, "allowRotate" : true }, "windup" : { "duration" : 0.05, "armRotation" : -20, "weaponRotation" : -20, "weaponOffset" : [0.5, 2.25], "allowFlip" : true, "allowRotate" : false }, "fire" : { "duration" : 0.2, "armRotation" : -135, "weaponRotation" : 40, "weaponOffset" : [0.5, 2.5], "allowFlip" : true, "allowRotate" : false } }, "altAbilityType": "rocketspear", "altAbility": { "scripts" : ["/items/active/weapons/melee/abilities/spear/rocketspear/rocketspear.lua"], "energyPerSecond" : 15, "projectileOffset" : [1, 0], "projectileType" : "firetravelingswoosh", "baseDamage" : 8, "damageConfig": { "damageSourceKind": "broadsword", "knockback": 25, "knockbackMode": "facing", "timeoutGroup": "primary" } }, "energyPerSecond" : 10, "projectileOffset" : [1, 0], "projectileType" : "firetravelingswoosh", "baseDamage" : 8, "builder": "/items/buildscripts/buildunrandweapon.lua", "critChance": 2, "critBonus": 6 } Thanks again!
Thanks for the pointer; I think this might come in handy when trying to make my own mod that uses both spears and staves.