Determining if the player is directly taking a thing (vs. "take all" or implicit taking)

For the record, I7 does have a phrase for checking whether multiple actions are being processed: the I6 parser is running multiple actions. For example:

Report taking the confetti when not (the I6 parser is running multiple actions):
	say "Special case text goes here."

It check the value of multiflag in I6. From the standard rules:

To decide whether the I6 parser is running multiple actions:
	(- (multiflag==1) -).
1 Like

Right now I’m not looking at the text of the player’s command for this, but if I do, I have a plan.

OK, the code I used was pretty short:

Simple take flag is initially false.

Carry out taking when the number of entries in the multiple object list is zero and the implicitly taking activity is not going on:
	now simple take flag is true.

Every turn when simple take flag is true:
	say "A simple take occurred on turn [turn count] with command '[the player's command]'.";
	now simple take flag is false.

Setting the flag in the carry out taking rules ensures that the taking action is successful.

Using multiflag is not quite as reliable as using number of entries in the multiple object list, possibly because ‘multiflag’ is used in an unrelated role during some parsing and may be left in that state. See comments at the end of Parser Letter D:

! multiflag is used here to prevent inappropriate MULTI_PE errors
! in addition to its unrelated duties passing information to action routines

In your test scenario, you can see that using multiflag will get a false positive:

A simple take occurred on turn 4 with command "put confetti on table".
1 Like