irswat Posted February 27, 2017 Share Posted February 27, 2017 (edited) Is there any way to apply a generic inventory filter for example to capture whenever any weapon is added or removed from inventory? I need to figure out the best way to keep track of items a player has in inventory, as well as spells learned, and shouts known. I have a method that involves going through inventory and filling formlists with items, but this must be done every time the player presses a key. Latency is a concern so I figure dumping inventory to formlists when the script is first initialized and then keeping the script updated whenever an item is added or removed is the most efficient way to keep an accurate list of a players inventory. I was thinking I could have multiple onitemadded/removed events that generically capture weapons, armor, ammo, potions, spell books, and update inventory formlists as necessary. any suggestions?I noticed I can filter by keywords. Do all weapons have a weapon keyword? do all armors have an armor keyword? etc. if so i could do this. Edited February 27, 2017 by irswat Link to comment Share on other sites More sharing options...
irswat Posted March 1, 2017 Author Share Posted March 1, 2017 anyone: is it possible to filter by keyword instead of formid/formlist? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted March 1, 2017 Share Posted March 1, 2017 The AddInventoryEventFilter only allows the object or objects if a formlist to trigger the OnItemAdded and OnItemRemoved events. I do not think you can use a keyword, although you are welcome to try. Personally, I think it is better to keep it tied to the key press than try adding it to the OnItemAdded and OnItemRemoved events. There are a ton of mods and even scripts in the base game that use these events. It is very easy to overburden the system especially when the player performs a 'take all' action. By keeping your stuff tied to a key press, you are actually making it safer than it would be with the OnItemAdded and OnItemRemoved events. That is my two cents... Link to comment Share on other sites More sharing options...
irswat Posted March 2, 2017 Author Share Posted March 2, 2017 Thanks. I just noticed I was looking at fallout 4 wiki that has a keyword parameter. Link to comment Share on other sites More sharing options...
Recommended Posts