Manual:DIL Manual/baseweight
Jump to navigation
Jump to search
Contents
baseweight
Field (integer, read-only; units: all).
u.baseweight : integer
The weight of the unit itself, in pounds, without anything it carries or contains: an empty bag, a character's body. It is the weight line of the unit in the zone file. The total, with contents, is the weight field, so u.weight - u.baseweight is what the unit holds.
Notes
- Read-only: vmc refuses an assignment ("Illegal lvalue"). Use set_weight_base(), which also changes the weight of the unit and of everything it is in.
- On null it fails.
Example
dilbegin size_part(part : unitptr, corpse : unitptr);
var
w : integer;
code
{
w := corpse.baseweight / 30;
if (w > 100)
w := 100;
if (w < 1)
w := 1;
set_weight_base(part, w);
return;
}
dilend
Makes a body part weigh a thirtieth of the corpse it was cut from, between 1 and 100 pounds, as in death.zon.