Jump to content
  • Advertisement

Ubik

Sign in to follow this  
  • entries
    101
  • comments
    122
  • views
    58298

More on Inform 7

Sign in to follow this  
Will F

213 views

I've done some more playing around with Inform 7 and am finding it fascinating. Here's an example from the Inform wikipedia page of the source code to a very simple game.

"Hello Wikipedia" by A Wikipedia Contributor

The story headline is "An Interactive Example".

The Living Room is a room. "A comfortably furnished living room."
The Kitchen is north of the Living Room.
The Front Door is south of the Living Room.

The insurance salesman is a man in the Living Room.
The description is "An insurance salesman in a tacky polyester suit. He seems eager to speak to you."
Understand "man" as the insurance salesman.

A briefcase is carried by the insurance salesman.
The description is "A slightly worn, black briefcase."
Understand "case" as the briefcase.

The insurance paperwork is in the briefcase.
The description is "Page after page of small legalese."
Understand "papers" or "documents" or "forms" as the paperwork.

Instead of listening to the insurance salesman:
say "The salesman bores you with a discussion of life insurance policies.
From his briefcase he pulls some paperwork which he hands to you.";
now the player carries the insurance paperwork.






I'm serious, that is the actual source code you send to the Inform compiler.

Here's what it looks like when you play it.

Quote:
Hello Wikipedia
An Interactive Example by A Wikipedia Contributor
Release 1 / Serial number 061003 / Inform 7 build 3Z95 (I6/v6.31 lib 6/11N) SD

Living Room
A comfortably furnished living room.

You can see an insurance salesman here.

>inventory
You are carrying nothing.

>examine man
An insurance salesman in a tacky polyester suit. He seems eager to speak to you.

>listen to man
The salesman bores you with a discussion of life insurance policies. From his briefcase he pulls some paperwork which he hands to you.

>inventory
You are carrying:
an insurance paperwork

>


I'm not yet sure how viable it would be for a large and complex game (for example Curses), but I haven't spent enough time with it to say either way. Regardless, after having worked with an older version of Inform, it seems a lot easier to get started with. This is what roughly equivalent source code looks like in Inform 6

Constant Story "Hello Wikipedia";
Constant Headline "^An Interactive Example^";

Include "Parser";
Include "VerbLib";

[ Initialise;
location = Living_Room;
"Hello World";
];

Object Kitchen "Kitchen";
Object Front_Door "Front Door";

Object Living_Room "Living Room"
with
description "A comfortably furnished living room.",
n_to Kitchen,
s_to Front_Door,
has light;

Object -> Salesman "insurance salesman"
with
name 'insurance' 'salesman' 'man',
description "An insurance salesman in a tacky polyester
suit. He seems eager to speak to you.",
before [;
Listen:
move Insurance_Paperwork to player;
"The salesman bores you with a discussion
of life insurance policies. From his
briefcase he pulls some paperwork which he
hands to you.";
],
has animate;

Object -> -> Briefcase "briefcase"
with
name 'briefcase' 'case',
description "A slightly worn, black briefcase.",
has container;

Object -> -> -> Insurance_Paperwork "insurance paperwork"
with
name 'paperwork' 'papers' 'insurance' 'documents' 'forms',
description "Page after page of small legalese.";

Include "Grammar";



Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!