Hey all,
I'm working on a mod that involves a lot of equipping and unequipping items on the player actor, and of course I'm dealing with all of the pain that comes with dealing with Bethesda's weird ass inventory handling.
I finally tracked down the SKSE EquipItemById function, which sounds like a perfect solution, but after scouring the wiki and the psc files provided with SKSE, I'm struggling to find a way to actually get the necessary itemId int hash. It seems like the only built-in way to generate the hash is to use the GetEquippedItemId function, but it seems like I should be able to generate a hash from any ObjectReference, right? They contain information about the object's display name and enchantment status, which seems to be what the hash is based on.
Am I missing something, or is the only way to get that hash to take my object ref, equip it onto a dummy actor, retrieve the itemId hash with GetEquippedItemId, then delete the actor? And if there is no built-in way, does anyone know what math the function is doing so I could make my own function to do the same thing?
Hopefully that made sense. Thanks in advance for any replies.