Condensing Register for game update script help.

Post » Sat Jan 31, 2015 2:56 pm

I'm using this script to check if player has the required wood logs for a quest and I know it is way too long. I'm not sure about the syntax, guess I should use && but am not sure about how. It needs condensing. Can anybody do this for me please.

Script -

Actor property PlayerRef autoMiscObject Property Aspens autoMiscObject Property Pines autoMiscObject Property RWoods autoQuest property MyQuest autoEvent OnUpdate()      if (PlayerRef.GetItemCount(Aspens) == 2)      if (PlayerRef.GetItemCount(Pines) == 2)      if (PlayerRef.GetItemCount(RWoods) == 2)          MyQuest.SetStage(100)             elseif (PlayerRef.GetItemCount(Aspens) != 2)    elseif (PlayerRef.GetItemCount(Pines) != 2)    elseif (PlayerRef.GetItemCount(RWoods) != 2)             RegisterForSingleUpdate(3.0)   Endif   Endif   EndifEndEvent

Thanks.

Edit: Even better would that the player gets a message every time a log is collected or dropped like in some quests that I don't remember their names.

Edit, edit: I realised it should be "RegisterForUpdate" not "RegisterForSingleUpdate".

User avatar
Stephanie I
 
Posts: 3357
Joined: Thu Apr 05, 2007 3:28 pm

Post » Sat Jan 31, 2015 3:43 am

http://www.creationkit.com/OnItemAdded_-_ObjectReference

http://www.creationkit.com/OnItemRemoved_-_ObjectReference

http://www.creationkit.com/AddInventoryEventFilter_-_ObjectReference

http://www.creationkit.com/RemoveInventoryEventFilter_-_ObjectReference

^^ Use in a PlayerAlias, add an item filter for the log OnInit and remove when possible.
User avatar
Jessica Lloyd
 
Posts: 3481
Joined: Fri Aug 25, 2006 2:11 pm

Post » Sat Jan 31, 2015 4:51 am

You got it backwards.

User avatar
sophie
 
Posts: 3482
Joined: Fri Apr 20, 2007 7:31 pm


Return to V - Skyrim