Home
Start a new game
Explore games
Help
Log in or sign up
Log in
Username
Password (
Forgot it?
)
×
New to Playfic?
Full Name
Email
Username
Password
Password (confirm)
Are you sure about this?
My New Game
by
Jim Munroe
Played 2,334 times
View game source
(spoilers!)
Download the
.z8 file
Source Code
"Gentle Introduction to Inform" by Mark Engelberg Chapter 1 - Introduction [It is recommended that you include the following line at the beginning of all your Inform projects. This sets up Inform to recognize American English spellings (as opposed to British English), and to give full-length room descriptions every time the player enters a room.] Use American dialect and full-length room descriptions. [Many games start with a little introductory paragraph to set the tone of the story.] When play begins, say "As you wake up, your head still feels fuzzy. You vaguely remember losing control over your plane while flying over a tropical island..." Part 1 - Creating your world Chapter 2 - Rooms [Every area of your game is called a "room". Each room has a name, which will be displayed in the status bar at the top of the screen while the player is in that room. The room's name should be capitalized, like a title. Each room should also have a description, which is the text that will be printed when the player enters the room, or types "look".] Sandy Beach is a room. The description of Sandy Beach is "You are on a sandy beach. The waves lap rhythmically at the shore. A few pieces of your plane are strewn about on the sand, but most of the wreckage seems to have washed out to sea. A path to the north leads into the jungle." Jungle is a room. The description of Jungle is "You are in the middle of a jungle. You hear a rumbling sound coming from the northeast. The entrance to a cave is to the west. A path leads south back to the beach, or continues north deeper into the jungle." [Once you've described your rooms, you need to explain how they are connected to one another.] Jungle is north of Sandy Beach. [If you don't say otherwise, Inform will assume that since the Jungle is north of Sandy Beach, Sandy Beach is also south of Jungle. A list of directional words and phrases: north, south, east, west, northeast, southeast, northwest, southwest, inside from, outside from, up from, down from] Chapter 3 - Dark Rooms [Sometimes it's useful to make a dark room. The player can't do anything in a dark room unless he's carrying a lit object.] Cave is a dark room. The description of Cave is "The cave is rather small. The cave's exit is to the east." Cave is west of Jungle. Chapter 4 - Doors [A door is an object that connects two rooms. Usually, it can be open or closed. Let's make a door that leads into a stone temple, just north of the jungle.] Temple Entrance is a room. The description of Temple Entrance is "A path from the south dead-ends here at the door to an ancient stone temple." Temple Entrance is north of Jungle. [Sometimes, Inform gets confused by the phrasing "Room Name is a room.", especially when a direction word as part of the room name. For example, if we want to have a room called "Inside the Temple", we can't just say "Inside the Temple is a dark room." This is easily fixed by adding "A room called" to the beginning of the room naming sentence.] A room called Inside the Temple is a dark room. The description of Inside the Temple is "This temple must be where the island natives congregate. The exit is to the south." [Making a door is easy. Just say the object is a door.] The stone door is a door. [If you want the door to begin the game open, add the sentence "The stone door is open."] [Once you have created the door, put it in your game by describing the directional relationships of the door to the rooms on either side of it.] The stone door is north of Temple Entrance and south of Inside the Temple. [The description of the stone door depends on whether the door is open or closed. We'll talk more about this later, but here's a preview of how to do that.] The description of the stone door is "The stone door is [if open]open.[otherwise]closed.[end if]" Part 2 - Filling your world with objects [The most important types of objects are things, containers, and supporters. A thing is any object that you can interact with. A container is something you can put another object in. A supporter is something you can put another object on.] Chapter 5 - Portable Things A stick is a thing. The description of the stick is "It is a long, wooden stick." The stick is in the Sandy Beach. [There are several built-in adjectives that you can use to descrbe various things. Important adjectives: edible - you can eat it wearable - you can wear it lit - the object provides light (lets you see in dark rooms)] A patch of glowing moss is a thing. The description of the moss is "The moss gives off a bright glow." The moss is lit. The moss is in the Jungle. A juicy mango is a thing. The description of the mango is "The mango looks juicy and delicious." The mango is edible. The mango is in the Sandy Beach. A pair of gloves is a thing. The pair of gloves is wearable. The description of the gloves is "The gloves are sturdy and thick." The gloves are in the Sandy Beach. [You can set things to be "carried by" or "worn by" the player at the beginning of the game.] A tiny rock is a thing. The description of the rock is "It's a very small rock." The rock is carried by the player. [When you create a portable thing, it will be automatically listed in the room description, e.g., "You can see a stick here." But often, you want to give a more elaborate description, at least until the first time it's picked up. This is called the thing's "initial appearance".] A brass key is a thing. The description of the brass key is "The key is made of solid brass." The brass key is in the Cave. The initial appearance of the brass key is "In the corner of the cave, you see a brass key partially covered in dirt." Chapter 6 - Things that are fixed in place [The adjective "fixed in place" means that you can't pick up the thing.] A gnarled oak tree is a thing. It is fixed in place. The description of the oak tree is "The tree has probably been standing here for centuries." The oak tree is in the Jungle. [As a variation, you can describe something as "scenery". This means the object is already mentioned in the description of the room, so there's no need to list it separately. Heavy use of scenery can give your room a lot of depth, because it gives the player lots of things they can examine.] Sand is a thing. It is scenery. The description of sand is "The sand is powdery and white." Sand is in the Sandy Beach. Some pieces of your plane are a thing. The plane pieces are scenery. The description of the plane pieces is "All that's left of your plane are a few pieces. You don't see anything important among the pieces." The plane pieces are in the Sandy Beach. Chapter 7 - Containers [Containers can contain other things. There are several built-in adjectives that can be used to describe you container. For example, you can say things like: * The container is openable. (If you want the player to be able to open and close the container, you have to say that it is openable, otherwise the container will be "stuck" in its open or closed position). * The container is closed. (Usuually, a container starts out open unless otherwise specified). * The container is transparent. (This will let you see what's inside of the container, even when it is closed). * The container is lockable. (This lets the player lock and unlock the container with the matching key). * The container is locked. (This starts the container out locked, as opposed to unlocked). * The carrying capacity of the container is 5. (How many things can fit in the container?) Let's apply these concepts to a treasure chest.] A treasure chest is a container. The treasure chest is openable, lockable, closed, and locked. The treasure chest is in Inside the Temple. The description of the treasure chest is "The chest is made of wood, with a big brass lock on the front. [if open]The chest is open. In the chest, you see [a list of things inside the chest].[otherwise]The chest is closed." The initial appearance of the treasure chest is "A sturdy chest is in the corner of the temple." The brass key unlocks the treasure chest. The carrying capacity of the chest is 2. Some gold bars are a thing. The gold bars are in the treasure chest. The description of the gold bars are "If you could get these off the island, you'd be rich!". Chapter 8 - Supporters [Supporters can have things placed on top of them. Like a container, a supporter can have a carrying capacity. If you don't specify, a supporter is assumed to be fixed in place.] A flat boulder is a supporter. The flat boulder is in the Jungle. The description of the flat boulder is "A large flat boulder sits in the center of the clearing." A snake is an animal. The snake is on the boulder. The description of the snake is "You don't remember much about snake identification, but you think the diamonds on its back mean that it is poisonous." Chapter 9 - Enterable containers and supporters [Sometimes a container is big enough for the player to get inside, or a supporter is big enough for the player to sit on, lie on, or stand on. If this is the case, we say that the object is "enterable". For example, the boulder should really be an enterable. Chairs and beds are common examples of enterable supporters.] The flat boulder is enterable. Chapter 10 - Synonyms [Often, it is useful to define synonyms for objects, so that the player can refer to them in more than one way.] Understand "pebble" as rock. Understand "serpent" as snake. Understand "wreckage" as plane pieces. Part 3 - Making rules [Inform automatically handles moving around between rooms, examining things, picking up and dropping things, wearing things, opening and closing things, and so on. The next step is to customize your game by adding special consequences to certain actions. Inform is organized as a bunch of rules. You can add your own rules. The first thing to be aware of is that several different verbs might be associated with the same action. To see the "true name" of each action, click on the Index tab, and go to Actions. For example, by browsing the index, you can see that the phrasings "take [things]", "get [things]", "pick up [things]", and "pick [things] up" are all considered the "taking" action. So when writing rules about what happens when you pick things up, you have to refer to the "taking" action. It's possible to invent your own actions, but for now, we'll talk about how to customize actions that Inform already understands. Next, be aware that for every possible action, (let's use "taking" as an example) Inform will look for the following rules: Before taking, Instead of taking, Check taking, Carry out taking, After taking, Report taking Usually, for each action, Inform already knows a "check" rule (which checks to make sure the action is reasonable, for example, you can't take an object that is fixed in place), a "Carry out" rule (which explains how to make the action happen, for example, when you take an object it moves to the player's inventory), and a "Report" rule which reports back that the action is accomplished (like the message "Taken."). It is possible to modify the existing pre-programmed rules, but most game writers add new rules by writing Before, Instead, and After rules (instead rules are the most common). Writing new rules is a skill that takes practice. Here are some examples to get you started. Let's start by making it so that you can only pick up the snake if you are wearing the gloves. Otherwise the snake bites you and you die.] Instead of taking the snake when gloves are worn: say "As you pick up the snake, it tries to bite you, but the gloves protect your hands."; now the player is carrying the snake. Instead of taking the snake when gloves are not worn: say "As you attempt to take the snake, it sinks its fangs into your bare hands and injects you with a paralyzing venom. In a matter of minutes, you are dead."; end the game in death. [Next, let's make it so the player is too weak to take the heavy gold bars, unless he has eaten the magic mango. First, we need to explain to Inform that our player has two states he can be in, either strong or weak.] A person is either strong or weak. The player is weak. After eating the mango: say "As you eat the juicy mango, you feel a magical wave of strength come over your body."; award 10 points; now the player is strong. Instead of taking the gold bars when the player is weak: say "These gold bars are extremely heavy, you're just not strong enough to pick them up." After taking the gold bars for the first time: say "The bars are heavy, but eating the mango has made you strong, so you pick them up with ease."; award 10 points. After dropping the gold bars: say "The heavy bars drop to the ground with a resounding thud." [A common thing to want to do is to customize the message when you travel from one location to another. Let's make a custom message so that the volcano seems really far away when you walk to it.] Volcano Rim is a room. The description of the volcano is "You are at the rim of an enormous, steaming volcano. You see molten lava deep inside the volcano." Volcano Rim is northeast of Jungle. Instead of going northeast from the Jungle: say "You wander through the jungle for what seems like hours."; continue the action. [If you go into the lava, you die. If you throw anything into the lava, it disappears.] Molten lava is scenery. The description of the lava is "The heat from the glowing, red lava almost burns your face." Understand "volcano" as lava. The lava is in the Volcano Rim. Instead of entering the lava: say "You jump into the lava and die."; end the game in death. Instead of inserting something (called the object) into the lava: say "You throw [the object] into the lava. It flames briefly, and then sinks away from view."; remove the object from play. Part 4 - More about rules, and text alternatives [Right now, every time you do a certain action, you always get the same response. You can add variety to your text, by making it so that each time you do something you get a slightly different message. For example, let's make a diary where the first couple of times you examine it, you get some information, but eventually, it tells you there's nothing more of interest. In the example below, the keyword [stopping] means that once you get to the last choice, it will always print the last choice from then on.] A diary is a thing. A diary is in the treasure chest. The description of the diary is "[one of]You read through the diary, which tells the story of a fearsome pirate.[or]The diary once belonged to a pirate who stashed a pile of gold bars on the island.[or]There is nothing more of interest in the diary.[stopping]" [You can also use rules to reroute one kind of action to another kind of action. For example, if you have a diary, you might want "open diary" to be the same as "examine the diary".] Instead of opening the diary: try examining the diary. [You can also use this same technique to automatically perform one action before doing another. For example, if the player says he wants to examine the diary, he should automatically pick up the diary (otherwise the above description doesn't make much sense). We use the variation "silently try" so that Inform won't print the "Taken." message.] Instead of examining the diary when the player is not carrying the diary: say "(first taking the diary)"; silently try taking the diary; continue the action. [You can use "Every turn" rules to make something interesting happen every turn. Usually, you'll want to vary the messages randomly, as in the following example.] Every turn when the player is in the jungle: say "[one of]You hear a trickle of water in the distance.[or]A plume of smoke rises from the volcano in the distance.[or]You feel a warm breeze brush past you.[or]You hear the growl of an animal from somewhere in the jungle.[in random order]" [Instead of usng the keyword [in random order] we could have used [cycling], which would cycle through the messages over and over again, always in the same order.] Part 5 - Characters [Let's put a pirate character in the cave. When the cave is dark, the player doesn't even know the pirate is there (presumably the pirate is napping in the dark. But when the player comes in with the glowing moss, it awakens the pirate, and he answers questions.] A pirate is a person. The pirate is in the cave. The initial appearance of the pirate is "An old pirate sits in the corner of the cave." The description of the pirate is "The pirate is very old, and wears an eye patch." Instead of going to the cave when the player is carrying the moss: say "As you enter the cave, you hear a voice muttering, 'Arrrr, who's there?'"; continue the action. [Characters come to life if you use random messages to make it seem like they are doing something.] Every turn when the player is in the cave and the pirate is visible: say "[one of]The pirate mutters something under his breath.[or]The pirate blinks slowly.[or]The pirate's eyes droop, as if he wants to go back to sleep.[or]The pirate looks at you warily.[in random order]" [But most impotantly, we need to be able to ask the pirate about various topics. Just put the topic word in quotes.] Instead of asking the pirate about "diary": say "The pirate thinks about your question for a moment and responds, 'Yes, I used to keep a diary, but it's been so many years, I hardly remember how to read or write any more.'" Instead of asking the pirate about "treasure": say "The pirate says, 'Yes, I brought gold bars to the island years ago. But my ship wrecked, and I got stranded. All the gold in the world doesn't do me much good here.'" Instead of asking the pirate about "volcano": say "There is an old legend that the volcano on this island is magic. They say that if you sacrifice something of great value to the volcano, it will grant any wish you desire." [Advanced variation: Sometimes, you want to allow several alternatives. For example, we want to be able to type "ask pirate about escape" or "ask pirate about escaping" or "ask pirate about escaping the island" or other variations. Here's how to do that:] Understand "escape" or "escaping" or "escaping the island" as "[escape]" Instead of asking the pirate about "[escape]", say "I've grown used to living here on the island. I no longer desire to escape. But if you want to escape, the volcano may be the key." Part 6 - Winning the game Instead of inserting the gold bars into the lava: say "You throw the gold bars into the volcano. You feel a sense of magical power building around you, and you say 'I wish I were home.' You feel an explosion of energy around you, and find yourself at home, in your bed."; award 20 points; end the game in victory. The maximum score is 40.