How to get the references of items inside a container?

Post » Sun Jun 17, 2012 9:00 pm

Ultimately Im looking to dynamically change different items gold value. For now, I want to try and get all the items within a certain chest and make them worth 2 times as much. These items could be anything put into a container. I thought there would be a function somewhere to see what's in a container but I can't seem to find it.
Any help or tips towards this would be appreciated.
User avatar
kirsty williams
 
Posts: 3509
Joined: Sun Oct 08, 2006 5:56 am

Post » Sun Jun 17, 2012 5:54 pm

You could check the script at PlayerBookShelfContainer. It uses OnItemAdded and OnItemRemoved events to check what gets in and out. But notice that is limited to a max number of references...So maybe you should work with an ObjectReference array instead of 18 properties.

Let us know how it works. I'm curious about it, maybe i'll try tomorrow :)
User avatar
Yvonne Gruening
 
Posts: 3503
Joined: Mon Apr 23, 2007 7:31 pm

Post » Mon Jun 18, 2012 8:39 am

I'll take a look and report back, thanks

(edit)
Ok, so thanks for leading me to the bookshelf, it had a lot of helpful things to look at which lead me to more things and so on... namely:
Event OnItemAdded
Event OnItemRemoved
GetItemCount()
GetBaseObject()

Form.GetGoldValue()

As you may tell, the majority of my problems are knowing the functions...
User avatar
Betsy Humpledink
 
Posts: 3443
Joined: Wed Jun 28, 2006 11:56 am

Post » Mon Jun 18, 2012 12:36 am

So next I want to SET the gold value (in code), since I know how to do it from the object editor, any more finger pointing would help as I search.
User avatar
Lexy Corpsey
 
Posts: 3448
Joined: Tue Jun 27, 2006 12:39 am


Return to V - Skyrim