Talk:GetCurrentStageID - Quest

From the CreationKit Wiki
Jump to navigation Jump to search

getstage in a script for a lot of quests[edit source]

Hi,

is it possible to do a getstage for a lot of quests without the use of dozens of questproperties? There is no onstory function that could be used, sadly, like checking if a quest advances to a new stage. Is there any other possibility?


I wouldn't think this would be possible. The scripts are basically encapsulated (isolated) from everything else, so you have pass in the quest properties. (There is one possible "hack" way that might be possible, but would only apply to quests in the ESM, so don't think it would help anyway.) --Sollar 06:20, 12 June 2012 (EDT)




I had trouble finding example scripts to do what I wanted to do, so maybe this additional example could help someone:

; Enables five enemies when you bump into the trigger zone at the ambush point but only during a certain time during the quest. 
        If MyQuestProperty.GetStage() >= 5 && MyQuestProperty.GetStage() < 99
		MyActorProperty1.enable(True)
		MyActorProperty2.enable(True)
		MyActorProperty3.enable(True)
		MyActorProperty4.enable(True)
		MyActorProperty5.enable(True)			
	EndIf

--David Brasher 15:06, 24 March 2012 (EDT)




Another example combining a few Quest functions:


 Quest Property ExampleQuest Auto
 MiscObject Property ExampleKey Auto
 Function DoThis()
   If Game.GetPlayer().GetItemCount(ExampleKey) && ExampleQuest.GetStage()== 10
     ExampleQuest.SetStage(20)
   EndIf
 EndFunction

--Sollar 06:20, 12 June 2012 (EDT)