Inform - Support - Patches

About Patches  

Compiler  
Library  

DM4 Errata  

Issue L60706

TAKE/REMOVE messages mixed up
Submitted by: Adam Cadre     Appeared in: Library 6/7 or before     Fixed in: Library 6/10
Problem

Take is the Inform verb for taking objects off the floor; Remove is the verb for taking them out of containers. (This is not to be confused with TAKE THING vs. REMOVE THING -- I'm speaking of the names of the verbs in the source code, not the dictionary words.) Thus, it's often desirable to have two different "after" messages for each verb:

  after [;
     Take: "You reel the black cable out a bit.";
     Remove:
       "You pull the cable out of the input jack.";
  ];

The problem is that the unmodified library produces the following transcript:

  >TAKE CABLE
  You reel the black cable out a bit.

  >PUT CABLE IN JACK
  You plug the black cable into the input jack.

  >TAKE CABLE
  You reel the black cable out a bit.
Solution

The lines producing this unfortunate behavior are found in VerbLibm.h:

  [ RemoveSub i;
    i=parent(noun);
    if (i has container && i hasnt open) return L__M(##Remove,1,noun);
    if (i~=second) return L__M(##Remove,2,noun);
    if (i has animate) return L__M(##Take,6,i);
    if (AttemptToTakeObject(noun)) rtrue;
    action=##Take;   if (AfterRoutines()==1) rtrue;
    action=##Remove; if (AfterRoutines()==1) rtrue;

    if (keep_silent==1) rtrue;
    return L__M(##Remove,3,noun);
  ];

Note that if there is an after routine for Take, it will override the after routine for Remove -- even though this is the Remove routine! To give Remove its proper precedence over the less specific Take, simply switch the two lines beginning with "action".


Last updated 17 April 2013. This web site has not been fully supported since April 2008. Information may be out of date. This page was originally managed by Roger Firth.