Jump to content

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


AndyTheSaurus

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

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

  • Recently Browsing   0 members

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