Saying something after the standard search results?

Hello all,

I would like the searching container/supporter action to behave regularly, but then say something more about, at least under specific circumstances. For other actions, I can usually do this overriding the Report doing the thing etc, but since searching uses the Reportaction, I’m not sure how I can achieve the effect in this case.

Any recommendations other than rewriting searching, which for obvious reasons I would rather avoid?

1 Like

What did you have in mind for the additional text (in terms of where it would appear and under what circumstances)? Is this something that After searching ... could be appropriate for?

It’s a simple fixed text (to wit, something like say “Most importantly, what you’re looking for is not there.”but I cannot use the After part because this comes before the Report 8-/

1 Like

You can write your own report rule, and then specify that it’s the last rule:

Report an actor searching (this is the final search report rule):
	say "Your inspection is complete."

The final search report rule is listed last in the report searching rules.
3 Likes

Ooh, I didn’t expect that part to be a rulebook in itself! (I really need to understand rulebooks better)

1 Like

Each stage of action processing is a rulebook so you can easily add or subtract rules. So, if you wanted your “what you’re looking for is not there” text to appear after the player searches something that isn’t a container or a supporter, you’d have to do something like this:

The can't search unless container or supporter rule is not listed in any rulebook.

Report an actor searching (this is the standard report searching rule):
	if the noun is not a container and the noun is not a supporter:
		if the player is the actor:
			say "[We] [find] nothing of interest."
	
The standard report searching rule is listed after the standard search supporters rule in the report searching rulebook.

The Standard Rules for searching includes a check rule that stops the action when the noun is neither a container or a supporter. You actually don’t need to specify where the rule is listed in this case (I just put that in to show another way to order rules). You can also use the RULES command to see what rules generate what responses, and the Actions tab of the index can show you what rules apply to a command, and the order in which they are evaluated.

2 Likes

A shortcut is to declare:

Last report an actor searching:
	say "Your inspection is complete."

With that syntax, no need to name the rule and to manually move it to the end of the rulebook.

4 Likes

That is true, but then you can’t do something like this:

The final search report rule does nothing when the noun is the beachball.
2 Likes

You’re not generally going to use “does nothing when…” for your own rule. It’s easier to write

Last report an actor searching when the noun is not the beachball:

…or put an “if” in the rule body.

3 Likes

Thank you all, I’m learning a lot of things, or finally understanding some of things I had read about actually work!

1 Like