Very Brief Micro Adventure Documentation
1/4/98
Anthony J. Wood
ajw@best.com

Building an Adventure
To create an adventure with "Micro Adventure Creator" you need three files:
•	A "room data" or /LOC file defines each room in the adventure.  It's description, obvious exits, and inventory items.  These files are created using "Electric Pencil".
•	An "Adventure Flow" or /ADV file.  This file contains the code in the Micro Adventure language that defines the logic of the game.  These files are created using "Electric Pencil".
•	A "title page" or /TIT file defines a title screen for the adventure. These files are created using "ADVDRAW/BAS".

Once you have created the three files that define your adventure, you run "MICROADV/BAS" to "compile" the adventure.  

1.	Boot with NewDos/80
2.	BASIC
3.	Load "microadv/bas"
4.	RUN
5.	Answer the first three questions, which tell it the location of the /LOC, /ADV, /TIT files.  
6.	Answer either "Y" or "N" to question: Display Tables?
7.	Select option "3. Disk/Tape" when asked what kind of runtime to create.
8.	MicroAdv the loads each file, parses them, and tokenizes them.
9.	If you displayed the tables, look at them, and then answer "Y" to the question "Save to Memory?".
10.	MicroAdv asks if you want any items to be initialized into the player's inventory.  These can be any NOUN.
11.	MicroAdv now Pokes the tokenized adventure into high memory, and displays two sets of address.  The larger numbers define where the adventure now resides.  The smaller numbers display where the adventure needs to load into memory to run.

Next, you can either run the adventure or  create a disk file that includes the machine code runtime code and the tokenized adventure.  Here are the steps:
1.	CMD "S" to return to DOS from BASIC.
2.	Type "MOVE" to run MOVE/CMD.  This small program moves the tokenized adventure from its high memory location to its correct location for running.  At this point, you could run your adventure by just running the runtime code: DSKTAP/CMD.  This code will load just in front of the tokenized adventure, and will execute it.
3.	"DUMP filename/obj <start addr> <end addr>" will saved the tokenized adventure into a file.  You get the starting and ending address from MicroAdv (the smaller range displayed when it finishes).
4.	Now you need to merge the runtime with the tokenized adventure into a single executable.  This is done using "CMDFILE", a program that came with ZBASIC.  When running CMDFILE, load two files off of disk:  "dsktap/cmd" and "filename/obj".  Use 5200H as the starting address.  Save it to disk with any filename/CMD.  You can download CMDFILE off of the Net.
5.	You're done!  Run the adventure by typing filename/CMD.

Initial Inventory Items
Initial inventory items are not contained in any of the three files that define the game, and must be entered at compile time.  Here are the initial settings for the three games I wrote:

Initial Inventory Items for GERMANY:
Colt 45, Rations, Uniform.

Initial Inventory Items for ASTEROID:
NONE

Initial Inventory Items for TIME:
Sword, Torch

LOC files
Here's a sample entry:
in a clearing in an old forest.
1,PARACHUTE,255,2,1,255,255,255

The first line is the description of the room.  The second line is: Number of items in this room, Items, room to the N, S, E, W, U, D.
Room numbers start with 0.  255 means no exit in that direction. The file ends with a ".END".

ADV files
Take a look at the Germany, Time, and Asteroid examples.  It is straight forward, but here's some explanation to get you going.

The adventure execution follows these steps:
•	Wait for user input.  This is then parsed into a VERB and a NOUN.
•	Scan through the /ADV code looking for a verb block that matches this verb.
•	Inside the VB block can be NOUN blocks that only execute if the current NOUN matches one of the nouns inside the list.
•	The language includes commands for checking the users inventory, adding or removing items to rooms and inventory, simple variable support, etc.
•	There is also support for a code fragment that executes once after each user input.  This allows "background" actions, such as the sun rising or setting.

Take a look at this code fragment:

VB:HIDE,COVE
*BURY
NCHK
?RM#2
N:TY:I see nowhere to hide it.
N:RET
NOUN:PARACHUTE
DEL:NOUN
INC HIDEP
TY:I cover it with leaves.
RET

"VB" means execute this code fragment if the verb matches one in this list.  Otherwise, go to the next "VB" block.
"*BURY" is a label named "BURY" that can be jumped to with the "JP" command.  For example:

?RM#2
Y:JP BURY

Compares the current room number to 2.  If it is #2, then jump to BURY.

NCHK checks to see if the users inventory contains the current noun.  If not, the user will get an error message, and the cycle restarts.
?RM compares the current room number.
N: or Y: can proceed any statement.  The statement won't be executed unless the result of the last comparison matches.
TY: types some text.
RET ends the current block and restarts the cycle (which starts by waiting for user input).
DEL removes an item from the inventory.  DEL: NOUN removes the current noun from inventory.
INC increments a variable or "flag".

There are many more statements, check out the example /ADV files on the AdvSrc.dsk.