Difference between revisions of "Manual:DIL Manual/setweight()"

From DikuMUD Wiki
Jump to navigation Jump to search
(XML import)
 
(checked against the compiler and the interpreter; example compiles)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
= setweight() =
 +
'''Obsolete.''' <code>setweight()</code> was removed from DIL in 2020; vmc no longer knows the name.
  
−
 
+
Two procedures replace it:
−
<span id="bpsetweight"></span>
+
* [[Manual:DIL Manual/set weight base|set_weight_base(u, w)]] sets the unit's own (empty) weight, and changes its total weight and the weight of whatever holds it by the same amount;
−
setweight( u : unitptr, i : integer )
+
* [[Manual:DIL Manual/set weight|set_weight(u, w)]] sets the unit's total weight, and changes the weight of whatever holds it to match.
−
    u : the unit on which you wish to alter the weight.
+
To add or take liquid from a drink container, change its weight with <code>set_weight()</code>.
−
    i : the new weight
 
−
 
 
−
    This is needed on for example drink-containers. I.e. if you wish to
 
−
    remove or add some liquid, you must also adjust the weight of the
 
−
    container, or you will mess up things.
 
−
 
 
−
---~---~---~---~---~---~---~---~---
 

Latest revision as of 23:25, 14 November 2026

setweight()

Obsolete. setweight() was removed from DIL in 2020; vmc no longer knows the name.

Two procedures replace it:

  • set_weight_base(u, w) sets the unit's own (empty) weight, and changes its total weight and the weight of whatever holds it by the same amount;
  • set_weight(u, w) sets the unit's total weight, and changes the weight of whatever holds it to match.

To add or take liquid from a drink container, change its weight with set_weight().