Jump to content

Recommended Posts

Posted

So I'm working on my Bag of Holding mod, and I'm having trouble getting a new feature to work. What I'm trying to do is use the NVSE functions GetHotkeyItem and player.GetEquippedObject to build a FormList of the base IDs of all hotkeyed and player-equipped items, which I'm then trying to use an exclusion list for player.RemoveAllTypedItems calls.

 

Unfortunately, it's not working as expected. Specifically, I'm seeing the following problems:

  • If the player chooses to protect just equipped items, then all items get deposited - including equipped ones.
  • If the player chooses to protect hotkeyed items (or both hotkeyed and equipped items), then no items get deposited - including non-hotkeyed, non-equipped items.

 

Anyone know what the heck is going on? I've pasted my script into the spoiler tag below. Look under the "3 - NEW VALUE" comment for the most relevant section of code.

 

 

  Reveal hidden contents

 

 

I've tried commenting out the checks relating to whether or not hotkeyed and/or equipped items should be protected, so I know there's no problem there. It has to be something I'm doing with the FormList.

Posted
The only thing I can think of is that the exception formlist parameter to RemoveAlltypedItems is required to be a formlist containing only base forms. Before adding anything to that list, I'd check if it's a base form and if not, gets its base and then add that.
Posted
Thanks. I also posted this in a more appropriate forum section and got some help from rickerhk that led me to a working solution :)
  • Recently Browsing   0 members

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