Making an exception to an every turn rule

For ambiance, I have a character doing something every turn.

Every turn when the location is the checkout:
	say "[one of]The cashier yawns loudly[or]The cashier loudly snaps her newspaper, then turns the page[or]The cashier stands up straight, then stretches her arms upward and outward[or]You can hardly believe how empty the pharmacy is. There isn't a single customer lined up at the cashier's counter[or]The cashier looks at you over the top of her newspaper, as if sizing you up[cycling].".

However, it’s inelegant when the player engages with the cashier, since there is already text characterizing the action.

What is the correct phrasing to skip this every turn rule when the player is performing specific actions? Or can I? I’ve tried lots of things and am simply not getting it right.

1 Like

There’s probably a more elegant way to do this, but I’d just create a truth state called like cashier-talking, set it to true in an after asking the cashier about or telling the cashier about rule (adding whatever other possible cashier actions there are – showing, giving), then having the every turn rule fire the ambient text if the truth state is false, or if it’s true set it to false for the next turn. Kludgy? Sure! Workable? Probably!

3 Likes

I’ve often thought it would be nice to have an action rulebook that happens after the Report stage finishes (i.e. after the action is truly complete) but before the Every Turn rules, for “aftereffects” of the action. It turns out this is actually quite difficult to make work in all situations (how should it interact with actions tried silently during the course of another action?), but you can often do the same thing with Every Turn rules.

Because as it happens, all rulebooks in Inform can, by default, care about the current action. You can say “every turn of waiting” the same way you say “before waiting” or “instead of waiting”.

So:

Asking the cashier about is engaging in conversation.
Answering the cashier that is engaging in conversation.
[etc]

Every turn when not engaging in conversation:
2 Likes

maybe an After rule instead?

Definition: an object (called o) is involved rather than uninvolved if o is the noun or o is the second noun.

After doing something when the location is the checkout and the cashier is uninvolved,
  say "cashier does their thing.".
1 Like

The trick here is that After rules come before Report rules (and block them, by default!) so this will come before (or instead of) the results of a successful action but after the results of an unsuccessful action, which I’ve always found mildly unintuitive. “After” rules are a weird beast that I seldom use for that reason.

3 Likes

I had thought that wouldn’t work 'cause I was half-remembering Supplied missing noun forgotten by end of turn (so scene change fails)? . We’re actually warned in WI 12.10 to not use the current action phrase in an every turn rule. But depending on what the action had been in an every turn preamble is ok. Weird.

I was forgetting that ‘involved’ is a built-in concept with the if [action] involves [object] phrase, so maybe…

the previous action is an action that varies.
before doing anything, now the previous action is the current action.
every turn when the location is the checkout:
  unless the previous action involves the cashier, say "whatever."

But this would fail to activate on, say, examining the cashier, so @Draconis’ specifying of the engaging in conversation kind of action would allow more control.

3 Likes

Great replies, everyone! I’ll be able to learn something from every option.

This one just occurred to me:
When in doubt, spread it out!

Every turn when the the location is the checkout  (this is the checkout area rule):
	if buying the action figure:
		do nothing;
	otherwise if talkingtoit the cashier:
		do nothing;
	otherwise:
		say "[one of]The cashier yawns loudly[or]The cashier loudly snaps her newspaper, then turns the page[or]The cashier stands up straight, then stretches her arms upward and outward[or]You can hardly believe how empty the pharmacy is. There isn't a single customer lined up at the cashier's counter[or]The cashier looks at you over the top of her newspaper, as if sizing you up[cycling].".

I do it this way. Works well and is easy to manage.

Only if you end up in a situation where you have to set the ‘spoke-to-cashier-this-turn’ flag to true in so many different places in your code that it’s getting unruly would I think of going to a more complex system.

-Wade

2 Likes