Home » Archimedes archive » Acorn User » AU 1998-08.adf » Freeware » PD/IntFiction/DavidRPG2/!DavidRPG2/Docs/Language

PD/IntFiction/DavidRPG2/!DavidRPG2/Docs/Language

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1998-08.adf » Freeware
Filename: PD/IntFiction/DavidRPG2/!DavidRPG2/Docs/Language
Read OK:
File size: 15B8 bytes
Load address: 0000
Exec address: 0000
File contents
Full syntax of DavidRPG2
========================

These are my notes on the file structure for DavidRPG2, they 
are not that concise, so a look at the example files will help.

Every command and label is case-sensitive.
All labels must be unique

Infomation
----------
The following lines must be presant they describe the game. 

examples:

name=Game1
adventure=To defeat the Carter
author=David Spence, 1996
version=0.01 (19 Feb 1996)

Comments
--------
Comments are lines starting with | the rest of the line is ignored.

Variables
---------
All variables need to be declared and are all global. They can be declared at
any point in the file: 

variable <name> = <Integer>

They are used through the functions described later (see commands).

Rooms
-----
All rooms are declared using a room declaration:
There is a room 'null' which means no room for instance in move().

room <label> [start] {
name:    "<name>"
text:    "<name>"                 \ can be up to 20 lines of text. Each line
                                  \ starts on a newline.
east:    <command>                \ east:, west:, north:, southeast, etc.
                                  \ (see commands for <command>), all
                                  \ optional. 
enter:   <command>                \ optional
leave:   <command>                \ optional
objects: <label1>,[<label2>,...]  \ optional
people:  <label1>,[<label2>,...]  \ optional
actions: {                        \ optional block of verbs which are to be
 <verbs>:  <command>              \  reported to the room
}
}

The start tag must be preasant in one and only one room definition. It is 
where he game will commence.

Objects
-------
All objects are declared using a object declaraton.

object <label> {
name:    "<name>"
text:    "<name>"                \ see room.
move:    yes|no                  \ can it be picked up
energy:  <int>                   \ initial energy value for object if
                                 \ passes 0 the dead: routine is called.
                                 \ If -1 then the object cannot be destroyed.
dead:    <command>
canbe:   {                       \ Optional. If the verb is done to this 
 <verbs>:  <command>             \ object the commands are executed.
}
cando:   {                       \ Optional. If the verb is done using this 
 <verbs>:  <command>             \ object the commands are executed.
}
}

Note the cando: is also used if the object is the only object which can do 
<verb> when a statement like <verb> <object> is issued (eg hit brick)

People
------
All people are declared using a person declaraton.

person <label> {
name:    "<name>"
text:    "<name>"                 \ see room.
energy:  <int>                    \ see object
dead:    <command>
objects: <label1>,[<label2>,...]  \ optional
see:     <commands>               \ optional executed when the player sees
                                  \ the person
unsee:   <commands>               \ optional executed when the player stops 
                                  \ seeing the person
canbe:   {                        \ see object
 <verbs>:  <command>
}
talk:    {                        \ Optional. Keywords which the person 
 <keywords>: <command>            \ reacts to.
}
}


Player
------
The player is declared using the player declaraton.

player {
name:    "<name>"
text:    "<name>"                 \ see room.
energy:  <int>                    \ see object
dead:    <command>
objects: <label1>,[<label2>,...]  \ optional
canbe:   {                        \ see object
<verbs>:  <command>
}
cando:   {                        \ see object
<verbs>:  <command>
}
}


Commands
--------
Commnands are the most important part of the language.

If more than one command is needed after the : put a { and all the commands 
will be executed until the corrisonding } if not then the command is ended by
a new line.

'c_room' can be used for the current room in <room>s. 

print("<string>")       - prints a string (no new line use "\n")
print(<variable label>) - prints a number (no new line see above)

NOTE:
The line is printed even if there has been no '\n' when the outest most block
of code is exited

goto(<label>)           - goes to new room

give(<person>,<object>) - gives an object to the person or player
                        - does not check move.

P_move(<person>,<room>) - moves a person to a room. The player cannot be
                        - moved in this way

O_move(<object>,<room>) - moves a object to a room 
                        - does not check move.

end() - ends the game

change(<variable>,<int>)- changes <variable> by <int>

set(<variable>,<int>)   - set <variable> to <int>

if(<variable> <op> <value>): <commands> - conditional execution
                                        - value is string

Where <op> is
      =  : equals
      <> : Not equal
      <  : Less than
      >  : Greater than                 

Actions
-------
For a full definition of how the actions:/canbe:/cando: tags interact see the
tutorial file.

Variables
---------
As well as the user variables there are the following variables:
c_room : the current room NAME
ob_got : use '= "NAME"' or '<> "NAME"' to check if the user has or hasnot NAME
energy : the energy of the object or person the code is in
pl_eng : the players energy

Player
------
Note: the label 'player' can be used to denote the player in all places
which need a person except in a room{ person: } label

Verbs/Keywords
--------------
These are lists of words which may be matched seperated by spaces.
00000000  46 75 6c 6c 20 73 79 6e  74 61 78 20 6f 66 20 44  |Full syntax of D|
00000010  61 76 69 64 52 50 47 32  0a 3d 3d 3d 3d 3d 3d 3d  |avidRPG2.=======|
00000020  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
00000030  3d 0a 0a 54 68 65 73 65  20 61 72 65 20 6d 79 20  |=..These are my |
00000040  6e 6f 74 65 73 20 6f 6e  20 74 68 65 20 66 69 6c  |notes on the fil|
00000050  65 20 73 74 72 75 63 74  75 72 65 20 66 6f 72 20  |e structure for |
00000060  44 61 76 69 64 52 50 47  32 2c 20 74 68 65 79 20  |DavidRPG2, they |
00000070  0a 61 72 65 20 6e 6f 74  20 74 68 61 74 20 63 6f  |.are not that co|
00000080  6e 63 69 73 65 2c 20 73  6f 20 61 20 6c 6f 6f 6b  |ncise, so a look|
00000090  20 61 74 20 74 68 65 20  65 78 61 6d 70 6c 65 20  | at the example |
000000a0  66 69 6c 65 73 20 77 69  6c 6c 20 68 65 6c 70 2e  |files will help.|
000000b0  0a 0a 45 76 65 72 79 20  63 6f 6d 6d 61 6e 64 20  |..Every command |
000000c0  61 6e 64 20 6c 61 62 65  6c 20 69 73 20 63 61 73  |and label is cas|
000000d0  65 2d 73 65 6e 73 69 74  69 76 65 2e 0a 41 6c 6c  |e-sensitive..All|
000000e0  20 6c 61 62 65 6c 73 20  6d 75 73 74 20 62 65 20  | labels must be |
000000f0  75 6e 69 71 75 65 0a 0a  49 6e 66 6f 6d 61 74 69  |unique..Infomati|
00000100  6f 6e 0a 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 0a 54 68  |on.----------.Th|
00000110  65 20 66 6f 6c 6c 6f 77  69 6e 67 20 6c 69 6e 65  |e following line|
00000120  73 20 6d 75 73 74 20 62  65 20 70 72 65 73 61 6e  |s must be presan|
00000130  74 20 74 68 65 79 20 64  65 73 63 72 69 62 65 20  |t they describe |
00000140  74 68 65 20 67 61 6d 65  2e 20 0a 0a 65 78 61 6d  |the game. ..exam|
00000150  70 6c 65 73 3a 0a 0a 6e  61 6d 65 3d 47 61 6d 65  |ples:..name=Game|
00000160  31 0a 61 64 76 65 6e 74  75 72 65 3d 54 6f 20 64  |1.adventure=To d|
00000170  65 66 65 61 74 20 74 68  65 20 43 61 72 74 65 72  |efeat the Carter|
00000180  0a 61 75 74 68 6f 72 3d  44 61 76 69 64 20 53 70  |.author=David Sp|
00000190  65 6e 63 65 2c 20 31 39  39 36 0a 76 65 72 73 69  |ence, 1996.versi|
000001a0  6f 6e 3d 30 2e 30 31 20  28 31 39 20 46 65 62 20  |on=0.01 (19 Feb |
000001b0  31 39 39 36 29 0a 0a 43  6f 6d 6d 65 6e 74 73 0a  |1996)..Comments.|
000001c0  2d 2d 2d 2d 2d 2d 2d 2d  0a 43 6f 6d 6d 65 6e 74  |--------.Comment|
000001d0  73 20 61 72 65 20 6c 69  6e 65 73 20 73 74 61 72  |s are lines star|
000001e0  74 69 6e 67 20 77 69 74  68 20 7c 20 74 68 65 20  |ting with | the |
000001f0  72 65 73 74 20 6f 66 20  74 68 65 20 6c 69 6e 65  |rest of the line|
00000200  20 69 73 20 69 67 6e 6f  72 65 64 2e 0a 0a 56 61  | is ignored...Va|
00000210  72 69 61 62 6c 65 73 0a  2d 2d 2d 2d 2d 2d 2d 2d  |riables.--------|
00000220  2d 0a 41 6c 6c 20 76 61  72 69 61 62 6c 65 73 20  |-.All variables |
00000230  6e 65 65 64 20 74 6f 20  62 65 20 64 65 63 6c 61  |need to be decla|
00000240  72 65 64 20 61 6e 64 20  61 72 65 20 61 6c 6c 20  |red and are all |
00000250  67 6c 6f 62 61 6c 2e 20  54 68 65 79 20 63 61 6e  |global. They can|
00000260  20 62 65 20 64 65 63 6c  61 72 65 64 20 61 74 0a  | be declared at.|
00000270  61 6e 79 20 70 6f 69 6e  74 20 69 6e 20 74 68 65  |any point in the|
00000280  20 66 69 6c 65 3a 20 0a  0a 76 61 72 69 61 62 6c  | file: ..variabl|
00000290  65 20 3c 6e 61 6d 65 3e  20 3d 20 3c 49 6e 74 65  |e <name> = <Inte|
000002a0  67 65 72 3e 0a 0a 54 68  65 79 20 61 72 65 20 75  |ger>..They are u|
000002b0  73 65 64 20 74 68 72 6f  75 67 68 20 74 68 65 20  |sed through the |
000002c0  66 75 6e 63 74 69 6f 6e  73 20 64 65 73 63 72 69  |functions descri|
000002d0  62 65 64 20 6c 61 74 65  72 20 28 73 65 65 20 63  |bed later (see c|
000002e0  6f 6d 6d 61 6e 64 73 29  2e 0a 0a 52 6f 6f 6d 73  |ommands)...Rooms|
000002f0  0a 2d 2d 2d 2d 2d 0a 41  6c 6c 20 72 6f 6f 6d 73  |.-----.All rooms|
00000300  20 61 72 65 20 64 65 63  6c 61 72 65 64 20 75 73  | are declared us|
00000310  69 6e 67 20 61 20 72 6f  6f 6d 20 64 65 63 6c 61  |ing a room decla|
00000320  72 61 74 69 6f 6e 3a 0a  54 68 65 72 65 20 69 73  |ration:.There is|
00000330  20 61 20 72 6f 6f 6d 20  27 6e 75 6c 6c 27 20 77  | a room 'null' w|
00000340  68 69 63 68 20 6d 65 61  6e 73 20 6e 6f 20 72 6f  |hich means no ro|
00000350  6f 6d 20 66 6f 72 20 69  6e 73 74 61 6e 63 65 20  |om for instance |
00000360  69 6e 20 6d 6f 76 65 28  29 2e 0a 0a 72 6f 6f 6d  |in move()...room|
00000370  20 3c 6c 61 62 65 6c 3e  20 5b 73 74 61 72 74 5d  | <label> [start]|
00000380  20 7b 0a 6e 61 6d 65 3a  20 20 20 20 22 3c 6e 61  | {.name:    "<na|
00000390  6d 65 3e 22 0a 74 65 78  74 3a 20 20 20 20 22 3c  |me>".text:    "<|
000003a0  6e 61 6d 65 3e 22 20 20  20 20 20 20 20 20 20 20  |name>"          |
000003b0  20 20 20 20 20 20 20 5c  20 63 61 6e 20 62 65 20  |       \ can be |
000003c0  75 70 20 74 6f 20 32 30  20 6c 69 6e 65 73 20 6f  |up to 20 lines o|
000003d0  66 20 74 65 78 74 2e 20  45 61 63 68 20 6c 69 6e  |f text. Each lin|
000003e0  65 0a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |e.              |
000003f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000400  20 20 20 20 5c 20 73 74  61 72 74 73 20 6f 6e 20  |    \ starts on |
00000410  61 20 6e 65 77 6c 69 6e  65 2e 0a 65 61 73 74 3a  |a newline..east:|
00000420  20 20 20 20 3c 63 6f 6d  6d 61 6e 64 3e 20 20 20  |    <command>   |
00000430  20 20 20 20 20 20 20 20  20 20 20 20 20 5c 20 65  |             \ e|
00000440  61 73 74 3a 2c 20 77 65  73 74 3a 2c 20 6e 6f 72  |ast:, west:, nor|
00000450  74 68 3a 2c 20 73 6f 75  74 68 65 61 73 74 2c 20  |th:, southeast, |
00000460  65 74 63 2e 0a 20 20 20  20 20 20 20 20 20 20 20  |etc..           |
00000470  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000480  20 20 20 20 20 20 20 5c  20 28 73 65 65 20 63 6f  |       \ (see co|
00000490  6d 6d 61 6e 64 73 20 66  6f 72 20 3c 63 6f 6d 6d  |mmands for <comm|
000004a0  61 6e 64 3e 29 2c 20 61  6c 6c 0a 20 20 20 20 20  |and>), all.     |
000004b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000004c0  20 20 20 20 20 20 20 20  20 20 20 20 20 5c 20 6f  |             \ o|
000004d0  70 74 69 6f 6e 61 6c 2e  20 0a 65 6e 74 65 72 3a  |ptional. .enter:|
000004e0  20 20 20 3c 63 6f 6d 6d  61 6e 64 3e 20 20 20 20  |   <command>    |
000004f0  20 20 20 20 20 20 20 20  20 20 20 20 5c 20 6f 70  |            \ op|
00000500  74 69 6f 6e 61 6c 0a 6c  65 61 76 65 3a 20 20 20  |tional.leave:   |
00000510  3c 63 6f 6d 6d 61 6e 64  3e 20 20 20 20 20 20 20  |<command>       |
00000520  20 20 20 20 20 20 20 20  20 5c 20 6f 70 74 69 6f  |         \ optio|
00000530  6e 61 6c 0a 6f 62 6a 65  63 74 73 3a 20 3c 6c 61  |nal.objects: <la|
00000540  62 65 6c 31 3e 2c 5b 3c  6c 61 62 65 6c 32 3e 2c  |bel1>,[<label2>,|
00000550  2e 2e 2e 5d 20 20 5c 20  6f 70 74 69 6f 6e 61 6c  |...]  \ optional|
00000560  0a 70 65 6f 70 6c 65 3a  20 20 3c 6c 61 62 65 6c  |.people:  <label|
00000570  31 3e 2c 5b 3c 6c 61 62  65 6c 32 3e 2c 2e 2e 2e  |1>,[<label2>,...|
00000580  5d 20 20 5c 20 6f 70 74  69 6f 6e 61 6c 0a 61 63  |]  \ optional.ac|
00000590  74 69 6f 6e 73 3a 20 7b  20 20 20 20 20 20 20 20  |tions: {        |
000005a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000005b0  5c 20 6f 70 74 69 6f 6e  61 6c 20 62 6c 6f 63 6b  |\ optional block|
000005c0  20 6f 66 20 76 65 72 62  73 20 77 68 69 63 68 20  | of verbs which |
000005d0  61 72 65 20 74 6f 20 62  65 0a 20 3c 76 65 72 62  |are to be. <verb|
000005e0  73 3e 3a 20 20 3c 63 6f  6d 6d 61 6e 64 3e 20 20  |s>:  <command>  |
000005f0  20 20 20 20 20 20 20 20  20 20 20 20 5c 20 20 72  |            \  r|
00000600  65 70 6f 72 74 65 64 20  74 6f 20 74 68 65 20 72  |eported to the r|
00000610  6f 6f 6d 0a 7d 0a 7d 0a  0a 54 68 65 20 73 74 61  |oom.}.}..The sta|
00000620  72 74 20 74 61 67 20 6d  75 73 74 20 62 65 20 70  |rt tag must be p|
00000630  72 65 61 73 61 6e 74 20  69 6e 20 6f 6e 65 20 61  |reasant in one a|
00000640  6e 64 20 6f 6e 6c 79 20  6f 6e 65 20 72 6f 6f 6d  |nd only one room|
00000650  20 64 65 66 69 6e 69 74  69 6f 6e 2e 20 49 74 20  | definition. It |
00000660  69 73 20 0a 77 68 65 72  65 20 68 65 20 67 61 6d  |is .where he gam|
00000670  65 20 77 69 6c 6c 20 63  6f 6d 6d 65 6e 63 65 2e  |e will commence.|
00000680  0a 0a 4f 62 6a 65 63 74  73 0a 2d 2d 2d 2d 2d 2d  |..Objects.------|
00000690  2d 0a 41 6c 6c 20 6f 62  6a 65 63 74 73 20 61 72  |-.All objects ar|
000006a0  65 20 64 65 63 6c 61 72  65 64 20 75 73 69 6e 67  |e declared using|
000006b0  20 61 20 6f 62 6a 65 63  74 20 64 65 63 6c 61 72  | a object declar|
000006c0  61 74 6f 6e 2e 0a 0a 6f  62 6a 65 63 74 20 3c 6c  |aton...object <l|
000006d0  61 62 65 6c 3e 20 7b 0a  6e 61 6d 65 3a 20 20 20  |abel> {.name:   |
000006e0  20 22 3c 6e 61 6d 65 3e  22 0a 74 65 78 74 3a 20  | "<name>".text: |
000006f0  20 20 20 22 3c 6e 61 6d  65 3e 22 20 20 20 20 20  |   "<name>"     |
00000700  20 20 20 20 20 20 20 20  20 20 20 5c 20 73 65 65  |           \ see|
00000710  20 72 6f 6f 6d 2e 0a 6d  6f 76 65 3a 20 20 20 20  | room..move:    |
00000720  79 65 73 7c 6e 6f 20 20  20 20 20 20 20 20 20 20  |yes|no          |
00000730  20 20 20 20 20 20 20 20  5c 20 63 61 6e 20 69 74  |        \ can it|
00000740  20 62 65 20 70 69 63 6b  65 64 20 75 70 0a 65 6e  | be picked up.en|
00000750  65 72 67 79 3a 20 20 3c  69 6e 74 3e 20 20 20 20  |ergy:  <int>    |
00000760  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 5c  |               \|
00000770  20 69 6e 69 74 69 61 6c  20 65 6e 65 72 67 79 20  | initial energy |
00000780  76 61 6c 75 65 20 66 6f  72 20 6f 62 6a 65 63 74  |value for object|
00000790  20 69 66 0a 20 20 20 20  20 20 20 20 20 20 20 20  | if.            |
000007a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000007b0  20 20 20 20 20 5c 20 70  61 73 73 65 73 20 30 20  |     \ passes 0 |
000007c0  74 68 65 20 64 65 61 64  3a 20 72 6f 75 74 69 6e  |the dead: routin|
000007d0  65 20 69 73 20 63 61 6c  6c 65 64 2e 0a 20 20 20  |e is called..   |
000007e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000007f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 5c 20  |              \ |
00000800  49 66 20 2d 31 20 74 68  65 6e 20 74 68 65 20 6f  |If -1 then the o|
00000810  62 6a 65 63 74 20 63 61  6e 6e 6f 74 20 62 65 20  |bject cannot be |
00000820  64 65 73 74 72 6f 79 65  64 2e 0a 64 65 61 64 3a  |destroyed..dead:|
00000830  20 20 20 20 3c 63 6f 6d  6d 61 6e 64 3e 0a 63 61  |    <command>.ca|
00000840  6e 62 65 3a 20 20 20 7b  20 20 20 20 20 20 20 20  |nbe:   {        |
00000850  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 5c  |               \|
00000860  20 4f 70 74 69 6f 6e 61  6c 2e 20 49 66 20 74 68  | Optional. If th|
00000870  65 20 76 65 72 62 20 69  73 20 64 6f 6e 65 20 74  |e verb is done t|
00000880  6f 20 74 68 69 73 20 0a  20 3c 76 65 72 62 73 3e  |o this . <verbs>|
00000890  3a 20 20 3c 63 6f 6d 6d  61 6e 64 3e 20 20 20 20  |:  <command>    |
000008a0  20 20 20 20 20 20 20 20  20 5c 20 6f 62 6a 65 63  |         \ objec|
000008b0  74 20 74 68 65 20 63 6f  6d 6d 61 6e 64 73 20 61  |t the commands a|
000008c0  72 65 20 65 78 65 63 75  74 65 64 2e 0a 7d 0a 63  |re executed..}.c|
000008d0  61 6e 64 6f 3a 20 20 20  7b 20 20 20 20 20 20 20  |ando:   {       |
000008e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000008f0  5c 20 4f 70 74 69 6f 6e  61 6c 2e 20 49 66 20 74  |\ Optional. If t|
00000900  68 65 20 76 65 72 62 20  69 73 20 64 6f 6e 65 20  |he verb is done |
00000910  75 73 69 6e 67 20 74 68  69 73 20 0a 20 3c 76 65  |using this . <ve|
00000920  72 62 73 3e 3a 20 20 3c  63 6f 6d 6d 61 6e 64 3e  |rbs>:  <command>|
00000930  20 20 20 20 20 20 20 20  20 20 20 20 20 5c 20 6f  |             \ o|
00000940  62 6a 65 63 74 20 74 68  65 20 63 6f 6d 6d 61 6e  |bject the comman|
00000950  64 73 20 61 72 65 20 65  78 65 63 75 74 65 64 2e  |ds are executed.|
00000960  0a 7d 0a 7d 0a 0a 4e 6f  74 65 20 74 68 65 20 63  |.}.}..Note the c|
00000970  61 6e 64 6f 3a 20 69 73  20 61 6c 73 6f 20 75 73  |ando: is also us|
00000980  65 64 20 69 66 20 74 68  65 20 6f 62 6a 65 63 74  |ed if the object|
00000990  20 69 73 20 74 68 65 20  6f 6e 6c 79 20 6f 62 6a  | is the only obj|
000009a0  65 63 74 20 77 68 69 63  68 20 63 61 6e 20 64 6f  |ect which can do|
000009b0  20 0a 3c 76 65 72 62 3e  20 77 68 65 6e 20 61 20  | .<verb> when a |
000009c0  73 74 61 74 65 6d 65 6e  74 20 6c 69 6b 65 20 3c  |statement like <|
000009d0  76 65 72 62 3e 20 3c 6f  62 6a 65 63 74 3e 20 69  |verb> <object> i|
000009e0  73 20 69 73 73 75 65 64  20 28 65 67 20 68 69 74  |s issued (eg hit|
000009f0  20 62 72 69 63 6b 29 0a  0a 50 65 6f 70 6c 65 0a  | brick)..People.|
00000a00  2d 2d 2d 2d 2d 2d 0a 41  6c 6c 20 70 65 6f 70 6c  |------.All peopl|
00000a10  65 20 61 72 65 20 64 65  63 6c 61 72 65 64 20 75  |e are declared u|
00000a20  73 69 6e 67 20 61 20 70  65 72 73 6f 6e 20 64 65  |sing a person de|
00000a30  63 6c 61 72 61 74 6f 6e  2e 0a 0a 70 65 72 73 6f  |claraton...perso|
00000a40  6e 20 3c 6c 61 62 65 6c  3e 20 7b 0a 6e 61 6d 65  |n <label> {.name|
00000a50  3a 20 20 20 20 22 3c 6e  61 6d 65 3e 22 0a 74 65  |:    "<name>".te|
00000a60  78 74 3a 20 20 20 20 22  3c 6e 61 6d 65 3e 22 20  |xt:    "<name>" |
00000a70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000a80  5c 20 73 65 65 20 72 6f  6f 6d 2e 0a 65 6e 65 72  |\ see room..ener|
00000a90  67 79 3a 20 20 3c 69 6e  74 3e 20 20 20 20 20 20  |gy:  <int>      |
00000aa0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 5c 20  |              \ |
00000ab0  73 65 65 20 6f 62 6a 65  63 74 0a 64 65 61 64 3a  |see object.dead:|
00000ac0  20 20 20 20 3c 63 6f 6d  6d 61 6e 64 3e 0a 6f 62  |    <command>.ob|
00000ad0  6a 65 63 74 73 3a 20 3c  6c 61 62 65 6c 31 3e 2c  |jects: <label1>,|
00000ae0  5b 3c 6c 61 62 65 6c 32  3e 2c 2e 2e 2e 5d 20 20  |[<label2>,...]  |
00000af0  5c 20 6f 70 74 69 6f 6e  61 6c 0a 73 65 65 3a 20  |\ optional.see: |
00000b00  20 20 20 20 3c 63 6f 6d  6d 61 6e 64 73 3e 20 20  |    <commands>  |
00000b10  20 20 20 20 20 20 20 20  20 20 20 20 20 5c 20 6f  |             \ o|
00000b20  70 74 69 6f 6e 61 6c 20  65 78 65 63 75 74 65 64  |ptional executed|
00000b30  20 77 68 65 6e 20 74 68  65 20 70 6c 61 79 65 72  | when the player|
00000b40  20 73 65 65 73 0a 20 20  20 20 20 20 20 20 20 20  | sees.          |
00000b50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000b60  20 20 20 20 20 20 20 20  5c 20 74 68 65 20 70 65  |        \ the pe|
00000b70  72 73 6f 6e 0a 75 6e 73  65 65 3a 20 20 20 3c 63  |rson.unsee:   <c|
00000b80  6f 6d 6d 61 6e 64 73 3e  20 20 20 20 20 20 20 20  |ommands>        |
00000b90  20 20 20 20 20 20 20 5c  20 6f 70 74 69 6f 6e 61  |       \ optiona|
00000ba0  6c 20 65 78 65 63 75 74  65 64 20 77 68 65 6e 20  |l executed when |
00000bb0  74 68 65 20 70 6c 61 79  65 72 20 73 74 6f 70 73  |the player stops|
00000bc0  20 0a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | .              |
00000bd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000be0  20 20 20 20 5c 20 73 65  65 69 6e 67 20 74 68 65  |    \ seeing the|
00000bf0  20 70 65 72 73 6f 6e 0a  63 61 6e 62 65 3a 20 20  | person.canbe:  |
00000c00  20 7b 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | {              |
00000c10  20 20 20 20 20 20 20 20  20 20 5c 20 73 65 65 20  |          \ see |
00000c20  6f 62 6a 65 63 74 0a 20  3c 76 65 72 62 73 3e 3a  |object. <verbs>:|
00000c30  20 20 3c 63 6f 6d 6d 61  6e 64 3e 0a 7d 0a 74 61  |  <command>.}.ta|
00000c40  6c 6b 3a 20 20 20 20 7b  20 20 20 20 20 20 20 20  |lk:    {        |
00000c50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000c60  5c 20 4f 70 74 69 6f 6e  61 6c 2e 20 4b 65 79 77  |\ Optional. Keyw|
00000c70  6f 72 64 73 20 77 68 69  63 68 20 74 68 65 20 70  |ords which the p|
00000c80  65 72 73 6f 6e 20 0a 20  3c 6b 65 79 77 6f 72 64  |erson . <keyword|
00000c90  73 3e 3a 20 3c 63 6f 6d  6d 61 6e 64 3e 20 20 20  |s>: <command>   |
00000ca0  20 20 20 20 20 20 20 20  20 5c 20 72 65 61 63 74  |         \ react|
00000cb0  73 20 74 6f 2e 0a 7d 0a  7d 0a 0a 0a 50 6c 61 79  |s to..}.}...Play|
00000cc0  65 72 0a 2d 2d 2d 2d 2d  2d 0a 54 68 65 20 70 6c  |er.------.The pl|
00000cd0  61 79 65 72 20 69 73 20  64 65 63 6c 61 72 65 64  |ayer is declared|
00000ce0  20 75 73 69 6e 67 20 74  68 65 20 70 6c 61 79 65  | using the playe|
00000cf0  72 20 64 65 63 6c 61 72  61 74 6f 6e 2e 0a 0a 70  |r declaraton...p|
00000d00  6c 61 79 65 72 20 7b 0a  6e 61 6d 65 3a 20 20 20  |layer {.name:   |
00000d10  20 22 3c 6e 61 6d 65 3e  22 0a 74 65 78 74 3a 20  | "<name>".text: |
00000d20  20 20 20 22 3c 6e 61 6d  65 3e 22 20 20 20 20 20  |   "<name>"     |
00000d30  20 20 20 20 20 20 20 20  20 20 20 20 5c 20 73 65  |            \ se|
00000d40  65 20 72 6f 6f 6d 2e 0a  65 6e 65 72 67 79 3a 20  |e room..energy: |
00000d50  20 3c 69 6e 74 3e 20 20  20 20 20 20 20 20 20 20  | <int>          |
00000d60  20 20 20 20 20 20 20 20  20 20 5c 20 73 65 65 20  |          \ see |
00000d70  6f 62 6a 65 63 74 0a 64  65 61 64 3a 20 20 20 20  |object.dead:    |
00000d80  3c 63 6f 6d 6d 61 6e 64  3e 0a 6f 62 6a 65 63 74  |<command>.object|
00000d90  73 3a 20 3c 6c 61 62 65  6c 31 3e 2c 5b 3c 6c 61  |s: <label1>,[<la|
00000da0  62 65 6c 32 3e 2c 2e 2e  2e 5d 20 20 5c 20 6f 70  |bel2>,...]  \ op|
00000db0  74 69 6f 6e 61 6c 0a 63  61 6e 62 65 3a 20 20 20  |tional.canbe:   |
00000dc0  7b 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |{               |
00000dd0  20 20 20 20 20 20 20 20  20 5c 20 73 65 65 20 6f  |         \ see o|
00000de0  62 6a 65 63 74 0a 3c 76  65 72 62 73 3e 3a 20 20  |bject.<verbs>:  |
00000df0  3c 63 6f 6d 6d 61 6e 64  3e 0a 7d 0a 63 61 6e 64  |<command>.}.cand|
00000e00  6f 3a 20 20 20 7b 20 20  20 20 20 20 20 20 20 20  |o:   {          |
00000e10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 5c 20  |              \ |
00000e20  73 65 65 20 6f 62 6a 65  63 74 0a 3c 76 65 72 62  |see object.<verb|
00000e30  73 3e 3a 20 20 3c 63 6f  6d 6d 61 6e 64 3e 0a 7d  |s>:  <command>.}|
00000e40  0a 7d 0a 0a 0a 43 6f 6d  6d 61 6e 64 73 0a 2d 2d  |.}...Commands.--|
00000e50  2d 2d 2d 2d 2d 2d 0a 43  6f 6d 6d 6e 61 6e 64 73  |------.Commnands|
00000e60  20 61 72 65 20 74 68 65  20 6d 6f 73 74 20 69 6d  | are the most im|
00000e70  70 6f 72 74 61 6e 74 20  70 61 72 74 20 6f 66 20  |portant part of |
00000e80  74 68 65 20 6c 61 6e 67  75 61 67 65 2e 0a 0a 49  |the language...I|
00000e90  66 20 6d 6f 72 65 20 74  68 61 6e 20 6f 6e 65 20  |f more than one |
00000ea0  63 6f 6d 6d 61 6e 64 20  69 73 20 6e 65 65 64 65  |command is neede|
00000eb0  64 20 61 66 74 65 72 20  74 68 65 20 3a 20 70 75  |d after the : pu|
00000ec0  74 20 61 20 7b 20 61 6e  64 20 61 6c 6c 20 74 68  |t a { and all th|
00000ed0  65 20 63 6f 6d 6d 61 6e  64 73 20 0a 77 69 6c 6c  |e commands .will|
00000ee0  20 62 65 20 65 78 65 63  75 74 65 64 20 75 6e 74  | be executed unt|
00000ef0  69 6c 20 74 68 65 20 63  6f 72 72 69 73 6f 6e 64  |il the corrisond|
00000f00  69 6e 67 20 7d 20 69 66  20 6e 6f 74 20 74 68 65  |ing } if not the|
00000f10  6e 20 74 68 65 20 63 6f  6d 6d 61 6e 64 20 69 73  |n the command is|
00000f20  20 65 6e 64 65 64 20 62  79 0a 61 20 6e 65 77 20  | ended by.a new |
00000f30  6c 69 6e 65 2e 0a 0a 27  63 5f 72 6f 6f 6d 27 20  |line...'c_room' |
00000f40  63 61 6e 20 62 65 20 75  73 65 64 20 66 6f 72 20  |can be used for |
00000f50  74 68 65 20 63 75 72 72  65 6e 74 20 72 6f 6f 6d  |the current room|
00000f60  20 69 6e 20 3c 72 6f 6f  6d 3e 73 2e 20 0a 0a 70  | in <room>s. ..p|
00000f70  72 69 6e 74 28 22 3c 73  74 72 69 6e 67 3e 22 29  |rint("<string>")|
00000f80  20 20 20 20 20 20 20 2d  20 70 72 69 6e 74 73 20  |       - prints |
00000f90  61 20 73 74 72 69 6e 67  20 28 6e 6f 20 6e 65 77  |a string (no new|
00000fa0  20 6c 69 6e 65 20 75 73  65 20 22 5c 6e 22 29 0a  | line use "\n").|
00000fb0  70 72 69 6e 74 28 3c 76  61 72 69 61 62 6c 65 20  |print(<variable |
00000fc0  6c 61 62 65 6c 3e 29 20  2d 20 70 72 69 6e 74 73  |label>) - prints|
00000fd0  20 61 20 6e 75 6d 62 65  72 20 28 6e 6f 20 6e 65  | a number (no ne|
00000fe0  77 20 6c 69 6e 65 20 73  65 65 20 61 62 6f 76 65  |w line see above|
00000ff0  29 0a 0a 4e 4f 54 45 3a  0a 54 68 65 20 6c 69 6e  |)..NOTE:.The lin|
00001000  65 20 69 73 20 70 72 69  6e 74 65 64 20 65 76 65  |e is printed eve|
00001010  6e 20 69 66 20 74 68 65  72 65 20 68 61 73 20 62  |n if there has b|
00001020  65 65 6e 20 6e 6f 20 27  5c 6e 27 20 77 68 65 6e  |een no '\n' when|
00001030  20 74 68 65 20 6f 75 74  65 73 74 20 6d 6f 73 74  | the outest most|
00001040  20 62 6c 6f 63 6b 0a 6f  66 20 63 6f 64 65 20 69  | block.of code i|
00001050  73 20 65 78 69 74 65 64  0a 0a 67 6f 74 6f 28 3c  |s exited..goto(<|
00001060  6c 61 62 65 6c 3e 29 20  20 20 20 20 20 20 20 20  |label>)         |
00001070  20 20 2d 20 67 6f 65 73  20 74 6f 20 6e 65 77 20  |  - goes to new |
00001080  72 6f 6f 6d 0a 0a 67 69  76 65 28 3c 70 65 72 73  |room..give(<pers|
00001090  6f 6e 3e 2c 3c 6f 62 6a  65 63 74 3e 29 20 2d 20  |on>,<object>) - |
000010a0  67 69 76 65 73 20 61 6e  20 6f 62 6a 65 63 74 20  |gives an object |
000010b0  74 6f 20 74 68 65 20 70  65 72 73 6f 6e 20 6f 72  |to the person or|
000010c0  20 70 6c 61 79 65 72 0a  20 20 20 20 20 20 20 20  | player.        |
000010d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000010e0  2d 20 64 6f 65 73 20 6e  6f 74 20 63 68 65 63 6b  |- does not check|
000010f0  20 6d 6f 76 65 2e 0a 0a  50 5f 6d 6f 76 65 28 3c  | move...P_move(<|
00001100  70 65 72 73 6f 6e 3e 2c  3c 72 6f 6f 6d 3e 29 20  |person>,<room>) |
00001110  2d 20 6d 6f 76 65 73 20  61 20 70 65 72 73 6f 6e  |- moves a person|
00001120  20 74 6f 20 61 20 72 6f  6f 6d 2e 20 54 68 65 20  | to a room. The |
00001130  70 6c 61 79 65 72 20 63  61 6e 6e 6f 74 20 62 65  |player cannot be|
00001140  0a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
00001150  20 20 20 20 20 20 20 20  20 2d 20 6d 6f 76 65 64  |         - moved|
00001160  20 69 6e 20 74 68 69 73  20 77 61 79 0a 0a 4f 5f  | in this way..O_|
00001170  6d 6f 76 65 28 3c 6f 62  6a 65 63 74 3e 2c 3c 72  |move(<object>,<r|
00001180  6f 6f 6d 3e 29 20 2d 20  6d 6f 76 65 73 20 61 20  |oom>) - moves a |
00001190  6f 62 6a 65 63 74 20 74  6f 20 61 20 72 6f 6f 6d  |object to a room|
000011a0  20 0a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | .              |
000011b0  20 20 20 20 20 20 20 20  20 20 2d 20 64 6f 65 73  |          - does|
000011c0  20 6e 6f 74 20 63 68 65  63 6b 20 6d 6f 76 65 2e  | not check move.|
000011d0  0a 0a 65 6e 64 28 29 20  2d 20 65 6e 64 73 20 74  |..end() - ends t|
000011e0  68 65 20 67 61 6d 65 0a  0a 63 68 61 6e 67 65 28  |he game..change(|
000011f0  3c 76 61 72 69 61 62 6c  65 3e 2c 3c 69 6e 74 3e  |<variable>,<int>|
00001200  29 2d 20 63 68 61 6e 67  65 73 20 3c 76 61 72 69  |)- changes <vari|
00001210  61 62 6c 65 3e 20 62 79  20 3c 69 6e 74 3e 0a 0a  |able> by <int>..|
00001220  73 65 74 28 3c 76 61 72  69 61 62 6c 65 3e 2c 3c  |set(<variable>,<|
00001230  69 6e 74 3e 29 20 20 20  2d 20 73 65 74 20 3c 76  |int>)   - set <v|
00001240  61 72 69 61 62 6c 65 3e  20 74 6f 20 3c 69 6e 74  |ariable> to <int|
00001250  3e 0a 0a 69 66 28 3c 76  61 72 69 61 62 6c 65 3e  |>..if(<variable>|
00001260  20 3c 6f 70 3e 20 3c 76  61 6c 75 65 3e 29 3a 20  | <op> <value>): |
00001270  3c 63 6f 6d 6d 61 6e 64  73 3e 20 2d 20 63 6f 6e  |<commands> - con|
00001280  64 69 74 69 6f 6e 61 6c  20 65 78 65 63 75 74 69  |ditional executi|
00001290  6f 6e 0a 20 20 20 20 20  20 20 20 20 20 20 20 20  |on.             |
000012a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000012b0  20 20 20 20 20 20 20 20  20 20 20 2d 20 76 61 6c  |           - val|
000012c0  75 65 20 69 73 20 73 74  72 69 6e 67 0a 0a 57 68  |ue is string..Wh|
000012d0  65 72 65 20 3c 6f 70 3e  20 69 73 0a 20 20 20 20  |ere <op> is.    |
000012e0  20 20 3d 20 20 3a 20 65  71 75 61 6c 73 0a 20 20  |  =  : equals.  |
000012f0  20 20 20 20 3c 3e 20 3a  20 4e 6f 74 20 65 71 75  |    <> : Not equ|
00001300  61 6c 0a 20 20 20 20 20  20 3c 20 20 3a 20 4c 65  |al.      <  : Le|
00001310  73 73 20 74 68 61 6e 0a  20 20 20 20 20 20 3e 20  |ss than.      > |
00001320  20 3a 20 47 72 65 61 74  65 72 20 74 68 61 6e 20  | : Greater than |
00001330  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001340  0a 0a 41 63 74 69 6f 6e  73 0a 2d 2d 2d 2d 2d 2d  |..Actions.------|
00001350  2d 0a 46 6f 72 20 61 20  66 75 6c 6c 20 64 65 66  |-.For a full def|
00001360  69 6e 69 74 69 6f 6e 20  6f 66 20 68 6f 77 20 74  |inition of how t|
00001370  68 65 20 61 63 74 69 6f  6e 73 3a 2f 63 61 6e 62  |he actions:/canb|
00001380  65 3a 2f 63 61 6e 64 6f  3a 20 74 61 67 73 20 69  |e:/cando: tags i|
00001390  6e 74 65 72 61 63 74 20  73 65 65 20 74 68 65 0a  |nteract see the.|
000013a0  74 75 74 6f 72 69 61 6c  20 66 69 6c 65 2e 0a 0a  |tutorial file...|
000013b0  56 61 72 69 61 62 6c 65  73 0a 2d 2d 2d 2d 2d 2d  |Variables.------|
000013c0  2d 2d 2d 0a 41 73 20 77  65 6c 6c 20 61 73 20 74  |---.As well as t|
000013d0  68 65 20 75 73 65 72 20  76 61 72 69 61 62 6c 65  |he user variable|
000013e0  73 20 74 68 65 72 65 20  61 72 65 20 74 68 65 20  |s there are the |
000013f0  66 6f 6c 6c 6f 77 69 6e  67 20 76 61 72 69 61 62  |following variab|
00001400  6c 65 73 3a 0a 63 5f 72  6f 6f 6d 20 3a 20 74 68  |les:.c_room : th|
00001410  65 20 63 75 72 72 65 6e  74 20 72 6f 6f 6d 20 4e  |e current room N|
00001420  41 4d 45 0a 6f 62 5f 67  6f 74 20 3a 20 75 73 65  |AME.ob_got : use|
00001430  20 27 3d 20 22 4e 41 4d  45 22 27 20 6f 72 20 27  | '= "NAME"' or '|
00001440  3c 3e 20 22 4e 41 4d 45  22 27 20 74 6f 20 63 68  |<> "NAME"' to ch|
00001450  65 63 6b 20 69 66 20 74  68 65 20 75 73 65 72 20  |eck if the user |
00001460  68 61 73 20 6f 72 20 68  61 73 6e 6f 74 20 4e 41  |has or hasnot NA|
00001470  4d 45 0a 65 6e 65 72 67  79 20 3a 20 74 68 65 20  |ME.energy : the |
00001480  65 6e 65 72 67 79 20 6f  66 20 74 68 65 20 6f 62  |energy of the ob|
00001490  6a 65 63 74 20 6f 72 20  70 65 72 73 6f 6e 20 74  |ject or person t|
000014a0  68 65 20 63 6f 64 65 20  69 73 20 69 6e 0a 70 6c  |he code is in.pl|
000014b0  5f 65 6e 67 20 3a 20 74  68 65 20 70 6c 61 79 65  |_eng : the playe|
000014c0  72 73 20 65 6e 65 72 67  79 0a 0a 50 6c 61 79 65  |rs energy..Playe|
000014d0  72 0a 2d 2d 2d 2d 2d 2d  0a 4e 6f 74 65 3a 20 74  |r.------.Note: t|
000014e0  68 65 20 6c 61 62 65 6c  20 27 70 6c 61 79 65 72  |he label 'player|
000014f0  27 20 63 61 6e 20 62 65  20 75 73 65 64 20 74 6f  |' can be used to|
00001500  20 64 65 6e 6f 74 65 20  74 68 65 20 70 6c 61 79  | denote the play|
00001510  65 72 20 69 6e 20 61 6c  6c 20 70 6c 61 63 65 73  |er in all places|
00001520  0a 77 68 69 63 68 20 6e  65 65 64 20 61 20 70 65  |.which need a pe|
00001530  72 73 6f 6e 20 65 78 63  65 70 74 20 69 6e 20 61  |rson except in a|
00001540  20 72 6f 6f 6d 7b 20 70  65 72 73 6f 6e 3a 20 7d  | room{ person: }|
00001550  20 6c 61 62 65 6c 0a 0a  56 65 72 62 73 2f 4b 65  | label..Verbs/Ke|
00001560  79 77 6f 72 64 73 0a 2d  2d 2d 2d 2d 2d 2d 2d 2d  |ywords.---------|
00001570  2d 2d 2d 2d 2d 0a 54 68  65 73 65 20 61 72 65 20  |-----.These are |
00001580  6c 69 73 74 73 20 6f 66  20 77 6f 72 64 73 20 77  |lists of words w|
00001590  68 69 63 68 20 6d 61 79  20 62 65 20 6d 61 74 63  |hich may be matc|
000015a0  68 65 64 20 73 65 70 65  72 61 74 65 64 20 62 79  |hed seperated by|
000015b0  20 73 70 61 63 65 73 2e                           | spaces.|
000015b8