scr2ifm offers two basic ways of mapping: you can create an initial (incomplete) map from your first transcript and then add the rest 'by hand', or you can create a set of transcripts, each exploring different parts of the game, and then merge them all into a final map. Which you choose is up to you.
Output from scr2ifm is as follows. First, if the title of the map was specified with the 'title' command (see IFM COMMANDS), it is printed. Then, if there's more than one map section, a list of map section titles is printed.
Next, there's a list of IFM commands derived from the transcript. Each time a new room is seen, a room command is output for it. Each room is given a tag name formed by the initials of each capitalized word in its name. To make tags unique, the second and subsequent occurrences of a tag name have that number appended. For example, room 'West of House' would get tag 'WH'.
If a movement command was up, down, in or out, then a compass direction is chosen for it that doesn't clash with other rooms (if possible) and the 'go' attribute is used to mark its real direction. If a movement command isn't recognized, the same is done except this time the 'cmd' attribute is used to record the command instead.
If movement is seen between two already-visited rooms, a link command is output (or a join, if the rooms appear to be on different map sections). Link tags are built by concatenating the room tags of the linked rooms with an underscore in between. Link movement is dealt with in the same manner as for rooms.
If the special 'item' or 'task' commands are seen (see IFM COMMANDS), then an item or task command is output following the room that it appears in. If an item or task hasn't been given a tag, it is assigned one. The tag is made by translating all invalid tag characters in the name to underscores, capitalizing (to avoid clashes with IFM commands) and, if the tag clashes with a previously-defined tag, adding a numerical suffix to make it unique. For example, 'black rod' might get a tag 'Black_rod_2'.
Finally, the IFM commands from the file indicated by the -c option are echoed (if any).
Another problem with mapping is that some games have these inconvenient things called puzzles, which sometimes block you from exploring everywhere so you can map it properly. Come on, IF authors, let's get our priorities right!
If you use the 'map' command, you'll end up with two or more map sections. The first map section is the one that contains the very first room, and will have a default name unless you give it one using another 'map' command.
You can fix most of these problems by creating a command file and specifying it with the -c option. There are two types of entry: scr2ifm commands and IFM commands. In a command file, blank lines and comment lines (those starting with a #) are ignored. If a command isn't recognized as a scr2ifm command, it's assumed to be an IFM command, and is passed straight into the output verbatim. You can use these to resolve conflicts in the generated map, by stretching certain links or hiding them altogether.
Here's a list of the commands available:
Start of a transcript of ADVENTURE The Interactive Original By Willie Crowther and Don Woods (1977) David M. Baggett's 1993 reconstruction, ported by Graham Nelson Release 3 / Serial number 951220 / Inform v1502 Library 5/12 Interpreter 1 Version B / Library serial number 951024
>verbose ADVENTURE is now in its "verbose" mode, which always gives long descriptions of locations (even if you've been there before).
>l
At End Of Road You are standing at the end of a road before a small brick building. Around you is a forest. A small stream flows out of the building and down a gully.
The previous two commands are recommended after starting the transcript.
>e
Inside Building You are inside a building, a well house for a large spring.
There are some keys on the ground here.
There is tasty food here.
There is a shiny brass lamp nearby.
There is an empty bottle here.
>item "keys" That's not a verb I recognise.
>item "food" That's not a verb I recognise.
>item "lamp" That's not a verb I recognise.
>item "bottle" That's not a verb I recognise.
The previous four commands declare the given items to the program. You don't have to bother with this if you don't want item locations on your map.
>get all stream: You have nothing in which to carry the water. well house: That's hardly portable. spring: That's hardly portable. pair of 1 foot diameter sewer pipes: That's hardly portable. set of keys: Taken. tasty food: Taken. brass lantern: Taken. small bottle: Taken.
>w
At End Of Road You are standing at the end of a road before a small brick building. Around you is a forest. A small stream flows out of the building and down a gully.
>s
In A Valley You are in a valley in the forest beside a stream tumbling along a rocky bed.
>s
At Slit In Streambed At your feet all the water of the stream splashes into a 2-inch slit in the rock. Downstream the streambed is bare rock.
>s
Outside Grate You are in a 20-foot depression floored with bare dirt. Set into the dirt is a strong steel grate mounted in concrete. A dry streambed leads into the depression.
Note that in this game we don't go in all possible directions -- there's no logic to the connections, and it'd just make a complete mess on the map.
>unlock grate What do you want to unlock the steel grate with?
>keys You unlock the steel grate.
>task "Unlock grate" need Keys That's not a verb I recognise.
That last command declared a task -- again, you don't have to bother with this if you don't want to.
>open grate You open the steel grate.
>task "Open grate" after last That's not a verb I recognise.
>d
Below the Grate You are in a small chamber beneath a 3x3 steel grate to the surface. A low crawl over cobbles leads inward to the west.
The grate stands open.
>w
In Cobble Crawl You are crawling over cobbles in a low passage. There is a dim light at the east end of the passage.
There is a small wicker cage discarded nearby.
>item "cage" That's not a verb I recognise.
>get cage Taken.
>w
Darkness It is pitch dark, and you can't see a thing.
>undo In Cobble Crawl [Previous turn undone.]
Oops! Stumbled into the dark by mistake. Without the UNDO, that would have meant 'Darkness' appeared on the map as a room.
>turn lamp on You switch the brass lantern on.
>w
In Debris Room You are in a debris room filled with stuff washed in from the surface. A low wide passage with cobbles becomes plugged with mud and debris here, but an awkward canyon leads upward and west.
A note on the wall says, "Magic word XYZZY."
A three foot black rod with a rusty star on one end lies nearby.
>item "black rod" tag Rod That's not a verb I recognise.
>xyzzy
Inside Building You are inside a building, a well house for a large spring.
Goodness me! That was unexpected -- we've been teleported. The link almost certainly won't look good on the map. We have the option of UNDOing, right now, or fixing the map later. Let's do the latter.
>xyzzy
In Debris Room You are in a debris room filled with stuff washed in from the surface. A low wide passage with cobbles becomes plugged with mud and debris here, but an awkward canyon leads upward and west.
A note on the wall says, "Magic word XYZZY."
A three foot black rod with a rusty star on one end lies nearby.
>get rod Taken.
>w
Sloping E/W Canyon You are in an awkward sloping east/west canyon.
>w
Orange River Chamber You are in a splendid chamber thirty feet high. The walls are frozen rivers of orange stone. An awkward canyon and a good passage exit from east and west sides of the chamber.
A cheerful little bird is sitting here singing.
>item "bird" That's not a verb I recognise.
>unscript
End of transcript.
Ok, now to create a map. To do that, use this command:
scr2ifm -o advent.ifm advent.scr
To check for problems, just type:
ifm advent.ifm
On the first run through, there are complaints about an overlapping room, due to a bad choice of direction for the 'down' link from Outside Grate, and the expected problems with the link between the Debris Room and the Building. A command file, advent.cmd, will fix these problems:
# Fix bad choice of direction. link BG dir s;
# Hide "xyzzy" link. link IDR_IB hidden;
# Replace it with join. join IDR to IB cmd "xyzzy";
Now, if we invoke
scr2ifm -o advent.ifm -i -c advent.cmd advent.scr
we get the following map:
## IFM map created by scr2ifm.pl
## Commands generated by transcript. room "At End Of Road" tag AEOR;
room "Inside Building" dir e from AEOR tag IB; item "keys" tag Keys; item "food" tag Food; item "lamp" tag Lamp; item "bottle" tag Bottle;
room "In A Valley" dir s from AEOR tag IAV;
room "At Slit In Streambed" dir s from IAV tag ASIS;
room "Outside Grate" dir s from ASIS tag OG; task "Unlock grate" need Keys tag Unlock_grate; task "Open grate" after last tag Open_grate;
room "Below the Grate" dir n from OG go down tag BG;
room "In Cobble Crawl" dir w from BG tag ICC; item "cage" tag Cage;
room "In Debris Room" dir w from ICC tag IDR; item "black rod" tag Rod;
link IDR to IB dir n s cmd "xyzzy" tag IDR_IB;
room "Sloping E/W Canyon" dir w from IDR tag SEC;
room "Orange River Chamber" dir w from SEC tag ORC; item "bird" tag Bird;
## Customization commands. link BG dir s; link IDR_IB hidden; join IDR to IB cmd "xyzzy";
ifm(1)