GetStage for vanilla quest - how to implement?

Post » Sun Nov 18, 2012 8:12 am

I'm trying to get the stage of a vanilla quest (has the player completed "Tending The Flames"?) to use as a condition in my Shrine Donations mod - If the player has completed the quest, then he gets a superior blessing, if he hasn't completed the quest he gets a normal blessing.

I've read http://www.creationkit.com/IsStageDone_-_Quest but can't work out how to implement this, and that page seems to keep sending me in circles!

How exactly do I define the quest property in the script, and do I just the use the quest name that it says in the quest tab (ie. presumably MS05KingOlafsFestival)?
User avatar
Dominic Vaughan
 
Posts: 3531
Joined: Mon May 14, 2007 1:47 pm

Post » Sun Nov 18, 2012 3:00 pm

I do something similiar in my mod using the following code:

Quest Property QuestToCheck Autoif QuestToCheck.IsCompleted() ;Do Somethingendif

The key is simply setting the correct quest to pass in to the script.
User avatar
Carlos Vazquez
 
Posts: 3407
Joined: Sat Aug 25, 2007 10:19 am

Post » Sun Nov 18, 2012 2:52 am

As simple as that! Thanks!
User avatar
mike
 
Posts: 3432
Joined: Fri Jul 27, 2007 6:51 pm

Post » Sun Nov 18, 2012 3:10 am

Well, it works for one of the quests, but not for the other...

The "Tending the Flames" quest is defined as MS05 (the correct quest ID), and when completed by the player gives the correct messagebox and removes 5 gold as a result.

The "Fit For a Jarl" quest is defined as SolitudeFreeform02 (the correct quest ID), but when completed by the player is completely ignored, doesn't give the correct message or remove 10 gold - instead, the standard "Dibella grants your blessing!" message and 25 gold is removed.


Have I made any obvious errors in my scripting?

Scriptname ShrineDonationDibella extends ObjectReference  MiscObject Property Gold001 AutoQuest Property TendingTheFlames AutoQuest Property FitForAJarl AutoSpell Property TempleBlessing AutoMessage Property BlessingMessage AutoMessage Property AltarRemoveMsg AutoActor property PlayerRef autoimport debugEvent OnActivate(ObjectReference akActionRef)		if akActionRef == PlayerRef					 ;We don't want NPCs activating this				If PlayerRef.GetItemCount(Gold001) < 25						debug.messagebox("You need at least 25 gold to offer a donation! Worship the embodiment of beauty through the arts, and please Dibella as you please your lover.") ;(make the transaction fail)	  ;<===Convert to message object					Else			   If TendingTheFlames.IsCompleted()				PlayerRef.RemoveItem(Gold001, 5)					   TempleBlessing.Cast(akActionRef, akActionRef)					   AltarRemoveMsg.Show()					   BlessingMessage.Show()			   debug.messagebox("Your poetic and musical artistry at the Bard's College is pleasing to Dibella - she grants a blessing for just 5 gold!")			 Else			   If FitForAJarl.IsCompleted()			   PlayerRef.RemoveItem(Gold001, 10)					   TempleBlessing.Cast(akActionRef, akActionRef)					   AltarRemoveMsg.Show()					   BlessingMessage.Show()			   debug.messagebox("Your appreciation of fine clothing pleases Dibella - she grants a blessing for just 10 gold!")									Else						PlayerRef.RemoveItem(Gold001, 25)						TempleBlessing.Cast(akActionRef, akActionRef)						AltarRemoveMsg.Show()						BlessingMessage.Show()			   debug.messagebox("Dibella grants your blessing! Worship the embodiment of beauty through the arts, and please Dibella as you please your lover.")			endif		endif   endifendifEndEvent

Edit: I don't know why my code is being formatted like that here - it looks fine in the CK and when I paste it here...but looks different when I view the post...
User avatar
lexy
 
Posts: 3439
Joined: Tue Jul 11, 2006 6:37 pm

Post » Sun Nov 18, 2012 4:45 am

Have I made any obvious errors in my scripting?
In Papyrus, ElseIf is one keyword, not two.... so it should look something like this:
Scriptname ShrineDonationDibella extends ObjectReference   MiscObject Property Gold001 Auto  Quest Property TendingTheFlames AutoQuest Property FitForAJarl AutoSpell Property TempleBlessing AutoMessage Property BlessingMessage AutoMessage Property AltarRemoveMsg AutoActor property PlayerRef auto import debug Event OnActivate(ObjectReference akActionRef)  if akActionRef == PlayerRef									  ;We don't want NPCs activating this    If PlayerRef.GetItemCount(Gold001) < 25	  debug.messagebox("You need at least 25 gold to offer a donation! Worship the embodiment of beauty through the arts, and please Dibella as you please your lover.") ;(make the transaction fail)   ;<===Convert to message object    ElseIf TendingTheFlames.IsCompleted()	  PlayerRef.RemoveItem(Gold001, 5)	  TempleBlessing.Cast(akActionRef, akActionRef)	  AltarRemoveMsg.Show()	  BlessingMessage.Show()	  debug.messagebox("Your poetic and musical artistry at the Bard's College is pleasing to Dibella - she grants a blessing for just 5 gold!")    ElseIf FitForAJarl.IsCompleted()	  PlayerRef.RemoveItem(Gold001, 10)	  TempleBlessing.Cast(akActionRef, akActionRef)	  AltarRemoveMsg.Show()	  BlessingMessage.Show()	  debug.messagebox("Your appreciation of fine clothing pleases Dibella - she grants a blessing for just 10 gold!")    Else	  PlayerRef.RemoveItem(Gold001, 25)	  TempleBlessing.Cast(akActionRef, akActionRef)	  AltarRemoveMsg.Show()	  BlessingMessage.Show()	  debug.messagebox("Dibella grants your blessing! Worship the embodiment of beauty through the arts, and please Dibella as you please your lover.")    EndIf  EndIfEndEvent
What you had compiles but the logic was different than you were expecting. I think this code should give you what you want.
User avatar
Kat Ives
 
Posts: 3408
Joined: Tue Aug 28, 2007 2:11 pm

Post » Sun Nov 18, 2012 1:50 am

Thanks - am typing from my phone now, but will try it out as soon as I get back to the CK.
User avatar
MARLON JOHNSON
 
Posts: 3377
Joined: Sun May 20, 2007 7:12 pm

Post » Sun Nov 18, 2012 5:18 pm

Hmmm....for some reason it's still not working....I completed the quest in-game and am wearing the Radiant Raiments to prove it - yet the script still isn't recognising completion.

I also tried removing the other condition, and it still doesn't recognise quest completion for SolitudeFreeForm02 - could it be possible that the vanilla quest is never marked as "completed" by the game? That seems unlikely, as once completed the reward is given and quest vanishes from the log.
User avatar
Jessie Rae Brouillette
 
Posts: 3469
Joined: Mon Dec 11, 2006 9:50 am

Post » Sun Nov 18, 2012 4:16 pm

Hmmm....for some reason it's still not working....I completed the quest in-game and am wearing the Radiant Raiments to prove it - yet the script still isn't recognising completion.

I also tried removing the other condition, and it still doesn't recognise quest completion for SolitudeFreeForm02 - could it be possible that the vanilla quest is never marked as "completed" by the game? That seems unlikely, as once completed the reward is given and quest vanishes from the log.
I don't know the quest so I can't say, but maybe change the logic. How about checking http://www.creationkit.com/Quest.GetStageDone_(Papyrus) instead? Just dig in the CK to find what stage gives you the reward and pass it in.
User avatar
Tanika O'Connell
 
Posts: 3412
Joined: Fri Jan 26, 2007 1:34 am

Post » Sun Nov 18, 2012 1:14 pm

I don't know the quest so I can't say, but maybe change the logic. How about checking http://www.creationkit.com/Quest.GetStageDone_(Papyrus) instead? Just dig in the CK to find what stage gives you the reward and pass it in.

Yes! That works - thanks....so it seems that the quest is never actually marked as completed, but the last stage in the quest (the one that gives the reward) is recognised - so that's a workaround. Is this then a bug in the vanilla quest, or do all misc/radiant quests work like this?
User avatar
Killer McCracken
 
Posts: 3456
Joined: Wed Feb 14, 2007 9:57 pm

Post » Sun Nov 18, 2012 5:15 am

Is there such a thing as "GetActiveMagicEffect" or similar?

I want the final condition of this script to detect if the player has the Lovers Comfort power active.

The nearest I could find on the CK page was "GetEquippedSpell". I thought that maybe that would work, set at 2 (ie. a spell that the player has but not in either hand) but no luck.
User avatar
koumba
 
Posts: 3394
Joined: Thu Mar 22, 2007 8:39 pm

Post » Sun Nov 18, 2012 8:13 am

Is there such a thing as "GetActiveMagicEffect" or similar?

I want the final condition of this script to detect if the player has the Lovers Comfort power active.

The nearest I could find on the CK page was "GetEquippedSpell". I thought that maybe that would work, set at 2 (ie. a spell that the player has but not in either hand) but no luck.

I haven't worked with Magic Effects, but I'd recommend taking a look at this: http://www.creationkit.com/ActiveMagicEffect_Script

I can tell you for sure that the GetEquippedSpell isn't what you want. That is for when a player gets a spell "ready". You can find out what spell the player has in each hand.
User avatar
Kortniie Dumont
 
Posts: 3428
Joined: Wed Jan 10, 2007 7:50 pm

Post » Sun Nov 18, 2012 5:06 am

Is there such a thing as "GetActiveMagicEffect" or similar?

I want the final condition of this script to detect if the player has the Lovers Comfort power active.
Okay, I found this: http://www.creationkit.com/HasMagicEffect_-_Actor which will probably do what you want.
User avatar
Angus Poole
 
Posts: 3594
Joined: Fri Aug 03, 2007 9:04 pm

Post » Sun Nov 18, 2012 1:10 am

Thanks for finding that! - it seems as though it should work, but doesn't appear to work in-game unfortunately. It just seems to be ignored completely.

LoversComfort is defined in properties as magic effect MarriageSleepAb:

Scriptname ShrineDonationDibella extends ObjectReferenceMiscObject Property Gold001 AutoQuest Property TendingTheFlames AutoQuest Property FitForAJarl AutoMagicEffect Property LoversComfort AutoSpell Property TempleBlessing AutoMessage Property BlessingMessage AutoMessage Property AltarRemoveMsg AutoActor property PlayerRef autoimport debugEvent OnActivate(ObjectReference akActionRef)  if akActionRef == PlayerRef																	 ;We don't want NPCs activating this	If PlayerRef.GetItemCount(Gold001) < 25		  debug.messagebox("You need at least 25 gold to offer a donation! Worship the embodiment of beauty through the arts, and please Dibella as you please your lover.") ;(make the transaction fail)   ;<===Convert to message object	ElseIf (Game.GetPlayer().HasMagicEffect(LoversComfort))		  TempleBlessing.Cast(akActionRef, akActionRef)		  AltarRemoveMsg.Show()		  BlessingMessage.Show()		  debug.messagebox("Your acts of physical love please Dibella as you please your spouse - she grants a blessing for free!")	ElseIf TendingTheFlames.IsCompleted()		  PlayerRef.RemoveItem(Gold001, 5)		  TempleBlessing.Cast(akActionRef, akActionRef)		  AltarRemoveMsg.Show()		  BlessingMessage.Show()		  debug.messagebox("Your poetic and musical artistry at the Bard's College is pleasing to Dibella - she grants a blessing for just 5 gold!")	ElseIf (FitForAJarl.GetStageDone(30))		  PlayerRef.RemoveItem(Gold001, 10)		  TempleBlessing.Cast(akActionRef, akActionRef)		  AltarRemoveMsg.Show()		  BlessingMessage.Show()		  debug.messagebox("Your appreciation of fine clothing pleases Dibella - she grants a blessing for just 10 gold!")	Else		  PlayerRef.RemoveItem(Gold001, 25)		  TempleBlessing.Cast(akActionRef, akActionRef)		  AltarRemoveMsg.Show()		  BlessingMessage.Show()		  debug.messagebox("Dibella grants your blessing! Worship the embodiment of beauty through the arts, and please Dibella as you please your lover.")Endif  EndIfEndEvent
User avatar
Heather Kush
 
Posts: 3456
Joined: Tue Jun 05, 2007 10:05 pm

Post » Sun Nov 18, 2012 3:06 am

Just a quick bump on this - if anyone has any ideas as to why HasMagicEffect may not be working, or if it's an issue with a known workaround, then the info would be much appreciated - I'd like to be able to finish my Advanced Shrine Blessings mod, but can't do so until I can figure this out.
User avatar
Emma Parkinson
 
Posts: 3401
Joined: Wed Jul 26, 2006 5:53 pm

Post » Sun Nov 18, 2012 3:00 am

According to vanilla Skyrim the magic effect MarriageSleepAb isn't used by anything. You can view a use report by right-clicking and selecting "Use Info". Try substituting for RestedMarriageSkillEffect instead.

On a side note change this:
ElseIf (Game.GetPlayer().HasMagicEffect())
To this:
ElseIf PlayerRef.HasMagicEffect()

If you can use "PlayerRef" instead of Game.GetPlayer() you should. (Properties are reported to be much, much faster)
Especially since you actually do add the player as a property there is no reason you should use Game.GetPlayer()
User avatar
c.o.s.m.o
 
Posts: 3419
Joined: Sat Aug 12, 2006 9:21 am

Post » Sun Nov 18, 2012 1:43 pm

Aha! Thanks for the advice - will give it a try!
User avatar
Sara Lee
 
Posts: 3448
Joined: Mon Sep 25, 2006 1:40 pm


Return to V - Skyrim