Following for an activity rules

It seems if you try to follow a named for activity rule from another rule that it doesn’t do anything. Is this a bug?

The kitchen is a room. The plant is a thing in the kitchen. Rule for writing a paragraph about the plant (this is the describe plant rule): say "It's a beautiful plant." Instead of examining the plant, follow the describe plant rule.

The above example prints nothing when the plant is examined.

It’s easy to circumvent with a “To” phrase, but shouldn’t it work without that?

WI 18.24, the documentation that describes the Writing a paragraph about activity, and in particular, Example 354 (Air Conditioning is Standard), seems to indicate that you want to carry out the activity within an Instead rule rather than following the named rule as you have in your code example:

The kitchen is a room. 

The plant is a thing in the kitchen.

Rule for writing a paragraph about the plant (this is the describe plant rule):
	say "It's a beautiful plant."

Instead of examining the plant:
	carry out the writing a paragraph about activity with the plant.

Output:

kitchen
It's a beautiful plant.

>x plant
It's a beautiful plant.
1 Like

I don’t think the describe plant rule is actionable in this case. It’s stating what should be done while printing a room description. You probably want to carry out the… oh! I see Josh has answered it.

(you can preserve your code formatting on this forum by entering three ``` marks on the line preceding your code)

I think the problem is that rules only generally work as expected from within the same kind of rulebook. An ‘Instead’ rule is in an action-based rulebook, whereas the ‘For writing a paragraph about’ rules are in an object-based rulebook - so your describe plant rule can’t be invoked because there’s no object for its rulebook to currently be acting on.

1 Like

Do you realise that at the moment, when you enter the room or type LOOK, the info that would appears is simply ‘It’s a beautiful plant’? Without even first saying ‘There’s a plant here.’ That’s probably not what you intended. You probably want it to say something typical like, ‘You see a plant,’ but then have X PLANT give ‘It’s a beautiful plant.’

For that, all you need to do is put the plant somewhere, then set a description:

The plant is in the kitchen. Description of the plant is "It's a beautiful plant.".

Activities aren’t really designed for one-off direct calls of code like you were trying here. They’re code that can react to particular circumstances automatically so long as the activity is going on. Writing a paragraph about is one such activity. It prints what you ask it to when a LOOK is carried out and the game has to write about some visible thing in the location.

I recall that I used to forget that a ‘rule for writing a paragraph about’ something worked that way, and did not actually supply a description of the thing.

-Wade

1 Like

Thank you for the correct syntax.