How would I change the default "you can't go that way" response during specific scenes?

I would like to change the default “you can’t go that way” response for specific scenes; how would I do that? This seems like it should be simple, but I can’t figure out how to write the rule.

It’s pretty straightforward:

The can’t go that way rule response (A) is “[if fire-scene is happening]The house is on fire, this isn’t the time to go randomly running around![otherwise]You can’t go that way.[end if]”.

The RESPONSES ALL command will let you see the the very, very long list of parser responses so you can modify them as you like.

3 Likes

Brilliant! I thought I tried that syntax, but I must have gotten it wrong. And thanks for the command, I’m sure I’ll make good use of it.

You could also write rules for going nowhere, which is how that response is triggered. e.g.

Instead of going nowhere in control room:
	say "The only exits are out to the airlock and down to the lab."

Instead of going nowhere in control room during spinup:
	say "The only exits are... um... airlockward and labward, but it won't be safe or practical to reckon directions, let alone actually move, until the centrifuge is active.

imo the rules-based approach is a bit tidier and easier to read in this case, if you have more scenes or more conditions to work with.

7 Likes

Yes, I recommend this approach, with “instead of going nowhere during My Scene”. It lets you keep your rules independent and not need to edit the response every time you want to add a new custom failure message.

1 Like

Ah I like that better, yeah. It’s definitely easier to work with and matches the other rules I have. I just didn’t think to try the nowhere “direction”!

All good points! I think I like directly changing responses since early on when I was working on my first game, I saw a couple of bits of authorial advice that recommended customizing them – I think looking at games like Violet that embed a narrative voice in them other than the drily English Inform default – and adopted the advice with cargo-cult-like fanatacism even when, as here, there are easier ways to do the same thing.

amplyfing Peregryn’s solution, one can also write

Instead of going [direction]: 
    say "blah, blah.."

having a general going nowhere direction custom message AND a custom message for a specific, nowhere or less, direction allow interesting creations, for a lame example, giving hints, for example, noticing that there’s a locked airlock in a specific direction…

Best regards from Italy,
dott. Piergiorgio,

2 Likes

One small tap-in here is that some people don’t like having too many “instead” statements.

You can say

check going nowhere in control room during spinup (this is the scene specific go nowhere 1 rule):
	say "The only exits are... um... airlockward and labward, but it won't be safe or practical to reckon directions, let alone actually move, until the centrifuge is active." instead;

the scene specific go nowhere 1 rule is listed first in the check rules.

@BlueAskew’s case should work well overall–I found when getting into more complex cases and interactions, there would be clashes of ordering, and while Inform sorts rules according to specificity (more generic ones last,) and that’s usually good enough, there can be unpleasant surprises.

It seems quite likely your “can’t go that way” rules won’t conflict, if they only happen during specific scenes, and if your rules are “instead of during scene 1/2/3/4”, but just in case… here’s something that may be useful down the road when you need finer-tuned control.

Also, the “instead rules” (there are no “instead of going” rules IIRC, just instead) get a bit long.

I also agree with @Piergiorgio_d_errico about generic “can’t go that way” direction.

a room has text called noway-text.
check going nowhere (this is the change default can't go message rule):
   if noway-text of the location of the player is not empty, say "[noway-text of location of player]." instead;

the change default can't go message rule is listed last in the check going rules.

then in a not-for-release section you can say

when play begins:
    repeat with rm running through rooms:
        if noway-text of player is empty, say "[rm] has no can't go that way replacement message.";
1 Like