Event whenever item enters player's inventory?

Post » Fri Aug 29, 2014 2:08 am

is there any event that triggers when a item (from which the script is called) enters player's inventory? and no, container change doesnt work, since when I get the item from my chest it wont trigger the script, I have to drop it on the ground and pick it up

User avatar
I love YOu
 
Posts: 3505
Joined: Wed Aug 09, 2006 12:05 pm

Post » Fri Aug 29, 2014 9:55 am

http://www.creationkit.com/Onitemadded

User avatar
Sophie Miller
 
Posts: 3300
Joined: Sun Jun 18, 2006 12:35 am

Post » Fri Aug 29, 2014 4:16 pm

if I understand the event right, I have to call it from player's inventory, how do I do that?

User avatar
Greg Cavaliere
 
Posts: 3514
Joined: Thu Nov 01, 2007 6:31 am

Post » Fri Aug 29, 2014 6:53 am

Make a quest alias named PlayerAlias -> specific Reference (cell: all, actor:playerREF), put the script on this alias.

User avatar
Beat freak
 
Posts: 3403
Joined: Thu Dec 14, 2006 6:04 am

Post » Fri Aug 29, 2014 10:37 am

So that OnItemAdded doesn't run for items you don't care about, you can use this: http://www.creationkit.com/AddInventoryEventFilter_-_ObjectReference

User avatar
Benito Martinez
 
Posts: 3470
Joined: Thu Aug 30, 2007 6:33 am

Post » Fri Aug 29, 2014 12:20 pm

no matter what I do with player inventory, the quest stage & objective never changes

Scriptname ItemReceiveEvent extends ReferenceAlias  Quest Property ThisQuest  Auto  Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)	ThisQuest.SetObjectiveCompleted(10)	ThisQuest.SetObjectiveDisplayed(20)	ThisQuest.SetStage(20)endEvent

and I seem to not be able to find a way to post a picture, so anyone who wants to help me and check if I created alias right (specific reference - Ref; 'PlayerRef' (00000014) to NPC_ 'Player' (00000007)) send me a PM,

thanks!

and yes, "ThisQuest" is script alias for the correct quest

User avatar
Katie Louise Ingram
 
Posts: 3437
Joined: Sat Nov 18, 2006 2:10 am

Post » Fri Aug 29, 2014 1:23 am

It should be Specific Reference > Cell (Any) > PlayerRef

User avatar
Jynx Anthropic
 
Posts: 3352
Joined: Fri Sep 08, 2006 9:36 pm

Post » Fri Aug 29, 2014 1:07 pm

that's how it is

Specific Reference > (any) > PlayerRef 'Player', the thing I posted is the text from updated button text in Fill Type section

User avatar
Vera Maslar
 
Posts: 3468
Joined: Wed Sep 27, 2006 2:32 pm

Post » Fri Aug 29, 2014 1:33 am

That will appear when using that format.

It doesn't really matter though, you could also use the Unique actor version. Both point to the Player Actor form (0000007).

User avatar
Luis Longoria
 
Posts: 3323
Joined: Fri Sep 07, 2007 1:21 am

Post » Fri Aug 29, 2014 1:42 am

Matthaswag you got a PM with screenshot of alias dialog, unfortunatelly, I cant send it to you Terra >.<

edit: neither unique actor for player nor player inventory seem to not be working

User avatar
Beat freak
 
Posts: 3403
Joined: Thu Dec 14, 2006 6:04 am

Post » Fri Aug 29, 2014 2:40 am

I'm not sure why it isn't. It looks like it should...

User avatar
Neil
 
Posts: 3357
Joined: Sat Jul 14, 2007 5:08 am

Post » Fri Aug 29, 2014 3:08 am

Made a quest test. There's no way your method shouldn't work.

I made a small quest with 3 stages.

0 (start up)

5

10

My Objectives are just two indexes.

0 = "I need to find an item". This item being an alias that is created at the player's position on start up.

10 = "Find another item". This comes up when said item is found.

The script I used is similar but different functions used:

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)        GetOwningQuest().SetObjectiveCompleted(0)        GetOwningQuest().SetCurrentStageID(10)        ; The new objective will be displayed in the stage fragment.    EndEvent

Stage 5: SetObjectiveDisplayed(0)

Stage 10: SetObjectiveDisplayed(10)

When item is picked up/added, Stage 10 is called.

So check out how your stages and objectives are set up.

User avatar
Poetic Vice
 
Posts: 3440
Joined: Wed Oct 31, 2007 8:19 pm


Return to V - Skyrim