carry out fooing the bar:
unless the bar is purple, fail with "The bar should be purple.";
try eating the bar;
to fail with (msg - a text):
say "[bold type]Failure -- [msg][roman type]";
stop the action;
What I mean is this: in the carry out rule there’s a sort of assertion (“unless the bar is purple”), and if this fails it calls a phrase (fail with…), and then in that phrase, I would like to stop the entire carry out fooing action.
My hunch is that this either cannot be done at all, or at least only in very circuitous ways. But I am always prepared for the case that I am missing something fundamental in Inform7.
If the rules reach the Carry Out stage, the action is deemed to be successful. All failure checks must occur before you reach this stage. You need to write a Before, Instead, or Check rule.
Check fooing the bar when the bar is not purple: instead fail with "The bar should be purple.";
Carry out fooing the bar: try eating the bar.
maybe I should tell y’all what I was actually trying to do and see what you can come up with.
I wanted to do a sort of “fast forward” command for beta testers (and, not least, myself). I know you can do this with “test” scripts and maybe using the skein. But I thought it would be neat to be able to do scripts that would play through moves, and also perform assertions about the game state as the game progresses.
Maybe I can do this with Danii’s unit test extension?
Essentially I would like the game to do stuff like this:
try opening the box
Assert the box is open
Try taking the apple
Assert the player is carrying the apple
Assert the apple is red
Assert the worm is in the apple
Try going north
Edit: or even better:
parse “open box”
Assert the box is open
Etc
You might try Aaron Reed’s Intelligent Hinting for this. It would be able to take care of making your assertion true if it fails, and for fast-forwarding through puzzles to later parts of the game.