# Door problem 1

I have a door that I want to be blocked and that the player has to solve a problem to access. In this instance the player would need to say “Sing hymn” to unblock the door. Any suggestions?

``````The east door is scenery.
The east door is a door.
The east door is east of the Ancient Slavery Exhibit and west of the Back Lot room.
The description of the east door is "Barring the door is the sculptures of several angry-looking young men, brandishing torches. Their fire increases the closer you get and are so intense that your skin begins to sizzle."
``````

First you’d need to create the singing action (see Writing with Inform §12.7 “New actions”). If this is supposed to be a one-off situation, you could probably get away with something like this:

``````Hymn-singing is an action applying to nothing.
Understand "sing a/the/-- hymn" as hymn-singing.
Report hymn-singing:
say "You sing a hymn."

The east door is a locked door. It is east of the Ancient Slavery Exhibit and west of the Back Lot room.
Instead of hymn-singing when the locked east door is in the location:
say "As you sing, the flames go out.";
now the east door is unlocked.
``````

If you want to have several different things that can be sung, you could do something like this:

``````A song-type is a kind of value. The song-types are hymn, ballad, and war chant. [or whatever you need]

Singing is an action applying to one song-type.
Understand "sing [a song-type]" as singing.
Report singing:
say "You hum [the song-type understood] to yourself."

The east door is a locked door. It is east of the Ancient Slavery Exhibit and west of the Back Lot room.
Instead of singing when the locked east door is in the location and the song-type understood is hymn:
say "As you recite the hymn, the flames go out.";
now the east door is unlocked.
``````
2 Likes

Thank you.
I think at this point I owe you a [beverage of your choice].

2 Likes