Jump to content

Container: Check if Holotape gets added


Zorkaz

Recommended Posts

A dirty way would be an inventory filter that triggers on anything, then test if the item "IS HOLOTAPE" like

Event Oninit()
   Self.AddInventoryEventFilter(akFilter = None)
EndEvent

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
   If (akBaseItem is Holotape) 
      Self.RemoveInventoryEventFilter(akFilter = None)
      ;do stuff
   Endif
EndEvent

Of course running an everything event triggering filter on a high traffic container like a workshop = not good.

Link to comment
Share on other sites

The Pipboy isn't a container(it's also is not possible to get its objectreference), the player is. So you can apply his script to the player but his warning still applies as the player is a very high traffic container.

 

Assuming I understood that right. If you mean an actual container designed to hold things displayed by the pipboy...that's still gonna go through the player.

 

Note: Containers(not the player/NPCs) can have "allowed" lists which will refuse all items except what is in their "allowed" lists(these are formlists).

Edited by Rasikko
Link to comment
Share on other sites

My Stockmaster Workstation in Concord is monitoring a high traffic container for inventory events regarding all items (by necessity).

Because this can generate lots of inventory events to process, I've integrated a queue: The inventory event handler just adds it's event data to the queue. The queue contents will then get processed in blocks of 5, beginning about 500ms after the last inventory event was added to the queue.

 

Btw, interesting feature, these allowed lists for containers.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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