Advance objective after multiplay item pickup

Post » Thu Jun 21, 2012 10:09 am

Hey guys,

I have been following the basic quest tutorial on the creation kit website, and am now creating a more detailed questline.

As part of a quest, the player is asked to retrieve a full set of armor (helmet, cuirass, gauntlets & boots)

How can I script it so that the objective advances when ALL of the items have been picked up?

This code is currently applied too all 4 pieces of armor, and at the moment, the quest advances when one piece has been picked up.

Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)
if (newContainer == Game.GetPlayer())
KSQ01.SetObjectivedisplayed(30)
KSQ01.SetStage(30)
endif
EndEvent


There must be some way to say "if cuirass, helmet, boots & gauntlets are in player inventory, SetStage(30)" am I right?

I will really appriciate any help.

Thanks,

JPiiONEFOURONE
User avatar
Rik Douglas
 
Posts: 3385
Joined: Sat Jul 07, 2007 1:40 pm

Post » Thu Jun 21, 2012 11:01 am

Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)    if (newContainer == Game.GetPlayer())        if (KSQ01.GetStage() < 30)            if (newContainer.GetItemCount(Boots) && newContainer.GetItemCount(Cuirass) && newContainer.GetItemCount(Gauntlets) && newContainer.GetItemCount(Helmet))                KSQ01.SetObjectivedisplayed(30)                KSQ01.SetStage(30)            endif        endif    endifEndEvent
User avatar
Heather Dawson
 
Posts: 3348
Joined: Sun Oct 15, 2006 4:14 pm

Post » Thu Jun 21, 2012 10:56 am

alternatively you can set up the objective as a "collect 4/4" similar to many of the favor quests (like "bring me 5 fire salts"), where each piece of armor will advance the objective counter by 1, and the object will complete when it hits 4/4. its a lot more complicated, but it looks nice, and especially useful if your armor pieces are scattered in different areas
User avatar
Amanda Furtado
 
Posts: 3454
Joined: Fri Dec 15, 2006 4:22 pm


Return to V - Skyrim