<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Inform 7 - Undo Restart Restore</title>
	<atom:link href="/blog/category/systems/inform-7/feed/" rel="self" type="application/rss+xml" />
	<link>/blog</link>
	<description>Interactive Fiction by Juhana Leinonen</description>
	<lastBuildDate>Thu, 21 Apr 2016 23:15:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.7.1</generator>
	<item>
		<title>Structuring Inform 7 code</title>
		<link>/blog/2016/04/structuring-inform-7-code/</link>
		
		<dc:creator><![CDATA[Juhana]]></dc:creator>
		<pubDate>Thu, 21 Apr 2016 23:02:43 +0000</pubDate>
				<category><![CDATA[Inform 7]]></category>
		<guid isPermaLink="false">/blog/?p=1534</guid>

					<description><![CDATA[Questions about organizing Inform 7 code tend to pop up regularly. Here's the method I use, which is of course not the official or the only way to do it. Taking a ready-made header structure and trying to adapt your own code to it by filling in the blanks would be too inflexible, so I <a href="/blog/2016/04/structuring-inform-7-code/" class="more-link">Continue reading <span class="screen-reader-text">Structuring Inform 7 code</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Questions about organizing Inform 7 code tend to pop up regularly. Here's the method I use, which is of course not the official or the only way to do it.</p>
<p>Taking a ready-made header structure and trying to adapt your own code to it by filling in the blanks would be too inflexible, so I build the structure dynamically as I go along. A new project starts with no headers at all. New headers are added when code gets diverse enough to justify a new classification.</p>
<pre class="inform">
<div class="block">
Include Rideable Vehicles by Graham Nelson.
</div>
<div class="block">
The Front Yard is a room.
</div>
</pre>
<p>In this example the extension and the room definition don't have anything in common, so they're split into different headings.</p>
<pre class="inform">
<div class="header">Volume 1 &mdash; Extensions</div>
<div class="block">
Include Rideable Vehicles by Graham Nelson.
</div>
<div class="header">Volume 2 &mdash; Rooms</div>
<div class="block">
The Front Yard is a room.
</div>
</pre>
<p>When we add a new room, there's another split (although in real life the split would come only after they have a bit more content, we'll come back to that soon).</p>
<pre class="inform">
<div class="header">Volume 1 &mdash; Extensions</div>
<div class="block">
Include Rideable Vehicles by Graham Nelson.
</div>
<div class="header">Volume 2 &mdash; Rooms</div>
<div class="header">Book 1 &mdash; Front Yard</div>
<div class="block">
The Front Yard is a room.
</div>
<div class="header">Book 2 &mdash; Driveway</div>
<div class="block">
The Driveway is a room. The Driveway is west of Front Yard.
</div>
</pre>
<p>Notice how the two similar headers are grouped together with a common parent header. </p>
<p>The general rule of thumb is that when something has at least two paragraphs of code, it gets its own header. For example, assuming we have the following code:</p>
<pre class="inform">
<div class="header">Chapter 1 &mdash; Engine room</div>
<div class="block">
The Engine room is south of Cable-car platform. The description is 
<span class="string">"The wooden shack houses a large diesel generator that moves the cableway. 
The shack's walls are rotten and patchy. The exit leads back out to the north."</span>
</div>
<div class="block">
The diesel generator is a device in the Engine room. 
<span class="string">"The diesel generator <span class="substitution">[if switched on]</span>is running loudly, 
turning the cableway.<span class="substitution">[otherwise]</span>looks like it hasn't been 
used in quite some while."</span> The diesel generator is fixed in place.
</div>
<div class="block">
The shack walls are scenery in the Engine room. The description is 
<span class="string">"Light is shining through the wall boards."</string>
</div>
</pre>
<p>Each thing in this room (including the room itself) has only one paragraph of code, so they'd all stay under the same heading for now. Later when the code gets some meat around the bones, some things get more paragraphs and it's time to split them under more headings.</p>
<pre class="inform">
<div class="header">Chapter 1 &mdash; Engine room</div>
<div class="block">
The Engine room is south of Cable-car platform. The description is 
<span class="string">"The wooden shack houses a large diesel generator that moves the cableway. 
The shack's walls are rotten and patchy. The exit leads back out to the north."</span>
</div>
<div class="header">Section 1 &mdash; Diesel generator</div>
<div class="block">
The diesel generator is a device in the Engine room. 
<span class="string">"The diesel generator <span class="substitution">[if switched on]</span>is running loudly, 
turning the cableway.<span class="substitution">[otherwise]</span>looks like it hasn't been 
used in quite some while."</span> The diesel generator is fixed in place.
</div>
<div class="block">
After switching on the diesel generator:
<div class="indent">
say <span class="string">"The generator makes some suspicious noises but then comes to life. 
The cableway starts moving again."</span>
</div>
</div>
<div class="block">
After switching off the diesel generator:
<div class="indent">
say <span class="string">"The generator shuts down and the cableway stops."</span>
</div>
</div>
<div class="header">Section 2 &mdash; Shack walls</div>
<div class="block">
The shack walls are scenery in the Engine room. The description is 
<span class="string">"Light is shining through the wall boards."</string>
</div>
</pre>
<p>The two-paragraphs rule is not absolute; sometimes it makes more sense to keep everything under one header when the code is not that important, like decorative scenery. Inform has only five header levels which also limits the size of the pieces into which you can split the code.</p>
<p>The five header levels are <strong>volume</strong>, <strong>book</strong>, <strong>part</strong>, <strong>chapter</strong> and <strong>section</strong>. I haven't really attached any specific fixed meaning to different header levels. Volumes contain top-level abstractions ("Metadata", "World", "Debugging") and any subheaders just use the next immediate type (volumes contain only books, books contain only parts etc.) This means that header levels in different parts of the source text aren't comparable: an NPC in one place might be under "part" level and another NPC could be under "section" level somewhere else, with neither being necessarily more important than the other.</p>
<p>The header structure is generally best arranged into a tree shape so that subheaders have a logical relationship with their parent headers, and headers on the same level under the same parent header belong to the same group. In other words, the diesel generator is a subheader under the Engine room because that's where the generator is. That much should be obvious, but subheaders under the the same parent header should also share a "theme" between each other: in the above example, if one of the subheaders is a new room-specific action, it's then better to group the objects under a new parent header so that the new action is not on the same level with the objects.</p>
<p>The important thing here is to not get hung up on getting it right the first time. The structure is allowed to live, and I tend to move parts of code around constantly while writing. The time it takes to keep the code organized is more than generously paid back later when navigating the code is fast and intuitive.</p>
<p>All that said, in the end the general top-level structure tends to usually be more or less something like this:</p>
<ol>
<li>
Meta</p>
<ul>
<li>License</li>
<li>Changelog</li>
<li>Extensions</li>
<li>Bibliographical information</li>
<li>Releasing</li>
</ul>
</li>
<li>
Mechanics <em>(any of these headers could get promoted to their own volume if there's a lot of content)</em></p>
<ul>
<li>Commands
<ul>
<li>Modifications to standard commands</li>
<li>New commands</li>
<li>Out of world commands
<ul>
<li>Credits</li>
<li>Instructions</li>
<li>Hints</li>
</ul>
</li>
</ul>
<li>Default messages</li>
<li>Modifications to standard rules</li>
<li>New kinds</li>
<li>Scenes</li>
<li>Gameplay logic</li>
<li>Conversation system</li>
<li>Special mechanics</li>
</ul>
</li>
<li>
World</p>
<ul>
<li>Rooms
<ul>
<li>
Room 1</p>
<ul>
<li>
Thing in room
</li>
<li>
Misc scenery
</li>
</ul>
</li>
<li>
Backdrops
</li>
</ul>
</li>
<li>Major NPCs</li>
</ul>
</li>
<li>
Debugging
</li>
</ol>
<p>But, as said, this is not a rigid structure but something that tends to form as a result of the dynamic method.</p>
<p>Here are sources of some full projects that use this method: <a href="http://nitku.net/if/sparkle/source.html">Sparkle</a>, <a href="http://nitku.net/if/escapade/source.html">Escapade!</a>, <a href="http://nitku.net/if/yomomma/source.html">Raising the Flag on Mount Yo Momma</a>. For more ideas: <a href="http://ifdb.tads.org/search?sortby=new&newSortBy.x=0&newSortBy.y=0&searchfor=tag%3AI7+source+available">source code by other people</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>IF Recorder version 3</title>
		<link>/blog/2011/11/if-recorder-version-3/</link>
		
		<dc:creator><![CDATA[Juhana]]></dc:creator>
		<pubDate>Tue, 08 Nov 2011 21:14:57 +0000</pubDate>
				<category><![CDATA[Inform 7]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Undum]]></category>
		<guid isPermaLink="false">/blog/?p=593</guid>

					<description><![CDATA[The tool formerly known as "Transcript recording plugin for Parchment" has been successfully used as a betatester transcript recorder with at least one game, and even in the currently running IFComp. Thanks to liberal version numbering scheme it has now reached version 3 and has been renamed IF Recorder. Here are the major new features: <a href="/blog/2011/11/if-recorder-version-3/" class="more-link">Continue reading <span class="screen-reader-text">IF Recorder version 3</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>The tool formerly known as "<a href="/blog/2011/05/transcript-recording-plugin-for-parchment-released/">Transcript recording plugin for Parchment</a>" has been successfully used as a betatester transcript recorder with at least one game, and even in the currently running IFComp. Thanks to liberal version numbering scheme it has now reached version 3 and has been renamed <em>IF Recorder</em>.</p>
<p>Here are the major new features:</p>
<ul>
<li><strong>Works with <a href="http://undum.com/">Undum</a>.</strong> Now someone might wonder why anyone would want to record hypertext fiction stories, but even if there's less need to check what kind of input readers give, other reasons still apply: you might want to get statistical data on which choices the readers make, or see if the readers give up at some certain point in the story, or even find out if some of the choices just don't work as they should.
</li>
<li><strong>Web interpreter template for Inform 7.</strong> There's a ready-made Inform 7 template to use with the <a href="http://inform7.com/learn/man/doc394.html">"Release along with an interpreter"</a> option. This makes it easier to start using the recorder although you still have to set up the database and the server scripts.
</li>
</ul>
<p>The project's new headquarters are at <a href="https://github.com/juhana/if-recorder">Github</a> along with the <a href="https://github.com/juhana/if-recorder/wiki/Installation">instructions</a> and <a href="https://github.com/juhana/if-recorder/downloads">downloads</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Some useful Inform 7 extensions</title>
		<link>/blog/2010/04/some-useful-inform-7-extensions/</link>
					<comments>/blog/2010/04/some-useful-inform-7-extensions/#comments</comments>
		
		<dc:creator><![CDATA[Juhana]]></dc:creator>
		<pubDate>Sat, 24 Apr 2010 21:15:06 +0000</pubDate>
				<category><![CDATA[Inform 7]]></category>
		<guid isPermaLink="false">/blog/?p=277</guid>

					<description><![CDATA[I'm a big fan of extensions. Creating an IF game takes enough time as it is, so any way of avoiding reinventing the wheel someone has already invented and made public is a big plus. Extensions don't get enough use, and I'm not alone with this opinion: Aaron Reed has called for more visibility, including blogging about the best ones. I'll take a head start by introducing some of my own favorites.]]></description>
										<content:encoded><![CDATA[<p>Very often I turn transcripting on when I start playing IF. As a side effect <a href="http://www.logicalshift.co.uk/mac/index.html">Zoom</a> automatically runs the command VERSION, which in case of Inform 7 games shows the list of <a href="http://inform7.com/write/extensions/">extensions</a> the game uses. More often than not the list is empty. </p>
<p>I'm a big fan of extensions. Creating an IF game takes enough time as it is, so any way of avoiding reinventing the wheel someone has already invented and made public is a big plus. Extensions don't get enough use, and I'm not alone with this opinion: Aaron Reed has <a href="http://www.intfiction.org/forum/viewtopic.php?f=38&t=1012">called for more exposure</a>, including blogging about the best ones. I'll take a head start by introducing some of my own favorites.</p>
<p><span id="more-277"></span></p>
<h3>Epistemology by Eric Eve</h3>
<p>By far the most useful extension I've yet found. The first thing I do every time I start a new project is including this extension because it will almost certainly be used.</p>
<p><a href="http://inform7.com/extensions/Eric%20Eve/Epistemology/index.html">Epistemology</a> adds two properties to every thing in the game: seen/unseen and familiar/unfamiliar. Every object starts as unseen and when the player encounters things (is in the same room or looks in the container where the object is) they automatically change to being seen. The familiar/unfamiliar property is what the author can toggle when needed if the player character already knows about something or learns about it during the game. The author can test whether a thing is either seen or familiar by checking if it's known or unknown. </p>
<p>The most obvious use is for an ask/tell conversation system: you can prevent the player from asking about things that the player character would not yet know about by defining the action as "ask [person] about [any known thing]". </p>
<p>In addition you should consider using the [any known thing] token every time when an action allows any noun to be used (not only those in scope). Let's say you want the player to be able to get more information about NPCs by commanding WHO IS. You've implemented the command with the grammar line "who is [any person]". You don't want the player to ask about John Q. Public, who is the surprise villain of your game. So you write something like this:</p>
<div class="inform">
	Check asking who John Q Public is:</p>
<div class="inform-indent">
		if John Q Public is not revealed:</p>
<div class="inform-indent">
			say <span class="inform-text">"You don't know who that is."</span> instead.
</div>
</div>
</div>
<p>That works well when the player refers to John Q. by his full name, but now disambiguation can give the surprise away:</p>
<div class="transcript">
<div class="transcript-command">
	&gt;WHO IS JOHN
</div>
<p>	Who do you mean, John Doe or John Q. Public?
</p></div>
<p>It's better to use "who is [any known person]" to avoid the disambiguation mechanism revealing things the player shouldn't know about.</p>
<h3>Far Away by Jon Ingold</h3>
<p><a href="http://inform7.com/extensions/Jon%20Ingold/Far%20Away/index.html">Far Away</a> provides the adjective "distant" which simply puts things out of the player's reach. Anything except examining (and other actions that do not require touch) will be blocked with a "you can't reach it" message.</p>
<p>Far Away is most useful for filling in scenery items mentioned in room descriptions. You can create the item, give it a description, make it distant, and then just forget about it. No need worrying whether touching the sun or taking the clouds gives a reasonable response -- the response is always the "can't reach" one.</p>
<h3>Object Response Tests by Juhana Leinonen</h3>
<p>There's a reason other than shameless self-promotion for this extension to be on this list. The amount of verbs in the standard library is huge and testing each object against each verb is a staggering task. <a href="http://inform7.com/extensions/Juhana%20Leinonen/Object%20Response%20Tests/index.html">Object Response Tests</a> allows you to try every available verb on one item with a single command. You can scan the output for unsuitable responses, like "You feel nothing unexpected" when the player types TOUCH THE FIRE.</p>
<p>You can also try a single verb on all objects in scope, or all verbs on all objects at once. Any custom commands in the game can be added to the testing batch, or disabled commands removed from it. Testing commands are disabled in the released game.</p>
<p>The extension is not a replacement for proper testing done by humans, but it will help catch some of the cases easily missed by testers.</p>
<h3>Disambiguation Control by Jon Ingold</h3>
<p>Another one of Jon Ingold's extensions, <a href="http://inform7.com/extensions/Jon%20Ingold/Disambiguation%20Control/index.html">Disambiguation Control</a>, completely replaces the default disambiguation mechanism. It's a tinkerer's dream: in addition to improving the parser's functionality in general, you get to define the parser's disambiguation preferences to whatever you want.</p>
<p>In contrast to the extensions mentioned before, this is not one that I'd recommend to everyone. I7's own disambiguation engine works fairly well in most cases. Disambiguation Control requires a relatively large amount of learning to use efficiently. It will also potentially increase the author's work because it adds new layers and options to the mechanism that by default does everything more or less automatically. Nevertheless if you find yourself thinking the standard parser's disambiguation should be smarter or hoping for more control over disambiguation choices, this is the extension for you.</p>
]]></content:encoded>
					
					<wfw:commentRss>/blog/2010/04/some-useful-inform-7-extensions/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>An action by any other name: Finding the names of actions in Inform 7</title>
		<link>/blog/2009/12/an-action-by-any-other-name/</link>
					<comments>/blog/2009/12/an-action-by-any-other-name/#comments</comments>
		
		<dc:creator><![CDATA[Juhana]]></dc:creator>
		<pubDate>Mon, 14 Dec 2009 10:01:37 +0000</pubDate>
				<category><![CDATA[Inform 7]]></category>
		<guid isPermaLink="false">/blog/?p=214</guid>

					<description><![CDATA[One thing that seems to trip authors every time in I7 is finding the name of the action to work with. Here are some hints for finding the name of the action when you encounter the "that did not make sense as a description of an action" error.]]></description>
										<content:encoded><![CDATA[<p>One thing that seems to trip authors every time in I7 is finding the name of the action to work with. Here are some hints for finding the name of the action when you encounter the "that did not make sense as a description of an action" error.</p>
<p>Let's say we have in our game a coin and a slot machine and we would understandably want to handle <span class="command">PUT COIN IN MACHINE</span> somehow. So we write this:</p>
<pre class="inform">
<div class="block">
  The Casino is a room.
</div>
<div class="block">
  A slot machine is in the Casino. The player carries a coin.
</div>
<div class="invalid block">
  Instead of putting the coin in the slot machine:
  <div class="indent">
    say <span class="string">"The coin falls through the machine and straight into the winnings tray. It must be broken."</span>
  </div>
</div>
</pre>
<p>Looks all good, right? But when we try it, the compiler says this:</p>
<blockquote class="inform-error"><p>
Problem. You wrote 'Instead of putting the coin in the slot machine'  , which seems to introduce a rule taking effect only if the action is 'putting the coin in the slot machine'. But that did not make sense as a description of an action. I am unable to place this rule into any rulebook.
</p></blockquote>
<p>This happens because "putting it in" is actually not the action's name. Even though when playing the game <em>one action can have several verbs</em> that are synonymous (eg. TAKE and GET do exactly the same thing) but in the code <em>each action has only one name</em> (eg. taking). Actions are like those demons in folklore where you have to know their true name before you can control them.</p>
<p>How do you find an action's real name then? There are a couple of ways, but these two are probably the easiest.</p>
<p>The first method is to open the index page and take a look at the Actions tab. (This is the Mac IDE, the Windows and possibly Linux versions have the buttons in slightly different places.)</p>
<p><img loading="lazy" src="/blog/blogcontent/uploads/2009/12/actions_tab.png" alt="Actions tab in Inform 7" title="Actions tab" width="456" height="232" class="size-full wp-image-218" srcset="/blog/blogcontent/uploads/2009/12/actions_tab.png 456w, /blog/blogcontent/uploads/2009/12/actions_tab-150x76.png 150w, /blog/blogcontent/uploads/2009/12/actions_tab-300x152.png 300w" sizes="(max-width: 456px) 100vw, 456px" /></p>
<p>This page lists all actions and all verbs that are available in-game. Scroll down the page and find "put".</p>
<p><img loading="lazy" src="/blog/blogcontent/uploads/2009/12/actions_put.png" alt="The put verb in the actions tab" title="The put verb in the actions tab" width="451" height="279" class="size-full wp-image-219" srcset="/blog/blogcontent/uploads/2009/12/actions_put.png 451w, /blog/blogcontent/uploads/2009/12/actions_put-150x92.png 150w, /blog/blogcontent/uploads/2009/12/actions_put-300x185.png 300w" sizes="(max-width: 451px) 100vw, 451px" /></p>
<p>The command PUT has different meanings depending on the context but the line we want in this case is "put [other things] in/inside/into [something]". This shows the name of the action: inserting it into.</p>
<p>The drawback of this method is that the index tab is not always available if there was a problem compiling the game, so you might not get to see the list without trimming the non-working parts of the code and compiling again. There's another way of finding the name of the action right in the game itself. Go to the game running in the IDE (where the debugging verbs are available), type ACTIONS to turn the actions listing on and then the command you wish to manipulate (although this suffers from the same problem as the index in Linux and possibly Windows IDE; see the comments below):</p>
<div class="transcript">
<div class="transcript-command">&gt;actions</div>
<p>Actions listing on.</p>
<div class="transcript-command">&gt;put coin in machine</div>
<p><strong>[inserting the coin into the slot machine]</strong><br />
That can't contain things.<br />
[inserting the coin into the slot machine - failed the can't insert into what's not a container rule]
</div>
<p>The emphasized line shows that the action that the game tries is "inserting it into", which is the name of the action we need to use in our case.</p>
]]></content:encoded>
					
					<wfw:commentRss>/blog/2009/12/an-action-by-any-other-name/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
	</channel>
</rss>
