Inform 7; Even plainer English: Dark rooms, Vehicles, and Scenes.

I don’t know about you all, but while working on my creative project I found the rulebook/guide to be less than helpful at times. Though I eventually figured out how to make some of the things that I wanted to do work, I figured I’d explain a few of them here step by step with simpler terms and explanations than the guide.

Dark rooms:

As Jeremy Douglass shares in his essay regarding dark rooms, Enlightening IF, “You can’t see anything; you can do very little indeed. All objects except those in your inventory are out of scope, unreachable, as if non-existent.”

There are ways to lighten up dark rooms, however; whether by turning a light on in the room, or by having some item on hand that provides light.

The first method: Using a device, such as a lantern, flashlight, or match, is significantly easier than creating a light within the room.

           To begin, create the object and identify it within Inform7 as a device.

                        e.g. The lantern is a device in the cave entrance. 

           Inform7 usually assumes that devices are “on” normally. So make sure that you label it as off if you want the player to have to turn it on.

                      e.g. The lantern is switched off. 

                                Note: The syntax here is rather picky as the word “switched” is necessary or it won’t understand what you’re saying.

          In order for the lantern to provide it light, you have to tell it to provide light of course and can be accomplished via an “after” phrase.

                    e.g. After switching on the lantern, now the lantern is lit. 

Note:

  • Again, the syntax is picky. switching on and lit are necessary unless you’ve defined otherwise with separate code. Also, be wary of word order, as “After the lantern is switched on” will not work. A verb ending in “ing” is necessary in order for Inform to understand.

While the device is on, any room the player is in that was previously dark, or that was coded as dark, will be illuminated.

The second method: In order to create a light-switch/light that can be turned on within a room, a few things need to happen.

First, you must create a dark room. This is done very easily and only requires that you label the room as “dark.”

                 e.g. The cave is a dark room.

Now, if the player enters the cave he’ll get the message, “It is pitch dark, and you can’t see a thing,” and as Douglass explains, won’t actually have anything in scope, but you can make it so.

In order to place an object in scope, you must first create the object. In this case, I’ll use matches. Then, use the following,

                e.g. After deciding the scope of the player when the location is cave:
                                                 place the matches in scope.

The player must also have created a source in the room for light, like a torch on the wall. Then, use the following to light the object within the room.

               e.g. Instead of  taking the matches:
                                      Now the torch is lit;
                                     say “You strike a match against a nearby rock and light the torch on the wall, luckily for you it was freshly soaked in gasoline.”
 

I made a short game, that can be accessed by clicking on this sentence, which has both cases.

A few notes:

  • Devices can also work for turning on lights, as shown in the game.
  • While in a dark room, if the creator of the game placed any objects in scope, read the description or try typing in the command, scope.
  • It is a good idea to fix light sources in place if you intend to have a light that can turn on and off.
  • It is easy to make words such as “light-switch” be understood and made interact-able via others: 
                            Understand “light” and “switch” as the light-switch.

Vehicles:

Creating a vehicle is actually very simple.  In fact, Inform already understands what a vehicle is!

e.g. In the frontyard is a vehicle called the sedan. 

Inform will understand that the character can get inside of “the sedan” and can then move around while inside of it. Other common syntax works for vehicles as well, such as describing.

Basic Scene Creation:

In order to create a scene, or, some event that occurs based on time passing or a certain event happening, the event must be described as such.

   e.g. The Play is a scene. 

Then, a condition must be met in order for the scene to begin.

e.g. The Play beings when the player is in the theater for 5 turns. 

To define what happens in a scene, simply put When [the scene] begins: and then on a new line, begin defining.

           e.g. When The Play begins:
                         say “The actors come on stage and perform their show for you. You are astounded.”

Ending the scene is exactly the same, only the words ends and ending must be used.

             e.g. When The Play ends:
                         say “You clap.”
               The Play ends when the player is in the theater for 5 turns.              
 

Here is an example of a scene.

A few notes:

  • If you plan on listing time or turns for scene length, keep in mind that Inform counts both simultaneously. Therefore, if the scene starts in 2 turns, and you want the chances to last for 2 turns, make sure that it ends after 4 turns.
  • Within the scene, you can apply as much or as little change as you desire.

Hope this is helpful!

Movement and “Rooms” in Scratch

Like with my previous post, I thought it would be helpful to answer a common question I get from students by way of a tutorial. In this case, the question is how to have a character appear to move from one room to another. In the video below (since Scratch is all drag and drop, I thought it would be easiest to convey this in video form), I accomplish this with a sprite and background changes on the stage. I use a broadcast to communicate between the two. As with most software, there are probably other ways to accomplish this, but I found that this works pretty well. If you have any suggestions or better solutions, please post a comment.

YouTube Preview Image

Optimizing room descriptions and object lists in Inform 7

Once you start building games in Inform 7, you may notice that the basic process of describing a room and then putting things in it will default to a somewhat rigid or mechanical output. So a common question I get is, “How do I hide things”? Or, “How do I get rid of that long list of items?” I’ve given various bits of advice for different games and situations, but since this is such a common question, I thought I’d summarize some common situations I’ve seen and methods for dealing with them. In preparing these snippets, I’ve put together a small game in my Playfic account, so if you’d prefer to skip to the final product you can play it there. Otherwise, read on!

[Read more...]

CSS & Undum – Making your work (more) unique

So as we’ve learned in class there are these really cool things called stylesheets that change how your website looks.

Because the Undum engine runs on HTML (and Javascript, but all the formatting stuff is HTML) you can add your own stylesheet and customize it.

Using CSS as a customization tool can be extremely important to your story.  I’m going to demonstrate some of the ways you can edit the stylesheet given to you with the source code.

I’ll be using the game I made  to show what I did :)

Also, I did make a video of all of this, but then colourlovers.com had surprise NSFWness that I wasn’t expecting and it showed up in my video. It’s really not THAT bad so if you don’t care about that sort of thing you can watch it here.  The slightly NSFW stuff is at the end anyways.
So the file that comes with the undum source code that contains the CSS code is called undum.css (pretty straightforward).

That code will be linked to in your javascript file (which I talked about in my last video) towards the top.  Simply change the link where it says “stylesheet” to wherever you plan on uploading the css file on your server.

 

I only changed the background and the title background.  In all honesty, Undum doesn’t have too many features that allow for customization.  But by changing these two elements you’re creating an entirely different look.

The background is located in the body tag.  You change the URL there to wherever the image you want to use is uploaded, or you delete that tag and change the hex code (which makes colors!) to what ever you want.  The background of the title is located under the ‘title’ class (which looks like #title in your code) and simply repeat the same steps there that you did for the background.

A great place to find color schemes and patterns is colourlovers.com.  I use it for almost all of my projects that need a little extra something.  It’s pretty self explanatory, and I do explain it a bit more in my slightly accidental NSFW video.

The biggest way to learn is to play around with the code.  Try changing numbers.  If you use firefox, check out firebug.  Firebug will let you mess with the code without committing any specific changes.  It’s a great way to learn.

 

 

Inform 7 Help

Here are some tutorials I’ve found helpful for using Inform7:

http://if1.home.comcast.net/~if1/inform_7.htm

http://newmedia.hpiweb.com/

And the Inform 7 handbook:

http://www.musicwords.net/if/InformHandbook.pdf

Undum Tutorial

I explain it a little bit in the video, but I want to talk a little bit about what Undum is beforehand.

There are lots of different kinds of software out there that you can use to create your very own work of interactive fiction.  This is what Undum is.  It’s a program that allows you to create a very cool, streamlined “choose your own adventure” story.

 

I worked with it a lot last semester for my seminar project, and it’s definitely something I recommend if you’re looking for a way to publish your own work of interactive fiction.

Undum stories tend to be a lot like a game.  You have different options that you can pick, and you need to write your story to reflect that.

For example, in my story, I had a sort of fight scene where you had to choose if you were going to hit someone in the jaw or in the neck.  Depending on which option you clicked, it would take you to that specific choice.
Undum works very well for this!

I hope you find my tutorial helpful, and good luck!

 

Unable to display content. Adobe Flash is required.
Unable to display content. Adobe Flash is required.