Beginner's Guide

Variables and the ALR

To make our television work, we will need to make a couple of tasks - which you will learn in the next section. But before you can do that, we need to prepare a variable and our alr to make it work correctly. First, we are going to create a variable.

Click on the Variable Icon on the toolbar. It is the one with X=3 Y=X on it. Or you can select Adventure then Advanced. Don't panic! This is something very simple and you'll love what it can do. Click on the Variable tab and select Add. First we need to give the variable a name. In this case type in the word channel. Notice that it is in lowercase. This is very important to remember because it will have to appear in the ALR exactly the same. Leave the initial value at 0, and leave it as an integer. Click OK, then save your file again.

That part is done. Now open your favorite text editor. You are now going to create your first ALR (ADRIFT Language Resource). On the first line type the following EXACTLY as it appears below.

channel0|The screen is dark.

You can see that the number zero right after the word channel. This is going to be the default number that is used. There is also a | after the number zero. This tells what text is to be displayed in the place of the channel variable. Keyboards vary, but the | is usually found on the same key as the backslash \, above the enter key.

Continue until your alr looks something like this. You can replace the text with a description of your favorite television shows.

channel0|The screen is dark.
channel1|Hey! Your favorite cartoon is on.
channel2|It looks like a soap opera of some sort is on.
channel3|The weather channel is on. It looks like rain for early next week.
channel4|A commercial for toilet tissue is on right now.
channel5|You're watching an infomercial for a handy dandy hand held steam cleaner.
channel6|It looks like there is a foreign film on. Too bad you can't understand what they are saying.

Now you hopefully have an idea of what it should look like. To be on the safe side, make sure you do not have a blank line at the end of the alr. To check, place your cursor behind the last period on the last line of text and hit delete. Now select save as - or save. Save the file as myfirstgame.alr

Now go back to the generator and select File then select Import. A list should appear. Select Language Resource and select the file myfirstgame.alr and then select Open. Save again.

You are just about ready to create your first task. But before you do that, go back to the object Television that you created earlier. After the description type in the following:

channel%channel%

Your complete description should look like this:

It is a foreign model, but you got a good deal. channel%channel%

Update the object and save your changes. It may look strange to you now, but once you learn how to create tasks, you will love the way that this works and will probably use variables and the alr all the time.

Continue on to the Tasks section and we'll get that television working like it should be.

Table of Contents     Creating Tasks