Inform 7 Tutorial

Inform 7 Tutorial

© 2005,2006,2007 Jeremiah McCall – permission is granted for non-profit educational reproduction. Please credit the author. Feel free to link to this page but do not reproduce the contents on another webpage

Step I – Rooms, People, and Basic Conversation.

This tutorial provides an approach for a newcomer to Inform 7. For this example, we will design a Roman scenario with two locations, two characters, and some basic responses to player questions

As you follow this tutorial please be aware that while Inform is programmed with English statements, it does not understand English. A given command, therefore, has to be written in a very specific way.

Note on typeface: My comments are in normal text. Instructions for Inform (program code) are in bold. They are working examples of code that Inform will understand (assuming, of course, that there are no typos). Commands that a player playing the game might enter are rendered in italics.

To create a room, Inform’s name for any location in gamespace, type _______ is a room. Then write a description for the player to see and enclose in double quotes ” “.

The Sacra Via is a room. “The Sacred Way runs from the northwest to the southeast. To the northwest is the forum.”

The following lines create a second room and locate it northwest of the first room. Rooms can be any of the eight directions + above and below another room. In this case, the player can type >go northwest or just >ne and will move from the Sacra Via to the forum.

The Forum is northwest of the Sacra Via. “The Forum Romanum is bustling with merchants, politicians, slaves, and street vendors. The law courts of the praetors are thronged with bystanders and the old and new shops along the Fulvian and Sempronian basilicas are teeming with activity. A hundred transactions are occurring at any given moment and the air is buzzing with possibilities. To the north stands the comitium, the meeting place of the Roman assembly and the rostra, the podium for addressing the Roman assembly. Further in the distance is the curia, the hall of the Roman senate. Northwest of the forum the Capitoline hill looms large with the temple to Jupiter standing as a guardian over the city. Southeast of the Forum runs the Sacred Way (Sacra Via). “

These sentences create a character, a man called Lucius. Lucius is placed in the forum and given a description. When the player types look at Lucius she/he will see the description.

Lucius is a man. Lucius is in the forum. The description of Lucius is “A striking looking Roman garbed in a toga with a narrow purple stripe. He seems to be going about his business.”

Same thing as above except a woman named Julia is created.

Julia is a woman. Julia is in the forum. The description of Julia is “A striking looking Roman in a pale blue dress. She seems to be going about her business.”

This statement allows the player to ask Lucius a question. Questioning happens when the player commands >ask (someone) about (something). In the example below, if the player commands >ask Lucius about business the response will be displayed using the say command

After asking Lucius about “business”:
say “Lucius says, ‘I am involved in various businesses. I own vineyards in Campania and an eel farm in Antium, among other things.”

A response if the player commands >ask Lucius about eel farms

After asking Lucius about “eel farm”:
say “Lucius says, ‘As you know, eels are a prized delicacy for those who can afford them.”

A response if the player commands >ask Julia about business

After asking Julia about “business”:
say “Julia says, ‘I am in the forum looking for cloth.'”.

A response if the player commands ask Julia about cloth

After asking Julia about “cloth”:
say “Julia says, ‘the finest cloth available so that I may take it to a seamstress to make a gown for my daughter.”

Step II – Adding Things

In step II we will add some things to the program we have already established. “Things” in Inform-speak, are any physical objects in the game world. In this example we will create a ring and cause the characters Lucius and Julia to respond to the player’s attempts to give each of them the ring.

The majority of the program will remain unchanged.

First let’s create the ring. Write this code after the lines creating the Sacra Via room. (They could be written anyplace, but organization is a very good idea.)

The ring is in the Sacra Via.

One could, if they wished, describe the ring just as one described a person, by writing The description of the ring is “A beautiful ring with a family crest.”. Remember, descriptions like this are only displayed when the player types a command like >Look at ring or >examine ring

Once a thing is created it can be picked up and dropped by the player through commands like >take ring and >drop ring. A player can always see what she is carrying by typing the command >inventory or just >i

Now we can write instruction for how to handle it if the player gives the ring to Julia and/or Lucius. For this example, let’s assume the ring is Lucius’

By default, when the player attempts to give something to a character, the character is uninterested and does not accept the item. This can be changed using the instead command.

Instead of giving the ring to Julia:
say “Julia waves you off gently: ‘that is not my ring.’ You notice Lucius’s eyes light up.”.

Notice that the player will just read Julia’s response. No instructions have been written for the ring to change hands. Since the ring is Lucius’, we will want to have the ring actually be given to Lucius. Both the “say” instruction and “now” instruction are both carried out when the player types >give Lucius the ring  or >give the ring to Lucius

Instead of giving the ring to Lucius:
say “Lucius clasps your hand and gushes,’thank you! I don’t know how I could have lost my family’s ring.’ He takes the ring from you and places it on his finger.”;
Now Lucius is carrying the ring.

  1. ВалокПролетарск
    February 15, 2017 at 3:02 pm

    RE:Inform 7 Tutorial | Gaming the Past Валок КРН Верещагино

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: