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
ScriptName MyRefreshAliasScript extends QuestQuest Property MyFirstQuest autoEvent OnInit() RegisterForSingleUpdate(1.0)EndEventEvent OnUpdate() MyFirstQuest.Stop() MyFirstQuest.Start() RegisterForSingleUpdate(10.0)EndEvent
Scriptname MDHRelockScript extends ObjectReference {Re-locks a container for the player to train lockpicking against};simply re-locking the container will only give the player experience from the first unlock.Actor Property PlayerRef autoObjectReference Property CopyMe autoObjectReference Property TargetMarker AutoInt OneCopyEvent OnLoad() BlockActivation()EndEventEvent OnActivate(ObjectReference akActionRef)BlockActivation() If akActionRef == PlayerRef If OneCopy < 1 ObjectReference Dupe = TargetMarker.PlaceAtMe(CopyMe) OneCopy = 1 Dupe.SetScale(0.0) Dupe.Activate(akActionRef)endif endifEndEvent;=============;SecondScript;=============;;Event OnLockStateChanged(Dupe) ;fires when player unlocks container. Ignore syntax. How awesome if I could fire this from main script though?; Lock() ;prevents container from opening after successful lockpick; Delete() ;wont delete whilst still property. Need to clear it here or the 1st script could check OneCopy for clearing the property somehow.; OneCopy = 0;EndEvent
ObjectReference kSelf = GetReference()kSelf.DoSomething()...or if an actor...
Actor kSelf = GetReference() As ActorkSelf.DoSomething()If not referencing itself more than once, there's no need to cache kSelf and you could just...
GetReference().DoSomething()...or...
(GetReference() As Actor).DoSomething()