This repository was archived by the owner on Sep 16, 2025. It is now read-only.

Description
Hi All,
Just wanted to say thanks for the efforts going into this, I've only started looking into creating a mod in the last couple of weeks, I have a quick question if I may, I know it's still early days so if it's the fact that this hasn't been worked on yet, I can go away until it has (I'd love to be able to contribute but have no idea how to get started).
I'm just playing at the moment and I'm trying to loop over my players inventory and have got this far:
auto* player = RE::PlayerCharacter::GetSingleton();
auto name = std::string(player->GetDisplayFullName());
logger::info("Player name: {}", name);
if (player) {
player->ForEachInventoryItem([&](const RE::BGSInventoryItem& a_item) {
auto reference = a_item.object;
if (reference) {
logger::info("Inventory Item: isWeapon: {}, FormID: {}, Object Type name: {}", reference->IsWeapon(),
reference->formID, reference->GetObjectTypeName());
}
return RE::BSContainer::ForEachResult::kContinue;
});
} else {
logger::info("Player not loaded");
}
My question is two part:
- I've found from experimentation, that there is only one entry in the foreach loop for each item even if I hold multiple instances of that item. Is it possible to get the count for each inventory item?
- Is there a way to get the name of the item - I've investigated the form object but cannot for the life of me figure out how to get the name.
Any help you can give is much appreciated and I look forwards to being able to use any further updates to the library.
CoderSparks