Check value of an item with a script?

Post » Wed Dec 30, 2009 12:10 am

I want to make a mod that cuts out the need for going to merchants.

I was thinking of making a chest that you add items into and cast a spell on it to turn everything inside into it's gold value, but I need to know how to check the value of an item that is in the chest. Anyone know how?
User avatar
Marcia Renton
 
Posts: 3563
Joined: Fri Jan 26, 2007 5:15 am

Post » Wed Dec 30, 2009 5:04 am

Well it's impossible to get an item reference for an inventory item just like that right now so you might want to use getactivemenuselection on the item in the chest, which makes a reference out of the object you are currently hovering your cursor over, which ofcourse rules out a spell. So you can make a condition that if you press a key(or even a key combo) of your choice and hover the cursor over the item, it calculates the items value and replaces it with gold.
User avatar
Isaiah Burdeau
 
Posts: 3431
Joined: Mon Nov 26, 2007 9:58 am

Post » Wed Dec 30, 2009 3:17 am

Erhm, isn't it as simple as calling GetItems on that container, then iterating over the elements of the array and calling GetFullGoldValue on every item? You only need the base object for that.
User avatar
jessica breen
 
Posts: 3524
Joined: Thu Aug 03, 2006 1:04 am

Post » Tue Dec 29, 2009 8:23 pm

Erhm, isn't it as simple as calling GetItems on that container, then iterating over the elements of the array and calling GetFullGoldValue on every item? You only need the base object for that.


Sure, if you're not afraid of array scripts :P
User avatar
Hayley O'Gara
 
Posts: 3465
Joined: Wed Nov 22, 2006 2:53 am

Post » Wed Dec 30, 2009 10:56 am

Erhm, isn't it as simple as calling GetItems on that container, then iterating over the elements of the array and calling GetFullGoldValue on every item? You only need the base object for that.

True. You will get rich extremely fast with such a mod though - unless you tweak it to only give a percentage of each item's value, but then again, that may be what you want.
User avatar
saharen beauty
 
Posts: 3456
Joined: Wed Nov 22, 2006 12:54 am


Return to IV - Oblivion