Jump to content

[LE] SKSE - Accessing inventory data with a plugin


Lazauya

Recommended Posts

Hello, currently I'm having a bit of trouble with inventories. I want to access entries to the player's or some other container's inventory, but apparently I have come across a strange quirk. I'm taking an object reference and casting it as a ExtraContainerData. Then I acess data->objList to get the tList of EntryData's. However, when I Fall the Count() oft tList, only 5 members are counted, even though I know there are more. The five members appear to be the set of iron armor the player is wearing. I'm very confused as to why this is. Should I be casting the object ref as something else to access the entire list? Or is there another list included in the ExtraContainerChanges I don't know about?

 

For reference, here's a code snippet:

ExtraContainerChanges * pToContainerREF = static_cast<ExtraContainerChanges*>(ContainerREF->extraData.GetByType(kExtraData_ContainerChanges));
ExtraContainerChanges::EntryDataList * pToContainerREFItemList = pToContainerREF->data->objList;
pToContainerREFItemList->Count() //returns 5


I'm using the "default inventory", the inventory that a generic player actor has when they load into a cell without loading a save game or starting a new one.

Link to comment
Share on other sites

Why wouldn't you use papyrus to access a containers inventory, and then pass that to your plugin? speed?

My goal is to eventually add things to the container with just SKSE, but since I was having trouble that more complex task I thought it better to try a more simple one, like finding all the items in said container. But so far all I can find is a list of items that does directly reference some items in the container, but not all. Because of this, I'm very confused.

If you want to know exactly why: I'm trying to add items to the inventory without letting them stack. This might sound stupid, but it's part of a larger project and this is one of the most crucial parts.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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