DracoX09 Posted February 10, 2018 Share Posted February 10, 2018 I have spells for my mod Bound Elemental Arrows, but was hoping I could make them into powers so the character could conjure the arrows with a bow equipped. Unfortunately just changing them into powers doesn't really work very well as the magic effect stays on the character for the full duration, and if the power is cast again the arrows are removed but the effect is not, and then using the power again won't do anything until the effect ends. Is there a way that I can just make the powers toggle like night-eye? Link to comment Share on other sites More sharing options...
Fantafaust Posted February 10, 2018 Share Posted February 10, 2018 (edited) Is it a spell or an ability?Assuming it's a spell: Scriptname GenericPowerSpellToggleScript extends activemagiceffect Spell Property SpellToBeToggled Auto MagicEffect Property OneMagicEffectOfToggleSpell Auto Actor Property PlayerRef Auto Event OnEffectStart(Actor akTarget, Actor akCaster) If akCaster == PlayerRef If PlayerRef.HasMagicEffect(OneMagicEffectOfToggleSpell) PlayerRef.DispelSpell(SpellToBeToggled) Else SpellToBeToggled.Cast(PlayerRef, PlayerRef) EndIf EndIf EndEvent Assuming it's an ability: Scriptname GenericAbilityToggleScript extends activemagiceffect Spell Property AbilityToBeToggled Auto String Property AbilityMessageOn Auto String Property AbilityMessageOff Auto Event OnEffectStart(Actor akTarget, Actor akCaster) If akTarget.HasSpell(AbilityToBeToggled) akTarget.DispelSpell(AbilityToBeToggled) akTarget.RemoveSpell(AbilityToBeToggled) Debug.Notification(AbilityMessageOff) Else akTarget.AddSpell(AbilityToBeToggled, False) Debug.Notification(AbilityMessageOn) EndIf EndEvent Edited February 10, 2018 by Fantafaust Link to comment Share on other sites More sharing options...
DracoX09 Posted February 10, 2018 Author Share Posted February 10, 2018 I actually want it to be a Lesser Power, that way it can be cast while wielding a bow. Link to comment Share on other sites More sharing options...
Fantafaust Posted February 10, 2018 Share Posted February 10, 2018 (edited) I mean the original spell/ability. These scripts have to be put on a new magic effect, and a new spell, which of course can be a lesser power.That's how all the toggle abilities in my mods work.It's a new magic effect and new lesser power spell per toggle, btw.So it'll basically be like this:Spell1MagicEffectSpell1Spell1ToggleEffectSpell1TogglePower - Player gets this oneAnd so on for all your spells. Edited February 10, 2018 by Fantafaust Link to comment Share on other sites More sharing options...
DracoX09 Posted February 11, 2018 Author Share Posted February 11, 2018 I mean the original spell/ability. These scripts have to be put on a new magic effect, and a new spell, which of course can be a lesser power.That's how all the toggle abilities in my mods work. It's a new magic effect and new lesser power spell per toggle, btw. So it'll basically be like this:Spell1MagicEffectSpell1Spell1ToggleEffectSpell1TogglePower - Player gets this one And so on for all your spells. Thank you so much! Again! Really wish I knew more about scripts and making mods, hopefully I'll learn more as I go on. You sir, are awesome! Link to comment Share on other sites More sharing options...
Fantafaust Posted February 11, 2018 Share Posted February 11, 2018 It's just practice. If someone is able to pull something off and I can't figure out how, I download their mod and study the scripts so I can reverse engineer it. It takes time, but it's a good way to learn. Link to comment Share on other sites More sharing options...
Recommended Posts