This is probably something I should’ve explained better in the documentation, but the Action on Groups rule needs to handle the entire action, including its effect. So the reason the glasses aren’t ending up on the table in this case is that you haven’t told the rule to put them there… the actions will run as usual for everything else, because of the “make no decision,” but by then you’ve removed all the glasses from the multiple object list.
So! All you need to do is put “now the item is on the table” in the code block where you increment G. All the rule succeeds/make no decision stuff looks like you’ve got it working correctly (in fact you don’t even need the “rule succeeds” clauses, I don’t think–as long as you don’t hit the “make no decision” in the final block then the rule will succeed, because the Action on Groups rulebook has default success).
There’s another problem, though, which is much more oh dear for the extension. “Put four glasses and the vase and the pitcher on the table” doesn’t work, I think because when Inform starts with Extras as the multiple object list the noun is still one of the glasses. I tried changing the noun to the first entry of the multiple object list, and that succeeded in getting the vase onto the table, but the announcement for it still said “glass:”–maybe the current item from the multiple object list was already set by that point too? So I tried changing the current item from the multiple object list by hand, and it seems to work, but it makes me feel all hinky.
Here’s what I have now, and the test script is working:
Include Actions on Groups by Matt Weiner.
A glass is a kind of thing.
The player carries six glasses, a pitcher, and a vase of flowers.
Dining Area is a room.
A table is a supporter in Dining Area.
Test me with "put two glasses on the table / look / put three glasses and the pitcher on the table / look / take all / put four glasses and the vase and the pitcher on the table / look"
Putting something on something is a groupable action.
Action on groups rule for putting glasses on the table:
let G be a number;
let Extras be a list of things;
repeat with item running through the multiple object list:
if item is a glass:
increment G;
now the item is on the table;
otherwise:
add item to Extras;
Say "You carefully set [G in words] glasses on the table.";
if the number of entries in Extras is 0:
rule succeeds;
if the number of entries in Extras is 1:
let item be entry 1 in Extras;
clear the multiple object list;
if G > 0:
say "[item]: [run paragraph on]";
try putting item on the table;
rule succeeds;
otherwise if the number of entries in Extras > 1:
alter the multiple object list to Extras;
let item be entry 1 in Extras;
now the noun is item;
now the current item from the multiple object list is item;
make no decision.
(I also wrote something to make "pitcher: " show up before “Done.” in the second test case.)
But another thing is that, as written, the rule doesn’t apply until you hit a glass on the multiple object list–if you write “put vase and three glasses on the table” the result will be screwy. The way to get around that would be to change the rule heading to “Action on groups rule for putting something on the table:”, and make sure if there are no glasses in the list it makes no decision and doesn’t print “You carefully put zero glasses on the table”. Actually since it’ll make no decision as long as there’s anything in the list that isn’t a glass, all you need to do is avoid the “zero glasses” message.
OK, so here’s what I have now:
Include Actions on Groups by Matt Weiner.
A glass is a kind of thing.
The player carries a pitcher, six glasses, and a vase of flowers.
Dining Area is a room.
A table is a supporter in Dining Area.
Test me with "put two glasses on the table / look / put three glasses and the pitcher on the table / look / take all / put four glasses and the vase and the pitcher on the table / look"
Putting something on something is a groupable action.
Action on groups rule for putting something on the table:
let G be a number;
let Extras be a list of things;
repeat with item running through the multiple object list:
if item is a glass:
increment G;
now the item is on the table;
otherwise:
add item to Extras;
if G > 0:
say "You carefully set [G in words] glasses on the table.";
if the number of entries in Extras is 0:
rule succeeds;
if the number of entries in Extras is 1:
let item be entry 1 in Extras;
clear the multiple object list;
if G > 0:
say "[item]: [run paragraph on]";
try putting item on the table;
rule succeeds;
otherwise if the number of entries in Extras > 1:
alter the multiple object list to Extras;
let item be entry 1 in Extras;
now the noun is item;
now the current item from the multiple object list is item;
make no decision.
Not as intuitive as I hoped! Maybe I should just put a note in the documentation that says that using the extension to consolidate action reports and pass some of the objects through to normal processing is complicated. More likely, it would be a good idea to put in some phrases that automatically handle all the sort of stuff at the end, so you could write something like “try the putting it on action with Extras as a group on the table” and it would invoke a phrase “try (action name) with (list of objects) as a group on (object)” that automatically handles altering the multiple object list, and setting the noun and current item from the multiple object list.
(Oh, also, if you put one glass and the vase on the table you get “one glasses.”)