More on Inform 7

posted in Ubik
Published October 03, 2006
Advertisement
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 ContributorThe 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";
Previous Entry Logging
Next Entry Source control
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

XNA

1565 views

...

642 views

Physics demo

1289 views

Console launch...

1123 views

New project

1484 views

b day

1139 views

Source control

1314 views

More on Inform 7

1094 views

Logging

1240 views

Lines of code

1308 views
Advertisement