how can I suppress system-generated messages (adv3Lite)

When Harry gets up from his bed, he needs to put on his clothes. There are three individual items of clothing available—pants, shirt, and shoes. He can put each on individually, or either of the following commands results in his putting on all of them: wear all or put on clothes.

I have also added a new verb rule for get dressed, which also results in Harry putting on all three items of clothing.

But the text displayed in the game window is awkward…

I want to suppress that parenthetical first taking… text that comes after the first two items are put on.

In fact, just to get that required some gymnastics in the code.

I thought at first I could just redirect the command to one of the commands that already works…

doInstead(Wear, 'all')

…but that doesn’t work. Tracking progress in the debugger shows it doing the redirect but then failing when it can’t do anything with ‘all’.

So, I now do three individual redirects…

// get dressed
VerbRule(GetDressed)
    'get' 'dressed'
    : VerbProduction
    action = GetDressed
    verbPhrase = 'get dressed/getting dressed'
;
DefineIAction(GetDressed)
    execAction(c)
    {
        if(runningShoes.isWornBy(harry) &&
           hoodie.isWornBy(harry) &&
           cargoPants.isWornBy(harry))
            "Harry was already wearing his pants, shirt and shoes. There was
            nothing else to put on. <.p>";
        else
        {
            doInstead(Wear, runningShoes);
            if(runningShoes.isWornBy(harry))
               "Harry put on the shoes. <.p>";
            doInstead(Wear, hoodie);
            if(hoodie.isWornBy(harry))
               "Harry put on the hoodie. <.p>";
            doInstead(Wear, cargoPants);
       }
    }
;

Without the if statements, I get…

He ends up wearing all items, but the game window only acknowledges the last one, the pants.

With my if statements, I get all three items acknowledged, but the parenthetical test—the game generated first taking text—is in the wrong position.

So, my question is, can I suppress that parenthetical text? More generally, can I intercept the game’s output stream? How? Where is it? I’ve looked and can’t find it, not just for this command, but other places as well; the system text is fine for some things, but other times it’s in the way.

Thanks.

Jerry

There are some points here I want to take a further look at, which I don’t have time to do right now, but in the meantime I think you could get reasonable output with something like this:

DefineIAction(GetDressed)
    execAction(c)
    {
        local lst = gActor.getOutermostRoom.allContents.subset(
            {x: x.isWearable && x.wornBy == nil });
        
        if(lst.length == 0)
            "There was nothing left there for Harry to put on. ";
        else
        {
            local repList = [];
            foreach(local garment in lst)
            {
                doInstead(Wear, garment);
                repList += garment;
            }
            
            c.action.reportList = repList;
        }
            
    }    
;

The implicit action announcement (first taking…) is produced by Action.buildImplicitActionAnnouncement, so one way to selectively suppress it would be to define something like:

modify Action
    buildImplicitActionAnnouncement(success, clearReports = true)
    {
        if(showImplicitAction)
            return inherited(success, clearReports);
        
        return nil;
    }
    
    showImplicitAction = true 
;

Then you could temporarily switch off the implicit action report with something like this:

DefineIAction(GetDressed)
    execAction(c)
    {
        local lst = gActor.getOutermostRoom.allContents.subset(
            {x: x.isWearable && x.wornBy == nil });
        
        if(lst.length == 0)
            "There was nothing left there for Harry to put on. ";
        else        
        {
            Action.showImplicitAction = nil;
            local repList = [];
            foreach(local garment in lst)
            {
                doInstead(Wear, garment);
                repList += garment;
            }
            
            c.action.reportList = repList;
            Action.showImplicitAction = true;
        }
            
    }    
;

Success!

Both things work—the code that builds the garment list and does a redirect for each item works the way I was hoping for…

…and the Action modification lets me selectively suppress the system-generated text (although as well is the first fix works, this second may not be necessary here but it’s a great trick to know :slight_smile:.

Thanks.

Jerry