WakianTech Posted June 26 Share Posted June 26 [Almost posted this in the wrong place, moved it here!] Hello all! I am working on a big mod and unique weapons and collectables. I have a sword that when attacking, takes health from the player. (High Reward, High Risk) However, I have been trying EVERYTHING in Creation Kit to make this work. I've tried enchantments, Perks, Scripts... nothing for goodness sake will work at all! I managed to make it give health, but don't know how to make it take away health... I am feeling a little defeated! If it's not possible, than I understand and I will just move on. I just wanted to at least put it to rest before I can call it a fail completely. Any pointers or help would be greatly appreciated! Oh and I will also be sure to credit whomever can solve this mystery for me! (I am also willing to show scripts I have attempted to use if anyone needs them) Link to comment Share on other sites More sharing options...
Evangela Posted June 26 Share Posted June 26 (edited) Apply Weapon Swing Spell perk entry should work if you have the magic effect / pell set to Constant Effect - Self. Edited June 26 by Evangela Link to comment Share on other sites More sharing options...
WakianTech Posted June 26 Author Share Posted June 26 I get that, but I don't really know how to go about it... I have tried doing that (both with a script and value modifier) and nothing seems to work. Link to comment Share on other sites More sharing options...
dylbill Posted June 26 Share Posted June 26 I would recommend using a script with animation events "weaponSwing" and "weaponLeftSwing" https://ck.uesp.net/wiki/OnAnimationEvent_-_Form 1 Link to comment Share on other sites More sharing options...
PeterMartyr Posted June 27 Share Posted June 27 swing or hitting.. just asking.. cos if swing and miss took my health I would get shitty Edit, You might wanna add blocking to that Link to comment Share on other sites More sharing options...
WakianTech Posted June 27 Author Share Posted June 27 Hitting, the health only takes when you make contact with an enemy. Still haven't had any solution... So I am probably just gonna nerf the idea and make absorb health from the enemy instead. It appears to be impossible at this point. Link to comment Share on other sites More sharing options...
dylbill Posted June 27 Share Posted June 27 To detect hits, just put an enchantment on your weapon or add a new magic effect to the enchantment if it already has one. Then add a script to the magic effect that extends ActiveMagicEffect and use the OnEffectStart Event. The event will trigger whenever you hit something with the weapon. Link to comment Share on other sites More sharing options...
dylbill Posted June 27 Share Posted June 27 Another option is if you're using SKSE, my mod Dylbills Papyrus Functions: https://www.nexusmods.com/skyrimspecialedition/mods/65410 includes DbSkseEvents. Example script: ;script attached to a form such as a quest Weapon Property MyWeapon Auto Weapon Property MyOtherWeapon Auto Event OnInit() ;compare MyWeapon with 'Source'. Register this form for when anything is hit with MyWeapon. DbSkseEvents.RegisterFormForGlobalEvent("OnHitGlobal", self, MyWeapon, 2) ;compare MyOtherWeapon with 'Source'. Register this form for when anything is hit with MyOtherWeapon. DbSkseEvents.RegisterFormForGlobalEvent("OnHitGlobal", self, MyOtherWeapon, 2) EndEvent Event OnHitGlobal(ObjectReference Attacker, ObjectReference Target, Form Source, Ammo akAmmo, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) Actor attackerActor = Attacker as Actor if attackerActor && (Target as actor) ;an actor hit another actor with MyWeapon or MyOtherWeapon if Source == MyWeapon attackerActor.DamageAv("Health", 10.0) Elseif Source == MyOtherWeapon attackerActor.DamageAv("Health", 20.0) Endif Endif EndEvent Link to comment Share on other sites More sharing options...
Recommended Posts