Jump to content

How do I register a quest stage change using the RegisterForQuestStage?


Recommended Posts

I use the code:

Scriptname TXXIElisifRomance01StartScript extends Quest  

Quest Property CurrentQuest Auto 
Quest Property SubscriptionQuest Auto 

Event OnInit()
    PO3_Events_Form.RegisterForQuestStage(Self, SubscriptionQuest)  
    Debug.MessageBox("RegisterForQuestStage")
EndEvent

Event OnQuestStageChange(Quest akQuest, int newStage)
    Debug.MessageBox("OnQuestStageChange")
    if (akQuest == SubscriptionQuest)
        Debug.MessageBox("Quest: " + akQuest.GetName() + ", new stage: " + newStage)
    endif
EndEvent

The script itself has been added to the quest and it has the following property:

image.thumb.png.20d0d4936805a5ca917b1d48333d7c1f.png

Only the first MessageBox("RegisterForQuestStage") works for me.
I change the quest Favor252 stages using setstage, but OnQuestStageChange is not called. What could be the problem?

 

Edited by TheXXI
Link to comment
Share on other sites

Try debugging it with debug code... to see it works with a slight delay, between messages, or  to the console or trace

Scriptname TXXIElisifRomance01StartScript extends Quest  

Quest Property CurrentQuest Auto 
Quest Property SubscriptionQuest Auto 

Event OnInit()
    PO3_Events_Form.RegisterForQuestStage(Self, SubscriptionQuest)  
    Debug.MessageBox("RegisterForQuestStage")
	; [Debug] utility wait here 5 sec (don't use wait menu mode, I trying to pause it intil you close the message box)
	; [Debug] set SubscriptionQuest Quest Stage test "amount"
	; [debug] option but helpful, check to see the stage was set
	; maybe another pause for message boxes, ever thought of debugging to trace or console
EndEvent

Event OnQuestStageChange(Quest akQuest, int newStage)
    Debug.MessageBox("OnQuestStageChange")
    if (akQuest == SubscriptionQuest)
        Debug.MessageBox("Quest: " + akQuest.GetName() + ", new stage: " + newStage)
	else
	; [debug] Message well it fire a least ¯\_(ツ)_/¯ getting there :)
    endif
EndEvent

did you set the stage,  to test it, correctly, if not, to quote Mythbusters "Here your Problem"  your missing your testing assertions. So to speak...  that do the actual testing with a Yay OR Nay

Debug code should return either a success or utter failure, it really helps to track down the problem, FYI it fired, why is the quest stage not working? It also helps with not going in game and running around over and over, that really time consuming and non productive

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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