AndyTheSaurus Posted August 28 Share Posted August 28 (edited) I find that despite calling OnQuestInit() in the main script and setting up an event timer, my Quest scripts do not execute. tHIS MONSTROSITY OF A SCRIPT REPRESENTS EVERYTHING INCLUDING THE KITCHEN SINK THROWN IN, AND GENERATES NO OUTPUT AT ALL. YET IT COMPILES Scriptname PlayerSlaveCollarQuestInitScript extends Quest GlobalVariable Property PlayerCollarIsFound Auto GlobalVariable Property LockPlayerCollar Auto Quest Property PlayerSlaveCollarQuest Auto Armor Property DLC04_ShockCollarPlayer Auto ; ObjectReference Property PlayerRef Auto Actor Property PlayerREF Auto bool QuestIsInitialized = false ;Event OnQuestInit() ; if isRunning() ;;; RegisterForUpdate( 0.0) ; Debug.Trace("This quest SCRIPT Init has been done") ; endif ; Debug.Trace("This quest QUEST Init has been called") ; Start() ; PlayerSlaveCollarQuest.SetStage (0 ) ; PlayerSlaveCollarQuest.SetStage (10 ) ;endEvent int myTimerID = 10 float TimeDuration = 0.1 Event OnQuestInit() ; RegisterForUpdate(1,0) ;;;;;; THIS WAS USED IN SKYRIM AND WORKED Debug.Trace("This quest SCRIPT Init has been done") Start() if ( isRunning() ) endif PlayerSlaveCollarQuest.SetStage (0 ) PlayerSlaveCollarQuest.SetStage (10 ) StartTimer(TimeDuration, myTimerID ) EndEvent Event OnInit() EndEvent Event OnTimer(int aiTimerID) PlayerSlaveCollarCheck() If ( aiTimerID == myTimerID ) ; The five second timer we started just expired ; Debug.Trace("Timer ended! Do some cool stuff now...") if ( QuestIsInitialized == false ) PlayerSlaveCollarQuest.SetStage (0 ) PlayerSlaveCollarQuest.SetStage (10 ) QuestIsInitialized = true endif if ( PlayerCollarIsFound.GetValueInt() == 0 ) if ( Game.GetPlayer().GetItemCount ( DLC04_ShockCollarPlayer) == 0 ) RETURN endif PlayerCollarIsFound.SetValue(1) SetStage (30 ) endif if ( Game.GetPlayer().GetItemCount( DLC04_ShockCollarPlayer)== 0 ) ; Player dropped it Game.GetPlayer().AddItem( DLC04_ShockCollarPlayer, 1 ) elseif ( Game.GetPlayer().GetItemCount( DLC04_ShockCollarPlayer) > 1 ); Player picked it up again Game.GetPlayer().RemoveItem( DLC04_ShockCollarPlayer, 1 ) endif ; If we wanted to have the timer start over, we could now do StartTimer again... StartTimer(TimeDuration , myTimerID ) EndIf StartTimer(TimeDuration, myTimerID ) EndEvent function PlayerSlaveCollarCheck() if ( QuestIsInitialized == false ) PlayerSlaveCollarQuest.SetStage (0 ) PlayerSlaveCollarQuest.SetStage (10 ) QuestIsInitialized = true endif if ( PlayerCollarIsFound.GetValueInt() == 0 ) if ( Game.GetPlayer().GetItemCount ( DLC04_ShockCollarPlayer) == 0 ) RETURN endif PlayerCollarIsFound.SetValue(1) SetStage (30 ) endif if ( Game.GetPlayer().GetItemCount( DLC04_ShockCollarPlayer)== 0 ) ; Player dropped it Game.GetPlayer().AddItem( DLC04_ShockCollarPlayer, 1 ) elseif ( Game.GetPlayer().GetItemCount( DLC04_ShockCollarPlayer) > 1 ); Player picked it up again Game.GetPlayer().RemoveItem( DLC04_ShockCollarPlayer, 1 ) endif endfunction Edited August 28 by AndyTheSaurus Link to comment Share on other sites More sharing options...
7531Leonidas Posted August 28 Share Posted August 28 This is a general forum, you should probably try to put the name of your game in the title, or tag the post. You will probably get faster and better responses by posting in the game specific forum here on the Nexus, if it exists. Go to 'Game Communities' at the top of the page, click on it, and scroll/search for your game. Join the appropriate Game Community to post. 1 Link to comment Share on other sites More sharing options...
AndyTheSaurus Posted August 28 Author Share Posted August 28 (edited) Thanks Have now found Scripts will not run because the Quest must be both STARTED and RUNNING - an obscure flag setting on the main quest form Edited August 30 by AndyTheSaurus Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now