Hello! I have been trying to add a modified spinslash altability for my energy weapon broadsword. Basically, it's a spinslash ability with the same speed as superspinslash and without the hover. I got the speed to work but I do not know how to change the swoosh to the energy swoosh and the spinslash sound to the laser weapon sound. For completeness, here's what I did to get the speed right: Code: "altAbilityType":"spinslash", "altAbility" : { "name" : "Ultra Spin Slash", "energyUsage" : 100.0, "stances" : { "windup" : { "duration" : 0.025, "armRotation" : 0, "weaponRotation" : -80, "twoHanded" : true, "allowRotate" : false, "allowFlip" : false }, "slash" : { "duration" : 0.025, "armRotation" : -45, "weaponRotation" : -45, "twoHanded" : true, "allowRotate" : false, "allowFlip" : false } } }, As for getting the sound right, I tried to make a different ability type using the spinslash.lua and spinslash.weaponability files. I copied the files, renamed then to spineslash.lua and spineslash.weaponability. The plan was to change the sounds in the spineslash.weaponability file and use the new spineslash type ability. I first tested if the game recognized the new ability so I put in a patch for the weaponabilities.config file in buildscripts. However, typing in "altAbilityType":"spineslash" in the active item file of my energy sword gives me the sword without any secondary skill whatsoever. I think the main problem is how I made the custom ability, so I would really appreciate a step-by-step on how to do it right. Of course, I am also open to any other method. Thanks! For completeness, here are the other files: weaponabilities.config.patch Code: [ { "op" : "add", "path" : "/spineslash", "value" : "/items/active/weapons/melee/abilities/broadsword/spinslash/spineslash.weaponability" } ] spineslash.weaponability Code: { "animationParts" : { }, "animationCustom" : { "animatedParts" : { "stateTypes" : { "spinSwoosh" : { "default" : "idle", "states" : { "idle" : { }, "fire" : { "frames" : 3, "cycle" : 0.075, "mode" : "transition", "transition" : "idle" } } } }, "parts" : { "spinSwoosh" : { "properties" : { "zLevel" : -1, "centered" : true, "offset" : [0, 0.75], "transformationGroups" : ["swoosh"], "rotationCenter" : [0, 0] }, "partStates" : { "spinSwoosh" : { "idle" : { "properties" : { "image" : "" } }, "fire" : { "properties" : { "image" : "/items/active/weapons/melee/abilities/broadsword/spinslash/spinswoosh.png:<frame><swooshDirectives>", "damageArea" : [ [-1.5, 0.875], [2.75, 0.875], [4.125, 0.5], [5.0, 0], [5.0, -0.5], [4.625, -0.875], [3.5, -1.375], [-1.5, -1.375] ] } } } } } } }, "sounds" : { "flail" : [ "/sfx/melee/sword_spinslash.ogg" ] } }, "ability" : { "name" : "Spine Slash", "type" : "spineslash", "scripts" : ["/items/active/weapons/melee/abilities/broadsword/spinslash/spineslash.lua"], "class" : "SpineSlash", "energyUsage" : 80.0, "cooldownTime" : 0.5, "damageConfig" : { "damageSourceKind" : "broadsword", "statusEffects" : [ ], "baseDamage" : 5, "knockback" : 20, "knockbackMode" : "facing", "timeout" : 0.15, "timeoutGroup" : "alt" }, "armRotationOffsets" : [20, -20, 0, 0, -20, 20, 0, 0], "stances" : { "windup" : { "duration" : 0.075, "armRotation" : 0, "weaponRotation" : -80, "twoHanded" : true, "allowRotate" : false, "allowFlip" : false }, "slash" : { "duration" : 0.075, "armRotation" : -45, "weaponRotation" : -45, "twoHanded" : true, "allowRotate" : false, "allowFlip" : false } } } } spineslash.lua Code: require "/scripts/util.lua" require "/items/active/weapons/weapon.lua" SpineSlash = WeaponAbility:new() function SpineSlash:init() self.cooldownTimer = self.cooldownTime self:reset() end function SpineSlash:update(dt, fireMode, shiftHeld) WeaponAbility.update(self, dt, fireMode, shiftHeld) self.cooldownTimer = math.max(0, self.cooldownTimer - dt) if self.weapon.currentAbility == nil and self.cooldownTimer == 0 and not status.resourceLocked("energy") and self.fireMode == "alt" then self:setState(self.slash) end end function SpineSlash:slash() local slash = coroutine.create(self.slashAction) coroutine.resume(slash, self) local movement = function() mcontroller.controlModifiers({runningSuppressed = true}) if self.hover then mcontroller.controlApproachYVelocity(self.hoverYSpeed, self.hoverForce) end end while util.parallel(slash, movement) do coroutine.yield() end end function SpineSlash:slashAction() local armRotationOffset = math.random(1, #self.armRotationOffsets) while self.fireMode == "alt" do if not status.overConsumeResource("energy", self.energyUsage * (self.stances.windup.duration + self.stances.slash.duration)) then return end self.weapon:setStance(self.stances.windup) self.weapon.relativeArmRotation = self.weapon.relativeArmRotation - util.toRadians(self.armRotationOffsets[armRotationOffset]) self.weapon:updateAim() util.wait(self.stances.windup.duration, function() return status.resourceLocked("energy") end) self.weapon.aimDirection = -self.weapon.aimDirection self.weapon:setStance(self.stances.slash) self.weapon.relativeArmRotation = self.weapon.relativeArmRotation + util.toRadians(self.armRotationOffsets[armRotationOffset]) self.weapon:updateAim() armRotationOffset = armRotationOffset + 1 if armRotationOffset > #self.armRotationOffsets then armRotationOffset = 1 end animator.setAnimationState("spinSwoosh", "fire", true) animator.playSound("flail") util.wait(self.stances.slash.duration, function() local damageArea = partDamageArea("spinSwoosh") self.weapon:setDamage(self.damageConfig, damageArea) end) end self.cooldownTimer = self.cooldownTime end function SpineSlash:reset() animator.setGlobalTag("swooshDirectives", "") end function SpineSlash:uninit() self:reset() end
If you use the [code] [/code] tags - it preserves spacing and saves you a lot of time. Generally also looks nicer.