home *** CD-ROM | disk | FTP | other *** search
- /** Interfere2d Interfering waves with DUST(© '94 A.Maschke)
- **
- ** $VER: 1.2 Interfere2dReq (20.12.1994 Wolfgang Loske)
- **
- ** Read manual for more information
- ** Bitte Anleitung für mehr Informationen lesen
- **
- **/
-
- call addlib('rexxsupport.library',0,-30,0)
- call addlib('rexxreqtools.library',0,-30,0)
-
- /**
- ** Initialize some colors, change if you want
- ** Ein paar Farben anmelden, ändern wie gewünscht
- **/
- csi='9b'x;slant=csi'3m';bold=csi'1m';norm=csi'0m';black=csi'31m'
- white=csi'32m';blue=csi'33m';LF = '0a'x
-
- /** Get commandline argument ## Argument der Kommandozeile holen
- **This Proggi has no options :-))))
- **/
- COUNT = "1"
- DEST = "RAM:"
- ROOT = "obj."
- TITLE = "Interfere2d Requester"
- FONT = "rt_font=thin609.font/8"
- /* Check for configuration */
- if ~open(PATH,"env:DUST",R) then do
- call rtezrequest("Could not open ENV:DUST to get your path to the executables !"LF||,
- "Please refer to the manual for installation instructions","Bummer",TITLE,FONT)
- exit
- end
- else
- PATH=readln(PATH)
-
- X= rtezrequest("We have the following defaults."LF||,
- "If you want to enter new values, answer the question with N."LF||,
- "If you only want to change one particular value, accept"LF||,
- "the other by pressing return. You will be asked again afterwards!","Yo!|EXIT",TITLE,FONT)
- if X = 0 then call EXIT
- BACK1:
- ANSWER= rtezrequest("QUESTION:"LF||LF||,
- "You want "||COUNT||" wave(s) to run over your object ?"LF||,
- "You want the files stored in "||DEST||" ?"LF||,
- "You want the sequence to have "||ROOT||" as the root name ?"LF||LF||,
- "Is this right ?","Yes|EXIT|No",TITLE,FONT)
- Select
- when ANSWER = "1" then NOP
- when ANSWER = "2" then call EXIT
- when ANSWER = "0" then SETUP = 1
- otherwise
- do
- say "Only "bold"Y"norm", "bold"N"norm" or just Return are valid answers"
- call BACK1
- end
- end
-
- if SETUP = 1 then do
- COUNT=rtgetlong(COUNT,"How many waves do you want ?",TITLE,"Yep !",FONT "rtgl_min=1 rtgl_max=5")
- if COUNT = "" then COUNT = "1"
- DEST=rtfilerequest(DEST,,TITLE,"Yo!",FONT "rtfi_flags=freqf_nofiles")
- if DEST = "" then DEST = "ram:"
- ROOT=rtgetstring(ROOT,"Please give rootname of the resulting animation sequence !",
- ,TITLE,"Yo!",FONT)
- if ROOT = "" then ROOT = "obj."
- SETUP = 0
- call BACK1
- end
-
- SOURCE:
- CUR = pragma("Directory")
- SOURCE=rtfilerequest(CUR,,"Select SOURCE object !","Yo!",FONT)
- Select
- when SOURCE = "" then do
- X= rtezrequest("No source given. Please enter again !","Bummer|EXIT",TITLE,FONT)
- if X=0 then call exit
- else call SOURCE
- end
- when ~exists(SOURCE) then do
- call rtezrequest("Object does not exist !!! Please enter again !","Bummer|EXIT",TITLE,FONT)
- if X=0 then call exit
- else call SOURCE
- call SOURCE
- end
- otherwise
- end
-
- /** Wave parameters **/
- OBJID=1;DESTID=2
- FRAMES=24
- TYPE.1=T;AMPLITUDE.1=12;WAVELENGTH.1=24;SOURCEX.1=0; SOURCEY.1=0; DAMPING.1=1.0;PHASE.1=60
- TYPE.2=T;AMPLITUDE.2=14;WAVELENGTH.2=36;SOURCEX.2=-30;SOURCEY.2=10; DAMPING.2=0.9;PHASE.2=-30
- TYPE.3=T;AMPLITUDE.3=11;WAVELENGTH.3=22;SOURCEX.3=5; SOURCEY.3=-30;DAMPING.3=1.1;PHASE.3=45
- TYPE.4=T;AMPLITUDE.4=10;WAVELENGTH.4=30;SOURCEX.4=-20;SOURCEY.4=20; DAMPING.4=0; PHASE.4=60
- TYPE.5=T;AMPLITUDE.5=10;WAVELENGTH.5=30;SOURCEX.5=-20;SOURCEY.5=-20;DAMPING.5=0; PHASE.5=60
-
- LOAD = "load("OBJID","SOURCE")"
- COPY = "copy("DESTID","OBJID")"
- SAVE = "save("DESTID","DEST||ROOT||"%)"
-
- X= rtezrequest("We have five predefined waves, which is also the limit of the script !"LF||,
- "Dependend on how many waves you wanted, you will now be shown"LF||,
- "this much predefinded parameters in the following order:"LF||,
- "TYPE,AMPLITUDE,WAVELENGTH,SOURCEX,SOURCEY,DAMPING and PHASE"LF||,
- "If you want to change one or more waves, you have to type the new"LF||,
- "values _EXACTLY_ in this order seperated by spaces"LF||,
- "i.e.: l 13 20 10 14 1.1 -45","Gotcha !|EXIT",TITLE,FONT)
- if X=0 then call exit
-
- call open(FILE,"t:SCRIPT",W)
- call writeln(FILE, LOAD)
- do i=1 to COUNT
- wave.i="wave2dframe("OBJID","FRAMES",$,"DESTID","TYPE.i","AMPLITUDE.i","WAVELENGTH.i","SOURCEX.i","SOURCEY.i","DAMPING.i","PHASE.i")"
- VALUES = rtgetstring(TYPE.i AMPLITUDE.i WAVELENGTH.i SOURCEX.i SOURCEY.i,
- DAMPING.i PHASE.i ,"Wave Nr.: "i LF||,
- "Type Amplitude Wavelength SourceX SourceY Damping Phase"LF||,
- center(TYPE.i,5) center(AMPLITUDE.i,9) center(WAVELENGTH.i,12),
- center(SOURCEX.i,8) center(SOURCEY.i,9) center(DAMPING.i,8) center(PHASE.i,6)LF||,
- "Press Return to accept or enter new values",TITLE,"Wow !",FONT)
- if VALUES = "" then
- WAVE.i = WAVE.i
- else
- parse var VALUES TYPE.i AMPLITUDE.i WAVELENGTH.i SOURCEX.i SOURCEY.i DAMPING.i PHASE.i
- wave.i="wave2dframe("OBJID","FRAMES",$,"DESTID","TYPE.i","AMPLITUDE.i","WAVELENGTH.i","SOURCEX.i","SOURCEY.i","DAMPING.i","PHASE.i")"
- call writeln(FILE,WAVE.i)
- call writeln(FILE,COPY)
- end
- call writeln(FILE, SAVE)
- call close(FILE)
-
- X= rtezrequest("Calling MakeLoop and Dust in the background."LF||,
- "Objects will be created and saved in the path you've chosen."LF||,
- "Please be patient, this may take a while !"LF||LF||,
- "If you interupt now, you have the basic script for MakeLoop in T: !",
- ,"Nice !|EXIT",TITLE,FONT )
- if X=0 then call EXIT
- MAKELOOP = PATH||"makeloop t:script t:script2 "
- address command MAKELOOP OBJID FRAMES
- DUST = PATH||"dust >nil: t:script2"
- call open(FILE,"t:SCRIPT2",A)
- call writeln(FILE,"exit")
- call close(FILE)
- call pragma("S",30000)
- address command DUST
-
- call rtezrequest("Objects saved !"LF||LF||"Thanks for using Interfere2d","Nice !",
- ,TITLE,FONT "rtez_flags=ezreqf_centertext")
- exit
-
- EXIT:
- call rtezrequest("Program aborted by user request !"LF||LF||"Thanks for using Interfere2d",
- ,"Nice !",TITLE,FONT "rtez_flags=ezreqf_centertext")
- exit
-