home *** CD-ROM | disk | FTP | other *** search
/ The GRAAL Herald 1 / GraalHerald1.lha / GraalHerald1 / Editor.txt < prev    next >
Text File  |  1996-11-27  |  21KB  |  565 lines

  1. Note: This text has been revised since the 2.0 beta 1 release!
  2.  
  3.  
  4.  
  5.  
  6.                          The GRAAL Script Editor
  7.                          =======================
  8.  
  9.                                Version 2.0
  10.  
  11.  
  12.  
  13.  
  14. Introduction
  15. ------------
  16.  
  17. This is a neat little (well, growing bigger all the time, actually) editor, 
  18. making life in the GRAAL script-writing lane much easier than it otherwise
  19. would be.
  20.  
  21. At first, you may find the concept behind it all slightly confusing. While
  22. other "user-friendly" games development systems opt for point-and-click
  23. control of everything, storing the results in "unreadable" databases, GRAAL
  24. is basically made up of ASCII scripts that can be created using any text
  25. editor. While this requires more typing and a deeper understanding of
  26. the internal workings of the system, it also has some big advantages.
  27. It means greater flexibility in your creations, a better overview, and a
  28. total freedom when it comes to documenting the scripts via comment lines
  29. the way YOU feel like doing it.
  30.  
  31. The 2.0 version of the GRAAL editor now steps in to bring you the best
  32. of the "point'n'click world", too. It makes the typing of the scripts a LOT
  33. easier, and you will not want to be without it.
  34.  
  35. In short, the editor spares you from annoying things such as trying to
  36. remember what script does what, what the parameters of the "OBJECT:"
  37. statement were, and what the coordinates of your last 6 FLOOR: and PATH:
  38. definitions actually looks like on screen. The end result is the same as
  39. you would get with any other editor, though - ASCII script files with
  40. lists of GRAAL statements and commands.
  41.  
  42. In addition, the GRAAL editor has the following advantages:
  43.  
  44. * It handles multiple scripts in multiple windows simultaneously, with
  45.   easy switching, copying and pasting between them.
  46.  
  47. * It is connected to the on-line reference, giving help on statements
  48.   and commands.
  49.  
  50. * It keeps track of used and unused room, section, scene, and ptrn
  51.   numbers.
  52.  
  53. * Although many features are GRAAL-related, it is perfectly possible to use
  54.   this editor to edit any kind of ASCII text file. You will probably find
  55.   it a good alternative. Enjoy!
  56.  
  57. The editor handles files up to 5000 lines long. (If you have GRAAL scripts
  58. that long, you are probably in need of professional help :-)
  59.  
  60.  
  61.  
  62.  
  63. System Requirements
  64. -------------------
  65.  
  66. This editor needs Workbench 2.0 or better (preferably 3.0+) to work.
  67.  
  68. amigaguide.library v. 34 or later must be in your LIBS: drawer.
  69. (This can be found for free on Aminet.)
  70.  
  71. On AGA machines, the editor screen "clones" your Workbench setting, so if
  72. you have a hi-res Workbench, it uses a hi-res screen; with a Productivity
  73. Workbench, it opens in Productivity mode... you get the picture. Just make
  74. sure that your Workbench is at least 640 pixels wide, and everything should
  75. operate smoothly. On non-AGA machines, a normal hi-res, non-interlaced
  76. screen is used.
  77.  
  78. Also note that the editor must be placed in your game development library
  79. on your hard disk for all file fetching routines to operate without problems.
  80.  
  81. The GRAAL.guide file should also be placed in the same directory.
  82.  
  83.  
  84.  
  85. Known bugs & Irritating Facts
  86. -----------------------------
  87.  
  88. * Sometimes when you re-size a window other than the currently active, the
  89.   display in that window becomes corrupted. Put the window in front and
  90.   activate before re-sizing, this should help you avoid any problems. In
  91.   most cases, you are better off using the "Select Window" functions to
  92.   switch between windows, anyway.
  93.  
  94. * A block marked for editing and contained in a single screen line is
  95.   sometimes not properly highlighted on screen. However, the copy/cut/delete
  96.   functions still work.
  97.  
  98.  
  99.  
  100.  
  101.                          WORKING WITH THE EDITOR
  102.                          =======================
  103.  
  104.  
  105.  
  106. Creating a New Script
  107. ---------------------
  108.  
  109. Since the editor expects to be placed in your GRAAL development directory, 
  110. it checks for a graal.main file in the current directory at start-up -
  111. without such a file, you don't really have much of a development environment!
  112.  
  113. If there is no graal.main file, the editor asks if one should be created.
  114. If you answer "yes", a template for such a script will be created in the
  115. editing window (which makes up the main part of the editor display).
  116.  
  117. You can also use the "New" option in the "Project" menu to create a new
  118. file. The "New" option has six suboptions. The first one, "empty", just
  119. opens a new, empty editing window on top of the first one. The editor
  120. handles up to ten script windows simultaneously, and you can switch
  121. between them quite easily with the "Select Window" option in the "Edit" menu
  122. (or <Amiga>+<W>).
  123.  
  124. The suboption "graal.main" creates a graal.main script template, as
  125. discussed above.
  126.  
  127. The last four suboptions, ".room", ".section", ".scene", and ".ptrn"
  128. creates a template for the specified script type. Before the template
  129. is shown, a requester pops up showing a recommended script number - this
  130. number is the first number not already occupied by any of the existing
  131. scripts. You can change it if you wish, but remember that it's a waste
  132. of space leaving unnecessary gaps in the number sequences.
  133.  
  134. The requester also has a gadget for a short script description - you should
  135. enter a meaningful description of the room, cutscene or whatever here.
  136. This comment is placed in the first (comment) line of the script, and
  137. you will see why it's so useful is a very short while... in the next
  138. section, as it were!
  139.  
  140.  
  141.  
  142. Loading Existing Scripts
  143. ------------------------
  144.  
  145. The "Load" option, also in the "Project" menu, has the same selection of
  146. suboptions as the "New" option. (The only difference is that "empty" is
  147. replaced by "general" here.)
  148.  
  149. "Load general" brings up an ordinary file requester.
  150.  
  151. "Load graal.main file" loads the graal.main straight away - not much use
  152. asking for its name, because it's always the same.
  153.  
  154. "Load .room file" and so on brings up a list requester showing the numbers
  155. and descriptions (see above) of all existing scripts of the desired type, 
  156. neatly sorted i ascending order.
  157.  
  158. Most of the time, you probably want to open a script in a new window, which
  159. is why you should use the "Open & Load" option instead. It looks exactly
  160. like the "Load" options, but in this case, the suboptions have keyboard
  161. shortcuts (<amiga>+<3-8>). Learn to use them, as this is the quickest way
  162. to open scripts.
  163.  
  164.  
  165.  
  166. The Templates and the Syntax Checker
  167. ------------------------------------
  168.  
  169. Some statements in the templates have some suggested parameters already
  170. filled in. In most cases there is no point in giving a suggestion, though, 
  171. because the correct parameters are very much up to yourself. You can see
  172. this quite easily:
  173.  
  174. 1) Create a new .room script, making the editor give you a room script
  175. template. Now press the button marked "Syntax". This will make the editor
  176. check the script in the current window for syntax errors, and it will not
  177. be very long before it comes upon a statement with no parameter filled in.
  178. It then displays an error message telling you about the problem, and it
  179. also marks the statement where the error occurs.
  180.  
  181. The syntax checker is a great help, but it does not find every possible
  182. error. This is what it does:
  183.  
  184. * It checks the names of all statements.
  185.  
  186. * It checks that all mandatory statements are in place. However, note that
  187.   some statements may depend on others to work, and this is not checked by
  188.   this function. Be particularly careful with graphics, and make sure the
  189.   correct CLPART: statement is in effect in every situation requiring
  190.   CLPART pictures!
  191.  
  192. * It checks the number of parameters for all statements (except for
  193.   statements with a variable number of parameters).
  194.  
  195. * For all parameters that may consist of conditions, commands, or both, 
  196.   it checks the name of each condition and command.
  197.  
  198. If any error is found, the offending statement / command is highlighted, 
  199. and the nature of the error is shown in a requester as described above.
  200.  
  201. Note: The syntax checker uses the file name suffix to determine what
  202. statements and commands are allowed - so it can only be used in files
  203. following the GRAAL naming conventions. And it does NOT work with .ptrn
  204. files.
  205.  
  206.  
  207. All this should make development a little less frustrating. However, GRAAL
  208. itself checks a lot of other stuff too, and will still throw runtime errors
  209. at you from time to time. Further improvements will probably appear over
  210. time.
  211.  
  212.  
  213.  
  214. Amigaguide Help
  215. ---------------
  216.  
  217. If you place the cursor on a statement or command word and press the HELP
  218. key, the amigaguide reference file is opened with the relevant topic
  219. displayed. (The small <?> button does the same thing.)
  220.  
  221. Note that just like the syntax checker, the help function uses the file
  222. name suffix to determine what statements and commands are allowed - so it
  223. can only be used in files following the GRAAL naming conventions.
  224.  
  225.  
  226.  
  227. Normal Editing Functions
  228. ------------------------
  229.  
  230. I will not bother you too much about the functions that you are likely
  231. to encounter in any text editor. You should find the find & replace options, 
  232. and the other options of the "Edit" menu, quite adequate for the job at hand.
  233.  
  234. Just a few words about useful keyboard keys:
  235.  
  236. <shift>+<down arrow>
  237. <shift>+<up arrow>      These keys scrolls the script one page at a time.
  238.  
  239. <shift>+<right arrow>   Moves the cursor past the last character of the line.
  240.  
  241. <shift>+<left arrow>    Moves the cursor to the beginning of the line.
  242.  
  243. <control>+<right arrow> Moves to the next semi-colon of the line; that is, 
  244.                         to the next GRAAL statement parameter.
  245.  
  246. <esc>                   Close the current window.
  247.  
  248. <enter>                 Exit a string gadget (for example, in the Find
  249.                         window), or carry out a function (for example, 
  250.                         "Find" in the find window, once the cursor is not
  251.                         in a string gadget anymore).
  252.  
  253. Other available shortcut keys are all listed in the menus.
  254.  
  255.  
  256.  
  257. Marking Text Using the Mouse
  258. ----------------------------
  259.  
  260. Apart from marking text blocks with <amiga>+<1> and <amiga>+<2>, you can use
  261. the mouse:
  262.  
  263. 1   Click the first character of the block.
  264.  
  265. 2   Hold down a <shift> key and click the character immediately to the right
  266.     of the last character of the block. (Clicking the first character of a
  267.     line will mark the entire previous line.)
  268.  
  269.  
  270.  
  271. The Status Bar
  272. --------------
  273.  
  274. Some useful bits of information are shown in the "status bar" immediately
  275. above the editing windows:
  276.  
  277. 1   Cursor row (r) and column (c) position.
  278.  
  279. 2   Insert (I) or overstrike (O) write mode.
  280.  
  281. 3   Number of changes made since the last save. Note that some "big"
  282.     operations, like inserting a block of text, only count as one change
  283.     each!
  284.  
  285. 4   Time. The clock is only updated when you do something in the editor, 
  286.     like moving the cursor.
  287.  
  288.  
  289.  
  290. "Quick Positioning" Keys
  291. ------------------------
  292.  
  293. To help you quickly locate those parts of a script file which are most
  294. often edited, four buttons have been provided. For example, clicking
  295. <ACTION:> takes you to the first occurence of "ACTION:" in the file.
  296.  
  297.  
  298.  
  299. Switching between Windows
  300. -------------------------
  301.  
  302. When writing GRAAL scripts, you very often need to make changes to two or
  303. more script files almost simultaneously. Fortunately, the GRAAL editor
  304. really excels at this.
  305.  
  306. Use <amiga>+<w> to open a window containing a list of all currently open
  307. editing windows and their contents. In addition, all windows where unsaved
  308. changes exist are marked with an asterisk ( * ) before the window number.
  309.  
  310. Click on any name in the list, and that window will become active and placed
  311. on top of the other windows. You can also use the cursor keys and select
  312. a window with the <enter> key. In fact, the GRAAL text editing functions
  313. have been designed to make as little use of the mouse as possible - the
  314. keyboard is much faster once you get accustomed to using all shortcut keys.
  315.  
  316. If you need to view more than one script at the same time, just resize the
  317. editing windows and place them next to each other - nothing could be simpler.
  318. (Though I must confess I don't use this much myself - window switching is
  319. so much easier!)
  320.  
  321.  
  322.  
  323.  
  324.  
  325.                           THE PARAMETER EDITOR
  326.                           ====================
  327.  
  328.  
  329. Would you believe me if I told you there's an editor in the editor? Well, 
  330. it's true. Instead of typing in the parameters of statements and commands, 
  331. separating parameters with ";" or "," characters, you can edit the
  332. parameters in a window instead, with each parameter neatly contained in
  333. its own string gadget. This is how to do it:
  334.  
  335. Place the cursor on a statement or command - the actual NAME, mind you, 
  336. not on one of the parameters.
  337.  
  338. Press right Amiga + E or click the <Edit Parameters> button.
  339.  
  340. A window opens, with all parameters neatly laid out in string gadgets.
  341. The number of string gadgets available equals the number of parameters.
  342. Repetitive parameters (surrounded by brackets {} in the syntax description)
  343. only get one string gadget. You could type the parameters there, but it's
  344. often easier to do these in the normal editor "typewriter" mode.
  345.  
  346. The lead text for each gadget is taken from the syntax help - if it's
  347. longer than 15 characters, the leftmost characters will not be visible, 
  348. which may look a little funny at times. Oh well...
  349.  
  350. When you press the Enter key, any changes you have made will be inserted
  351. into the script file. Press the Esc key if you want to forget about the
  352. changes you've started to make.
  353.  
  354.  
  355.  
  356. Optional Parameters
  357. ------------------
  358.  
  359. Optional parameters are shown in blue. Consult the on-line reference if
  360. you do not know what they are used for.
  361.  
  362.  
  363.  
  364. Cycle Buttons
  365. -------------
  366.  
  367. If the button to the right of a string gadget is available, you can press
  368. this to cycle through the valid alternatives for the parameter. The
  369. contents of the gadget will change as you click the button repeatedly.
  370.  
  371. UPPERCASE text entered by the cycle button should be kept as is.
  372. Occasionally, a text in lowercase may appear, which you should change to
  373. a proper value.
  374.  
  375. For example, if the text "obj" is shown as one of the cycle alternatives, 
  376. GRAAL expects you to replace this with an object number.
  377.  
  378.  
  379.  
  380. amigaguide help
  381. ---------------
  382.  
  383. You can open the amigaguide reference for the statement or command being
  384. edited by pressing the HELP key or clicking the small "?" button.
  385.  
  386.  
  387.  
  388. Graphical editing
  389. -----------------
  390.  
  391. A lot of parameters have to do with specifying co-ordinates, positions
  392. and other stuff related to a backdrop picture.
  393.  
  394. If there are parameters which can be edited in this way, one or more
  395. of the five buttons beneath the string gadgets will become available.
  396.  
  397. Usually, the editor finds the relevant backdrop picture and room file
  398. to use automatically, but may occasionally ask you for a file name when
  399. it cannot decide which part of the adventure you are actually affecting.
  400.  
  401. Sometimes, the editor asks "Reload the object and image data?". If you
  402. haven't altered any images, or switched rooms or anything since the last
  403. time you used the graphical editing functions, you can answer "no" to
  404. speed up the process.
  405.  
  406. The details of all the "graphical editing" operations  are explained
  407. below. Once you are done, press "Enter" to save the changes, or "Esc"
  408. to cancel. If the backdrop picture is larger than the screen, use the
  409. left and right cursor keys to scroll it.
  410.  
  411.  
  412.  
  413. Background Graphics
  414. -------------------
  415.  
  416. If the backdrop picture is one of the rooms in your game, all previously
  417. defined objects placed in that room is also shown for reference. If you
  418. edit a floor or an exit, previously defined floors and exits are shown.
  419.  
  420. Note: While you move the object you're editing around the screen, you
  421. will sometimes erase these other, pasted-on objects. To restore them, 
  422. just press the left or right cursor key. Also, if objects overlap, the
  423. editor does not bother to sort them in the proper order. Kepping the left
  424. or right cursor key down for a while should allow you to see all the
  425. objects revealed (although flashing wildly) even if they overlap.
  426.  
  427. Two points to remember: Make sure all statements and commands specifying
  428. picture file names, which help the editor choose the right file, are
  429. entered as early as possible. Also, remember that the editor loads such
  430. data from the files SAVED TO DISK, not from unsaved files in the editor
  431. itself. Therefore, save before using the parameter editor.
  432.  
  433. Now, a closer look at the five "graphical editing" buttons:
  434.  
  435.  
  436.  
  437. <Area>
  438. ------
  439.  
  440. An area is a rectangle that can be moved around the screen and re-sized.
  441. To re-size, click and drag the bottom left corner (the little square) of
  442. the rectangle.
  443.  
  444. To move the rectangle, click and drag anywhere else on the screen.
  445.  
  446. If you use this option to edit the cut-out frames for BOB images, you will
  447. get a number of rectangles on screen corresponding to the number of
  448. images cut out by the ...BOBS: statement. Use the leftmost rectangle
  449. to re-size: all duplicate frames will also be re-sized automatically.
  450. To alter the spacing between the frames, use the up and down cursor keys.
  451.  
  452. If you use <Area> to edit floors or exits, all floors and paths or exits
  453. are also shown on the screen (except the one being edited), and the system
  454. tries to print the number of each near the middle of the corresponding
  455. area.
  456.  
  457.  
  458.  
  459. <Position>
  460. ----------
  461.  
  462. This edits the position of an image, and possibly also the image number.
  463.  
  464. If the previous position and image used are known, the object or image
  465. will start out in its old position.
  466.  
  467. Click and hold the mouse button. The image being edited will start
  468. flashing in weird colours. Drag the mouse to the desired location and
  469. release.
  470.  
  471. To alter the image, use the up and down cursor keys.
  472.  
  473. To flip the image left/right, press the "x" key. (However, this will not
  474. be automatically registered in the "image" parameter).
  475.  
  476. When you save the changes with the "Enter" key, the image last used
  477. will normally be placed in the "image" parameter. However, if the
  478. "image" parameter previously contained an animation sequence or a PTRN
  479. specification, it will NOT be affected. This is to prevent a lot of
  480. hard work being undone by an over-smart editor...
  481.  
  482.  
  483.  
  484. <Pastepos>
  485. ----------
  486.  
  487. This is exactly the same as editing an image position, except the
  488. parameters specify the upper left corner of the image, not the hotspot
  489. position. (You don't have to choose the correct button yourself - only
  490. the relevant one will be available.)
  491.  
  492.  
  493.  
  494. <Char.pos>
  495. ----------
  496.  
  497. Very similar to the previous two, but only available when editing an
  498. object. This sets the main character's position relative to the object
  499. when using the MOBJ command. The image used for the main character can
  500. also be altered. The same rules as for the object positioning apply.
  501.  
  502.  
  503.  
  504. <Line>
  505. ------
  506.  
  507. This one edits the line for a PATH: statement. Each point on the line
  508. (there may be up to 6 of them) has a "handle" in the form of a small
  509. square. Just click within the handle and drag to move the point to a
  510. new place.
  511.  
  512. To add a new point, press the "arrow up" key. The new point will be
  513. inserted between the last and the second last point.
  514.  
  515. To delete a point, press the "arrow down" key. It is always the second
  516. last point that is deleted.
  517.  
  518.  
  519.  
  520. <Ink>
  521. -----
  522.  
  523. This one's a little different. Many commands require colour numbers to
  524. be specified, and this helps to pick the correct palette index number
  525. directly from the palette of the relevant backdrop picture.
  526.  
  527. When the picture is shown, a palette overlays the upper left corner of
  528. the picture. The text above the screen tells you to click on a colour
  529. - the "normal ink" colour for things like text displays, and the
  530. "background ink", which is the colour most functions use to erase or
  531. clean up unwanted parts of the picture.
  532.  
  533. The "highlight ink" colour is only used in the sentence display area.
  534. It is the colour used when a completed sentence is highlighted during
  535. command execution.
  536.  
  537.  
  538.  
  539. Inserting new statements or commands using <Edit Parameters>
  540. -----------------------------------------------------------
  541.  
  542.  
  543. If you place the cursor on an empty line and click <Edit Parameters>, 
  544. a list requester pops up asking you if you wish to insert a new
  545. statement. All valid statements (according to the script type) are
  546. shown in the list. Select a statement with the up and down arrow keys, 
  547. or with the mouse. With a statement selected, you can also press the
  548. <?> to read the amigaguide help for the statement.
  549.  
  550. Select the statement with the <Enter> key, the <OK> button, or by
  551. clicking it a second time with the mouse. A new line containing
  552. the statement will be inserted at the cursor position, and the
  553. parameter editor window is opened automatically.
  554.  
  555.  
  556. Similarly, positioning the cursor on a line that has a statement, 
  557. but neither on the statement nor the existing command names, brings
  558. up a requester asking if you wish to insert a new condition or
  559. command. Be careful not to insert a new command in the middle of
  560. paremeters belonging to an existing command, though...
  561.  
  562. Note: .scene files can't contain statements. Therefore, its always
  563. the condition/command list that appears when using the <Edit
  564. Parameters> function in an empty space.
  565.