★ APPLICATIONS ★ GRAPHICS ADVENTURE CREATOR: PROGRAMMING TUTORIAL 1 ★ |
Gac - Programming Tutorial Part 1 (Amstrad Action) |
This month the Balrog continues adding to our bank adventure, started last issue, as well as telling you more ahout how to work GAC... 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! First, let's add the extra locations: Room 3 'You are outside the bank. Exits are north and west.'
Room 4'You are on the the High Street. There is an exit to the east and you can go down to the sewers.'
and amend the old locations .
Now let's add a maze - let's make it a sewer complex beneath the High Street... Room 5'You are in a dank sewer You can see daylight above.'
So 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 tf you changed all the location descriptions to be the same!). Now, we still want to add the following:
As to putting the key in room 8. follow the same approach as the bar of gold from last issue, i.e.: Nouns Objects Messages Low Priority: 11: IF (VERB 7 AND NOUN 2 AND HERE 2) GET 2 OKAY END 12: IF (VERB 8 AND NOUN 2 AND CARR 2) DROP 2 OKAY END 13: IF (VERB 16 AND NOUN 2 AND AVAI2) MESS 2 END Adding 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 END If you typed 'West' and marker/flag three is set (i.e. 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 add: IF (VERB 18 AND NOUN 3 AND CARR 2) SET 3 WAIT END Which 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 3 And we should be ready to rock and roll I 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 datable 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 tilings as you go along, but don't press ESCAPE before you get to the "Which room/object/line number...?" or 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 (i.e. no spaces). This can be done by 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 0 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 computer's 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 (i.e. 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 (e.g. 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 (very useful for debugging the adventure). What next? That is up to you! Next month I'll continue the tutorial, but I would prefer to answer readers'questions. If anyone has any queries concerning GAC thamstrad en write to: GAC Programming Clinic, Amstrad Action, Boauford Court. |