0lexan Posted April 2, 2020 Share Posted April 2, 2020 Hello, I was testing some scripting and spells, and I found that guards seem to automatically dispel spells. I originally had a cloak spell that would add an ability to the guard, but they did not seem to take any effect while any other actor did. I am wondering if there is a work around for this behavior that they have? Script 1: Scriptname AAAA_TestFixScript extends activemagiceffect Actor Property ActorFromRef Auto MagicEffect Property MI_DeathEffect_ME Auto Spell Property MI_DeathEffect_Spell Auto Event OnEffectStart(Actor akTarget, Actor akCaster) RegisterForSingleUpdate(0.05) EndEvent Event OnUpdate() ActorFromRef = Game.FindRandomActorFromRef(Game.GetPlayer(), 5000.0) if (ActorFromRef.HasMagicEffect(MI_DeathEffect_ME) == 0) ActorFromRef.AddSpell(MI_DeathEffect_Spell) endif registerforsingleupdate(0.05) EndEvent This would simply grab a random actor and add the ability manually, since I was having trouble adding the ability to guards.Script 2 simply had a debug.trace to check if the ability was successfully added to the character, along with a GetActorBase().GetName(). Any and all help is appreciated. Link to comment Share on other sites More sharing options...
Recommended Posts