Suppressing Disambiguation message

Man did I fall into a rabbit hole of documentation and source code combing, and came up empty. I am looking to suppress the disambiguation notification in certain conditions. This is an approximation of the scenario:

cleanRag : Thing 'clean rag*rags' 'clean rag' @startRoom
     "A rag so clean it could plausibly be used as an ascot.  "
;
filthyRag : Thing 'dirty filthy rag*rags' 'filthy rag' @startRoom
     "A lump of cloth so nasty, no one would want to touch it.  "
     dobjFor(Take) {
          verify() {  logicalRank(50, 'ewwwNo'); }
     }
;

What I get:

>get rag
(the clean rag)
Taken.

What I want:

>get rag
Taken.

…where player gets the clean rag. Let’s assume for the moment that I have thought through the implications of this for the player, and am comfortable with the potential ambiguity :] I dove into disambig.t routines, filterAmbiguousX routines, and Resolvers but have so far not really pieced the flow together enough to intercede effectively. Anyone else been down this path?

1 Like

I’ve done this. Let me find my relevant code…

1 Like
modify libMessages

    announceAmbigActionObject(obj, whichObj, action) {     
    	if(obj.suppressAnnounceAmbig) return '';
        else return inherited(obj,whichObj,action); }
    announceDefaultObject(obj, whichObj, action, resolvedAllObjects) { 
    	if(obj.suppressAnnounceAmbig) return '';
        else return inherited(obj,whichObj,action,resolvedAllObjects); }
;
modify Thing
    suppressAnnounceAmbig = nil 
;

You could get more detailed by defining suppressAnnounceAmbig(action) and changing the if-checks in the announce… methods to pass the current action. I didn’t find that necessary…
Hope this helps!

1 Like

Wow, super fast and worked first time! Thanks so much!!!

1 Like