Beginner's questions

I am trying to adapt Robert Browning’s dramatic monologue “My Last Duchess” into IF – partly to see whether the medium is suited to the form, but also because writing hundreds of lines of pseudo blank verse/heroic couplets is, let’s face it, great fun! See [url]https://intfiction.org/t/the-dramatic-monologue-if/6857/1]. I find myself struggling with the programming side of it, however.

Here are some questions in no particular order:

I am trying to make the Duke follow the player (when the player is the Duchess), and while the following works, I would like to insert a “Let us go…” message before the new room description:

Every turn when the player is the duchess: If the duke is not in the location: move the duke to the location.

If I put a “say” in this rule, the message will only display after the room description, so I take it I could use a “before” rule of some kind.

Also, I would like “[examine] the Duchess” to refer to different things depending on where the player is. If he is in the gallery, it should refer to “the painting”, if in the gallery and the skull has been discovered (I use a number variable, SearchTest, for this) it should refer to “the skull”. How would I implement this? I should also mention that It’s further complicated by the fact that “the Duchess” is also sometimes a player character.

Thanks!

Try:

Before going from a room when the duke is in the location:
	say "'Follow me.'"

The “from a room” clause is necessary to distinguish successful going actions from unsuccessful ones. If you just wrote “Before going when the duke is in the location”, the message would appear before “You can’t go that way.”

This is what “does the player mean” rules are for. See 17.19.

zarf’s suggestion is useful if you want the noun “Duchess” to always be applicable to multiple things. However, if you want limit “Duchess” to mean certain things in certain situations, you can use conditional understand rules:

Understand "Duchess" as the player when the player is the Duchess.

Understand "Duchess" as the painting when the player can see the painting and the player cannot see the skull.

and things like that. WWI 16.7 “Context: understanding when” (in 6G60) has additional examples.