Getting and setting script variables on inventory item

Post » Sun Jan 18, 2015 1:52 am

Hey guys it's been a while since I've been around here. I can't remember if a solution was ever found for this.

If I know the base object type, how can I get and set script variables on the object reference in the player's inventory? If I know beforehand that the player has atleast one of the items, is it possible? The variables are locally set on each instance of the object references. Each script will have something like:

Int Property SomeValue = http://forums.bethsoft.com/topic/1513115-getting-and-setting-script-variables-on-inventory-item/0 Auto Hidden

Which I want to set in some way like this:

ObjectInInventory.SomeValue += 1

Is this possible? I looked to see if there was a way to grab the object out of the player's inventory and place it in the world somewhere to set the variables, but RemoveItem() only accepts a container, or oblivion.

User avatar
Hannah Barnard
 
Posts: 3421
Joined: Fri Feb 09, 2007 9:42 am

Post » Sun Jan 18, 2015 3:29 pm

I should add that there won't be a way to "grab" the object before it's ever added to the player's inventory. So putting the object into a property in another script to hold it there isn't an option really.
User avatar
Erich Lendermon
 
Posts: 3322
Joined: Sat Nov 03, 2007 4:20 pm


Return to V - Skyrim