Starting a New Quest

Post » Tue Jun 19, 2012 6:31 pm

I'm just starting out, and I can't get my new quest to start. I've read the tutorials talking about using GetOwningQuest().SetStage(10), and that won't compile. I've gone into properties and done some stuff, still won't compile.
I wrote this script:
Scriptname QuesterTester extends TopicInfo  Quest Property TBJ  Auto  Int Property PrevLvl  Auto  FUNCTION getthedamnquest()     If GetOwningQuest().GetStage() <= PrevLvl         GetOwningQuest().SetStage(PrevLvl)     EndifendFUNCTIONQuest Property TBJ01  Auto  
Wherein PrevLvl has been set to 10.

Now I have this script locally at the topic I want to kick off the quest. I feel like I should simply be able to write getthedamnquest() and compile in the end: box of the topic, but that isn't working.
Anyone know how to start a darn quest?
User avatar
Tania Bunic
 
Posts: 3392
Joined: Sun Jun 18, 2006 9:26 am

Post » Tue Jun 19, 2012 3:37 pm

I got it working somehow.
User avatar
Chloe Mayo
 
Posts: 3404
Joined: Wed Jun 21, 2006 11:59 pm

Post » Tue Jun 19, 2012 6:20 pm

As long as your PrevLvl Property is set to a value that is one of the Quest Stages (so, set to 10 and you have a Stage 10) then this has started your Quest.

So ... you setup some dialogue
As part of a piece of that dialogue you set a current Stage for the Quest
And so the Quest became Active

(setting Stages is not the only way, but it is probably the most common).

If you restrict the Dialogue to a particular NPC, then you have created a quest, made a quest-giver (the restricted NPC) and started the quest - Well done :)

(if you did not restrict which NPC can say the Dialogue, then any NPC is the Quest-Giver ... depends how you want your Quest to work, I guess)
User avatar
Jamie Lee
 
Posts: 3415
Joined: Sun Jun 17, 2007 9:15 am

Post » Tue Jun 19, 2012 11:40 am

Well, It's kind of blind leading the blind, as I'm pretty new to all this scripting stuff myself, but maybe someone more knowledgeable will jump in and correct any of this that may be wrong. I hope it gets you on the right track, at least.

From what I can tell, you have this as a topic script fragment within the quest. Let's say it's attached to a specific line of dialog. That dialog won't be an option until the quest containing it has already started. You can set the quest as "Enabled at game start" with stage 0 as the start-up stage, and it will add your topic to whoever you point it at (Quest alias for a unique actor, for instance). As long as your "GetOwningQuest" is called from a script that's actually in part of the quest, and the quest is active, it should work. But it won't work if it's called from a script that's not attached to the quest you're trying to change (like a script on a base object). Then, If you're trying to set a new stage and get the "Quest Started" banner after a line of dialog I think you can just put:

GetOwningQuest().SetActive()
GetOwningQuest().SetStage(NewStageNumber)

or you can use your property:

TBJ.SetStage(#)

in the "End Topic Fragment". Or alternatively you can set TBJ quest as a property of an external script (not directly tied to the quest) and call "TBJ.Start()" from some event to get TBJ started. Then you can set stage from within TBJ. Also, I've had issues with fragment scripts sometimes not behaving themselves, and they need to be completely cleared, compiled, and exited out of the quest before they'll work again. You might try that if a setstage from within it still doesn't work.
User avatar
CSar L
 
Posts: 3404
Joined: Fri Nov 09, 2007 9:36 pm


Return to V - Skyrim