Enquirer Home Page | Twitter | Back to Improbable Island

Advanced Techniques IV - Programs as gadgets Pt2.

You've got a room. You want to give it entrance specific descriptions as detailed in the first advanced tutorial. You've also got some things to look at and do, using commands which you want to watch out for.

That's two (largish) programs, a Grand Entrance program, and a Look Object program. You might have some other, smaller, bits and bobs that you want to do. So you set to and build your programs. Very nice. Hmmm. Not quite what you wanted though, your guest looks at something, and one of the entrance specific pages gets shown first, then the page detailing what they're looking at, and then the main room description. You wanted to just have the page detailing what they're looking at and nothing else. Perhaps some way of looking back round the room. 1)

You can get rid of the room description by using a "Hide Room Description" Contraption, but what about the entrance specific page? There are various ways of doing this, but, and this is crucial, they all depend on knowing whether the guest is looking round or not before deciding whether or not to show the entrance specific page. That is, they depend on the Look Object running before the Grand Entrance program. And now you've gone and built them the wrong way round. You could take all the programming out and start again, but that's a massive pain in the arse, and anyway, one of them has an extra four rows in now that you're loath to waste.

What you should have done is to build the Grand Entrance and the Look Round programs somewhere else, on a hidden page say, and then used Run Program Contraptions to run them from the main room. Then all you'd have had to do is to swap round the two Run Program Contraptions in your main program.2)

Take heed of this example. If you have multiple things going on in your main room, then separate them out into separate pieces, and write a program for each. Put these programs in a separate, hidden, room or page. Then consider these programs as gadgets in their own right, which you use with the Run Program Contraption.

Sometimes there might be gadgets that you want to build that aren't room specific. Gadgets that you might use in multiple rooms, possibly with slight variations. It's a good idea to have one room dedicated to keeping a library of such gadgets so that they're all in one place. The next programming guide will give an example of such a gadget, and also introduce Thoughts. The next guide after that will show how to use thoughts as parameters, sort of similar to the parameters that simple gadgets, Contraptions and Contrivances, have. This will enable you to build general use gadgets that can be tailored slightly according to where you want to use it.

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

1) My prefered method is to have a page entitled "Look back round." and decorated blankly. If they then click on the link, then the program will behave as if they have just entered the room.
2) Ain't hindsight wonderful?
Logged in as: Guest (Guest)
places/advtutiv.txt · Last modified: 2018/08/31 23:05 by Hairy Mary