Jump to content

Need some quest scripting help


Kohdi

Recommended Posts

Okay, I'm at my wit's end. I've been trying combinations of variables for literally hours. I'm trying to write a script that, upon taking a key from a dead actor, will check my quest's progress. If the quest is at stage A, advance to stage C. If the quest is at stage B, advance to stage D. Sounds easy, right? I'm about ready to put a fist through my monitor because I can feel the answer is just out of sight. Here's what I have so far:

 

Scriptname KohdiReachwindKeyScript extends ObjectReference  

Quest Property ReachwindDiscoveryQuestProp  Auto  

Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)
if (newContainer == Game.GetPlayer())
	if KohdiReachwindDiscoveryQuest.GetStage <= 5
		KohdiReachwindDiscoveryQuest.SetObjectiveDisplayed(90)
		KohdiReachwindDiscoveryQuest.SetStage(50)
	elseif KohdiReachwindDiscoveryQuest.GetStage == 10
		KohdiReachwindDiscoveryQuest.SetObjectiveDisplayed(90)
		KohdiReachwindDiscoveryQuest.SetStage(55)
	endif
endif
endevent

 

If anyone with appropriate knowledge can advise me on the changes to make, I heartily thank you.

 

And if you recognize the purpose for this script, please don't spill the beans. ;)

Edited by Kohdi
Link to comment
Share on other sites

You declared your property as "ReachwindDiscoveryQuestProp" but you're using it as "KohdiReachwindDiscoveryQuest" which would mean the script doesn't compile. If that's not your problem, well maybe you could add some debug messages or something, because I don't see anything else that's wrong with the script.
Link to comment
Share on other sites

Thank you for the reply, I've been going back over the tutorials and the business about the quest property was there (I overlooked it), but the script still isn't compiling. Here's what I have now -

 

Scriptname KohdiReachwindKeyScript extends ObjectReference  

Quest Property ReachwindDiscoveryQuestProp  Auto

Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)
   	if (newContainer == Game.GetPlayer())
           	if ReachwindDiscoveryQuestProp.GetStage <= 5
                   	ReachwindDiscoveryQuestProp.SetObjectiveDisplayed(90)
                   	ReachwindDiscoveryQuestProp.SetStage(50)
           	elseif ReachwindDiscoveryQuestProp.GetStage == 10
                   	ReachwindDiscoveryQuestProp.SetObjectiveDisplayed(90)
                   	ReachwindDiscoveryQuestProp.SetStage(55)
           	endif
   	endif
endevent

 

And here's what the compiler spits back -

 

(7,47): GetStage is not a property on script quest or one of its parents
(7,56): cannot compare a none to a int (cast missing or types unrelated)
(7,56): cannot relatively compare variables to None
(10,51): GetStage is not a property on script quest or one of its parents
(10,60): cannot compare a none to a int (cast missing or types unrelated)

 

I don't know how to translate this information, but it sounds like I'm either missing the right script property, or missing some property in the quest itself. Again, help is greatly appreciated.

Link to comment
Share on other sites

OK, I feel like I'm getting there, I've started using the GetCurrentStageID as well as an "int", but in my current configuration I'm not sure if I'm checking the right values -

 

Scriptname KohdiReachwindKeyScript2 extends ObjectReference  

Quest Property KohdiReachwindDiscoveryQuest  Auto

int Stage

Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)
;	stage = getcurrentstageid.kohdireachwinddiscoveryquest()
if (newContainer == Game.GetPlayer())
	if Stage <= 5
		KohdiReachwindDiscoveryQuest.SetObjectiveDisplayed(90)
		KohdiReachwindDiscoveryQuest.SetStage(50)
	elseif stage == 10
		KohdiReachwindDiscoveryQuest.SetObjectiveDisplayed(90)
		KohdiReachwindDiscoveryQuest.SetStage(55)
	endif
   	endif
endevent

 

Now, without the line I offset with ; in there, the script compiles just fine. I'm wondering though If the quest stage is being checked, or if the "stage" int is still going unassigned?

 

If I activate the offset line, the compiler returns -

 

(8,9): variable getcurrentstageid is undefined
(8,27): none is not a known user-defined type
(8,1): type mismatch while assigning to a int (cast missing or types unrelated)

 

How should I go about assigning the quest-stage value to my "stage" int, if I'm doing it wrong?

Link to comment
Share on other sites

Holy cow, it worked.

 

I honestly didn't think the syntax mattered there.

 

Thank you for helping, you've ended my two-day frustration-fest. On to the next script! D:

Link to comment
Share on other sites

  • Recently Browsing   0 members

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