GetWeight

From NWN Lexicon
Revision as of 17:25, 30 May 2013 by 82.84.136.192 (talk) (→‎Remarks)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to 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