home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 166.lha / demorun.doc < prev    next >
Encoding:
Text File  |  1988-04-28  |  5.4 KB  |  119 lines

  1.  
  2.  
  3.     Hi,
  4.  
  5.     Here's a specialized XICON-like hack that will help some of you BADGE 
  6.     contest enterers to comply with some of the tougher constraints 
  7.     contained in the rules.
  8.  
  9.     The contest rules state that you should be able to drag your entire
  10.     demo (in a drawer if necessary) as a single icon onto a hard disk and
  11.     have it still work from either the workbench or CLI without any ASSIGNs
  12.     or assumed disk names etc.
  13.  
  14.     This hack is particularly useful to Director owners who are using
  15.     custom fonts or using the sound module, but may also be useful 
  16.     with any other programs having similar problems determining
  17.     the name of the directory they are being run from.
  18.  
  19.     When using fonts included with your demo, or (in the Director) the 
  20.     sound module, someone has to tell the system where all the stuff is.  
  21.  
  22.     Due to a bug (or is it a feature :-) in AmigaDOS Execute() system call 
  23.     (which the Director uses internally for its EXECUTE command), programs 
  24.     being EXECUTEd will always think they are being run from the root 
  25.     directory of DF0:, with no way to determine where the EXECUTEing demo 
  26.     is actually being run from.  This makes it virtually impossible to 
  27.     assign fonts to the directory you are running your demo from without 
  28.     making some assumptions as to the name of the disk on which the demo is
  29.     contained etc.  Since this is in conflict with some of the suggestions
  30.     in the BADGE contest rules, I put together this hack.
  31.  
  32.     This program is a small (6K) program with icon, that determines it's
  33.     own directory, and does an ASSIGN HERE:  to that directory.  It will
  34.     then search the tooltypes parameters in the icon for a string that
  35.     starts with EXECUTE= .  It will do an Execute() call to run the
  36.     program(s) (with parameters) specified by these EXECUTE= entries
  37.     (multiple such entries are allowed).
  38.  
  39.     This example does an EXECUTE=projector here:demo.film  to run a Director
  40.     animation.  The resultant animation can assume that HERE: is assigned
  41.     to it's current directory, and specify that as the location of the
  42.     FONTS: and the MOD: directory (for the sound module) with Director 
  43.     commands such as:
  44.  
  45.         EXECUTE a,"assign mod: here:options"
  46.         MODULE "sound"
  47.         PAUSE 20        :rem  delay to allow module to load without
  48.                         :rem  disk contention.  (you could load other
  49.                         :rem  stuff instead)
  50.         EXECUTE a,"assign mod:"        :rem  unassign mod, don't need anymore
  51.         ...(load sounds, play sounds, etc.)...
  52.  
  53.         EXECUTE a,"assign temp: fonts:"
  54.         EXECUTE a,"assign fonts: here:fonts"
  55.         ...(load fonts etc)...
  56.         EXECUTE a,"assign fonts: temp:"
  57.         EXECUTE a,"assign temp:"
  58.         ...(setfont, etc.)...
  59.  
  60.     All other references to file names (picture,sound etc.) within the 
  61.     script should probably be done using HERE: for correct operation. 
  62.  
  63.     Upon exit of the program, demorun will un-assign HERE: so the entry
  64.     does not take up any memory (another contest rule is that demos will
  65.     return all it's memory, a laudable goal).  You should remember that
  66.     any ASSIGNs done in your script should before completion do an:
  67.  
  68.            ASSIGN TEMP:
  69.  
  70.     (for example to unassign temp) to undo any special assigns that have
  71.     been done.  Ideally, if you have correctly undone all the assigns
  72.     you can check this with the ASSIGN command from the CLI after running
  73.     your demo and see if there are any outstanding assign entries that
  74.     reference the disk that contains your demo.  If there are none, the 
  75.     disk icon should disappear after being removed from the drive, and 
  76.     you have correctly undone all that you have done during the demo.
  77.     (*whew*).  
  78.  
  79.     The icon also has a WINDOW= command in the tooltypes section of the
  80.     icon (check this with the workbench "info" command after clicking
  81.     once on the demorun icon).  This sets up an initial window which
  82.     may be necessary for the programs being run if they output anything
  83.     to the CLI window.  Without this window definition, such programs
  84.     will crash.  This window feature makes the existance of the Projector
  85.     icon completely unecessary.  You can change the window's title by
  86.     changing the title string contained in the WINDOW= tooltypes 
  87.     parameter.
  88.  
  89.     Note that the stack parameter in the icon will only affect the stack
  90.     for the demorun program itself, if you need to adjust the stack
  91.     for the program you're running (shouldn't need to for the Projector) 
  92.     you'll have to do an: 
  93.     
  94.         EXECUTE=execute here:script 
  95.  
  96.     with a stack command in the script.  (I haven't tried this by the
  97.     way).  This should use the execute AmigaDOS command to run a script
  98.     file which can adjust the stack for programs executed by the script
  99.     itself.  Any script output should still end up on the demorun window.
  100.  
  101.     This program will also run from the cli simply by typing it's name.
  102.     I expect you may decide to re-name it to something more suitable for 
  103.     your demo, and  perhaps rework the design of the icon with an icon tool.
  104.  
  105.     As you may have surmised, with the Director doing both sound and
  106.     custom fonts, you end up doing about 10 ASSIGN commands during the
  107.     course of the demo.  Lot of thrashing, don't know if its really worth
  108.     all that, but it is about the only way to completely meet the fine
  109.     print of the terms of the BADGE contest.  Please let anyone you
  110.     may know who is submitting a Director-based demo to the BADGE contest
  111.     about this, time is getting short.
  112.  
  113.     Rest assured, future Directors will eliminate most if not all of
  114.     such complications (if future AmigaDOS's don't do it for us).
  115.  
  116.     Keith Doyle 9/12/88
  117.     213-325-1311 (7pm-12mid Mon-Thu)
  118.  
  119.