I have a pretty basic mod idea, want to give guards a perk that applies an effect to the player which then does some things. Problem is the effect never seems to work, I get nothing in my papyrus log?
I've added the perk to both the EncGuardSons/ImperialTemplate.
Perk is marked as hidden and has an entry point to apply combat spell on hit, with a condition GetIsReference target player.
Spell applies the magiceffect in question for 5 seconds, which is just a script effect with my script attached to it.
The Script
ScriptName GTJ_ArrestingScript Extends ActiveMagicEffect Actor _targetRefActor _casterRefEvent OnEffectStart(Actor akTarget, Actor akCaster)Debug.Trace("GTJ --- Magic effect was started on " + akTarget) _targetRef = akTarget _casterRef = akCaster _targetRef.GetActorBase().SetEssential(True) RegisterForSingleUpdate(1)EndEventEvent OnEffectFinish(Actor akTarget, Actor akCaster)Debug.Trace("GTJ --- Magic effect fades from " + akTarget) _targetRef.GetActorBase().SetEssential(False) UnregisterForUpdate()EndEventEvent OnUpdate() If (_targetRef.IsBleedingOut())Debug.Trace("GTJ --- " + _targetRef + "is bleeding out, arresting...") _targetRef.StopCombatAlarm() Game.FadeOutGame(True, True, 1, 1) Utility.Wait(0.5) _casterRef.GetCrimeFaction().SendPlayerToJail() Else;Debug.Trace("GTJ --- " + _targetRef + "not bleeding out, waiting...") RegisterForSingleUpdate(1) EndIfEndEvent