Daily Nugget # 4: Implementing a new command with support for ALL

Hi All, In my WIP I wanted to add custom commands with support for ALL. In the attached snippet I have tried to work out a case for a command commonly used by beta testers which somehow is missing from the Standard Rules. I also added a beta tester in the scenario, and made him willing to do anything the player asks (for beta testing purposes). However the scenario does have some flaws: I tried to exclude the command from targeting people, but this does not work cleanly for all cases:

>lick beta
I don't suppose the beta tester would care for that.
 
>lick all
You lick the table, the apple, the pear, the grapefruit, and the banana.
 
>lick apple and beta
You lick the apple and the beta tester.
 
I don't suppose the beta tester would care for that.

Feedback is very much appreciated!

Based on example “The Left Hand of Autumn” in 17.4. Standard tokens of grammar (ganelson.github.io).

2 Likes

Probably not the response you were hoping for, but I must admit that I’m enjoying the fact that “lick all” is an implemented action above.

2 Likes

I think this:

Rule for deciding whether all includes people when an actor multi-licking: it does not.

… only kicks in when the command really is “lick all”, not when there are multiple objects given by name, as in:

>lick apple and beta
You lick the apple and the beta tester.

I don’t suppose the beta tester would care for that.

So, the check rule (can’t multi-lick other people rule) catches the person case, but for the first case (apple), the process will go through to the Carry out rule, where you print the whole list of matched things (which includes the person).

So, to exclude the person, you can change the Carry out rule, specifically what you assign to L:

Carry out an actor multi-licking when group-description-complete is false:
	let L be the list of matched things which are not people;
	say "[We or the actor] [lick] [L with definite articles].";
	say line break;
	now group-description-complete is true;

Output:

>lick apple and beta
You lick the apple.

I don’t suppose the beta tester would care for that.

5 Likes

I’m not sure if this is unpopular or I don’t know what actually is going on, but in ZIL it’s implemented as:

> LICK ALL
red apple: It's got a waxy coating on.
blue apple: I don't think you would care for that, so I won't let you.
green bread: No thanks!

So that it is understandable which is happening when.

1 Like

Just trying to be helpful here to the army of poor beta testers who manually lick everything in sight…

1 Like

True enough. If you want the landry-list approach of e.g. the take command, the code will be much simpler:

It will also more cleanly handle unreachable items (like the melon in the closed glass case). I only tried to go for the listing approach since it feels more natural to me. Many thanks to Zed et al who helped me iron out the details for most of this experiment, I have learned at lot!

2 Likes

And then I found out additional empty lines are introduced if I add any After rule. If I change the Carry out rule into a Report rule (as the standard take command does), then it works for the player. When I ask the beta tester to do a lick all or take all, then a blank line is added for every thing in the list. At least it is consistent with standard verb behaviour, but I’d like to know where that extra line is suddenly coming from… Also, the code shown does not cater for tense for the player (neither does the standard take command, which will always report Taken.), so I currently use this for the reporting bit:

Report an actor licking:
	if the action is not silent:
		if the actor is the player:
			say "[We] [lick] [the noun].";
		otherwise:
			say "[The actor] [lick] [the noun].";
1 Like