Create a quest and in the quest data tab tick the Start Game Enabled box (it would be best to start the quest using the Story Manager for a number of reasons but for the moment try this), untick the Run Once box and give the quest a priority of 99. In the quest aliases tab create a new reference alias and tick the Optional, Find Matching Reference, In Loaded Area and Closest check boxes. In the match conditions tab create a condition that uses the condition function IsActor on the subject == 1. In the packages tab, add your package. In the scripts tab attach a script like this one:
Spoiler ScriptName MyScript extends ReferenceAliasReferenceAlias Property MyRefAlias autoActor MyActorEvent OnInit() RegisterForSingleUpdate(1.0)EndEventEvent OnUpdate() MyActor=MyRefAlias.GetReference() as Actor MyActor.EvaluatePackage() RegisterForSingleUpdate(3.0)EndEvent
Actors tend to evaluate their packages every 10 seconds by default but this script forces them to evaluate their packages every 3 seconds. Now duplicate this alias until you have 15 aliases. Don't forget to set the properties properly. Remember that you must point each RefAlias property at the alias itself.
What this quest is doing is it will search the loaded area (5x5 cells surronding the player) for actors and will give the closest 15 actors in this area an alias (the alias gives these actors the package). Now create a second quest the same way as the first (you should refine this later by using the story manager to start these quests). You will also need to attach a script to this second quest in the scripts tab. This script should look like this:
Spoiler ScriptName MyRefreshAliasScript extends QuestQuest Property MyFirstQuest autoEvent OnInit() RegisterForSingleUpdate(1.0)EndEventEvent OnUpdate() MyFirstQuest.Stop() MyFirstQuest.Start() RegisterForSingleUpdate(10.0)EndEvent
This script will constantly stop and start the first quest which will refresh the first quest's aliases periodically.
Make sure your package has the conditions GetDetected==1 running on the subject and whatever condition you require on the player (check if armor in a specific slot is equipped, is there a condition that will do this?).