home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 24 / CD_ASCQ_24_0995.iso / vrac / aafdoc.zip / AAFREV.TXT < prev    next >
Text File  |  1995-06-15  |  10KB  |  229 lines

  1.                           AAFREV
  2.  
  3. This review of the Aircraft and Adventure Factory from
  4. Mallard/BAO deals only with the latter: the adventure part.
  5.  
  6. With AAF it is possible to write "scripts" or "scenarios" which
  7. are really BASIC-type programs. These, when compiled ("AAF
  8. YOURFILE.TXT YOURFILE.ADV") will create "adventures" which can
  9. then be run with MicroSoft's Flight Simulator 4.0.
  10.  
  11. A typical adventure will find you at the threshold of a runway.
  12. When you're ready to contact Clearance, you say (into your
  13. imaginary mike) "Wherever Clearance, Cessna 1234B requesting
  14. clearance for wherever, as filed." Then clearance will come back
  15. with "Cessna 1234B, cleared as filed. Squawk 1234." In digital
  16. sound, if you have a sound card (most popular brands are
  17. supported) -- what's really happening is that a sound .VOC file
  18. is being played. You acknowledge: "Cessna 34B direct wherever"
  19. etc.; clearance says "Cessna 34B readback correct. Ground on
  20. point whatever." On through contact ground, contact tower,
  21. contact departure, contact approach, contact (destination) tower,
  22. contact (destination) ground. etc. You actually hear ATC as you
  23. (or your friends, to give different voices for different
  24. stations) make them as .VOC files.
  25.  
  26. Or you're on standby with a rescue squad. You hear "Cessna 1234B,
  27. can you pick up a guy with a broken leg at Mount Snow?" Respond,
  28. receive detailed orders, and take off.
  29.  
  30. Or, when flying over RFK stadium hear "Hail to the Redskins!"
  31. from the band as the 'Skins score another touchdown.
  32.  
  33. The script, which is a text file later to be compiled, looks, as
  34. remarked, much like a BASIC program, and indeed the language is a
  35. somewhat cut-down version of QBASIC. It depends largely on "if. .
  36. . . [then]/endif" statements, such as:
  37.  
  38. if com(121.35)
  39.      PLAY "CLEAR.VOC"
  40. endif
  41.  
  42. This means if your COM radio is tuned to 121.35, play the
  43. (recorded by you) CLEAR.VOC file. But you don't *have* to play
  44. something (maybe you don't have a sound board). That instruction
  45. could have read PRINT "Cessna 23B, cleared as filed", and such a
  46. message would print out at the bottom of your screen.
  47.  
  48. All kinds of variables can be tested: not just COM tuning, but
  49. also:
  50.  
  51. if airspeed(500,1000)  ;speed range low-hi
  52.      print "You're going too fast"
  53. endif
  54.  
  55. if altagl(0,100)     ;altitude above ground level, range low-hi
  56.      play "PULLUP.VOC"
  57. endif
  58.  
  59. if cylinder(16580,12346,0,15)
  60.      print "You're within 15 nautical miles"
  61. endif
  62.  
  63. This last means if you're in an imaginary cylinder centered at
  64. those FS North and FS East coordinates with a radius of 15 miles,
  65. print the message.
  66.  
  67. if key("a")
  68.      gosub readout
  69. endif
  70.  
  71. If you press "a" you will go to a subroutine which will print on
  72. your screen your current altitude and course, and then return you
  73. to the rest of the adventure. GOSUBs are typical BASIC commands;
  74. you can also GOTO another part of the adventure, which has a
  75. particular "label" -- again a standard BASIC routine.
  76.  
  77. if gearup()   ;this one has no other parameters
  78.      print "Put your gear down, you ninny!"
  79. endif
  80.  
  81. Most of these are checking a variable or a condition and taking
  82. appropriate action. But you can also *set* certain variables:
  83.  
  84. if key("b")
  85.      setvar(cloud1top,5000)
  86.      setvar(cloud1bot, 500)
  87. endif
  88.  
  89. This sets the top of cloud level 1 to 5000 (meters) and the
  90. bottom to 500 meters -- cold front coming through. The condition
  91. ("if" statement) on this could have been a cylinder, as above:
  92. when you're within that cylinder (so far from those coordinates),
  93. roll in the clouds.
  94.  
  95. You can check whether you're on the glideslope, whether you're on
  96. the ground, whether your course is within certain limits, whether
  97. you have a sufficient climb rate, etc. AAF can do more than radar
  98. can. There are a good many "standard" inquiries/requests as in
  99. the foregoing, and also a great many FS variables which can
  100. otherwise be tested and changed: cloud1top is one of them. They
  101. are all listed in the appendix to the AAF documentation -- I do
  102. not myself yet know what all of them mean and do!
  103.  
  104. Another interesting program fragment is:
  105.  
  106. if course(0,0)
  107. endif
  108. printvar(result,"Your course is: ")
  109.  
  110. (PRINTVAR is a primitive which prints the value of any variable
  111. with a header.)
  112.  
  113. The variable RESULT "contains the value to be compared against
  114. (LOW, HIGH)" according to the documentation. Here it will contain
  115. your course. So also with AIRSPEED(LOW,HIGH), ALTITUDE(LOW,HIGH),
  116. BANK(LOW,HIGH), although I haven't tried all of these. The gosub
  117. readout routine mentioned above uses these.
  118.  
  119. So, PLAY or PRINT a voice file or a message. But you can also
  120. VIEW: a .PCX graphics file. If you have a .PCX file with, say, an
  121. instrument approach plate for your destination airport, you can
  122. issue:
  123.  
  124. if cylinder (x,y,0,15)
  125.      view(10,DCAIAP.PCX)
  126. endif
  127.  
  128. If you're in that cylinder, your DCAIAP.PCX will come up on the
  129. screen for ten seconds. .PCX files are PC Paintbrush files, and
  130. can be created with many different graphics programs, including
  131. Windows Paint. They have to be 320 x 200 resolution and 256
  132. colors.
  133.  
  134. In the case of demos (which you make) PLAY is replaced by $PLAY.
  135. Other "primitives" are WAIT(x) -- a certain number of seconds
  136. before proceeding; and SETPOSITION(NORTH,EAST,ALTITUDE), which
  137. puts your plane at such-and-such FS coordinates at a particular
  138. altitude.
  139.  
  140. Now the catch with all of this, of course, is that you have to
  141. learn at least the rudiments of BASIC (as used here) to write
  142. these scripts, and that might be a little scary for those who
  143. have never done this sort of thing ("all I know how to do is turn
  144. on my computer and type FS!"). But this is not complicated BASIC:
  145. as a matter of fact, it does not include some commands which are
  146. pretty common in BASIC: IF . . . ELSE, FOR loops, WHILE
  147. statements, etc.: I myself miss all of these, and whereas they
  148. can all be duplicated in AAF-BASIC, it's pretty cumbersome. The
  149. AAF compiler is fast, but not terribly robust: it gives you some
  150. warnings if you make a mistake, but these are not always obvious,
  151. and sometimes you can write an .ADV which sure won't work because
  152. of some syntax error, and the compiler won't tell you anything.
  153. My own advice is to look at the original text files (before
  154. compiling) that have been produced by others -- no doubt they
  155. will be made available on the FSFORUM and elsewhere. As of this
  156. writing, there are, however, only two available: SAMPLE.TXT,
  157. which comes with AAF, and my CMIBMI.TXT, in CMIBMI.ZIP, library
  158. 5/Aircraft/Adventure. Ask yourself "why did he do that?" and "why
  159. does that work?" Or, write some small programs with just a few
  160. routines, see how they work, and then combine them (with a word
  161. processor) into a larger program. You can write up quite a series
  162. of subroutines, such as the readout mentioned above (gives you
  163. current altitude and heading).
  164.  
  165.  
  166. Making the voice files (.VOC) is another matter. I myself write
  167. programs first to PRINT to the screen, to see if they work:
  168. then I write a .VOC and change PRINT to PLAY. Sound cards usually
  169. come with a utility to produce .VOC files -- for example,
  170. Soundblaster Pro has VEDIT2. I somewhat prefer a shareware
  171. program, Blaster Master, available (BMST5.ZIP) in the Sound Cards
  172. library of the MIDI forum. Both of these programs can "pack" .VOC
  173. files so they take up less room (and therefore less disk space
  174. and less upload/download time). But these have to be unpacked to
  175. restore the original before they can be used with AAF: there is a
  176. utility to do this provided with the program. I do not myself
  177. find it very helpful: "packed" and "unpacked" files sound pretty
  178. awful. However, I *do* find that at least for voice, you can do
  179. your "sampling" at a very low rate, even 4000, and this
  180. considerably cuts down the size of the .VOCs. Anyway PKZIP won't
  181. touch packed files: they're already compressed.
  182.  
  183. Of course some ATC messages work much better as PRINTs than as
  184. PLAYs. In my readout subroutine, I print on the screen airspeed,
  185. course, and altitude -- I just use PRINTVAR(x,"message") here. It
  186. would be a killer to make up .VOC files for all the possible
  187. combinations!
  188.  
  189. What They Say:
  190. It is always a bit difficult to get the conventions and jargon of
  191. ATC communications. There are several sources, however. One is
  192. John Rafferty's Realistic Commerical Flying with Flight Simulator
  193. (Compute! Books, 1989), which has several good examples. The best
  194. book here, however, is by Paul Illman and Jay Pouzar, The Pilot's
  195. Radio Communications Handbook (Tab Practical Flying Series, Tab
  196. Books, 1989) -- everything from UNICOM to transiting an Air
  197. Traffic Control Center, with a great many examples and a complete
  198. script for Kansas City to Minneapolis and back. Or, of course,
  199. you can follow the examples provided with AAF or from other
  200. sources, such as Simutech's ProSim Plus series, as well as files
  201. which will be uploaded to the FSFORUM. And you can buy a scanner
  202. and listen to real ATC (and the pilot's responses) if you're
  203. within range of an active airport. Basically there are certain
  204. procedures: the pilot calls clearance, clearance clears and hands
  205. off to ground; ground authorizes taxi and hands off to tower;
  206. tower clears for takeoff; departure sends one on the way;
  207. approach gives general directions and then (destination) tower
  208. gives such things as vectors and final landing clearance, handing
  209. off to ground, etc. SubLOGIC's Air Transport Pilot has all of
  210. these and others as well, printed to the screen. Obviously there
  211. are other messages: "Descend and maintain x thousand", "Turn
  212. right to heading y", "Execute missed approach", and the like.
  213.  
  214. I really have been playing with AAF for only a short time, and I
  215. am sure that there are many more applications which have not yet
  216. occured to me: no doubt we will be seeing some of them on the
  217. FSFORUM. But still, at least in my experience so far, this is the
  218. best "add-on" to MicroSoft's Flight Simulator since the Aircraft
  219. and Scenery Designer. I confidently predict that it will produce
  220. a whole flurry of new scenarios/scripts which will extend our use
  221. of FS by a major factor. And that's not even counting the
  222. aircraft designing functions, which are another matter for
  223. another day (and most probably another reviewer!).
  224.  
  225. Jim Ross 70235,143
  226.  
  227.  
  228.  
  229.