Accurate specification of the "instead" qualifier?

As in this line in the Standard Rules:

Carry out taking inventory (this is the print empty inventory rule):
  if the first thing held by the player is nothing,
    say "[We] [are] carrying nothing." (A) instead.

It clearly does… something. It prevents execution of the remaining Carry out taking inventory rules. What exactly is it doing here? “Rule succeeds”? “Rule fails”? “Continue the action”? “Stop the action”?

This is another case where the absence of a reference manual for Inform 7 is glaring. I can’t find a single definition of what this does anywhere in “Writing with Inform”, because it’s not a reference manual and doesn’t document large portions of the Inform 7 language.

I agree that WWI can be difficult to use as a reference, but I don’t think this is a particularly good example. Chapter 19 (titled “Rulebooks”) under section 11 (titled “Success and failure”) seems like a fairly obvious place to look for that information. Here we find a box that details:
(from: WI §19.11 Success and failure)

continue the action; means “end this rule with no outcome”

stop the action; means “end this rule in failure”

… instead; means “end this rule in failure”

(Although, in fairness, this is the latest version. I don’t know to which version of WWI you are referring.)

2 Likes

I can’t add anything about the failings of the manual. But do you want to know what the instead achieves here? You already said it: It prevents execution of the remaining Carry out taking inventory rules.

I always remember a phrase related to this, from the docs, that says… ‘… it is too late for that.’

I searched it up and the full phrase is ‘Carry out rules must not block the action - it is too late for that.’

In this case, the inventory action has gone ahead and printed ‘I’m carrying nothing.’ etc. It just doesn’t need to print more. Nelson could have written the message and then said ‘stop the action’ right underneath, but ‘instead (message)’ does the same thing in one line. I don’t know if he’s super consistent in such approaches through the Standard Rules. Certainly the more time you spend in them, the more you see how he works.

I generaly think of instead as an immediate end to and diversion from the current action, almost always resulting in the action failing. I have to say ‘almost always’ because if the instead is in a rule followed by another rule, it won’t fail the original rule. But will if abided by.

-Wade

Thanks for finding this. I’ve said before that I think Writing with Inform is terrible; couldn’t find that by searching it, there’s no index, etc. etc.

The context:

I’m trying to implement some finicky time-passes code for tracking time sort of Deadline-style (there have been several previous attempts at this but I’m not entirely satisfied with any of them). To get it exactly like I want it, I have to figure out how it interacts with every single action in the Standard Rules.

I want to not advance time on failed actions (for the most part). So for almost everything I want to do, it works to add an extra “carry out” rule to handle timekeeping, with additional timekeeping in the “after” rules for special cases, and in the “check” rules for cases which should take time when failing. The failed actions get caught in the “check” stage or earlier. (I still have to handle “implicit taking” and similar though.)

But to make sure that the time-tracking rules trigger, I have to make sure that the standard “carry out” doesn’t quit the rulebook early. Which, well, it does quit the rulebook early in this case. Thankfully this is one which shouldn’t take time.

The “instead” should be OK if it’s used in the form “try instead” because then the timekeeping for the other action will trigger.

There is a stray “stop the action” in “Carry out an actor looking under”, which I’ll have to replace. (I should maybe report that one as a bug.) (There’s more in the “(for dialogue language element only)” section which I won’t be using.)

I considered other approaches to tracking time (Writing with Inform suggests several hackish and non-extensible approaches) but primarily doing it in the “carry out” stage is the only one which allows for the right granular level of control I’m looking for.

And as usual, I have to go through all of Standard Rules, and some of the I6/Inter kits, with a fine-toothed comb to make sure none of it is going to trip up my implementation.

It sounds like you’ve got a good scheme worked out.

I’ll just let you know how I do this sort of thing (which may originally have come from one of the approaches in the manual you rejected.) I use Eric Eve’s Variable Time Control extension. The main principle is: an every turn rule always advances time by a standard amount. But you can send a signal at any point during the turn to ‘take no time’ (causes no advance). And can otherwise put code anywhere in any process to alter time by a specific amount.

Since taking no time is usually tied to rejection messages, I create a token: To say nt: take no time, then I just stud the responses from the standard rules, and any rejections I create, with [nt]s. e.g. BREAK SAFE triggers: say “[nt]That would never work.”.

-Wade

1 Like

Yes, Eric Eve’s approach is basically the one I’m using, and thanks to Eric for figuring that out.

I have to tweak it though.

2 Likes

Interesting.

It’s pretty obscure that I have to open up the IDE, then find the “general index” button (which honestly I’d never noticed before? It’s not the most obvious when I’m looking at the “Documentation” button in the Linux IDE – it’s not in the table of contents), to find the index. (Special note – it’s not accessible through the “Index” in the IDE.)

In order to find it in the version of the manual on the Web… well, it’s in there somewhere, but again the general index is not listed in the table of contents! (You have to go to “Index of Examples”, then backtrack to the top of the page to find the “General Index” button.)

Seriously?!? It’s stuff like this that makes the whole book infuriating.

Whatever I’m looking for is probably buried in there somewhere, but finding it is another matter – even if it’s the index, it’s not in the table of contents. This really epitomizes the organizational problems.

2 Likes

<phrase X> instead or instead <phrase X> is the equivalent of:

<phrase X>;
stop the action;

what stop the action does where:

  • Setting action variables: nothing
  • Before, Check: stops the action
  • Instead, After: stops the action; this would happen at the end of the rule anyway unless there was a continue the action, but it’s not necessarily redundant if it appears in the middle of the rule
  • Carry out, Report: stops the current rulebook, but continues with the action; report being the last rulebook, it would rarely be a meaningful distinction for that case

It’s that easy!

2 Likes

If the table of contents named every term that’s in the index, the table of contents would be as long as the index.

Andrew, I think you’ve misread this. Nathanael is complaining that there is no direct link to the General Index in the Table of Contents.

2 Likes

I think it is fair to say there have been several complaints. :)

I agree it would be good if the web manual added a “General Index” link.

2 Likes

The I7 docs web remix has a link to the index on every page.

5 Likes