I've released my ESM utility called Inventory and weight: http://skyrim.nexusmods.com/downloads/file.php?id=13244
It allows mods to call these functions:
Spoiler
- Float Function getWeight (Form item)
- Bool Function isEquipped (Form item)
- Armor Function getEquippedArmor ()
- Armor Function getEquippedGauntlets ()
- Armor Function getEquippedBoots ()
- Armor Function getEquippedHelmet ()
- Form [] Function getInventoryArmor (Bool equipped = False)
- Form [] Function getInventoryJeweleries (Bool equipped = False)
- Form [] Function getInventoryMiscObjects ()
- Form [] Function getInventoryPotions ()
- Form [] Function getInventoryWeapons (Bool equipped = False)
- Form [] Function getInventoryOther ()
- Float [] Function getWeights ()
How to use:
- set the quest to a property in your script:
kuiawq Property questInv Auto
- call the functions like this:
Float leftWeaponWeight = questInv.getWeight (Game.GetPlayer ().GetEquippedWeapon (1))
- arrays returned have the limit of 128 elements
- after calling any of the getInventory* functions, getWeights () will return an array of the items returned
- e.g.: Spoiler
Form [] equippedArmour = questInv.getInventoryArmor (True)Floats [] weights = questInv.getWeights ()Int i = 0Bool exitLoopWhile i < equippedArmour.Length && !exitLoop Form armour = equippedArmour [i] If armour ;because the array will be 128 Length, there will be elements that are empty Debug.Trace ("equipped armour " + armour + " weight: " + weights [i]) Else ;the loop has hit an empty array. no more items past this. exitLoop = True EndIf i += 1EndWhile - the singular use getWeight (Form item) only returns weight of items that are in the player's inventory.
Here's it's read-me:
Spoiler
Short description
=================
This is a ESM mod utility required by some of my mods. It tracks the player's inventory and the weight of each item in it.
Gameplay changes
================
None. This is a ESM mod utility required by some of my mods. It tracks the player's inventory and the weight of each item
in it.
Activate this mod in an interior cell with few actors.
When first activated, the mod will temporarily remove all your inventory items. It will then require about 60 seconds
to poll each item and calculate its weight. It will take this long because of the amount of items you gain from the
mod giving you back your inventory.
When in normal play, when you acquire new items in your inventory, it will poll those items for their weight. Because of
the small amount of items you gain during normal play, this polling will almost be instantaneous and will have no
impact on your gameplay.
This ESM mod utility will become obsolete in the future when Skyrim Script Extender is released.
Details
=======
The mod polls for the weight of an item by giving it to you, waiting for your inventory weight to change then
removing that item again. During normal gameplay, this happens near to instantaneously that it shouldn't impact
your gameplay.
Modders can use this mod by setting a Script property to point to kuiawqs. E.g.: kuiawqs Property invAndWeightQ Auto
Once done, these methods becom available
to their mods:
Float Function getWeight (Form item)
Bool Function isEquipped (Form item)
Armor Function getEquippedArmor ()
Armor Function getEquippedGauntlets ()
Armor Function getEquippedBoots ()
Armor Function getEquippedHelmet ()
Form [] Function getInventoryArmor (Bool equipped = False)
Form [] Function getInventoryJeweleries (Bool equipped = False)
Form [] Function getInventoryMiscObjects ()
Form [] Function getInventoryPotions ()
Form [] Function getInventoryWeapons (Bool equipped = False)
Form [] Function getInventoryOther ()
Float [] Function getWeights ()
Functions that return arrays (e.g. getInventoryArmor ()) will always return an array with 128 elements.
getWeights () return an array of weights for the inventory query last called. E.g when a query for equipped
jeweleries is called (e.g. invAndWeightQ.getInventoryJeweleries (True)), getWeights () will return the weights for those
jewelery items returned.
=================
This is a ESM mod utility required by some of my mods. It tracks the player's inventory and the weight of each item in it.
Gameplay changes
================
None. This is a ESM mod utility required by some of my mods. It tracks the player's inventory and the weight of each item
in it.
Activate this mod in an interior cell with few actors.
When first activated, the mod will temporarily remove all your inventory items. It will then require about 60 seconds
to poll each item and calculate its weight. It will take this long because of the amount of items you gain from the
mod giving you back your inventory.
When in normal play, when you acquire new items in your inventory, it will poll those items for their weight. Because of
the small amount of items you gain during normal play, this polling will almost be instantaneous and will have no
impact on your gameplay.
This ESM mod utility will become obsolete in the future when Skyrim Script Extender is released.
Details
=======
The mod polls for the weight of an item by giving it to you, waiting for your inventory weight to change then
removing that item again. During normal gameplay, this happens near to instantaneously that it shouldn't impact
your gameplay.
Modders can use this mod by setting a Script property to point to kuiawqs. E.g.: kuiawqs Property invAndWeightQ Auto
Once done, these methods becom available
to their mods:
Float Function getWeight (Form item)
Bool Function isEquipped (Form item)
Armor Function getEquippedArmor ()
Armor Function getEquippedGauntlets ()
Armor Function getEquippedBoots ()
Armor Function getEquippedHelmet ()
Form [] Function getInventoryArmor (Bool equipped = False)
Form [] Function getInventoryJeweleries (Bool equipped = False)
Form [] Function getInventoryMiscObjects ()
Form [] Function getInventoryPotions ()
Form [] Function getInventoryWeapons (Bool equipped = False)
Form [] Function getInventoryOther ()
Float [] Function getWeights ()
Functions that return arrays (e.g. getInventoryArmor ()) will always return an array with 128 elements.
getWeights () return an array of weights for the inventory query last called. E.g when a query for equipped
jeweleries is called (e.g. invAndWeightQ.getInventoryJeweleries (True)), getWeights () will return the weights for those
jewelery items returned.
Once SKSE is released with its links to Papyrus, all this will become obsolete. I can't wait!

