For a while, I delayed the project since most transcripts involved commands to characters, and before ZILF 0.7 (and its Adventure example code), I had no idea how to code them. I have to say that I like how ZIL/ZILF handles it now!
I was torn between trying to do the sample transcripts from either Ballyhoo or Lurking Horror, as those were the first Infocom games I ever purchased and have a special fondness for them. Since the Frankenstein narrative of Lurking Horror's sample transcript was better suited to Halloween, I opted for the Ballyhoo transcript.
![]() |
Ballyhoo sample transcript |
The juggler is here, dropping things.
Among other things, the transcript seems to be in BRIEF mode and the juggler character in particular has alternate text when you revisit his room (and it doesn't seem like something that'd be coded as a daemon/queue). For a short while, it made me temporarily forget Infocom's actual default behavior (where no room objects are listed in revisited rooms) and I almost set upon rewriting my ZILF library's code. In the end, I realized that the transcript was doing something that no actual Infocom game did. Just the same, I was able to code it:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<OBJECT JUGGLER | |
(DESC "juggler") | |
(IN JUGGLER_ROOM) | |
(DESCFCN JUGGLER-DESC-F) | |
(ADJECTIVE YOUNG) | |
(FLAGS CONTBIT SEARCHBIT OPENBIT SURFACEBIT PERSONBIT) | |
(SYNONYM JUGGLER MAN) | |
> | |
<ROUTINE JUGGLER-DESC-F (ARG) | |
<COND (<=? .ARG ,M-OBJDESC?> <RTRUE>)> | |
<COND (<OR <VERB? LOOK> <EQUAL? ,MODE ,VERBOSE> <AND <EQUAL? ,MODE ,BRIEF> <NOT <FSET? ,HERE ,TOUCHBIT>>> > | |
<TELL "In front of you is a young, dark-haired man juggling a broken plate, a | |
lacrosse ball, a cracked candlepin, and a chopstick." CR>) | |
(T | |
<TELL "The juggler is here, " > | |
<COND (<EQUAL? 1 <MOD <DIV ,MOVES 3> 2>> | |
<TELL "dropping things." CR>) | |
(T | |
<TELL "juggling." CR>)>)>> |
The spacing of the transcript also doesn't quite match an actual Infocom game. Of course, this is for manual typography purposes, but it reminds me how optimal default spacing is always an interesting concept to me (and whether it is important for authors to easily change it).
You crawl under the hedge and find yourself...
My first thought pertaining to the hedge-crawling text was that I would use the M-ENTER check as it is used by the ZIL manual to print entering-rooms messages. Even though the game didn't require it, I checked to see if the code supported different-messages-depending-on-where-the-player-is-coming-from. Due to setting the HERE global before the M-ENTER code was called, it wasn't possible. Easy enough to fix, though.
In the end, I decided that since this message was directly tied to the hedge, I'd just write a bunch of hedge code instead.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<SYNTAX CRAWL UNDER OBJECT = V-CRAWL> | |
<OBJECT HEDGE | |
(DESC "hedge") | |
(LOC GLOBAL-OBJECTS) | |
(ACTION HEDGE-F) | |
(SYNONYM HEDGE) | |
(FLAGS NDESCBIT)> | |
<ROUTINE HEDGE-F () | |
<COND (<VERB? CLIMB> | |
<TELL "Its branches are too little and prickly to climb." CR>)>> | |
<ROUTINE V-CRAWL () | |
<COND (<NOT <PRSO?, HEDGE>> | |
<TELL "That would get awkward fast." CR>) | |
(T | |
<COND (<FSET? ,HEDGE ,TOUCHBIT> | |
<TELL "You crawl under the hedge and find yourself..." CR CR>) | |
(T | |
<TELL | |
"You smell the dirt in your face and feel the thorns on your back as you crawl under the hedge and find yourself..." CR CR> | |
<FSET ,HEDGE ,TOUCHBIT>)> | |
<COND (<EQUAL? ,HERE, GRINDER_ROOM> | |
<GOTO ,IN_PARK>) | |
(<EQUAL? ,HERE, JUGGLER_ROOM> | |
<GOTO ,IN_PARK>) | |
(<EQUAL? ,HERE, MAGICIAN_ROOM> | |
<GOTO ,NEAR_TREES>) | |
(<EQUAL? ,HERE, NEAR_TREES> | |
<GOTO ,MAGICIAN_ROOM>) | |
(<EQUAL? ,HERE, IN_PARK> | |
<GOTO ,JUGGLER_ROOM>)>)>> | |
<ROOM IN_PARK | |
(DESC "In the Park, South of Trees") | |
(IN ROOMS) | |
(LDESC "You're in a large sunny park. North of here, you see an apple tree and an elm | |
tree.") | |
(WEST PER HEDGE-CRAWL) | |
(NORTH TO NEAR_TREES) | |
(FLAGS LIGHTBIT)> | |
<ROUTINE HEDGE-CRAWL ("AUX" DESTIN) | |
<TELL "You crawl under the hedge and find yourself..." CR CR> | |
<COND (<EQUAL? ,HERE ,IN_PARK> | |
<SET DESTIN, JUGGLER_ROOM>) | |
(<EQUAL? ,HERE ,NEAR_TREES> | |
<SET DESTIN, MAGICIAN_ROOM>)> | |
.DESTIN> |
Once the player has crawled under the hedge, he or she can go west back onto the street without typing >CRAWL UNDER THE HEDGE but leaving the street always involves the command (in trying to be faithful, I imagined Infocom to somewhat be a dick about it).
Putting the hedge object in location GLOBAL-OBJECTS makes sure it is available from every room in the game.
I made that HEDGE-CRAWL routine so that players can re-enter the street with a simple >GO WEST (and go to the right location, depending on where they left from). That was pretty fun to figure out. Notice how the code sets the local variable (DESTIN) to the applicable room and then just ends with saying the variable again. This makes the routine return the value of the variable, sending the player to the correct room.
No comments:
Post a Comment