Testing whether handling an activity

I posted what I thought was a bug regarding this; but it turns out it’s documented in 18.7. I find it weirdly counterintuitive, but apparently it’s the intended behaviour. So never mind.

[spoiler]Is it just me, or are “if handling the [foo] activity:” conditions completely broken? It looks like checking one of these conditions actually causes Inform to initiate the activity.

Morning is a room. "The sun is rising."

When play begins:
	if handling the printing the plural name activity, say "[1] ";
	if handling the printing a number activity, say "[2] ";
	if handling the printing room description details activity, say "[3] ";
	if handling the printing inventory details activity, say "[4] ";
	if handling the listing contents activity, say "[5] ";
	if handling the grouping together activity, say "[6] ";
	if handling the writing a paragraph about activity, say "[7] ";
	if handling the listing nondescript items activity, say "[8] ";
	if handling the printing the name of a dark room activity, say "[9] ";
	if handling the printing the description of a dark room activity, say "[10] ";
	if handling the printing the announcement of darkness activity, say "[11] ";
	if handling the printing the announcement of light activity, say "[12] ";
	if handling the printing a refusal to act in the dark activity, say "[13] ";
	if handling the constructing the status line activity, say "[14] ";
	if handling the printing the banner text activity, say "[15] ";
	if handling the reading a command activity, say "[16] ";
	if handling the deciding the scope activity, say "[17] ";
	if handling the deciding the concealed possessions activity, say "[18] ";
	if handling the deciding whether all includes activity, say "[19] ";
	if handling the clarifying the parser's choice activity, say "[20] ";
	if handling the asking which do you mean activity, say "[21] ";
	if handling the printing a parser error activity, say "[22] ";
	if handling the supplying a missing noun activity, say "[23] ";
	if handling the supplying a missing second noun activity, say "[24] ";
	if handling the implicitly taking activity, say "[25] ".

It seems clear that nothing above the “Welcome” line ought to be printed. I couldn’t see anything about this in the bug tracker, though I may well have overlooked it.[/spoiler]

1 Like

Yeah, the name of that function is confusing. What is really does is “carry out ACTIVITY; if that invoked no rules…”

The simple test you want is “if ACTIVITY is going on…”

1 Like