Definition of an ALR File

The term ALR stands for Adrift Language Resource. It is used to describe any file with the filename extension ".ALR" which is used with the ADRIFT Generator to greatly expand the options available to a writer using the ADRIFT system in creating an Interactive Fiction adventure. More simply speaking, the ALR file allows you, the writer, greater variety and individuality in creating your adventures with ADRIFT Generator.

The ADRIFT Generator allows writers to create simple or complex IF adventures using a windowed environment. Every adventure has some basic commands and responses already built into it by the ADRIFT Generator, minimizing the amount of work which the writer has to put into the adventure. However, if a writer doesn't like the default commands or responses for a particular subject, there are several ways to change them. One of those ways is to use an ALR file to substitute default text built into ADRIFT with text the writer would prefer to be displayed.

Default text replacement is not the only use of an ALR file though. ALR files can really be used to replace ANY text in an ADRIFT adventure at the discretion of the writer. Additionally, when used in conjunction with variables, ALR files provide an almost unlimited level of flexibility and creativity when writing an adventure.

The rest of this Topic Tutorial will describe both the basic and advanced uses of the ALR file.

How an ALR File Works

Simply speaking, the writer lists in the ALR file the text in their adventure which they want to replace, followed by the text they would prefer to be displayed. The ALR file is then imported into the writer's adventure where it replaces the appropriate text per the writer's instructions. Now, when the adventure is run, the original text is replaced with the new text as dictated in the ALR file.

Creating an ALR File

To create an ALR file, first create a new file in Windows NOTEPAD. Most users can open NOTEPAD by selecting Start - Programs - Accessories - Notepad. An even quicker way to start NOTEPAD is by selecting Start - Run, typing "notepad" and pressing ENTER.

Next, save your new NOTEPAD file as "<filename>.ALR", where <filename> is the name you feel best associates the file with your adventure. Other than organizational purposes, the name and location of your file is up to you and has no bearing on your game. Once you import the file into your adventure, ADRIFT never uses the file again (unless you change and re-import it). Just be sure to remember the name and location of your newly saved file.

As a general rule, I name my ALR files the same as my TAF filename to help me keep track of my files better. You may also want to sequentially number your ALR files or add special additional text to describe what type of ALR file it is. For example, for an adventure entitled WONDER.TAF, you might title your ALR as follows:

For a single ALR file, the title WONDER.ALR would be appropriate.

For multiple ALR files, sequential numbering would be appropriate, such as WONDER1.ALR, WONDER2.ALR and WONDER3.ALR.

If you have an ALR designed to replace text in the adventure and a separate ALR file designed to work with variables (discussed later), then you may want to save your ALR files as WONDERT.ALR (for text replacement) and WONDERV.ALR (for variable replacement).

These are of course only guidelines to help you better organize your adventure files and by no means required. It is important to note that your filenames should generally be limited to 8 characters, not including the ALR extension. Following this guideline ensures that individuals running older versions of Windows can still enjoy playing your adventure.

Once saved, your ALR file is now ready for use.

Comments in an ALR File

Blank lines are ignored when the ALR file is imported and help to organize your information so it is more readable.

Personal comments and section titles can be used in the ALR, but must be preceeded by a pound sign (#) to let ADRIFT Generator know that these comments should be ignored during the import. It is important to note that you shouldn't use the pound sign in conjunction with your variables in an ALR file as this symbol is used for comments. That is why I have used an exclamation point (!) in the examples above.

Blanks and comments are not only important for personal organization, but they also help others easily locate items in your ALR file if you have asked them for help to solve a problem. It is a good habit to form early in ANY aspect of IF creation, not just in writing an ALR file.

Associating an ALR File With an Adventure

Just because you have created an ALR file doesn't mean that ADRIFT Generator knows it exists. Nor does ADRIFT know which adventure is associated with the ALR file. Once you have finished creating and saving your ALR file with all the appropriate text replacements, you then have to import your ALR file into the appropriate adventure.

To import an ALR file, first open the appropriate adventure in ADRIFT Generator. Once it is open, select File - Import - Language Resource. By default, ADRIFT Generator will look in the last directory you have opened. If your ALR file is not there, browse to the correct directory and open your ALR file. When you open the ALR file, ADRIFT Generator will import the contents of it into the TAF file of the currently open adventure. Because ADRIFT imports the contents of the ALR file, it is important to note two things:

Your ALR file has no bearing on your game once it has been imported. You can delete it or move it and your game will not be affected because ADRIFT only uses the ALR file at the moment it is imported.

You have to import the ALR every time you update or change anything in it. If you don't, ADRIFT has no way of knowing you changed anything in the file and the new text will never be replaced.

Now that the file has been imported, be sure to save your adventure and try playing it to see if everything works like you intended. If something doesn't work right, go back to the ALR file and look it over. You may not have typed the original text exactly like it appears in ADRIFT. You also might have misspelled something. Finally, check the capitalization. If the original text in ADRIFT doesn't have a capital letter in a specific word and your ALR file does, then that line of text won't be replaced. If all else fails, have someone else take a look at your ALR and TAF files. Many times, a second party looking at your files for the first time can spot something you missed.

Text Wrapping in an ALR File

If you have line wrapping enabled in NOTEPAD, or in a different text editor such as WORDPAD, then longer lines of text may wrap to the next line. There is nothing wrong with that because anything between two hard returns is considered by ADRIFT as only 1 line. By "hard return" I mean that the ENTER key was pressed to end the line and start a new one.

If you want to replace something with multiple paragraphs of text or with text on multiple lines, use the HTML <br> command where you want a new line. DO NOT press ENTER to get the new line or else NOTEPAD will interpret this as an entirely new ALR entry.