GetWeight

From NWN Lexicon
Jump to: navigation, search



GetWeight(object)

Retrieves the weight of an individual item, or the weight of all objects carried by a single creature.

int GetWeight(
    object oTarget = OBJECT_SELF
);

Parameters

oTarget

Target to determine the weight of. (Default: OBJECT_SELF)


Description

Returns the weight of an individual item. When used on a creature, returns the weight of all items combined carried by that creature (not the creature's actual weight by itself).



Remarks

The number returned isn'€™t in lbs, it'€™s in tenths of lbs. I tested it with a PC carrying 82 lbs worth of gear, and was shocked to learn that her weight was 818!

The function returns 0 on anything that isn'€™t an item or doesn'€™t have items in the inventory. A creature without anything in its inventory has a weight of 0, as do doors, invalid objects, placeables without inventories or empty inventories, etc.


Version

1.30

See Also



 author: Charles Feduke, editor: Lilac Soul