Combine reports extension

Eric Eve’s “Combine Reports” extension works very nicely for summarizing similar reports, but it doesn’t provide an equally nice summary for a single instance of a MultipleObjectAnnouncement.

The resulting transcript looks something like this:

> take all
You take the note, the bowling ball, and the knife.

> drop knife
Dropped.

> take all
knife: Taken.

The last line would ideally be “You take the knife.”

I can get that behavior by modifying the afterActionMain routine in the extension’s actionReportManager and changing it to work on lists of at least one object, instead of two or more. I’m just wondering if there’s a reason it doesn’t do that by default - perhaps the capability is provided by some core library functionality that I’m not aware of?

Any thoughts?

This looks more like a oversight by Eric rather than a design decision. Maybe it’s a good idea to report that directly to him or open an issue about it on bugdb.tads.org.

I can’t recall why I did it this way; it may be at the time I wrote the extension I wasn’t sure that people would want it to override the single object case in this way. I’ll take another look at it in due course and maybe add in an option.

EDIT: Okay, I’ve now taken a look and made the following tweak at the start of the actionReportManager object:

actionReportManager: object
    /* 
     *   The minimum number of objects that must be in a list before we 
     *   attempt to summarize it. Normally this will be 2, but it may be 
     *   that some games will want to change it to 1, for example, so that 
     *   the same reporting style is used for singleton objects as for lists.
     */
    
    minLengthToSummarize = 2
    
    afterActionMain()
    {        
        /* 
         *   If the action isn't iterating over at least 
         *   minLengthToSummarize direct objects we have nothing to do, so 
         *   we'll stop before doing any messing with the transcript
         */
        
        if(gAction.dobjList_.length() < minLengthToSummarize)
            return;

By default the extension will behave as before, but changing actionReportManager.minLengthToSummarize to 1 will change the behaviour to that requested by the OP.