home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 3 / Meeting_Pearls_III.iso / Pearls / gfx / Dust / Scripts / Interfere2d < prev   
Encoding:
Text File  |  1995-01-10  |  6.1 KB  |  155 lines

  1. /** Interfere2d         Interfering waves with DUST(© '94 A.Maschke)
  2. **
  3. ** $VER: 1.2 Interfere2dReq  (20.12.1994 Wolfgang Loske)
  4. **
  5. ** Read manual for more information
  6. ** Bitte Anleitung für mehr Informationen lesen
  7. **
  8. **/
  9.  
  10. call addlib('rexxsupport.library',0,-30,0)
  11. call addlib('rexxreqtools.library',0,-30,0)
  12.  
  13. /**
  14. ** Initialize some colors, change if you want
  15. ** Ein paar Farben anmelden, ändern wie gewünscht
  16. **/
  17. csi='9b'x;slant=csi'3m';bold=csi'1m';norm=csi'0m';black=csi'31m'
  18. white=csi'32m';blue=csi'33m';LF = '0a'x
  19.  
  20. /** Get commandline argument ## Argument der Kommandozeile holen
  21. **This Proggi has no options :-))))
  22. **/
  23. COUNT = "1"
  24. DEST = "RAM:"
  25. ROOT = "obj."
  26. TITLE = "Interfere2d Requester"
  27. FONT = "rt_font=thin609.font/8"
  28. /* Check for configuration */
  29. if ~open(PATH,"env:DUST",R) then do
  30.    call rtezrequest("Could not open ENV:DUST to get your path to the executables !"LF||,
  31.         "Please refer to the manual for installation instructions","Bummer",TITLE,FONT)
  32.    exit
  33.    end
  34. else
  35.     PATH=readln(PATH)
  36.  
  37. X= rtezrequest("We have the following defaults."LF||,
  38. "If you want to enter new values, answer the question with N."LF||,
  39. "If you only want to change one particular value, accept"LF||,
  40. "the other by pressing return. You will be asked again afterwards!","Yo!|EXIT",TITLE,FONT)
  41. if X = 0 then call EXIT
  42. BACK1:
  43. ANSWER= rtezrequest("QUESTION:"LF||LF||,
  44.     "You want "||COUNT||" wave(s) to run over your object ?"LF||,
  45.     "You want the files stored in "||DEST||" ?"LF||,
  46.     "You want the sequence to have "||ROOT||" as the root name ?"LF||LF||,
  47.     "Is this right ?","Yes|EXIT|No",TITLE,FONT)
  48. Select
  49.         when ANSWER = "1" then NOP
  50.         when ANSWER = "2" then call EXIT
  51.         when ANSWER = "0" then SETUP = 1
  52.         otherwise 
  53.         do
  54.           say "Only "bold"Y"norm", "bold"N"norm" or just Return are valid answers"
  55.           call BACK1
  56.         end
  57. end
  58.  
  59. if SETUP = 1 then do
  60.         COUNT=rtgetlong(COUNT,"How many waves do you want ?",TITLE,"Yep !",FONT "rtgl_min=1 rtgl_max=5")
  61.         if COUNT = "" then COUNT = "1"
  62.         DEST=rtfilerequest(DEST,,TITLE,"Yo!",FONT "rtfi_flags=freqf_nofiles")
  63.         if DEST = "" then DEST = "ram:"
  64.         ROOT=rtgetstring(ROOT,"Please give rootname of the resulting animation sequence !",
  65.                 ,TITLE,"Yo!",FONT)
  66.         if ROOT = "" then ROOT = "obj."
  67.         SETUP = 0
  68.         call BACK1
  69. end
  70.  
  71. SOURCE:
  72. CUR =  pragma("Directory")
  73. SOURCE=rtfilerequest(CUR,,"Select SOURCE object !","Yo!",FONT)
  74. Select
  75.         when SOURCE = "" then do
  76.                 X= rtezrequest("No source given. Please enter again !","Bummer|EXIT",TITLE,FONT)
  77.                 if X=0 then call exit
  78.                         else call SOURCE
  79.                 end
  80.         when ~exists(SOURCE) then do
  81.                 call rtezrequest("Object does not exist !!! Please enter again !","Bummer|EXIT",TITLE,FONT)
  82.                 if X=0 then call exit
  83.                         else call SOURCE
  84.                 call SOURCE
  85.                 end
  86.         otherwise
  87. end
  88.  
  89. /** Wave parameters **/
  90. OBJID=1;DESTID=2
  91. FRAMES=24
  92. TYPE.1=T;AMPLITUDE.1=12;WAVELENGTH.1=24;SOURCEX.1=0; SOURCEY.1=0; DAMPING.1=1.0;PHASE.1=60
  93. TYPE.2=T;AMPLITUDE.2=14;WAVELENGTH.2=36;SOURCEX.2=-30;SOURCEY.2=10; DAMPING.2=0.9;PHASE.2=-30
  94. TYPE.3=T;AMPLITUDE.3=11;WAVELENGTH.3=22;SOURCEX.3=5;  SOURCEY.3=-30;DAMPING.3=1.1;PHASE.3=45
  95. TYPE.4=T;AMPLITUDE.4=10;WAVELENGTH.4=30;SOURCEX.4=-20;SOURCEY.4=20; DAMPING.4=0;  PHASE.4=60
  96. TYPE.5=T;AMPLITUDE.5=10;WAVELENGTH.5=30;SOURCEX.5=-20;SOURCEY.5=-20;DAMPING.5=0;  PHASE.5=60
  97.  
  98. LOAD = "load("OBJID","SOURCE")"
  99. COPY = "copy("DESTID","OBJID")"
  100. SAVE = "save("DESTID","DEST||ROOT||"%)"
  101.  
  102. X= rtezrequest("We have five predefined waves, which is also the limit of the script !"LF||,
  103.         "Dependend on how many waves you wanted, you will now be shown"LF||,
  104.         "this much predefinded parameters in the following order:"LF||,
  105.         "TYPE,AMPLITUDE,WAVELENGTH,SOURCEX,SOURCEY,DAMPING and PHASE"LF||,
  106.         "If you want to change one or more waves, you have to type the new"LF||,
  107.         "values _EXACTLY_ in this order seperated by spaces"LF||,
  108.         "i.e.: l 13 20 10 14 1.1 -45","Gotcha !|EXIT",TITLE,FONT)
  109. if X=0 then call exit
  110.  
  111. call open(FILE,"t:SCRIPT",W)
  112. call writeln(FILE, LOAD)
  113. do i=1 to COUNT
  114.         wave.i="wave2dframe("OBJID","FRAMES",$,"DESTID","TYPE.i","AMPLITUDE.i","WAVELENGTH.i","SOURCEX.i","SOURCEY.i","DAMPING.i","PHASE.i")"
  115.         VALUES = rtgetstring(TYPE.i AMPLITUDE.i WAVELENGTH.i SOURCEX.i SOURCEY.i,
  116.                 DAMPING.i PHASE.i ,"Wave Nr.: "i LF||,
  117.                 "Type  Amplitude  Wavelength  SourceX   SourceY  Damping  Phase"LF||,
  118.                 center(TYPE.i,5) center(AMPLITUDE.i,9) center(WAVELENGTH.i,12),
  119.                 center(SOURCEX.i,8) center(SOURCEY.i,9) center(DAMPING.i,8) center(PHASE.i,6)LF||,
  120.                 "Press Return to accept or enter new values",TITLE,"Wow !",FONT)
  121.         if VALUES = "" then 
  122.                 WAVE.i = WAVE.i
  123.         else
  124.                 parse var VALUES TYPE.i AMPLITUDE.i WAVELENGTH.i SOURCEX.i SOURCEY.i DAMPING.i PHASE.i
  125.                 wave.i="wave2dframe("OBJID","FRAMES",$,"DESTID","TYPE.i","AMPLITUDE.i","WAVELENGTH.i","SOURCEX.i","SOURCEY.i","DAMPING.i","PHASE.i")"
  126.         call writeln(FILE,WAVE.i)
  127.         call writeln(FILE,COPY)
  128. end
  129. call writeln(FILE, SAVE)
  130. call close(FILE)
  131.  
  132. X= rtezrequest("Calling MakeLoop and Dust in the background."LF||,
  133.                 "Objects will be created and saved in the path you've chosen."LF||,
  134.                 "Please be patient, this may take a while !"LF||LF||,
  135.                 "If you interupt now, you have the basic script for MakeLoop in T: !",
  136.                 ,"Nice !|EXIT",TITLE,FONT )
  137. if X=0 then call EXIT
  138. MAKELOOP = PATH||"makeloop t:script t:script2 "
  139. address command MAKELOOP OBJID FRAMES
  140. DUST = PATH||"dust >nil: t:script2"
  141. call open(FILE,"t:SCRIPT2",A)
  142. call writeln(FILE,"exit")
  143. call close(FILE)
  144. call pragma("S",30000)
  145. address command DUST
  146.  
  147. call rtezrequest("Objects saved !"LF||LF||"Thanks for using Interfere2d","Nice !",
  148.         ,TITLE,FONT "rtez_flags=ezreqf_centertext")
  149. exit
  150.  
  151. EXIT:
  152. call rtezrequest("Program aborted by user request !"LF||LF||"Thanks for using Interfere2d",
  153.         ,"Nice !",TITLE,FONT "rtez_flags=ezreqf_centertext")
  154. exit
  155.