So I have a script to damage the player's stamina when a weapon is swung. The condition is on the spell the MGEF (no duration, no area, hide in UI, script archetype) is attached to, and it registers correctly.
However, when I swing my fists, or sword, the stamina damage registers but is delayed by about a second. I want the values to be modifiable, but not if there is this much delay. This doesn't happen if I just use. This is the script on the MGEF:
Scriptname FFDamageFatigueScript extends activemagiceffect GlobalVariable Property FFUseUS Auto {FightingFatigueUseUserSettings}GlobalVariable Property FFOneHandDam Auto {Amount of stamina drain for one handed attacks, if FFUseUS is enabled.}GlobalVariable Property FFTwoHandDam Auto {Amount of stamina drain for two handed attacks, if FFUseUS is enabled.}Actor Property PlayerREF Auto Event OnEffectStart(Actor akTarget, Actor akCaster) If FFUseUS.GetValue() If PlayerREF.GetEquippedItemType(0) >= 0 && PlayerREF.GetEquippedItemType(0) <= 4 || PlayerREF.GetEquippedItemType(1) >= 0 && PlayerREF.GetEquippedItemType(1) <= 4 ;if user settings enabled and player has 1handed or hand to hand PlayerREF.DamageAV("Stamina", FFOneHandDam.GetValueInt()) ElseIf PlayerREF.GetEquippedItemType(0) >= 5 && PlayerREF.GetEquippedItemType(0) <= 6 || PlayerREF.GetEquippedItemType(1) >= 5 && PlayerREF.GetEquippedItemType(1) <= 6 ;if user settings enabled and player has 2 handed PlayerREF.DamageAV("Stamina", FFTwoHandDam.GetValueInt()) EndIf Else If PlayerREF.GetEquippedItemType(0) >= 0 && PlayerREF.GetEquippedItemType(0) <= 4 || PlayerREF.GetEquippedItemType(1) >= 0 && PlayerREF.GetEquippedItemType(1) <= 4 ;user settings not enabled PlayerREF.DamageAV("Stamina", 10) ElseIf PlayerREF.GetEquippedItemType(0) >= 5 && PlayerREF.GetEquippedItemType(0) <= 6 || PlayerREF.GetEquippedItemType(1) >= 5 && PlayerREF.GetEquippedItemType(1) <= 6 PlayerREF.DamageAV("Stamina", 25) EndIf EndIf EndEvent
Is there something I'm doing that is blatantly wrong? (I know DamageAV is slower than DamageActorValue, but would that really affect it this much?)
And if you do it too many times in a row it doesn't even register the extra hits.