The Graphic Adventure Creator


(o)(o)

Programming with the Balrog

This part of the site covers the stuff The Balrog wrote about GAC in Amstrad Action, the information comes from Programming with the Balrog and GAC Programming Clinic. Some things have changed to fit the ZX Spectrum (and to protect the innocent).


Programming with the Balrog

GAC hints thanks to Paul Robson (Don't worry Paul - I'll review your game soon!) If you have any hints or tips for writing an adventure game or using a creator please send them in!

GAC can't do conditions such as 'IF (ROOM > x AND ROOM < y)' where you may want to, say, print a message in rooms X to Y. To overcome this, you could use a set of conditions with a marker:
HIGH 1 RESE n END
IF (ROOM > x) SET n END
IF (ROOM > y) RESE n END
IF (SET? n) MESS m WAIT END

(I haven't included the brackets which GAC inserts automatically)

It also has problems with 'NO2', the second noun in an input. Using GAC's own example - 'PUT GOLD IN BOX', where

'PUT'=VERB n 'DROP'=VERB m 'GOLD'=NOUN x 'BOX'=NOUN Y

a IF (VERB n AND NOUN x AND NO2=y).... Does not work ( 'PUT' AND 'GOLD' AND 'BOX')

b IF (NO2=y AND VERB n AND NOUN x).... Works

('BOX' AND 'PUT' AND 'GOLD')

What if you want to say 'DROP GOLD IN BOX' as well as 'PUT'?

c IF (NO2=y AND VERB n XOR VERB m AND NOUN x).... Works ('BOX' AND 'PUT' XOR 'DROP' AND 'GOLD')

BUT 'DROP GOLD' also works, which is not what is required! In fact, I can't find any combination which does work.

THIS works:-

d IF (NO2=y AND (VERB n XOR VERB m) AND NOUN x)....

('BOX' AND ('PUT' XOR 'DROP') AND 'GOLD')

But, (again!) GAC erases the added brackets when you next view the condition. If you're prepared to not view it again, fine.

This also works and conditions are unchanged by GAC:Local or Low 1 RESE a END

2 IF (NO2=y) SET a END

3 IF (VERB n XOR VERB m AND NOUN x AND SET? a).... ('PUT' XOR 'DROP' AND 'GOLD' AND 'BOX')

3 Important for anyone who, like me, makes lots of mistakes or changes their mind often!

You've entered a message (or Room, Verb etc) and then decide to delete it. GAC does not reclaim the original memory used, but seems to flag the memory location as unwanted, leaving most of the text intact but unseen. It's better to leave the text as it stands, make a note of the message number (or verb etc.) and re-use the message at a later stage, changing the text of course.

I discovered this when I looked at some saved code and saw words which I had deleted. I did a print-out of everything and typed it all into an 'empty' GAC, saving about 5,000 bytes!


Programming with the Balrog

Thanks this month go to Mike Barnard and Paul Robson for their tips on getting the most out of the Graphic Adventure Creator. If you have any tips for getting the most out of your adventure creator, or any tips on how to write adventures, then why not get pen to paper, quill to parchment or finger to keyboard and write to the Balrog at the usual address. The Balrog is especially interested in any external machine code routines for use with PAW.

There is no practical way of achieving Noel Llopis' idea in AA51 of adding your own calls to GAC (as you can do with PAW) but you can use some of the control codes to good effect. Control codes can be incorporated into a games room or message descriptions.

These control codes are listed in chapter 9 of the manual. Letter them starting at 1="A", to 26="Z" then 27="[", 28="\", 29="]", 30="^", 31="0" to make reference easier. Eg. CTRL + Variable Note BASIC equivalent

D n Change screen mode n=0-2 (GAC MODE n still uses 40 columns though) G Bell (Beep!) PRINT CHR$(7)

H Move cursor left 1 character PRINT CHR$(8)

I Move cursor right 1 character PRINT CHR$(9)

J Move cursor down 1 line PRINT CHR$(10)

K Move cursor up 1 line PRINT CHR$(11)

L CLS

N n n=Paper number 0-2 PAPER n

O n n=Pen number 0-3 PEN n

X Inverse video on/off

\ n xx n=Pen number INK n,x,x

x=letter representing a colour (appendix B of GAC manual, two different X's mean a flashing colour.)

] xx Set border colour BORDER X,X

For example, 'CTRL-L, space, rest of message...' will clear the window (code 12) and print a message.

You can also change colours with these, although I would suggest setting up a sequence to reset colours to normal in case of error - if this happens you won't be able to read the menu or anything else! You can do this by setting up a 'dummy' room with the following codes:-

\0AA INK 0,1
\AXX INK 1,24
N0 PAPER 0
OA PEN 1
]AA BORDER 1

Note: These are all typed with 'CTRL' pressed, except the zero which is typed on it's own. The codes should be continuous, I have separated them to show what each section does.

You can now experiment with the codes, eg, at the beginning of a room description, you can change colours, make a beep, etc. If the colours go wrong, press ESC until the menu screen, press 'B' for beginning room, delete old start room, and type the number of the dummy room, 'ENTER', 'ENTER' to start game, and the colours will return back to normal.

Thus your GAC games can now have sound (well a beep!), varying modes and multi-colour descriptions!


Noel Llopis from Luanco in Spain has written explaining how to choose a random message between any two numbers in GAC:-

If you write RAND ( 5 ) you will have a number between 0 and 4, and if you write ( 100 + RAND ( 5 ) ) you will have a number between 100 and 104. So if you write MESS ( 100 + RAND ( 5 ) ) the program will print a message between 100 and 104 - simple! This is very useful for asking the player for an order (eg What now? What next? etc.) and for describing objects (You see... There are... etc.)

Thanks Noel! The simplest solutions are usually the best yet the hardest to think of!


Simon also has some tips on character interaction:-

'With the Quill/PAW it is perfectly possible to have interactive, wandering non-player characters almost like a Level 9 game...

A character who moves away or does something when you are present. For example: Starts

map Objects: 1. The Balrog Location 2
2. Rod Lawton Location 1
Messages: 1. The Balrog goes NW.
2. The Balrog goes SE.
3. The Balrog goes east.
4. The Balrog sees Rod, "Mmmmm! Food!" shouts the cruel crusader before eating poor Rod.

Status Table

Entry 1 at 2 { Checks you're at location 2 } present 1 { Checks Balrog is present }

message 1 { 'The Balrog goes NW.' }

place 1 3 { Puts Balrog in location 3 }

Entry 2 at 3 present 1 message 2 place 1 1

Entry 3 at 1 present 1 message 3 place 1 2

Entry 4 present 1 { Checks Balrog is present } present 2 { Checks Rod is present }

message 4 { Print message }

destroy 2 { Removes Rod! (Hehehe!) }


Getting started

The Graphic Adventure Creator, like a machine code assembler, is not something you can just load in and use straight away - it can take months to learn properly but the basics can be learnt very quickly. In this brief two page guide I plan to write a small two location 'adventure' which should help you get to grips with the basics but to write a good adventure you will need the booklet (see later).So, let's get down to business - you've loaded in GAC and what do all those menus mean?!?!

{Screenshot of opening menu

The first thing you must do is load in the quickstart file (explained below) - to do this type T on the menu for load adventure and then type T for tape followed by the filename QS.ADV. The quickstart file will now be loaded and you'll return to the main menu.So, you've got the quickstart file, but as yet you haven't got any locations - type R on the menu. Now, due to space limitations, the adventure we write will be VERY simple - as previously mentioned it will have just two location and one object:-You are now in the "Rooms" subsection and the program will be asking you for a room number. Type 1 and then type in the room description -'You are in a large bank vault. `You will then be prompted for connections - ie where can I go from this room? In our example type:-EAST 2Which means if you type EAST (or E) you will go to room 2.You will then be asked for a picture number - for now just press return (or though later you should play with the Graphics menu - it's good fun!)Now we need to enter a room 2 that people can go east into!So:-Which Room number? 2You are in a bank.Connections are...WEST 1To quit back to the main menu hit escape twice.Now you're back at the main menu you can test what you've done so far - so press ENTER/RETURN to go into the adventure...And you'll find yourself standing in a large bank fault! Granted you can't do much apart from walk between the bank and the vault but it's a start!Finally for our example adventure, let's add an object - press O from the main menu (if you're still in the game press escape twice to return to the menu).We'll number our object 1 and give it the description 'a bar of gold' (the input routine should be familiar to you now - it's the same as room entry), you want the bar to start in room

1 (the bank vault). Set the weight as zero as we're not imposing carrying limits in this example.

--------- --------- N
! Large ! ! ! ! ! Bank  
!_______! Bank ! W _!_ E
! Vault ! ! ! ! ! (gold)! ! ! !
--------- --------- S

Now go back to the main menu and enter the game again - you should also be able to see a bar of gold now in the vault but you won't be able to do anything with it as we haven't written that in the code yet!First we'll have to set up 'gold' as a noun - go to the nouns menu and type '1 gold' - this means that noun 1 is gold... But what if someone typed 'get bar'? So add '1 bar' as well (and add ingot as well if you want to show off!).So, we've now set up the object as a noun but we haven't set up the get and drop routines - to do this we need to go into Low priority conditions. Our first input should be line 8 (lines 1 to 7 are used by Quickstart), type:-IF (VERB 7 AND NOUN 1 AND HERE 1) GET 1 OKAY ENDWhoa! What did all that mean? Well, if you look in the verbs menu you'll see that verb 7 is get (or take), noun 1 you've just set up and HERE 1 checks to see if object 1 (bar of gold) is here - ie in the location!{Somewhere have the nice piccie from the front of the GAC packaging}So, if you typed 'get bar' (or some variation) and the bar is here then GET 1 (gets object 1), print 'okay' (OKAY) and then END (END is like a full stop in English - it tells the computer that you've finished the routine - clever huh?Ok, so we've written a get gold routine - now we need to write a similar drop routine on line 9 of the low priority conditions -IF (VERB 8 AND NOUN 1 AND CARR 1) DROP 1 OKAY ENDCARR just checks to see if an object's being carried.Let's also make it so you can type 'examine gold' in line 10 -IF (VERB 16 AND NOUN 1 AND AVAI 1) MESS 1 ENDVerb 16 is examine, AVAI returns true if object is available for us (is HERE or CARR) and MESS 1 prints message 1 on the screen...But we haven't defined message 1 yet I hear you cry! Whoops, let's go and do that now... Press ESC twice to get back to the main menu and select messages, then choose message one and type 'It looks like it could be worth thousands!'.Now select save adventure from the main menu and save on a blank tape/disc as a datafile.Go back to the main menu and (drumroll) enter the adventure - you should be able to carry the gold around, drop it and examine it! Now the adventure purists reading this probably won't be very impressed - but it's a start! Tune in next month for more...

What do all those menus mean?

Adverbs

Used for words like 'in', 'out' (ADVE is used to check if one has been typed)

Begin Where

Instructs GAC where the adventure starts (ie if you type 2 you will start in the bank location).

Conditions (LOCAL)

Room specific, these conditions can be used for puzzles. (For example we could have had a local condition that if in room 1 and input was 'get gold' then a message would be printed (alarm bells sounds)).

Graphics

Great fun to play with - any room in a GAC game can have a graphic, subject to memory limitations.

High Priority Conditions

Err... The highest priority conditions! These conditions are checked before the others - so you could code a puzzle which depended on a time limit amongst other things.

Low Priority Conditions

Whatever the player types these conditions check to see if the input is correct - ie in our bank example 'get gold' is a LPC.

Messages

Used for describing objects, events etc.

Nouns

Like adverbs.

Objects

See bar of gold example.

Printer Menu

Lets you print out your program.

Room Descriptions

Used for locations descriptions.

Save adventure

Obvious! You can save your file as an executable (which means you could load it independently of GAC) or as a data file (which can be loaded back into GAC).

Verbs

Like nouns/adverbs...

Erase adventure data

Don't do this unless you're really sure you want to do it as it will delete everything you've typed in!

Enter adventure

Play adventure you are writing (used for testing routines).

What is QS.ADV?

QS.ADV is a quickstart file which saves you some typing - it has many system messages (such as "You are carrying" and "What now?..."), many useful verbs (examine, north, south, east, west, look etc.) and several of the common low priority conditions associated with them. This is to allow you get into writing your adventure without having to write the basics each time.

Booklet

This article is the tip of the proverbial iceberg in explaining the use of GAC - if you're serious about using GAC then write to GAC Booklets, c/o AA enclosing a cheque/postal order for ?3 and we'll send you the instruction book! However you don't necessarily need the book to use GAC but it certainly helps!{Rod,I am quite happy to do the booklet and make a few more pennies but I understand if AA would have to do all the work!Stuart}

What next?

That is up to you! Next month I will continue the tutorial, adding to our bank adventure, but I would prefer to answer readers questions - if anyone has any queries concerning GAC then write to GAC Programming Clinic at the usual AA address.

The Quickstart data file explained

Verbs Nouns----- -----6 D 255 IT6 DOWN8 DROP3 E Messages3 EAST --------16 EXAMINE 239 You are carrying7 GET 240 What now?...13 GRAPHICS 241 You can't.10 INVENTORY 242 Pardon?9 L 243 Press a key for another game...10 LIST 244 Are you sure (Y/N)...15 LOAD 245 You've already got that.9 LOOK 246 You haven't got that.1 N 247 You can't see that1 NORTH 248 You're carrying too much to pick that 13 PICTURES up.11 QUIT 249 Your score was15 RESTORE 250 and you took2 S 251 It is dark. You can't see.14 SAVE 252 I can't find that anywhere.2 SOUTH 253 You can also see7 TAKE 254 Okay12 TEXT 255 turns.5 U5 UP4 W4 WEST12 WORDS

Low priority conditions

IF ( VERB 9 ) LOOK WAIT END If you typed 'look', redescribe the room you're in and wait for a new command.IF ( VERB 10 ) MESS 239 LIST WITH WAIT END If you typed 'inventory' then print 'You are carrying ' and list all the objects that are with you.IF ( VERB 11 ) QUIT OKAY END If you typed 'quit' then ask the adventurer if they are sure and if they respond yes then quit, otherwise print okay and continue.IF ( VERB 12 ) TEXT OKAY END If you typed 'text' then turn the pictures off.IF ( VERB 13 ) PICT OKAY END If you typed 'pictures' then turn the pictures on.IF ( VERB 14 ) SAVE OKAY END If you typed 'save' then save the game position to tape or disc.IF ( VERB 15 ) LOAD LOOK WAIT END If you typed 'load' then load a previously saved game position from tape or disc, then describe the room you are in.


GAC Programming clinic

This month I'll continue adding to our bank adventure started last issue as well as telling you more about how to work GAC... My first puzzle!

Not only are we going to add more locations to our bank adventure, we'll also be adding a puzzle (a locked bank vault door) and a maze!

Room 1     Room 2
---------- -------- N
! Large  ! !      !
!          ! Bank
!_________! Bank ! W _!_ E
! Vault ! (door) ! ! ! ! (gold) !! ! ! ---------- --------S
Room 4 ! Room 3
---------- ---------
! High   ! !Outside!
! Street
!_________! Bank ! ! (key) ! ! ! ! (hole) ! ! 
! ---------- --------- ! V To sewers

First let's add the extra locations -Room 3 'You are outside the bank. Exits are north and west. 'Connections: N 2 W 4Room 4 'You are on the the highstreet. There is an exit to the east and you can go down to the sewers. 'Connections: E 3 D 5and amend the old locations...Add the message 'The bank vault door lies open to the east. ' (We're not going to allow the adventurer to close the vault, just open it) in Room 1.Remove the exit 'west 1' from room 2 (as we'll be putting a door between these two locations) and add south 3. Also add to the end of the room description 'There is an exit to the south and a large bank vault door to the west. 'Now let's add a maze - lets have the maze as a sewer complex beneath the high street...Room 5 'You are in a dank sewer. You can see daylight above. 'Connections: U 4 N 8 S 7 E07 W 6Room 6 'You are in a smelly sewer. 'Connections: N 7 S 8 W 5 E 6Room 7 'You are in a slimy sewer. 'Connections: N 6 W 7 E 7 S 8Room 8 'You are in a sewer. 'Connections: N 7 S 8 W 8 E 8So let's go over what we've got now - we've added a lot more locations, including a four room sewer maze which should be good (and could be made a lot harder if you changed all the location descriptions to be the same!). Now, we still want to add -Start in room 8Put a key in room 8Add a door to Room 2Add a puzzle which lets you open the door with the key...Starting in room 8 is easy - just go to the 'Begin where?' menu and change it to 8! As to putting the key in room 8, follow the same approach as the bar of gold from last issue - ie..Nouns 2 KeyObjects 2 a key starts in room 8 and weighs 1.Messages 2 The key looks important...Low Priority:-11: IF (VERB 7 AND NOUN 2 AND HERE 2) GET 2 OKAY END12: IF (VERB 8 AND NOUN 2 AND CARR 2) DROP 2 OKAY END13: IF (VERB 16 AND NOUN 2 AND AVAI 2) MESS 2 ENDAdding the door and the puzzle element is the complicated bit -Add MESSAGE 3 'The door is wide open...'add 'door', 'vault' and 'bank' as noun 3 and add the verb 'unlock' to the verb list (make it verb 18).Now go the local room conditions and add a condition for room 2 -IF (VERB 4 AND SET? 3) GOTO 1 WAIT ENDIf you typed 'West' and marker/flag three is set (ie the door is open) the go to room 1 (the bank vault).Also add IF (VERB 4) MESS 4 WAIT END to the list (if type go west and marker is not set then print message 4 (which we make 'You can't walk through doors you know!'))And finally addIF (VERB 18 AND NOUN 3 AND CARR 2) SET 3 WAIT ENDWhich basically says if you typed 'UNLOCK DOOR' and you have the key on you then set the door to be unlocked.Finally we want to add the message about the door being open to the end of the room description so we need to go to the high priority conditions menu and add -1: IF (AT 2 AND SET? 3) MESS 3And we should be ready to rock and roll! Pat yourself on the back if it works - 'Bank adventure' now looks much more like a proper adventure than the two location 'thing' we created last month! If it doesn't work then look at the errors box to see what you've done wrong...Save it as a datafile called bank.

Editing and deleting things

To edit something (such as a room location or a condition), follow the procedure to enter it, and instead of empty lines to edit things on, you will get what was there before. To skip to the next part just press ENTER/RETURN. You are free to edit things as you go along, but don't press ESCAPE before you get to the "Which room/object/line number...?" else your changes won't be kept!To delete something, follow the procedure to enter it, but edit the first bit of data to be a blank line (ie no spaces) this can be done be repeatedly holding down the CLR key.For example, to edit object one from 'a bar of gold' to read 'the mystical lost treasure of Nanu-Xanu', just press O from the main menu (for objects), choose object 1, edit the line using CLR, DEL and the cursor keys and then press enter until the "Which object number?..." prompt appears at the bottom of the screen. Then just press escape and the change will be committed to the computers memory.

What is a marker/diagnostics?

Markers and counters (sometimes called flags or variables) are very important to any adventure game - without them it would be very difficult to write even the simplest puzzle.There are 256 markers, which can only be true or false. They are set by using the SET and RES commands (see example of the bank door above) - thus if marker 3 is set (true) then we say that the door is open, else if it is unset/reset (false) then the door is closed. Markers are tested using the SET? and RES? commands. These markers are very useful for puzzles which need to test if something is true or false (ie a door open/closed, night/dark, hungry/full etc.).There are 128 counters, numbered from 0 to 127. They are most frequently used to store the number of moves since a particular event (eg in the dark) but could be used for keeping account of how many gold coins you have etc. Counter 0 holds the score and counters 126 and 127 hold the turns count since the start of the game.When you are testing an adventure, the way to return to the main menu is to press the ESC key, as usual. This gives you the message "Press D for diagnostics or ESC to escape...". If you press the "D" key, then all the markers and counters will be displayed on the screen. For the markers, a filled circle indicates "SET" and an unfilled one "RESET". the values of the counter are given as you would expect. To get back to the main menu just press ESC again, or press any other key to get back to the game (this is very useful for debugging the adventure).

Errors

Any adventure you write will develop bugs as you go along - some of them more serious than others. There are several errors than can occur from within GAC and most of them will throw up one of the error messages listed below:Message not found - means exactly that, you haven't set up the message that the routine is referring to. If you get this immediately, check that you have loaded in the quickstart files (QS.ADV) as this has all the system messages.

Room not found - commonly caused when you have a GOTO to a non-existent room or a connection which leads to a room which has not yet been created.Object not found - means that you have tried to pick up, drop or describe an object which doesn't exist.

Marker not found - Means you have tried to access a marker which does not exist.Counter not found - means you have tried to access a counter which does not exist.

Illegal value - Means you have tried to look for a verb, noun, adverb etc with a number greater than is possible or have tried to load a counter with a number greater than 255.
The legal ranges of numbers are:-
Rooms : 1 .. 9999
Objects : 1 .. 255
Messages: 1 .. 255
Verbs : 1 .. 255

Nouns : 1 .. 255
Adverbs : 1 .. 255
Markers : 0 .. 255
Counters: 0 .. 127 [which store: 0 .. 255]

Usually an error is caused by a typing error or forgetting to enter a room/object/noun etc and thus easily traceable.


GAC Programming with the Balrog

Well, this month was meant to be the start of the GAC Programming Clinic in which people would write in with their problems with GAC and I would answer them... but... I'VE HAD NO LETTERS! Now, either my previous two GAC articles were so well written that no-one had any problems at all or no-one cares! (sob! - The Balg) So this month I've decided to move away from our bank adventure (which I will use every now and then for examples) and continue explaining the intricacies of GAC...This month we'll look at the graphical capabilities of GAC.Drawing graphics in GAC is very simple and easy to master and can add greatly to your adventure, adding graphics to an adventure is good fun too as you can see the results take shape before your very eyes.Press 'G' from the main menu to enter the graphics section of GAC. On the screen will be a rectangular window, a compact menu below and a question 'Which picture number?...'. Press '1' and press ENTER - the question will disappear and cross-hairs will appear in the middle of the window.You can move the cross-hair around one pixel at a time using the arrow (cursor) keys and for rapid movement (of 8 pixels a time) you can press the cursor keys in conjunction with SHIFT.Graphic commands----------------arrows Cursor

Move the cross-hair around the screen.SHIFT arrow Cursor Move the cross-hair around the screen quickly.ESC Escape Change picture number or press again to return back to main menu.D Dot Place a dot on the screen.DEL Undo Take back last command - ie, if you just pressed D for a dot then pressing DEL with delete the dot. In the top right hand side of the screen is the word 'LAST' which tells you what your last command was.COPY Pen Puts pen on/off paper - press COPY once to start a line and then move the cross-hair to where you want the line to terminate and press COPY again. If you look at the pen on the right hand side of the screen you will know when your pen is up or down on the 'paper'.I Ink Change colour of 'pen' - On the left hand side of the screen is a set of number (0 to 3) followed by coloured squares. These are the colours of the various inks you can use. When chosen the pen on the right of the screen will change colour to the one you have chosen.F Fill The fill command can colour-in a section of the screen with up to two separate colours (chosen using the S command). The fill routine is very fast but not very good with irregular shapes - these shapes may need several 'fills' to colour in completely. See the diagram below for more details on how the fill routine works. Note that you can only fill any area of solid colour not shaded areas, as, due to their composition, you will only fill one pixel.Only this part /* Use diagram from page 8 All filledfilled of GAC manual */ + cursor position Case A Case BThe area filled is worked out by the fill routine checking up and down from the cursor position until it hits something, giving a horizontal band of colour.S Shades Used to determine what colours you want to fill with - if you want a solid colour then just press the ink number twice. You only need to re-do the 'S' shading command again if you change the colour. If you have several FILLs the same colour there is no need to re-type 'S' in between them.C colour Change your choice of colours used in four colour 'inkpot'. First choose which colour ink you want to change and then you will be asked for two letters taken from the table below.SPACE: black I: green R: bright greenA: blue J: cyan S: sea greenB: bright blue K: sky blue T: bright cyanC: red/brown L: yellow/brown U: lime greenD: magenta M: white/grey V: pastel greenE: mauve N: pastel blue W: pastel cyanF: bright red O: orange X: goldG: purple P: pink Y: pastel yellowH: bright magenta Q: pastel magenta Z: white If you change ink 0 to BB then the background ink will turn bright blue (0 is background, 1 is text), however AI would produce a background flashing between blue and green. Experiment with this command carefully though - make sure you don't set ink 0 and ink 1 to the same colour else you won't be able to read anything!E Eclipse Draw an eclipse (a squashed circle) on the screen - useful for drawing clouds, suns, moons, holes in the floor etc. Of course it can also be used for drawing a circle if you get the proportions right. Press 'E' again when you have moved the cross-hair to where you want the eclipse to finish.R Rectangle Draw a rectangle.

Editing pictures

The CTRL key and the cursor keys will step you backward and forward through the picture step-by-step so that you can insert things half-way through.CTRL-left takes you back one command (similar to DELete in that the last thing disappears, but it is not deleted).CTRL-right takes you forward one command.CTRL-up takes you forward five commands.CTRL-down take you back five commands.SHIFT-> deletes everything from this point in the picture to the end.W Draw the whole picture back again.One other very useful feature of GAC is that of merging pictures - for instance, you find that, in your adventure, you have a single basic cave shape, which you want to use in many of your pictures, but details differ. It is possible to include a picture already created into the picture you're in by pressing 'P', typing the number of the picture you want to include, and pressing ENTER. This is then drawn over the top of anything there. (It's usually best to merge at the start of drawing a picture and then you can draw around the merged picture).Finally, to actually allocate pictures to various locations you must move to the rooms menu and change the picture at that location to the picture number you have drawn on the graphics menu.----Arghhh!! Seems like last months GAC programming article got a little corrupted on it's 3" disc and the room descriptions and exits for the maze was chopped out completely! Here is the missing section so that you can play 'Bank Adventure' properly!Now let's add a maze - lets have the maze as a sewer complex beneath the high street...Room 5 'You are in a dank sewer. You can see daylight above. 'Connections: U 4 N 8 S 7 E 7 W 6Room 6 'You are in a smelly sewer. 'Connections: N 7 S 8 W 5 E 6Room 7 'You are in a slimy sewer. 'Connections: N 6 W 7 E 7 S 8Room 8 'You are in a sewer. 'Connections: N 7 S 8 W 8 E 8


GAC Programming with the Balrog

This months we look at the 'guts' of the adventure - the conditions. Conditions are used for puzzles and programming the adventure how to react to different situations and player input. There are three types of conditions: local, high priority and low priority. GAC processes in the following order:- Print start room description Do HIGH PRIORITY conditions Get the adventurer's command Check for connections and if so, move Do LOCAL conditions (Specific for a room) Do LOW PRIORITY conditions (General commands)For example, if you want the computer to describe a room when you type the command 'LOOK' then you would put the following code in the LOW PRIORITY conditions section:- IF ( VERB 7 ) LOOK WAIT ENDSo, the general form of a condition is:- IF ( some conditions) some actions ENDIf the conditions are true, then the actions are performed. For more explanation look at the bank adventure example in AA76 and AA77.All the GAC conditions are:-VERB n Has VERB n been typed? (n is a number in the verb list) VERB 7 will give a TRUE answer if verb number 7 was typed, otherwise it will give FALSE.NOUN n Has NOUN n been typed? (similar to VERB)ADVE n Has ADVErb n been typed? (similar to VERB)HERE n Is object n HERE in the same room/location as the player? For example if you are in room 3 and object 1 is there then HERE 1 will respond TRUE.CARR n Is object n being CARRied?AVAI n Is object n AVAIlable for use? (ie HERE or being CARRied)x IN n Is object n IN room x? If object 1 is in room 3, then 1 IN 3 will be TRUE.WEIG n Give the WEIGht of object n.SET? n Is marker n SET? } If you're not sure what markers areRES? n Is marker n RESet? } then look in AA77. } Markers 0-2 have special values } defined below:- } Mkr 0, if set, means that a room has } been described since it was } last reset. } Mkr 1, if set, means you are in a } light room. Otherwise you are } in a dark room. } Mkr 2, if set, means you have a lamp } or some other source of } light. } If markers 1 and 2 are both reset, } then the program will refuse to } describe rooms, coming up with the } "It's dark" message instead, since } you are in a dark room without any } light. } Mkr 3, if set, disables the scoring } mechanism when you exit from } the game.CTR n Gives you the value of CounTeR n. } For more details onx EQU? n Is x EQUal to the value of counter n? } counters see AA77.TURN Gives the number of TURNs since the start of the game.ROOM Gives you the room number of the ROOM you are currently in.AT n Gives a TRUE answer if you are AT room number n.condition AND condition Will give a TRUE answer if both of the conditions give TRUE answers. eg VERB 1 AND NOUN 2 will be TRUE only if verb 1 and noun 2 are both typed.condition OR condition Will give TRUE if either conditions are TRUE, or both.condition XOR condition Will give TRUE if one of the conditions is TRUE and the other is FALSE.NOT condition Will give a TRUE answer if the condition was FALSE, and vice versa. So NOT VERB 1 will be TRUE if VERB 1 is FALSE.x < y Gives TRUE if number x is less than number y.x > y Gives TRUE if number x is more than number y.x = y Gives TRUE if x is equal to y.RAND x Gives a RANDom number between 0 and (x-1). So RAND 10 might give any number at random in the range 0 to 9.VBNO Gets the number of the verb in this command.NO1 Gets the number of the first noun in this command.NO2 Gets the number of the second noun in this command.NO1 and NO2 are used to check word order, and to GET and DROP objects without having to have a condition for each one.All the GAC Actions are:-

LOOK Describe the room you are in at the moment.
DESC n DESCribe room number n.
PICT Turns the PICTure display on.
TEXT Turns the picture display off, giving a TEXT only adventure.
GET n GET object number n. If it isn't here, or you've already got it, or it's too heavy, then the appropriate message is printed.
DROP n DROP object number n. If you haven't got it, then the appropriate message is printed out.
x SWAP y Exchange objects x and y.
OBJ n Describe OBJect number n.
LIST n LIST all objects in room number n.
LIST WITH LISTs all the objects carried WITH you.
x TO n Move object number x TO y. To destroy an object move it to room 0.
SET n SET marker n.
RESE n RESEt marker n.
x CSET n Set x to be the value of counter number n.
INCR n INCRease counter n by one. The maximum is 255.
DECR n DECRease counter n by one. The minimum is 0. Trying to increase past 255 or decrease past 0 is ignored.
GOTO n GO TO room n and describe the new room.
CONN n This checks through the CONNection table for a connection from the current room using verb n. If one is found, this gives the room number of the room you would move to if you took the connection, If not, then it gives zero. As an example, if you were in room 3 in the bank adventure, CONN 4 would give 4 because in the connections from room 3, verb 4 (W) would take you to room 4.
STRE n Set the maximum weight you can carry to n. STRE is short for strength.
BRIN n BRINgs object n here (if it exists).
FIND n FIND object n and move to it (if it exists). This does not acknowledge any restrictions (such as connections), so it could be useful in a magic spell or summoning.
SAVE SAVEs the current game position to tape or disc.
LOAD LOADs the current game position from tape or disc.
WAIT WAITs for a new command.
OKAY Prints "Okay" and awaits a new command.
EXIT Stops the game. The player is NOT asked, so this is for use when the player gets killed or wins.
QUIT The player is asked if s/he wants to continue, and if they type "N", for "No" when asked if they are sure, the game continues, else the game is abandoned.
MESS n Prints MESSage number n.
PRIN n PRINt number n.LF Prints a LineFeed. Everything from here is printed on a new line.
WITH Is equal to the room number of where things are put when you are carrying them.
HOLD n HOLDs up the game for n fiftieths of a second. For example to freeze the game for 10 seconds use HOLD 500.x + y Returns the value of x added to y.x - y Returns the value of x minus y.In all the above, n, x and y need not be simple numbers. They can be complex expressions (like 2+2 instead of 4 or other words such as CTR 1 or NO1), but expressions should be enclosed in brackets. For example IF ( VERB 3 ) GET 1 OKAY ENDwill become: IF ( VERB ( 3 ) ) GET (1) OKAY END


GAC Programming with the Balrog

This month is my final GAC tutorial - next month I'll start answering all your GAC problems in the Programming Clinic, this month I'll tie together the some loose bits and try to give some clues on writing a good adventure game and how to get the most out of GAC.

Memory management

One of the major problems with GAC is memory - you only have approximately 25K to write your adventure in and this free memory disappears very quickly (especially if you draw a lot of complex graphics). So how do you make the most of that limited memory? Read below...

Graphics...

Drawing pictures in GAC really eats up the old memory - each graphic command (rectangle, ellipse, fill etc) uses up bytes and often programmers waste extra memory by drawing graphics inefficiently - for example, drawing a chessboard with lines (which would seem the obvious method) and then filling in the squares uses up 199 bytes whereas drawing the chessboard using rectangles only uses up 154 bytes - this might not seem like a big difference but six chessboards drawn with lines would waste 1K of memory! Programmers often fill their pictures in at the wrong time as well - if you wanted to have the chessboard black on white with a blue background you should draw just the outsides of the board, fill it in with black, draw the other lines (using rectangles) and then just fill in the white squares with white (this is 33 fill operations), rather than drawing the board and filling in the various squares (which is 64 fill operations!) - if all this seems a bit complicated don't worry - you don't need it to write a good adventure it just means you'll have more memory to play around with!

Using templates...

Another way to save memory in your pictures is to use templates or merge pictures together. For more details see the box 'Editing pictures' on page 39 of AA78. Many GAC writers like to have their pictures surrounded by pretty borders or with a common graphic and using templates are the ideal way to do it.Global object declarations...Instead of having individual code for each object (ie GET KEY, GET RAT, GET MONEY etc) you can use global object declarations by using the NO1 command:-IF ( NO1 = 0 AND VERB 7 ) MESS 19 WAIT END If you typed 'GET' by itself or with an unrecognised word, print message 19 "I'm sorry, but I don't know what one of those is..."IF ( NO1 = 0 AND VERB 8 ) MESS 19 WAIT END And similarly for "DROP"IF ( NO1 = 0 AND VERB 16 ) MESS 18 WAIT END And again for "EXAMINE" except message 18 is "You find nothing much"IF ( NO1 < 5 AND VERB 7 ) GET NO1 OKAY END If you typed "GET" and a noun with a number less than 5, then get the object with that noun's number. This only works because the object and nouns which refer to them have the same number.IF ( NO1 < 5 AND VERB 8 ) DROP NO1 OKAY END If you typed "DROP" and a noun whose number is less than 5, then drop the object with that noun number.IF ( NO1 < 5 AND VERB 16 AND AVAI NO1 ) MESS NO1 WAIT END If you typed "EXAMINE" and a noun whose number is less than 5, then print out the message with that noun number, it being the more detailed description of that object, then wait for a new command.Thus, if you write your adventure with say, the first 20 messages, nouns and objects being allocated to objects then you can use this to save memory.Multi part...Penultimately, if you find yourself running out of memory, you could make your game load in multiple parts with each part being separate from the previous one. For example you could have the end of part one of your adventure as crash landing on the moon and then have part 2 taking place on the moon itself. Of course you can't allow the player to return to a previous part but if your adventure can be split up into sections than this is one of the best ways to get the most out of GAC.Final tip...One last comment about saving memory in GAC - it's been shown that whilst writing an adventure, memory is allocated to messages (such as locations, objects, messages etc) as they are created, even if they are later deleted or changed - thus if you write twenty messages and then decide to scrap them at a later date, GAC will unfortunately not free the memory from the deleted messages. So, if you're really stuck for memory, you could always print out the whole adventure and then re-type it into a 'fresh', 'unused' GAC. This obviously is a pain but if you're desperate for that memory it's one of the ways to do it.

How to write a good adventure

It's difficult to give any hard and fast rules as to what constitutes a good game and I'm not going to do that! Instead I'll just cover a briefly mention a few hints and tips in making a good adventure:-

No instant death situations

It can be intensely frustrating to get killed without warning in a game. These 'instant death situations' can easily be avoided by giving a hint to the player that something could be dangerous (ie a sign saying "Quicksand to the east") or by asking a player if they're sure they really want to do something. (ie "Are you sure you want to light the dynamite?").

Try and make puzzles as logical as possible

Some games have very illogical puzzles which make them near impossible to solve and very annoying to play. Having a door open by opening a can of coke is silly but opening a door by turning a key is not.

Spelling

Try and not make any spelling mistakes as it can make your game look sloppy and unprofessional.

Bugs

Bugs in a game can really be frustrating and can be mostly destroyed by good playtesting so get some people help you out in testing the game.

Graphics

Make a conscious decision about whether to have graphics in your adventure - graphics can use up a lot of memory and if you can't draw can look awful but good pictures can add to a game. If you can't draw try and get a friend who can do it for you.

Text

Try and make your text as verbose and atmospheric as possible, if you think of an adventure as 'interactive fiction' then you'll understand how important the text in your adventure is - if your game has no atmosphere then it won't grab player attention and make them want to play more.

Parser

Try and think of different words a player might use in different situations. For example in a good game, if you have a locked door, then there should be lots of different word combinations to open the door such as OPEN DOOR WITH KEY, TURN KEY IN DOOR, UNLOCK DOOR, UNLOCK DOOR WITH KEY etc.


GAC Programming Clinic

If you have any questions on the use of GAC, specific GAC related problems and queries or hints and tips of your own then jot them down and send them to the Balg's GAC Programming Clinic at the usual AA address. Dear Balrog,

I bear great tidings for all adventure fans! Within this missive is held the secret of loading GAC from the covertape - without using the menu program. This, unfortunately, applies only to those of us lucky enough to own disc drives. My handy hint will allow all budding adventure writers to produce a working disc containing nothing but the GAC code, (and all that empty space to be filled by their adventures).

The first step is to transfer the tape (Number 10) onto disc by following the instructions in the magazine. Make sure the disc with all the transferred software is in drive A, then type in the following little proggette:

|a

memory &7fff

load "menu.bin",&8000

poke &8100,&3e

poke &8101,1

poke &8102,0

save"gac",b,&8000,&7a5,&80ea

NB: Since there are no line numbers, each command is executed immediately RETURN is pressed.

Once you have typed that little lot in, you should find a new file on your disc, "GAC.BIN", 3K in length. This is a modified version of the "MENU.BIN" program.

Now, all you need to do is copy the files:

1.BIN

GAC.BIN and

QS.ADV

across to a new blank disc (using CP/M or your fave disc copier) and you're away!

Alternatively you can use it on the original disc, but it does not leave as much room free for adventures. You needn't copy QS.ADV across, but it is handy to have around when starting to program a new adventure. 1.BIN however is essential as it contains the main GAC program, whereas GAC.BIN is simply the loader.

To start up this new copy of GAC, simply type

RUN"GAC"

and before you know it, it's running!

By the way, if you change the last number 1 in the line 'poke &8101,1' to a 2 then save, (changing the name to 'Belle'), you get a file that can run the Southern Belle direct.

Austin Donnelly, Glasgow

GAC entry format

A lot of people have written asking for what they should send with the GAC games they write for the competition - so here they are - the full compo rules!

The game must be GACed (It is a GAC competition after all!)

It must be one part only (the covertape won't have room for a multi-part game but you can have a loading screen if you want)

You can send your game on a tape or disc (although I'd prefer the game on disc) but if you want your game back you must include a stamped self addressed envelope.

You must send a solution and map with your entry (I can't be expected to play hundreds of GAC games without any help!)

It would help if you sent any relevant instructions.

It would also help if you wrote why you feel your game is good- outline any clever puzzles, amusing responses or strong points.

Don't forget you can also mark your game as PD if you'd like Debby Howard of Adventure PD to stock the game if you're not the lucky winner.

Remember don't send your games yet - there's no rush!


GAC Programming Clinic

If you have any questions on the use of GAC, specific GAC related problems and queries or hints and tips of your own then jot them down and send them to the Balg's GAC Programming Clinic at the usual AA address.

Q: How do you swap one object for another?
John Reilly, Barnstaple
A: Use the SWAP command! The action 'x SWAP y' will exchange objects x and y. Thus you could write a routine for 'LIGHT LAMP' which swaps the objects 'a lamp' with 'a lit lamp'.

Q: How do you tell what you are carrying.
John Reilly, Barnstaple
A: Use the 'LIST WITH' command which lists all the objects you have with you.

Q: Does it matter if you send the adventure on tape or disc?
Brendan "Legolas" McGoldrick, Strabane
A: No! I'd prefer if you sent your entries for the GAC compo on disc but you can send them on tape if you really want. If you enclose a stamped self addressed envelope I will return your game when I have finished with it.

Q: Has QS.ADV to be loaded each time GAC is loaded?
D.S.Anthes. Dorset

A: Not necessarily - QS.ADV just makes your life easier by including a lot of adventure conditions which are used in every adventure but you don't need to load it if you don't want to!

Q: In you GAC tutorial the text clearly states that key is in room 8 but illustration show it in room 4 - which is right?

D.S.Anthes. Dorset

A: The text - there was a muck up in the map which showed the key in the wrong room.

Q: Is there any way to program character interaction? (For example, being able to speak to another person, with different reactions for different things said.)

Keith O'Conor, Dublin

A: Yes, but its not easy! You'd have to code a response to each word said which is very difficult considering the complexities of the English language! However you could code in specific phrases such as 'SAY HELLO' or 'SAY PASSWORD'.

Q: The adventure I'm writing is BIG, So big that I've had to make it two parts. My problem is that to access the second part I've written a BASIC password system. On the title screen you get a choice of going to part 1 or 2. Not a problem, however what I want to find out is if there's anyway that at the end of part one I can make it automatically load up my BASIC password system.

David Georgiades, Kent

A: Firstly, remember that the GAC compo entries must be only one parters - there isn't really room on the covertape for much more. Unless you know a lot about machine code it is impossible to get GAC to execute external routines such as a password checker. However at the end of part one you could give the player a password for part two and then tell the player to load it. You also don't have to write a password routine in BASIC - you could include it into your actual GAC game - just make the first location in part two a room with no exits with the description 'Please type password from part one:' and then write a condition which means when you type the correct password GAC uses the GOTO command to send you to the real first location.

Q: Does GAC allow characters which can move from location to location? If so how?

Brendan "Legolas" McGoldrick, Strabane

A: Ummm... It is possible but it is complicated! You'd have to write a routine which used the CONN command to determine which exits where available and then move the character (who would be stored as an object) using the x TO n command. Any reader want to

send in such a routine?

Q: In my adventure I have a twenty location maze with the same description in each location - is it possible to write a routine to print the description in each room rather than have to write out the same words twenty times? Rachel "Mad Cow" Smith, Chesterfield

A: Yes it is possible - just place the following in the high priority conditions:

HIGH 1 RESE n END

2 IF (ROOM > x) SET n END

3 IF (ROOM > y) RESE n END

4 IF (SET? n) MESS m WAIT END

Where n is a marker used to say wether you are in the maze or not, x is the first location of the maze and y is the last.


GAC Programming Clinic

If you have any questions on the use of GAC, specific GAC related problems and queries or hints and tips of your own then jot them down and send them to the Balg's GAC Programming Clinic at the usual AA address.

Q: How do you have two pictures of say a tunnel - one if the torch is lit and the other it it isn't? John Reilly, Barnstaple

A: Ummm.. Toughy. There are two ways to do this - the first is to have two identical rooms with different pictures (but this is very greedy on memory). The second is to use control codes as shown in AA58:-

Control codes can be incorporated into a games room or message descriptions. These control codes are listed in chapter 9 of the manual. Letter them starting at 1="A", to 26="Z" then 27="[", 28="\", 29="]", 30="^", 31="0" to make reference easier. Eg.

CTRL + Variable Note BASIC equivalent D n Change screen mode n=0-2 MODE n (GAC still uses 40 columns

though)

G Bell (Beep!) PRINT CHR$(7)

H Move cursor left 1 character PRINT CHR$(8) I Move cursor right 1 character PRINT CHR$(9) J Move cursor down 1 line PRINT CHR$(10)

K Move cursor up 1 line PRINT CHR$(11)

L CLS

N n n=Paper number 0-2 PAPER n

O n n=Pen number 0-3 PEN n

X Inverse video on/off

\ n xx n=Pen number INK n,x,x x=letter representing a colour (appendix B of GAC manual, two different X's mean a flashing colour.)

] xx Set border colour BORDER X,X

For example, 'CTRL-L, space, rest of message...' will clear the window (code 12) and print a message.You can also change colours with these, although I would suggest setting up a sequence to reset colours to normal in case of error - if this happens you won't be able to read the menu or anything else! You can do this by setting up a 'dummy' room with the following codes:-

\0AA INK 0,1 \AXX INK 1,24 N0 PAPER 0

OA PEN 1

]AA BORDER 1

Note: These are all typed with 'CTRL' pressed, except the zero which is typed on it's own. The codes should be continuous, I have separated them to show what each section does.You can now experiment with the codes, eg, at the beginning of a room description, you can change colours, make a beep, etc. If the colours go wrong, press ESC until the menu screen, press 'B' for beginning room, delete old start room, and type the number of the dummy room, 'ENTER', 'ENTER' to start game, and the colours will return back to normal.Thus you can change the colour of the picture of the tunnel - have very dark pictures for no light and normal pictures for a lit room.

Q: I want to be able to have a built-in map using an unused room to hold the picture, pressing M to show the map and another key to return to the adventure. Can this be done?

John Reilly, Barnstaple

A: Yes but it would be very wasteful on memory and complicated. You'd have to have a different picture for each stage of the map, with the M key using the GOTO command to send the player to that room and a RETURN command which would use the GOTO key to send you back to the location you came from. You could save on memory by merging pictures of the maps together but it would still use a lot of memory up.

Q: How do you have characters which wait to you to give them something or to do something for them.

Brendan "Legolas" McGoldrick, Strabane

A: Just write a routine for it! For example put in the low priority conditions the line 'GIVE MONEY', check to see if the character is present (by setting it up as an object and using the HERE command) and then print a message (ie 'Thanking you for the money the bus conductor runs away').

Q: In the text in the February tutorial, after message 3 (which is OK) local room condition, room 2 ok then asks "Which line number?", nothing seems to answer this and if a number given at random and "IF (VERB & SET? 3) GOTO 1, WAIT END" is typed in, the machine answers "Don't understand" and reprints it! Also shouldn't this condition be low priority?

D.S.Anthes. Dorse

tA: You should start at line number 1. The machine is responding "Don't understand" as the line you are typing in is not syntactically correct - it should be "IF (VERB 4 AND SET? 3) GOTO 1 WAIT END". This is a local condition as it only applies to one room - you don't want verb 4 to always send you to room 1 so you make sure it only applies in room 2.


84

GAC Programming Clinic

If you have any questions on the use of GAC, specific GAC related problems and queries or hints and tips of your own then jot them down and send them to the Balg's GAC Programming Clinic at the usual AA address. So, on with the questions!

Q: Is it possible to get rid of an object - i.e. a man will sell you a ring for some money so you lose the money.

Nick Hughes, Barnstaple

A: Yep! Just use the x TO n command where x is the object number and n is the room number (room 0 will destroy the object).

Q: On some lines of code you put the line WAIT - what does it mean and when do you have to use it?

Nick Hughes, Barnstaple

A: Whenever you press the carriage return in GAC it increments the turn counter (126 and 127) by one. However, some actions such as SAVE and INVENTORY shouldn't take a turn so the WAIT command is used - this stops the turn counter incrementing by one by WAITING for a new command.

Q: How do you score points?

Nick Hughes, Barnstaple

A: No problemo! Counter 0 is used to score points - thus you can use the INCR 0 and DECR 0 command to increase and decrease the score. So you could thus increase scores when a player completes a puzzle and decrease the score if a player does something wrong (However make sure that you don't allow the player to keep increasing his score by typing the same thing over and over again... ie. if you increase the players score when they open a door, make sure that if they type open door again their score doesn't go up again!)

Q: In my adventure, I want the text to be white and the page and border black. I have written a BASIC loader that changes the screen colours, but as soon as the adventure has loaded the colours return to the default yellow on blue.

David Georgiades, Kent

A: Simple! Use the control code method described last issue to change the colours in the first displayed message or draw an introductory graphic (such as a pretty 'Welcome to Game X' and change the background and foreground colours using the Ink command.

Q: How do you get a player to start off with something in his inventory. I have tried desperately to do this, but all in vain.

Keith O'Conor, Dublin

A: Not sure about this one as I haven't actually tested it out but I think you type 'with' when asked 'Starts in Room' in the objects sub-menu.


89

GAC Programming Clinic

Even though the entry date for the GAC competition is long gone the Balg would still like to continue the clinic - so, if you have any questions on the use of GAC, specific GAC related problems and queries or hints and tips of your own then jot them down and send them to the Balg's GAC Programming Clinic at the usual AA address.

Dear Balg,

I was reading through AA82 last night when I came to your hallowed pages (why only two?) and saw the plea for a GAC routine to move a character around. Here is mine; the character moves around at random.

The Dwarrow

Thanks Dwarrow! I'm sure some people will find it useful!

GAC Character moving routine

(The character to be moved will be referred to as *.) by the Dwarrow

HIGH:

1) CTR ( 4 ) = ROOM END
2) FIND * END
3) IF ( CONN ( 1 ) AND RAND ( 4 ) AND RES? ( 5 ) ) * TO n SET ( 5 ) END 4) IF ( CONN ( 2 ) AND RAND ( 4 ) AND RES? ( 5 ) ) * TO n SET ( 5 ) END 5) IF ( CONN ( 3 ) AND RAND ( 4 ) AND RES? ( 5 ) ) * TO n SET ( 5 ) END 6) IF ( CONN ( 4 ) AND RAND ( 4 ) AND RES? ( 5 ) ) * TO n SET ( 5 ) END (If you have more movement verbs (such as up and down), add similar lines on the end of this part, and change the RAND ( 4 ) bit to RAND ( x ) where x is the number of possible movement verbs).
7) GOTO CTR ( 4 ) RESE ( 5 ) END

(This routine only moves one character as it stands but it could very easily be expanded by repeating lines 2-6 before line 7, using a different object number instead of *).

The character movement can also be restricted by adding conditions into the local list:LOCAL (Room 17)

1) IF ( VERB 1 ) GOTO 7 END

--

90

http://members.aol.com/stuwhyte/Balrog/aa90.htm


GAC Programming Clinic

This month readers have sent hints on how to get the most out of GAC...

List numbers

by Ron Bray

Dear Balg,

I overcame one little difficulty in a way other users may find helpful. Unless you are extremely well organised, it can be a pain remembering the next number to use for your verbs, nouns and adverbs. I always have one of each called 'AA' carrying the highest number.

So, when I need a new verb, the screen displays all my verbs in alphabetical order with AA sitting at the top (naturally!) showing the next number. If it were, say, 47 and I needed a new verb, Twist, I can immediately delete 47, enter 47 Twist and 48 AA.

ADVINMAN.ADV

by C. H. Hetterington

Dear Balrog,

Does anyone else know about the ADVINMAN.ADV file that follows QS.ADV on the covertape? It is an amusing little adventure, and it is very helpful to be able to examine the GAC conditions used in it and see how they work.

Multi-part adventures

by Louise Downing

Balg,

Although it is not possible to link various parts of a game together so you can carry through objects, there is another way to make multi part adventures - simply at the end of the first part give the player a password for the second part and then at the start of part two, make the start location have the description 'Enter password from part 1...' (making sure you have no exits from this location). Then just create a condition so that when the password is typed the player is transported to part two proper. However you won't be able to take objects across from part one - you have to try and make part one end with the player carrying either no objects or a few objects which you can predict (so at the end of part one you could attack the player muggers who steal all his objects etc.)




hitch-hiker@earthling.net