FLATLAND TUTORIAL Flatland home
texture styles orientation guide tips,tricks more blocks actions sprites popups lighting sound linking orientation textures navigation mulitilevels body tag head tag starting welcome
9 | LINKING

The ability to make hyperlinks between information sources is arguably the most important feature of that great repository of pet photographs they call the Internet. Spots are no different in this respect than regular old Web pages. Links are accomplished in 3DML files by naming ENTRANCEs and EXITs in your file, and pointing them at each other, or at outside SPOTs or Web pages.

Links can occur anywhere in a SPOT. You can place an EXIT on any block, including an empty block. Traditionally, however, EXITs are used in conjuction with the PORTAL Block. When a visitor to your spot rolls their mouse over an EXIT, the destination title or URL will appear just below the cursor, to let them know where the link will take them.

New Blocks
The PORTAL Block "@"
The PORTAL Block is used to indicate a hyperlink. It looks something like a doorway, only a little twistier. You can place an image over the doorway to give your visitors some clue as to where the link leads. By default, a portal block is linked to http://www.flatland.com. You can link the portal to any URL by using an <EXIT> tag.

When you are making your own spots, you'll want to use the <CREATE> tag to put an image that indicates where the link leads in the doorway of your PORTAL. But for now, we'll just use the default Flatland logo image.

The <EXIT> tag
<EXIT LOCATION = "(column,row,level)" HREF = "file_name#entrance_name" TRIGGER="click on, step on" TEXT="text" TARGET="destination name" />

Like the <ENTRANCE> tag, the <EXIT> tag can be placed anywhere within the <BODY> tags. Some builders like to put them directly after the Level in which they occur, others like to keep them all together at the bottom.

The <EXIT> tag has five attributes: LOCATION, HREF, TRIGGER, TARGET, and TEXT. LOCATION is the x,y,z coordinate at which the exit occurs, [with 1,1,1 being in the top left (or northwest) corner of the bottom level.] HREF is where the link leads to, expressed as the destination's file name or URL, followed by the entrance name, separated by a "#". TRIGGER defines how the EXIT may be activated, either by clicking on it, stepping on it, or both. To make an EXIT both "click on" and "step on" activated, just include both options in the TRIGGER attribute: TRIGGER="click on, step on". By default, EXITS placed in the BODY of the 3DML file will be "click on". Exits placed on PORTAL blocks will be both "click on" and "step on". If you want to open the link in a new window or frame of an html page, you can use the TARGET attribute to name where the link will open, just as you would in HTML. TEXT specifies the text that will appear by the user's cursor, indicating that the link is active. Usually this text is the title of the page or spot that the link leads to. But you can of course put any text here that you wish. If no TEXT attribute is specified, then no text will appear.

ENTRANCEs and EXITs in the <CREATE> tag
ENTRANCEs and EXITs can also be attached to specific blocks by including them in the <CREATE> tag. The tag syntax is the same, except that you don't need a LOCATION parameter. Remember, when you attach an EXIT directly to a block, then every instance of that block in your map will link to the same URL. When you attach an ENTRANCE to a block, and then use that block more than once in a map, then you will effectively have more than one ENTRANCE with the same name. Lets say you have an entrance named "doorway" attached to a block that appears 3 times in your map. When a visitor travels through a link to the "doorway" entrance, Rover will chose one of the 3 doorway entrances to use at random.

A note about Entrances
Entrances can only be placed on empty spaces or on certain kinds of blocks. If an entrance is placed on a location that is occupied by a block with a solid shape, then Rover will remove the model for that block, and it won't appear in your spot. This includes the PORTAL Block. If you want a PORTAL to act as an entrance as well as an exit, you should place the entrance on the location just in front of the PORTAL block. The blocks in the Basic Blockset that are allowed as entrances are these: FLOOR, CEILING, GROUND, HALFCEILING, HALFFLOOR, all LIGHT blocks, and SOUND.

We are going to make a link between firstspot.3dml and tallspot.3dml, and a link between two different locations within tallspot.3dml.

Link my spots!
First, lets put in a PORTAL. Change Level 1 of firstspot.3dml to look like this:

<LEVEL NUMBER="1">
###.@.###
#.......#
#.......#
#.......#
#.......#
#.......#
#.......#
#.......#
#########
</LEVEL>

Then, add this exit tag just before the </BODY> tag:

<EXIT LOCATION="(5,1,1)" HREF="tallspot.3dml#default" TRIGGER="click on, step on" TEXT="tallspot"/>

Linking your spot. This has established a one-way link from the PORTAL in firstspot.3dml, located at (5,1,1), to the default entrance in tallspot.3dml. A visitor can travel from firstspot.3dml to tallspot.3dml, but not back again, because there is no <EXIT> tag in the tallspot.3dml file.

Show me the code so far

Create a two-way link
In order to make this a two-way link, add this tag before the </BODY> tag in tallspot.3dml:

<EXIT LOCATION="(5,1,1)" HREF="firstspot.3dml#default" TRIGGER="click on, step on" TEXT="firstspot" />

And put a PORTAL in that location to mark the link:

<LEVEL NUMBER="1">
###.@.###
#A.....B#
##......#
##......#
#K......#
#h......#
#k......#
#D.....C#
#########
</LEVEL>

Save both of your files, and open firstspot.3dml in your browser. Go back and forth between the links!

show me the code

You probably noticed that when you linked back into firstspot.3dml, you didn't enter in the same location from which you left. This is because there is only one <ENTRANCE> tag in firstspot.3dml, the default entrance at (5,8,1). In order to create an exact two-way link between two locations, each location must have BOTH an <ENTRANCE> tag and an <EXIT> tag that point to each other. Also remember that the links would work just fine with or without the PORTAL blocks. The PORTAL is just a convention (like highlighted text in HTML) to indicate that a link is present.

Create a direct two-way link
In order to create a direct two-way link, add this <ENTRANCE> tag to
firstspot.3dml:

<ENTRANCE LOCATION="(5,2,1)" NAME="second" ANGLE="180,0"/>

And go back to the <EXIT> tag in tallspot.3dml and change it to read:

<EXIT LOCATION="(5,1,1)" HREF="firstspot.3dml#second" TRIGGER="click on, step on" TEXT="firstspot" />

show me the code

Now you have a direct link between two locations in two different spots. Next, we'll add an internal link between two different locations within tallspot.3dml.

Create a Direct Link
In your tallspot.3dml file, add these tags to the BODY:

<ENTRANCE LOCATION="(7,6,1)" NAME="floor" />
<ENTRANCE LOCATION="(7,6,3)" NAME="roof" />

<EXIT LOCATION="(7,7,1)" HREF="#roof" TRIGGER="click on, step on" TEXT="Up to the Roof"/>

<EXIT LOCATION="(7,7,3)" HREF="#floor" TRIGGER="click on, step on" TEXT="Down to the Floor" />

And mark your links with PORTALs. Change Level 1 to the following:
<LEVEL NUMBER="1">
###.@.###
#A.....B#
##......#
##......#
#K......#
#h......#
#k....@.#
#D.....C#
#########
</LEVEL>

And then add a Level 3 that looks like this:

<LEVEL NUMBER="3">
.........
.........
.........
.........
.........
.........
......@..
.........
.........
</LEVEL>

Up on the roof of the tall spot. And now you will need to change your MAP Tag accordingly:

<MAP DIMENSIONS="(9,9,3)" />

Save both of your files and open tallspot.3dml in your browser. Experiment jumping around between all of the links you have created.


code spot next

 



Copyright 1999, 2000 Flatland Online, Inc.