Using Global Counter to count different types of objects

Post » Sun Feb 17, 2013 4:34 am

I have this script below which I've used to count items of the same type/ID, e.g. candlesticks (all the same). In the quest I am currently working on player has to collect clues, 1 being a MISC object the other a Potion. If I use the same script I'm sure it'll mess up/won't count the potion. How can I amend this?

Scriptname GlobalCounterScript extends ObjectReference

GlobalVariable property GlobalCount auto
Quest property myQuest auto
MiscObject property Obj auto

Int property preReqStage auto
Int property StageToSet auto
int myCount

Auto State Ready
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
if myQuest.GetStage() == preReqStage
if akNewContainer == Game.GetPlayer()
utility.wait(0.10)
myCount = Game.GetPlayer().GetItemCount(Obj)
GlobalCount.SetValue(myCount)

if myCount == 2
myQuest.SetStage(StageToSet)
endif
GoToState("Picked")
endif
endif
EndEvent
EndState
State Picked
EndState
User avatar
daniel royle
 
Posts: 3439
Joined: Thu May 17, 2007 8:44 am

Return to V - Skyrim