Enquirer Home Page | Twitter | Back to Improbable Island
 

Advanced Techniques II - Multiple Commands

It's the pride and joy of your Place. The big machine room! It's got different coloured buttons to press!! There's a lever to pull!!! Dials to twist!!!! More exclamation marks than you can shake a stick at!!!!! All of them doing different fun things. All of them activated by commands.

You've got a lovely room full of things to look at, each with their own little description on their own page. But you don't want to just list these as links under the "Explore this area" heading. You want to make your guests work a little to find them. Perhaps there's some sort of puzzle where the guest has to find something that's carefully hidden, by working out what to look at. There are plenty of little things to keep them interested until they find the right one.

The general case - you've got a room, and you want to enable multiple commands from it. You could have separate programs, as shown here, for each command. This could use a lot of programs, and is a little messy. Each command is in a separate place, and hopping around between them to see what you've done is awkward. Maybe this works well for you, if so, then go with it. But it's possible to put all of these commands into one program. Here we will deal with the case where you only want to fire one Contraption (typically a Show Page) for each command. The next tutorial will deal with the more general case where you may wish to do something a little more sophisticated using multiple Contraptions for some commands.

Use one line per command. For each command, put your list of keywords "Press" and "Yellow Button"; or "Look", "Large" and "Vase" say, in Partial Match Commentary Contrivances to the left of the flow control knob, set the knob to Any Fail, and then put the desired Contraption, Show Page, Warp to Room, or whatever else you want, in the escape hatch. Like this.

 Many different commands each triggering its own page.

Note for budding programmers.

Here we're using the same trick as in the last tutorial. For each command, the desired outcome is in the escape hatch, so we have to use the same 'reverse logic' as before, and set the program flow knobs to fail exactly when the desired conditions are achieved. In the above program, we want the contraption in the escape hatch to fire if All the Contrivances pass, and so we want the program to continue if any Contrivance fails. Take a careful note of this. ANY fail, the program continues. ALL pass, the escape hatch fires.

In general, remember the following table.

Proceed to
next line of
program
(flow control
knob setting)
Proceed to
Escape Hatch
Any Pass All Fail
All Pass Any Fail
Any Fail All Pass
All Fail Any Pass

Note that all your different commands are mutually exclusive. As soon as one command is found that matches what was typed in, the escape hatch fires and the program terminates. This may not be what you want. For example don't mix up a program that shows pages depending on where you've come in from (as covered in the previous tutorial) with one like the above which looks out for commands. Keep them in separate programs.

Sometimes however, this might be quite useful. In the second example above, where there are things to look at, you may want to test if your guest is looking at anything at all. If they're using the command /look, but not then trying to look at something that you've anticipated, you may want to give them some sort of message. "I'm sorry, I don't know what you're trying to look at." This is easily done.

Start your program with a line with just one Partial Match Commentary Command with its parameter set to 'Look'. Leave the Flow Control Knob setting on Any Pass. So the rest of the program will only be looked at if your guest is trying to look at something. Continue with a line for each item that you want people to be able to look at, as in the above program. Then in the final line put just a Show Page pointing to your 'What are you looking at?' message page. This will be reached whenever none of the previous lines work. That is, when they're not trying to look at something that you've anticipated, as desired. Your program should look something like this.

 Looking at many different things, with a catch-all page if the player says something you aren't set up to recognize.


Proceed to next tutorial.
Return to previous tutorial.
Advanced Tutorial Contents Page.
Return to Places Overview

 
Logged in as: Guest (Guest)
places/advtutii.txt · Last modified: 2018/08/31 23:08 by Hairy Mary