If not looking and not going

Hi all, trying to add the tutorial stuff into my game. One thing gets me stumped though. Referring to Ex. 399. Solitude (zedlopez.github.io)

A novice suggestion rule (this is the suggestion that he look rule):
   if not looking and not going, say " [bold type]look[roman type]".

I tried to isolate the poblem and I think what it is trying to do is to suggest to look if the last command executed by the player was not a looking or going command. However the test as shown here does not appear to work. I checked the source code for Bronze and it seems to do the same thing. But that was compiled with an older version, I guess this functionality was removed at some point? Or did I miss something I need to do to make that test ‘if not looking and not going’ work? I can of course add my own global variables and set them after looking and after going, but was wondering if this would still work for newer Inform7 versions.

I gave that example a try. Its checks for looking and going don’t work because they’re not happening at the right time. The player is never considered to be looking or going when the ‘suggestion that he look rule’ runs; the actions are over and gone by then.

You could, as you were thinking yourself, check whether the player is LOOKing or GOING, or both, with an every turn rule (which happens at the end of a turn and at which time the tests will work), set variables, and then respond to the state of those variables in a rewritten ‘suggestion that he look’ rule.

-Wade

Good catch. This was my fix:

When play begins:
	say "Have you played interactive fiction before? >";
	if the player consents, now novice mode is false;

store-previous-action is initially false.
previous-action is an action that varies.

after reading a command: now store-previous-action is true.
before doing anything when store-previous-action is true:
  now previous-action is the current action;
  now store-previous-action is false;

A novice suggestion rule (this is the suggestion that he look rule): 
if the previous-action is not looking and the previous-action is not going, say "  [bold type]look[roman type]".
2 Likes

Good catch on your side too. I forgot to mention that the answer to the question was interpreted in the wrong way, leading to the opposite result (getting the helpful hints when not needed and vice versa.)

I’d noticed that part and submitted a pull request fixing setting novice mode shortly after the 10.1 release, so it was already the case that that much would have been fixed in the forthcoming release.