New Extension: Actions on Groups

That was sort of my thought. After the rulebook runs, check if anything has been subtracted. If it has, remove those, and send the new multiple object list back for processing. Ideally this would happen recursively until nothing more is removed. Then the usual action processing rules take over for what’s left of the list. So a rule for placing a number of glasses on the table would remove all of them from the list, but allow any other objects to be handled as usual.

What Draconis said. That would facilitate the thing I was referring to.

New version of the extension is up at GitHub. I included the “prepare to continue the action” phrase and the “when dealing with (description)” phrase, and bg’s glasses example which demonstrates them. I didn’t try to include the stuff about removing things from the multiple object list this time around; it still seems possibly like it could get more confusing to me. I’ll have to think about how to implement it. I also added Andrew Plotkin’s Serial And Fix, which seems especially likely to be useful with this extension, and which AFAICT currently only lives buried in one of the threads on this forum.

Thanks again for all the suggestions!

EDIT: Changed the link to reflect the new location at GitHub.

After a few hours bashing my head against walls… so, printing special “examine” text for a particular group of objects is always going to either involve the TLoA workaround, or else need your nice fancy extension that is meant to flexibly handle all kinds of actions? (I ask because there’s just the one group I need to have its own examine-text, and all these pages-long solutions seem a bit overkill. But if that’s just how things are, then buckle down I must and yoink the pages-long solutions.)

Well, yeah, but my extension should be pretty easy! Just do this:

Examining is groupable action.

Understand "examine [things]" as examining.

Action on groups rule for examining when dealing with [your list of items here]: [Your response here].

and you should be good to go! That’s really the main use-case for my fancy extension, all the other flexible stuff is things that happened in response to other more complicated uses we thought of.

(Again, the fundamental reason you need to do this fancy stuff is that Inform’s only model for acting on a group of things is to act on each of them in a row, so the TLHoA solution is to take care of all that when acting on the first item, and then short-circuit the action for the rest of them. The extension basically just automates it.)

The location of the extension at GitHub has now changed slightly; it is:

https://github.com/i7/extensions/blob/master/Matt%20Weiner/Actions%20on%20Groups.i7x

(The dash between my names has been changed to a space, in conformity with most other people’s folders at Friends of I7.)

So now that Inform 6M62 has a multiple action processing rulebook this should probably get some tweaks to deal with that… though it still seems to compile and work OK in 6M62, and if I changed it to use the multiple action processing rulebook I’d lose the default success. Hmmm.

It does seem as though, if I want to make it possible to implement the new “Western Art History 305” example elegantly using the example, I’d have to include that functionality for removing things from the multiple object list that everyone’s been clamoring for. So maybe I’ll do that.