     ****      *****	 ******	       ADVENTURE BANK CREATOR  
    *    *     *   *     *             ======================
    ******     ****      *            For AMOS Written On AMOS
    *    *     *   *     *             ======================
    *	 *  *  *****  *  ******           By Chris Beeson

       It's As Easy As A.B.C.

                      	- THE PROGRAMMING MANUAL -


                          	Introduction
                                ------------

This Document will explain to you how to use the A.B.C banks in AMOS,
it will cover :
                Loading the banks
                Setting up the screen display
                Using the menu system in your own programs
                Getting Messages to be displayed
                Loading samples
                Using Sprites and bobs
                Adding that finishing touch to your work.

Even though I will explain each part as simply as possible, some parts 
are tricky and may confuse some readers.  Your best bet in NOT to read 
this document but to get out there and play around with the code, get 
use to it!  You can change it if you like but make sure you are working 
on a COPY of the editor.

The document is basically about the procedures in the File 'Procedures.AMOS'
(Load AMOS to View and edit them) 

THIS DOCUMENT IS NOT DESIGNED FOR USERS WHO HAVE LITTLE KNOWLEDGE OF
AMOS.


			Loading up the Banks
			--------------------

Loading the Banks (Or groups) couldn't be much easier.  The procedure
is already written.

Getting it in to you program.

    1. Copy The _Load[File$] Procedure from Procedures.AMOS. (This can
       be done by using the Copy and paste command from within AMOS)

    2. Paste the Procedure into a your Program.

Before you can run this procedure you need to copy another part from 
Procedures.AMOS.  Copy The dim statement and all the Global statements
in to your Program and put them at the beginning.

You may find that you need to place a 'Set Buffer' command at the top
of the program listing.  Set it to about 60.

The Procedure
-------------

_LOAD[FILE$]

FILE$ is the name of the Bank(Group) that you want to load.
If it is not a correct A.B.C bank you will get weird results.

It will load all the information into the variables.


Overview of Variables
---------------------

If you come across this :
                          Y=1 : X cord

It simply means when Y=1 the variable contains the X cord.


ITEMS(A)            'Contains the number of items in the room A 
  
PIC(A)              'Contains the picture bank number for room A

MUS$(A,X)           'Contains the name of the music(X=1), Tempo(X=2)
                     for room A

D$(A,X)             'Contains the room number to jump to.  A=Current room
                     X=1 : North, X=2 : South, X=3 : East, X=4 : West.

DAT$(A,X,Y)         'Contains all the information in Room A, for Item X,
                     Read on for Y.

BB(A,X,Y)           'Contains the Bob position in room A, X = Item number, 
                     Y=0 : Bob Image, Y=1 : Y Cord, Y=2 : X Cord

ZN(A,X,Y)           'Contains the zone position in Room A, X = Item
                     number,Y=1 : X1 cord, Y=2 : Y1 Cord, Y=3 : X2 Cord,
                     Y=4 :Y2 Cord. 

MEN$(X,Y)           'Contains the menu Info, X = The Option number,
                     Y=1 : X cord, Y=2 : Y cord, Y=3 : Text


Variable may change or new ones may be added in latter versions.
See the source code and have a nose through it! 

The DAT$(A,X,Y) Variable
------------------------

This variable contains all the main information.

A is the current room number.

X is the Item number you want to Examine or get etc.

Depending on the value of Y it will return a message.

          Y		COMMAND
         ---            -------

	  1		Give
	  2		Get
	  3 		Open
	  4		Close
	  5		Use
	  6		Examine
	  7		The name of the area



             		Setting up the Screen display
                        -----------------------------

Again there is procedure to do all the work for you.

              SETUP[RM]

RM is the current room.

Call this procedure every time you enter a new room, it will play any
music, load the picture, place all the bobs and define all the zones.

That's it, what else can I say?



        		Using the Menu System
                        ---------------------

The Menu System is the main part of any game, I have selected this type
of system because of it's looks and because it's much easier to program.

All the commands for the menu system are in a procedure called :
        
               _MENUSET

This procedure sets up all the information, and displays all the
commands.  Run this Procedure BEFORE you start the main menu loop.
      
               HILIGHT
               MESSAGE
               ZON
               CHECK

Are all required when you need to use the menu system.

HILIGHT will hi-light the current command the mouse is over.

MESSAGE will display the command in the MESSAGE BAR if the mouse button
has been clicked over a hi-lighted command

ZON Will display the name of the AREA the mouse is over.  It will only
be displayed if a message is already present.
Remember: AREA is a zone in the graphics window.  So it could be a door
	  for example.

CHECK will then branch off according to the selected command.
So if the command was GET it could run a procedure called GETIT.

Once you have all these procedures in your program you can write the
main menu loop (There is one in the Procedures.AMOS file.)

It could look something like this :

Do
   Screen 2
   MZ=Mouse Zone : MK=Mouse Key
   If MZ>0 Then HILIGHT
   If MZ>0 and MK=1 then MESSAGE
   If (MZ1>0) and (MES$<>"") and (MK=1) Then CHECK
   Screen 1
   MZ1=Mouse Zone 
   If MZ1>0 and (MES$<>"") then ZON
   If OLD3>0 and MZ1=0 then MESSAGE : OLD3=0
Loop

How it works
------------

     1. Sets the current screen to screen 2

     2. Finds if the Mouse is over a mouse zone, and the state of the
        mouse key(i.e. Pressed or not)

     3. If the mouse is over a mouse zone then hi-light the command.

     4. If the mouse is over a mouse zone and the mouse button is
        being pressed display it in the message bar.

     5. If something is already being display and the mouse is over a
        mouse zone and being pressed, goto the check procedure.

     6. Set the current screen to screen 1
  
     7. See if the mouse is over a mouse zone in screen 1

     8. If the mouse is over a zone and a command is displayed in the
        MESSAGE BAR then add the name of the Area to the MESSAGE.

     9. If the mouse isn't over a zone, but it was, wipe the name off
        the message.


Remember : Screen 1  -  The Graphics screen.  Sprites, bobs etc.

           Screen 2  -  The Menu Screen.

           Screen 3  -  Keep hidden.  For The setup of messages.



               		Displaying Speech Messages
                        --------------------------


Q. What on Earth are Speech Messages ? 

A. They are Messages which are displayed if you E.g. Try to open something
   which can't.  Messages which are displayed in screen 1, they have nothing 
   to do with the menu system. 

There is a Procedure that will display these types of messages, it is
called :
 
            DISPLAY_TEXT[MESSAGE$,SPD]

MESSAGE$ is the message you want to type.

SPD is the speed of the message.  

The current formula is
  
        Wait  SPD+Len(MESSAGE$)


This procedure opens a screen(3), always keep the screen at the very 
back of the display. 

Loading Samples
---------------

Samples are a bit of a problem because A.B.C groups use every bank.
Samples can be held in most banks(1-15), but what ever you do, DO NOT
LOAD A SAMPLE BANK because it will wipe over  the bank that was there
before which could cause problems.

What you could do is load the Sample bank into bank 2 once you have
called the procedure _LOAD[FILE$].  This is possible because once you
have loaded the groups and copied the information in to the variables
the program won't need to load from that bank again, until you go on to
a new group.
  

              
Using Bobs and Sprites
----------------------

The main character may be the most important of any graphic adventure.
Though it can be EXTREMELY hard to program.  You have to think about objects
which you walk past, are they infront or behind the character or both?

Can you examine them?  If you can you need to zones around the bob.

How are you going to get the zone to follow the bob?

How are they going to be animated?  What about memory? Disk Space?

I could never explain to you how to go about doing all of this, your
best bet is to just have a play!

In the near future I may think about writing an editor which would
allow you to plan the bob paths and set the priority of objects etc.
Drop us a line if you have any brilliant ideas.                           
              

Adding that finishing touch.
---------------------------

The finishing touch for you maybe to add an opening animation sequence,
or puting animation sequences in the middle of the game.  Spliting the game
up into 'chapters' is also a good Idea.  I can't say what the best finishing touch is, it's completely
up to you.  Let you mind go wild....

Have Fun.

