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

  1. ;ws107a.mps
  2. ;mods for labdemo by Andy Wally 10/97
  3. ;debug on
  4. Labyrinth on
  5.  
  6. yield off
  7.  
  8. ;consts
  9.  
  10. ;settled
  11. joniSetId=4902
  12. santiagoSetId=4903
  13. laptrapSetId=4954
  14. sentinelSetId=4905
  15.  
  16. ;bod
  17. joniLipsId=4906
  18. santiagoLipsId=4907
  19. sentinelLipsId=4909
  20. joniArmsId=4919
  21. santiagoArmsId=4920
  22. joniBodId=4946
  23. santiagoBodId=4947
  24.  
  25. ;fidgets
  26. joniFidgetsId=[4910 4911 4912
  27. santiagoFidgetsId=[4913 4914 4915
  28.  
  29. ;exit/enter
  30. joniEnterWId=4955
  31. santiagoEnterWId=4957
  32. laptrapEnterWId=4956
  33. joniExitWId=4925
  34. santiagoExitWId=4926
  35. laptrapExitWId=4927
  36. joniExitEId=4928
  37. santiagoExitEId=4929
  38. laptrapExitEId=4930
  39.  
  40. ;speech
  41. joniCPreSpchId=[5123 5124
  42. joniCPostSpchId=[5125 5126
  43. joniSolvedSpchId=5122
  44. santiagoCPreSpchId=[5127 5128
  45. santiagoCPostSpchId=[5129 5130
  46. santiagoWrongSpchId=[5118 5120
  47. santiagoSolvedSpchId=5121
  48. sentinelCPreASpchId=[5100 5136
  49. sentinelCPreBSpchId=5101
  50. sentinelCPostSpchId=[5131 5132
  51. sentinelRetSpchId=[5133 5134 5135
  52. owenL1ASpchId=5103
  53. owenL1BSpchId=[5107 5108 5109
  54. owenL234SpchId=5103
  55. owenPostSpchId=5139
  56. leslieL1SpchId=[5104 5105 5106
  57. leslieL2SpchId=[5110 5111 5112
  58. leslieL3SpchId=[5114 5115 5116
  59. leslieL4SpchId=[5137 5138
  60. lesliePostSpchId=5140
  61.  
  62. radioLightId=4922
  63. backpackLightId=4923
  64. laptrapLightId=4924
  65.  
  66. bridgeUpId=4952
  67. bridgeLevelsId=4940
  68. bridgeDownId=4953
  69. snakesLId=4931
  70. snakesRId=4939
  71.  
  72. ;sfx
  73. snakesHissSfxId=4920
  74. snakeHissSfxId=4921
  75. bridgeLevelsSfxId=4922
  76. joniCrossesSfxId=4926
  77. santiagoCrossesSfxId=4927
  78. answerSnapSfxId=4924
  79. answerGoHomeSfxId=4925
  80. answerPickUpSfxId=4923
  81. backpackSfxId=4928
  82.  
  83. backgroundId=4900
  84.  
  85. ;initial opened pouch
  86. whichPouch=0
  87.  
  88. ;groups
  89. preloadGroupId=4900
  90. enterWGroupId=4910
  91. exitWGroupId=4920
  92. exitEGroupId=4921
  93. rewardGroupId=4930
  94.  
  95. ;z values
  96. exitSpotZ=2
  97. sentinelZ=4
  98. sentinelSpotZ=6
  99. bridgeZ=8
  100. puzzleTextZ=10
  101. santiagoZ=20
  102. joniZ=22
  103. laptrapZ=24
  104. rocksZ=[30 32 34 36
  105. snakesRZ=40
  106. snakesLZ=42
  107. radioSpotZ=60
  108. backpackSpotZ=62
  109. toolkitZ=80
  110.  
  111. ;//////////////////////////////
  112.  
  113.  
  114. include com.mps
  115. ;xtra line
  116. include data107a.mps
  117. ;xtra line
  118. ;include help.mps
  119.  
  120. ;//////////////////////////////
  121.  
  122. ;global access
  123. ;worldMem=RWorldPort
  124. ;get worldMem priorScene prior
  125. ;set worldMem priorScene backgroundId
  126. ;get worldMem puzzleLevel math level
  127. ;get worldMem intVariable been107 beenHere
  128. ;if beenHere=0
  129. ;  set worldMem intVariable been107 1
  130.  
  131. level=2
  132. beenHere=0
  133. joniClickCtr=1
  134. santiagoClickCtr=1
  135. sentinelClickCtr=1
  136. helpClickCtr=1
  137. wrongCtr=1
  138.  
  139. puzzleCompleted=False
  140.  
  141.  
  142. UseResourceGroupFile "wscommon.grp"
  143. UseResourceGroupFile "ws107a.grp"
  144. UseResourceGroupFile "ws107aP.grp"
  145. UseResourceGroupFile "help.grp"
  146.  
  147.  
  148.  
  149. call init
  150. yield on
  151.  
  152.  
  153. ;///////////////////////////////
  154.  
  155. procedure init
  156. [
  157.  
  158.   LoadResourceGroup preloadGroupId
  159.  
  160.   musicLoop=RBackgroundSound loopAMusicId
  161.  
  162.   scene=RScene backgroundId
  163.   play scene setScreenCursor deadCursor
  164.   set scene laptrapClosed laptrapDone
  165.   set scene goToSignin exitToSignin
  166.   play scene enableAsynchronousResourceLoading
  167.   play scene start
  168.  
  169.   joni=RCharacter joniSetId -1 -1 joniZ
  170.   santiago=RCharacter santiagoSetId -1 -1 santiagoZ
  171.   laptrap=RCharacter laptrapSetId -1 -1 laptrapZ
  172.   sentinel=RCharacter sentinelSetId -1 -1 sentinelZ
  173.   call initChars
  174.   play sentinel showPose
  175.  
  176.   fidgetManager=FidgetManager
  177.   call initFidgetManager
  178.   play fidgetManager start
  179.  
  180.   snakesL=RAmbientAnim snakesLId -1 -1 snakesLZ 0 0
  181.   snakesR=RAmbientAnim snakesRId -1 -1 snakesRZ 0 0
  182.   play snakesL start
  183.   play snakesR start
  184.   snakesHissSfx=RSound snakesHissSfxId 0
  185.  
  186.   bridgeUp=RAnimation bridgeUpId -1 -1 bridgeZ
  187.   play bridgeUp show
  188.  
  189.   puzzle=RPuzzle
  190.   call initPuzzleC
  191.   set puzzle scrambleAnswers true
  192.   set puzzle centerPuzzleText true
  193.   play puzzle setPuzzleTextFont trueType ACaslon "Acasb___" 16 10
  194.   play puzzle start
  195.  
  196.   call createHotSpots
  197.  
  198.   ;do this after the backpack hotspot is set up
  199. ;  call setupBackpack
  200.  
  201. ;  CacheFile "ws119P.grp"
  202. ;  CacheFile "ws203P.grp"
  203.  
  204.   ;intro
  205.  
  206.   if beenHere=0
  207.   [
  208.     play joni showPose
  209.     play santiago showPose
  210.     play laptrap showPose
  211.  
  212.      movieAct=MovieAction "mv107a.smk" 0 0 500000
  213.      play scene addToQueueBack "movieAct"
  214.  
  215.      set scene queueFinished movieDone
  216.     play scene startQueue
  217.   ]
  218. ]
  219.  
  220. procedure movieDone
  221. [
  222.   play musicLoop start
  223.   play snakesHissSfx start
  224. ]
  225.  
  226. procedure initChars
  227. [
  228.   ;add anims
  229.   call addAnimsJoniC
  230.   call addAnimsSantiagoC
  231.   call addAnimsLaptrapC
  232.   play sentinel setHead sentinelLipsId -1 -1
  233.  
  234.   ;set clicks
  235.   call setCharClicksC
  236.  
  237.   ;set cursors
  238.   call setCharCursorsC
  239.  
  240.   set laptrap animateSettled true
  241. ]
  242.  
  243. procedure initFidgetManager
  244. [
  245.   joniFidg1=CharacterAction "joni" fidgetAnim joniFidgetsId.1
  246.   joniFidg2=CharacterAction "joni" fidgetAnim joniFidgetsId.2
  247.   joniFidg3=CharacterAction "joni" fidgetAnim joniFidgetsId.3
  248.   santiagoFidg1=CharacterAction "santiago" fidgetAnim santiagoFidgetsId.1
  249.   santiagoFidg2=CharacterAction "santiago" fidgetAnim santiagoFidgetsId.2
  250.   santiagoFidg3=CharacterAction "santiago" fidgetAnim santiagoFidgetsId.3
  251.  
  252.   play fidgetManager add "joniFidg1" 10
  253.   play fidgetManager add "santiagoFidg1" 10
  254.   play fidgetManager add "joniFidg2" 10
  255.   play fidgetManager add "santiagoFidg2" 10
  256.   play fidgetManager add "joniFidg3" 10
  257.   play fidgetManager add "santiagoFidg3" 10
  258. ]
  259.  
  260. procedure createHotSpots
  261. [
  262. ;  ;navigation
  263. ;  exitSpotW=RCHotSpot 0 121 83 335
  264. ;  set exitSpotW zOrder exitSpotZ
  265. ;  set exitSpotW cursor westCursor
  266. ;  set exitSpotW hit goWest
  267.  
  268. ;  exitSpotE2=RCHotSpot 546 106 639 209
  269. ;  set exitSpotE2 zOrder exitSpotZ
  270. ;  set exitSpotE2 cursor eastCursor
  271. ;  set exitSpotE2 hit exitEast
  272.  
  273.  
  274. ;demostuff
  275. pbExit=RPButton 600 450 31005
  276. set pbExit "hit" leavepreviews
  277.  
  278.  
  279. pbDemos=RPButton 500 450 31006
  280. set pbDemos "hit" leavethispreview
  281.  
  282. ;txtExit=RText 590 440 640 480 11 25 "Exit" 1 0 "Arial" 0
  283. ;txtDemos=RText 500 400 640 440 11 25  "Demo Menu" 1 0 "Arial" 0
  284. ;txtForward=RText 550 400 640 440 10 25  "Forward" 1 0 "Arial" 0
  285. ;txtBack=RText 480 400 550 440 10 25  "Back" 1 0 "Arial" 0
  286.  
  287. ;hsExit=RHotSpot 580 440 640 480
  288. ;hsDemos=RHotSpot 500 400 640 440
  289. ;hsForward=RHotSpot 550 400 640 440
  290. ;hsBack=RHotSpot 480 400 550 440
  291.  
  292. ;set hsExit "hit" killdemos
  293. ;set hsDemos "hit" killthisdemo
  294. ;set hsForward "hit" next
  295. ;set hsBack "hit" previous
  296.  
  297. ;end demostuff
  298.  
  299.  
  300.  
  301.  
  302.   ;(sentinel set too small)
  303.   sentinelSpot=RCHotSpot 249 365 382 479
  304.   set sentinelSpot zOrder sentinelSpotZ
  305.   set sentinelSpot cursor liveCursor
  306.   set sentinelSpot hit sentinelClicked
  307.  
  308. ;  call showBackpackSpot 86 221 115 269
  309.  
  310. ;  call showRadioSpot 166 234 198 264
  311. ]
  312.  
  313. procedure addToPuzzle
  314. [
  315.  
  316.   ;answers
  317.   rockPair1=RAnswer 1 0 5 319 rocksZ.1
  318.   rockPair2=RAnswer 2 0 1 367 rocksZ.3
  319.   rockPair3=RAnswer 3 0 105 344 rocksZ.2
  320.   rockPair4=RAnswer 4 0 52 400 rocksZ.4
  321.  
  322.   ;containers
  323.   container=RContainer 1 244 243 305 302
  324.  
  325.   ;puzzle text
  326.   pText=RPuzzleText 1 381 344 445 368 puzzleTextZ false
  327. ]
  328.  
  329. procedure entrance
  330. [
  331.   play joni hidePose
  332.   play santiago hidePose
  333.   play laptrap hidePose
  334.  
  335.   loadAct=LoadResourceGroupAction enterWGroupId
  336.   unloadAct=UnloadResourceGroupAction enterWGroupId
  337.   sNIB=StartNIBAction
  338.   eNIB=EndNIBAction
  339.  
  340.   play scene addToQueueBack "sNIB"
  341.   play scene addToQueueBack "loadAct"
  342.   call addQMoveActions joniEnterWId santiagoEnterWId laptrapEnterWId 0
  343.   play scene addToQueueBack "unloadAct"
  344.   play scene addToQueueBack "eNIB"
  345.  
  346.   set scene queueFinished entrySpeech
  347.   play scene startQueue
  348. ]
  349.  
  350. procedure entrySpeech
  351. [
  352.   sentinelSpch1=SpeechAction "sentinel" sentinelRetSpchId.1
  353.   sentinelSpch2=SpeechAction "sentinel" sentinelRetSpchId.2
  354.   sentinelSpch3=SpeechAction "sentinel" sentinelRetSpchId.3
  355.  
  356.   play scene addToQueueBack "sentinelSpch1"
  357.   play scene addToQueueBack "sentinelSpch2"
  358.   play scene addToQueueBack "sentinelSpch3"
  359.  
  360.   set scene queueFinished nothing
  361.   play scene startQueue
  362. ]
  363.  
  364. procedure playerWrong
  365. [
  366.   spch=SpeechAction "santiago" santiagoWrongSpchId.wrongCtr
  367.  
  368.   if wrongCtr=1
  369.     wrongCtr=2
  370.   else
  371.     wrongCtr=1
  372.  
  373.   play scene addToQueueBack "spch"
  374.  
  375.   set scene queueFinished nothing
  376.   play scene startQueue
  377. ]
  378.  
  379. procedure playerSolved
  380. [
  381.   set joni clicked
  382.   set santiago clicked
  383.   set sentinel clicked
  384.   joniClickCtr=1
  385.   santiagoClickCtr=1
  386.   sentinelClickCtr=1
  387.   helpClickCtr=1
  388.   puzzleCompleted=True
  389.  
  390.   set scene queueInterruptible 0
  391.   loadGrpAct=LoadResourceGroupAction rewardGroupId
  392.   loadResAct=LoadResourceAction "ASEQ" bridgeDownId
  393.   sNIB=StartNIBAction
  394.   eNIB=EndNIBAction
  395.  
  396.   play scene addToQueueBack "sNIB"
  397.   play scene addToQueueBack "loadGrpAct"
  398.   play scene addToQueueBack "loadResAct"
  399.   play scene addToQueueBack "eNIB"
  400.  
  401.   set scene queueFinished rewardResLoaded
  402.  
  403.   play scene startQueue
  404. ]
  405.  
  406. procedure rewardResLoaded
  407. [
  408.   set scene queueInterruptible 0
  409.   drop bridgeUp
  410.   bridgeDown=RAnimation bridgeDownId -1 -1 bridgeZ
  411.  
  412.   hideRock=HideAnswerAction
  413.   hidePuzzleText=HidePuzzleTextAction
  414.   bridgeLevels=AnimAction bridgeLevelsId -1 -1 bridgeZ bridgeLevelsSfxId
  415.   showLeveledBridge=ShowAnimAction "bridgeDown"
  416.   unloadGrpAct=UnloadResourceGroupAction rewardGroupId
  417.  
  418.   play scene addToQueueBack "hideRock"
  419.   play scene addToQueueBack "hidePuzzleText"
  420.   play scene addToQueueBack "bridgeLevels"
  421.   play scene addToQueueBack "showLeveledBridge"
  422.   play scene addToQueueBack "unloadGrpAct"
  423.  
  424.   set scene queueFinished bridgeLeveled
  425.   play scene startQueue
  426. ]
  427.  
  428. procedure bridgeLeveled
  429. [
  430.   set scene queueInterruptible 0
  431.   ;player can now advance
  432.   exitSpotE=RCHotSpot 546 246 639 399
  433. ;  set exitSpotE zOrder exitSpotZ
  434. ;  set exitSpotE cursor eastCursor
  435. ;  set exitSpotE hit goEast
  436. ;  set exitSpotE2 hit goEast
  437.  
  438.   santiagoSpch=SpeechAction "santiago" santiagoSolvedSpchId
  439.   joniSpch=SpeechAction "joni" joniSolvedSpchId
  440.  
  441.   play scene addToQueueBack "santiagoSpch"
  442.   play scene addToQueueBack "joniSpch"
  443.  
  444.   set scene queueFinished goEast
  445.   play scene startQueue
  446. ]
  447.  
  448. procedure joniClicked
  449. [
  450. ;  if puzzleCompleted=False
  451.     joniSpch=SpeechAction "joni" joniCPreSpchId.joniClickCtr
  452. ;  else
  453. ;    joniSpch=SpeechAction "joni" joniCPostSpchId.joniClickCtr
  454.  
  455.   play scene addToQueueBack "joniSpch"
  456.  
  457.   if joniClickCtr=1
  458.     joniClickCtr=2
  459.   else
  460.     joniClickCtr=1
  461.  
  462.   set scene queueFinished nothing
  463.   play scene startQueue
  464. ]
  465.  
  466. procedure santiagoClicked
  467. [
  468. ;  if puzzleCompleted=False
  469.     santiagoSpch=SpeechAction "santiago" santiagoCPreSpchId.santiagoClickCtr
  470. ;  else
  471. ;    santiagoSpch=SpeechAction "santiago" santiagoCPostSpchId.santiagoClickCtr
  472.  
  473.   play scene addToQueueBack "santiagoSpch"
  474.  
  475.   if santiagoClickCtr=1
  476.     santiagoClickCtr=2
  477.   else
  478.     santiagoClickCtr=1
  479.  
  480.   set scene queueFinished nothing
  481.   play scene startQueue
  482. ]
  483.  
  484. procedure sentinelClicked
  485. [
  486.   if puzzleCompleted=False
  487.   [
  488.     snakeHissSfx=SoundAction snakeHissSfxId
  489.  
  490.     if sentinelClickCtr=1
  491.     [
  492.       sentinelSpch1=SpeechAction "sentinel" sentinelCPreASpchId.1
  493.       sentinelSpch2=SpeechAction "sentinel" sentinelCPreASpchId.2
  494.  
  495.       play scene addToQueueBack "sentinelSpch1"
  496.       play scene addToQueueBack "sentinelSpch2"
  497.       play scene addToQueueBack "snakeHissSfx"
  498.     ]
  499.     else
  500.     [
  501.       sentinelSpch=SpeechAction "sentinel" sentinelCPreBSpchId
  502.  
  503.       play scene addToQueueBack "sentinelSpch"
  504.       play scene addToQueueBack "snakeHissSfx"
  505.     ]
  506.   ]
  507. ;  else
  508. ;  [
  509. ;    sentinelSpch=SpeechAction "sentinel" sentinelCPostSpchId.sentinelClickCtr
  510. ;
  511. ;    play scene addToQueueBack "sentinelSpch"
  512. ;  ]
  513.  
  514.   if sentinelClickCtr=1
  515.     sentinelClickCtr=2
  516.   else
  517.     sentinelClickCtr=1
  518.  
  519.   set scene queueFinished nothing
  520.   play scene startQueue
  521. ]
  522.  
  523. procedure addQHelpTalk
  524. [
  525. ]
  526.  
  527. procedure goWest
  528. [
  529.   loadAct=LoadResourceGroupAction exitWGroupId
  530.   ;unloadAct=UnloadResourceGroupAction exitWGroupId
  531.   sNIB=StartNIBAction
  532.   eNIB=EndNIBAction
  533.  
  534.   play scene addToQueueBack "sNIB"
  535.   play scene addToQueueBack "loadAct"
  536.   call addQMoveActions joniExitWId santiagoExitWId laptrapExitWId 1
  537.   ;play scene addToQueueBack "unloadAct"
  538.   play scene addToQueueBack "eNIB"
  539.  
  540.   set scene queueFinished exitWest
  541.   play scene startQueue
  542. ]
  543.  
  544. procedure goEast
  545. [
  546.   set scene queueInterruptible 0
  547.   play musicLoop pause
  548.  
  549.   play joni setAnim joniExitEId -1 -1
  550.   play joni hideSettled joniExitEId true
  551.   play santiago setAnim santiagoExitEId -1 -1
  552.   play santiago hideSettled santiagoExitEId true
  553.   play laptrap setAnim laptrapExitEId -1 -1
  554.   play laptrap hideSettled laptrapExitEId true
  555.  
  556.   loadAct=LoadResourceGroupAction exitEGroupId
  557.   ;unloadAct=UnloadResourceGroupAction exitEGroupId
  558.   joniCrosses=CharacterAction "joni" characterAnim joniExitEId
  559.   santiagoCrosses=CharacterAction "santiago" characterAnim santiagoExitEId
  560.   laptrapCrosses=CharacterAction "laptrap" characterAnim laptrapExitEId
  561.   joniCrossesSfx=SoundAction joniCrossesSfxId
  562.   santiagoCrossesSfx=SoundAction santiagoCrossesSfxId
  563.   sNIB=StartNIBAction
  564.   eNIB=EndNIBAction
  565.  
  566.   grp1CrossesCAct=CompositeAction
  567.   play grp1CrossesCAct add "santiagoCrosses"
  568.   play grp1CrossesCAct add "santiagoCrossesSfx"
  569.  
  570.   grp2CrossesCAct=CompositeAction
  571.   play grp2CrossesCAct add "joniCrosses"
  572.   play grp2CrossesCAct add "joniCrossesSfx"
  573.   play grp2CrossesCAct add "laptrapCrosses"
  574.  
  575.   play scene addToQueueBack "sNIB"
  576.   play scene addToQueueBack "loadAct"
  577.   play scene addToQueueBack "grp1CrossesCAct"
  578.   play scene addToQueueBack "grp2CrossesCAct"
  579.   ;play scene addToQueueBack "unloadAct"
  580.   play scene addToQueueBack "eNIB"
  581.  
  582.   set scene queueFinished exitEast
  583.   play scene startQueue
  584. ]
  585.  
  586. procedure leaving
  587. [
  588. play musicLoop stop
  589.   UnloadResourceGroup preloadGroupId
  590.   CloseResourceGroupFile "wscommon.grp"
  591.   CloseResourceGroupFile "ws107a.grp"
  592.   CloseResourceGroupFile "ws107aP.grp"
  593.   CloseResourceGroupFile "help.grp"
  594. ]
  595.  
  596. procedure exitWest
  597. [
  598.   call leaving
  599.  
  600. ;  UncacheFile "ws107aP.grp"
  601.  
  602. ;  relay "ws105.mps"
  603.  
  604. Labyrinth off
  605. relay labrnth1.mps
  606.  
  607. ]
  608.  
  609. procedure exitEast
  610. [
  611.   play musicLoop resume
  612.  
  613.   call leaving
  614.  
  615. ;  UncacheFile "ws105P.grp"
  616.   ; uncache this one, since a return will be thru 107b
  617. ;    UncacheFile "ws107aP.grp"
  618.  
  619. ;  relay "ws119.mps"
  620. relay lab2.mps
  621.  
  622. ]
  623.  
  624. procedure exitToSignin
  625. [
  626. ;  call leaving
  627. ;
  628. ;  UncacheFile "ws105P.grp"
  629. ;  UncacheFile "ws107aP.grp"
  630. ;  UncacheFile "ws119P.grp"
  631. ;
  632. ;  relay "signin.mps"
  633. ]
  634.  
  635. procedure killdemos
  636.     [
  637.    quit
  638.    ]
  639.  
  640. procedure killthisdemo
  641.     [
  642.    drop script stack
  643.    relay autorun.mps
  644.    ]
  645.  
  646. ;procedure next
  647. ;    [
  648. ;   call exitEast
  649. ;   ]
  650. ;
  651. ;procedure previous
  652. ;    [
  653. ;   call exitWest
  654. ;   ]
  655.  
  656. procedure leavethispreview
  657.   [
  658.   play musicLoop stop
  659.     Labyrinth off
  660. ;  click=RSound 31405 -1
  661. ;  play click start
  662. ;  pause 1
  663.   exit
  664.   ]
  665.  
  666.  
  667. procedure leavepreviews
  668.   [
  669.   wp=RWorldPort
  670.   firsttime=0
  671.   set wp intVariable 1 firsttime
  672.   Labyrinth off
  673. ;  click=RSound 31405 -1
  674. ;  play click start
  675. ;  pause 1
  676.   quit
  677.   ]
  678.  
  679.