So I created a formlist and filled it with the generic guards (and my own test npc),
I created a trigger box around my actors and attached this script to it:
ScriptName SneakingSuspisionScript extends ObjectReferenceQuest Property CrimeOverhaul AutoEvent OnTriggerEnter(ObjectReference PlayerRef) if Game.GetPlayer()==PlayerRefCrimeOverhaul.Start()elseendIfEndEventEvent OnTriggerLeave(ObjectReference PlayerRef)if Game.GetPlayer()==PlayerRefCrimeOverhaul.Stop()elseendIfEndEvent
I created a new quest called CrimeOverhaul, created an alias, chose Find Matching Reference and ticked the In Loaded Area and Closest boxes, created a match condition "IsInList GuardFormList == 1" and attached this script:
ScriptName GuardSuspisous extends ReferenceAliasint iIndexActor PlayerRefActor GuardFormList Property GuardFormList autoQuest Property CrimeOverhaul autoEvent OnInit() PlayerRef = Game.GetPlayer() while CrimeOverhaul.IsRunning()==true while PlayerRef.IsSneaking()==true iIndex = GuardFormList.GetSize() while iIndex > 0 iIndex -= 1 Guard = GuardFormList.GetAt(iIndex) as Actor if PlayerRef.IsDetectedBy(Guard)==true Utility.Wait(3) if PlayerRef.IsDetectedBy(Guard)==true Guard.SendTrespassAlarm(PlayerRef) else endIf else endIf endWhile endWhile endWhileEndEvent
Can anyone can point out the (probably) obvious mistakes, please? Because its not working and I cannot figure out why.
P.S. Sorry about the awful indenting, its very late and I am really tired.