Enquirer Home Page | Twitter | Back to Improbable Island
 

Programming Tutorial X - Where am I???

You've built a nice large Place. Huge in fact. Gigantic. So large that it's easy for people to get lost in it.1) So you've gone to some effort and made a map out of keyboard characters, and also decorated a page with it, so that if a guest looks at that page, then they can work out where they are. You've even colour coded it, and provided sub-maps for various wings/floors. Very nice. And thoughtful. Nice and thoughtful!

So, where do you want to put this map in your place? Probably in multiple places. Do you really want to build and decorate a new page for every room that you'd like to have map access? That's a lot of decorating, considering the size of your map.

There's an easier way. 2) Build and decorate your map on just one page, anywhere. Then, anywhere else that you want to give your guests access to the map, simply slip in a program with an Add Page Access (Link to page) Contraption, with the parameter set to the page with the map on. It's a program so simple that I'm not even going to show you the grid. You can do this! Much easier than rebuilding the map everywhere.

Notes for budding programmers.

This is the Add Page Access (Link to Page) Contraption. Note that, as with the Show Page Contraption, the page does not have to have any particular connection with the room. It can be anywhere in your Place.

It is useful to be aware of the precise mechanics of pages. A guest's location is determined by the room they are in and the page that they are on. If the guest follows a link to any page at all, then no matter where it is, they are still in the same room. The title at the top of the screen will remain the same, and all doors and links from the original room that are not hidden by a Hide Door or Hide Page Link Contraption will show. Any programs on the new page will run, then any programs in the original room will also be run. It is this very useful feature which allows the above program to work. If we tried to do the same thing with rooms instead, then we would have the map room connected to many different rooms in your Place, and it would not be at all obvious which way to go back, your guest could use the map to flit to anywhere that connected to it. This could be dealt with, using memories3) and lots of programming, but it would be difficult. Using pages does the job automatically.


It is also useful to be aware that page links work a little differently to doors. With doors, there's a fixed collection of doors leading from a room, depending on how many you've built, and they come in a fixed order (as determined in Master Settings).

This is not how page links work at all. A room starts with the links to pages that have been built off of it whose Master Settings are Showing. When a program runs in a room, any Add Page Access Contraptions cause a new page link to appear, irrespective of any links to that page that already exist. It is thus quite possible to have two, three or even more links to the same page showing.

The order in which they show is determined by the order in which they are programmed. The first link to be shown by a program will be at the top of the list, the second will be underneath it and so on. Once all the programmed links appear, then the 'natural' links are shown.

If a Hide Page Link is encountered, then all links to that page are hidden. Even subsequent use of Add Page Access Contraptions won't show a link.

The next tutorial will be more straight forward, and will deal with randomizing events using the Dice Contrivance.


Go to next tutorial.
Return to previous tutorial.
Tutorial Contents Page
Return to Introduction to Programming.
Return to Places Overview

1) If you think that this sounds far fetched, then have a look round the Bingo Hall one square north of Improbable Central.
2) Which is a key concept in all programming. Sometimes referred to as the KISS principle: Keep It Simple, Stupid!
3) a rather wonderful feature of programming that has not been dealt with yet.
 
Logged in as: Guest (Guest)
places/progtutx.txt · Last modified: 2017/05/28 03:54 (external edit)