AdventureScript
--------------------------------------------

Start:
 Copy the sample folder somewhere and give it a title. Take a look at
 the folder structure and the files in it. Put the game info
 (title, author...) in the file main.ast (edit with a text editor).
 If you want to have title pictures, save them as 320*200 gifs (titleN) in the
 gif/title sub-folder and convert them with Aconv.exe (with windows you can
 drag and drop, in dos mode enter the file at the command line).

 ! Note: You can't drag and drop/ enter multiple files.

Settings:
 The setting.dat file is made up of 5 boolean expressions (true/ false):
  -Use Soundblaster
  -Use Joystick
  -Encode -> Script
  -Speed up
  -Skip title

Tileset:
 You best start out with drawing a tile set with PaintShop Pro 4.
 This painting program can be downloaded as shareware at:
   http://www.jasc.com/pspdl.html

 Then you create a new 32*32 picture with 256 colors, and start to
 draw a tile. You need to use the default palette def.pal in the pic
 folder. Load it with colors/ load palette/ nearest color matching.
 You might as well use gif/sample.gif as a blank reference.
 After you finished to draw the picture, save it as gif87 non-interlaced
 titled tle_NR in the gif folder in a new tileset folder. Create the
 same tileset subfolder in the pic folder and convert the picture
 to *.grh with Aconv.exe.
 Note that when you create stages later, PSPs picture browser is helpful.
 But you don't need the gif files for the game to run and you should
 exclude them from a distributed file.

Spriteset:
 Creating a spriteset is the same as ->Tileset above but you need
 to do 6 versions of it. Two animated cells for left (spr_lf1/2)
 and right (spr_rt1/2) as well as back (spr_bk1) and
 frontal (spr_fr1). Save them in the gif/sprite1 folder.
 White (index 15) is the transparent color (these pixels won't
 be shown in the game).

 ! Note: If you want to use white as non transparent
         colors use index 31.

 If you want to create more then
 one sprite-set save them as "sprite2" and so on (later you
 can change the players appearance during an AScript).

Maps:
 These *.map files (w1.map, w2.map...) describe the world the player
 moves around in. You can open and edit with a simple text editor like
 MS Notepad. Better yet is Notespad (freeware) which lets you edit
 multiple files. To download it enter Notespad as keyword at:
  http://www.shareware.com/   

 In the map folder there needs to be a file worlds.dat created which
 contains the number of worlds and the world where the player starts.
 Example (4 stages, starting at 3): 4,3

Tiles:
 There're 25 tiles to the left and right (the middle is zero).
 A world is set up of different stages, which use a certain
 tileset (the subfolder in the pic folder). A tileset beach fe. contains
 sand tiles, water, palm trees etc. You start a map file by writing
 the tileset (in quotation marks). Always divide data by comma, space or return.
 So you'd start with:
  "tileSetName"

 Now you define the position of the tiles on the map (copy the zeros as reference or open up sample.map):

    25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
     *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
-2 * 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-1 * 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 0 * 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 1 * 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 2 * 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

 Each value points to a tile picture that you created.
 Then you define tile details if you want to. Otherwise everything is just
 background.

 ! Note: The y value of the player is always 1.

 (Limit: 26 tiles for each stage)

Tile attributes:
 The seperate parts of definition end with a -1.
 You can use map/sample.map as reference.
 The least you have to write are those "-1" seperations.

 Example (of such an empty tile attributes set):
  -1
  -1
  -1
  -1

 Tile attributes are:
  [links]
  SEPERATION
  [tile types]
  SEPERATION
  [anim cells]
  SEPERATION
  [object script]

  Explanation:
   >> links (worldNr, plrx, plry)
    Links are like doors or pathways that change the setting. Plry should always be 1.
     Example (tile 2 links to world 3 at x=4/ y=5):
      2,3,4,5

   >> tile types (tileNr, type)
     Type can be:
       Back      | 0
       Barrier   | 1
       Backdoor  | 2
       Sideway   | 3
     The default type (if nothing else is defined in the map) is Back.
     Example (tile 3 is a barrier):
      3,1

   >> anim cells (swap from to, speed)
    Animation cells are exchanged during game. There are 3 different kind of
    speeds. 0 is slowest (least probable to happen) and 2 is fastest (most
    probable to happen).
     Example (tile 3 changes slowly to tile 4 and fast back again to tile 3):
      3,4,0 4,3,2

   >> object script (#, name)
    This declared a tile as an object and points to a -> script that is executed
    when the player meets the tile. Objects and scripts are described below.
     Example (tile 3 runs the script "wizard.act"):
      3,"wizard"

 The end of each stage map is the highest tile the map uses. This can be zero to
 allow for auto checking or a higher value then the map contains that is set by
 a script or animation.

Objects:
 An object is everything from a person to a gold coin, as long as
 it should interact with the player in some ways during the game.
 Objects have an 8 letters maximum, because you name the scripts
 after them. 

Script:
 This tells how an object interacts with the player. Scripts are
 text files that have to be saved as *.act in the script folder.
 You can again use Notespad for editing (see above -> maps).
 Scripts start with "start at N", where N is the firts station, and they
 end with "*500". If you want to hide the content of your scripts,
 turn the encode flag in the -> settings to true and decode your
 scripts via drag and drop with Decode.exe (thanks to Engelbert). Then
 you can remove your old scripts.

 Structure:
  Start at FirstStationNumber
  *StationNumber
    Choice triplet
    Choice triplet
    ...
  *NextStationNumber
    Choice triplet
    Choice triplet
    ...
  *500

 Take a look at the flower.act file for an example.

Stations:
 Scripts are divided into stations that start with a star * and
 the number (Like *10). 

 (Limit: 500 stations per object)

Choice triplets:
 These always come in bundles of three (question, answer, link).

 Question:
   First, something the user may choose. Like:
    -Switch off light
    -Talk to person
    -Say "Hello" (or simply: "Hello")
 Answer:
   Then comes what happens at this choice. Like on "Hit the monster" you'd write
     -You killed it.
   In some exceptional cases you might want to skip the answer, fe. if the action
   has visual results that need no explanation. See the empty choice -> command.
 Link:
   After that, there is the new reference station (a number).
   This will point to a new station with more choices or is set
   to -1 to end the script.

 ! Note: You need to write very short sentences.

 (Limit: 10 choices per station)

Flags:
 Flags can be anything, from "killed the bad guy" to
 "learned magic spell #1" or whatever. They are
 boolean expressions (either true or false). Avoid
 confusion and don't use any reserved words like
 "not" for naming, rather express the statement in a
 positive way and use the not in an if statement
 (see below -> Ifs).

 (not case sensitive
  Limit: 200 flags at once)

Comments:
 Comments start (at the beginning of a line) with '
 Commented lines won't have any effects on the adventure.
 Example:
  Take the magic staff
  ' Staff is needed later at the castle
   You take it, might be good for something. (get magic staff/change 3)
     -1

Ifs:
  Syntax:
   >if [not] FLAG/ OBJECT
     ...
   [>else
     ...]
   >end if

 Explanation:
  These start with a ">" and show or hide certain options. Fe. if the player
  knows about something, a flag "has info x" is set to true when he gets the info,
  and somewhere else where he could use the info, more then the standard options
  appear.

 Example (the flag "the player has info on evil wizard" is checked):
  *1
   You say: "Hello guardian."
     The guardian is bored: "Hello."
       1
   >if the player has info on evil wizard
     You say: "I'm looking for the evil wizard."
      The guardian is shocked: "How did you know..?"
       2
   >end if
   You say: "Well, I gotta go."
     You leave.
      -1

 You cannot construct stations that are empty in certain situations.
 ! Note: Behind an if construct without an else, the AScript parser always
         expects there to be another choice triplet.

 (not case sensitive)

Command:
 Commands are put into brackets like "(" and ")" after the second part of
 a choice triplet. Commands set flags besides other things. Like:

  Take the apple.
    You put the apple into your bag. (get apple)

 Multiple commands are seperated by a slash "/". In this example, #2 are dark and #3 are
 light tiles of the same thing:

  Switch on light
    The darkness fades. (true light is on/swap 2,3)

 Possible commands are:
  false/ kill FLAG    >> set a flag to false or kill it
  true FLAG           >> set a flag to true
  drop/ give OBJECT   >> gets rid of an object in the bag
  get OBJECT          >> puts an object into the bag. You can check a bag object like a flag
  change [to] TILE    >> changes object tile to given number (like: change to 1)
  switch TILE1,TILE2  >> changes all tiles TILE1 on a stage for another tile TILE2 (like switch 1,2)
  swap TILE1,TILE2    >> swaps all tiles TILE1 for another tile TILE2 (like swap 1,2)
  not FLAG            >> inverses a flag (will be set to true if false and vice versa)
  game over           >> ends the game
  sprite N            >> changes the sprites appearance by loading spriteSet N (see above -> Sprites)
  show OBJECT         >> displays a picture (converted gif from the object folder)
  empty choice        >> this marks an empty answer (see -> Choice triplets)
  beep N              >> beeps for N times (like: beep 1)

 (not case sensitive)

--------------------------------------------

http://www.geocities.com/SiliconValley/Lakes/7784
