Jump to content

Does AddInventoryEventFilter() work with keywords in SE


Masterofnet

Recommended Posts

 

Does AddInventoryEventFilter() work with keywords in SE.

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
AddInventoryEventFilter(Keyword)

endEvent

I didn't get this test? How it works?

 

I test script below with keyword but it didn't work ?

 

http://www.creationkit.com/index.php?title=Complete_Example_Scripts#Show_Gift_Inventory_and_Identify_Items_Given

Link to comment
Share on other sites

Yes it works with keywords.

 

You know you would have to be a real moron to come on this thread and post your gibberish after you read the person tested it themselves and it does not work.

 

 

I didn't get this test? How it works?

 

I test script below with keyword but it didn't work ?

 

http://www.creationkit.com/index.php?title=Complete_Example_Scripts#Show_Gift_Inventory_and_Identify_Items_Given

 

 

 

I do not know about the " Script Below" and you do not have to bother testing this, it does not work - like I stated. However if you would like to, this is how I did.

Scriptname KeywordTest extends ReferenceAlias

Keyword Property vendoritemweapon Auto
EVENT OnInit()
AddInventoryEventFilter(vendoritemweapon)  
Debug.Notification("Filter Added")
ENDEVENT


Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
Debug.Notification("Filter Test")
Endevent

Place this script on a reference alias for the player and have them drop anything that is not a weapon. If the notification displays, then the inventory filter using a keyword does not work.

Edited by Masterofnet
Link to comment
Share on other sites

Of course it will not work with keywords. The input parameter is of Form and while it will compile with a Keyword, keywords are not added to the player inventory and thus they cannot trigger the OnItemAdded event.

 

If you want to deal with only items of a specific keyword, you have a couple of options.

 

1. Check each added item for the keyword and skip it if it does not match. Works but can potentially bog down if a ton of items are transferred at once.

 

2. Create an empty formlist to use in the inventory event filter and use an xEdit script to create a patch file and add every object with the keyword from every plugin currently loaded into the formlist. A little more work on the users end but is adaptable and allows only the items you want to work with to trigger the OnItemAdded event.

Link to comment
Share on other sites

Of course it will not work with keywords. The input parameter is of Form and while it will compile with a Keyword, keywords are not added to the player inventory and thus they cannot trigger the OnItemAdded event.

 

Actually, using keyword in the Fallout 4 Kit does work. That is the reason I asked the question. Before anyone answered I had decided to download the SE kit and tested it. It does not work in the Skyrim SE Kit.

 

The Item would trigger the event and the the function would look for the keyword on the form.

 

http://www.creationkit.com/fallout4/index.php?title=AddInventoryEventFilter_-_ScriptObject

 

 

Thank you for stating this again. I am new in papayrus and I had a hard time to get around this.

 

Glad to help.

 

 

2. Create an empty formlist to use in the inventory event filter and use an xEdit script to create a patch file and add every object with the keyword from every plugin currently loaded into the formlist. A little more work on the users end but is adaptable and allows only the items you want to work with to trigger the OnItemAdded event.

 

I would like to hear more about how to do this. Someone needs to start a thread about xEdit that details all of its functions and how to use them.

Edited by Masterofnet
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...