Quest Runs while Disable and Fills Ref

Post » Sat Jan 26, 2013 12:58 am

Something i've stumbled upon which doesnt really make sense too me.
  • Creating a Quest, No Start Up
  • Make a Alias named 'Player' setting it to ForceRef : Player
  • Setting the option for the Alias - Optional Flag
  • Attaching MyPlayerScript to Player Alias
  • Creating a second Quest, Start Up
  • Attaching MyQuestScript to the Quest

What happens is, MyQuestScript detects if Alias Player has a Reference, if it does not then it will fill the Reference manually, and oddly Events start to be filtered with MyPlayerScript even though the Alias Quest is not running... why is this?

MyPlayerScript
Spoiler

ScriptName MyPlayerScript Extends ReferenceAliasEvent OnPlayerLoadGame()	CallFunction()EndEventFunction CallFunction()	Debug.Trace("CallFunction() : MyPlayerScript")EndFunction

MyQuestScript
Spoiler

ScriptName MyQuestScript Extends Quest;=================================================================================; Properties;=================================================================================MyPlayerScript Property pScript AutoReferenceAlias Property pPlayer Auto;=================================================================================; Variables;=================================================================================Float fPulseRate = 5.0Bool bKeepLive = True;=================================================================================; OnInit;=================================================================================Event OnInit()	RegisterForSingleUpdate(fPulseRate)EndEventEvent OnUpdate()	If bKeepLive		If !pPlayer.GetRef()			pPlayer.ForceRefTo(Game.GetPlayer())			pScript.CallFunction()			Debug.Trace("OnUpdate : MainQuestScript")		EndIf	EndIf		;Keep Update running	If bKeepLive		RegisterForSingleUpdate(fPulseRate)	EndIfEndEvent
User avatar
emily grieve
 
Posts: 3408
Joined: Thu Jun 22, 2006 11:55 pm

Return to V - Skyrim