Suppress "before" messages when fast-traveling

This probably also has a straightforward answer I’m not thinking of! I have some text printing when the player goes from Room A to Room B and vice versa (actually, for reasons I don’t remember, one is a Before and one is an After; I wrote this early on) but I’d like to suppress these when the player is fast-traveling because then they pop up annoying and contextless-ly.

[code]After going from the White Room to the Black Room:
say “You climb the stairs up to the Black Room.”;
continue the action;

Before going from the Palace Doors to the Square:
say “You descend the stairs to the White Room.”;
continue the action;[/code]

Here’s the fast travel code:

[code]Fast-traveling is an action applying to one thing. Understand “go to [any room]” as fast-traveling.

Check fast-traveling:
if the noun is the location:
say “You’re already in [the location].” instead;
otherwise if the noun is not visited:
say “You don’t know how you’d find it.” instead.

Carry out fast-traveling:
while the player is not in the noun:
let the way be the best route from the location of the player to the noun through visited rooms, using doors;
let destination be the room the way from the location;
if destination is not the noun:
silently try going the way;
otherwise:
try going the way;[/code]

It also occurred to me to include the problematic text in the room description or use a “before looking”, but I don’t know if there’s a way for the parser to know what room you’re coming from (I don’t want it to print “You descend the stairs to the White Room” if you’re coming down the hall from the Green Room but have visited the Black Room before, as it did if I used if the player had been…) I’ve also tried “if the current action is not fast-traveling”, both on its own and with the names of specific rooms.

There are probably better solutions, but what I would do in my klunky way…

Name all your Before rules that you want to suppress:

Before going from the Palace Doors to the Square (this is the palace doors to square rule): say "You descend the stairs to the White Room."; continue the action;

Then, before starting fast travel, set a flag:

[code]
Sprinting is a truth state that varies. [I think, might not need “that varies”]
Carry out fast-traveling:
now sprinting is true;
while the player is not in the noun:
let the way be the best route from the location of the player to the noun through visited rooms, using doors;
let destination be the room the way from the location;
if destination is not the noun:
silently try going the way;
otherwise:
try going the way;

Last carry out fast-traveling:
now sprinting is false;[/code]

Then for each named rule you want to suppress:

The palace doors to square rule does nothing while sprinting is true.

Not tested for exact syntax, but theoretically should work. There’s probably a more elegant way - like making a “Room Transitions Rulebook” with all your rules then saying “The Room Transitions Rulebook does nothing while sprinting is true.”

Whoops, I definitely did not substitute all the actual names with placeholders. GDI. Thanks HanonO, I’ll give it a try (if the “better solutions” do not arise, haha).

I don’t have Inform on hand right now to check, but can’t you “Before going from X to Y when not fast-travelling”?

I don’t think that will work. The current action can’t be both “going” and “fast-travelling”.

Probably the way to do this would be to have a First Room Transitions Rule that is something like “First room transitions rule when sprinting is true: rule succeeds.”

Couple of days late, but this solution seems to work (bar the word being “when” and not “while”). Thanks!