home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 17 / amigaformatcd17.iso / -screenplay- / shareware / graal / graal_manual.text < prev    next >
Text File  |  1997-06-29  |  189KB  |  4,992 lines

  1.  
  2.  
  3.  
  4.  
  5. 1    Contents
  6. =============
  7.  
  8.  
  9. 1    Contents   
  10.  
  11. 2    Introduction    
  12.  
  13.      2.1  Copyright Information     
  14.      2.2  Credits    
  15.      2.3  About the Manual     
  16.      2.4  Release Info    
  17.      2.5  Notation Conventions      
  18.  
  19. 3    (Finally:) The REAL Introduction    
  20.  
  21.      3.1  So, What Is GRAAL?   
  22.      3.2  Other Tools of the Trade  
  23.      3.3  The Things That Make a GRAAL   
  24.      3.4  GRAAL Script Files   
  25.      3.5  The graal.main Script     
  26.      3.6  The .room Scripts    
  27.      3.7  The .section Files   
  28.      3.8  The .scene Scripts   
  29.      3.9  The .ptrn Scripts    
  30.      3.10 Running an Adventure      
  31.      3.11 Loading, Saving and Quitting   
  32.  
  33. 4    Starting on an Adventure  
  34.  
  35.      4.1  Starting on the graal.main File     
  36.      4.2  The Hero - What a Character!   
  37.      4.3  Basics about Images and Bobs   
  38.      4.4  The Images in the graal.main File   
  39.  
  40. 5     "A Room! A Room! A Kingdom for a Room!"      
  41.  
  42. 6    The Object Matter    
  43.  
  44. 7    Section Objects and BOBs
  45.  
  46. 8    Camera! Action! Lights!   
  47.  
  48.      8.1  ACTION: statements   
  49.  
  50. 9    Using Exits     
  51.  
  52. 10   The DACT: Statements      
  53.  
  54. 11   Flags and String Variables     
  55.  
  56.      11.1 Flags      
  57.      11.2 String Variables     
  58.  
  59. 12   Having a Chat   
  60.  
  61. 13   Multiple Characters and Inventories      
  62.  
  63.      13.1 Multiple Character Graphics    
  64.      13.2 Character Objects    
  65.      13.3 Switching Characters      
  66.      13.4 Inventory Switching  
  67.      13.5 Identifying Characters and/or Inventories     
  68.      13.6 Characters Following Characters Around...     
  69.      13.7 Helpful Conditions   
  70.      13.8 Things to Consider   
  71.      13.9 Space-saving Tip     
  72.  
  73. 14   Character and Graphics Design  
  74.  
  75.      14.1 Size  
  76.      14.2 Colour     
  77.      14.3 Pointer Shapes and Colours     
  78.      14.4 Designing Animations      
  79.      14.5 Complex animation patterns     
  80.      14.6 Flipped images  
  81.      14.7 All About 3D and Hotspots      
  82.      14.8 Scaling the Characters    
  83.  
  84. 15   Cutscenes  
  85.  
  86.      15.1 Hop, Skip and Jump   
  87.      15.2 No Breaks!      
  88.      15.3 Nesting    
  89.  
  90. 16   Timer Events    
  91.  
  92. 17   Special Techniques or "How The Heck Did He Do That?"    
  93.  
  94.      17.1 The Load / Save Room.     
  95.      17.2 Going into the Alley      
  96.      17.3 Speaking In a Foreign Tongue   
  97.      17.4 An Automated Room    
  98.      17.5 The Art of Avoiding a Seagull  
  99.      17.6 A Spitting Image     
  100.      17.7 A Map Room      
  101.  
  102. 18   The On-line Monitor  
  103.  
  104. 19   Macros     
  105.  
  106.      19.1 Starting a Macro Recording     
  107.      19.2 Saving a Macro  
  108.      19.3 Playing a Macro      
  109.      19.4 Restrictions to Macro Playback      
  110.  
  111. 20   "Productifying" Your Adventures     
  112.  
  113.      20.1 The Basics      
  114.      20.2 The diskinfo.graal File   
  115.      20.3 GREP  
  116.      20.4 GPRO  
  117.      20.5 GDC   
  118.  
  119. 21   The Editor      
  120.  
  121.      21.1 Introduction    
  122.      21.2 System Requirements  
  123.      21.3 Known Bugs & Irritating Facts  
  124.      21.4 Creating a New Script     
  125.      21.5 Working with the Editor   
  126.      21.6 Creating a Report    
  127.      21.7 The Parameter Editor      
  128.      21.8 Icon Tooltypes  
  129.      21.9 Editor Keyboard Shortcuts      
  130.  
  131. 22   Hints and Tips  
  132.  
  133.      22.1 Flags      
  134.      22.2 Diverse    
  135.  
  136. 23   Questions and Answers           
  137.  
  138.  
  139.  
  140.  
  141. 2    Introduction
  142. =================
  143.  
  144.  
  145. 2.1  Copyright Information
  146. --------------------------
  147.  
  148. GRAAL 2 is Shareware. If you like it and use it, register and make 
  149. me happy!
  150.  
  151. All rights to the GRAAL system remains with Performance 
  152. Software and is copyright © 1997 Per Thulin.
  153.  
  154. Users of GRAAL may use the system freely to distribute their own 
  155. graphic adventures, but are completely forbidden to use any of the 
  156. supplied example material - puzzles, characters, animations, or 
  157. scenes - in their own work. Quite simply, all material used in your 
  158. own GRAAL adventures must be your own!
  159.  
  160. The shareware version of GRAAL is not crippled in any way, but it 
  161. is not quite adapted for "professional" use, which is explained later 
  162. in this manual.
  163.  
  164. See the file Registration.form for details on how to register.
  165.  
  166.  
  167. 2.2  Credits
  168. ------------
  169.  
  170. GRAAL is coded in Amos Professional. You know it makes 
  171. sense... :) Also, let's not forget that Black Legend Craft 1 and 
  172. AMCAF extensions. They made things that much better!
  173.  
  174. The GRAAL Editor is coded in Blitz 2 Basic. You know it makes 
  175. even more sense... ;)
  176.  
  177.  
  178. 2.3  About the Manual
  179. ---------------------
  180.  
  181. This manual contains an awful lot of text. Don't be discouraged - 
  182. that is simply because each little GRAAL statement carries an 
  183. awful lot of power (and because I'm such a blabbermouth), and 
  184. some sophisticated initial definitions automate most of the 
  185. gameplay! Before you get totally discouraged, print out the 
  186. following files from the example disk(s):
  187.  
  188. graal.main 
  189. 1.section 
  190. 1.room
  191.  
  192. If you look at these files, and disregard the abundance of comment 
  193. lines starting with /*, you will quickly realise how precious little 
  194. GRAAL code is actually needed for the basics of an adventure, and 
  195. be able to read on with a lighter heart. Also remember that there is 
  196. an editor included making your GRAAL-coding life a lot easier - you 
  197. don't have to enter that many tricky parts manually, the editor can 
  198. help you.
  199.  
  200. The GRAAL documentation is divided into three main parts:
  201.  
  202. 1.   The latest .readme file - essential to all who wants to read 
  203.      about the news in the latest version of the system.
  204.  
  205. 2.   This manual.
  206.  
  207. 3.   An AmigaGuide on-line reference (graal.guide), the definitive 
  208.      authority on all GRAAL statements and commands.
  209.  
  210. If you want to play the provided "Olaf" demo AND build your own 
  211. Graphic Adventure, I strongly suggest you play the game first!  
  212. Because "Olaf" is used as an example throughout the tutorial, some 
  213. of the secrets of the demo is given away here. This is also a good way 
  214. of deciding whether this kind of stuff is what you want to spend the 
  215. rest of your life doing :-)
  216.  
  217.  
  218. 2.4  Release Info
  219. -----------------
  220.  
  221. GRAAL 2.2 brings you the following features:
  222.  
  223. *    A graphic adventure point'n'click interface along the lines of, 
  224.      among others, the Indy games and Monkey Island 
  225.      (Trademarks of LucasArts Ltd.).
  226.  
  227. *    Automation of most of the controllable characters' walking, 
  228.      talking, and general fiddling around.
  229.  
  230. *    32- or 64-colour (EHB) lowres, automatically scrolling 
  231.      background screens, 320 to 640 pixels wide.
  232.  
  233. *    16-colour, hires, fully configurable command area, 640 pixels 
  234.      wide.
  235.  
  236. *    Any number of player commands.
  237.  
  238. *    Features to handle "USE", "GIVE TO" and "GO TO" 
  239.      commands.
  240.  
  241. *    Room and section data swapped in and out of memory at 
  242.      runtime to minimise the growth of permanent in-memory data 
  243.      as the adventure grows. This gives you a virtually unlimited 
  244.      number of locations (rooms), objects, images, dialogues, etc.
  245.  
  246. *    Also automatically detects extra memory and uses this as 
  247.      cache memory to avoid unnecessary disk access.
  248.  
  249. *    Animated objects and characters.
  250.  
  251. *    Pixel-perfect detection of objects.
  252.  
  253. *    Side-view "simulated 3D" scenes with foreground, "middle", 
  254.      and background objects.
  255.  
  256. *    Dynamic depth-scaling of characters.
  257.  
  258. *    A rather intelligent and easy-to-use dialogue system for those 
  259.      totally silly discussions with sidekick characters we all have 
  260.      come love so much.
  261.  
  262. *    An equally intelligent and smart but perhaps a little more 
  263.      difficult-to-grasp floor and path definition system - for defining 
  264.      legal movement paths and automatic negotiation of obstacles.
  265.  
  266. *    Cut-scenes with or without indicators. Nested cut-scenes are possible.
  267.  
  268. *    Timer events.
  269.  
  270. *    Functions for in-game clocks and dates.
  271.  
  272. *    Built-in requesters for save/load and quit functions - or disable 
  273.      them and design your own save/load and quit screens.
  274.  
  275. *    Multiple character control.
  276.  
  277. *    Multiple inventories.
  278.  
  279. *    Soundtracker style music modules for background music.
  280.  
  281. *    IFF and raw samples for sound effects.
  282.  
  283. *    Run-time error checking (to a degree).
  284.  
  285. *    GRAAL automatically detects if a GRAAL adventure is run 
  286.      from diskette, CD-ROM, or hard disk, and adjusts disk 
  287.      swapping and save/load routines accordingly.
  288.  
  289. *    All tools included except an art/animation package and 
  290.      (optional) sound sampler equipment.
  291.  
  292. *    Diskette layout system for automatic copying and labelling of 
  293.      distribution master diskettes.
  294.  
  295. *    Dynamic on-line monitor and debugger for script testing, on-
  296.      the-fly temporary corrections, and examination of the game 
  297.      status.
  298.  
  299. *    Single-step trace mode for debugging.
  300.  
  301. The developer's registered version also gives you:
  302.  
  303. *    Optimization and encryption of distribution files. The process 
  304.      also locks all development functions (the on-line monitor, 
  305.      break keys, etc.) so that they cannot be used by the player.
  306.  
  307. *    Extra graphics files offering various "requester looks".
  308.  
  309. It does NOT give you:
  310.  
  311. *    AGA (but on the other hand, a much broader customer base for 
  312.      your games. Let's be kind to those ECS users out there! :)
  313.  
  314.  
  315. 2.5  Notation Conventions
  316. -------------------------
  317.  
  318. In this text, < > denotes button gadgets and [ ] keyboard keys.
  319.  
  320. Furthermore, I have tried to print names of files and sections of 
  321. scripts in a special font:
  322.  
  323. file.name
  324.  
  325. Of course, those of you who only have the ascii manual will not 
  326. benefit from this. Register and order the manual! :)
  327.  
  328.  
  329.  
  330.  
  331. 3    (Finally:) The REAL Introduction
  332. =====================================
  333.  
  334.  
  335. Welcome to GRAAL. Maybe thy quest is over!
  336.  
  337. ...or maybe it has just begun. Because, although GRAAL is a 
  338. powerful tool, designing a graphic adventure still needs an awful 
  339. lot of hard work from your side - all GRAAL does is take most of the 
  340. actual coding work out of the job and lets you get on with designing 
  341. the story, logic, backgrounds, objects, animated characters and 
  342. dialogue! Which, in itself, should keep you busy for quite a while.
  343.  
  344. GRAAL was mainly invented along with the 7-room demo of the 
  345. first ever GRAAL adventure "Olaf Longhair, Part I", delaying the 
  346. release of both, but ensuring that GRAAL really works on a full-
  347. scale and rather advanced graphic adventure. Although maybe not 
  348. quite up to LucasArts standards, it proves that GRAAL can make 
  349. at least a budget-level game any day! And since this manual was 
  350. written parallel to the code that went into "Olaf" and GRAAL itself, 
  351. you should find everything of importance right here.
  352.  
  353.  
  354. 3.1  So, What Is GRAAL?
  355. -----------------------
  356.  
  357. All GRAAL adventures consist of:
  358.  
  359. *    The GRAAL driver program, which is the "adventure engine". 
  360.      It is named GRAAL_2 in the development package. When you 
  361.      use it to run a specific game, it is usually renamed to whatever 
  362.      that adventure is called.
  363.  
  364. *    GRAAL script files, containing the statements that make up 
  365.      the adventure. There are different kinds of script files: One 
  366.      graal.main file, .room files, .section files, .scene files, and .ptrn 
  367.      files.
  368.  
  369. *    IFF image files, depicting background scenes and object and 
  370.      character "clip-art".
  371.  
  372. *    A file called diskinfo.graal. This file contains, among other 
  373.      things, the names of all the other files used in your adventure. 
  374.      This file is used by GRAAL to locate files and handle disk 
  375.      swapping in an intelligent way if your game gets so big it does 
  376.      not fit onto one disk.
  377.  
  378. *    Optionally, soundtracker music modules and sample banks.
  379.  
  380.  
  381. 3.2  Other Tools of the Trade
  382. -----------------------------
  383.  
  384. If you don't have AmigaGuide (or Multiview - WB 3 and above), get 
  385. hold of it NOW. You'll need it to use the editor, and read the on-line 
  386. command reference.
  387.  
  388. You will not go far without a good paint program like Deluxe Paint, 
  389. Brilliance or Personal Paint to create all backgrounds, objects and 
  390. animations. An image processing program like Photopaint, Image 
  391. FX or ADPro is a good complement.
  392.  
  393. To take some of the work out of the backdrop scene creation, why 
  394. not use a modelling and rendering package? (Believe it or not, there 
  395. are some good ones that are freeware, even - POV-ray, for instance.
  396.  
  397. A sound sampler and software could also come in handy, as could a 
  398. scanner or digitizer. But hey, it's up to you. Or rather, your wallet.
  399.  
  400.  
  401. 3.3  The Things That Make a GRAAL
  402. ---------------------------------
  403.  
  404. Because there are a lot of things in the GRAAL system to keep 
  405. track of, and you need almost all of it to make the adventure work, 
  406. the manual will try to explain most of the stuff in the tutorial form, 
  407. followed by in-depth discussions on a number of the trickier 
  408. subjects and concepts. There is also an on-line command reference 
  409. in Amigaguide format, which is a necessary complement to this 
  410. manual, and which will be vital once you get hang of things in 
  411. general. Also, the Olaf 1 demo provides you with well commented 
  412. script files of all types. These demonstrate almost all major GRAAL 
  413. techniques. (Beware: READ THE COPYRIGHT NOTICE!)
  414.  
  415. But first, let's have a quick general look at the general structure of 
  416. a GRAAL game.
  417.  
  418.  
  419. 3.4  GRAAL Script Files
  420. -----------------------
  421.  
  422. The GRAAL code needed to make an adventure tick is contained in 
  423. a number of script files. It is a compact language; if it wasn't for the 
  424. heavy commenting, they would not take up too much space at all!
  425.  
  426. There are different types of script files, each controlling a different 
  427. portion of the game. Their relationships form a tree- shaped 
  428. structure, like this:
  429.  
  430.  There may be any number of .section files beneath the graal.main 
  431. file, and any number of .room files under each .section file.
  432.  
  433. (Although placed in the middle of the structure, the importance of 
  434. section files vary greatly depending on the design of your 
  435. adventure. In some cases, you may want to have only the one 
  436. section file, containing nothing at all! More about this further on.)
  437.  
  438. In all these script files there are three basic kinds of lines:
  439.  
  440. Comment lines - All comment lines must begin with the 
  441. characters
  442.  
  443. /*
  444.  
  445. which can be followed by any text, like in
  446.  
  447. /* This is a comment if ever I saw one!
  448.  
  449. Use comments a lot, because the GRAAL syntax is not particularly 
  450. reader-friendly, and what was clear in your mind when you typed 
  451. it in may seem like pointless rubbish a couple of weeks later - if you 
  452. don't have the comments there to remind you.
  453.  
  454. Hint: The GRAAL_Editor uses the first line of each script file to 
  455. explain its contents in file requesters, making it easier to find the 
  456. file you want. Therefore, always make the first line of each script a 
  457. comment, like this:
  458.  
  459. /* Short description of script contents
  460.  
  461. Empty lines - may be used as separators for improved readability.
  462.  
  463. Statement lines - each statement line contains a statement (or 
  464. keyword, if you will), followed by a colon, and one or more 
  465. parameters separated by semicolons. Like this:
  466.  
  467. statement: parameter1;parameter2;...;parameterN
  468.  
  469. In many cases, the parameters contained in a statement line are 
  470. conditions or commands, containing their own parameters. 
  471. Example:
  472.  
  473. ACTION: 4;IFRF 2=0;SAY I Can't do that;EXIT
  474.  
  475. In this example, ACTION: is a statement that comes into play when 
  476. GRAAL is checking a command input by the player. More precisely, 
  477. the ACTION statement in this example will be used if a sentence 
  478. using verb 4 (parameter 1) has been entered by the player. GRAAL 
  479. will then execute the commands SAY and EXIT, but only if the 
  480. condition IFRF 2=0 has been fulfilled first.
  481.  
  482. Note: There must be a space between the ":" and the parameters, 
  483. but there must be no spaces around the semicolons separating the 
  484. parameters! Also, there is no semi-colon after the last parameter in 
  485. a line.
  486.  
  487. Each statement in a script file may be up to 255 characters long. 
  488. The script files are case sensitive, so make sure all statement and 
  489. command names are written in upper case.
  490.  
  491. Any line in the three types of script files mentioned above that does 
  492. not conform to the rules will be spotted by GRAAL at run-time, 
  493. normally causing the execution of the adventure to halt with an 
  494. error message. Double-check everything, and use the GRAAL 
  495. editor for help with the parameter syntax and syntax checking!
  496.  
  497.  
  498. 3.5  The graal.main Script
  499. --------------------------
  500.  
  501. "All right, but what do these different script files actually do?" I 
  502. hear you scream.
  503.  
  504. Good questions! The first, and in many ways the most important, is 
  505. the graal.main file. It is called that because that is what it must be 
  506. called - if GRAAL doesn't find a graal.main file in the current 
  507. directory, it will say so and terminate.
  508.  
  509. The graal.main file sets up everything that is common to the entire 
  510. adventure, such as:
  511.  
  512. *    All basic aspects of the main character's behaviour - he's 
  513.      certainly going to be around in the entire adventure!
  514.  
  515. *    Where the adventure starts.
  516.  
  517. *    The fonts to be used for the user interface.
  518.  
  519. *    All the objects that can be carried anywhere in the game.
  520.  
  521. *    All the characters involved in dialogues.
  522.  
  523. *    All the actions the main character can take that are common 
  524.      to all, or at least to most, locations.
  525.  
  526.  
  527. 3.6  The .room Scripts
  528. ----------------------
  529.  
  530. Once GRAAL has interpreted the graal.main file, it knows which 
  531. room file to look for first. All room files have the suffix .room 
  532. preceded by the room number, so the first room file used in the 
  533. adventure is very often called 1.room . (If you decide on a better 
  534. starting point for the adventure later on, you may of course tell 
  535. GRAAL to start in, for example, room 45 instead.)
  536.  
  537. Since GRAAL reserves memory for each possible room number 
  538. from 1 and up to the highest room number used, it is quite wasteful 
  539. to have "gaps" in the room sequence. If you have deleted some 
  540. rooms in the middle of the sequence, use the vacant numbers when 
  541. you add new rooms, thus minimising the gaps in the numbering 
  542. sequence.
  543.  
  544. The .room files do much the same for each adventure location or 
  545. "room" as the graal.main file does for the adventure as a whole.
  546.  
  547. They contain, among other things, the following:
  548.  
  549. *    The name of the IFF file to be used as the background in the 
  550.      Scene Area.
  551.  
  552. *    Information about "clip-art" to be loaded in and used as 
  553.      graphic elements and objects for this particular room.
  554.  
  555. *    The dialogues that take place in this room.
  556.  
  557. *    The objects that can only exist within this room.
  558.  
  559. *    All actions that are specific to this room.
  560.  
  561.  
  562. 3.7  The .section Files
  563. -----------------------
  564.  
  565. .section files are very similar to .room files. Their main purpose in 
  566. life is to make GRAAL more memory efficient. The basic idea is that 
  567. many graphic adventures are divided into logical sections, a section 
  568. being a number of connected rooms where the same objects can be 
  569. handled and a number of puzzles need to be solved before you can 
  570. move on to the next section. However, once you are through with a 
  571. section, there are a number of objects and images you will never use 
  572. again, and therefore they can be deleted from memory the freed 
  573. space can be used for the objects of the new section. Or, perhaps the 
  574. rooms of the section share a lot of graphics - like a labyrinth in a 
  575. system of caves probably would.
  576.  
  577. How you define sections is up to you, and you do not need to use the 
  578. concept at all if it is irrelevant. (In that case, just use section 1 for 
  579. all the rooms, and place no commands in the 1.SECT file - just a few 
  580. comment lines describing what the blazes you are up to, with a 
  581. couple of totally blank lines in between.)
  582.  
  583.  
  584. 3.8  The .scene Scripts
  585. -----------------------
  586.  
  587. .scene files are known as cut-scene files, containing non- interactive 
  588. parts of the adventure (playing much like cartoon movies). They 
  589. can also be used as subroutines, saving you the work of re-coding 
  590. the same set of commands in a lot of places.
  591.  
  592. The cut-scene files are a little special (but simpler) than the 
  593. previous script files, and will be discussed later on.
  594.  
  595.  
  596. 3.9  The .ptrn Scripts
  597. ----------------------
  598.  
  599. .ptrn files are not scripts as such - they contain definitions of 
  600. animation patterns that would be too long to enter into the other 
  601. script files directly, or you wish to re-use in a number of different 
  602. places in your scripts - or all of the above. (For those of you familiar 
  603. with Amos Pro, the contents of the .ptrn files follow the AMAL 
  604. syntax exactly.)
  605.  
  606.  
  607. 3.10 Running an Adventure
  608. -------------------------
  609.  
  610. At some point or other, you feel that the script files are ripe for 
  611. testing. This is simply a matter of trying to start the adventure by 
  612. running the driver program GRAAL_2, which must be placed in the 
  613. same directory as all the script and graphics files you refer to in the 
  614. game.
  615.  
  616. (You should, of course, run the syntax checker in the 
  617. GRAAL_Editor on all scripts first to get rid of all typing errors and 
  618. other such mistakes. This takes far less time than re-running 
  619. GRAAL_2!)
  620.  
  621. First, the GRAAL_2 program loads. Then, the GRAAL title screen 
  622. is shown. The progress indicator (the horizontal bar) indicates that 
  623. the contents of the graal.main file are being loaded and processed. 
  624. When the title screen disappears and the screen goes blank for a 
  625. moment, the system is working on the first .room script.
  626.  
  627. Most likely, you will get some error messages before everything 
  628. starts running smoothly. A GRAAL "run-time error" message will 
  629. appear in yellow text surrounded by a red border on screen, stating 
  630. the type of error, which room was currently loaded, and which file 
  631. was last accessed. 
  632.  
  633. Note: This file may in some cases not be the actual culprit! For 
  634. example, If GRAAL has loaded a small cutscene file, executed it 
  635. and run into a problem in the calling script later on, it is still the 
  636. name of the completely innocent cutscene file that is shown, so take 
  637. this information for what it is.
  638.  
  639. Some problems may be of a less severe nature. In those cases, 
  640. GRAAL sometimes lets you decide whether to continue playing, or 
  641. exit the program (in which case it tries to clean up the memory just 
  642. as if you give the "Q"uit command when playing the game the 
  643. normal way).
  644.  
  645. Continuing after such a warning is not always safe: The error 
  646. almost certainly affects some aspect of the game. However, things 
  647. like flag value errors may often be corrected using the on-line 
  648. monitor (see the appendices).
  649.  
  650. Also note that in the error messages, the offensive statements and 
  651. commands are sometimes printed in a slightly different way from 
  652. how they appear in the script: This is because all RBOBn, SBOBn, 
  653. ROBJn and SOBJn references, which are relative numbers, are 
  654. translated directly upon loading to become absolute numbers. So if 
  655. your N_xxxxBOBS statement in the graal.main file decide that 
  656. ROOMBOBS start at image number 51, an erroneous statement 
  657. containing RBOB4 would actually show the number as "54" in the 
  658. error message. (Sorry 'bout that. Read on, and you will probably 
  659. understand what the heck I am talking about later.)
  660.  
  661. There will most likely always be some errors that are not trapped 
  662. properly, and the system may just "die on you". In those cases, try 
  663. to determine how far the loading process has actually gone, and 
  664. check the structure of YOUR scripts carefully against the Olaf 1 
  665. demo and the order in which things appear there! Also, resetting 
  666. your Amiga before trying again often helps - as always, there is a 
  667. certain amount of memory thrashing going on if you make a lot of 
  668. consecutive test runs.
  669.  
  670. For an overview of the features of the GRAAL_2 player interface, 
  671. read the "Olaf.guide" that contains instructions for the demo 
  672. adventure.
  673.  
  674.  
  675. 3.11 Loading, Saving and Quitting
  676. ---------------------------------
  677.  
  678. GRAAL has its own, built-in requesters and short-cut keys for the 
  679. standard tasks of loading, saving, and quitting a game. However, 
  680. you can easily disable those short-cut keys (with some statements 
  681. in the graal.main script) and design your own routines. Olaf 
  682. Longhair uses a special room where you can have a look at the 
  683. score, save and load games, and optionally quit the program. In the 
  684. demo, I have not disabled the short-cut keys, so you can choose 
  685. which way to quit, for example - the quick one or the impressive 
  686. one!
  687.  
  688. On the subject of loading saved games, note that saved game files 
  689. can only be used with the same GRAAL driver and adventure 
  690. version with which they were saved - each time you add or delete 
  691. objects, rooms and other stuff in the adventure, the saved game file 
  692. format changes, and renders old saved game files unusable. To 
  693. make the task of testing a little easier, have a look at the macro 
  694. feature ("Macros" on page 65).
  695.  
  696.  
  697.  
  698.  
  699. 4    Starting on an Adventure
  700. =============================
  701.  
  702.  
  703. I won't bother you with a lot of talk about how you must plan the 
  704. contents of your adventure, have a good storyline, so on and so 
  705. forth. If you don't that's not my fault, is it? I simply assume you 
  706. HAVE a story to tell, and that you are well aware of how graphic 
  707. adventures of this kind works - if you don't, you'd better play some 
  708. first. I will then show how you can do it all using GRAAL.
  709.  
  710. I won't even go into the basic idea behind my example adventure 
  711. "Olaf Longhair", because surely you have played the demo by now!
  712.  
  713. This tutorial concentrates on everything that makes the first four 
  714. rooms in Olaf Longhair tick - because once we have that much 
  715. going, almost everything follows along the same lines (or will be 
  716. pointed out separately).
  717.  
  718. The four rooms, in order of appearance, are:
  719.  
  720. 1.   The bar, where Olaf wakes up the morning after the night 
  721.      before, and has an informative chat with the bartender.
  722.  
  723. 2.   The street outside the bar, where he bumps into a strange- 
  724.      looking guy with an even stranger-looking animal.
  725.  
  726. 3.   The harbour, where he meets a foreign captain and deals with 
  727.      a rather irritating seagull.
  728.  
  729. 4.   The shopping emporium of one Ali Harrod, Esq.
  730.  
  731.  
  732. 4.1  Starting on the graal.main File
  733. ------------------------------------
  734.  
  735. Look at the graal.main script now. To do it "the GRAAL way", 
  736.  
  737. *    Start the GRAAL Editor, which should be in the same 
  738.      directory as the example files.
  739.  
  740. *    Press right Amiga + "4" to automatically open a new window 
  741.      in the editor and load the graal.main script there.
  742.  
  743. The GRAAL Editor with graal.main loaded into window no.2
  744.  
  745. The best way to start creating a new adventure is to take a 
  746. graal.main file that works, and alter it to suit your own needs. Using 
  747. the GRAAL editor, you can also choose to create a graal.main file 
  748. template, with comments and statements showing what is 
  749. mandatory and what is not. (This method can also be used for the 
  750. other script types.)
  751.  
  752. Here are some examples of statements that can be set almost 
  753. immediately. Other ones will be dealt with once we start designing 
  754. rooms, objects and characters for the adventure.
  755.  
  756. If you use the GRAAL Editor, you can read more about each 
  757. statement if you place the cursor in the statement name 
  758. somewhere and then press the [Help] key or click the <?> button.
  759.  
  760. NAME: "Olaf Longhair Goes East"
  761.  
  762. The name of my adventure is "Olaf Longhair Goes East". (The 
  763. quotes are not there because they enclose a string or anything - I 
  764. actually want them displayed on screen when the name of the 
  765. adventure is called up by pressing the [V] key during a game!)
  766.  
  767. VERSION: Demo 2.2
  768.  
  769. The adventure version number. This is especially useful to 
  770. guarantee that you don't try to load old saved game files when 
  771. testing a newer version of the adventure.
  772.  
  773. Then follows a lot of statements dealing with the player interface 
  774. layout, and numbers setting limits for how many images, objects, 
  775. and other things GRAAL can handle in your adventure. Basically, 
  776. the size of the comand area, the number of available commands, 
  777. their positions and appearance, the layout of inventory lists, and 
  778. dialogue alternative displays can all be adjusted to suit your needs. 
  779. Read the comments in the graal.main file, that's the best way to 
  780. learn about them. Many of these statements require graphic 
  781. images to be specified and positioned - more about graphics follows 
  782. below.
  783.  
  784.  
  785. Fonts
  786. """""
  787.  
  788. Among the statements in graal.main, one thing worth a special 
  789. mention is the way GRAAL uses fonts.
  790.  
  791. The statements
  792.  
  793. MSGFONT: xen;8
  794. COMFONT: garnet;9
  795. TITLEFONT1: olaf;27
  796. TITLEFONT2: times;14
  797.  
  798. each loads a font with a certain size and stores it in memory for 
  799. later use in the game. (For more information on what font is used 
  800. where, go to the on-line reference.) 
  801.  
  802. To keep things easy to handle on the player side, we do NOT install 
  803. these fonts in the normal Workbench FONTS: drawer, but keep 
  804. them in a special FONTS drawer inside the drawer where all the 
  805. other game files reside. 
  806.  
  807. This means all fonts you wish to use in the game must be copied to 
  808. this special "game fonts" drawer in your development directory. 
  809. The only trouble is that GRAAL needs to have its fonts drawer 
  810. "prepared" with the standard Amiga FIXFONTS command in order 
  811. to be able to load the fonts.
  812.  
  813. What this means is that whenever you change the fonts in the 
  814. drawer, you should run the standard Workbench "fixfonts" 
  815. program, with the logical assign FONTS: pointing to the game fonts 
  816. drawer. You do this in a CLI shell, and the commands used should 
  817. look something like this ("DH1:" below is a hard disk drive, and 
  818. "MYADVENTURE" is the path to your development drawer on that 
  819. disk):
  820.  
  821. > assign FONTS: to DH1:MYADVENTURE/FONTS
  822. > fixfonts
  823. > assign FONTS: to SYS:FONTS
  824.  
  825. The last command re-assigns FONTS: to the Workbench FONTS 
  826. drawer.
  827.  
  828.  
  829. 4.2  The Hero - What a Character!
  830. ---------------------------------
  831.  
  832. At this point, we will not get much further without bringing the big 
  833. star, our main character, the man, Olaf Longhair himself, into play!
  834.  
  835. One of the things GRAAL makes so easy to manage is the point and 
  836. click control of the main character - in this case, Olaf. GRAAL 
  837. controls what animation sequence is the correct one to use in all 
  838. standard situations, in which direction Olaf is heading, where in a 
  839. room he can actually place his feet, and so on.
  840.  
  841. Wonderful as all this may be, it doesn't relieve you of the 
  842. responsibility for the character design - in other words, before 
  843. GRAAL can do all this wonderful stuff, you must design the main 
  844. character and the animations used for his basic movements.
  845.  
  846. Basically, what we need now are some still images and animation 
  847. cels showing Olaf in various standardised poses. For "Olaf", all 
  848. these are placed in the IFF picture file "Olaf_Original.iff", which 
  849. you should take a look at now.
  850.  
  851. What the images portray are:
  852.  
  853. *    Olaf walking towards, away, and sideways
  854.  
  855. *    Olaf's front, back, and profile when standing still
  856.  
  857. *    Olaf talking - the front, back, and profile views.
  858.  
  859. *    Olaf manipulating things - also front, back and sideways 
  860. views, but for each view also in three "height" versions - for 
  861. objects high up, far down, or "in mid-air".
  862.  
  863. As you notice, the images of Olaf in the file are neatly and evenly 
  864. spaced. This makes it easier for GRAAL to "cut out" these images 
  865. and store them in its image bank later.
  866.  
  867. Also note that there are no separate images for the right and left 
  868. profiles - to make life a little easier, and less memory consuming, 
  869. the profile images will simply be flipped by GRAAL when a 
  870. reversed view is required.
  871.  
  872. We will need more images of Olaf during the course of the game, 
  873. but since they will only be used for special occasions, they are 
  874. loaded into memory only when they are needed and erased 
  875. afterwards. So "Olaf_Original.iff" contains all the "global" images 
  876. of our main character and favourite hero.
  877.  
  878.  
  879. 4.3  Basics about Images and Bobs
  880. ---------------------------------
  881.  
  882. We are going to talk a lot about stills, cels, animations and BOBs in 
  883. this tutorial, all concepts dealing with how an image is used.
  884.  
  885. A still is any image that is static.
  886.  
  887. An animation is any image that moves, and it does so by using a 
  888. number of slightly different stills replacing each other, called 
  889. ANIMATION CELS.
  890.  
  891. BOB is short for Blitter OBject. BOBs are well-known to Amos 
  892. programmers. They are, basically, the way GRAAL displays all 
  893. graphics on screen that aren't just backdrops: Objects, animated 
  894. characters, texts, and so on. BOBs can be put into the display and 
  895. deleted again without harming the backdrop picture. To achieve 
  896. this, the system must keep track of all the little graphic bits and 
  897. pieces by assigning each one used at any time with a BOB number. 
  898. To make it easier to keep track of the images used by the BOBs, 
  899. they are stored in a BOB image bank.
  900.  
  901. Any BOB may use any image (or vice versa, depending on how you 
  902. look at the world). For example, BOB number 44 may be used to 
  903. display a flower, held in image bank position 56, in one scene. In 
  904. another room or scene, the same BOB number 44 may be used to 
  905. display a knife, which is image 78 in the bank. Confusing? Just 
  906. keep this in the back of your head until we start discussing the 
  907. script file statements!
  908.  
  909. Since re-cycling is the word of the day, there is no difference in the 
  910. image types used for different purposes - all are stored in the BOB 
  911. image bank, and you may use the same image as an animation cel 
  912. in one situation and as a still image in another.
  913.  
  914. The BOB image bank, where we store all images, must be logically 
  915. divided into three sections:
  916.  
  917. 1.   Global BOB images are those that are kept in memory at all 
  918.      times, for example all Olaf's basic movements, icons for global 
  919.      objects, and command area graphics. The number of slots used 
  920.      for these are defined with the N_GLOBALBOBS: statement. 
  921.      Make an educated guess how many of these you'll need. "Olaf" 
  922.      uses about 90.
  923.  
  924. 2.   Room BOB images are images that are only needed in a 
  925.      specific room - as soon as the game switched to a new room, all 
  926.      these images are erased from memory and replaced by the 
  927.      graphics for the new room. The number of these is defined by 
  928.      the N_ROOMBOBS: statement. When referred to in the 
  929.      scripts, their numbers are always prefixed with RBOB: 
  930.      RBOB5 means room BOB 5.
  931.  
  932. 3.   Section BOB images work the same way as room BOBs, but 
  933.      for a section (collection of connected rooms) rather than a 
  934.      single room. Their number is defined by the 
  935.      N_SECTIONBOBS: statement. When referred to in the 
  936.      scripts, their numbers are always prefixed with SBOB: 
  937.      SBOB10 means section BOB image 10.
  938.  
  939. If you make a mistake when estimating the number of each image 
  940. category here, it is not the end of the world. These numbers can be 
  941. altered at any time later on.
  942.  
  943.  
  944. 4.4  The Images in the graal.main File
  945. --------------------------------------
  946.  
  947. Back to the graal.main file now, to practice what was just preached:
  948.  
  949. N_GLOBALBOBS: 90 
  950. N_SECTIONBOBS: 30 
  951. N_ROOMBOBS: 70
  952.  
  953. This means that right now, we believe we need 50 global BOB 
  954. images, 30 for use in sections, and 70 for use in rooms. If we change 
  955. our minds later on, we can always change the numbers then.
  956.  
  957. Let's define the main character's images. The statement
  958.  
  959. CLPART: Olaf_Original.iff
  960.  
  961. tells GRAAL that following statements will grab images from the 
  962. picture file Olaf_Original.iff
  963.  
  964. BOBS: 10;11;1;1;31;47;32;0
  965.  
  966. tells GRAAL to grab 10 BOB images and store them in image slot 
  967. 11 and upwards (slots 1-10 are reserved for system use, 
  968. remember?)
  969.  
  970. In the GRAAL editor, try this:
  971.  
  972. 1.   Put the cursor on the statement name "BOBS:".
  973.  
  974. 2.   Click <Edit parameters>.
  975.  
  976. 3.   Click <Area>.
  977.  
  978. 4.   The Olaf_Original.iff file appears with ten frames showing 
  979.      which pieces of graphics will be cut out. The frames can be 
  980.      moved, resized, and re-spaced. If you were to change the new 
  981.      position with the Enter key (but don't do it now!), the 
  982.      parameters of the statement reflects the changes you made. 
  983.      See "The Editor" on page 74 for a complete description of the 
  984.      editor.
  985.  
  986. More CLPART: and BOBS: statements follow upon this first one, 
  987. until all basic images we need have been loaded into the image 
  988. bank.
  989.  
  990. If you want to use multiple controllable characters, automatic 
  991. character scaling, or make the cingle controlled character 
  992. "clickable", you have to define a CHAR: statement for it. Each 
  993. CHAR: statement defines a controllable character, and because 
  994. parameters in CHAR: also set height, width, and other properties, 
  995. the above statements may seem a little useless and out-of-date. So 
  996. they are, but bear with me - they are left in for compatibility.
  997.  
  998. In my demo adventure, I do use character scaling, so let's define 
  999. Olaf with a CHAR: statement:
  1000.  
  1001. CHAR: 1;18;11;40;1;1;37;0;22;1.2
  1002.  
  1003. 1;
  1004.  
  1005. means Olaf is character number one. There must ALWAYS be a 
  1006. character number one if CHAR: statements are used at all!
  1007.  
  1008. 18;
  1009.  
  1010. means that Olaf is object 18. We'll come back to defining objects 
  1011. later - in this case, the object definition holds some important 
  1012. information about Olaf, like which animation channel he will be 
  1013. using.
  1014.  
  1015. We will not go into details about the other parameters here - read 
  1016. all about it in the on-line reference.
  1017.  
  1018. (In older versions of GRAAL, there was no CHAR: statement, or 
  1019. indeed a character object - instead, you had separate 
  1020. CHARACTER_WIDTH:, CHARACTER_HEIGHT: and similar 
  1021. statements to set the properties now dealt with in the CHAR: 
  1022. statement.)
  1023.  
  1024. Anyway, on with it. We need to define some graphics concering 
  1025. some standard movements and still images for our hero:
  1026.  
  1027. STILL_RIGHT: 14
  1028. STILL_LEFT: //14 
  1029. STILL_BACK: 12 
  1030. STILL_FRONT: 11
  1031.  
  1032. These statements tell which still images are to be shown when Olaf 
  1033. is facing in the respective direction, doing nothing.
  1034.  
  1035. Wait a minute, what's that strange "//14" thing? Well, it's a 
  1036. convenient way of re-using graphics. Any image number prefixed 
  1037. with "//" will display the image flipped left/right, so you don't have 
  1038. to create graphics for both views. Neat, eh?
  1039.  
  1040. Anyway, on with it.
  1041.  
  1042. PAUSE_RIGHT: 13 
  1043. PAUSE_LEFT: //13 
  1044. PAUSE_BACK: 12 
  1045. PAUSE_FRONT: 11
  1046.  
  1047. These images are used when Olaf pauses after having gone in a 
  1048. certain direction. If you wish, they may be set to exactly the same 
  1049. values as the STILL_ images. However, as you see, Olaf uses image 
  1050. 13, a slightly more relaxed, forward-facing and "ready-for-input" 
  1051. pose, for the right and left poses in these statements than in the 
  1052. STILL_ statements. 
  1053.  
  1054. You don't HAVE to make the left pose the flipped-over version of 
  1055. the right pose - if you want to draw different images for each 
  1056. direction, go right ahead. Also, if there is any risk of both views of 
  1057. the same image being shown on screen at the same time, they 
  1058. should be separate images! For more info, see "Character and 
  1059. Graphics Design" on page 48.
  1060.  
  1061. So far, all we have done is specify still images. Now we enter into 
  1062. the gruesome, yet strangely attractive world of animation:
  1063.  
  1064. WALK_RIGHT: A 0,(16,6)(15,6)(14,6)(17,6) ... 
  1065. WALK_LEFT: A 0,(//16,6)(//15,6)(//14,6)(//17,6) ... 
  1066. WALK_AWAY: A 0,(29,8)(30,8)(31,8)(30,8) 
  1067. WALK_TOWARD: A 0,(26,8)(27,8)(28,8)(27,8)
  1068.  
  1069. And yes, AMOS Pro users will immediately give a cry of joy: It's 
  1070. AMAL!
  1071.  
  1072. AMAL is AMOS Pro's animation language, and GRAAL uses the 
  1073. same syntax for animations. So let's see what we have here:
  1074.  
  1075. "A 0," simply tells GRAAL to repeat the following animation 
  1076. sequence indefinitely. (Stay calm - GRAAL will handle all starting 
  1077. and stopping of standard character animations automatically.)
  1078.  
  1079. "(16,6)(15,6)(14,6)" and so on are the images and display lengths of 
  1080. each animation cel. For WALK_RIGHT, first image 16 is displayed 
  1081. for 6 frames (=screen updates), then image 15 is displayed for 6 
  1082. frames, and so on. When the end of the list is reached, the 
  1083. animation loops and starts over with image 16 again. As you see in 
  1084. the WALK_LEFT statements, flipped images are used in 
  1085. animations also - no problems. For more about animations, see 
  1086. "Designing Animations" on page 49.
  1087.  
  1088. It's quite wise to use 6 frames as the smallest time space for any 
  1089. image during background scrolling - 3 is possible and may work 
  1090. well if you have a limited number of BOBs in each scene in your 
  1091. adventure. However, if you paint on a large canvas so to speak, the 
  1092. system will have problems fitting all graphic updates into a 3 frame 
  1093. space and so the animation may become jerky. (6 isn't safe in all 
  1094. situations, but it usually works and is a good compromise.)
  1095.  
  1096. TALK_MAP: 11;A 0,(20,18)(11,12)(20,12)(11,6)(19,12)
  1097.  
  1098. Not only walking is animated and automated in GRAAL - talking 
  1099. is as well.
  1100.  
  1101. The animation to be used for speech in each situation is not 
  1102. connected to a certain direction, but rather to what image is 
  1103. displayed on screen at the time the character starts talking - The 
  1104. above statement tells us to use this animation if the character is 
  1105. facing forwards (image 11) when the speech starts.
  1106.  
  1107. As you see in graal.main, there are six TALK_MAP:s specified - all 
  1108. STILL_ and PAUSE_ images are accounted for, which indeed they 
  1109. must be for GRAAL automation of the speech to work in all 
  1110. standard situations. And you can test for flipped images, too: 
  1111. "TALK_MAP: //14; ...", for instance, checks if the image displayed is 
  1112. the flipped version of image 14.
  1113.  
  1114. HANDLE_MAP: 11;A 1,(11,12)(36,1);A 1,(11,12)(34,1);A 
  1115. 1,(11,12)(35,1)
  1116.  
  1117. Standard "manipulation" or handling of objects are specified in a 
  1118. similar manner - the animation to be used when a certain object is 
  1119. handled depends on a) the previous character image on screen and 
  1120. b) whether the object in question is placed high up, low down or in 
  1121. mid-air - an animation sequence for each possible position is 
  1122. supplied in the same statement, separated by semicolons.
  1123.  
  1124. Note that the last image in each sequence should be specified as 
  1125. shown for only ONE frame - this is because a) the character will 
  1126. stay in that position during the handling of the object anyway, and 
  1127. b) we may wish to immediately do some other graphic tricks after 
  1128. the HANDLE command has been given, such as placing an object 
  1129. in the character's out-stretched hand. Specifying too long a pause 
  1130. in these animation sequences would produce an unwanted pause in 
  1131. the flow of the script.
  1132.  
  1133. To summarise, if the character is facing forward using image 11, 
  1134. and suddenly is commanded to handle an object placed in mid-air, 
  1135. (the cup in the "Constantinoplian" bar is a concrete example), the 
  1136. middle animation sequence in the above statement, which is "A 
  1137. 1,(11,12)(34,1)", would be executed.
  1138.  
  1139. OK. That was a lot of hard work and tricky definitions to sink one's 
  1140. teeth into, but guess what? We're done! We have actually 
  1141. completed a large percentage of the animations needed for our hero, 
  1142. and can get on with designing the adventure itself!
  1143.  
  1144. The statements we have defined above will be used and executed 
  1145. time and time again throughout the adventure, and in a fully 
  1146. automated fashion, too. But you control-freaks should not worry too 
  1147. much: GRAAL contains enough script commands to enable you to 
  1148. break away from the standard poses and animations in any given 
  1149. special situation - if you are willing to take on the extra work and 
  1150. extra coding in the scripts that is required.
  1151.  
  1152.  
  1153.  
  1154.  
  1155. 5     "A Room! A Room! A Kingdom for a Room!"
  1156. =============================================
  1157.  
  1158.  
  1159. As you may gather from the heading of this chapter, we now quite 
  1160. badly need a room or other location to move about in - having our 
  1161. hero confined to a lot of abstract image and animation statements 
  1162. in the graal.main file will not make anyone happy.
  1163.  
  1164. Let's start with room number one. Although the demo adventure 
  1165. first goes through a couple of other rooms, these only make up the 
  1166. introductory animation, that is where the real action starts. 
  1167.  
  1168. Similar to how the main properties of the adventure is defined in 
  1169. graal.main, the properties of room 1 is defined in the file 1.room. 
  1170. Have a look.
  1171.  
  1172. The first statement we come across here is
  1173.  
  1174. UPDATE: 3;1
  1175.  
  1176. which sets the updating speed of the scene area. The higher the 
  1177. numbers, the slower the screen updating, and the more graphics 
  1178. GRAAL is capable to shift between updates. To keep animations 
  1179. etc. from becoming jerky, the numbers must be set high enough to 
  1180. cope with all graphics.
  1181.  
  1182. Actually, this only becomes a real problem when the background is 
  1183. scrolling, so there are two numbers. The first is only used during 
  1184. such scrolls. At all other times, the update rate is determined by the 
  1185. second number. And in this room, the first number is completely 
  1186. irrelevant, because the scene fits into the display without scrolling 
  1187. - it is exactly 320 pixels wide. For other rooms, like the harbour, 
  1188. UPDATE: is set to 6. (I have designed all of Olaf's animations to 
  1189. work with the update range set in multiples of 2 or 3.)
  1190.  
  1191. Next, there comes a
  1192.  
  1193. SECTION: 1
  1194.  
  1195. statement, indicating that this room is part of section 1, as are all 
  1196. the rooms making up Constantinople in this game.
  1197.  
  1198. Next, we need a background picture for the scene area. I prepared 
  1199. the interior of this rather primitive bar in the file "1BG.IFF" using 
  1200. the 3D modelling and rendering freeware program POV-RAY. The 
  1201. gorgeous 24-bit image that was the result was then reduced to 16 
  1202. colours, creating an image that is crude but suitably "cartoon-like" 
  1203. for the purpose.
  1204.  
  1205. The background's 16 colour registers were then moved around and 
  1206. combined with 16 standard colours used for Olaf and any other 
  1207. common BOBs and images, whereupon i remapped the colours of 
  1208. the 16-colour original in DPAINT. Now, all that remains is to tell 
  1209. GRAAL to use this picture as the backdrop. 
  1210.  
  1211. BACKDROP: 1BG.IFF
  1212.  
  1213. takes care of that.
  1214.  
  1215. The width of the backdrops may be from 320 up to 640, making for 
  1216. excellent scrolling background scenarios (as shown in the 
  1217. Constantinople main street and the Baghdad panorama, for 
  1218. instance). The height is variable, but must be the same for all 
  1219. rooms, and be set with the AREA_SIZES: statement in graal.main
  1220.  
  1221. Each time we enter a new room, Olaf must have a starting position 
  1222. and pose. This is defined by the
  1223.  
  1224. START_POS: 1;13;20;115;L;1
  1225.  
  1226. statement. This not only indicates where Olaf starts, but whether 
  1227. the background screen starts scrolled to the far left, far right or the 
  1228. middle. (In this case, it's all the same, since the scene fits within the 
  1229. screen width.)
  1230.  
  1231. Any number of starting positions may be defined for the same room 
  1232. - great for those really awkward labyrinths!
  1233.  
  1234. GRAAL is not truly 3D - nothing shown on a computer screen ever 
  1235. is - but uses a simulated 3D perspective. The bar in 1BG.IFF has a 
  1236. floor, extending from the very bottom of the scene area and a few 
  1237. lines up in the picture - if Olaf moves higher up in the picture, he is 
  1238. also going further back in the room. The effect is demonstrated 
  1239. more fully by the alley in the street outside the bar, which Olaf can 
  1240. actually "walk into". To enhance the effect, GRAAL can also scale 
  1241. the character or characters under your control automatically, so 
  1242. the further up they go, the smaller they become. (However, this is 
  1243. only done for rooms where it is needed, and only if you specifically 
  1244. ask for it.)
  1245.  
  1246. Now, in order for Olaf to stay on the floor and not start climbing the 
  1247. walls of the bar, we need some way of restricting his movement. We 
  1248. do that using statements like
  1249.  
  1250. FLOOR: 1;16;114;304;119;1-1/2-2/3-3/4-4
  1251.  
  1252. Each such statement defines a rectangular part of the picture 
  1253. where Olaf may place his feet. If there is more than one such 
  1254. rectangle, each is defined by a separate floor statement, and all 
  1255. floors must overlap with at least one other floor to enable Olaf to 
  1256. find his way from one floor to another. The last parameter, "1-1/2-
  1257. 2/3-3/4-4", describe how Olaf navigates between the four floors in 
  1258. this room. See the FLOOR: statement in the on-line reference for 
  1259. more information about this.
  1260.  
  1261. It wouldn't be much fun to have an adventure take place in only one 
  1262. room (although such a thing IS possible - how about a "closed room 
  1263. murder mystery"?). So the next statement, 
  1264.  
  1265. EXIT: 1;7;66;12;112;10;113;Exit to\street
  1266.  
  1267. defines an exit from the bar. This creates a "clickable" rectangle on 
  1268. the screen with some additional parameters describing the 
  1269. properties of the exit. We will come back to the subject of switching 
  1270. rooms further on.
  1271.  
  1272. So, now we have a background, an exit, and area to move about on, 
  1273. and much more. Time to add some special graphics to the room to 
  1274. spice things up a little.
  1275.  
  1276. CLPART: 1FG.IFF
  1277.  
  1278. is a statement telling GRAAL that we wish to grab some clipart 
  1279. from the 1FG.IFF file to use as images in this room. 
  1280.  
  1281. ROOMBOBS: ...
  1282.  
  1283. statements follow the syntax of the BOBS: statement we used in 
  1284. the graal.main file. Every image grabbed with this statement 
  1285. should later be referred to by a "room BOB image number", which 
  1286. is a number proceeded by "RBOB". For example, RBOB3 means 
  1287. room BOB image 3.
  1288.  
  1289. The images we grab as RBOBs are all used for objects and graphics 
  1290. that are unique to this room, and are not much use outside it 
  1291. (although you CAN grab clipart from the same 1FG.IFF file 
  1292. anywhere you like in the game, of course).
  1293.  
  1294. Perhaps some of the clipart we just loaded is supposed to be pasted 
  1295. into the scene without doing anything except being pretty. The 
  1296. statements STATIC: and ANIM: are used for this purpose - which 
  1297. one depends on whether the image should be static or animated. 
  1298. We have two such static objects in the bar. One is the barrel behind 
  1299. which Olaf appears. It has no other function except hiding Olaf at 
  1300. the start of the game and being a general foreground object which 
  1301. adds a bit of depth to the scene. The other is the wooden pillar, also 
  1302. placed in the foreground.
  1303.  
  1304. That is the graphics department of room 1 over and done with.
  1305.  
  1306.  
  1307.  
  1308.  
  1309. 6    The Object Matter
  1310. ======================
  1311.  
  1312.  
  1313. You could, theoretically, spring Olaf loose in the bar now, but there 
  1314. would be absolutely nothing to do - just an exit pointing to an 
  1315. undefined room, floors to move about on - and a barrel to hide 
  1316. behind! So far, there is not a single object to interact with!
  1317.  
  1318. The OBJECT: statement lets you define things that can be 
  1319. manipulated in various ways. Every piece of your scene that 
  1320. you need to hide, show, interact with, or move around, 
  1321. should be defined as an object. (For graphics that follow very 
  1322. simple, and don't move around, you may wish to use ANIM: or 
  1323. STATIC: statements, or BOBON / PBOB commands.)
  1324.  
  1325. Just as with BOB images, objects are defined in various places 
  1326. depending on where in the adventure they may appear - just in one 
  1327. room, in a section, or in the entire adventure. Sticking with the 
  1328. 1.room file for the moment, you see some
  1329.  
  1330. ROOMOBJ: ...
  1331.  
  1332. statements here. They define objects which are never removed from 
  1333. the bar, and never changed in any way: One of the barrels, the plate 
  1334. of spam that Olaf refuses to touch, and so on. Room objects are a 
  1335. great way of adding atmosphere, detail, and red herrings to a game 
  1336. without wasting computer memory - from the players' point of view, 
  1337. there is no way of telling whether an object is a room, section, or 
  1338. global object. Only you know!
  1339.  
  1340. The policy in the tutorial is to leave details to the on-line reference 
  1341. in graal.guide, but understanding the properties of an object is 
  1342. rather vital, so we will examine one of the global objects present in 
  1343. the bar closely. (The room objects are no good for this purpose, since 
  1344. their use is severely restricted.)
  1345.  
  1346. In the graal.main file, locate the line
  1347.  
  1348. OBJECT: 16;piece of\paper;8;VIS;56;RBOB6;66;119;12;0;//14;with;PICK;0;8;47;LOW;WD;an;this;it
  1349.  
  1350. In the GRAAL Editor, you get a better view of the parameters if you 
  1351. place the cursor on the word OBJECT: and then click <Edit 
  1352. Parameters> to load the object into the Edit Parameters window:
  1353.  
  1354. An object loaded into the parameter editor 
  1355. (more about that in the chapter about the GRAAL Editor).
  1356.  
  1357. This statement describes a piece of paper not actually used in the 
  1358. demo portion of the adventure, but it serves to display the 
  1359. properties of a typical object:
  1360.  
  1361. 16; 
  1362.  
  1363. means this is global object number 16.
  1364.  
  1365. piece of\paper; 
  1366.  
  1367. is the name of the object. The backslash is replaced by a line break 
  1368. when the name is shown in the scene area.
  1369.  
  1370. 8; 
  1371.  
  1372. is the room where the object first appears.
  1373.  
  1374. VIS; 
  1375.  
  1376. means the object can be seen and handled. (NVIS means 
  1377. "invisible".)
  1378.  
  1379. 56; 
  1380.  
  1381. is the BOB number (not the IMAGE number!) that will be used 
  1382. when displaying the object.
  1383.  
  1384. RBOB6; 
  1385.  
  1386. is the BOB image number which is used to display the object by 
  1387. default. This could also be an animation sequence using the same 
  1388. animation syntax as the TALK_MAP: etc. statements explained 
  1389. previously.
  1390.  
  1391. But wait a minute! We use an RBOB image, obviously grabbed in 
  1392. the 8.room file, to display a global object, which is obviously not tied 
  1393. to that one room? Isn't this strange? 
  1394.  
  1395. No, it actually makes sense. Room 8 is the only place where the 
  1396. piece of paper will actually be SHOWN in that shape - when it is 
  1397. used further on in the game, it will only be displayed using its 
  1398. inventory icon. So this is a safe use of RBOBs!
  1399.  
  1400. 66;119; 
  1401.  
  1402. is the x and y position of the RBOBs hotspot.
  1403.  
  1404. 12;0; 
  1405.  
  1406. is the "character offset". When Olaf wants to handle the piece of 
  1407. paper, he will walk to a position 14 pixels to the right and 0 pixels 
  1408. above the object's hotspot.
  1409.  
  1410. Normally, we talk about the relative positions of the character's 
  1411. and object's hotspots here. (See "All About 3D and Hotspots" on 
  1412. page 52.) However, if you prefix the x value with a "W", for example 
  1413.  
  1414.      W8;0; 
  1415.  
  1416. the x position refers to the edge of the character that is closest to 
  1417. the object instead. That technique allows for multiple characters of 
  1418. different widths more easily. However, if you only have one 
  1419. character, or they look more or less the same, don't bother.
  1420.  
  1421. //14; 
  1422.  
  1423. is the still image used to display Olaf once he has walked up to the 
  1424. object. Since the object is to the left of him, he will face it using 
  1425. image //14. And specifying the correct still image for each object is 
  1426. vital: Should Olaf begin to handle the object after walking up to it, 
  1427. the HANDLE_MAP sequence linked to image //14 will be used. 
  1428. Should he start to talk, the TALK_MAP sequence linked to the 
  1429. image will be used. But you need not worry about this, as long as 
  1430. you specify the HANDLE_MAPs, TALK_MAPs and still images 
  1431. used for object handling correctly!
  1432.  
  1433. with; 
  1434.  
  1435. is a preposition. If a preposition exists, it is assumed that this object 
  1436. can not be USEd on its own with the USE verb - it must be 
  1437. combined with something else, and so the sentence line will read 
  1438. USE PIECE OF PAPER WITH, and the system will wait for a 
  1439. second object to be clicked. If this parameter is left blank, the object 
  1440. will be used on its own.
  1441.  
  1442. PICK; 
  1443.  
  1444. indicates that the object can be picked up (the condition IFPICK 
  1445. returns TRUE). NPICK is used for the opposite.
  1446.  
  1447. Actually, you can easily override this parameter using script 
  1448. commands - picking up objects marked NPICK, and making the 
  1449. character refuse to pick up objects marked PICK. Still, this setting 
  1450. means objects which rely on the global ACTION: statements 
  1451. dealing with picking up and dropping will be handled in the right 
  1452. way.
  1453.  
  1454. Also, there is no risk in making an object pickable even if it is 
  1455. initially invisible (NVIS). If it cannot be seen, it cannot be accessed 
  1456. by the player, and thus, the PICK status becomes insignificant...
  1457.  
  1458. (ALWAYS use NPICK for room objects, unless you make sure you 
  1459. make the character drop the object again before he leaves the 
  1460. room!)
  1461.  
  1462. 0; 
  1463.  
  1464. If the object is animated using an animation command (instead of 
  1465. the single RBOB17 for this example), the animation channel must 
  1466. be specified here. The range of possible values is 2-16, and as with 
  1467. BOB numbers, the same number may not be used for two things 
  1468. simultaneously. The piece of paper is not animated, and therefore 
  1469. this parameter is 0.
  1470.  
  1471. 8; 
  1472.  
  1473. This is the object's "quick command", that is, the command issued 
  1474. when the player points to the object and clicks the right mouse 
  1475. button. Verb 8 is LOOK AT.
  1476.  
  1477. 47; 
  1478.  
  1479. This is the object icon used to show the object in the inventory: 
  1480. Global BOB image 47.
  1481.  
  1482. LOW; 
  1483.  
  1484. This is an important one for all objects which can be picked or 
  1485. handled! It determines which of the "handle animations" Olaf will 
  1486. use. Since the piece of paper is on the floor, the LOW animation will 
  1487. be used. (Always place objects, or Olaf, using the character offset 
  1488. co-ordinates so that one of the three positions can be used in a 
  1489. natural way!)
  1490.  
  1491. DW; 
  1492.  
  1493. This is an "attribute string" which can be used to determine some 
  1494. general properties for the object. "D" stands for dead object, and 
  1495. "W" for "wood". (A rather pointless attribute in this case. Basically, 
  1496. it only tells us that it is softer than stone or steel!)
  1497.  
  1498. Attributes are used to make basic responses to some actions seem 
  1499. more natural - you don't have to define separate replies to all 
  1500. objects, but can specify a general response for all cases of Olaf 
  1501. trying to use the small knife on objects made of wood, for instance. 
  1502. You may also find an "abstract" class very useful - when Olaf 
  1503. attempts to pick up the horizon, it enables you to respond with 
  1504. some really insulting remarks! (Look in the graal.main script for 
  1505. ACTION: statements containing IFTYPE tests to see how this can 
  1506. be used.)
  1507.  
  1508. GRAAL is quite flexible in many ways, and there are a number of 
  1509. GRAAL commands to alter many of the object's properties, such as 
  1510. the name, visibility, location and so forth during the course of the 
  1511. game. See the on-line reference for a complete list of commands. 
  1512. Generally speaking, the statements in the script files set things up 
  1513. - it is the commands contained in DACT:, LACT: and ACTION: 
  1514. statements executed during gameplay that brings the whole thing 
  1515. to life!
  1516.  
  1517. While we are at it, let us examine another, but more human, global 
  1518. object: The bearded man / bartender.
  1519.  
  1520. So, what is the difference between a bearded man and some sheep 
  1521. bones? Well, the bartender is animated using a default animation 
  1522. sequence, as you see. This sequence also uses RBOB images, since 
  1523. the bartender never leaves 1.room. Furthermore, the bartender can 
  1524. not be picked up (there's a relief!) and uses animation channel 
  1525. number 8 for the animation. His special attributes are "MV" - 
  1526. meaning he's a male character and alive.
  1527.  
  1528.  
  1529.  
  1530.  
  1531. 7    Section Objects and Bobs
  1532. =============================
  1533.  
  1534.  
  1535. There is a third class of objects involved in the bar scene, those 
  1536. defined in the section file 1.section with the SECTIONOBJ: 
  1537. statements. These are objects that only exist the very first time a 
  1538. new section of the game is visited, and disappear again before the 
  1539. section is exited. It is not that useful, but some of the objects in 
  1540. Constantinople is of this kind - the magic flute, for example, which 
  1541. disappears into the pawn shop before you can leave town.
  1542.  
  1543. You will probably find section BOB images (SBOBs) more useful 
  1544. than section objects. These are grabbed in the section file the same 
  1545. way RBOBs are grabbed in the room files, but with the 
  1546. SECTIONBOBS: statement. Needless to say, they remain in 
  1547. memory during the visit to the section, but disappear and are 
  1548. replaced by other graphics the moment you walk into another game 
  1549. section.
  1550.  
  1551. You are not obliged to use the section concept at all, especially if 
  1552. your adventure is quite small. However, at least one section script 
  1553. must exist, even if it just contains a comment saying "Not Used". 
  1554. Then specify all your rooms as belonging to this "empty" section.
  1555.  
  1556. Okay, we have everything in place, except one VERY important 
  1557. thing - the instructions telling Olaf to deal with the commands you 
  1558. give him!
  1559.  
  1560.  
  1561.  
  1562.  
  1563. 8    Camera! Action! Lights!
  1564. ============================
  1565.  
  1566.  
  1567. 8.1  ACTION: statements
  1568. -----------------------
  1569.  
  1570. All conditions and commands used to respond to the player's 
  1571. actions are placed in ACTION: statements (leaving the dialogues 
  1572. out of it for the moment).
  1573.  
  1574. ACTION: statements may appear in all three major types of script 
  1575. file: .room, .section and graal.main.
  1576.  
  1577. The idea is that the ACTION: statements taking care of a certain 
  1578. action is placed closest to the place where the action takes place. If 
  1579. an action can only take place in one specific room, the ACTION: 
  1580. statements for it are placed in that .room file. If the action is only 
  1581. valid in a certain section, they are placed in the .section file. If it is 
  1582. something that needs to be taken care of regardless of where it 
  1583. appears, the graal.main file is the place.
  1584.  
  1585. In fact, almost every action should have some "safety net" in the 
  1586. graal.main file - if no specific action is taken in the ACTION: 
  1587. statements of the .room and .section files, the graal.main ACTION: 
  1588. statements should at least make it look like Olaf understood what 
  1589. you were trying to do! There is nothing more unrewarding than 
  1590. clicking away at lots of things and have absolutely nothing happen.
  1591.  
  1592. Okay. So we write a lot of action statements containing commands 
  1593. that makes Olaf walk, talk, and jump! But how does GRAAL know 
  1594. when to use what actions?
  1595.  
  1596. Well, suppose we want to pick up the cup on the barrel in the bar. 
  1597. Let's look at how that is performed in GRAAL, keeping in mind that 
  1598. GRAAL always checks the .room file first, then the .section file, and 
  1599. finally, if nothing else helps, the graal.main file. Each file is checked 
  1600. from the top down to the bottom, which is very important to 
  1601. remember in order to get the sequence of tests and commands right.
  1602.  
  1603. When the player has clicked PICK UP and the CUP, GRAAL starts 
  1604. looking for appropriate ACTION: statements, knowing the number 
  1605. of the verb (PICK UP = 2) and the object (the CUP is section object 
  1606. 3, referred to as SOBJ3).
  1607.  
  1608. The first parameter in each ACTION: statement is always the verb 
  1609. number, and in 1.room, the first ACTION: 2;... statement that we 
  1610. come across is
  1611.  
  1612. ACTION: 2;IFOBJ SOBJ3;ADDRF 0,20,1
  1613.  
  1614. IFOBJ SOBJ3 tells us to perform the rest of the actions if we 
  1615. pointed to room object SOBJ3, and we did. What happens next? 
  1616. Well, 1 is added to the value of room flag 20 for room 0. More about 
  1617. flags later - suffice to say they are like variables in ordinary 
  1618. programming languages, and this particular flag is used to hold the 
  1619. player score in "Olaf". So you get one point for picking up the cup...
  1620.  
  1621. When we are done with the first ACTION: 2;... line, the next one 
  1622. reads
  1623.  
  1624. ACTION: 2;IFOBJ ROBJ6;....
  1625.  
  1626. This is not a match, because the line is only relevant if we're trying 
  1627. to pick up ROBJ6. Going through the rest of the ACTION: 2;... lines 
  1628. in 1.room, we quickly discover that there are no more line concering 
  1629. the mug there.
  1630.  
  1631. Switching to the 1.section file, let's see if we are more lucky. No, not 
  1632. a single PICK UP command, actually. This is not so surprising, 
  1633. since almost all objects start out in a certain room.
  1634.  
  1635. Well, why then wasn't there a command to really pick up the cup in 
  1636. the 1.room file? Because, with the power of GRAAL, almost all 
  1637. PICK UPs of any "pickable" object can be handled using a few 
  1638. single ACTION: statements in the graal.main file - only objects 
  1639. handled in special ways in room 1 need to have their actions in the 
  1640. 1.room file. Going on to the graal.main file, we find the following:
  1641.  
  1642. ACTION: 2;IFCARR;SAY I Already have it!;EXIT
  1643.  
  1644. IFCARR says that if the object we refer to is already in the 
  1645. inventory, then let Olaf say "I already have it!". EXIT means no 
  1646. more tests on ACTION statements will be done for our current 
  1647. input: The sentence line will be cleared and Olaf is ready to try 
  1648. something else.
  1649.  
  1650. However, SOBJ1 is NOT in our inventory yet, so we go on:
  1651.  
  1652. ACTION: 2;IFPICK;MOBJ;HANDLE;W 12;PICK;HANDLE -1;EXIT
  1653.  
  1654. Now behold the true power of the GRAAL. This is the stuff we have 
  1655. been tormenting ourselves for all along the tutorial up to this point!
  1656.  
  1657. IFPICK; 
  1658.  
  1659. If the object is "pickable"...
  1660.  
  1661. MOBJ; 
  1662.  
  1663. Olaf walks to the default offset position next to the object (as 
  1664. specified in the OBJECT: statement for the cup)...
  1665.  
  1666. HANDLE; 
  1667.  
  1668. Olaf stretches out a hand according to the HANDLE_MAP: 
  1669. animation...
  1670.  
  1671. W 12; 
  1672.  
  1673. and waits for about 1/4 of a second...
  1674.  
  1675. PICK; 
  1676.  
  1677. grabs the object (it disappears from the screen and enters the 
  1678. inventory list)...
  1679.  
  1680. HANDLE -1; 
  1681.  
  1682. lowers the hand again to the position it had before the 
  1683. HANDLE command...
  1684.  
  1685. EXIT; 
  1686.  
  1687. ...and then we are done!
  1688.  
  1689. Now, if our object hadn't been "pickable", the ACTION: used by us 
  1690. above are followed by a couple of "safety nets". (Remember, we 
  1691. never get to these lines if the object has indeed been picked up - the 
  1692. "EXIT" command sees to that.) One example of such a safety net is:
  1693.  
  1694. ACTION: 2;IFTYPE -;SAY That was rather far-fetched, wasn't it?;EXIT
  1695.  
  1696. IFTYPE -; 
  1697.  
  1698. This checks if the referred object was an abstract object, like the 
  1699. horizon in the Constantinople harbour. Since abstract objects can't 
  1700. very well be picked up under any circumstances, 
  1701.  
  1702. SAY That was rather far-fetched, wasn't it?;EXIT
  1703.  
  1704. makes Olaf "speak" this sentence using the talk-map corresponding 
  1705. to his current position on the screen.
  1706.  
  1707. And finally, if the object happens to be un-pickable, but of another 
  1708. type, 
  1709.  
  1710. ACTION: 2;SAY I can't pick that up.;EXIT
  1711.  
  1712. gives a rather dull but to-the-point message to the player. Don't go 
  1713. erasing ACTIONs in the supplied example graal.main file 
  1714. altogether the first thing you do - a lot of these "safety net" actions 
  1715. should be in almost any game, although you should of course alter 
  1716. the wording and detailed behaviour to suit your own needs!
  1717.  
  1718.  
  1719. Special ACTION: Statements
  1720. """"""""""""""""""""""""""
  1721.  
  1722. The verb numbers corresponding to normal player input goes from 
  1723. 1 and upwards. Instead of an ordinary verb number, the following 
  1724. can appear as the first parameter of an ACTION: statement:
  1725.  
  1726.  
  1727. (zero) - the verb number used for GO TO (that is, an exit has been 
  1728. clicked. See "Using Exits" on page 34).
  1729.  
  1730. -1
  1731.  
  1732. Timer events. See "Timer Events" on page 57.
  1733.  
  1734. -2
  1735.  
  1736. Things to do after a LOAD or RESUME command. See "The Load / 
  1737. Save Room." on page 58.
  1738.  
  1739. ?
  1740.  
  1741. means any normal verb number from 1 and upwards will match 
  1742. this statement. For example, you may have a room where no 
  1743. ordinary actions should be possible. All player input (except exit 
  1744. movements) could then be trapped in the room script with a single
  1745.  
  1746. ACTION: ?;EXIT
  1747.  
  1748. statement.
  1749.  
  1750. Repeating Verbs and Conditions
  1751.  
  1752. If the first parameter in an ACTION: statement reads
  1753.  
  1754. =
  1755.  
  1756. the verb number and initial conditions from the action statement 
  1757. immediately above, saving you some typing if several statements 
  1758. begin in the same way. 
  1759.  
  1760. Example:
  1761.  
  1762. ACTION: 1;IFOBJ 2;IFOBJ2 21;MOBJ 21;SAY Here you go!;...
  1763. ACTION: =;RESP R,4,Thank you very much!;EXIT
  1764.  
  1765. The second line will actually be interpreted as
  1766.  
  1767. ACTION: 1;IFOBJ2;IFOBJ2 21;RESP R,4,Thank you very much!;EXIT
  1768.  
  1769. If only some of the initial conditions should be repeated, but a blank 
  1770. space in between conditions. Here's the example once more, this 
  1771. time repeating only the first condition:
  1772.  
  1773. ACTION: 1;IFOBJ 2; ;IFOBJ2 21;MOBJ 21;SAY Here you go!;...
  1774. ACTION: =;RESP R,4,Thank you very much!;EXIT
  1775.  
  1776. Now the second line will actually read
  1777.  
  1778. ACTION: 1;IFOBJ2;RESP R,4,Thank you very much!;EXIT
  1779.  
  1780. The method can also be used to repeat the initial part of DACT: and 
  1781. LACT: statements.
  1782.  
  1783.  
  1784.  
  1785.  
  1786. 9    Using Exits
  1787. ================
  1788.  
  1789.  
  1790. Now that we are familiar with the general behaviour of ACTION 
  1791. statements, it is time to explain how exits work.
  1792.  
  1793. As you may or may not remember, the EXIT: statement in the 
  1794. 1.room file defined a "clickable" rectangle on screen. However, we 
  1795. never explained what happens when the player clicks the exit.
  1796.  
  1797. This is what happens: GRAAL interprets this as a very special 
  1798. input sentence, with the VERB set to 0 and OBJ1 set to the number 
  1799. of the exit. It then checks the ACTION statements just as if the 
  1800. player had input a normal command. This is a typical ACTION 
  1801. statement to take care of an exit command:
  1802.  
  1803. ACTION: 0;IFOBJ 1;MEXIT;CBOB 12;GOTO 2,1
  1804.  
  1805. 0; 
  1806.  
  1807. was the verb number indicating an "exit click".
  1808.  
  1809. IFOBJ 1; 
  1810.  
  1811. tests if it was exit number 1 that was clicked.
  1812.  
  1813. MEXIT; 
  1814.  
  1815. is a special command that can only be used in ACTION: 0;... 
  1816. statements. It makes the main character move to the exit point 
  1817. specified in the EXIT: statement (not to be confused with the EXIT 
  1818. *command*, which is something completely different).
  1819.  
  1820. CBOB 12
  1821.  
  1822. Perhaps we wish the character to face the door before exiting.
  1823.  
  1824. GOTO 2,1
  1825.  
  1826. is a command specifying which room and entrance to go to. Voilà!
  1827.  
  1828. Of course, you are free to do whatever you like in these statements, 
  1829. just like in any other ACTION: statement. You may manipulate the 
  1830. way exits are interpreted to your heart's content!
  1831.  
  1832.  
  1833.  
  1834.  
  1835. 10   The DACT: Statements
  1836. =========================
  1837.  
  1838.  
  1839. In each room file, there must be at least one DACT: statement. The 
  1840. DACT: statements contain conditions and commands that are run 
  1841. through each time the room is entered. The flow of control is the 
  1842. same as for ACTION: statements: If a condition is not met, the rest 
  1843. of that DACT: statement is disregarded, and if an EXIT command 
  1844. is encountered, no more DACT: lines will be checked this time 
  1845. around.
  1846.  
  1847. When GRAAL starts to run through the DACT: statements, all 
  1848. graphics and objects are already loaded into their proper places. 
  1849. However, the screen is still black - the light switch has not been 
  1850. pushed yet, so to speak. This means you can do tests and move 
  1851. things around using commands in the DACT: statements before 
  1852. you let the player see the scene, which is very, very useful. Once you 
  1853. are done preparing the scene, simply use a LIGHTS ON command 
  1854. in a DACT: statement. When an EXIT command is encountered, 
  1855. control is handed over to the player.
  1856.  
  1857.  
  1858.  
  1859.  
  1860. 11   Flags and String Variables
  1861. ===============================
  1862.  
  1863.  
  1864. In order to keep track of what is going on in your adventure, you 
  1865. need a way to store information about the player's actions. In 
  1866. GRAAL, there are two forms of variables that can be used to stora 
  1867. information: Flags and string variables.
  1868.  
  1869.  
  1870. 11.1 Flags
  1871. ----------
  1872.  
  1873. Flags can hold integer numbers. There are 20 flags for each room 
  1874. and 6 for each object. In reality, you can use any flag for any 
  1875. purpose you like, but naturally it is most logical to keep 
  1876. information regarding a certain room in that room's room flags, 
  1877. information about an object in its own object flags, and so on. Also, 
  1878. this is often most conventient - if you refer to the current room's or 
  1879. object's flags, you don't have to specify the room or object number 
  1880. in most flag-handling conditions and commands.
  1881.  
  1882. Since room 0 is never used as a location in the game, but it exists 
  1883. as a "flag space", you can use room 0 flags to hold information that 
  1884. pertains to the whole game.
  1885.  
  1886. There are commands to set, add, and subtract from flag values, and 
  1887. conditions to test the contents in many different ways. Flags can 
  1888. also be set to store in-game dates and times.
  1889.  
  1890. The flag values can also be printed in sentences by all text-
  1891. displaying commands - see the on-line reference for information 
  1892. about how to do that.
  1893.  
  1894.  
  1895. 11.2 String Variables
  1896. ---------------------
  1897.  
  1898. In addition to the flags, there are 12 "global" string variables that 
  1899. can hold text strings like the player name, or just snippets of text 
  1900. you have to repeat in several text-displaying commands. There are 
  1901. commands to set and test string variable contents, and there is also 
  1902. a PROMPT command that asks the player for input. The PROMPT 
  1903. command uses the dialogue area to display a prompt on the first 
  1904. line and a text cursor on the second line. The player then enters the 
  1905. text of his choice, and ends the input by pressing the Enter key. 
  1906. Simple as that.
  1907.  
  1908.  
  1909.  
  1910.  
  1911. 12   Having a Chat
  1912. ==================
  1913.  
  1914.  
  1915. There are few things that breathe life into a graphic adventure the 
  1916. way good dialogues do. Of course, in order to have a dialogue, you 
  1917. need to have at least two people communicating. In this case, this 
  1918. means our hero and another character in the game.
  1919.  
  1920. In the bar where the game starts, there is a bearded bartender who 
  1921. is very likely to become the first person Olaf speaks to. Let's look at 
  1922. how this is done.
  1923.  
  1924. First of all, any character involved in conversations must be 
  1925. defined as an object using an OBJECT: statement - it can be a 
  1926. global, section or room object. There is nothing special with the 
  1927. definition: Just make sure the object is visible and placed in the 
  1928. room where the dialogue takes place. Also, assign an animation 
  1929. channel to it.
  1930.  
  1931. We need a way to make each "speaking partner" talk to the player-
  1932. controlled character, which is done by defining DLG: statements in 
  1933. the graal.main file (below the OBJECT statements). Each DLG: 
  1934. statement defines a set of rules for where and how the speech is 
  1935. displayed, and an animation sequence for the speaking partner 
  1936. talking.
  1937.  
  1938. DLG: 1;5;11;-20;A 0,(RBOB4,12)(RBOB6,24)...
  1939.  
  1940. 1; 
  1941.  
  1942. means this is dialogue speech definition number one. 
  1943.  
  1944. 5; 
  1945.  
  1946. means that the appearance of the speaking partner is defined by 
  1947. global object 5 (the bartender).
  1948.  
  1949. 11; 
  1950.  
  1951. is the colour used for the text displayed when the bartender speaks.
  1952.  
  1953. 20; 
  1954.  
  1955. determines how far above the bartender's head the text is 
  1956. displayed.
  1957.  
  1958. A 0,(RBOB4,12)(RBOB6,24)....
  1959.  
  1960. is the animation used when the bartender talks.
  1961.  
  1962. Some speaking partners are probably fairly static, and then you do 
  1963. not need more than one animation for the speech. However, 
  1964. nothing prevents you from defining more than one DLG: statement 
  1965. for the same speaking partner.
  1966.  
  1967. Now that we have two statements in the graal.main file, we move on 
  1968. to the 1.room file, where the actual dialogue contents are defined.
  1969.  
  1970. A dialogue always starts when GRAAL encounters a DSET 
  1971. command in an ACTION: or DACT: statement. It then shifts into 
  1972. another mode, where the player's input is no longer a normal 
  1973. command sentence, but only the number of a dialogue alternative. 
  1974. GRAAL responds to the chosen alternative by going through LACT: 
  1975. statements that correspond to the selected alternative, and does 
  1976. not consider the ordinary ACTION: statements. Sooner or later, 
  1977. GRAAL encounters an EDLG command in one of the LACT: 
  1978. statements, which terminates the dialogue and switches the game 
  1979. back to the normal input mode.
  1980.  
  1981. Let's begin from the beginning. When the player commands TALK 
  1982. TO  BEARDED MAN, the following ACTION line is performed:
  1983.  
  1984. ACTION: 5;IFOBJ 5;IFOF 
  1985. 1=0;MOBJ;SAY Hello;RESP R,1,Hello,yourself;
  1986. DSET 1,+3,+7,+9,+11,+12;EXIT
  1987.  
  1988. 5; 
  1989.  
  1990. the verb is TALK TO - we have a match
  1991.  
  1992. IFOBJ 5; 
  1993.  
  1994. the object is the BEARDED MAN/BARTENDER - we still have a 
  1995. match
  1996.  
  1997. IFOF 1=0; 
  1998.  
  1999. Hello, what's this? It's a test of an object flag, a concept we have not 
  2000. discussed earlier. Object flags are variables attached to each object. 
  2001. There are six flags for each object, and each can have any 
  2002. numerical, integer value. By assigning values to flags and testing 
  2003. them, you can keep track of everything that has happened to an 
  2004. object - it's up to you to decide what to use the flags for. In this case, 
  2005. I have decided to use flag 1 for the bartender to see if this is the first 
  2006. time ever we talk to him. All flags are initially 0, so this test - IFOF 
  2007. 1=0 - is true in our case. Before the dialogue is ended, the flag 
  2008. values will be set to 1 to indicate that next time around, we should 
  2009. resume the conversation in a slightly different manner.
  2010.  
  2011. OK, on with it:
  2012.  
  2013. MOBJ; 
  2014.  
  2015. We move up to the bartender just like we move up to any object 
  2016. before manipulating it.
  2017.  
  2018. SAY Hello; Say "Hello".
  2019.  
  2020. RESP R,1,Hello, yourself.; 
  2021.  
  2022. This is the bartender's response. "1" means GRAAL will look up the 
  2023. statement 
  2024.  
  2025. DLG: 1;... 
  2026.  
  2027. in the graal.main file to find out how the bartender should behave 
  2028. when talking. "R" means the default bartender animation will 
  2029. resume as soon as the talking is over.
  2030.  
  2031. So far, all statements have been performed with the game still in 
  2032. the "normal" mode. Now comes the command which switches to 
  2033. dialogue mode:
  2034.  
  2035. DSET 1,+3,+7,+9,+11;12 
  2036.  
  2037. This command engages us in dialogue number one and tells 
  2038. GRAAL to add the four dialogue alternatives 3, 7, 9, 11 and 12 to 
  2039. the list of possible lines for Olaf to speak. Since this is the first 
  2040. DSET statement ever to be performed for dialogue one, they will be 
  2041. the ONLY four alternatives.
  2042.  
  2043. EXIT
  2044.  
  2045. exits the parsing of the TALK TO command, and leaves us to get on 
  2046. with the dialogue - the player now has to select a dialogue line from 
  2047. the dialogue area which has replaced the normal control area.
  2048.  
  2049. Hmm. Dialogue lines 3,7,9, 11 and 12. What are they? All the lines 
  2050. are defined by LINE statements in the 1.room file. Let us take line 
  2051. 3 as an example:
  2052.  
  2053. LINE: 1;3;What is this place?;Where did you say I was?; 
  2054.  
  2055. 1;3; 
  2056.  
  2057. means this is line 3 of dialogue 1
  2058.  
  2059. What is this place?; 
  2060.  
  2061. This is the line appearing in the dialogue command area (where the 
  2062. player can choose a line to say) when the alternative is previously 
  2063. unused.
  2064.  
  2065. Where did you say I was?; 
  2066.  
  2067. is the version that will appear if the alternative is "re-used". If this 
  2068. second version is specified as a blank space only, the first version of 
  2069. the sentence will always be used.
  2070.  
  2071. "one blank space"
  2072.  
  2073. The last semi-colon is followed by one, very important blank space, 
  2074. which tells GRAAL there are no conditions attached to this 
  2075. dialogue line.
  2076.  
  2077. To explain the concept of dialogue conditions, let's look at another 
  2078. of the initially added lines, line 7. The definition of that LINE goes:
  2079.  
  2080. LINE: 1;7;Do you know anything about the ship in the harbour?; ;IFOF 
  2081. 2=1
  2082.  
  2083. First of all, notice there is no second version of this line. The 
  2084. question will always look the same, regardless of how many times 
  2085. Olaf puts it to the poor bartender.
  2086.  
  2087. Here, there is an additional condition that determines whether this 
  2088. dialogue alternative is available to Olaf or not. Object flag 2 for the 
  2089. bartender must be set to 1, otherwise the line will not appear in the 
  2090. dialogue command area, no matter how many "DSET 1,+7" 
  2091. commands are issued. However, once a DSET 1,+7 command has 
  2092. been given, line 7 becomes a possible line: GRAAL will check object 
  2093. flag 2 for the bartender each time the dialogue is re-engaged or 
  2094. refreshed, and as soon as flag 2 becomes 1, the line will appear and 
  2095. become available for Olaf to speak.
  2096.  
  2097. If you look through the lines, you will notice that only lines 3, 11 
  2098. and 12 are unconditional. This means that if the first thing Olaf 
  2099. does is engage in conversation with the bartender, only those two 
  2100. alternatives will be visible. So what the player now sees in the 
  2101. command area is:
  2102.  
  2103. What is this place? 
  2104. My head hurts.
  2105. Could you help me, please...
  2106.  
  2107. However, if he trundles off to the harbour to look at the ship, and 
  2108. only then returns to talk to the bartender, line 7
  2109.  
  2110. Do you know anything about the ship in the harbour?
  2111.  
  2112. is also available.
  2113.  
  2114. OK, back to our poor player, currently facing the task of choosing 
  2115. a sentence to speak.
  2116.  
  2117. When the player clicks one of the alternatives, the corresponding 
  2118. line number is sent back to GRAAL. Let's assume the player clicks 
  2119. on
  2120.  
  2121. My head hurts.
  2122.  
  2123. This means the number "11" is returned. GRAAL now starts to 
  2124. search for LACT statements starting with 1;11; - there had better 
  2125. be one, or nothing will happen! Fortunately, there is:
  2126.  
  2127. LACT: 1;11;RESP R,1,That's probably because...;DSET 1,N11
  2128.  
  2129. This is a typical example of a simple response to a dialogue line. 
  2130. The bartender speaks, and then another DSET command is given. 
  2131. Because we already are in dialogue mode, this command only 
  2132. "refreshes" the dialogue - that is, makes alterations to the current 
  2133. set of valid alternatives. In this case, the adjustment is to take 
  2134. away line 11 and tell GRAAL that it should never been shown 
  2135. again. That's what "N11" means.
  2136.  
  2137. The alternative "Could you help me, please..." yields a similarly 
  2138. unusable response, so assuming Olaf hasn't been out exploring the 
  2139. town yet, he is now left with only one alternative - the line
  2140.  
  2141. What is this place?
  2142.  
  2143. The response to this one is a bit more substantial. The bartender 
  2144. makes a long response - so long, in fact, that is does not fit into 
  2145. one LACT statement with ease. Instead, there are two statements, 
  2146. performed in sequence. When using this technique, remember NOT 
  2147. to put an EXIT or DSET command at the end of the first statement, 
  2148. because that would interrupt the process and prohibit the second 
  2149. statement from being executed!
  2150.  
  2151. In the process, the bartender - if he is still named "bearded man" - 
  2152. reveals his identity. Therefore, there is a
  2153.  
  2154. NAME bartender; 
  2155.  
  2156. command, renaming object 5 "bartender" if it has not been done 
  2157. already.
  2158.  
  2159. The response ends with DSET 1,+1,+2,+5. This means that three 
  2160. more possible alternatives will be added to the set of lines available 
  2161. to Olaf, all of which are unconditional. The current alternative - 
  2162. line 3 - also remains, but now appears in its alternative form 
  2163. "Where did you say I was?". This makes the conversation a bit more 
  2164. believable, since you usually rephrase your questions when you feel 
  2165. you need to repeat them.
  2166.  
  2167. One of the added alternatives, line 1, is an "end-of-conversation" 
  2168. alternative. When Olaf says "Thank you very much", the bartender 
  2169. answers "Don't mention it.". Then, 
  2170.  
  2171. EDLG;EXIT
  2172.  
  2173. is performed, which switches the game back to normal input mode. 
  2174. As you se in the LACT statement, object flag 1 for the bartender is 
  2175. set to 1 with a SETOF (set object flag) command to indicate that if 
  2176. we TALK TO the bartender again, it is a resumed conversation - 
  2177. the initial "hellos" will be expressed a bit differently.
  2178.  
  2179.  This concludes the basic tour of the features available in GRAAL 
  2180. 1.0, but stay tuned: Below are a lot of hints and tips about how to 
  2181. use the power and special techniques of GRAAL to their full 
  2182. potential.
  2183.  
  2184.  
  2185.  
  2186.  
  2187. 13   Multiple Characters and Inventories
  2188. ========================================
  2189.  
  2190.  
  2191. In the dialogues described in the previous chapter, the "speaking 
  2192. partners" were little more than ordinary objects, animated to make 
  2193. them look and act like human beings (or wizards, hobbits, 
  2194. monsters... take your pick). 
  2195.  
  2196. You can also offer the player true control over more than one 
  2197. character. GRAAL keeps track of each character's location. There 
  2198. are also multiple inventories, so that each character may have its 
  2199. own inventory. 
  2200.  
  2201. Up to four alternate characters and four inventories can be used.
  2202.  
  2203. (The Olaf Longhair adventure demo does not use multiple 
  2204. characters. Get hold of "The GRAAL Herald, Issue 2" - 
  2205. GraalHerald2.lha - which contains a mini-demo showing off these 
  2206. and other 2.1+ features.)
  2207.  
  2208.  
  2209. 13.1 Multiple Character Graphics
  2210. --------------------------------
  2211.  
  2212. To make the multiple character feature feasible, each character 
  2213. uses the same animation patterns, sequences and default still 
  2214. images as the main (default) character. The only thing that differs 
  2215. between the characters are the image numbers being used.
  2216.  
  2217. This means that we still only need one set of "default graphics" 
  2218. statements in graal.main. In other words, the
  2219.  
  2220. STILL_...
  2221. PAUSE_...
  2222. WALK_---
  2223. HANDLE_MAP: ...
  2224. TALK_MAP: ...
  2225.  
  2226. statements are defined only for the main character, exactly the 
  2227. same way as in single-character games. Also, the CBOB command 
  2228. expects you to specify a BOB number for the main character, and 
  2229. then automatically uses the corresponding image for the currently 
  2230. controlled character instead, and the same goes for the IFCBOB 
  2231. condition.
  2232.  
  2233. All images used in these statements should have numbers close 
  2234. together so as to form a "block" of graphics in the image bank, 
  2235. describing all default poses of the main character. This block 
  2236. should be placed as low as possible in the image number series. For 
  2237. example, the main character graphics may consist of 30 images, 
  2238. which we need to store in image numbers 11 to 40. Something like 
  2239.  
  2240. /* Clipart file containing all graphics for the main character
  2241. CLPART: main_character.iff
  2242. /* The BOBS: statements below grab 3*10=30 images
  2243. BOBS: 10;11;...
  2244. BOBS: 10;21;...
  2245. BOBS: 10;31;...
  2246.  
  2247. in graal.main should take care of that.
  2248.  
  2249. Now, for each extra controllable character, an identical "graphics 
  2250. block" must be loaded in a similar way. Ideally, these blocks are 
  2251. placed directly above the main characters graphics, like this:
  2252.  
  2253. CLPART: second_character.iff
  2254. BOBS: 10;41;...
  2255. BOBS: 10;51;...
  2256. BOBS: 10;61;...
  2257.  
  2258. would place the graphics for the second character in slots 41 to 70.
  2259.  
  2260. Note: The image numbers used for alternate characters MUST be 
  2261. higher than those for the main character graphics!
  2262.  
  2263. Now, as you have already guessed, the images contained in the two 
  2264. block must match each other: If image 11 shows the main character 
  2265. facing forward, image 41 MUST show the second character facing 
  2266. forward, and so on.
  2267.  
  2268.  
  2269. 13.2 Character Objects
  2270. ----------------------
  2271.  
  2272. In normal, single-character adventures, the main character is not 
  2273. an object in itself - that is why no name appears when you move the 
  2274. mouse pointer over the main character in the scene area. However, 
  2275. when you have multiple characters each one must be defined by a 
  2276. global object before we can start to put any "character-switching 
  2277. functions" into the game.
  2278.  
  2279. First, define a global object for each character. It's nice if the main 
  2280. character is object number 1, and the second character object 2 and 
  2281. so on, but this is not at all necessary as we shall see later on.
  2282.  
  2283. You MUST abide by the following rules for the character objects:
  2284.  
  2285. *    Each one must have a unique BOB number not used for 
  2286.      anything else in the parts of the game where the character can 
  2287.      appear.
  2288.  
  2289. *    Each one must have a unique animation channel, not used for 
  2290.      anything else in the parts of the game where the character can 
  2291.      appear.
  2292.  
  2293. *    They should all be VISible.
  2294.  
  2295. *    They should all be NPICK (not "pickable").
  2296.  
  2297. Apart from this, they are defined pretty much like any other type 
  2298. of object.
  2299.  
  2300. Now, we need to tell GRAAL that there are multiple controllable 
  2301. characters in the game, and define some more properties for them 
  2302. that cannot be deduced from their respective OBJECT: definitions. 
  2303. This is done with CHAR: statements:
  2304.  
  2305. CHAR: no;object;stimg;eimg;floor;colour;height;text_offset;width;speed
  2306.  
  2307. no
  2308.  
  2309. is the character number. The main (default) character is always 
  2310. number 1, and if CHAR: statements are used at all, there MUST be 
  2311. one for character number 1!
  2312.  
  2313. object
  2314.  
  2315. This is the object number of the object defining the character, as 
  2316. discussed earlier.
  2317.  
  2318. startimage;endimage
  2319.  
  2320. These parameters define the first and last image number of the 
  2321. "image block" containing all default character graphics. 
  2322.  
  2323. startfloor
  2324.  
  2325. This one may seem a little odd. Each character's starting position 
  2326. in the game is defined by the room and x/y parameters of the 
  2327. OBJECT: statement, but we also need to know what floor in the 
  2328. room contains that point, which is a piece of information not 
  2329. available in the OBJECT: statement.
  2330.  
  2331. colour;height;text_offset;width;speed  
  2332.  
  2333. When using a only one controllable character, all these things are 
  2334. set in separate statements.
  2335.  
  2336. Examples:
  2337.  
  2338. CHAR: 1;1;11;40;2;11;40;10;20;1.2
  2339.  
  2340. Character 1 is global object 1, occupies image slots 11-40, and starts 
  2341. out on floor 2 - the room and exact position are specified in the 
  2342. object definition.
  2343.  
  2344. Furthermore, it uses text colour 11, is about 40 pixels high, has an 
  2345. extra 10 pixels above its head to the place where related text is 
  2346. displayed, is 20 pixels wide, and walks at a speed of 1.2. (This is one 
  2347. of the very few floating point numbers used in GRAAL!)
  2348.  
  2349. CHAR: 2;20;41;70;1;4;0;30;30;1.5
  2350.  
  2351. Character 2 is global object 20, occupies image slots 41-70, and 
  2352. starts out on floor 1 - once again, the room and exact position are 
  2353. specified in the object definition.
  2354.  
  2355. It uses colour 4, its height is set to 0 which makes the mouse pointer 
  2356. point to its feet, the text is displayed 30 pixels higher up than that, 
  2357. it is 30 pixels wide and uses a walking speed of 1.5.
  2358.  
  2359. Note that if your various controllable characters are of different 
  2360. heights, it is probably a very wise thing to set the height to 0 as in 
  2361. this example, otherwise offsets from objects and the mouse cursor 
  2362. will look very strange indeed.
  2363.  
  2364. Using a Character Object with a Single Character
  2365.  
  2366. Perhaps you want to manipulate your character using commands 
  2367. that requires it to be clickable in the scene area. Even if you only 
  2368. have one character in your game, you can still specify an object for 
  2369. it and connect it with a CHAR: 1;... statement. Then the mouse 
  2370. pointer will now recognise the character and display its name in the 
  2371. scene area. also, if you wish to use the automatic 3D scaling feature 
  2372. for the character, a CHAR: 1,... statement is required.
  2373.  
  2374.  
  2375. 13.3 Switching Characters
  2376. -------------------------
  2377.  
  2378. Proper BOBS:, OBJECT:, and CHAR: statements - that is all that 
  2379. is needed in your graal.main file to make your game multi-
  2380. character. However, we still need a way of switching between the 
  2381. various characters.
  2382.  
  2383. Well, here it is. Switching between characters is r-e-a-l-l-y easy - in 
  2384. fact, I can't think of a single way to make it any easier. The 
  2385. command to use is simply
  2386.  
  2387. SWITCH character
  2388.  
  2389. *    If the characters are visible in the current screen, you won't 
  2390.      see the change, apart from the fact that the next time you click 
  2391.      in the scene area, the new character moves instead of the old 
  2392.      one. 
  2393.  
  2394. *    If the characters are in different rooms, GRAAL will simply 
  2395.      jump to the room where the new character is currently located 
  2396.      - the first time you switch to a character, this is of course the 
  2397.      room and position specified in that character's OBJECT: 
  2398.      statement.
  2399.  
  2400. *    If the characters are in the same room, but the one you switch 
  2401.      to is "off camera", the scene area will scroll the character into 
  2402.      view.
  2403.  
  2404. The SWITCH command must always come last in a command 
  2405. sequence, followed by an EXIT command. 
  2406.  
  2407.  
  2408. 13.4 Inventory Switching
  2409. ------------------------
  2410.  
  2411. Now, you probably want each character to have its own inventory. 
  2412. Normally, this means the SWITCH command should be preceded 
  2413. by an inventory command:
  2414.  
  2415. INVENTORY 2,U;SWITCH 2
  2416.  
  2417. would switch to inventory 2 (and update the command area to show 
  2418. the change), and then also immediately switch to character 2. 
  2419.  
  2420. Note: The inventory switching is handled completely separately 
  2421. from the character switching, and there is no law that says 
  2422. character 1 must use inventory 1 and so forth. This is because you 
  2423. may want to switch inventory lists for other purposes than 
  2424. switching characters!
  2425.  
  2426. Another note: The default inventory is inventory 1. (There's a big 
  2427. shock for you... :)
  2428.  
  2429. To make an object start out in an inventory rather than in a room, 
  2430. you use a special form of room number in the OBJECT: statement 
  2431. room parameter. Simply type an "I" followed by the inventory 
  2432. number:
  2433.  
  2434. I2
  2435.  
  2436. will place the object in inventory 2.
  2437.  
  2438. PICK, GET, and PUT commands always work with the currently 
  2439. selected inventory. To place things in another inventory than the 
  2440. currently selected, you must use the PUT command specifying the 
  2441. inventory in a similar way to the OBJECT: statement room 
  2442. number:
  2443.  
  2444. PUT 4,U,I2
  2445.  
  2446. would move object 4 to inventory 2. The parameter "U" indicates 
  2447. that the move is made from the current inventory, since U means 
  2448. we wish to update the inventory display to show the change.
  2449.  
  2450. Technically, each inventory is a room number, calculated by 
  2451.  
  2452. 1000 - inventory number = inventory room
  2453.  
  2454. which means inventory 1 is actually room 999. This concept works 
  2455. as long as you don't have more than 990 rooms in your game, and I 
  2456. really don't think you do...
  2457.  
  2458.  
  2459. 13.5 Identifying Characters and/or Inventories
  2460. ----------------------------------------------
  2461.  
  2462. You may well wish to have some way of knowing which character is 
  2463. currently selected. There is a COMGR command that can paste an 
  2464. image anywhere in the command area (although you should take 
  2465. care not overlay the inventory list or any other areas used by the 
  2466. system, of course). Simply create a global image containing the 
  2467. name, symbol or portrait for each of the possible characters / 
  2468. inventories, then COMGR the proper one onto the command area 
  2469. when switching.
  2470.  
  2471.  
  2472. 13.6 Characters Following Characters Around...
  2473. ----------------------------------------------
  2474.  
  2475. If you have a game with two controllable characters it is very likely 
  2476. that, from time to time, you will want one of them to follow the 
  2477. other one around. As long as all movements by the currently 
  2478. controlled character is generated either by the player clicking in 
  2479. the scene area, or by the CMOVE command, this is quite simple to 
  2480. achieve. The command
  2481.  
  2482. FOLLOW character,startx,starty,followx,followy
  2483.  
  2484. will cause the specified character to follow the one under player 
  2485. control around.
  2486.  
  2487. This continues until a SWITCH command switches the control to 
  2488. another character, or you give a
  2489.  
  2490. FOLLOW OFF
  2491.  
  2492. command.
  2493.  
  2494. The parameters following the character specification deals with 
  2495. where the following character will position itself in relation to the 
  2496. current character.
  2497.  
  2498. Generally speaking, it will strive to always stop "behind" the 
  2499. controlled character.
  2500.  
  2501. startx,starty
  2502.  
  2503. After a FOLLOW command has been given, any GOTO command 
  2504. moving the controlled character to a new room will cause the 
  2505. following character to go there, too. startx specifies the number of 
  2506. pixels between the characters. It is the Left/Right/Middle 
  2507. parameter of the START_POS: statement that determines whether 
  2508. the following character will be to the left or the right of the 
  2509. controlled one. Thus, it should always be a positive number; 
  2510. GRAAL determines the actual sign. starty should normally be a 
  2511. small, negative number.
  2512.  
  2513. followx, followy
  2514.  
  2515. These number work about the same way as startx and starty, 
  2516. except they determine the offset between the characters after 
  2517. having walked around in a room. Both numbers should always be 
  2518. positive: GRAAL "knows" where to place the following character in 
  2519. most cases.
  2520.  
  2521. Note that when the controlled character goes next to a floor 
  2522. boundary, the following character probably ends up a few pixels off 
  2523. that floor, depending on your offset settings. There are two things 
  2524. to remember about this:
  2525.  
  2526. *    You may want to adjust the floor sizes in some rooms to 
  2527.      prevent the following character from "climbing the walls".
  2528.  
  2529. *    Normally, if control is switched to the following character, it 
  2530.      will be treated as if it had been placed on the same spot as the 
  2531.      previously controlled character. Normally, having a character 
  2532.      move from a spot outside the floor system results in very odd 
  2533.      movement paths, but in this special case, the slight 
  2534.      misplacement of the character will be taken care of 
  2535.      automatically. However, if a SHOW or OMOVE command has 
  2536.      been issued for the character's object between the last "follow" 
  2537.      and the switching of control to it, GRAAL expects you to 
  2538.      correctly specify the character's current floor using 
  2539.      SETFLOOR instead (once control has been switched to it).
  2540.  
  2541.  
  2542. 13.7 Helpful Conditions
  2543. -----------------------
  2544.  
  2545. To help to determine what the scene looks like, a couple of 
  2546. conditions have been added primarily for multiple character 
  2547. games:
  2548.  
  2549. IFCHAR character
  2550.  
  2551. is TRUE if the current character under player control is the 
  2552. specified character.
  2553.  
  2554. IFHERE object
  2555.  
  2556. is TRUE if the specified object is in the room. Note that the 
  2557. parameter is the object number and not the character number - 
  2558. because this may also come in handy for other objects apart from 
  2559. characters.
  2560.  
  2561.  
  2562. 13.8 Things to Consider
  2563. -----------------------
  2564.  
  2565. Unfortunately, there is no collision detection between characters. 
  2566. From time to time, they will seem to "walk through" each other on 
  2567. screen. The only thing you can do about it is try to minimize the 
  2568. problem by carefully thinking about character placements and floor 
  2569. layouts.
  2570.  
  2571.  
  2572. 13.9 Space-saving Tip
  2573. ---------------------
  2574.  
  2575. If you have a need for different controllable characters in different 
  2576. sections of the game, you can save a lot of chip memory by letting 
  2577. them share the same space in the image bank. Just put CLPART 
  2578. and BOBS commands in the appropriate section files (and also in 
  2579. ACTION: -2 statements to make sure the correct set is loaded after 
  2580. loading a saved game).
  2581.  
  2582.  
  2583.  
  2584.  
  2585. 14   Character and Graphics Design 
  2586. ==================================
  2587.  
  2588.  
  2589. Well, fellow adventurer, by now you are a proficient GRAAL user. 
  2590. I hope. Anyway, welcome to the first master class, where we will 
  2591. look at some of the central GRAAL concepts a bit more closely.
  2592.  
  2593. This chapter deals with designing your main character and 
  2594. planning your graphics, something that must be done with some 
  2595. thought and consideration - although small adjustments are easy to 
  2596. make at any stage during the game development, things like the 
  2597. character size influence every other piece of graphics you create, so 
  2598. beware!
  2599.  
  2600.  
  2601. 14.1 Size
  2602. ---------
  2603.  
  2604. Get a suitable character size, keeping the backgrounds in mind - 
  2605. they are 120 pixels high, and in lowres, so you must use lowres 
  2606. when designing too - otherwise your hero will look rather fat on the 
  2607. screen! I should think a character between 40 and 60 pixels high 
  2608. would be about right. Below 40 and there is not much room for 
  2609. detail at all, more than 60 and the scenes start to feel cramped 
  2610. because the character takes up too much space. Also, bigger 
  2611. graphics takes more processing power.    In addition, the more pixels 
  2612. you have to animate, the more chances you have of making a bad 
  2613. job of it! Really, I am not kidding. Small can be beautiful 
  2614. sometimes.
  2615.  
  2616. Naturally, how you want the backdrops to relate to the main 
  2617. character is also a factor - is he a small guy in a big, cruel world, or 
  2618. an ace detective always moving around in cramped Victorian 
  2619. tunnels and Baker Street studies?
  2620.  
  2621.  
  2622. 14.2 Colour
  2623. -----------
  2624.  
  2625. Use only some of the available colours for your character, and make 
  2626. it a good spread of useful colours, because these colours will have to 
  2627. be the same in all scenes!
  2628.  
  2629. Colours not used for portrayal of the main character, or frequently 
  2630. occurring objects, can change according to the current scene - the 
  2631. more colours you have left to play with, the more variation you can 
  2632. bring to the backdrops.
  2633.  
  2634. Note: The first three colours more or less have to be as follows: 
  2635. Colour 0 should always be used ONLY for transparent areas in 
  2636. BOB images. Colour 1 SHOULD be a rather bright white, colour 2 
  2637. MUST be black!!
  2638.  
  2639. Here's a tip: When working with a background or clip-art picture in 
  2640. a paint program, set colour 0 to something strange to distinguish it 
  2641. from "usable" colours, but always set it back to black before saving, 
  2642. or the borders around the adventure scenes when running the 
  2643. adventure may become coloured in ways that we don't want! If you 
  2644. don't follow this advice, you surely will make the mistake of using 
  2645. colour 0 as the black colour in spots of the graphics, whereas it will 
  2646. be transparent when used in the game - and vice versa!
  2647.  
  2648. Note: Despite the fact that you should only use some colours for the 
  2649. character, always create the graphics with a palette using the same 
  2650. number of colours as your backdrop pictures.
  2651.  
  2652.  
  2653. 14.3 Pointer Shapes and Colours
  2654. -------------------------------
  2655.  
  2656. The shape of the two mouse pointers used in GRAAL can be 
  2657. changed in graal.main by using the ARROW_CURSOR: and 
  2658. CROSSHAIR_CURSOR: statements.
  2659.  
  2660. The new pointer shapes are simply images stored in the image 
  2661. bank like any other, but they have some special properties:
  2662.  
  2663. *    They must be four colours only, and colour 0 is transparent.
  2664.  
  2665. *    Colours 1, 2, and 3 of the pointer shape will be mapped to 
  2666.      colours 17, 18, and 19 of the backdrop palette. If you want the 
  2667.      pointer to always have the same colours in the scene area, 
  2668.      these colours must be the same for all backdrop pictures. 
  2669.  
  2670. If there was a way to alter these palette numbers I would, but there 
  2671. isn't, so I can't. So there. This means that you may want to plan 
  2672. ahead and decide the following colours for all scene are graphics, 
  2673. once and for all:
  2674.  
  2675. 0    Black (transparent. Do NOT use this for the black parts of the 
  2676.      backdrop itself!)
  2677.  
  2678. 1    White
  2679.  
  2680. 2    Black (Use THIS for the black parts of the backdrop picture!)
  2681.  
  2682. 17   Pointer colour 1
  2683.  
  2684. 18   Pointer colour 2
  2685.  
  2686. 19   Pointer colour 3
  2687.  
  2688.  
  2689. 14.4 Designing Animations
  2690. -------------------------
  2691.  
  2692. The following poses must be designed for the main character:
  2693.  
  2694. *    The stills to use for front, back and "sideways facing left" still 
  2695.      poses.
  2696.  
  2697. *    The animations for walking towards, away, and sideways right 
  2698.      to left.
  2699.  
  2700. *    The animations for talking corresponding to the front, back 
  2701.      and side stills. (Open and close the mouth in different ways, 
  2702.      move the head slightly, etc.)
  2703.  
  2704. *    The animations or stills used for handling objects (picking up, 
  2705.      handing over, etc.), also corresponding to the three "main 
  2706.      stills" previously mentioned, but in three different heights for 
  2707.      each still - High, Middle and Low, depending on whether the 
  2708.      object is located on the floor, high up or on a table or 
  2709.      something else in "mid air".
  2710.  
  2711. The reason you don't have to make separate animations and images 
  2712. for right and left is that you can mirror one image to point in the 
  2713. other direction using a simple trick described further on. This saves 
  2714. memory as well as time spent in paint programs!
  2715.  
  2716. To get the animation smooth, it should be designed to work with 
  2717. frame updating taking place every 6th vertical blank. This may 
  2718. sound like nonsense to you, but what it means is that you can 
  2719. switch the animation cel every six 50ths of a second, which equals 
  2720. six frames displayed on a PAL TV system (or 60ths of a second on 
  2721. an NTSC system).
  2722.  
  2723. Actually, too many animation cels for a certain movement may not 
  2724. necessarily add that much to the game anyway. Olaf uses only 5 
  2725. cels for a basic walking movement, each cel being shown for 6 50ths 
  2726. of a second.
  2727.  
  2728. So, now you should have you basic animations designed. Good. 
  2729. First, test them against some different backdrops that you think 
  2730. will be representative for the game in your excellent paint program.
  2731.  
  2732. Then, satisfied that your character basically looks OK, you should 
  2733. now design a "dummy room" in GRAAL, place some "dummy 
  2734. objects" in that room that will force your character to use all his 
  2735. newly learned physical skills. Then, give him a good work-out.
  2736.  
  2737.  
  2738. 14.5 Complex animation patterns
  2739. -------------------------------
  2740.  
  2741. Some times, we may need more complex animations for an object or 
  2742. character. For example, the captain in room 3 of the Olaf demo 
  2743. walks back and forth aboard his ship, bends down to fix things, and 
  2744. occasionally, also loses his hat! The AMAL animation language 
  2745. used by GRAAL allows us to achieve this, but the code needed is 
  2746. longer than will comfortably fit into a statement line in GRAAL. 
  2747. Therefore, ANIM:, OMOVE:, SHOW:, and OBJECT: statements all 
  2748. accept animation pattern specifications that look like this:
  2749.  
  2750. ...PTRN n...
  2751.  
  2752. which tells GRAAL to go look for the animation code in a file called 
  2753. n.ptrn. Here is part of the pattern file for the captain's movements 
  2754. as described above:
  2755.  
  2756. /* The captain's standard movements for room 3
  2757. /*
  2758. S:
  2759. A 15,(RBOB6,6)(RBOB5,6)(RBOB4,6)(RBOB7,6)(RBOB8,6)(RBOB7,6)(RBOB4,6)(RBOB5,6)
  2760. M 20,0,70 M 20,10,150 M 98,-6,200
  2761. A 1,(RBOB4,100)
  2762. M 0,0,100
  2763. A 3,(RBOB9,72)(RBOB10,128)
  2764. M 6,0,1
  2765. M 0,0,499
  2766. A 1,(RBOB4,50)
  2767. M -6,0,1
  2768. M 0,0,49
  2769. A 15,(//RBOB6,6)(//RBOB5,6)(//RBOB4,6)(//RBOB7,6)(//RBOB8,6)(//RBOB7,6)(//RBOB4,6)...
  2770. ...
  2771. A 1,(//RBOB4,500)
  2772. M 6,0,1
  2773. M 0,0,499
  2774. J S
  2775.  
  2776. The pattern contains three things:
  2777.  
  2778. *    Labels and jumps to labels
  2779.  
  2780. *    Animation commands (A...)
  2781.  
  2782. *    Movement commands (M...)
  2783.  
  2784. S: is simply a label allowing us to repeat the entire sequence of 
  2785. commands indefinitely by jumping back to the S: label from the 
  2786. very end of the commands sequence with the J(ump to) S command.
  2787.  
  2788. The rest of the script is made up of "blocks" where we first specify 
  2789. an animation sequence, and how many times it should be repeated, 
  2790. and then one or more movement commands that decide how the 
  2791. object is to be moved during that animation.  
  2792.  
  2793. In the M(ove) commands, the first number is the number of pixels 
  2794. to move left or right (negative numbers = left), the second is the 
  2795. number of pixels to move up or down (negative numbers = up), and 
  2796. the third is the number of frames the movement should take. Note 
  2797. that only the M(ove) commands control the timing of the program. 
  2798. If one or move M(ove) commands before the A(nimation) command 
  2799. has run out of frames to display, the program still moves on to the 
  2800. next A(nimation) command. This means that:
  2801.  
  2802. In most cases, the total number of frames that the A(nimation) 
  2803. command takes should match the number of frames the 
  2804. corresponding M(ove) command(s) will take. 
  2805.  
  2806. This way, the entire animation will keep in sync.
  2807.  
  2808. To specify a "still image" in the middle of the pattern, do like this:
  2809.  
  2810. A 1,(RBOB4,100)
  2811. M 0,0,100
  2812.  
  2813. Here, RBOB4 is shown for a hundred frames, and during that time, 
  2814. the M 0,0,100 command keeps it still, because it is told to move 
  2815. nowhere (0,0).
  2816.  
  2817.  
  2818. 14.6 Flipped images
  2819. -------------------
  2820.  
  2821. As discussed in the section on image definitions in the graal.main 
  2822. file, you can easily "flip" an image left/right by prefixing the 
  2823. number with two slashes ( // ). However, there is a catch: You 
  2824. cannot safely use both the normal and the flipped image on screen 
  2825. at the same time - unpredictable results will occur if you do so!
  2826.  
  2827. The rule is, if you run the risk of having the same image in both the 
  2828. original and the flipped version on screen at the same time, you 
  2829. have to make the flipped version into a proper image in the image 
  2830. bank, with its own image number.
  2831.  
  2832.  
  2833. 14.7 All About 3D and Hotspots
  2834. ------------------------------
  2835.  
  2836. GRAAL rooms are usually displayed in a "simulated 3D" 
  2837. perspective (although top-down views can be achieved). This 
  2838. basically means that the things slightly higher up the picture seem 
  2839. "further away" than the things towards the lower end of the 
  2840. picture. Take the harbour in "Olaf" as an example: When Olaf 
  2841. walks towards the water and the edge of the quay, he's actually 
  2842. only moving a number of pixels up the screen - there is no such 
  2843. thing as "away", because the screen can never really be anything 
  2844. but 2D.
  2845.  
  2846. This simple fact allows us to play with foreground and background 
  2847. objects. Anything placed towards the bottom of the screen will, 
  2848. generally speaking, be "in front". I'm talking about objects as well 
  2849. as STATIC: and ANIM: images now, mind you - everything drawn 
  2850. directly onto the background picture will naturally always be part 
  2851. of the background!
  2852.  
  2853. So, as a rule anything lower down goes "in front" of anything 
  2854. further up, but that's not necessarily the way we want people to 
  2855. perceive things - take the mug on top of the barrel in the bar, for 
  2856. instance. Looking only at the placement of the images of the mug 
  2857. and the barrel, the mug should logically be partly hidden by the 
  2858. barrel, because it is further up the picture. It's not. Instead, it looks 
  2859. like it is placed ON the barrel, which is what we want. Also, when 
  2860. Olaf walks behind the barrel, he must also walk behind the mug - 
  2861. if the mug is on the barrel but Olaf seems to be walking in front of 
  2862. the mug but behind the barrel, everything becomes hideously 
  2863. unrealistic.
  2864.  
  2865. The answer to this problem? It's simply a matter of setting each 
  2866. image's hotspot correctly. The hotspot is the point of each image 
  2867. that will actually be placed at the x and y coordinate specified when 
  2868. displaying the image.
  2869.  
  2870. Each image has its own hotspot, and it is normally set when the 
  2871. image is loaded with a ...BOBS: statement (the last parameter - 
  2872. look it up in the reference). The GRAAL default is to place the 
  2873. hotspot at the middle of the bottom edge of the image - you might 
  2874. say at the "foot" of the image. This is normally very appropriate, 
  2875. especially so for people and living objects. But you can place the 
  2876. hotspot anywhere you like - if you specify a value other than the 
  2877. default, the hotspot will be offset in the y direction that number of 
  2878. pixels from the top edge of the image. Both negative and positive 
  2879. values are allowed.
  2880.  
  2881. Study the ROOMBOBS: statement for the mug image in room one, 
  2882. compare that to the mug's x and y position in the OBJECT: 
  2883. statement in graal.main, and you will see that the hotspot is placed 
  2884. well below the actual image, making it the "frontmost" object in the 
  2885. bar.
  2886.  
  2887. The hotspot of an image can also be altered using the HOTSP 
  2888. command - this is used in some cutscenes dealing with the ship in 
  2889. the harbour, to switch the depth-placing of the sail. This is because 
  2890. the captain first walks behind the sail, but when summoned 
  2891. ashore, he suddenly has to go in front of it! The solution? Just alter 
  2892. the sail's hotspot...!
  2893.  
  2894.  
  2895. 14.8 Scaling the Characters
  2896. ---------------------------
  2897.  
  2898. Starting with GRAAL 2.2, the characters under player control can 
  2899. be automatically scaled to match the simulated 3D perspective in 
  2900. your backdrop. (You should only use this in rooms where you really 
  2901. need it, because the scaled images never look as good as the 
  2902. original-sized ones.) It is demonstrated in room 2 of the demo 
  2903. adventure, where Olaf gets a lot smaller when walking into the 
  2904. alley.
  2905.  
  2906. To begin with, the 3D scaling process relies on the information 
  2907. about graphics stored in the CHAR: statements in graal.main. So 
  2908. even if you only have one controllable character, you have 
  2909. to create a global object and a CHAR: statement for it, as 
  2910. discussed in "Multiple Characters and Inventories" on page 42.
  2911.  
  2912. After that, the process is a simple one: At the very start of a room 
  2913. script, put a
  2914.  
  2915. 3D: 
  2916.  
  2917. statement. (See the on-line reference for details).
  2918.  
  2919. Each parameter in the 3D: statement defines a vertical line on 
  2920. screen, and above each line, the character will be a little smaller 
  2921. than below it. If the character is below the first line, it will retain 
  2922. its original size as drawn by you. If the character is above the last 
  2923. line, it is at its minimum size (25%, that is, half the height an half 
  2924. the width).
  2925.  
  2926. The 3D scaling works with the SAY, MOBJ, HANDLE, CMOVE, 
  2927. CBOB and CPOS commands, and the IFCBOB condition. This 
  2928. means you shouldn't use OMOVE or SHOW to move or animate 
  2929. controllable characters, unless you know exactly where in the room 
  2930. the animations will be used and can make them according to that 
  2931. size. If you handle more than one controllable character in the same 
  2932. room, you probably need to use the SWITCH command a lot so you 
  2933. can animate each character with the above commands rather than 
  2934. relying on OMOVE and SHOW.
  2935.  
  2936. By setting some of the "scaling lines" outside the scene area, you 
  2937. can force GRAAL to only use one or two of the scaled sizes. I have 
  2938. used this in 7.room, where Olaf is only shown in the minimum size, 
  2939. because all the scaling lines are put below the displayed scene area.
  2940.  
  2941. Note 1: If you use the BOBS command to load a new set of global 
  2942. images that make up the graphics for one of your characters, you 
  2943. will have to issue the MAKE3D command afterwards to recreate 
  2944. the scaled versions of the images as well.
  2945.  
  2946. Note 2: If you use the FOLLOW command (see "Characters 
  2947. Following Characters Around..." on page 46), take care to lay out 
  2948. floors and paths so that the following character always ends up the 
  2949. same size as the controlled character. Otherwise, it usually looks 
  2950. plain ugly.
  2951.  
  2952.  
  2953.  
  2954.  
  2955. 15   Cutscenes
  2956. ==============
  2957.  
  2958.  
  2959. CUTSCENES are simply script files (suffixed with .scene) that 
  2960. contain nothing but commands. That's right - no conditions, and no 
  2961. statements! This means lines should NOT start with ACTION: or 
  2962. anything like that - just fire away with the command name in 
  2963. column one of each line! You can include several commands on the 
  2964. same line just like in ACTION: statements as long as you separate 
  2965. them with semi-colons.
  2966.  
  2967. Depending on the command used to start the cutscene, the 
  2968. command area either disappears completely, has a special "cut-
  2969. scene icon" overlaying part of it, or remains totally unaffected 
  2970. (although still unusable until the cutscene has ended). You may use 
  2971. this to alter the degree of "movie-feel" the cutscene invokes. 
  2972. Cutscenes that are so short that the player hardly notices anything 
  2973. special happening control-wise should NOT mess with the display 
  2974. of the command area.
  2975.  
  2976. The immense usefulness of cutscenes may not be apparent at first, 
  2977. but you will soon find out that you use quite a lot of them - because 
  2978. in addition to being used for "movie scenes", they are also very 
  2979. handy whenever you have a sequence of GRAAL commands that 
  2980. you need to use in a lot of different places. In these cases, cutscenes 
  2981. can act the way procedures or subroutines do in ordinary 
  2982. programming languages. In those cases, you must make sure the 
  2983. entire cutscene is executed, and you probably don't want to show 
  2984. the cutscene indicator to the player. It's easy enough - just read on!
  2985.  
  2986. The logic of cutscenes ought to be a fairly simple subject, since there 
  2987. are no conditions allowed in them. In practice, two things require 
  2988. you to think very carefully about designing your cutscenes: The 
  2989. "skip" function (pressing the [Esc] key to jump past a cutscene) and 
  2990. nested cutscenes.
  2991.  
  2992.  
  2993. 15.1 Hop, Skip and Jump
  2994. -----------------------
  2995.  
  2996. Normally, a cutscene consists of two parts: The main part at the 
  2997. top, always containing ALL the actions in the scene, and the FINAL 
  2998. section at the end.
  2999.  
  3000. The FINAL section is ONLY used if the [Esc] key was pressed 
  3001. during execution of the main part. It must duplicate all statements 
  3002. necessary to set the scene exactly the same way it would have been 
  3003. set if the main part had been run through completely. Remember, 
  3004. you never know exactly where in the flow of the main part the 
  3005. player decides to press [Esc] and breaks out of the action!
  3006.  
  3007.  
  3008. 15.2 No Breaks!
  3009. ---------------
  3010.  
  3011. In some circumstances, for example when you use cutscenes as 
  3012. "subroutines" as discussed above, you may not want the skip option 
  3013. to be in effect. In this case, start the entire cutscene with the 
  3014. cutscene command NOBREAK, which disables the [Esc] key for the 
  3015. duration of the cutscene. If a cutscene starts with NOBREAK, you 
  3016. don't need a FINAL section in it.
  3017.  
  3018.  
  3019. 15.3 Nesting
  3020. ------------
  3021.  
  3022. Now, to complicate things even further, cutscenes may be nested in 
  3023. up to three levels - that is, you can execute a cutscene within a 
  3024. cutscene from within a cutscene!
  3025.  
  3026. "Why on earth would I want to do that?" you ask. Well, a good 
  3027. example is the harbour scene in room 3 of "Olaf". There are a 
  3028. number of occasions when Olaf needs to interact with the captain, 
  3029. calling him ashore time and time again. The captain's going ashore 
  3030. and aboard can not be handled as simple PTRN sequences, because 
  3031. he, the ship itself, and the sail need to be rearranged in various 
  3032. ways to make the captain go behind the sail, in front of the sail but 
  3033. behind the gangplank, etc.
  3034.  
  3035. Therefore, the captain going ashore is played using one cutscene, 
  3036. the going aboard in another (well, actually two, depending on 
  3037. whether his hat is secured with the rubber band or not). These 
  3038. cutscenes are then used from within, or in conjunction with, a 
  3039. number of others specifying what is going on when the captain 
  3040. comes ashore to talk to Olaf.
  3041.  
  3042. Let us call the first cutscene the "master scene" and those called 
  3043. from within that "sub-scenes". Now, what we have to watch out for 
  3044. is this:
  3045.  
  3046. If we press [Esc] at the very beginning of the master scene, or 
  3047. indeed anywhere before the last sub-scene, this means some of the 
  3048. sub-scenes will not come into play at all. However, the contents in 
  3049. each sub-scene may affect how the game should be set up at the end 
  3050. of the master scene.
  3051.  
  3052. To conclusion is that the FINAL section of the master scene also 
  3053. must include all statements that are present in the FINAL sections 
  3054. of the relevant sub-scenes. Let's look at Olaf and the captain again, 
  3055. when Olaf tries to use the dictionary on the captain and gets it all 
  3056. wrong. This is depicted in CUTSCENE 13 structured like this:
  3057.  
  3058. 1.   First, CUTSCENE 2 is called as a sub-scene to make the 
  3059.      captain come ashore.
  3060.  
  3061.      Note: Sub-scenes should always be called with parameter ,F or 
  3062.      ,NF to stop the cutscene indicator symbol flickering on the 
  3063.      screen. The master scene should be called with parameter ,S 
  3064.      or N because when it's finished, the whole scene is finished.
  3065.  
  3066. 2.   Then, Olaf tries to speak hindi or something like that, fails 
  3067.      miserably, and is knocked down.
  3068.  
  3069. 3.   While Olaf is still on the ground recovering, CUTSCENE 3 is 
  3070.      invoked to put the captain back aboard the ship.
  3071.  
  3072. 4.   Once the captain is back aboard, Olaf gets up and notes that 
  3073.      the whole endeavour wasn't particularly successful.
  3074.  
  3075. 5.   The FINAL section of the master scene CUTSCENE 13 then 
  3076.      needs to contain the following: The commands from the FINAL 
  3077.      section of CUTSCENE 3, because those make sure the captain 
  3078.      is back in place aboard the ship, and some commands to put 
  3079.      Olaf back on his feet in the right position. We do NOT have to 
  3080.      bother about anything in CUTSCENE 2, because the captain's 
  3081.      coming ashore does not have anything to do with how things 
  3082.      look after the master scene is finished.
  3083.  
  3084.  
  3085. 16   Timer Events
  3086. -----------------
  3087.  
  3088. GRAAL contains a number of functions that can make things 
  3089. happen at regular or irregular intervals more or less independent 
  3090. of the movements of your controlled character.
  3091.  
  3092. First, you use a DOAFTER command to set one of three "timer 
  3093. devices" to go off after a certain period of time (and this can also be 
  3094. a random amount).
  3095.  
  3096. Next, you specify a number of ACTION: -1;... statements, because 
  3097. each time a timer reaches zero, it goes through the list of ACTION: 
  3098. -1;... statements to see if it should do anything. (Each timer - there 
  3099. can be up to three running at the same time - uses its own "fake 
  3100. object number", so you can use IFOBJ conditions to see what 
  3101. statements belong to which timer if you have several running 
  3102. simultaneously.)
  3103.  
  3104. The timer will go on repeating itself, until you issue a CANCEL 
  3105. command for it. If you want the time between the timer events to 
  3106. change continuously, you should end each ACTION: -1,... command 
  3107. sequence with another DOAFTER for the same timer, specifying 
  3108. another random interval.
  3109.  
  3110. The timer device called "0" is a little special. It doesn't check the 
  3111. time elapsed since the DOAFTER command, but rather how long 
  3112. the player has been inactive. You can use this to trigger "stall 
  3113. anims" (like the one in "Simon the Sorcerer", where Simon puts on 
  3114. his headphones when nothing happens).
  3115.  
  3116. Normally, the cursor will flicker during execution of the ACTION: 
  3117. -1;... statements, because as always the player can't do anything 
  3118. while a command sequence is being executed. However, if the timer 
  3119. events are performed very quickly, you can use a TCURS OFF 
  3120. command to stop the cursor from disappearing.
  3121.  
  3122. One of the uses for a timer is the concept of in-game date and time. 
  3123. GRAAL contains a number of commands and layout statements to 
  3124. set, advance, check, and automatically display the date and time, 
  3125. even on an analogue clock face with hands for the hours and 
  3126. minutes. (These things are displayed in special, reserved sections 
  3127. of the command area.)
  3128.  
  3129. There is more on each of these subjects in the command 
  3130. descriptions in the on-line reference.
  3131.  
  3132.  
  3133.  
  3134.  
  3135. 17   Special Techniques or "How The Heck Did He Do That?" 
  3136. =========================================================
  3137.  
  3138.  
  3139. This is a walk-through of some of the particularly clever stuff in the 
  3140. Olaf script files. I hope this proves that I have tried not only to solve 
  3141. a limited set of specific problems when writing GRAAL, but 
  3142. provided a set of commands that are flexible enough to allow even 
  3143. the nearly impossible to be done without an endless array of 
  3144. "novelty gadgets".
  3145.  
  3146.  
  3147. 17.1 The Load / Save Room.
  3148. --------------------------
  3149.  
  3150. GRAAL has some dull, built-in requesters for saving, loading and 
  3151. quitting games, but the demo adventure shows how you can 
  3152. customize these features using a special room.
  3153.  
  3154. The room is called by clicking verb 10, which is represented on 
  3155. screen by a diskette icon. Because the load/save room should be 
  3156. available everywhere, the code for jumping to it is in an
  3157.  
  3158. ACTION: 10;...
  3159.  
  3160. statement in graal.main, containing the following:
  3161.  
  3162. *    We set a flag to remind ourselves about the missing command 
  3163.      area - see below.
  3164.      
  3165. *    Next, we need to issue a MARK command - this is absolutely 
  3166.      essential. Not only do we need it to get back to the same place 
  3167.      when backing out from the load/save room, but we actually use 
  3168.      the MARKed data when saving the game! (We can't just SAVE 
  3169.      directly in the load/save room, because then we would save - 
  3170.      the load/save room position!)
  3171.  
  3172. *    The next one may seem a little odd: We issue an EDLG 
  3173.      command. This is because from GRAAL 2.2, you can call load/
  3174.      save routines from within a dialogue, and if we were in 
  3175.      dialogue mode, we need to get out of it in order to access the 
  3176.      buttons and stuff in the load/save room. (When you load a 
  3177.      saved game, the correct mode is automatically switched on 
  3178.      again.) 
  3179.  
  3180. *    Because we will not need the command area in the load/save 
  3181.      room, we hide it with a COMAREA OFF command. 
  3182.  
  3183. *    After all of this, we jump to room 40, which is the load/save 
  3184.      room. Study the code to see how IFNOTSAVEDISK is used to 
  3185.      ensure we have a place to save the game, and how IFEXISTS 
  3186.      is used to check for existing, saved games and to alter the 
  3187.      appearance of the save/load buttons and game slots according 
  3188.      to what's available at each moment.
  3189.  
  3190. Now, if we back out from the load/save room, we'd like the 
  3191. command area back in place, thank you very much. Well, the 
  3192. "backing out" is handled by either a LOAD or a RESUME 
  3193. command, and both makes GRAAL look through the ACTION: -2... 
  3194. statements. So, all we have to do is have such a statement checking 
  3195. the flag we set earlier, and issue a COMAREA ON command to put 
  3196. the command area back where it belongs. (In Olaf, some rooms 
  3197. don't use the command area at all, so we also have an extra flag, set 
  3198. in each room, to test if we should do a COMAREA ON or not when 
  3199. loading a saved game.)
  3200.  
  3201. Note: If you have designed your own save/load/quit functions, you 
  3202. could disable the ordinary short-cut keys for the standard 
  3203. requesters in the finished version of the game. You do this by 
  3204. putting a couple of DISABLE_... statements in the graal.main 
  3205. script. Or, you could define your own save/load commands, pointing 
  3206. to your newly designed room, and map the standard short-cut keys 
  3207. (S/L/Q) to these commands. You do not necessarily have to put the 
  3208. "clickable areas" for these commands inside the command area 
  3209. visible to the player - if you put the areas off the screen with some 
  3210. coordinates like 500;500;501;501, you force the player to use the 
  3211. short-cut keys to access those commands.
  3212.  
  3213. Finally, remember that it is up to you to keep track of whether the 
  3214. command area is displayed or not every inch along the way - saving 
  3215. a game whilst the command area is not shown requires 
  3216. mechanisms to check out how it should be after each and every 
  3217. loading of a new game position.
  3218.  
  3219.  
  3220. 17.2 Going into the Alley
  3221. -------------------------
  3222.  
  3223. In room 2, there is an example of how an un-named exit can be used 
  3224. to cover an area and make special things happen when the player 
  3225. tries to direct his character to go there. In this case, the back of the 
  3226. alley is covered with an un-named exit. When the player clicks the 
  3227. alley for the first time, Olaf moves there and makes a comment 
  3228. about how very uninteresting it is. Then, a room flag is set, and the 
  3229. exit is hidden. From there on, the alley is just an ordinary part of 
  3230. the scene, and Olaf may walk in and out of the alley any number of 
  3231. times without anything special happening. 
  3232.  
  3233. The alley also demonstrates a typical use of the 3D scaling function 
  3234. - the way the 3D: statement is set up in 2.room, GRAAL uses 3 of 
  3235. the available character sizes to display Olaf, depending on how far 
  3236. into the alley he has gone.
  3237.  
  3238.  
  3239. 17.3 Speaking In a Foreign Tongue
  3240. ---------------------------------
  3241.  
  3242. The conversation with Rajah Singh on the quay is rather special - 
  3243. you are forgiven for thinking a special font is being used to display 
  3244. the foreign language spoken by Rajah. However, this is not the 
  3245. case. Instead, I have combined a "blank" RESP command with 
  3246. BOBON and BOBOFF commands. Have a look in the 3.room file:
  3247.  
  3248. First, the "foreign language" was "typed" in an ordinary picture 
  3249. (3FG.IFF) using DPAINT.
  3250.  
  3251. Then, the "words" were grabbed as RBOBs using ROOMBOB: 
  3252. statements.
  3253.  
  3254. Rajah's responses to Olaf dialogue lines are as follows:
  3255.  
  3256. 1.   First, a BOBON command is used to display the RBOB with 
  3257.      the "foreign language".
  3258.  
  3259. 2.   Immediately upon that, a RESP command displaying nothing 
  3260.      but blank spaces is used to make Rajah Singh "speak". The 
  3261.      number of blank spaces determines the time it takes to 
  3262.      execute the RESP command.
  3263.  
  3264. 3.   After that, a BOBOFF takes away the strange text again. 
  3265.      Simple, eh? No need to construct an entire font (and no need 
  3266.      for another GRAAL command to handle that font!).
  3267.  
  3268.  
  3269. 17.4 An Automated Room
  3270. ----------------------
  3271.  
  3272. As you may have noticed, you can never get into normal game mode 
  3273. in Ali Harrod's shop - As soon as you walk in, you end up in dialogue 
  3274. mode, and when you end the dialogue, you are immediately 
  3275. transported out of the boutique. This is thanks to the DACT 
  3276. statements, where the programmer can grab control and keep it for 
  3277. as long as he likes! Have a look in 4.room - there is not a single run-
  3278. through of DACT statements not ending with a DSET... EXIT 
  3279. combination, forcing the player into dialogue mode. Therefore, 
  3280. there are no ACTION: statements either.
  3281.  
  3282. This technique is useful in a lot of circumstances - many times, it 
  3283. relieves you of having to think up a lot of elaborate ideas for a room 
  3284. where you really don't want the player prowling around.
  3285.  
  3286.  
  3287. 17.5 The Art of Avoiding a Seagull
  3288. ----------------------------------
  3289.  
  3290. As long as the seagull in the harbour is sitting on the pollard, Olaf 
  3291. steers well clear of it when walking about. He simply walks where 
  3292. the room file FLOOR: statements say he can move!
  3293.  
  3294. However, as soon as the seagull is scared off, Olaf is free to 
  3295. approach the pollard and pick up the feather. This is made possible 
  3296. by two FLOOR and one NFLOOR command executed in the 
  3297. cutscene where the seagull takes off (4.scene).
  3298.  
  3299. Having chased the seagull away, one problem remains: The next 
  3300. time we re-enter the room, we want things to be the way they are 
  3301. now, and not according to how they are set up in the room file 
  3302. statements.
  3303.  
  3304. A room flag comes to the rescue here - it allows us to "remember" 
  3305. the seagull status between visits to the room.
  3306.  
  3307. Room flag 1 for the room (room 3) is used - as long as it is zero (the 
  3308. initial state), the seagull is on the pollard. As soon as the bird is 
  3309. scared off, we set the flag to 1 with a SETRF 1=1 command in the 
  3310. cutscene. This room flag is tested in a DACT: statement - if it is set 
  3311. to 1, the bird is moved to the roof of the shed, and the default floor 
  3312. definitions are changed exactly the same way as in cutscene 4.
  3313.  
  3314. Remember, as long as the LIGHTS ON command has not been 
  3315. used, the scene remains black and we can move anything we want 
  3316. around without the player being aware of what is done!
  3317.  
  3318.  
  3319. 17.6 A Spitting Image
  3320. ---------------------
  3321.  
  3322. The spitting llama on offer by Ali Harrod is composed of two 
  3323. animations, because I decided a single one would be too large. 
  3324. Instead, the llama itself is one animation, and the "spit" is another, 
  3325. very small one, animated by an AMAL "Move" command.
  3326.  
  3327. The movement of the llama and spit animations are synchronised - 
  3328. the llama being displayed on top of the spit. (Well, almost 
  3329. synchronised. If you leave the llama sequence on and walk away for 
  3330. a quarter of an hour, you will notice that things have become a little 
  3331. strange when you return. But who could keep away from the game 
  3332. that long, anyway? And if you don't like it, you can always make 
  3333. one big animation of the whole thing!)
  3334.  
  3335.  
  3336. 17.7 A Map Room
  3337. ---------------
  3338.  
  3339. I had planned on only delivering the first four rooms with GRAAL, 
  3340. but ended up giving you seven. The reason is some quite interesting 
  3341. techniques were used in room 5, which may come in handy.
  3342.  
  3343. Room 5 is an outline map of the East, showing the towns of 
  3344. Constantinople, Gurgan and Baghdad. The thing is, there is no 
  3345. Olaf, and nothing to do except watch a short cutscene and, when 
  3346. revisiting, point to one of the three towns. Also, this room does not 
  3347. use the command area at all - instead, the scene area itself takes up 
  3348. more space, and the command area is hidden.
  3349.  
  3350. Olaf was done away with by a simple CHAR OFF command in a 
  3351. DACT: statement - nothing strange about that (once you read the 
  3352. on-line reference). Remember that the main character will always 
  3353. be made visible when entering a new room, unless you put it away 
  3354. again with CHAR OFF.
  3355.  
  3356. Because we don't need the command area for this room, each GOTO 
  3357. command leading into this room from other rooms is preceeded 
  3358. with a COMAREA OFF command. (See the load/save room above 
  3359. for more about hiding the command area.) In the room itself, a room 
  3360. flag for room 40 (the save/load room) is set to indicate the status of 
  3361. the command area (shown or hidden) - this flag is used in the save/
  3362. load procedures, as described in "The Load / Save Room." on 
  3363. page 58.
  3364.  
  3365. We need to make sure the command area is replaced when entering 
  3366. a new room. The only rooms Olaf can go to from room 5 is room 6 
  3367. and room 7, so in each of these, a COMAREA ON command in the 
  3368. DACT: statements prior to LIGHTS ON restores the command 
  3369. area. (Keep the COMAREA ON commands close to LIGHTS ON to 
  3370. make sure the command area disappears/re-appears in sync with 
  3371. the scene area.)
  3372.  
  3373. By now, we have ensured the map, and ONLY the map, is shown on 
  3374. screen. The only thing the player can do in room 5 is to point to one 
  3375. of the three exits placed just over the towns on the map.
  3376.  
  3377. I have chosen to display the exit names for the towns in the normal 
  3378. fashion when the mouse cursor moves over them, although I might 
  3379. just as well have put a blank space instead of names in the EXIT 
  3380. statements. The names of the towns are written on the map itself, 
  3381. and it shouldn't have taken the player too long to figure out where 
  3382. to click, anyway.
  3383.  
  3384.  
  3385.  
  3386.  
  3387. 18   The On-line Monitor
  3388. ========================
  3389.  
  3390.  
  3391. GRAAL's on-line monitor is a great help when things go wrong in 
  3392. your scripts. It allows you to examine flags and other information 
  3393. "on the fly", and also make temporary corrections. This helps to 
  3394. lower the number of times you have to restart GRAAL during the 
  3395. tests. (Naturally, the monitor cannot be called up from an 
  3396. encrypted game unless there is a DEBUG: statement in 
  3397. graal.main.)
  3398.  
  3399. To invoke the monitor, simply press the [G] key. The monitor 
  3400. window pops up, covering the lower part of the screen. 
  3401.  
  3402. Here's a description of what it contains:
  3403.  
  3404. Information lines
  3405.  
  3406. At the very top are two lines of general information showing
  3407.  
  3408. *    The current room.
  3409.  
  3410. *    The last starting position used.
  3411.  
  3412. *    The current floor.
  3413.  
  3414. *    Whether the character is (should be) visible or not.
  3415.  
  3416. The information in line two is mainly of interest in multiple-
  3417. character games:
  3418.  
  3419. *    The number of the character currently under player control.
  3420.  
  3421. *    The number of the inventory currently used.
  3422.  
  3423. *    The number of the character following the controlled character 
  3424.      (if any).
  3425.  
  3426. Command field and < <- Execute > button, message field
  3427.  
  3428. In this text field, you can type any valid GRAAL command, and 
  3429. then make GRAAL execute it with the < <- Execute > button next 
  3430. to the field. 
  3431.  
  3432. These are the commands your are likely to use most:
  3433.  
  3434. *    GOTO to jump to another room (or reload the current one). 
  3435.      This command also automatically closes the monitor and thus 
  3436.      replaces the old (2.0) monitor's < <- GOTO > button.
  3437.  
  3438. *    SETOF and SETRF to set flags.
  3439.  
  3440. While GRAAL takes care of your request, the text * executing * will 
  3441. be shown in the message field at the very bottom of the window. If 
  3442. it goes OK, the text 
  3443. * OK * is shown. If GRAAL couldn't make sense of what you typed, 
  3444. the text 
  3445. * error * is shown instead. Make sure you get the syntax correct - 
  3446. often, any mistakes will make the dreaded GRAAL run-time error 
  3447. screen appear.
  3448.  
  3449. Some rules:
  3450.  
  3451. *    You can only enter one command at a time.
  3452.  
  3453. *    You cannot enter conditions.
  3454.  
  3455. *    All input is automatically converted to upper case.
  3456.  
  3457. *    You can use ROBJ, SOBJ, RBOB and SBOB references.
  3458.  
  3459. *    While anything is possible, not everything is smart or even 
  3460.      relevant at all times. Commands you probably don't want to 
  3461.      execute from the monitor include SAVE, LOAD, MARK, 
  3462.      RESUME and others that re-arrange a lot of stuff in GRAAL.
  3463.  
  3464. < Back to GRAAL > button
  3465.  
  3466. This button quits the monitor. Remember that some changes you 
  3467. attempt in the monitor may require re-loading the current room to 
  3468. take effect, in which case you should end the monitor session by 
  3469. executing a GOTO command instead.
  3470.  
  3471. List buttons
  3472.  
  3473. There are three buttons to list important information:
  3474.  
  3475. *    < Object List > shows a list of all objects - numbers, locations 
  3476.      and flag contents.
  3477.  
  3478. *    < Room List > shows the contents of all room flags for all 
  3479.      rooms.
  3480.  
  3481. *    < Inventories > shows a list of the contents of each inventory.
  3482.  
  3483. < Trace > button
  3484.  
  3485. This is a toggle button, deciding whether the single-trace debug 
  3486. mode is active or not.
  3487.  
  3488. Click once to activate. The trace console will open at the top of the 
  3489. scene area. Then click < Back to GRAAL> and provide GRAAL with 
  3490. some input.
  3491.  
  3492. As soon as GRAAL starts working on an input sentence, all 
  3493. conditions and commands about to be executed are shown in green 
  3494. in the trace console. For each command, you have to press a 
  3495. keyboard key to continue through the script. The full stop key is a 
  3496. good choice, because it also allows you to skip the pauses caused by 
  3497. commands like SAY and W(ait). 
  3498.  
  3499. The text colour in the trace window changes from green to red while 
  3500. the command is being executed. An empty trace window means 
  3501. GRAAL is waiting for more player input.
  3502.  
  3503. GRAAL with the trace console active. Here it waits for us to 
  3504. acknowledge the next action - loading a sound sample for the bell.
  3505.  
  3506. Note: In the trace console, object and image references are NOT 
  3507. converted back to ROBJ, RBOB, etc. references. For example, 
  3508. SBOB1 will show up as number 61 or something like that.
  3509.  
  3510. To deactivate the trace mode, call up the monitor again and click < 
  3511. Trace > once more.
  3512.  
  3513. The trace mode can also be activated and deactivated from within 
  3514. scripts with the TRACE ON and TRACE OFF commands.
  3515.  
  3516.  
  3517.  
  3518.  
  3519. 19   Macros
  3520. ===========
  3521.  
  3522.  
  3523. Macros allow you to record a sequence of player input selections, 
  3524. store them in a file, and play them back later.
  3525.  
  3526. The primary use is for testing - being able to play the same 
  3527. sequence of events back over and over again, and having it done 
  3528. automatically, makes testing a whole lot easier. They are especially 
  3529. useful for running through parts of the game which are really 
  3530. "finished", but still need to be tested from time to time to check that 
  3531. no alterations you have made to other parts of the game affects 
  3532. them, or when changes to scripts means you cannot use old saved 
  3533. game files to put you in the desired part of the game.
  3534.  
  3535. The macro functions only work in development mode. In encrypted 
  3536. games, they are not available unless there is a DEBUG: statement 
  3537. in graal.main.
  3538.  
  3539.  
  3540. 19.1 Starting a Macro Recording
  3541. -------------------------------
  3542.  
  3543. 1.   Start the game. Load a saved game, or go to the position from 
  3544.      which you want to start the macro recording by playing the 
  3545.      game in the normal way.
  3546.  
  3547. 2.   Press the [R] key. A message telling you that macro recording 
  3548.      is activated is shown very briefly in the scene area.
  3549.  
  3550. 3.   From now on, every command you execute, and every exit or 
  3551.      dialogue line you choose, will be recorded to memory.
  3552.  
  3553.  
  3554. 19.2 Saving a Macro
  3555. -------------------
  3556.  
  3557. 1.   When you have reached the point where you want the macro 
  3558.      to stop, press the [R] key again.
  3559.  
  3560. 2.   A dialogue box pops up, asking for a macro file name. The 
  3561.      name you type will be suffixed with the text ".macro"
  3562.  
  3563. 3.   Click the "Save" button. The macro file is now stored in the 
  3564.      development directory.
  3565.  
  3566.  
  3567. 19.3 Playing a Macro
  3568. --------------------
  3569.  
  3570. 1.   Put the game is in EXACTLY THE SAME POSITION as when 
  3571.      you started the macro recording. 
  3572.  
  3573. 2.   Press the [P] key. A dialogue box appears, asking for the 
  3574.      macro file name. Type the name - you do not have to enter the 
  3575.      ".macro" part.
  3576.  
  3577. 3.   Click the "Load" button.
  3578.  
  3579. 4.   The contents of the macro are now re-played before your very 
  3580.      eyes. Sit back, watch, and enjoy!
  3581.  
  3582. 5.   You may abort the playing of the macro at any time by 
  3583.      pressing the [Esc] key between commands.
  3584.  
  3585. Tip: Before playing a macro, you may want to put the text display 
  3586. at maximum speed by pressing the [ I ] key a number of times first.
  3587.  
  3588.  
  3589. 19.4 Restrictions to Macro Playback
  3590. -----------------------------------
  3591.  
  3592. The original timing of the player input is not preserved in the 
  3593. macros. When a macro is played back, execution of the next 
  3594. command starts as soon as the previous one is finished. This means 
  3595. macros are not suited for recording parts where the timing of player 
  3596. input is critical. In other words, if you are using the GRAAL timer 
  3597. functions, stop to think before you record macros.
  3598.  
  3599. Changing the N_GLOBALBOBS:, N_SECTIONBOBS:, 
  3600. GLOBALOBJS: or SECTIONOBJS: statements offsets the image 
  3601. and object numbers, and previously recorded macros will stop 
  3602. working. That's a very good reason to set them reasonably high 
  3603. right from the beginning.
  3604.  
  3605.  
  3606.  
  3607.  
  3608. 20   "Productifying" Your Adventures
  3609. ====================================
  3610.  
  3611.  
  3612. 20.1 The Basics
  3613. ---------------
  3614.  
  3615. While developing your adventure, you have all the required files in 
  3616. one, big, happy development directory. When you need to distribute 
  3617. your finished work (or test versions) to other people, problems 
  3618. arise: 
  3619.  
  3620. 1.   You only want to distribute the files needed for the adventure - 
  3621.      not the GRAAL docs, utility programs and temporary work 
  3622.      files which you probably also have in the development 
  3623.      directory.
  3624.  
  3625. 2.   If the game should be playable from diskettes, you need a way 
  3626.      to tell GRAAL which files are on which diskette, and you 
  3627.      probably want to duplicate some frequently used files onto all 
  3628.      the game diskettes.
  3629.  
  3630. 3.   Perhaps you want to encrypt and compress the files, saving 
  3631.      disk space and making it very much harder for players to find 
  3632.      the solution by cheating.
  3633.  
  3634. This is how to go about it:
  3635.  
  3636. 1.   You put the information about which files belong to the 
  3637.      finished game, and which diskette(s) they should be placed on, 
  3638.      in the diskinfo.graal file. Use the GREP program (described 
  3639.      below) to help you out.
  3640.  
  3641. 2.   This step is optional and can only be done by registered users: 
  3642.      You run the GPRO program, which uses the diskinfo.graal file 
  3643.      to copy all the required files from the development directory to 
  3644.      a test directory (which must also be on hard disk). This makes 
  3645.      it possible to test if all required files really were specified 
  3646.      correctly in the diskinfo.graal file before making diskettes. It is 
  3647.      during this step that GPRO also offers an option to encrypt 
  3648.      and compress selected files.
  3649.  
  3650. 3.   You run the GDC program - either from the development or 
  3651.      the test directory depending on whether you did step 2 above - 
  3652.      which uses the diskinfo.graal file to copy the game files to 
  3653.      diskettes. It also formats and labels each diskette so that 
  3654.      GRAAL knows what diskette names to look for when disk 
  3655.      swapping during play becomes necessary.
  3656.  
  3657.  
  3658. 20.2 The diskinfo.graal File
  3659. ----------------------------
  3660.  
  3661. GPRO and GDC rely on a "diskinfo" file to tell them which files 
  3662. should be copied, and which diskette each file is meant to end up 
  3663. on. A diskinfo file must contain the following:
  3664.  
  3665. On line 2 (and nowhere else): The common part of the delivery 
  3666. diskette volume name, for example
  3667.  
  3668. MYADVENTURE_DISK
  3669.  
  3670. When GDC does its stuff later, the diskettes will then be labelled
  3671.  
  3672. MYADVENTURE_DISK A   MYADVENTURE_DISK B
  3673.  
  3674. and so on.
  3675.  
  3676. Below line 3: The names of all the files, grouped according to 
  3677. delivery diskette. Each file name is on its own line, preceded by the 
  3678. diskette suffix and a space. For example:
  3679.  
  3680. A 1.room
  3681.  
  3682. means the file 1.room is delivered on MYADVENTURE_DISK A.
  3683.  
  3684. Remember: The files should be grouped according to volume, and 
  3685. the groups should be sorted alphabetically, starting with 
  3686. everything on diskette A.
  3687.  
  3688. You may have as many comment lines and empty lines in between 
  3689. the file entries as you like.
  3690.  
  3691. The following stuff should ALWAYS be on diskette A:
  3692.  
  3693. 1)  GRAAL_2 *
  3694.  
  3695. The main program. It does not have to be called GRAAL_2 - rename 
  3696. it to anything you want your adventure called.
  3697.  
  3698. 2)  FONTS *
  3699.  
  3700. A special entry which copies the entire fonts: drawer in your 
  3701. development directory.
  3702.  
  3703. 3)  graal.main
  3704.  
  3705. The graal.main file
  3706.  
  3707. 4)  diskinfo.graal *
  3708.  
  3709. 5)  The picture files for the command and dialogue areas (if you 
  3710. don't specify DEFAULT, in which case the graphics included in the 
  3711. GRAAL_2 program itself are used).
  3712.  
  3713. 6)  The resource file for requesters (suffix .rsb). If you use the 
  3714. DEFAULT, no entry is needed - it's already in the GRAAL_2 
  3715. program itself.
  3716.  
  3717. The asterisk (*) after some of the file names tells GPRO not to 
  3718. compress and encrypt these files (see below). Apart from the files 
  3719. above, always mark all user documentation and icon (.info) files 
  3720. with asterisks in the same manner!!
  3721.  
  3722.  
  3723. 20.3 GREP
  3724. ---------
  3725.  
  3726. Once your adventure becomes reasonably big, you may find it a bit 
  3727. difficult to keep track of all the files you use. 
  3728.  
  3729. The GREP program starts by inspecting the graal.main file, and 
  3730. from there it goes on to find all references to all files used by your 
  3731. adventure.(This, of course, requires that a proper START_ROOM: 
  3732. statement exists in graal.main, otherwise it will not find all the 
  3733. information.)
  3734.  
  3735. GREP creates a report over what files are used where, and also 
  3736. gives you helpful suggestions regarding the contents of your 
  3737. diskinfo.graal file and some of the statement settings in graal.main. 
  3738. This information is saved in a file called graal.report.
  3739.  
  3740. You can start GREP in two ways:
  3741.  
  3742. *    From the shell: Switch to the development drawer, type "run 
  3743.      GREP".
  3744.  
  3745. *    From the Editor: Select the "Create Report" option in the 
  3746.      GRAAL menu. The resulting file will automatically be loaded 
  3747.      into a new window in the Editor.
  3748.  
  3749.  
  3750. 20.4 GPRO
  3751. ---------
  3752.  
  3753. The GPRO program is used to copy the files that make up your 
  3754. adventure (the ones that should go on the delivery diskette) from 
  3755. the development directory (which can be a right old mess) to a test 
  3756. directory, containing only what is needed to run the adventure.
  3757.  
  3758. You should test the adventure thoroughly in the test directory, 
  3759. making sure everything is included, before making the delivery 
  3760. diskettes. (GDC is automatically copied from development to this 
  3761. test directory by gpro, because you need it there to make the 
  3762. diskettes.)
  3763.  
  3764. This program is only available to registered users (in other words, 
  3765. it needs the personal keyfile to work). Unregistered users are 
  3766. confined to copying the game files directly onto the delivery 
  3767. diskettes from the development directory using GDC, and then 
  3768. testing the diskettes.
  3769.  
  3770.  
  3771. Starting GPRO
  3772. """""""""""""
  3773.  
  3774. GPRO runs from CLI only. Open a shell, and switch to your 
  3775. development directory. Then type "RUN GPRO". (Don't forget the 
  3776. "RUN" bit, or GPRO may lock up during the copying process!)
  3777.  
  3778. GPRO now checks if there is a valid graal.key file in the directory. 
  3779. If not, it will say so, urge you to register GRAAL, and terminate.
  3780.  
  3781. The user interface is as follows:
  3782.  
  3783. Encrypt:
  3784.  
  3785. < > Yes: Compress and encrypt files not marked by an asterisk in 
  3786. the         diskinfo.graal file. See "Compressing and encrypting" 
  3787. below.
  3788.  
  3789. < > No: Do a normal file copy.
  3790.  
  3791. Simulation: < >
  3792.  
  3793. Click this if you just want to test the contents of the diskinfo file. 
  3794. The Copy function will just "go through the motions", showing what 
  3795. would happen if you had been copying for real.
  3796.  
  3797. Diskinfo:
  3798.  
  3799. You can choose the name of the diskinfo file to use here. You can, 
  3800. for example, have one diskinfo file for demo versions and one for 
  3801. "live" versions in your development directory. (I use this facility to 
  3802. produce a GRAAL delivery from the "Olaf" development directory, 
  3803. which normally produces only the "Olaf" game itself.)
  3804.  
  3805. Note that the selected file is renamed "diskinfo.graal" (the default 
  3806. name) in the destination directory, and therefore, "diskinfo.graal" 
  3807. is the name that should ALWAYS be used when referring to the 
  3808. diskinfo file IN the diskinfo file!
  3809.  
  3810. Destination:
  3811.  
  3812. The name of a hard disk directory, which, by the way, must exist 
  3813. already.
  3814.  
  3815. GPRO saves the names of the last diskinfo file and destination 
  3816. directory in a file, and so remembers the settings until the next 
  3817. time it is used.
  3818.  
  3819. Status bar
  3820.  
  3821. A green stripe shows how far the copying has progressed.
  3822.  
  3823. Message field
  3824.  
  3825. A text shows what is currently going on during the copy operation.
  3826.  
  3827. Copy and Exit buttons
  3828.  
  3829. Really... you'll just have to find out for yourself!
  3830.  
  3831. Compressing and encrypting
  3832. """"""""""""""""""""""""""
  3833. Almost all files can be compressed and encrypted during the 
  3834. copying process. There are two benefits to this: You save disk space, 
  3835. and both graphics and text files are rendered unreadable to your 
  3836. users except through the GRAAL_2 program.
  3837.  
  3838. The following files/diskinfo entries should NEVER be compressed 
  3839. during copying:
  3840.  
  3841. GRAAL_2 icon files documentation files graal.key diskinfo.graal
  3842.  
  3843. To make sure a file is never encrypted, just put a space and an 
  3844. asterisk after the file name in the diskinfo.graal file, for example:
  3845.  
  3846. A Disk.info * 
  3847. A GRAAL_2 * 
  3848. A GRAAL_2.info *
  3849.  
  3850. Of course, you may want to compress GRAAL_2 to save disk space, 
  3851. but do so before the final copying process, and use a utility that 
  3852. creates a self-decompressing executable file (like PowerPacker or 
  3853. CrunchMania).
  3854.  
  3855. Note that encrypted games ALWAYS require the keyfile to run, so 
  3856. include an entry for the keyfile (on diskette A) in the diskinfo file 
  3857. when you produce the final, encrypted master diskettes.
  3858.  
  3859. The compression routine puts the emphasis on speed rather than 
  3860. efficiency. On average, 30%-40% less space is used by a compressed 
  3861. adventure.
  3862.  
  3863. The percentage gained varies greatly with the structure and 
  3864. complexity of the files. Some examples:
  3865.  
  3866. 120K tracker module           gained 42% 
  3867. 24K complex bg picture             gained 20% 
  3868. 12K simple clipart picture              gained 54% 
  3869. 24K script file               gained 50% 
  3870. 48K IFF sample w. "silent" parts             gained 38%
  3871.  
  3872. GRAAL games with compressed files require up to 200K or so extra 
  3873. RAM space to do their job. Running a reasonably large adventure 
  3874. thus takes a little more than 1,5MB...
  3875.  
  3876. On fast machines, I perceive a performance increase running 
  3877. compressed games, but perhaps that's only my imagination... It's 
  3878. not unreasonable, though, that the reduced disk access more than 
  3879. makes up for the unpacking time.
  3880.  
  3881. On slow machines, the unpacking time becomes more noticeable, 
  3882. and running a GRAAL game on an unexpanded 68000 machine 
  3883. with no memory cacheing can be a nuisance. To help out a little, 
  3884. consider NOT compressing and encrypting long sound samples, 
  3885. and perhaps you could leave the tracker modules alone, too. 
  3886. Because the tracker modules are probably the biggest files you 
  3887. have, this will also save some working space (perhaps a 100K or so).
  3888.  
  3889.  
  3890. 20.5 GDC
  3891. --------
  3892.  
  3893. GDC is the program that copies the game files to the final delivery 
  3894. diskettes. You MUST use this program to prepare the diskettes.
  3895.  
  3896. However, GDC is not intended for making copies of the game. Just 
  3897. use GDC to make the "master diskettes", and then use some proper 
  3898. diskette copying software for the copies.
  3899.  
  3900. Note: ALWAYS wait for disk activity to finish completing before 
  3901. responding to any prompt telling you to switch diskettes or that    
  3902. the copying procedure has finished!
  3903.  
  3904. If you have run GPRO, the GDC program was copied to the test 
  3905. directory automatically, and you should run it from there.
  3906.  
  3907. If you don't have access to GPRO, you run GDC directly from the 
  3908. development directory.
  3909.  
  3910. GDC runs from CLI only. Open a shell, and switch to the 
  3911. appropriate directory. Then type "RUN GDC". (Don't forget the 
  3912. "RUN" bit, or GDC may lock up during the copying process!)
  3913.  
  3914. Format radio buttons
  3915.  
  3916. To prepare the diskettes, and label them properly, GDC first 
  3917. formats each diskette. This can be done quickly, if the diskette has 
  3918. been preformatted, or in the normal fashion, in which case the 
  3919. previous formatting status of the disk is not important.
  3920.  
  3921. Check Sizes button
  3922.  
  3923. This is normally done automatically when you start GDC.
  3924.  
  3925. The "gauges" or "meters" labelled A, B, and so on, are updated to 
  3926. show how much space is used on each disk. If you have specified too 
  3927. much for a certain volume in the diskinfo file, the top of that meter 
  3928. turns red to show that you must edit the diskinfo file and re-
  3929. distribute the files to make it all fit. (We're talking standard DD 
  3930. diskettes here, of course.)
  3931.  
  3932. If you have left GDC running while editing the file, you could use 
  3933. the button to re-calculate the space requirements. On the other 
  3934. hand, it might be a good idea to exit the program, make sure you 
  3935. update the right file in the right place, and only then re-run GDC...
  3936.  
  3937. Status bar
  3938.  
  3939. When you press Copy, each diskette meter in turn is gradually 
  3940. emptied, and this line starts growing instead to show how far the 
  3941. copy operation has progressed.
  3942.  
  3943. Message field
  3944.  
  3945. If anything goes wrong, this is where you will get told.
  3946.  
  3947. Copy and Exit buttons
  3948.  
  3949. Once more, pretty obvious...
  3950.  
  3951.  
  3952.  
  3953. You don't need more than 18 diskettes, do you? Please! Tell me you 
  3954. don't!
  3955.  
  3956.  
  3957.  
  3958. EXTREMELY NICE TIP: It's good practice to keep the 
  3959. diskinfo.graal file updated during development. Start GDC now 
  3960. and then to see if the distribution of files seem about right with 
  3961. respect to the space requirements... Also, use GREP to check that 
  3962. the diskinfo.graal information is correct.
  3963.  
  3964.  
  3965.  
  3966.  
  3967. 21   The Editor
  3968. ===============
  3969.  
  3970.  
  3971. 21.1 Introduction
  3972. -----------------
  3973.  
  3974. This is a neat little (well, growing bigger all the time, actually) 
  3975. editor, making life in the GRAAL script-writing lane much easier 
  3976. than it otherwise would be.
  3977.  
  3978. At first, you may find the concept behind it all slightly confusing. 
  3979. While other "user-friendly" games development systems opt for 
  3980. point-and-click control of everything, storing the results away in 
  3981. cryptic databases, GRAAL is basically made up of ASCII scripts 
  3982. that can be created using any text editor. While this means more 
  3983. typing and requires a deeper understanding of what's going on, it 
  3984. also has some definite advantages. It means greater flexibility in 
  3985. your creations, a better overview, and a total freedom when it 
  3986. comes to documenting the scripts via comment lines. And the 
  3987. GRAAL editor steps in to bring you the best of the "point'n'click 
  3988. world", too. It makes the typing of the scripts a lot easier, and you 
  3989. will not want to be without it.
  3990.  
  3991. In short, the editor spares you from annoying things such as trying 
  3992. to remember what script does what, what the parameters of that 
  3993. "OBJECT:" statement mean, and what the coordinates of your last 
  3994. 6 FLOOR: and PATH: definitions actually looks like on screen. The 
  3995. end result is the same as you would get with any other editor, 
  3996. though - ASCII script files with lists of GRAAL statements and 
  3997. commands.
  3998.  
  3999. In addition, the GRAAL editor has the following advantages:
  4000.  
  4001. *    It handles multiple scripts in multiple windows 
  4002.      simultaneously, with easy switching, copying and pasting 
  4003.      between them.
  4004.  
  4005. *    It is connected to the on-line reference, giving help on 
  4006.      statements and commands.
  4007.  
  4008. *    It keeps track of used and unused room, section, scene, and 
  4009.      ptrn numbers.
  4010.  
  4011. *    Although many features are GRAAL-related, it is perfectly 
  4012.      possible to use this editor to edit any kind of ASCII text file. 
  4013.      You will probably find it a good alternative. Enjoy!
  4014.  
  4015. The editor handles files up to 5000 lines long. (If you have GRAAL 
  4016. scripts that long, you are probably in need of professional help :-)
  4017.  
  4018.  
  4019. 21.2 System Requirements
  4020. ------------------------
  4021.  
  4022. This editor needs Workbench 2.0 or better to work.
  4023.  
  4024. amigaguide.library v. 34 or later must be in your LIBS: drawer. (This 
  4025. can be found for free on Aminet.)
  4026.  
  4027. On AGA machines, the editor screen "clones" your Workbench 
  4028. setting by default. If you have a hi-res Workbench, it uses a hi-res 
  4029. screen; with a Productivity Workbench, it opens in Productivity 
  4030. mode... you get the picture. Just make sure that your Workbench is 
  4031. at least 640 pixels wide, and everything should operate smoothly. 
  4032. (The screen mode can be customised using the tooltypes in the 
  4033. GRAAL Editor icon - see the end of this chapter.)
  4034.  
  4035. On non-AGA machines, a normal hi-res, non-interlaced screen is 
  4036. always used.
  4037.  
  4038. Also note that the editor must be placed in your game development 
  4039. library on your hard disk for all file fetching routines to operate 
  4040. without problems. The GRAAL.guide file should also be placed in 
  4041. the same directory.
  4042.  
  4043.  
  4044. 21.3 Known Bugs & Irritating Facts
  4045. ----------------------------------
  4046.  
  4047. *    A block marked for editing and contained in a single screen 
  4048.      line is sometimes not properly highlighted on screen. 
  4049.      However, the copy/cut/delete functions still work.
  4050.  
  4051. *    Adding lines to the end of the file in Overstrike Mode doesn't 
  4052.      work properly.
  4053.  
  4054. *    If you use a 68030 or better processor, you may have to turn 
  4055.      CPU caches off before using the Editor. Otherwise, graphics in 
  4056.      the graphical editing functions may not display properly and 
  4057.      make you unnecessarily confused. The way to switch off caches 
  4058.      is to open a CLI shell, and type
  4059.  
  4060. CPU NOCACHE NOBURST
  4061.  
  4062.  
  4063. 21.4 Creating a New Script
  4064. --------------------------
  4065.  
  4066. Since the editor expects to be placed in your GRAAL development 
  4067. directory, it checks for a graal.main file in the current directory at 
  4068. start-up - without such a file, you don't really have much of a 
  4069. development environment!
  4070.  
  4071. If there is no graal.main file, the editor asks if one should be 
  4072. created. If you answer "yes", a template for such a script will be 
  4073. created in the editing window (which makes up the main part of the 
  4074. editor display).
  4075.  
  4076. You can also use the "New" option in the "Project" menu to create a 
  4077. new file. The "New" option has six suboptions. The first one, 
  4078. "empty", just opens a new, empty editing window on top of the first 
  4079. one. The editor handles up to ten script windows simultaneously, 
  4080. and you can switch between them quite easily with the "Select 
  4081. Window" option in the "Edit" menu (or [Amiga>+[W>).
  4082.  
  4083. The suboption "graal.main" creates a graal.main script template, 
  4084. as discussed above.
  4085.  
  4086. The last four suboptions, ".room", ".section", ".scene", and ".ptrn" 
  4087. creates a template for the specified script type. Before the template 
  4088. is shown, a requester pops up showing a recommended script 
  4089. number - this number is the first number not already occupied by 
  4090. any of the existing scripts. You can change it if you wish, but 
  4091. remember that it's a waste of space leaving unnecessary gaps in the 
  4092. number sequences.
  4093.  
  4094. The requester also has a gadget for a short script description - you 
  4095. should enter a meaningful description of the room, cutscene or 
  4096. whatever here. This comment is placed in the first (comment) line 
  4097. of the script, and you will see why it's so useful is a very short 
  4098. while... in the next section, as it were!
  4099.  
  4100.  
  4101. 21.5 Working with the Editor
  4102. ----------------------------
  4103.  
  4104.  
  4105. Loading Existing Scripts
  4106. """"""""""""""""""""""""
  4107.  
  4108. Just like the "New" option, the "Load" option, also in the "Project" 
  4109. menu, has the same selection of suboptions as the "New" option. 
  4110. (The only difference is that "empty" is called "general" here.)
  4111.  
  4112. "Load general" brings up an ordinary file requester.
  4113.  
  4114. "Load graal.main file" loads the graal.main straight away - not 
  4115. much use asking for its name, because it's always the same.
  4116.  
  4117. "Load .room file" and so on brings up a list requester showing the 
  4118. numbers and descriptions (see above) of all existing scripts of the 
  4119. desired type, neatly sorted in ascending order.
  4120.  
  4121. Most of the time, you probably want to open a script in a new 
  4122. window, which is why you should use the "Load Another" option 
  4123. instead. It looks exactly like the "Load" options, but in this case, the 
  4124. suboptions have keyboard short-cuts ([amiga>+[3-8>). Learn to use 
  4125. them, as this is the quickest way to open scripts.
  4126.  
  4127. Note: .scene files with a space in the name will not be properly 
  4128. treated by the loader. Simply put, do not use spaces in file names.
  4129.  
  4130.  
  4131. The Templates and the Syntax Checker
  4132. """"""""""""""""""""""""""""""""""""
  4133.  
  4134. Some statements in the templates have suggested parameters 
  4135. already filled in but in most cases, there is no point in giving a 
  4136. suggestion because the correct parameters are very much up to 
  4137. yourself. You can see this quite easily:
  4138.  
  4139. 1.   Create a new .room script, making the editor give you a room 
  4140.      script template.
  4141.  
  4142. 2.   Now press the button marked "Syntax". This will make the 
  4143.      editor check the script in the current window for syntax errors, 
  4144.      and it will not be very long before it comes upon a statement 
  4145.      with no parameter filled in. It then displays an error message 
  4146.      telling you about the problem, and it also marks the statement 
  4147.      where the error occurs.
  4148.  
  4149. The syntax checker is a great help, but it does not find every 
  4150. possible error. This is what it does:
  4151.  
  4152. *    It checks the names of all statements.
  4153.  
  4154. *    It checks that all mandatory statements are in place. 
  4155.      However, note that   some statements may depend on others to 
  4156.      work, and this is not checked by this function. Be particularly 
  4157.      careful with graphics, and make sure the correct CLPART: 
  4158.      statement is in effect in every situation requiring   CLPART 
  4159.      pictures!
  4160.  
  4161. *    It checks the number of parameters for all statements (except 
  4162.      for statements with a variable number of parameters).
  4163.  
  4164. *    For all parameters that may consist of conditions, commands, 
  4165.      or both, it checks the name of each condition and command.
  4166.  
  4167. If any error is found, the offending statement / command is 
  4168. highlighted, and the nature of the error is shown in a requester as 
  4169. described above.
  4170.  
  4171. All this should make development a little less frustrating. 
  4172. However, GRAAL itself checks a lot of other stuff too, and will still 
  4173. throw runtime errors at you from time to time. Further 
  4174. improvements will probably appear over time.
  4175.  
  4176. Note: The syntax checker uses the file name suffix to determine 
  4177. what statements and commands are allowed - so it can only be used 
  4178. in files following the GRAAL naming conventions. And it does NOT 
  4179. work with .ptrn files.
  4180.  
  4181.  
  4182. Amigaguide Help
  4183. """""""""""""""
  4184.  
  4185. If you place the cursor on a statement or command word and press 
  4186. the HELP key, the amigaguide reference file graal.guide is opened 
  4187. with the relevant topic displayed. (The small <?> button does the 
  4188. same thing.)
  4189.  
  4190. Note that just like the syntax checker, the help function uses the 
  4191. file name suffix to determine what statements and commands are 
  4192. allowed - so it can only be used in files following the GRAAL 
  4193. naming conventions.
  4194.  
  4195.  
  4196. Normal Editing Functions
  4197. """"""""""""""""""""""""
  4198.  
  4199. I will not bother you too much about the functions that you are 
  4200. likely to encounter in any text editor. You should find the find & 
  4201. replace options, and the other options of the "Edit" menu, quite 
  4202. adequate for the job at hand.
  4203.  
  4204. Just a few words about useful keyboard keys:
  4205.  
  4206. [shift]+[down arrow]
  4207. [shift]+[up arrow]       These keys scrolls the script one page at a time.
  4208.  
  4209. [shift]+[right arrow]    Moves the cursor past the last character of the 
  4210.                          line.
  4211.  
  4212. [shift]+[left arrow]     Moves the cursor to the beginning of the line.
  4213.  
  4214. [control]+[right arrow]  Moves to the next semi-colon of the line; that 
  4215.                          is, to the next GRAAL statement parameter.
  4216.  
  4217. [Esc]                    Closes the current window.
  4218.  
  4219. [Enter]                  Exits a string gadget (for example, in the 
  4220.                          Find window), or carries out a function (for 
  4221.                          example, "Find" in the find window, once the 
  4222.                          cursor is not in a string gadget any more).
  4223.  
  4224. Other available short-cut keys are all listed in the menus.
  4225.  
  4226.  
  4227. Marking Text Using the Mouse 
  4228. """"""""""""""""""""""""""""
  4229.  
  4230. Apart from marking text blocks with [amiga>+[1> and 
  4231. [amiga>+[2>, you can use the mouse:
  4232.  
  4233. 1.   Click the first character of the block.
  4234.  
  4235. 2.   Hold down a [shift> key and click the character immediately to 
  4236.      the right of the last character of the block. (Clicking the first 
  4237.      character of a line will mark the entire previous line.)
  4238.  
  4239.  
  4240. The Status Bar
  4241. """"""""""""""
  4242.  
  4243. Some useful bits of information are shown in the "status bar" 
  4244. immediately above the editing windows:
  4245.  
  4246. *    Cursor row (r) and column (c) position.
  4247.  
  4248. *    Insert (I) or overstrike (O) write mode.
  4249.  
  4250. *    Number of changes made since the last save. Note that some 
  4251.      "big" operations, like inserting a block of text, only count as 
  4252.      one change each!
  4253.  
  4254. *    Time. The clock is only updated when you do something in the 
  4255.      editor, like moving the cursor.
  4256.  
  4257.  
  4258. <RUN> button
  4259. """"""""""""
  4260.  
  4261. The <RUN> button (which has a small GRAAL symbol on it) tries 
  4262. to start the GRAAL driver as a separate process. By default, it 
  4263. assumes the name of the GRAAL driver program is GRAAL_2. This 
  4264. can be changed using tooltypes in the GRAAL Editor icon. (See the 
  4265. end of this chapter.)
  4266.  
  4267.  
  4268. "Quick LOCATE" Buttons
  4269. """"""""""""""""""""""
  4270.  
  4271. To help you quickly locate those parts of a script file which are most 
  4272. often edited, four buttons have been provided. For example, 
  4273. clicking <ACTION:> takes you to the first occurrence of "ACTION:" 
  4274. in the file.
  4275.  
  4276.  
  4277. Switching between Windows
  4278. """""""""""""""""""""""""
  4279.  
  4280. When writing GRAAL scripts, you very often need to make changes 
  4281. to two or more script files almost simultaneously. Fortunately, the 
  4282. GRAAL editor really excels at this.
  4283.  
  4284. Use [amiga>+[w> to open a window containing a list of all currently 
  4285. open editing windows and their contents. In addition, all windows 
  4286. where unsaved changes exist are marked with an asterisk ( * ) 
  4287. before the window number.
  4288.  
  4289. Click on any name in the list, and that window will become active 
  4290. and placed on top of the other windows. You can also use the cursor 
  4291. keys and select a window with the [enter> key. In fact, the GRAAL 
  4292. text editing functions have been designed to make as little use of 
  4293. the mouse as possible - the keyboard is much faster once you get 
  4294. accustomed to using all short-cut keys.
  4295.  
  4296. If you need to view more than one script at the same time, just 
  4297. resize the editing windows and place them next to each other - 
  4298. nothing could be simpler. (Though I must confess I don't use this 
  4299. much myself - window switching is so much easier!)
  4300.  
  4301.  
  4302. 21.6 Creating a Report
  4303. ----------------------
  4304.  
  4305. The "Create Report" option in the GRAAL menu starts the GREP 
  4306. program, provided it is in the development drawer. When the 
  4307. program has finished, the resulting report (always called 
  4308. graal.report) is loaded into a new window in the Editor for viewing 
  4309. (and possibly some cutting and pasting as well).
  4310.  
  4311. The GREP program is described elsewhere in this manual.
  4312.  
  4313.  
  4314. 21.7 The Parameter Editor
  4315. -------------------------
  4316.  
  4317. Instead of typing the parameters of all statements and commands, 
  4318. separating them with ";" or "," characters, you can edit the 
  4319. parameters in a window, with each parameter neatly contained in 
  4320. its own string gadget.
  4321.  
  4322. This is how to do it:
  4323.  
  4324. 1.   Place the cursor on a statement or command - the actual 
  4325.      NAME, mind you, not on one of the parameters.
  4326.  
  4327. 2.   Press [right Amiga] + [E] or click the <Edit Parameters> 
  4328.      button.
  4329.  
  4330. 3.   A window opens, with all parameters neatly laid out in string 
  4331.      gadgets. The number of string gadgets available equals the 
  4332.      number of parameters. Repetitive parameters (surrounded by 
  4333.      brackets {} in the syntax description) only get one string 
  4334.      gadget. You could type the parameters there, but it's often 
  4335.      easier to do these in the normal editor "typewriter" mode.
  4336.  
  4337. The lead text for each gadget is taken from the syntax help - if it's 
  4338. longer than 15 characters, the leftmost characters will not be 
  4339. visible, which may look a little funny at times. Oh well...
  4340.  
  4341. The Parameter Editor window - this one with an OBJECT: 
  4342. statement loaded.
  4343.  
  4344.  
  4345. Keyboard Short-cuts
  4346. """""""""""""""""""
  4347.  
  4348. There are a number of short-cut keys to help you reach the different 
  4349. parts and functions of the window. They can only be used when the 
  4350. cursor is not in an input string gadget. That means after you have 
  4351. entered text into a gadget, press [Enter] to exit the gadget to make 
  4352. the short-cut keys available. Specifically:
  4353.  
  4354. *    When you press the [Tab] key, the next string gadget 
  4355.      (following the last   activated one) will be activated.
  4356.  
  4357. *    When you press the [Enter] key whilst not in an active gadget, 
  4358.      or click <OK>, any changes you have made will be inserted 
  4359.      into the script file.
  4360.  
  4361. *    When you press the [Esc] key or click <Cancel>, the changes 
  4362.      you've started to make will be forgotten, and the window is 
  4363.      closed without any alterations to the script.
  4364.  
  4365. *    When you press [Help] or click <?>, the amigaguide help for 
  4366.      the current statement or command is shown. When you've 
  4367.      done reading up on the subject, press [Esc] to return to the 
  4368.      parameter window.
  4369.  
  4370. *    The graphical editing functions have keyboard short-cuts [F1] 
  4371.      to [F7], as listed further on.
  4372.  
  4373.  
  4374. Optional Parameters
  4375. """""""""""""""""""
  4376.  
  4377. Optional parameters are shown in blue. Consult the on-line 
  4378. reference for information about when to use them (and not).
  4379.  
  4380.  
  4381. Cycle Buttons
  4382. """""""""""""
  4383.  
  4384. If the button to the right of a string gadget is available, you can 
  4385. press this to cycle through the valid alternatives for the parameter. 
  4386. The contents of the gadget will change as you click the button 
  4387. repeatedly.
  4388.  
  4389. UPPERCASE text entered by the cycle button should be kept as is. 
  4390. Occasionally, a text in lowercase may appear, which you should 
  4391. change to a proper value.
  4392.  
  4393. For example, if the text "obj" is shown as one of the cycle 
  4394. alternatives, this means you should replace "obj" with a proper 
  4395. object number.
  4396.  
  4397.  
  4398. Graphical Editing
  4399. """""""""""""""""
  4400.  
  4401. A lot of parameters have to do with specifying co-ordinates, 
  4402. positions and other stuff related to a backdrop picture. You very 
  4403. sledom have to enter the values of these parameters manually - 
  4404. instead, there are a number of special functions to let you do this 
  4405. graphically.
  4406.  
  4407. If a statement or command contain parameters which can be edited 
  4408. in this way, one or more of the special editing buttons beneath the 
  4409. string gadgets will become available. They also have keyboard 
  4410. short-cuts in the form of keys [F1] to [F8]. 
  4411.  
  4412. Usually, the editor finds the relevant backdrop picture and room 
  4413. file to use automatically, but may occasionally ask you for a file 
  4414. name when it cannot decide which part of the adventure you are 
  4415. referring to.
  4416.  
  4417. Sometimes, the editor asks "Reload the object and image data?". If 
  4418. you haven't altered any images, or switched rooms or anything 
  4419. since the last time you used the graphical editing functions, you can 
  4420. answer "no", which speeds up the process. 
  4421.  
  4422. If the backdrop picture is one of the rooms in your game, all 
  4423. previously defined objects placed in that room are also shown for 
  4424. reference. In many cases, floors and paths are also shown, with 
  4425. their respective numbers shown close to the center of the each floor 
  4426. and path. If the backdrop picture is wider than the screen, use the 
  4427. left and right cursor keys to scroll it.
  4428.  
  4429. Note: If objects overlap, the editor does not bother to sort them in 
  4430. the proper order. 
  4431.  
  4432. The details of all the "graphical editing" operations are explained 
  4433. below, and there is also a brief help text on a screen directly below 
  4434. the picture you are about to edit. Once you are done, press "Enter" 
  4435. to save the changes, or "Esc" to cancel. 
  4436.  
  4437.  
  4438. Important Tips
  4439. """"""""""""""
  4440.  
  4441. *    Make sure all statements and commands specifying picture 
  4442.      file names, which help the editor choose the right file, are 
  4443.      entered as early as possible in the script-writing process. 
  4444.  
  4445. *    Remember that the editor mainly loads data from the files 
  4446.      saved to disk, not from unsaved versions of the files still in the 
  4447.      editor. Therefore, you should usually save changes before 
  4448.      going to the parameter editor.
  4449.  
  4450. *    When selecting character images in multiple character games, 
  4451.      note that most character-related statements and commands 
  4452.      expect you to specify the image of character 1, which will be 
  4453.      replaced by the corresponding image for the currently 
  4454.      controlled character automatically. See "Multiple Characters 
  4455.      and Inventories" on page 42.
  4456.  
  4457. Now, a closer look at the "graphical editing" buttons:
  4458.  
  4459.  
  4460. <Area> [F1]
  4461. """""""""""
  4462.  
  4463. An area or "frame" is a rectangle that can be moved around the 
  4464. screen and re-sized. It is used to cut out clipart graphics, and for 
  4465. specifying areas for exits, floors, and a number of other things. 
  4466.  
  4467. To re-size, click and drag the bottom left corner (the little square) 
  4468. of the rectangle. To move the rectangle, click and drag anywhere 
  4469. else on the screen.
  4470.  
  4471. If you use this option to edit the cut-out frames for BOB images, you 
  4472. will get a number of rectangles on screen corresponding to the 
  4473. number of images to be cut out by the ...BOBS: statement. Use the 
  4474. leftmost rectangle to re-size: all duplicate frames will also be re-
  4475. sized automatically. To alter the spacing between the frames, use 
  4476. the up and down cursor keys.
  4477.  
  4478. Editing areas for a BOBS: statement. If you look closely, you may be 
  4479. able to see the 10 cut-out frames on the second row of images in this 
  4480. screen shot (it's easier in real life :).
  4481.  
  4482.  
  4483. <Position> [F2]
  4484. """""""""""""""
  4485.  
  4486. This edits the position of an image, and possibly also the image 
  4487. number.
  4488.  
  4489. If the previous position and image used are known, the object or 
  4490. image will start out in its old position. 
  4491.  
  4492. Click and hold the mouse button. Drag the mouse to move the 
  4493. image to the desired location and release. (If it's an object, a copy of 
  4494. the image will remain the object's previous position when you drag 
  4495. the image.)
  4496.  
  4497. To select another image, use the up and down cursor keys.
  4498.  
  4499. To flip the image left/right, press the "x" key.
  4500.  
  4501. Note: When you save the changes with the "Enter" key, the selected 
  4502. image will normally be placed in the "image" parameter. However, 
  4503. if the "image" parameter previously contained an animation 
  4504. sequence or a PTRN specification, it will NOT be affected. This is 
  4505. to prevent a lot of hard work being undone by an over-smart 
  4506. editor...
  4507.  
  4508.  
  4509. <Pastepos> [F3]
  4510. """""""""""""""
  4511.  
  4512. This is exactly the same as editing an image position, except the 
  4513. parameters specify the upper left corner of the image, not the 
  4514. hotspot position. This is nothing YOU have to worry about - the 
  4515. Editor will make the correct button available and also take care of 
  4516. which co-ordinate goes where.
  4517.  
  4518.  
  4519. <Char.pos> [F4]
  4520. """""""""""""""
  4521.  
  4522. Very similar to the previous two, but only available when editing 
  4523. an object. This sets the main character's position relative to the 
  4524. object, used in the MOBJ command. The image used for the main 
  4525. character can also be altered. The same rules as for the object 
  4526. positioning apply.
  4527.  
  4528. As from GRAAL 2.2, the Editor asks you if the character width 
  4529. should be taken into consideration. Answering "yes" means GRAAL 
  4530. will calculate the position of the edge of the character closest to the 
  4531. object, rather than the center of the image. This is only a concern if 
  4532. you have multiple characters with varying widths that can try to 
  4533. manipulate the object.
  4534.  
  4535.  
  4536. <Line> [F5]
  4537. """""""""""
  4538.  
  4539. This one edits the line for a PATH: statement. Each point on the 
  4540. line (there may be up to 6 of them) has a "handle" in the form of a 
  4541. small square. Just click within the handle and drag to move the 
  4542. point to a new place.
  4543.  
  4544. To add a new point, press the "arrow up" key. The new point will be 
  4545. inserted between the last and the second last point.
  4546.  
  4547. To delete a point, press the "arrow down" key. It is always the 
  4548. second last point that is deleted.
  4549.  
  4550.  
  4551. <Ink> [F6]
  4552. """"""""""
  4553.  
  4554. This one's a little different. Many commands require colour 
  4555. numbers to be specified, and this helps to pick the correct palette 
  4556. index number directly from the palette of the relevant backdrop 
  4557. picture.
  4558.  
  4559. When the picture is shown, a palette overlays the upper left corner 
  4560. of the picture. The text above the screen tells you to click on a colour 
  4561. - the "normal ink" colour for things like text displays, and the 
  4562. "background ink", which is the colour most functions use to erase or 
  4563. clean up unwanted parts of the picture.
  4564.  
  4565. The "highlight ink" colour is only used in the sentence display area. 
  4566. It is the colour used when a completed sentence is highlighted 
  4567. during command execution.
  4568.  
  4569.  
  4570. <File> [F7]
  4571. """""""""""
  4572.  
  4573. Not a very graphical function, but this button can be used to select 
  4574. a file name. If you have an AGA machine, the file requester that 
  4575. pops up will show only files of certain types, depending on the 
  4576. statement or command you are currently editing. For example, for 
  4577. the BG_IFF: statement, only picture files will be shown; for the 
  4578. TRACK command, only music modules will be shown. The filter 
  4579. settings can be changed using the tooltypes in the GRAAL Editor 
  4580. icon. See the end of this chapter. If it's a room file that is wanted, 
  4581. the Editor always uses the special "load room" requester which also 
  4582. shows the room descriptions.
  4583.  
  4584.  
  4585. <3D> [F8]
  4586. """""""""
  4587.  
  4588. This one edits the position of the 3D scaling lines in the 3D: 
  4589. statement. Just drag each line to its proper position along the y 
  4590. axis. Each line has a box attached to the top - the box represents the 
  4591. scale of the character, so the line with the smallest box should be 
  4592. the one furthest up the picture, and so on.
  4593.  
  4594. Inserting New Statements or Commands Using <Edit 
  4595. Parameters>
  4596.  
  4597. If you place the cursor on an empty line and use <Edit 
  4598. Parameters>, a list requester pops up asking you if you wish to 
  4599. insert a new statement. All valid statements (according to the 
  4600. script type) are shown in the list. Select a statement with the up 
  4601. and down arrow keys, or with the mouse. With a statement 
  4602. selected, you can also click the <?> button or press [Help] to read 
  4603. the amigaguide help for the statement.
  4604.  
  4605. Select the statement with [Enter], the <OK> button, or by clicking 
  4606. it a second time with the mouse. A new line containing the 
  4607. statement will be inserted at the cursor position, and the 
  4608. parameter editor window is opened automatically.
  4609.  
  4610. Similarly, positioning the cursor on a line that has a statement, but 
  4611. neither on the statement nor the existing command names, brings 
  4612. up a requester asking if you wish to insert a new condition or 
  4613. command. Be careful not to insert a new command in the middle of 
  4614. parameters belonging to another command...
  4615.  
  4616. Note: .scene files can't contain statements. Therefore, it's always 
  4617. the condition/command list that appears when using the <Edit 
  4618. Parameters> function in an empty space.
  4619.  
  4620.  
  4621. 21.8 Icon Tooltypes
  4622. -------------------
  4623.  
  4624. Some aspects of the Editor's operation can be changed using the 
  4625. following tooltypes:
  4626.  
  4627. SCREEN=WB|NTSC|PAL
  4628.                WB: The editor will open in the current Workbench screen 
  4629.                mode. NTSC: The screen opens in hires NTSC mode. PAL: The 
  4630.                screen open in hires PAL mode.
  4631.  
  4632. (Note: The SCREEN tooltype only works with AGA machines.)
  4633.  
  4634. GRAAL=name     Sets the name of the GRAAL driver program being 
  4635.                started with the Editor´s <RUN!> button.
  4636.  
  4637. IMAGEFILTER=filter
  4638.                Specifies which files should be shown by the file requester 
  4639.                when the FILE button in the Parameter Editor window is 
  4640.                used to find images. The default is
  4641.  
  4642.                #?.iff|#?.pic|#?.i16|#?.i32|#?.i64
  4643.  
  4644. TRACKFILTER=filter
  4645.                Specifies which files should be shown by the file requester 
  4646.                when the FILE button in the Parameter Editor window is 
  4647.                used to find music modules. The default is
  4648.  
  4649.                #?.trk|#?.track|#?.mod|#?.sng
  4650.  
  4651. SAMPLEFILTER=filter
  4652.                Specifies which files should be shown by the file requester 
  4653.                when the FILE button in the Parameter Editor window is 
  4654.                used to find samples for sound effects. The default is
  4655.  
  4656.                #?.snd|#?.raw|#?.8svx
  4657.  
  4658. CHECKONSAVE=YES|NO
  4659.                If this is set to yes, a syntax check will be automatically 
  4660.                performed as soon as you try to save a script file. 
  4661.                If an error occurs and you click the <Cancel> button in the 
  4662.                error report box, the file will not be saved. Clicking 
  4663.                <Continue> allows you to save the file with the errors in it.
  4664.  
  4665. PAINTAPP=path:name [arguments]
  4666.                The path and name of a paint program, which can be launched
  4667.                directly from the Editor's GRAAL menu. Some paint programs
  4668.                may accept command line arguments and even a file name. In 
  4669.                this case, put {f} in the place of the file name - GRAAL will 
  4670.                then open a file requester, using the imagefilter specification, 
  4671.                before starting the paint application. (This works wonderfully
  4672.                well with DPaint.)
  4673.  
  4674.  
  4675. 21.9 Editor Keyboard Shortcuts
  4676. ------------------------------
  4677.  
  4678. ("a" means the key must be combined with the right [Amiga] key.)
  4679.  
  4680. a[3]      Open new window & Load any file           
  4681. a[4]      Open new window & Load graal.main          
  4682. a[5]      Open new window & Load .room script           
  4683. a[6]      Open new window & Load .section script           
  4684. a[7]      Open new window & Load .scene script           
  4685. a[8]      Open new window & Load .ptrn script
  4686.  
  4687. a[S]      Save                   
  4688. a[A]      Save As                         
  4689. a[P]      Print
  4690. a[?]      About                            
  4691. a[Q]      Quit           
  4692.  
  4693. a[W]      Select Window           
  4694. a[I]      Insert Mode                      
  4695. a[O]      Overstrike Mode                                                        
  4696. a[F]      Find           
  4697. a[N]      Find Next           
  4698. a[R]      Replace          
  4699. a[1]      Mark Block Start                 
  4700. a[2]      Mark Block End                  
  4701. a[T]      Top           
  4702. a[B]      Bottom          
  4703. a[C]      Copy           
  4704. a[X]      Cut          
  4705. a[V]      Paste          
  4706. a[D]      Delete Current Line
  4707. a[Z]      Undo "Delete Current Line"
  4708. a[J]      Stack windows
  4709. a[L]      Tile windows horizontally
  4710. a[M]      Tile windows vertically
  4711.  
  4712. a[K]      Check Syntax           
  4713. a[E]      Edit Parameters 
  4714. a[G]      Launch GRAAL
  4715. a[H]      Create and load GREP report
  4716. a[U]      Launch paint program
  4717.  
  4718. [Shift] + [Left Arrow]             Start of line 
  4719. [Shift] + [Right Arrow]            End of line 
  4720. [Shift] + [Up Arrow]               Page up 
  4721. [Shift] + [Down Arrow]             Page down 
  4722. [Ctrl]  + [Right Arrow]            Next parameter ( ";" character ) 
  4723.  
  4724.  
  4725. [Help]    Show Amigaguide help for current statement / command
  4726.  
  4727. [Esc]     Close current window / requester 
  4728. [Enter]   Exit current input string gadget, or close requester and 
  4729.           execute function (depending on current situation). 
  4730. [Tab]     Activate next input string gadget (can only be done if previous 
  4731.           string gadget has been deactivated with [Enter] first). 
  4732.  
  4733. [F1]      Run GRAAL from Editing Window
  4734. [F2]-[F5] Quick locate buttons in Editing Window
  4735.  
  4736. [F1]-[F8] Editing buttons in Parameter Editing Window
  4737.  
  4738.  
  4739.  
  4740.  
  4741. 22   Hints and Tips
  4742. ===================
  4743.  
  4744.  
  4745. Here are some general hints and tips that may prove useful.
  4746.  
  4747.  
  4748. 22.1 Flags
  4749. ----------
  4750.  
  4751. *    Avoid setting flags in cutscenes, if you have a choice. It's hard 
  4752.      to keep track of the games' status in the main script files if the 
  4753.      setting of flags is "hidden from sight" in the cutscenes. (And 
  4754.      forget I mentioned I've done just the opposite in a few places. 
  4755.      Do as I say, not as I do! :-)
  4756.  
  4757. *    Since all variables have the initial value 0, it is good practice 
  4758.      to let that value represent the initial state of the object, room, 
  4759.      situation, etc.
  4760.  
  4761. *    Use room flags for all things that relate to the scene as a 
  4762.      whole, rather than the flags of a particular object.
  4763.  
  4764. *    Remember that ALL aspects of room objects and section 
  4765.      objects get reset as soon as you leave the room or section. You 
  4766.      can compensate for this using room flags to track room object 
  4767.      states, and then set the objects up in whatever way they 
  4768.      should be by using DACT statements.
  4769.  
  4770. *    Use the room flags for room 0 as "global flags" pertaining to 
  4771.      the game as a whole. Room 0 is never used as a "real" room in 
  4772.      any adventure.
  4773.  
  4774.  
  4775. 22.2 Diverse
  4776. ------------
  4777.  
  4778. *    During the development of a game, you often wish to start the 
  4779.      game in an odd location with the objects and flags required set 
  4780.      up in a special way. To keep your proper game scripts "clean", 
  4781.      set up a special testing room and call this as the 
  4782.      START_ROOM. Get objects and set flags using DACT:s, and in 
  4783.      the last DACT:, simply GOTO the location you wish to test.
  4784.  
  4785. *    Keep a template containing comments for all the ACTION: 
  4786.      statements in a separate file, and copy it to the end of each 
  4787.      new room and section script. This way, you have a map over 
  4788.      what command has what number handy in all scripts.
  4789.  
  4790.  
  4791.  
  4792.  
  4793. 23   Questions and Answers
  4794. ==========================
  4795.  
  4796.  
  4797. Q: Anything I should think about when assigning BOB numbers to 
  4798. objects?
  4799.  
  4800. A: Use numbers below 60. Make sure a BOB number is never used 
  4801. for more than one thing at a time in the same room. Otherwise, 
  4802. no: No information is connected to or "belongs to" BOB numbers 
  4803. and their use, so there are no other fixed rules.
  4804.  
  4805.  
  4806. Q: What about animation channels then?
  4807.  
  4808. A: Same thing. Look up the reserved channel numbers in 
  4809. graal.guide, and make sure you never try to use the same channel 
  4810. for two things in the same room!
  4811.  
  4812.  
  4813. Q: What are the rules for room object use?
  4814.  
  4815. A: A room object can only exist in one room - therefore, it can never 
  4816. be picked up or added to the inventory. Nor can you use its object 
  4817. flags for very much, because they will be reset each time you exit 
  4818. the room.
  4819.  
  4820. ROBJ references should only exist in .room files, never in .sect or 
  4821. graal.main!
  4822.  
  4823.  
  4824. Q: What are the rules for section object use?
  4825.  
  4826. A: A section object only exists within one section, and preferably 
  4827. disappears totally during the first visit to the section - otherwise, 
  4828. you must keep track of how the objects have been handled via room 
  4829. flags or such devices, if you happen to re-enter the section.
  4830.  
  4831. In other words, take particular care if your adventure is designed 
  4832. in such a way that you can go back to, for example, section 1 from 
  4833. section 2 - not only must you be sure that section 1 still looks okay 
  4834. with respect to section object use, but also, the section 2 section 
  4835. objects will suffer the same problems! Even if you haven't "solved" 
  4836. section 2 yet completely, going back to section 1 will end your first 
  4837. visit to section 2 and thus reset your section objects for section 2!!
  4838.  
  4839. SOBJ references should only be used in .room and .sect files, not in 
  4840. the .main file.
  4841.  
  4842.  
  4843. Q: I need some very precise movement paths for my character in 
  4844. some situations, and the floor system is not quite up to the job.
  4845.  
  4846. A: There are a couple of ways.
  4847.  
  4848. A) Try using PATH: statements. 
  4849.  
  4850. These allow you to connect otherwise unconnected floors using 
  4851. "twisting" paths. Read more in the room PATHS: statement in the 
  4852. on-line reference.
  4853.  
  4854. B) Use an un-named exit.
  4855.  
  4856. When you specify an EXIT: with no description, GRAAL shows no 
  4857. exit name in the scene area, nor does it put a "Go to ..." message in 
  4858. the sentence box when the exit is clicked. That way the un-named 
  4859. exit is just a "clickable area" in the scene area, and you can use 
  4860. ACTION: 0;... statements for it to do anything you like.
  4861.  
  4862. 1.   Put an un-named exit over the destination on the screen your 
  4863. character should reach using a special movement or animation.
  4864.  
  4865. 2.   In the ACTION: statements, use whatever commands you 
  4866. need to transport the character to the destination point: 
  4867. Perhaps first an ordinary CMOVE to the closest edge of the 
  4868. actual floors, and then OMOVE 0... to make the final part (up 
  4869. the ladder, down the hole, or whatever).
  4870.  
  4871. Note: Remember, if you move the character outside the normal floor 
  4872. area, you are in a bit of trouble if he must also be able to return: If 
  4873. you click outside your unnamed exit, the normal floor system will 
  4874. try to move the character the normal way, and if it is no longer in 
  4875. any floor area... well, problems arise. They can be dealt with, 
  4876. though, using some careful planning. The easiest way is to make 
  4877. sure the player does not get the opportunity of clicking anywhere 
  4878. before the character is safely back on a legal floor again! Some 
  4879. clever use of a number of un-named exits together with 
  4880. SHOWEXIT and HIDEEXIT commands may do the trick.
  4881.  
  4882.  
  4883. Q: I have the need for menu-style pictures with multiple user 
  4884. options.
  4885.  
  4886. A: Yes, why not indeed? Just use EXIT: statements with no name/
  4887. description to define the clickable areas needed on screen, and then 
  4888. ACTION: 0;... statements to handle the player input. 
  4889.  
  4890. Or, define room objects that are actually buttons.
  4891.  
  4892. Or, use the multiple inventories and put your menu selecting in a 
  4893. special inventory, then access them with some special "select" 
  4894. command.
  4895.  
  4896. There's more than one way to fling an otter...
  4897.  
  4898.  
  4899. Q: I want a way to show the player's score at any time!
  4900.  
  4901. A: The neatest (and quickest) way is probably to put a "SCORE" 
  4902. button in the command area using the VERB_ZONE: and 
  4903. VERB_TEXT: statements in the graal.main file. VERB_TEXT: 
  4904. allows you to define "direct verbs", that is, commands that do not 
  4905. wait for or use an object. If you define a verb "SCORE" and make 
  4906. that a direct verb, you can then use a TEXT command to display the 
  4907. score held in a flag (preferably a room flag for room 0 - as mentioned 
  4908. elsewhere, these make excellent "global flags").
  4909.  
  4910.  
  4911.  
  4912. Q: I don't quite understand the FLOOR: statements.
  4913.  
  4914. A: The best description is in graal.guide. Make sure you read ALL 
  4915. the information about FLOOR: and PATH: there - it's even got 
  4916. some diagrams! Then look at one of the rooms in the demo 
  4917. adventure to put theory to practice.
  4918.  
  4919.  
  4920. Q: I'm trying to run the GRAAL editor and GRAAL in parallel, but 
  4921. changes I make to the scripts in the editor do not seem to take 
  4922. effect, even though I'm sure I have saved them to disk.
  4923.  
  4924. A: Check this:
  4925.  
  4926. 1.   You must exit the room / situation where updates were made 
  4927. and then re-enter to force a reload of the scripts in question. 
  4928. Alternatively, use the "Go to" button in the on-line monitor, 
  4929. which also forces a reload.
  4930.  
  4931. 2.   You must have MAX_CACHE: 0 in graal.main before starting 
  4932. GRAAL for this. Otherwise, an old copy of the script file still in 
  4933. memory will probably be used instead of your updated version.
  4934.  
  4935. 3.   Changes to graal.main NEVER take effect without restarting 
  4936. the game. 
  4937.  
  4938.  
  4939. Q: After playing a tune with the TRACK command, samples played 
  4940. with the SAM command get caught in a loop!
  4941.  
  4942. A: Naughty you - you have probably used the undocumented MED-
  4943. module feature of GRAAL! It can play MED modules (MMD0 and 
  4944. MMD1 formats), provided you have the file extension ".med" in the 
  4945. module name. However, this causes the above bug in the sample 
  4946. routines to appear - this is Amos's fault. I know there exists an 
  4947. Amos bugfix or work-around for this, but I DON'T HAVE IT. If 
  4948. anyone has seen it, mail it pronto, and the med support will be 
  4949. made official!
  4950.  
  4951. Q: The command area behaves strangely - it doesn't go away when 
  4952. I tell it to in CUTSCENE commands.
  4953.  
  4954. A: You have probably not put it back correctly in a previous 
  4955. cutscene. All sequences of events that start with either 
  4956. CUTSCENE ...,NF or CUTSCENE ...,F must end with an 
  4957. equivalent CUTSCENE ...,N or CUTSCENE ...,S. ALWAYS restore 
  4958. the command area before doing a DSET - it may seem the DSET 
  4959. restores it for you after the dialogue has ended, but not really 100%. 
  4960. This goes for the COMAREA command, too. COMAREA OFF is just 
  4961. another way of saying CUTSCENE "blank file",NF, and 
  4962. COMAREA ON is equivalent to CUTSCENE "blank file",N
  4963.  
  4964. Q: The song I'm playing with the TRACK command doesn't stop 
  4965. after playing through once, but starts over in a weird tempo.
  4966.  
  4967. A: Unfortunately, the tracker "stop song" command 0FFE stopped 
  4968. working with the tracker command set I started using in GRAAL 
  4969. 2.1. Fortunately, there is a way around this: At the very end of the 
  4970. song, put a blank block, and have that block repeat itself by putting 
  4971. a tracker "jump" command (0B..) in it.
  4972.  
  4973. Q: 1. A scaled character changes its size when it starts moving/
  4974. stops moving. 
  4975. 2. A character following the controlled character is not of the same 
  4976. size!
  4977.  
  4978. A: You have been unlucky with the way the 3D scaling zones (in the 
  4979. room 3D: statement) coincide with the FLOOR: settings. There are 
  4980. a number of things you can try to make it all look nicer:
  4981.  
  4982. 1.   Make sure the 3D zone boundaries are not set too close to a 
  4983. "character position" like EXIT: points, START_POS: points or 
  4984. object-handling positions. This gets rid of problem 1.
  4985.  
  4986. 2.   Make sure each floor is within one and only one scaling zone, 
  4987. and add some space for the following character´s y offset 
  4988. around the floor edges as well. Then connect the floors with 
  4989. paths. This should get rid of problem 2.
  4990.  
  4991.