Inform 7 Handbook
by Jim Aikin
version 2.0 (May 2015)
valid for 6L38
The Inform 7 Handbook is copyright (c) 2015 by Jim Aikin. The Inform 7 Handbook has been released under and is subject to the terms of the Creative Commons Public License, the terms of which are hereby incorporated by reference. Please see Appendix C of this book and read it before using this material. Your use of this material signifies your agreement to the terms of the License.
You are free to copy, distribute, and transmit this work, and you are free to excerpt and adapt it, in whole or in part, subject to the following conditions:
1) You must attribute the work by prominently displaying the words Inform 7 Handbook, by Jim Aikin.
2) You may not in any way suggest that Jim Aikin endorses you or your use of the Inform 7 Handbook.
3) You may not receive any monetary or other compensation for your copying, distribution, or transmission of this work, nor for any derivative work that incorporates it, in whole or in part.
4) If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.
5) For any reuse or distribution, you must make clear to others the license terms of this work by incorporating the text of the license (see Appendix C), or by including a link to a Web page wherein the license resides.
Table of Contents
Foreword 8
Acknowledgments 11
About the Author 11
Chapter 1: Getting Started 12
Downloading & Installing 14
The Inform 7 Program 14
The Page Headers 16
The Go! Button 20
The Release Button 22
Other Features 23
Using the Built-In Documentation 23
What Happens in a Game 24
Entering Commands 25
Downloading & Playing Games 29
Whats This .z8 Stuff All About, Anyway? 29
Writing Your First Game 31
From the Top 32
The Detail Trap 33
Title Trickery 33
Telling a Story 35
Managing Your Project(s) 35
About Inform Source Code 36
All About Bugs 36
Testing Your Game 38
Using the Debugging Commands 39
Another Way to Debug 41
Puzzles 43
Extensions for Inform 44
Where to Learn More 46
Chapter 2: Rooms & Scenery
Creating Your First Room 48
Scenery 51
The Names of Things 52
How Much Scenery Is Enough? 55
Distant Scenery 56
Adding More Rooms to the Map 58
The Great Outdoors 61
Enterable Scenery 64
Doors 65
Locked Doors 67
Secret Doors 69
Dangerous Doors 70
Travel by Fiat 71
Windows 71
You cant go that way. 72
Duplicate Exits & Twisty Connections 73
Hallways with Lots of Doors 75
Changing the Map During the Game 76
Regions 78
Backdrops 80
Removing a Backdrop 80
Dark Rooms 81
Backdrops in Dark Rooms 84
Seemingly Identical Rooms 84
Floorless Rooms 85
When Is a Room visited? 85
More About Room Descriptions 87
Chapter 3: Things 90
Creating Things 90
Things vs. Kinds 91
The Names of Things 93
Long Names 95
Initial Appearance 96
Adding Vocabulary Words with Understand 97
Conditional Vocabulary 98
Containers & Supporters 99
Stealthy Containers 104
Sneaky Supporters 108
Looking Under & Looking Behind 109
Take All 112
Enterable Containers & Supporters 112
Moving Things Around 114
Inventory 115
Testing Where a Thing Is 117
Things Can Have Properties 118
Number Properties 119
Word Properties 120
Plurals & Collective Objects 123
More about Collections & Kinds 125
Objects That Have Parts 128
Reading Matter 129
Writing on Things 130
Mechanical Marvels 132
Smelling & Listening 136
Transforming One Thing into Another 138
New Ways to Use Things 139
Holding Something Up in the Air 140
Tipping Something 141
Holding Something Against Something Else 142
Chapter 4: Actions 144
Built-In Actions 144
Using Instead 147
Action Processing 148
Rulebooks & Stop the Action 153
Three Types of Actions 155
Creating New Actions 156
[Any Thing] 160
Same Action, New Results 163
Redirecting an Action 163
Actions with Topics 165
Action Processing Summary 166
Chapter 5: Creating Characters 170
Overview 172
The Player Character 173
Creating an NPC 174
Mr. & Mrs. 177
Conversations, Part I: talk to 178
Conversations, Part II: ask/tell/give/show 180
Topics of Conversation 181
Conversations, Part III: Character Knowledge 184
Conversations, Part IV: Menu-Based Conversation 186
Giving Orders to Characters 186
Giving Orders that Involve Going Elsewhere 188
Moving Characters Around 189
Characters Who Follow the Player 192
Characters the Player Can Follow 193
Stage Business 194
Character Actions 195
Combat 196
Moods 198
Body Parts 199
Chapter 6: Puzzles 200
Mapping 201
Blocked Passageways 201
Darkness 202
Hidden Items 203
Items Out of Reach 204
Locked Containers 205
Combination Locks 205
Manipulation Difficulties 205
Enigmas 207
Deceptive Appearances & Unusual Usages 207
Assembly Required 208
Mechanisms 209
Vehicles 209
Consulting Information Sources 209
The Uncooperative Character 210
Timed Puzzles 210
Inadequate Implementation 211
Chapter 7: Winning & Losing 213
A Word About Fairness 214
Keeping Score 215
A Treasure Chest 216
Achievements 218
Chapter 8: Time & Scenes 220
Passing Time 220
Future Events 222
Scenes 223
Chaining Scenes 224
Using Scenes to Control Action 225
Every Turn Rules 228
Chapter 9: Phrasing & Punctuation 231
Types of Source Text 232
Text Insertions 233
Switchable Markup 237
Quotes Within Quotes 238
Breaking Up Paragraphs 239
Large Text Blocks 240
White Space 240
Objects vs. Rules 242
The Names of Things 244
Punctuation 245
Assertions 246
Values 247
Arithmetic 252
Doing Calculations 253
Testing Conditions 255
Creating New Phrases 256
Indenting 257
Too Many Indents 261
Headings 262
Loops 263
Chapter 10: Advanced Topics 265
Story Tense and Viewpoint 265
Code Optimization 265
Instead of Instead 266
Every Turn Rules 267
Other Ways to Streamline Your Code 268
Tables 268
The Skein 272
Using the Index 273
Replacing Rules in the Standard Library 274
Helping the Parser 275
Pronouns 276
Clearing the Screen 276
I6 Constants 277
Relations 278
Adding Hints 281
Special Features in Glulx 282
What Does Inform 6 Have to Do with Inform 7? 282
So, Is Inform 7 the Ultimate IF Programming Language? 283
Appendix A: Glossary 286
Appendix B: Updating Older Extensions 289
Appendix C: Short Sample Games 292
Flea Market 292
Mr Potato Head 294
A Dangerous Jewel Box 296
The Omega Machine 298
The Lurking Critter 300
Restraints 301
Broken Eggs 304
Indoors & Outdoors 306
Appendix D: License
Foreword
Somebody once said that if you ask five poets to define poetry, youll get seven definitions. Im sure Im misquoting wildly the original version may not have been about poetry at all but the point should be clear. There are undoubtedly more good ways to explain the intricacies of the Inform 7 programming language than there are people who have written tutorials on the subject.
Next page