Jeffro's Space Gaming Blog

Microgames, Monster Games, and Role Playing Games

Inform 7: The Jewell of Terror

I periodically dig up the latest version of Inform and try to make it do stuff.  Generally, I think of a really simple project to do… and then end up getting rabidly frustrated of some incredibly stupid syntax issue that would be utterly trivial in a programming language I already know.  I end up frantically pouring over the documentation and trying every variation on the syntax by trial and error until I turn green and start smashing things.  “Jeffro will SMASH!!!”

This time I figured out that the trick is to remain exceedingly modest in your goals.  I now present to you my first complete adventure game.  This time I only spent an hour or so attempting to discover the if-then-else syntax, so I only turned purple.  I’m telling you though, it’s a complete game.  Woah!  (I could still fuss over things like “a vs. the” issues… and printing square brackets in the text, but I’m going to leave at this for now.)

“The Jewell of Terror” by Jeffro

When play begins, say “You’ve found the cave at last!  Can you descend its dark depths and return with the lost treasure of the Precursors?”

The maximum score is 10.

A Dark Tunnel is a room.  “A light glimmers to the south.  A rocky passage slopes downward to the northeast.” Check going south: if the player carries the jewell
 begin;
  award 5 points;
  end the game in victory;
  stop the action;
 otherwise;
  say “What… without the jewell??”;
  stop the action;
 end if.

The Inner Chamber is northeast of A Dark Tunnel.  It contains the jewell.

After taking the jewell for the first time: award 5 points; say “After all these years… now it’s yours!”

Advertisements

3 responses to “Inform 7: The Jewell of Terror

  1. Emily Short April 22, 2007 at 12:18 am

    Is http://www.inform-fiction.org/I7Downloads/Documents/I7_syntax.txt any help in these circumstances? And if not, are there things you’d like us to change about it?

  2. jeffro April 22, 2007 at 9:28 am

    Partly its that the language is deceptively simple, partly its that you can’t just look up a command or keyword in a glossary like you would in learning a typical language, and partly its that I bite off more than I can chew sometimes.

    I’ll continue to post my thoughts as I experiment with it further.

  3. jeffro April 22, 2007 at 12:31 pm

    Oops… looks like a big bad bug in my game. The check is a global routine… it doesn’t just apply to the most recently mentioned room. The code should read:

    Before going south: if the player is in the tunnel
    begin;
    if the player carries the jewell
    begin;
    award 5 points;
    end the game in victory;
    stop the action;
    otherwise;
    say “What… without the jewell??”;
    stop the action;
    end if;
    end if.

    Not very pretty, but still easier than Inform 6. I’ll check the manual to see if there’s a more elegant way to code it.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: