Changing a response rule for 1 turn and issues with (rule) in (number) turns from now

Hi everyone,

I have created a new action applying to two things and I’d like to change the response rule when only one noun is provided. The standard rule is "[action] [something] is too generic.", but I want to change that in "On what?" or something like that. Also, I want it responding like that only for that particular action.

So this is what I tried (the project is in Italian):

Pouring is an action applying to two things.  

Understand "versa [something] su [something]" as pouring.

After reading a command:
	if the player's command matches "versa [something]", now the parser clarification internal rule response (E) is "Su cosa?";
	unless the player's command matches "versa [something]", now the parser clarification internal rule response (E) is "[if the noun is not the player]Cosa vorresti che [the noun] facesse con '[parser command so far]'?[otherwise]'[maiuscolo][parser command so far][maiuscolo]' è troppo generico.[end if] Specifica qualcosa.";

I tried this because I don’t want the response rule permanently changed, but with this source text if I type “versa” then the response rule is still the generic one.

I also tried with re-changing the rule in 1 turn from now, but I have some problem with this command, also in the most simple example. If I type:

When play begins:
	say "Hello!" in 1 turn from now.

Inform does not understand this command.

I am working on the 6L38 release.

Do you know how to achieve my goal and how to solve problems with (number) turns from now?.

1 Like

This is a fragile way to customize the parser output and I don’t recommend it.

It’s much better to add verb grammar that matches what you want the game to understand:

Understand "versa [something] su [something]" as pouring.

Pouring-vaguely is an action applying to one thing.
Understand "versa [something]" as pouring-vaguely.

Carry out pouring-vaguely:
	say "That's too vague."

Or even:

Understand "versa [something]" as a mistake ("That's too vague.")

Thanks for your answer. It doesn’t perfectly fix my problem since I’d like to let the player complete the input for pouring in two commands. So that if the player only types "versa [something]", then he can complete the command with the second noun in the next turn. With your suggestion the action pouring is stopped by pouring-vaguely. But it’s fine, it’s not that important.

Anyway, do you have any idea why the command (rule) in (number) turns from now doesn’t work, even in the simple example in my previous post?

Player inputs are not the same as turns. Parser clarification causes an extra command input which is not a full turn. This is going to throw off your counting. And if anything goes wrong, the parser error could get stuck with the wrong value.

Also, trying to match a player’s command in an “after reading a command” rule is inherently fragile because it doesn’t account for synonyms.

For what you want, it’s best to make the parser clarification message contain conditional text. This is a bit hacky but it works:

To decide what action name is the action-to-be: (- (action_to_be) -).

To say parser-clarification-E:
	if action-to-be is the pouring action:
		say "What then";
	else:
		say "What do you want [if the noun is not the player][the noun] [end if]to [parser command so far]";

The parser clarification internal rule response (E) is "[parser-clarification-E]?".

The action-to-be parsing variable is not normally exposed in I7, but you can use it to see what verb was being parsed when a parser error occurred.

Note that the question mark is left outside of the “[parser-clarification-E]” substitution. This avoids some annoying problems with extra line breaks.

3 Likes

This is very interesting information. Many thanks!

Inform does have some built-in logic to try to figure out missing nouns, so you don’t have to do a lot of work to get it to print clarification questions:

Pouring it on is an action applying to two things.
Understand "pour [something preferably held] on [something]" as pouring it on.
Does the player mean pouring something on something carried: it is unlikely.
Report pouring it on: say "Ok, you pour [the noun] on [the second noun]."

There is a room.  In it is a plant and a sandpit.
The player carries a jug of water.

Test me with "pour water".

(This is obviously incomplete and allows a lot of silly options to be accepted. It’s just for demonstration purposes.)

Here the DTPM rule is required to avoid Inform defaulting to interpreting this as pour jug on jug, or to otherwise assume that you want to pour it onto a carried thing, which is obviously silly (to us) – but as soon as you ban that, then you get nice behaviour – if there’s one thing in the room then Inform will assume that was the target, otherwise it will print a clarification question.

You can define additional DTPM rules to further constrain the default guesswork – for example in a story I’m currently working on I’ve defined water-vessel and water-source kinds of thing, and you can drink from either and fill a vessel from a source, but you can also just fill jug and Inform will guess that you want to fill it from a fountain, because there’s no other water-source around. Without needing to explicitly define vague grammar for that. And it won’t try guessing silly things like filling the fountain from the jug (although it will still let you explicitly request that by typing it in full).

1 Like

there’s a more up-to-date version of the Italian parser ? I have already my share of (solved) issues with the current I7 and isn’t easy keeping around two different version of I7 under Linux…

Best regards from Italy,
dott. Piergiorgio.