I’ve been using the Action on Groups extension (thanks, Matt Weiner) and it is very helpful. One question: It doesn’t seem to handle a single object, only groups.
For example:
ORDER BREAD AND CHEESE
will execute properly, but
ORDER BREAD (or any single item)
will not invoke any rule. I think that is because the multiple object list is 0 and does not trigger the Action on Groups rule for Ordering.
Ordering is an action applying to one visible thing.
Understand "order [things]" as ordering.
Ordering is groupable action.
[This is for ordering a single item]
[Instead of ordering in Inn:
say "Is that all?";
now noun is on table 4;
now moneyAmt of display-money is price of noun;
say " Gracie places the [noun] on your table. 'That'll be [coinage of display-money]' ";
]
Instead of ordering in Inn:
follow the action on groups rule for ordering;
[When using rule fails/succeeds, do not use 'instead'.]
This is the ordering check rule:
say "[number of entries in the multiple object list] ";
if location is not Inn:
say "You are not at the proper eatery for that action.";
rule fails;
if the player is not on Table 4:
say "Gracie passes by and says, 'Please take a seat before you order, [title of player]'.";
Action on groups rule for ordering:
follow the ordering check rule;
if rule failed:
clear the multiple object list;
rule fails;
otherwise:
say "You order [the multiple object list].";
let L be the multiple object list;
let N be the number of entries in L;
now moneyAmt of display-money is 0.0;
repeat with Item running through L:
now Item is on Table 4;
[Clear dummy money object for tallying]
increase moneyAmt of display-money by price of Item;
say "The bill comes to [coinage of Display-money][line break]";
if moneyAmt of Display-money > moneyAmt of cash:
say "You don't have enough money for all that food!";
rule fails;
otherwise:
try examining table 4;
say "To pay for and eat this food, say EAT MEAL."; rule succeeds;
This code removes money from the player and adds calories to the player (so he/she doesn’t starve) but it is not invoked for single things. Or do I have it wrong?
Notice that I commented out the individual ORDERing action that I needed i parallel with group ORDERING.
Note also that Instead of ordering in Inn:
follow the action on groups rule for ordering;
gives a compile error: Ordering rule is too vague.