Adding GetBaseObject() did nothing. Can't seem to get a gold value from anything... Can someone confirm GetGoldValue() is working and what you got a value from?
Edit:
With SKSE I wrote a small script that examines everything in an NPC's inventory and gives me a copy of items found with a gold value > 0. It finds all kinds of stuff, like salt piles, weapons and gems. But if I form property those items into my script and use GetGoldValue() on them, the value is always 0. (The properties are filled.)
Edit #2
More weirdness.
form property saltpile autoEvent OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) game.getplayer().additem(saltpile) objectreference myOR = game.getplayer().dropobject(saltpile) debug.notification("form is is worth: "+myOR.GetBaseObject().GetGoldValue())EndEvent
While in inventory while pickpockeing the code returns 0. While in my own inventory, I get a value of 2.
Edit #3
Scratch that. It's not the particular inventory. The first time the script is run, the value is zero. The second time the script is run, I get a value. I also get the same result with the GetWeight() function. Anyone know what's up with that?