home *** CD-ROM | disk | FTP | other *** search
/ Inventor Labs: Technology / INVENTORLABS_TECHNOLOGY.BIN / pc / files / bell.dir / 00227_Script_HarmonicTelegraph < prev    next >
Text File  |  1997-05-26  |  23KB  |  635 lines

  1. --o Harmonic Telegraph Object Parent Script
  2.  
  3.  
  4. -- game logic properties
  5. property pLastSwitch -- #NEAR, #MIDDLE or #FAR
  6. property pLastSwitchPosition -- ending state (#ON or #OFF) for the last zoom switch clicked on
  7. property pSwitchQTChannel -- sprite channel of the last switch clicked on
  8. property pSwitchQTStatus  -- #ON or #OFF; is the QT for a zoom switch playing or not
  9. property pSwitchQTDuration -- the duration of the current Zoom switch QT
  10.  
  11. -- Mallet QT properties
  12. property pMalletQTChannel -- channel of QT movie for striking mallet
  13. property pMalletQTStatus -- #ON or #OFF; on if QT of mallet is playing
  14. property pMalletQTDuration -- number of frames in mallet movie
  15.  
  16. -- On/Off Switch properties
  17. -- NB: both the BigPicture frame and ZoomSwitches frame share the following six properties.  This means that the sprite channels for the various switches must be consistent between the two frames.  Thus, if in the BigPicture frame the Near switch is channel 10, the Near switch must be in channel 10 in the ZoomSwitches frame as well.
  18. property pNearSwitchStatus
  19. property pMiddleSwitchStatus
  20. property pFarSwitchStatus
  21.  
  22. property pNearSwitchChannel -- sprite channel for near switch
  23. property pMiddleSwitchChannel
  24. property pFarSwitchChannel
  25.  
  26. -- BigPicture properties
  27. property pBigPicNearSwitchOnCast -- cast for near switch "on" position in Big Picture frame
  28. property pBigPicMiddleSwitchOnCast
  29. property pBigPicFarSwitchOnCast
  30.  
  31. property pBigPicNearSwitchH -- locH and locV for three main switches in BigPicture frame
  32. property pBigPicNearSwitchV
  33. property pBigPicMiddleSwitchH
  34. property pBigPicMiddleSwitchV
  35. property pBigPicFarSwitchH
  36. property pBigPicFarSwitchV
  37.  
  38. -- ZoomSwitch properties
  39. property pZoomNearSwitchOnCast -- cast for near switch "on" position in Zoom frame
  40. property pZoomMiddleSwitchOnCast -- the "off" position is next in the cast
  41. property pZoomFarSwitchOnCast -- ie: "on" cast = 100, therefore "off" cast = 101
  42.  
  43. property pZoomNearSwitchH -- locH and locV for three main switches in Zoom frame
  44. property pZoomNearSwitchV
  45. property pZoomMiddleSwitchH
  46. property pZoomMiddleSwitchV
  47. property pZoomFarSwitchH
  48. property pZoomFarSwitchV
  49.  
  50. property pNearSwitchOnToOff -- QT Castnumbers for the zoom frame toggling between on and off
  51. property pNearSwitchOffToOn
  52. property pMiddleSwitchOnToOff
  53. property pMiddleSwitchOffToOn
  54. property pFarSwitchOnToOff
  55. property pFarSwitchOffToOn
  56.  
  57. -- ZoomReed properties
  58.  
  59. property pNearReedPosition -- 1, 2 or 3
  60. property pMiddleReedPosition
  61. property pFarReedPosition
  62.  
  63. property pNearTunedPosition -- the tuned state of the near reed
  64. property pMiddleTunedPosition
  65. property pFarTunedPosition
  66.  
  67. property pFirstNearReedCast -- first castNum of near reed in position 1
  68. property pFirstMiddleReedCast
  69. property pFirstFarReedCast
  70.  
  71. property pZoomNearReedH -- locH and locV for three main switches in Zoom frame
  72. property pZoomNearReedV
  73. property pZoomMiddleReedH
  74. property pZoomMiddleReedV
  75. property pZoomFarReedH
  76. property pZoomFarReedV
  77.  
  78. -- Resolution properties
  79. property pReedVibrationPattern -- the animation list for the vibrating reeds
  80. property pReedTracker -- where in the animation list are we?
  81. property pMaxReedAnimation -- number of entries in pReedVibrationPattern
  82. property pVibrateStatus -- #VIBRATE or #STOPPED
  83.  
  84. property pSoundKey -- a symbol, such as #NEARFAR or #NEARMIDDLEFAR that is used to access the name of the soundfile for the resolution to be played
  85. property pSoundList -- this property list associates combinations of correctly tuned reeds with their corresponding sound files
  86.  
  87. property pVibNearReedChannel -- sprite channels for vibrating tips of Reeds
  88. property pVibMiddleReedChannel
  89. property pVibFarReedChannel
  90.  
  91. property pVibNearReedH -- locH and locV for three vibrating reed tips in Resolution frame
  92. property pVibNearReedV
  93. property pVibMiddleReedH
  94. property pVibMiddleReedV
  95. property pVibFarReedH
  96. property pVibFarReedV
  97.  
  98. property pNeutralNearReedCast -- the 4th of 7 animating reed PICTs; the middle one
  99. property pNeutralMiddleReedCast
  100. property pNeutralFarReedCast
  101.  
  102.  
  103. property pNewReedSprite, pZoomReedH, pZoomReedV
  104. property pSwitchDestinationFrame, pBaseCursors, pFrameFinderList
  105.  
  106. property pRolloverStartsprite
  107. property pRolloverEndSprite
  108. property plabels 
  109.  
  110.  
  111. global gSNDpath, gInterfaceMgrObj
  112. ------------------------------------------------------------------------------------------------------------
  113. on mInit me
  114.   
  115.   mSetRolloverLabels (me, #Main)
  116.   
  117.   set pSoundList = [#NEAR:"BHTAUD1.AIF", #MIDDLE:"BHTAUD2.AIF", #FAR:"BHTAUD3.AIF", #NEARMIDDLE:"BHTAUD4.AIF", #NEARFAR:"BHTAUD5.AIF", #MIDDLEFAR:"BHTAUD6.AIF", #NEARMIDDLEFAR:"BHTAUD7.AIF"]
  118.   
  119.   set pFrameFinderList = [[#OFF,#OFF,#OFF], [#ON,#OFF,#OFF], [#OFF,#ON,#OFF], [#OFF,#OFF,#ON], [#ON,#ON,#OFF], [#OFF,#ON,#ON], [#ON,#OFF,#ON], [#ON,#ON,#ON]]
  120.   
  121.   set pNearSwitchChannel = 3
  122.   set pMiddleSwitchChannel = 4
  123.   set pFarSwitchChannel = 5
  124.   
  125.   
  126.   set pVibNearReedChannel = 17
  127.   set pVibMiddleReedChannel = 18
  128.   set pVibFarReedChannel = 19
  129.   
  130.   set pNewReedSprite = 14
  131.   
  132.   set pFirstNearReedCast = the number of cast "BHTRD1S1.PIC"
  133.   set pFirstMiddleReedCast = the number of cast "BHTRD2S1.PIC"
  134.   set pFirstFarReedCast = the number of cast "BHTRD3S1.PIC"
  135.   
  136.   set pNeutralNearReedCast = the number of cast "BHT1VIB4.PIC"
  137.   set pNeutralMiddleReedCast = the number of cast "BHT2VIB4.PIC"
  138.   set pNeutralFarReedCast = the number of cast "BHT3VIB4.PIC"
  139.   
  140.   set pBigPicNearSwitchOnCast = the number of cast "BHTSW1N.PIC"
  141.   set pBigPicMiddleSwitchOnCast = the number of cast "BHTSW2N.PIC"
  142.   set pBigPicFarSwitchOnCast = the number of cast "BHTSW3N.PIC"
  143.   
  144.   set pReedVibrationPattern = [0, 1, 0, -1, 0, 1, 2, 0, -1, -2, -1, 0, 1, 2, 3, 2, 1, 0, -1, -2, -3, -2, -1, 0, 1, 2, 3, 2, 1, 0, -1, -2, -3, -2, -1, 0, 1, 2, 3, 2, 1, 0, -1, -2, -3, -2, -1, 0, 1, 2, 1, 0, -1, -2, -1, 0, 1, 0, -1, 0]
  145.   set pMaxReedAnimation = count(pReedVibrationPattern)
  146.   
  147.   sound playfile 2, gSNDpath &  "BHTINTR.AIF" --rosebud
  148.   
  149.   set pSwitchQTChannel = 7
  150.   set pMalletQTChannel = 23
  151.   
  152.   return me
  153.   
  154. end
  155. ------------------------------------------------------------------------------------------------------------
  156. on mSetRolloverLabels me, whatarea
  157.   
  158.   if whatarea = #Main then
  159.     set pRolloverStartsprite = 3
  160.     set pRolloverEndSprite = 12
  161.     set plabels  = the text of cast "Tele Main Screen labels"
  162.   else if whatarea = #ReedCloseUp then
  163.     set pRolloverStartsprite = 16
  164.     set pRolloverEndSprite = 18
  165.     set plabels  = the text of cast "Tele Reed closeup text"
  166.   else if whatarea = #SwitchesCloseUp then
  167.     set pRolloverStartsprite = 11
  168.     set pRolloverEndSprite = 13
  169.     set plabels  = the text of cast "Tele Switch closeup text"
  170.   end if
  171.   mSetLabelText( gUtilityObj, "")
  172.   
  173. end mSetRolloverLabels
  174. ------------------------------------------------------------------------------------------------------------
  175. on mActivate me
  176.   
  177.   -- reset game status parameters
  178.   set pMalletQTStatus = #OFF
  179.   set pSwitchQTStatus = #OFF
  180.   
  181.   set pNearSwitchStatus = #ON 
  182.   set pMiddleSwitchStatus = #ON
  183.   set pFarSwitchStatus = #ON
  184.   
  185.   set pNearReedPosition = 1
  186.   set pMiddleReedPosition = 2
  187.   set pFarReedPosition = 3
  188.   
  189.   -- these are the correct answers
  190.   set pNearTunedPosition = 1
  191.   set pMiddleTunedPosition  = 3
  192.   set pFarTunedPosition = 2
  193.   
  194.   -- ditto for the reeds
  195.   set ZoomNearReedChannel = 4
  196.   set ZoomMiddleReedChannel = 5
  197.   set ZoomFarReedChannel = 6
  198.   
  199.   set ResNearReedChannel = 7
  200.   set ResMiddleReedChannel = 8
  201.   set ResFarReedChannel = 9
  202.   
  203.   -- ditto for the BigPicture switches
  204.   set BigPicNearSwitchChannel = 3
  205.   set BigPicMiddleSwitchChannel = 4
  206.   set BigPicFarSwitchChannel = 5
  207.   
  208.   
  209.   -- get the locH and locV info for the three vibrating reeds in the Resolution frame
  210.   set pVibNearReedH = 400
  211.   set pVibNearReedV = 274
  212.   set pVibMiddleReedH = 295
  213.   set pVibMiddleReedV = 187
  214.   set pVibFarReedH = 227
  215.   set pVibFarReedV =121
  216.   
  217.   mUnsetCursors(gUtilityObj)
  218.   set pBaseCursors = [15: #operate,16:#ZoomIN,17:#ZoomIN,18:#ZoomIN,19:#ZoomIN,21:#Return,22:#Return]
  219.   mSetCursors(gUtilityObj, pBaseCursors)
  220.   
  221.   mSetToolBtns (gInterfaceMgrObj, #HarmTele, me)
  222. end
  223. ------------------------------------------------------------------------------------------------------------
  224. on mClose me
  225.   
  226.  
  227.   
  228.   mUnsetCursors(gUtilityObj)
  229.   mSetCursors(gUtilityObj, [21:#Return,22:#Return])
  230.   set the locv of sprite pNearSwitchChannel = -1000
  231.   set the locv of sprite pMiddleSwitchChannel = -1000
  232.   set the locv of sprite pFarSwitchChannel = -1000
  233.     set the locv of sprite pNewReedSprite = -1000
  234.   --updatestage
  235.   puppetsprite pVibNearReedChannel, False
  236.   puppetsprite pVibMiddleReedChannel, False
  237.   puppetsprite pVibFarReedChannel, False
  238.   puppetsprite pNearSwitchChannel, False
  239.   puppetsprite pMiddleSwitchChannel, False
  240.   puppetsprite pFarSwitchChannel, False
  241.   puppetsprite pNewReedSprite, False
  242.  
  243. end mClose
  244. ------------------------------------------------------------------------------------------------------------
  245. on mTeleMainLoop me
  246.   
  247.   -- called from Big Picture Frame Script to check if Mallet QT has stopped playing
  248.   if pMalletQTStatus = #ON then
  249.     
  250.     if the movierate of sprite pMalletQTChannel = 0 then  mStopMalletMovie me
  251.     
  252.   else
  253.     
  254.     set spritetoCheck = pRolloverStartsprite
  255.     set found = FALSE
  256.     repeat while (not found) and (spritetoCheck <= pRolloverEndSprite)
  257.       if rollover(spritetoCheck) then
  258.         set labelText = line (spritetoCheck - pRolloverStartsprite + 1) of plabels
  259.         mSetLabelText( gUtilityObj, labelText)
  260.         set found = TRUE
  261.       end if
  262.       set spritetoCheck = spritetoCheck + 1
  263.     end repeat
  264.     if (not found) then mSetLabelText( gUtilityObj, "")
  265.     
  266.   end if
  267.   
  268.   go the frame
  269.   
  270. end mTeleMainLoop
  271. ------------------------------------------------------------------------------------------------------------
  272. on mPlayMalletMovie me
  273.   
  274.   sound stop 1
  275.   sound stop 2
  276.   updatestage
  277.   
  278.   if pMalletQTStatus = #OFF then
  279.     
  280.     set pMalletQTStatus = #ON
  281.     set the movieTime of sprite pMalletQTChannel = 0
  282.     set the movieRate of sprite pMalletQTChannel = 1
  283.     
  284.   end if
  285.   
  286. end mPlayMalletMovie
  287. ------------------------------------------------------------------------------------------------------------
  288. on mStopMalletMovie me
  289.   
  290.   set pMalletQTStatus = #OFF
  291.   mResolution me
  292.   
  293. end mStopMalletMovie
  294. --------------------------------------------88-------------------------------------------------------------
  295. on mZoomSwitches me
  296.   
  297.   sound stop 2
  298.   cursor 4
  299.   if pMalletQTStatus = #OFF then
  300.     mUnsetCursors(gUtilityObj)
  301.     mSetRolloverLabels (me, #SwitchesCloseUp)
  302.     set NewFrame = mSetupZoomSwitches (me)
  303.     set the puppet of sprite pNearSwitchChannel = 0
  304.     set the puppet of sprite pMiddleSwitchChannel = 0
  305.     set the puppet of sprite pFarSwitchChannel = 0
  306.     go frame NewFrame
  307.     mSetCursors(gUtilityObj, [21:#Return,22:#Return,11:#Operate,12:#Operate,13:#Operate])
  308.   end if
  309.   cursor -1
  310.   
  311. end mZoomSwitches
  312. ------------------------------------------------------------------------------------------------------------
  313. on mZoomReeds me, WhichReed
  314.   
  315.   sound stop 2
  316.   
  317.   if pMalletQTStatus = #OFF then
  318.     mUnsetCursors(gUtilityObj)
  319.     mSetUpZoomReeds me, WhichReed
  320.     go frame WhichReed & "Reed"
  321.     mSetCursors(gUtilityObj, [21:#Return,22:#Return,15:#Zoomout,16:#Finger,17:#Finger,18:#Finger])
  322.   end if
  323.   
  324. end mZoomReeds
  325. ------------------------------------------------------------------------------------------------------------
  326. on mResolution me
  327.   
  328.   -- turn the puppet of the main switches to off
  329.   set the puppet of sprite pNearSwitchChannel = 0
  330.   set the puppet of sprite pMiddleSwitchChannel = 0
  331.   set the puppet of sprite pFarSwitchChannel = 0
  332.   mUnsetCursors(gUtilityObj)
  333.   
  334.   mSetLabelText( gUtilityObj, "")
  335.   go frame "HT_RESOLUTION"
  336.   -- setup info for vibrating tips, if any are active, and create pSoundKey
  337.   mSetupVibratingTips me
  338.   
  339.   -- play sound file
  340.   set SoundFile = getAProp(pSoundList, pSoundKey)
  341.   if not(voidP(SoundFile)) then sound playfile 2, gSNDpath & SoundFile
  342.   
  343.   -- setup animation parameters
  344.   set pReedTracker = 1 -- first animation number in pReedVibrationPattern
  345.   set pVibrateStatus = #VIBRATE -- allows animation to take place
  346.   mSetCursors(gUtilityObj, [21:#Return,22:#Return])
  347.   
  348. end
  349. ---------------------------------------------------------------------------------------------------------
  350. on mVibrateReeds me
  351.   
  352.   if pVibrateStatus = #VIBRATE then
  353.     
  354.     set NextModifier = getAt(pReedVibrationPattern, pReedTracker)
  355.     set the castNum of sprite pVibNearReedChannel = pNeutralNearReedCast + NextModifier
  356.     set the castNum of sprite pVibMiddleReedChannel = pNeutralMiddleReedCast + NextModifier
  357.     set the castNum of sprite pVibFarReedChannel = pNeutralFarReedCast + NextModifier
  358.     set pReedTracker = pReedTracker + 1
  359.     
  360.     if pReedTracker > pMaxReedAnimation then
  361.       puppetsprite pVibNearReedChannel, False
  362.       puppetsprite pVibMiddleReedChannel, False
  363.       puppetsprite pVibFarReedChannel, False
  364.       set pVibrateStatus = #STOPPED
  365.       set done = true
  366.     end if
  367.     
  368.   end if
  369.   
  370.   go the frame
  371.   
  372. end mVibrateReeds
  373. -----------------------------------------------------88-------------------------------------------
  374. on mGoToBigPictureFrameFromSwitches me  
  375.   
  376.   if pSwitchQTStatus = #OFF then 
  377.     mUnsetCursors(gUtilityObj)
  378.     mSetupBigPictureSwitches me
  379.     go frame "HT_BIGPICTURE"
  380.     mSetCursors(gUtilityObj, pBaseCursors)
  381.   end if
  382.   
  383. end mGoToBigPictureFrameFromSwitches
  384. -----------------------------------------------------88-------------------------------------------
  385. on mGoToBigPictureFrameFromReeds me
  386.   
  387.   set the puppet of sprite pNewReedSprite = 0
  388.   mSetupBigPictureSwitches me
  389.   mUnsetCursors(gUtilityObj)
  390.   go frame "HT_BIGPICTURE"
  391.   mSetCursors(gUtilityObj,pBaseCursors)
  392.   
  393. end mGoToBigPictureFrameFromReeds
  394. ---------------------------------------------------------------------------------------------------
  395. on mGoToBigPictureFrameFromVibratingReeds me
  396.   
  397.   mUnsetCursors(gUtilityObj)
  398.   sound stop 1
  399.   
  400.   set the puppet of sprite pVibNearReedChannel = 0
  401.   set the puppet of sprite pVibMiddleReedChannel = 0
  402.   set the puppet of sprite pVibFarReedChannel = 0
  403.   mSetupBigPictureSwitches me
  404.   go frame "HT_BIGPICTURE"
  405.   mSetCursors(gUtilityObj,pBaseCursors)
  406.   
  407. end mGoToBigPictureFrameFromVibratingReeds
  408. ---------------------------------------------------------------------------------------------------
  409. on mSetupBigPictureSwitches me
  410.   
  411.   -- puppet all three main switches]
  412.   
  413.   mSetRolloverLabels (me, #Main)
  414.   set the puppet of sprite pNearSwitchChannel = 1
  415.   set the puppet of sprite pMiddleSwitchChannel = 1
  416.   set the puppet of sprite pFarSwitchChannel = 1
  417.   
  418.   -- setup near, middle and far switches
  419.   if pNearSwitchStatus = #ON then set the castNum of sprite pNearSwitchChannel = pBigPicNearSwitchOnCast
  420.   else set the castNum of sprite pNearSwitchChannel = pBigPicNearSwitchOnCast + 1
  421.   
  422.   if pMiddleSwitchStatus = #ON then set the castNum of sprite pMiddleSwitchChannel = pBigPicMiddleSwitchOnCast
  423.   else set the castNum of sprite pMiddleSwitchChannel = pBigPicMiddleSwitchOnCast + 1
  424.   
  425.   if pFarSwitchStatus = #ON then set the castNum of sprite pFarSwitchChannel = pBigPicFarSwitchOnCast
  426.   else set the castNum of sprite pFarSwitchChannel = pBigPicFarSwitchOnCast + 1
  427.   
  428. end
  429. ------------------------------------------------------------------------------------------------------------
  430. on mSetupZoomReeds me, WhichReed
  431.   
  432.   mSetRolloverLabels( me,#ReedCloseUp)
  433.   -- puppet all three main switches
  434.   set the puppet of sprite pNewReedSprite = 1
  435.   -- set the locH and locV values for three main reeds
  436.   set the locH of sprite pNewReedSprite = pZoomReedH 
  437.   set the locV of sprite pNewReedSprite = pZoomReedV
  438.   -- setup near, middle and far reeds
  439.   
  440.   if WhichReed = "Near" then
  441.     set NextCast = pFirstNearReedCast + (pNearReedPosition * 2) - 2
  442.   else if WhichReed = "Middle" then
  443.     set NextCast = pFirstMiddleReedCast + (pMiddleReedPosition * 2) - 2
  444.   else if WhichReed = "Far" then
  445.     set NextCast = pFirstFarReedCast + (pFarReedPosition * 2) - 2
  446.   end if
  447.   set the castNum of sprite pNewReedSprite = NextCast
  448.   set the locH of sprite pNewReedSprite = 319
  449.   set the locV of sprite pNewReedSprite = 268
  450.   updateStage
  451.   
  452. end
  453. ------------------------------------------------------------------------------------------------------------
  454. on mSetupVibratingTips me
  455.   
  456.   -- AnswerString is converted into a string to get the appropriate sound file to play later
  457.   set AnswerString = ""
  458.   -- check for near, middle and far reeds vibrating
  459.   if pNearSwitchStatus = #ON then
  460.     if pNearReedPosition = pNearTunedPosition then
  461.       put "Near" after AnswerString
  462.       set the puppet of sprite pVibNearReedChannel = 1
  463.       set the castNum of sprite pVibNearReedChannel = pNeutralNearReedCast
  464.       set the locH of sprite pVibNearReedChannel = pVibNearReedH
  465.       set the locV of sprite pVibNearReedChannel = pVibNearReedV
  466.     end if
  467.   end if
  468.   
  469.   if pMiddleSwitchStatus = #ON then
  470.     if pMiddleReedPosition = pMiddleTunedPosition then
  471.       put "Middle" after AnswerString
  472.       set the puppet of sprite pVibMiddleReedChannel = 1
  473.       set the castNum of sprite pVibMiddleReedChannel = pNeutralMiddleReedCast
  474.       set the locH of sprite pVibMiddleReedChannel = pVibMiddleReedH
  475.       set the locV of sprite pVibMiddleReedChannel = pVibMiddleReedV
  476.     end if
  477.   end if
  478.   
  479.   if pFarSwitchStatus = #ON then
  480.     if pFarReedPosition = pFarTunedPosition then
  481.       put "Far" after AnswerString
  482.       set the puppet of sprite pVibFarReedChannel = 1
  483.       set the castNum of sprite pVibFarReedChannel = pNeutralFarReedCast
  484.       set the locH of sprite pVibFarReedChannel = pVibFarReedH
  485.       set the locV of sprite pVibFarReedChannel = pVibFarReedV
  486.     end if
  487.   end if
  488.   
  489.   set pSoundKey = value("#" & AnswerString)
  490.   
  491. end
  492. ----------------------------------------88------------------------------------------------------------------
  493. on mSetupZoomSwitches me
  494.   
  495.   set CurrentSettingsList = [pNearSwitchStatus,pMiddleSwitchStatus,pFarSwitchStatus]
  496.   set FrameIndexNum = 0
  497.   set numofFrame = count (pFrameFinderList)
  498.   repeat with loopCounter = 1 to numofFrame
  499.     if CurrentSettingsList = getAt (pFrameFinderList, loopCounter) then set FrameIndexNum = loopCounter
  500.   end repeat
  501.   set NewFrameLabel = FrameIndexNum & "ZSW"
  502.   Return NewFrameLabel
  503.   
  504. end
  505. --------------------------------------------------88-------------------------------------------------------
  506. on mZoomSwitchClicked me, SwitchPosition
  507.   
  508.   cursor 4
  509.   set VitalInfoList = [[#ON:["BHTSWZ3F.MOV",324,329], #OFF:["BHTSWZ3N.MOV",324,328]],[#ON:["BHTSWZ2F.MOV",354,218], #OFF:["BHTSWZ2N.MOV",354,218]],[#ON:["BHTSWZ1F.MOV",370,151], #OFF:["BHTSWZ1N.MOV",370,151]]]
  510.   
  511.   
  512.   if pSwitchQTStatus = #OFF then
  513.     
  514.     set listIndex = getPos ([#NEAR, #MIDDLE, #FAR], SwitchPosition)
  515.     set SwitchState = getAt ([pNearSwitchStatus,pMiddleSwitchStatus,pFarSwitchStatus], listIndex)
  516.     set infolist = getProp(getAt (VitalInfoList, listIndex), SwitchState)
  517.     puppetSprite pSwitchQTChannel, true
  518.     set the castNum of sprite pSwitchQTChannel = the number of cast (getAt(infolist, 1))
  519.     set the locH of sprite pSwitchQTChannel = getAt(infolist, 2)
  520.     set the locV of sprite pSwitchQTChannel = getAt(infolist, 3)
  521.     updateStage
  522.     
  523.     if SwitchState = #ON then set SwitchState = #OFF
  524.     else set SwitchState = #ON
  525.     
  526.     if SwitchPosition = #NEAR then 
  527.       set pNearSwitchStatus = SwitchState
  528.     else if SwitchPosition = #MIDDLE then 
  529.       set pMiddleSwitchStatus = SwitchState
  530.     else if SwitchPosition = #FAR then 
  531.       set pFarSwitchStatus = SwitchState
  532.     end if
  533.     
  534.   end if
  535.   
  536.   set pSwitchQTStatus = #ON
  537.   set pSwitchDestinationFrame = mSetupZoomSwitches (me)
  538.   
  539.   cursor -1
  540.   
  541. end
  542. ------------------------------------------------88---------------------------------------------------------
  543. on mCheckSwitchMovie me
  544.   
  545.   if pSwitchQTStatus = #ON then
  546.     
  547.     if the movieRate of sprite pSwitchQTChannel = 0 then
  548.       
  549.       puppetsprite pSwitchQTChannel, false
  550.       set the locv of sprite pSwitchQTChannel = -1000
  551.       
  552.       go frame pSwitchDestinationFrame
  553.       set pSwitchQTStatus = #OFF
  554.     end if
  555.     go the frame
  556.     
  557.   else mTeleMainLoop me
  558.   
  559. end mCheckSwitchMovie
  560. ------------------------------------------------------------------------------------------------------------
  561. on mReedClicked me, Reed, Destination
  562.   
  563.   set listIndex = getpos( [0,0,0,#NEAR,#MIDDLE,#FAR],Reed)
  564.   if Reed = #NEAR then
  565.     set ReedAnimList = mBuildReedList(me, pNearReedPosition, Destination, pFirstNearReedCast)
  566.     set pNearReedPosition = Destination
  567.   else if Reed = #MIDDLE then
  568.     set ReedAnimList = mBuildReedList(me, pMiddleReedPosition, Destination, pFirstMiddleReedCast)
  569.     set pMiddleReedPosition = Destination
  570.   else if Reed = #FAR then
  571.     set ReedAnimList = mBuildReedList(me, pFarReedPosition, Destination, pFirstFarReedCast)
  572.     set pFarReedPosition = Destination
  573.   end if
  574.   
  575.   set RepeatValue = count(ReedAnimList)
  576.   repeat with n = 1 to RepeatValue
  577.     set the castNum of sprite pNewReedSprite = getAt(ReedAnimList, n)
  578.     updateStage
  579.     set TargetTime = the timer + 12
  580.     repeat while the timer < TargetTime
  581.     end repeat
  582.   end repeat
  583.   
  584.   
  585. end
  586. ------------------------------------------------------------------------------------------------------------
  587. on mBuildReedList me, Position, Destination, FirstCast
  588.   
  589.   set ReedMoveList = []
  590.   if Position > Destination then
  591.     repeat with n = (Position * 2) - 1 down to (Destination * 2) - 1
  592.       add(ReedMoveList, (FirstCast + n - 1))
  593.     end repeat
  594.   else
  595.     repeat with n = (Position * 2) - 1 to (Destination * 2) - 1
  596.       add(ReedMoveList, (FirstCast + n - 1))
  597.     end repeat
  598.   end if
  599.   return ReedMoveList
  600.   
  601. end mBuildReedList
  602. ------------------------------------------------------------------------------------------------------------
  603. on mOperate me, whatselection
  604.   
  605.   set the puppet of sprite pVibNearReedChannel = 0
  606.   set the puppet of sprite pVibMiddleReedChannel = 0
  607.   set the puppet of sprite pVibFarReedChannel = 0
  608.   mGoToBigPictureFrameFromReeds ( me )
  609.   mPlayMalletMovie  ( me )
  610.   mClearToolHilite (gInterfaceMgrObj)
  611.   
  612. end mOperate
  613. ------------------------------------------------------------------------------------------------------------
  614. on mZoom me, whatselection
  615.   
  616.   if (whatselection <= 3) then
  617.     mZoomReeds me, "Near"
  618.     mSetupZoomReeds me, "Near"
  619.     mReedClicked me, #NEAR, whatselection
  620.   else if (whatselection <= 6) then
  621.     mZoomReeds me, "Middle"
  622.     mSetupZoomReeds me, "Middle"
  623.     mReedClicked me, #MIDDLE, (whatselection - 3)
  624.   else if (whatselection <= 9) then
  625.     mZoomReeds me, "Far"
  626.     mSetupZoomReeds me, "Far"
  627.     mReedClicked me, #FAR, (whatselection - 6)
  628.   end if
  629.   
  630.   mClearToolHilite (gInterfaceMgrObj)
  631.   
  632. end mZoom
  633.  
  634.  
  635.