NemoTuNovi Posted February 12, 2018 Share Posted February 12, 2018 So I'm working on a quick and simple mod but I'm having trouble getting it to work properly in game. The goal is to have a greatsword that casts Flame Cloak on a standing/forward power attack and Fireball on a left or right power attack, similar to the Bloodskal Blade. To do this, I made a magic effect with the following script attached to it:Scriptname __ScrHKC extends activemagiceffectSpell Property SpellHoriz autoSpell Property SpellVert autoActor SelfRefEvent OnEffectStart(Actor akTarget, Actor akCaster)SelfRef = akCasterregisterForAnimationEvent(SelfRef, "AttackPowerStanding_FXstart")registerForAnimationEvent(SelfRef, "AttackPowerRight_FXstart")registerForAnimationEvent(SelfRef, "AttackPowerLeft_FXstart")registerForAnimationEvent(SelfRef, "AttackPowerBackward_FXstart")registerForAnimationEvent(SelfRef, "AttackPowerForward_FXstart")endEventEvent OnEffectFinish(Actor akTarget, Actor akCaster);;Automatically Unregisterd when Ability RemovedENDEVENTEvent OnAnimationEvent(ObjectReference akSource, string EventName)if (eventName == "AttackPowerRight_FXstart") || (eventName == "AttackPowerLeft_FXstart") || (eventName == "AttackPowerBackward_FXstart")SpellHoriz.cast(SelfRef)elseif (eventName == "AttackPowerStanding_FXstart") || (eventName == "AttackPowerForward_FXstart")SpellVert.cast(SelfRef)endifendEVENT I set property SpellHoriz to "Fireball" and SpellVert to "flameCloak" I then created a self-cast/constant effect spell that I attached the magic effect to. I made a perk with an entry that added the spell as an ability To finish it, I created a duplicate of the Silver Greatsword that had that the vanilla SilverSwordScript script attached to it, and replaced the SilverPerk property with the perk I created earlier.I'm fairly sure that this should work, however in-game I don't seem to be getting results when I swing the weapon. Does anyone have an idea what the problem might be, and how I might be able to fix it? I attached the .esp file. All related content is prefixed with __HKC. I would have attached the .esp to this topic, but for some reason nexus mods doesn't want you to be sharing mods on a modding forum. I provided a dropbox link to the .esp file for reference here. Thank you for your time. Link to comment Share on other sites More sharing options...
FrankFamily Posted February 12, 2018 Share Posted February 12, 2018 (edited) "Type" dropdown menu of your _HKCSPell should be ability not spell. Adding an ability means it adds its effects to the target, adding an spell makes it available for casting. That's most likely your problem. Also, alternative way that I personally prefer, make an actual enchantment with a FireAndForget, contact, Script archetype effect (like any offensive enchantment effect but blank) fill its "Equip Ability" (bottom of the window) with your ability. It will add said ability while the weapon is equipped. No perk or scripts required and it's more reliable in my experience. The downside being you occupy the enchantment of the weapon but if it's an unique one it doesn't matter. Btw, is it good practice to add unoficial patch as master or is there a particular reason you've done so? Edited February 12, 2018 by FrankFamily Link to comment Share on other sites More sharing options...
NemoTuNovi Posted February 12, 2018 Author Share Posted February 12, 2018 that seems to have fixed it. Thank you very much.If I try this again in the future, I will definitely go with your less roundabout route.Regarding the USLEP, I have no idea why I added it. I started doing that while making custom dungeons/world spaces about a year ago and it's just a habit now. Link to comment Share on other sites More sharing options...
Recommended Posts