Jump to content

[LE] Help With Custom Greatsword Enchantment?


NemoTuNovi

Recommended Posts

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 activemagiceffect

Spell Property SpellHoriz auto
Spell Property SpellVert auto

Actor SelfRef

Event OnEffectStart(Actor akTarget, Actor akCaster)
SelfRef = akCaster
registerForAnimationEvent(SelfRef, "AttackPowerStanding_FXstart")
registerForAnimationEvent(SelfRef, "AttackPowerRight_FXstart")
registerForAnimationEvent(SelfRef, "AttackPowerLeft_FXstart")
registerForAnimationEvent(SelfRef, "AttackPowerBackward_FXstart")
registerForAnimationEvent(SelfRef, "AttackPowerForward_FXstart")
endEvent

Event OnEffectFinish(Actor akTarget, Actor akCaster)
;;Automatically Unregisterd when Ability Removed
ENDEVENT

Event 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)
endif
endEVENT



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

"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 by FrankFamily
Link to comment
Share on other sites

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...