Repeatable Quest Activator

Post » Mon Nov 19, 2012 3:59 am

Working on a quest that I'd like the player to be able to repeat.

Stage 10 (player reads note from courier) and 20 (player reads book) are non repeatable and will only occur once. After completing the entire quest, I'd like the player to be able to activate a specific statue of Talos at any time and choose a messagebox option to "pray to Talos," which will set the quest stage back to 30 and repeat stages 30 to 70.

Should I put the OnActivate script on the statue object instance itself, or on the quest alias corresponding to the statue?
User avatar
Davorah Katz
 
Posts: 3468
Joined: Fri Dec 22, 2006 12:57 pm

Post » Mon Nov 19, 2012 8:37 am

As long as you haven't stopped the quest, putting it on the alias should be fine (and, I think, better).
User avatar
Daniel Lozano
 
Posts: 3452
Joined: Fri Aug 24, 2007 7:42 am

Post » Mon Nov 19, 2012 7:55 am

Should I put the OnActivate script on the statue object instance itself, or on the quest alias corresponding to the statue?
Either method should work identically. Filling an alias with it would make it persistent when it might not need to be though.
User avatar
Alycia Leann grace
 
Posts: 3539
Joined: Tue Jun 26, 2007 10:07 pm

Post » Mon Nov 19, 2012 10:52 am

Great to hear, thanks very much for clarifying!


Also, I assume I need to include in the script SetObjectiveCompleted(XX, false) for all the stages from 30 to 70. Do I need to run any additional command related to having previously "shutdown" the quest at stage 80?

As long as you haven't stopped the quest, putting it on the alias should be fine (and, I think, better).

I didn't include any stop function, but for stage 80 I have the "shutdown" box checked.
User avatar
Jade MacSpade
 
Posts: 3432
Joined: Thu Jul 20, 2006 9:53 pm

Post » Mon Nov 19, 2012 10:47 am

Filling an alias with it would make it persistent when it might not need to be though.

Aliases? I know filling properties with things makes them persistent, but I thought aliases were the best way of avoiding that. (If they aren't, I don't see any way of avoiding it at all...)
User avatar
Lizs
 
Posts: 3497
Joined: Mon Jul 17, 2006 11:45 pm

Post » Mon Nov 19, 2012 1:04 pm



Aliases? I know filling properties with things makes them persistent, but I thought aliases were the best way of avoiding that. (If they aren't, I don't see any way of avoiding it at all...)

You'd need to Stop the quest to clear all the aliases. A Completed quest still shows as running if you use SQV.

The best way i believe would be to attach the script to the object, making the quest a property.
User avatar
Kortniie Dumont
 
Posts: 3428
Joined: Wed Jan 10, 2007 7:50 pm

Post » Mon Nov 19, 2012 2:27 pm

Also, I assume I need to include in the script SetObjectiveCompleted(XX, false) for all the stages from 30 to 70. Do I need to run any additional command related to having previously "shutdown" the quest at stage 80?

Can't think of anything, but you need to be aware that GetStage() for this quest will always return the last stage the player ever reached (i.e. 80, in this case, after they've completed it once).

I didn't include any stop function, but for stage 80 I have the "shutdown" box checked.

I believe that box specifies the stage that will be run when the quest is stopped, not that the quest will be stopped when that stage is run, so you should be fine. But then again I wouldn't trust me on this, so I'd also check with a quick test if I were you :)
User avatar
Trista Jim
 
Posts: 3308
Joined: Sat Aug 25, 2007 10:39 pm

Post » Mon Nov 19, 2012 6:55 am

You'd need to Stop the quest to clear all the aliases. A Completed quest still shows as running if you use SQV.

The best way i believe would be to attach the script to the object, making the quest a property.

Ah, so just 'persistent while the quest lasts'? Cool, that's what I thought. Of course if the object is needed for the quest the persistence might not be bad :)
User avatar
Max Van Morrison
 
Posts: 3503
Joined: Sat Jul 07, 2007 4:48 pm

Post » Mon Nov 19, 2012 6:13 pm

I didn't include any stop function, but for stage 80 I have the "shutdown" box checked.
If the quest stops, the alias will be cleared, so the ReferenceAlias script would no longer be glued to the statue.
Aliases? I know filling properties with things makes them persistent, but I thought aliases were the best way of avoiding that. (If they aren't, I don't see any way of avoiding it at all...)
While the quest is running, yeah, references filling its aliases are persistent. The advantage to aliases is that after the quest stops, its aliases are no longer persistent while pointing a property to a reference will tick the persistent flag in the plugin, so it'll remain persistent forever. Such an activator might not ever need to be persistent if the REFR or base were scripted instead.
User avatar
Yonah
 
Posts: 3462
Joined: Thu Aug 02, 2007 4:42 am

Post » Mon Nov 19, 2012 1:15 pm

Thanks very much for all your help!

Does this script look OK for what I'm attempting (to be attached to the statue instance)?

http://pastebin.com/raw.php?i=S5Bkpa7r


EDIT: Unfortunately, it doesn't compile and I'm getting the following error message:

missing RPAREN at '\\r\\n' 
User avatar
Damned_Queen
 
Posts: 3425
Joined: Fri Apr 20, 2007 5:18 pm

Post » Mon Nov 19, 2012 1:21 pm

Hey man I'm on my phone so can't type well but you're missing some brackets. 1 line in particular, you've bracketed and missed one, so it needs:

If (akactivator == game.getplayer()) &&

You're missing the bracket after ()
User avatar
Devils Cheek
 
Posts: 3561
Joined: Sun Aug 13, 2006 10:24 pm

Post » Mon Nov 19, 2012 10:13 am

Try:
Spoiler
ScriptName ST_TalosActivateScript Extends ObjectReferenceActor Property PlayerREF Auto ; Fastest way to reference the playerMessage Property Message1 Auto ; Message Box to ask if player wants to pray to TalosMessage Property Message2 Auto ; Message about vision from TalosQuest Property MyQuest Auto ; Quest to craft Dovah Mir AmuletEvent OnActivate(ObjectReference akActionRef)	If akActionRef == PlayerREF		If MyQuest.GetStage() > 70 ; if player already completed quest			Int iButtonSelected = Message1.Show() ; Pray to Talos?			If iButtonSelected == 0 ; if player clicks "Yes"				Message2.Show() ; show message about vision from Talos				MyQuest.SetStage(30) ; set quest to stage 30 to find ingredient in random dungeon				MyQuest.SetObjectiveCompleted(30, false) ; reset all the quest stages				MyQuest.SetObjectiveCompleted(40, false)				MyQuest.SetObjectiveCompleted(50, false)				MyQuest.SetObjectiveCompleted(60, false)				MyQuest.SetObjectiveCompleted(70, false)				MyQuest.SetObjectiveCompleted(80, false)			EndIf		EndIf	EndIfEndEvent
Rearranged a few things and got it to compile.
User avatar
Gill Mackin
 
Posts: 3384
Joined: Sat Dec 16, 2006 9:58 pm

Post » Mon Nov 19, 2012 5:21 am

Awesome, thanks so much Justin and B1gBadDaddy - it compiles now! :banana:

Just to make sure, do I also need to change all the quest aliases associated with the repeatable stages to "Allow Reuse In Quest"? Or am I misunderstanding the meaning of that checkbox?


Allow Reuse in Quest: Normally, the Story Manager will not fill two aliases on the same quest with the same reference. If "Allow Reuse in Quest", the reference in this alias CAN be placed into another alias on this quest during the startup process.
User avatar
lydia nekongo
 
Posts: 3403
Joined: Wed Jul 19, 2006 1:04 pm


Return to V - Skyrim