My adventure in porting a game from Inform 6 to Inform 7 continues.
In Inform 6, the following source code calls the “Ejection” routine when the player types UP or OUT, which prints some text and moves the player to a new location:[code]! Direction routine from the office in “Toyshop” by Graham Nelson.
Object Chamber “Featureless Chamber”
with
description “”,
u_to [;
Ejection();
rtrue;
],
out_to [;
Ejection();
rtrue;
],
has light;[/code]
In the following Inform 7 code, typing the dummy verb CHICK at the prompt triggers the “Transport one” routine:[code]“Forcing the Status Line 02” by Jay Goemmer
Include Basic Screen Effects by Emily Short.
The story headline is “An Interactive Example”.
To redraw status line: (- DrawStatusLine(); -).
When play begins:
say “Introductory text here.[paragraph break]”;
say “[bracket]MORE[close bracket]”;
wait for any key;
clear the screen.
Chamber is a room. The printed name is “Featureless Chamber”. The description is “Type CHICK to begin the demonstration.”.
Midair is a room. The printed name is “Suspended in Midair”.
Endgame is a room. The printed name is “That’s all, folks!”
Understand “chick” as transport one.
Transport one is an action applying to nothing.
Report transport one:
clear the screen;
move the player to Midair, without printing a room description;
say “[line break]Narrative text here.[paragraph break]More narrative text droning on.[paragraph break]Rattling on nonsensically some more.[paragraph break]”;
redraw status line;
say “[bracket]MORE[close bracket]”;
wait for any key;
clear the screen;
move the player to Endgame, without printing a room description;
say “Thanks for coming. You can let yourself out by typing ‘QUIT.’”.[/code]
How do I trigger the “Transport one” routine when the player types UP or OUT at the prompt?
I’ve read and re-read the “Recipe Book” and “Writing with Inform,” as well as searching this forum, to no avail. I think it might have to do with “going,” but I just can’t get any farther than that.
Any help is incredibly welcome. Thanks in advance!
Cheers,