home *** CD-ROM | disk | FTP | other *** search
/ Treasure Mathstorm / TMSWINCD.ISO / pc / install / lab3.mps < prev    next >
Text File  |  1996-10-14  |  19KB  |  844 lines

  1. ;ws109.mps
  2. ;mods for labdemo by Andy Wally 10/97
  3.  
  4. Labyrinth on
  5.  
  6. yield off
  7.  
  8. ;consts
  9.  
  10. ;settled
  11. joniSetId=6102
  12. santiagoSetId=6103
  13. laptrapSetId=6163
  14. monkeySetId=6105
  15.  
  16. ;bod
  17. joniLipsId=6106
  18. santiagoLipsId=6107
  19. monkeyLipsId=6109
  20. joniArmsId=6158
  21. santiagoArmsId=6159
  22. monkeyArmsId=6161
  23. joniBodId=6152
  24. santiagoBodId=6153
  25. monkeyBodId=6155
  26.  
  27. ;fidgets
  28. joniFidgetsId=[6110 6111 6112
  29. santiagoFidgetsId=[6113 6114 6115
  30. monkeyFidgetsId=[6119 6120
  31.  
  32. ;exit/enter
  33. joniEnterWId=6125
  34. santiagoEnterWId=6126
  35. laptrapEnterWId=6127
  36. joniEnterEId=6128
  37. santiagoEnterEId=6129
  38. laptrapEnterEId=6130
  39. joniExitWId=6131
  40. santiagoExitWId=6132
  41. laptrapExitWId=6133
  42. joniExitEId=6134
  43. santiagoExitEId=6135
  44. laptrapExitEId=6136
  45.  
  46. ;speech
  47. joniCPreSpchId=[6339 6340
  48. joniCPostSpchId=[6341 6342
  49. joniSolvedSpchId=6338
  50. santiagoCPreSpchId=[6343 6344
  51. santiagoCPostSpchId=[6345 6346
  52. santiagoWrongSpchId=6334
  53. santiagoSolvedSpchId=6337
  54. monkeyCPreSpchId=[6305 6306
  55. monkeyCPostSpchId=[6347 6348
  56. monkeyIntroSpchId=[6300 6301 6302
  57. monkeyRetSpchId=[6303 6304
  58. monkeyWrongSpchId=6332
  59. monkeySolvedSpchId=[6335 6336
  60. owenL1SpchId=6309
  61. owenL2SpchId=6312
  62. owenL3SpchId=6316
  63. owenL4SpchId=6319
  64. owenPostSpchId=6331
  65. leslieL1SpchId=[6310 6311
  66. leslieL2SpchId=[6313 6314 6315
  67. leslieL3ASpchId=6317
  68. leslieL3BSpchId=6318
  69. leslieL4SpchId=[6320 6321 6322
  70. lesliePostSpchId=[6328 6329
  71.  
  72. monkeyPolishId=6138
  73. laptrapHideId=6167
  74. radioLightId=6122
  75. backpackLightId=6123
  76. laptrapLightId=6124
  77.  
  78. plateId=6139
  79. grooveId=6166
  80. glintId=6137
  81. plateShineId=6147
  82. JSDuckId=6164
  83. bushSneezeId=6148
  84. branchGlowId=6149
  85. bushHalfSneezeId=6168
  86.  
  87. ;sfx
  88. glintSfxId=6120
  89. monkeyPolishSfxId=6121
  90. plateShineSfxId=6126
  91. mathraSfxId=[6122 6130 6131
  92. bushSneezeSfxId=6127
  93. branchGlowSfxId=6128
  94. bushHalfSneezeSfxId=6132
  95. answerSnapSfxId=6124
  96. answerGoHomeSfxId=6125
  97. answerPickUpSfxId=6123
  98. backpackSfxId=6129
  99.  
  100. backgroundId=6100
  101.  
  102. ;ws105
  103. WSceneId=4200
  104. ;ws111
  105. ESceneId=6600
  106.  
  107. ;tool placement
  108. whichPouch=0
  109.  
  110. ;coords
  111. plateX=[233 293 359 410 438
  112. plateY=[364 378 361 389 360
  113. ;varies with level
  114. grooveX=[332 353 332 332
  115. grooveY=[228 228 228 216
  116.  
  117. plateWidth=54
  118. plateHeight=26
  119.  
  120. ;groups
  121. preloadGroupId=6100
  122. enterWGroupId=6110
  123. enterEGroupId=6111
  124. exitWGroupId=6120
  125. exitEGroupId=6121
  126. monkeyPolishGroupId=6130
  127. ;mathraScareGroupId=6140
  128. rewardGroupId=6150
  129.  
  130. ;z values
  131. exitSpotZ=2
  132. mathraSpotZ=4
  133. grooveZ=6
  134. puzzleTextZ=8
  135. platesZ=10
  136. plateShineZ=12
  137. glintZ=14
  138. monkeyZ=16
  139. bushZ=18
  140. branchZ=20
  141. santiagoZ=30
  142. joniZ=32
  143. laptrapZ=34
  144. radioSpotZ=60
  145. backpackSpotZ=62
  146. toolkitZ=80
  147.  
  148. ;//////////////////////////////
  149.  
  150. include com.mps
  151. ;xtra line
  152. include data109.mps
  153. ;xtra line
  154. ;include help.mps
  155.  
  156. ;//////////////////////////////
  157.  
  158. ;global access
  159. ;worldMem=RWorldPort
  160. ;get worldMem priorScene prior
  161. ;set worldMem priorScene backgroundId
  162. ;get worldMem puzzleLevel math level
  163. ;get worldMem intVariable been109 beenHere
  164. ;if beenHere=0
  165. ;  set worldMem intVariable been109 1
  166. level=1
  167. beenHere=0
  168. prior=0
  169.  
  170.  
  171. joniClickCtr=1
  172. santiagoClickCtr=1
  173. monkeyClickCtr=1
  174. helpClickCtr=1
  175. mathraSpotClickCtr=1
  176. wrongCtr=1
  177.  
  178. puzzleCompleted=False
  179.  
  180. UseResourceGroupFile "wscommon.grp"
  181. UseResourceGroupFile "ws109.grp"
  182. UseResourceGroupFile "ws109P.grp"
  183. UseResourceGroupFile "help.grp"
  184.  
  185. call init
  186.  
  187. ;CacheFile "ws111P.grp"
  188. ;CacheFile "ws105P.grp"
  189. yield on
  190.  
  191. ;///////////////////////////////
  192.  
  193. procedure init
  194. [
  195.  
  196.   LoadResourceGroup preloadGroupId
  197.  
  198.   musicLoop=RBackgroundSound loopAMusicId
  199.   play musicLoop start
  200.  
  201.   scene=RScene backgroundId
  202.   play scene setScreenCursor deadCursor
  203.   set scene laptrapClosed laptrapDone
  204.   set scene goToSignin exitToSignin
  205.   set scene toolTaken saveToolState
  206.   ;play scene enableAsynchronousResourceLoading
  207.   play scene start
  208.  
  209. ;  get worldMem intVariable treasuresLeft109 treasuresLeft
  210. ;  if treasuresLeft
  211. ;    play scene dropTreasure branchGlowId blueSneezeberryTool -1 -1 branchZ treasuresLeft
  212.  
  213.   joni=RCharacter joniSetId -1 -1 joniZ
  214.   santiago=RCharacter santiagoSetId -1 -1 santiagoZ
  215.   laptrap=RCharacter laptrapSetId -1 -1 laptrapZ
  216.   monkey=RCharacter monkeySetId -1 -1 monkeyZ
  217.   call initChars
  218.   play monkey showPose
  219.  
  220.   fidgetManager=FidgetManager
  221.   call initFidgetManager
  222.   play fidgetManager start
  223.  
  224.   glint=RAmbientAnim glintId -1 -1 glintZ 30 glintSfxId
  225.   play glint start
  226.  
  227.   bushHalfSneeze=RAnimation bushHalfSneezeId -1 -1 bushZ
  228.   set bushHalfSneeze cursor liveCursor
  229.   set bushHalfSneeze clicked bushClicked
  230.   play bushHalfSneeze show
  231.  
  232.   groove=RAnimation grooveId grooveX.level grooveY.level grooveZ
  233.   play groove show
  234.  
  235.   puzzle=RPuzzle
  236.   call initPuzzleC
  237.   set puzzle scrambleAnswers true
  238.   set puzzle centerAnswerText true
  239.   set puzzle centerPuzzleText true
  240.   play puzzle setAnswerFont trueType CaslonLightSSK "Casll___" 20 10
  241.   play puzzle setPuzzleTextFont trueType CaslonLightSSK "Casll___" 20 10
  242.   play puzzle start
  243.  
  244.   call createHotSpots
  245.  
  246.   ;do this after the backpack hotspot is set up
  247. ;  call setupBackpack
  248.  
  249.   ;intro
  250.   if prior=0
  251.   [
  252.     play joni showPose
  253.     play santiago showPose
  254.     play laptrap showPose
  255.  
  256.     call entrySpeech
  257.   ]
  258.   else
  259.     call entrance
  260. ]
  261.  
  262. procedure initChars
  263. [
  264.   ;add anims
  265.   call addAnimsJoniC
  266.   call addAnimsSantiagoC
  267.   call addAnimsLaptrapC
  268.   play laptrap setAnim laptrapHideId -2 -2
  269.   ;monkey
  270.   play monkey setHead monkeyLipsId -1 -1
  271.   play monkey setArms monkeyArmsId -1 -1
  272.   play monkey setBody monkeyBodId -1 -1
  273.   play monkey setAnim monkeyFidgetsId.1 -2 -2
  274.   play monkey setAnim monkeyFidgetsId.2 -2 -2
  275.  
  276.   ;set clicks
  277.   call setCharClicksC
  278.   set monkey clicked monkeyClicked
  279.  
  280.   ;set cursors
  281.   call setCharCursorsC
  282.   set monkey cursor liveCursor
  283.  
  284.   set laptrap animateSettled true
  285. ]
  286.  
  287. procedure initFidgetManager
  288. [
  289.   joniFidg1=CharacterAction "joni" fidgetAnim joniFidgetsId.1
  290.   joniFidg2=CharacterAction "joni" fidgetAnim joniFidgetsId.2
  291.   joniFidg3=CharacterAction "joni" fidgetAnim joniFidgetsId.3
  292.   santiagoFidg1=CharacterAction "santiago" fidgetAnim santiagoFidgetsId.1
  293.   santiagoFidg2=CharacterAction "santiago" fidgetAnim santiagoFidgetsId.2
  294.   santiagoFidg3=CharacterAction "santiago" fidgetAnim santiagoFidgetsId.3
  295.   monkeyFidg1=CharacterAction "monkey" fidgetAnim monkeyFidgetsId.1
  296.   monkeyFidg2=CharacterAction "monkey" fidgetAnim monkeyFidgetsId.2
  297.   monkeyFidg3=CharacterAction "monkey" fidgetAnim monkeyFidgetsId.2
  298.  
  299.   play fidgetManager add "joniFidg1" 10
  300.   play fidgetManager add "santiagoFidg1" 10
  301.   play fidgetManager add "monkeyFidg1" 10
  302.   play fidgetManager add "joniFidg2" 10
  303.   play fidgetManager add "santiagoFidg2" 10
  304.   play fidgetManager add "monkeyFidg2" 10
  305.   play fidgetManager add "joniFidg3" 10
  306.   play fidgetManager add "santiagoFidg3" 10
  307.   play fidgetManager add "monkeyFidg3" 10
  308. ]
  309.  
  310. procedure createHotSpots
  311. [
  312.   ;navigation
  313. ;  exitSpotW=RCHotSpot 0 193 116 479
  314. ;  set exitSpotW zOrder exitSpotZ
  315. ;  set exitSpotW cursor westCursor
  316. ;  set exitSpotW hit goWest
  317.  
  318. ;  exitSpotE=RCHotSpot 524 193 639 439
  319. ;  set exitSpotE zOrder exitSpotZ
  320. ;  set exitSpotE cursor eastCursor
  321. ;  set exitSpotE hit goEast
  322.  
  323. ;demostuff
  324.  
  325.  
  326. pbExit=RPButton 600 450 31005
  327. set pbExit "hit" leavepreviews
  328.  
  329.  
  330. pbDemos=RPButton 500 450 31006
  331. set pbDemos "hit" leavethispreview
  332.  
  333. ;txtExit=RText 590 440 640 480 11 25 "Exit" 1 0 "Arial" 0
  334. ;txtDemos=RText 450 440 590 480 11 25  "Demo Menu" 1 0 "Arial" 0
  335. ;txtForward=RText 250 440 350 480 11 25  "Forward" 1 0 "Arial" 0
  336. ;txtBack=RText 180 440 250 480 11 25  "Back" 1 0 "Arial" 0
  337.  
  338. ;hsExit=RHotSpot 590 440 640 480
  339. ;hsDemos=RHotSpot 450 440 590 480
  340. ;hsForward=RHotSpot 250 440 350 480
  341. ;hsBack=RHotSpot 180 440 250 480
  342.  
  343. ;set hsExit "hit" killdemos
  344. ;set hsDemos "hit" killthisdemo
  345. ;set hsForward "hit" next
  346. ;set hsBack "hit" previous
  347.  
  348. ;end demostuff
  349.  
  350.  
  351.   ;tickle
  352. ;  mathraSpot=RCHotSpot 0 0 123 40
  353. ;  set mathraSpot cursor liveCursor
  354. ;  set mathraSpot zOrder mathraSpotZ
  355. ;  set mathraSpot hit mathraSpotClicked
  356.  
  357. ;  call showBackpackSpot 43 247 78 312
  358.  
  359. ;  call showRadioSpot 186 263 225 304
  360. ]
  361.  
  362. procedure addToPuzzle
  363. [
  364.   ;answers
  365.   for i 1 5
  366.   [
  367.     plates.i=RAnswer i plateId plateX.i plateY.i platesZ
  368.  
  369.     ;shift rect up 3
  370.     set plates.i textRect plateX.i plateY.i-3 plateX.i+plateWidth plateY.i+plateHeight-3
  371.   ]
  372.  
  373.   ;container
  374.   container=RContainer 1 grooveX.level grooveY.level grooveX.level+plateWidth grooveY.level+plateHeight
  375.  
  376.   ;puzzle text
  377.   call addPuzzleText
  378. ]
  379.  
  380. procedure addPuzzleText
  381. [
  382.   if (level=1)+(level=3)
  383.   [
  384.     X1=278
  385.     X2=482
  386.     Y1=100
  387.     tRectHeight=21
  388.     space=tRectHeight-7
  389.  
  390.     for i 1 4
  391.     [
  392.       Y2=Y1+tRectHeight
  393.       pText.i=RPuzzleText i X1 Y1 X2 Y2 puzzleTextZ false
  394.       Y1=Y2
  395.     ]
  396.  
  397.     Y1=Y1+space
  398.     pText.5=RPuzzleText 5 X1 Y1 X2 Y1+tRectHeight puzzleTextZ false
  399.  
  400.     ;("years" text next to groove)
  401.     pText.6=RPuzzleText 6 387 223 441 249 puzzleTextZ false
  402.   ]
  403.   else
  404.   [
  405.     if (level=2)
  406.     [
  407.       X1=278
  408.       X2=482
  409.       Y1=100
  410.       tRectHeight=21
  411.       space=tRectHeight-7
  412.  
  413.       for i 1 3
  414.       [
  415.         Y2=Y1+tRectHeight
  416.         pText.i=RPuzzleText i X1 Y1 X2 Y2 puzzleTextZ false
  417.         Y1=Y2
  418.       ]
  419.  
  420.       ;space
  421.       Y1=Y1+space
  422.  
  423.       for i 4 5
  424.       [
  425.         Y2=Y1+tRectHeight
  426.         pText.i=RPuzzleText i X1 Y1 X2 Y2 puzzleTextZ false
  427.         Y1=Y2
  428.       ]
  429.     ]
  430.     else
  431.     [
  432.       X1=278
  433.       X2=482
  434.       Y1=108
  435.       tRectHeight=21
  436.       space=tRectHeight-7
  437.  
  438.       for i 1 3
  439.       [
  440.         Y2=Y1+tRectHeight
  441.         pText.i=RPuzzleText i X1 Y1 X2 Y2 puzzleTextZ false
  442.         Y1=Y2
  443.       ]
  444.  
  445.       ;space
  446.       Y1=Y1+space
  447.  
  448.       pText.4=RPuzzleText 4 X1 Y1 X2 Y1+tRectHeight puzzleTextZ false
  449.  
  450.       ;("years" text next to groove)
  451.       pText.5=RPuzzleText 5 387 211 441 237 puzzleTextZ false
  452.     ]
  453.   ]
  454. ]
  455.  
  456. procedure entrance
  457. [
  458.   play joni hidePose
  459.   play santiago hidePose
  460.   play laptrap hidePose
  461.  
  462.   sNIB=StartNIBAction
  463.   eNIB=EndNIBAction
  464.  
  465.   play scene addToQueueBack "sNIB"
  466.  
  467.   if prior=WSceneId
  468.   [
  469.     loadAct=LoadResourceGroupAction enterWGroupId
  470.     play scene addToQueueBack "loadAct"
  471.  
  472.     call addQMoveActions joniEnterWId santiagoEnterWId laptrapEnterWId 0
  473.  
  474.     unloadAct=UnloadResourceGroupAction enterWGroupId
  475.     play scene addToQueueBack "unloadAct"
  476.   ]
  477.   else
  478.   [
  479.     loadAct=LoadResourceGroupAction enterEGroupId
  480.     play scene addToQueueBack "loadAct"
  481.  
  482.     call addQMoveActions joniEnterEId santiagoEnterEId laptrapEnterEId 0
  483.  
  484.     unloadAct=UnloadResourceGroupAction enterEGroupId
  485.     play scene addToQueueBack "unloadAct"
  486.   ]
  487.  
  488.   play scene addToQueueBack "eNIB"
  489.  
  490.   set scene queueFinished monkeyIntro
  491.   play scene startQueue
  492. ]
  493.  
  494. procedure monkeyIntro
  495. [
  496.   play monkey setAnim monkeyPolishId -1 -1
  497.  
  498.   loadAct=LoadResourceGroupAction monkeyPolishGroupId
  499.   unloadAct=UnloadResourceGroupAction monkeyPolishGroupId
  500.   monkeyPolish=CharacterAction "monkey" characterAnim monkeyPolishId
  501.   monkeyPolishSfx=SoundAction monkeyPolishSfxId
  502.  
  503.   monkeyPolishCAct=CompositeAction
  504.   play monkeyPolishCAct add "monkeyPolish"
  505.   play monkeyPolishCAct add "monkeyPolishSfx"
  506.  
  507.   play scene addToQueueBack "loadAct"
  508.   play scene addToQueueBack "monkeyPolishCAct"
  509.   play scene addToQueueBack "unloadAct"
  510.  
  511.   set scene queueFinished entrySpeech
  512.   play scene startQueue
  513. ]
  514.  
  515. procedure entrySpeech
  516. [
  517.   if beenHere=0
  518.   [
  519.     monkeySpch1=SpeechAction "monkey" monkeyIntroSpchId.1
  520.     monkeySpch2=SpeechAction "monkey" monkeyIntroSpchId.2
  521.     monkeySpch3=SpeechAction "monkey" monkeyIntroSpchId.3
  522.  
  523.     play scene addToQueueBack "monkeySpch1"
  524.     play scene addToQueueBack "monkeySpch2"
  525.     play scene addToQueueBack "monkeySpch3"
  526.   ]
  527.   else
  528.   [
  529.     monkeySpch1=SpeechAction "monkey" monkeyRetSpchId.1
  530.     monkeySpch2=SpeechAction "monkey" monkeyRetSpchId.2
  531.  
  532.     play scene addToQueueBack "monkeySpch1"
  533.     play scene addToQueueBack "monkeySpch2"
  534.   ]
  535.  
  536.   set scene queueFinished nothing
  537.   play scene startQueue
  538. ]
  539.  
  540. procedure mathraSpotClicked
  541. [
  542.   ;loadGrpAct=LoadResourceGroupAction mathraScareGroupId
  543.   ;unloadGrpAct=UnloadResourceGroupAction mathraScareGroupId
  544.   ;loadResAct=LoadResourceAction "WAVE" mathraSfxId.mathraSpotClickCtr
  545.   hideJoni=SetHidePoseAction "joni"
  546.   hideSantiago=SetHidePoseAction "santiago"
  547.   JSDuck=AnimAction JSDuckId -1 -1 joniZ mathraSfxId.mathraSpotClickCtr
  548.   showJoni=SettledPoseAction "joni"
  549.   showSantiago=SettledPoseAction "santiago"
  550.   laptrapHide=CharacterAction "laptrap" characterAnim laptrapHideId
  551.  
  552.   JSDuckQ=ActionQueue
  553.   play JSDuckQ addToBack "hideJoni"
  554.   play JSDuckQ addToBack "hideSantiago"
  555.   play JSDuckQ addToBack "JSDuck"
  556.   play JSDuckQ addToBack "showJoni"
  557.   play JSDuckQ addToBack "showSantiago"
  558.  
  559.   JSDuckCAct=CompositeAction
  560.   play JSDuckCAct add "JSDuckQ"
  561.   play JSDuckCAct add "laptrapHide"
  562.  
  563.   ;play scene addToQueueBack "loadGrpAct"
  564.   ;play scene addToQueueBack "loadResAct"
  565.   play scene addToQueueBack "JSDuckCAct"
  566.   ;play scene addToQueueBack "unloadGrpAct"
  567.  
  568.   if mathraSpotClickCtr=3
  569.     mathraSpotClickCtr=1
  570.   else
  571.     mathraSpotClickCtr=mathraSpotClickCtr+1
  572.  
  573.   set scene queueFinished nothing
  574.   play scene startQueue
  575. ]
  576.  
  577. procedure bushClicked
  578. [
  579.   halfSneezeAct=PlayAnimAction "bushHalfSneeze" bushHalfSneezeSfxId 0
  580.  
  581.   play scene addToQueueBack "halfSneezeAct"
  582.  
  583.   set scene queueFinished nothing
  584.   play scene startQueue
  585. ]
  586.  
  587. procedure joniClicked
  588. [
  589. ;  if puzzleCompleted=False
  590.     joniSpch=SpeechAction "joni" joniCPreSpchId.joniClickCtr
  591. ;  else
  592. ;    joniSpch=SpeechAction "joni" joniCPostSpchId.joniClickCtr
  593.  
  594.   play scene addToQueueBack "joniSpch"
  595.  
  596.   if joniClickCtr=1
  597.     joniClickCtr=2
  598.   else
  599.     joniClickCtr=1
  600.  
  601.   set scene queueFinished nothing
  602.   play scene startQueue
  603. ]
  604.  
  605. procedure santiagoClicked
  606. [
  607. ;  if puzzleCompleted=False
  608.     santiagoSpch=SpeechAction "santiago" santiagoCPreSpchId.santiagoClickCtr
  609. ;  else
  610. ;    santiagoSpch=SpeechAction "santiago" santiagoCPostSpchId.santiagoClickCtr
  611.  
  612.   play scene addToQueueBack "santiagoSpch"
  613.  
  614.   if santiagoClickCtr=1
  615.     santiagoClickCtr=2
  616.   else
  617.     santiagoClickCtr=1
  618.  
  619.   set scene queueFinished nothing
  620.   play scene startQueue
  621. ]
  622.  
  623. procedure monkeyClicked
  624. [
  625. ;  if puzzleCompleted=False
  626.     monkeySpch=SpeechAction "monkey" monkeyCPreSpchId.monkeyClickCtr
  627. ;  else
  628. ;    monkeySpch=SpeechAction "monkey" monkeyCPostSpchId.monkeyClickCtr
  629.  
  630.   play scene addToQueueBack "monkeySpch"
  631.  
  632.   if monkeyClickCtr=1
  633.     monkeyClickCtr=2
  634.   else
  635.     monkeyClickCtr=1
  636.  
  637.   set scene queueFinished nothing
  638.   play scene startQueue
  639. ]
  640.  
  641. procedure playerWrong
  642. [
  643.   if wrongCtr=1
  644.     spch=SpeechAction "monkey" monkeyWrongSpchId
  645.   else
  646.     spch=SpeechAction "santiago" santiagoWrongSpchId
  647.  
  648.   if wrongCtr=1
  649.     wrongCtr=2
  650.   else
  651.     wrongCtr=1
  652.  
  653.   play scene addToQueueBack "spch"
  654.  
  655.   set scene queueFinished nothing
  656.   play scene startQueue
  657. ]
  658.  
  659. procedure playerSolved
  660. [
  661.   set scene queueInterruptible 0
  662.   set joni clicked
  663.   set santiago clicked
  664.   set monkey clicked
  665.   set bushHalfSneeze clicked
  666.   joniClickCtr=1
  667.   santiagoClickCtr=1
  668.   monkeyClickCtr=1
  669.   helpClickCtr=1
  670.   puzzleCompleted=True
  671.  
  672.   loadGrpAct=LoadResourceGroupAction rewardGroupId
  673.   unloadGrpAct=UnloadResourceGroupAction rewardGroupId
  674.   loadResAct=LoadResourceAction "ASEQ" branchGlowId
  675.   monkeySpch1=SpeechAction "monkey" monkeySolvedSpchId.1
  676.   plateShine=AnimAction plateShineId grooveX.level grooveY.level plateShineZ plateShineSfxId
  677.   monkeySpch2=SpeechAction "monkey" monkeySolvedSpchId.2
  678.   hideBush=HideAnimAction "bushHalfSneeze"
  679.   bushSneeze=AnimAction bushSneezeId -1 -1 bushZ bushSneezeSfxId
  680.   showBush=ShowAnimAction "bushHalfSneeze"
  681.   branchGlowSfx=SoundAction branchGlowSfxId
  682. ;  treasure=TreasureAction branchGlowId blueSneezeberryTool -1 -1 branchZ
  683.   santiagoSpch=SpeechAction "santiago" santiagoSolvedSpchId
  684.   joniSpch=SpeechAction "joni" joniSolvedSpchId
  685.   sNIB=StartNIBAction
  686.   eNIB=EndNIBAction
  687.   sNIB2=StartNIBAction
  688.   eNIB2=EndNIBAction
  689.  
  690.   play scene addToQueueBack "sNIB"
  691.   play scene addToQueueBack "loadGrpAct"
  692.   play scene addToQueueBack "loadResAct"
  693.   play scene addToQueueBack "eNIB"
  694.   play scene addToQueueBack "monkeySpch1"
  695.   play scene addToQueueBack "plateShine"
  696.   play scene addToQueueBack "monkeySpch2"
  697.   play scene addToQueueBack "sNIB2"
  698.   play scene addToQueueBack "hideBush"
  699.   play scene addToQueueBack "bushSneeze"
  700.   play scene addToQueueBack "showBush"
  701.   play scene addToQueueBack "eNIB2"
  702. ;  play scene addToQueueBack "treasure"
  703.   play scene addToQueueBack "branchGlowSfx"
  704.   play scene addToQueueBack "santiagoSpch"
  705.   play scene addToQueueBack "joniSpch"
  706.   play scene addToQueueback "unloadGrpAct"
  707.  
  708. ;  set scene queueFinished saveToolState
  709.   set scene queueFinished goEast
  710.   play scene startQueue
  711. ]
  712.  
  713.  
  714. procedure goWest
  715. [
  716.   set scene queueInterruptible 0
  717.   loadAct=LoadResourceGroupAction exitWGroupId
  718.   ;unloadAct=UnloadResourceGroupAction exitWGroupId
  719.   sNIB=StartNIBAction
  720.   eNIB=EndNIBAction
  721.  
  722.   play scene addToQueueBack "sNIB"
  723.   play scene addToQueueBack "loadAct"
  724.   call addQMoveActions joniExitWId santiagoExitWId laptrapExitWId 1
  725.   ;play scene addToQueueBack "unloadAct"
  726.   play scene addToQueueBack "eNIB"
  727.  
  728.   set scene queueFinished exitWest
  729.   play scene startQueue
  730. ]
  731.  
  732. procedure goEast
  733. [
  734.   set scene queueInterruptible 0
  735.   loadAct=LoadResourceGroupAction exitEGroupId
  736.   ;unloadAct=UnloadResourceGroupAction exitEGroupId
  737.   sNIB=StartNIBAction
  738.   eNIB=EndNIBAction
  739.  
  740.   play scene addToQueueBack "sNIB"
  741.   play scene addToQueueBack "loadAct"
  742.   call addQMoveActions joniExitEId santiagoExitEId laptrapExitEId 1
  743.   ;play scene addToQueueBack "unloadAct"
  744.   play scene addToQueueBack "eNIB"
  745.  
  746.   set scene queueFinished exitEast
  747.   play scene startQueue
  748. ]
  749.  
  750. procedure saveToolState
  751. [
  752. ;  get scene treasuresShowing treasuresLeft
  753. ;  set worldMem intVariable treasuresLeft109 treasuresLeft
  754. ]
  755.  
  756. procedure leaving
  757. [
  758. play musicLoop stop
  759.   ;UnloadResourceGroup preloadGroupId
  760.   CloseResourceGroupFile "wscommon.grp"
  761.   CloseResourceGroupFile "ws109.grp"
  762.   CloseResourceGroupFile "ws109P.grp"
  763.   CloseResourceGroupFile "help.grp"
  764. ]
  765.  
  766. procedure exitWest
  767. [
  768.   call leaving
  769.  
  770. ;  UncacheFile "ws203P.grp"
  771. ;  UncacheFile "ws109P.grp"
  772.  
  773. Labyrinth off
  774. relay lab2.mps
  775. ]
  776.  
  777. procedure exitEast
  778. [
  779.   call leaving
  780.  
  781. ;  UncacheFile "ws203P.grp"
  782. ;  UncacheFile "ws109P.grp"
  783.  
  784. Labyrinth off
  785. relay labrnth2.mps
  786. ]
  787.  
  788. procedure exitToSignin
  789. [
  790. ;  call leaving
  791. ;
  792. ;  UncacheFile "ws105P.grp"
  793. ;  UncacheFile "ws111P.grp"
  794. ;
  795. ;  relay "signin.mps"
  796. ]
  797.  
  798.  
  799. procedure killdemos
  800.     [
  801.    quit
  802.    ]
  803.  
  804. procedure killthisdemo
  805.     [
  806.    drop script stack
  807.    relay autorun.mps
  808.    ]
  809.  
  810. procedure next
  811.     [
  812.    call exitEast
  813.    ]
  814.  
  815. procedure previous
  816.     [
  817.    call exitWest
  818.    ]
  819.  
  820. procedure leavethispreview
  821.   [
  822.   play musicLoop stop
  823.   Labyrinth off
  824. ;  click=RSound 31405 -1
  825. ;  play click start
  826. ;  pause 1
  827.   exit
  828.   ]
  829.  
  830.  
  831. procedure leavepreviews
  832.   [
  833.   play musicLoop stop
  834.   wp=WorldPort
  835.   firsttime=1
  836.   set wp intVariable 1 firsttime
  837.   Labyrinth off
  838. ;  click=RSound 31405 -1
  839. ;  play click start
  840. ;  pause 1
  841.   quit
  842.   ]
  843.  
  844.