Global Variable doesn't recognise multiple item taking.

Post » Sat Nov 24, 2012 7:45 am

To elaborate on the title, I've used a few Global Variables for quests where objects to be acquired are spread out over the world - this works fine. My current quest uses a variable to count candlesticks, the sticks were originally all in a chest, 5 in total and taking them 1 by 1 would work and progress the quest when the Global reached 5 but taking them all at once doesn't. I place 1 stick outside the chest, as a clue and as a test, to see if taking the 1 from outside then multi-grabbing the 4 inside the chest would work, that doesn't either. How can I modify the script or any other alternative so that when the player has the 5 sticks the quest continues and you get "Return the candlesticks" message? As I said this only works if the sticks are taken 1 by 1. Here's the current script I am using.

Scriptname GlobalCounterScript extends ObjectReference
GlobalVariable property GlobalCount auto
Quest property myQuest auto
Int property preReqStage auto
Int property StageToSet auto
Auto State Ready
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
if myQuest.GetStage() == preReqStage
if akNewContainer == Game.GetPlayer()
GlobalCount.Mod(1)
if GlobalCount.GetValue() == 5
myQuest.SetStage(StageToSet)
endif
GoToState("Picked")
endif
endif
EndEvent
EndState
State Picked
EndState
User avatar
Jennifer Rose
 
Posts: 3432
Joined: Wed Jan 17, 2007 2:54 pm

Return to V - Skyrim