With my attempt to go through all items in player inventory, and work with the gold value of each, I ran into an unexpected problem: I can only get the value of the base item, not enchantments, using GetNthForm, GetItemCount and GetGoldValue.
player.removeallitems(chest_hidden,TRUE,FALSE) int playerInvValue=http://forums.bethsoft.com/topic/1503453-getting-gold-value-of-enchanted-items/0 int itemCount Form akForm int NumOfItems = chest_hidden.GetNumItems() While(NumOfItems> 0) NumOfItems -= 1 akForm = chest_hidden.GetNthForm(NumOfItems) itemCount=chest_hidden.GetItemCount(akForm) playerInvValue=http://forums.bethsoft.com/topic/1503453-getting-gold-value-of-enchanted-items/playerInvValue+itemCount*akForm.GetGoldValue() endWhile chest_hidden.removeallitems(player,TRUE,FALSE) bkQuest.sc_chest_out.removeallitems(player,TRUE,FALSE) Debug.MessageBox("Player Value = "http://forums.bethsoft.com/topic/1503453-getting-gold-value-of-enchanted-items/+ playerInvValue as string)
The core issue seems to be that I'm getting the base objects, not objectreferences as akForm?
What would be the best way to get the actual value of items in an inventory? (the player's inventory is the ultimate goal, but I'm using the "remove items to a hidden chest, and then back" -trick to avoid counting quest items, if that matters)
Also I plan to do more than just sum up the values eventually, a function on each value, if that matters.