Exercise 11 - Adding a Terminal
No Marathon level is complete without at least one terminal, so let's add one.
Creating the Alcove
Pull
out a 1"x1/2" alcove from the starting room. If you put it up against a
corner, you'll avoid giving the starting room too many vertices.

Fix up the wall textures inside, then apply a terminal texture and line it up.

Defining the Terminal
Next
we need to create a text file containing the terminal definition.
MarathUp uses a vaguely html-like format for describing terminal text,
that is described more fully in Appendix B. For now, fire up your
favourite text editor and enter the following. Save it in the same
folder as the Sketchup file under some suitable name, such as Ex1-Term1.txt.
<unfinished>
<logon 1600>
<information>
Hi there, good to see you again.
Grab some ammo from the room behind you and
go deal with the guys upstairs.
<logoff 1600>
Now
open the Wall Properties window for the back face of the alcove, and
set its Control Panel type to one of the computer terminals. In the
Permutation field, enter the name of the file that you created in the
last step.
If
you export and play the level now, you'll find that the terminal works,
except that it displays "Picture 1600 was not found!" instead of the
logon picture. That's because the map file doesn't have any terminal
pictures in it yet.
To fix that, use ResEdit to create a resource file called Example1.rsrc and copy PICT
resource 1600 (the Durandal logon picture) from the original Marathon 2
or Infinity map file into it.
Then play the map, and the terminal should be fully functional.
About resource files
As
well as terminal pictures, the resource file is also the place to put
chapter screens and level-specific MML and Lua scripts. MarathUp will
copy any resources present in the resource file into the exported map
file.
If you have a collection of levels that share the same resources, you can put them into a file called Map.rsrc. When exporting, MarathUp will first look for a file with the same name as the Sketchup file and an extension of .rsrc; if that is not found, it will look for a file called Map.rsrc in the same folder as the Sketchup file.
It is likely that a future map-merging facility will use Map.rsrc, so if you intend to merge your levels later on, that's the place to put your resources.
Setting an Objective
So far there's been no way of completing the level. Open the Level Properties window and check the Extermination box under Mission Type.
Now add a section to the terminal text file for when the objective is met,
<unfinished>
<logon 1600>
<information>
Hi there, good to see you again.
Grab some ammo from the room behind you and
go deal with the guys upstairs.
<logoff 1600>
<end>
<success>
<logon 1600>
<information>
Great work. Hold onto your socks, I'm taking
you out of there.
<logoff 1600>
<teleport level=end>
Teleporting
to level "end" will end the game. You can also put a 1-based level
number there to teleport to another level in a merged map file.
Export and play now, and you should have a complete little one-level game.
Now for something slightly different
That's
the end of the hands-on part of this tutorial. However, there are a few
more topics left to cover. Next we'll see how to import monsters, items and scenery semi-automatically.
---