Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

I7 One Door Two Keys?

19 views
Skip to first unread message

Darien

unread,
Jul 17, 2010, 9:08:19 PM7/17/10
to
Is it possible in Inform 7 to make one door with two keys? I have been
trying just now and it keeps complaining. I had wanted to make a
little simple sort of puzzle at the start of a game- you walk into a
house and the door locks behind you. You can either spend a few
minutes looking around for the key, or search your inventory and find
out that you actually already have one. But this doesn't seem to be
panning out- Inform just doesn't like me saying "such and such door
has two matching keys" or "Key A unlocks door 1. Key B unlocks door
1."

Thanks in advance.

256

unread,
Jul 18, 2010, 10:23:57 AM7/18/10
to

There's probably a more elegant way to do this, but this works:
-----
Kitchen is a room. Parlor is a room. The player is in Kitchen.
Portal is east of kitchen and west of parlor. Portal is a locked door.

Before unlocking portal with keyb:
say "You unlock Portal.";
Now portal is unlocked;
rule succeeds.

Before locking portal with keyb:
say "You lock Portal.";
now portal is locked;
rule succeeds.


KeyA is in Kitchen. KeyA unlocks portal.
KeyB is in Kitchen.
KeyC is in Kitchen.

test me with "open portal/take keyc/unlock portal/take keyb/unlock
portal with keyb/lock portal with keyb/take keya/unlock portal with
keya."

---------

-duff

0 new messages