Jump to content

Is anyone else unable to run Quest scripts????


Recommended Posts

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 by AndyTheSaurus
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...