SHARE
TWEET

Untitled

a guest Sep 18th, 2017 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. '*********************************************************************
  2. '* GRONI PINBALL PRESENTS ********************************************
  3. '*********************************************************************
  4. '* A VISUAL PINBALL X RELEASE ****************************************
  5. '*********************************************************************
  6. '* THE WALKING DEAD - PRO EDITION ************************************
  7. '*********************************************************************
  8. '* A PINBALL MACHINE BY STERN 2014 ***********************************
  9. '*********************************************************************
  10.  
  11. '*********************************************************************
  12. '* LAYERS ************************************************************
  13. '*********************************************************************
  14. '* LAYER 1 = STANDARD VP OBJECTS *************************************
  15. '* LAYER 2 = 3D OBJECTS **********************************************
  16. '* LAYER 3 = INSERT LIGHTS *******************************************
  17. '* LAYER 4 = FLASHER LIGHTS ******************************************
  18. '* LAYER 5 = GI ******************************************************
  19. '*********************************************************************
  20.  
  21. Option Explicit
  22. Randomize
  23.  
  24. DefaultOptions = 1*optExpr+1*optHitch+1*optWood+1*optBarn+1*optRamp+1*optFlip+1*optCard+1*optWell+1*optRubb+1*optFish+1*optTank+1*optBlade+1*optSanc+1*optTower
  25.  
  26. '*********************************************************************
  27. '* DOF CONTROLLER INIT ***********************************************
  28. '*********************************************************************
  29.  
  30. On Error Resume Next
  31. ExecuteGlobal GetTextFile("controller.vbs")
  32. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  33. On Error Goto 0
  34.  
  35. '*********************************************************************
  36. '* VARIABLES *********************************************************
  37. '*********************************************************************
  38.  
  39. Dim Ballspeed, bsTrough, plungerIM, PlNewPos, PlOldPos, PCount, BIP, WWSWHIT, Drops, PrisonMagnet
  40. Dim sw9Dir, sw9Pos, sw10Dir, sw10Pos, sw11Dir, sw11Pos, Dropbank
  41. Dim OptReset, DefaultOptions, Express, Hitch, Wood, Barn, Ramp, Flip, Card, Well, Rubb, Fish, Tank, Blade, Sanc, Tower
  42.  
  43. '*********************************************************************
  44. '* STARTUP SETTINGS **************************************************
  45. '*********************************************************************
  46.  
  47. RightSlingRubber_C.visible=0:RightSlingRubber_B.visible=0:RightSlingRubber_A.visible=0
  48.  
  49. LeftSlingRubber_C.visible=0:LeftSlingRubber_B.visible=0:LeftSlingRubber_A.visible=0
  50.  
  51. LDCOL.isdropped=1:RDCOL.isdropped=1
  52.  
  53. '*********************************************************************
  54. '* VPM INIT **********************************************************
  55. '*********************************************************************
  56.  
  57. Const BallSize = 53
  58.  
  59. LoadVPM "01560000", "SAM.VBS", 3.10
  60.  
  61. Const UseSolenoids = 1
  62. Const UseLamps = 0
  63. Const UseSync = 0
  64. Const HandleMech = 0
  65.  
  66. Const SCoin = "fx_Coin"
  67.  
  68. Set GiCallback2 = GetRef("UpdateGI")
  69.  
  70. InitializeOptions
  71.  
  72. 'Set GiCallback2 = GetRef("UpdateGI")
  73.  
  74. '*********************************************************************
  75. '* GAME NAME *********************************************************
  76. '*********************************************************************
  77.  
  78. Const cGameName = "twd_156"
  79.  
  80. '*********************************************************************
  81. '*********************************************************************
  82. '*********************************************************************
  83. '* TABLE INIT ********************************************************
  84. '*********************************************************************
  85. '*********************************************************************
  86. '*********************************************************************
  87.  
  88. Sub TWD_Init
  89. vpmInit Me
  90. With Controller
  91. .GameName = cGameName
  92. If Err Then MsgBox "Can't start Game " & cGameName & vbNewLine & Err.Description:Exit Sub
  93. .SplashInfoLine = "The Walking Dead - Pro Edition" & vbNewLine & "VPX Table by GRONI PINBALL V.1.0"
  94. .Games(cGameName).Settings.Value("rol") = 0
  95. .HandleKeyboard = 0
  96. .ShowTitle = 0
  97. .ShowDMDOnly = 1
  98. .ShowFrame = 0
  99. .HandleMechanics = 0
  100. .Hidden = 0
  101. On Error Resume Next
  102. .Run GetPlayerHWnd
  103. If Err Then MsgBox Err.Description
  104. On Error Goto 0
  105. End With
  106.  
  107. '*********************************************************************
  108. '* PINMAME TIMER *****************************************************
  109. '*********************************************************************
  110.  
  111. PinMAMETimer.Interval = PinMAMEInterval
  112. PinMAMETimer.Enabled = 1
  113.  
  114. '*********************************************************************
  115. '* BALL TROUGH *******************************************************
  116. '*********************************************************************
  117.  
  118. Set bsTrough = New cvpmBallStack
  119. With bsTrough
  120. .InitSw 0, 21, 20, 19, 18, 0, 0, 0
  121. .InitKick BallRelease, 90, 7
  122. .InitEntrySnd "", ""
  123. .InitExitSnd SoundFX("Stern_BallRelease",DOFContactors), SoundFX("Stern_BallRelease",DOFContactors)
  124. .Balls = 4
  125. End With
  126.  
  127. '*********************************************************************
  128. '* PLUNGER ***********************************************************
  129. '*********************************************************************
  130.  
  131. Const IMPowerSetting = 62
  132. Const IMTime = 0.6
  133. Set plungerIM = New cvpmImpulseP
  134. With plungerIM
  135. .InitImpulseP swplunger, IMPowerSetting, IMTime
  136. .Switch 23
  137. .Random 1.5
  138. .InitExitSnd SoundFX("Stern_Plung",DOFContactors), "Stern_PlungEmpty"
  139. .CreateEvents "plungerIM"
  140. End With
  141.  
  142. '*********************************************************************
  143. '* DROP TARGETS ******************************************************
  144. '*********************************************************************
  145.  
  146. Set Dropbank = new cvpmDropTarget
  147. With Dropbank
  148. .Initdrop Array(sw9, sw10, sw11), Array(9, 10, 11)
  149. .InitSnd SoundFX("Stern_Targetdrop",DOFDropTargets), SoundFX("Stern_Targetreset",DOFContactors)
  150. End With
  151.  
  152. '*********************************************************************
  153. '* MAGNET ************************************************************
  154. '*********************************************************************
  155.  
  156. Set PrisonMagnet = New cvpmMagnet
  157. With PrisonMagnet
  158. .InitMagnet PMagnet, 22
  159. .GrabCenter = 1
  160. .CreateEvents "PrisonMagnet"
  161. End With
  162.  
  163. '*********************************************************************
  164. '* TILT  *************************************************************
  165. '*********************************************************************
  166.  
  167. vpmNudge.TiltSwitch = -7
  168. vpmNudge.Sensitivity = 5.35
  169. vpmNudge.TiltObj = Array(TopBumper,RightBumper,LeftBumper,LeftSlingshot,RightSlingshot)
  170.  
  171. '*********************************************************************
  172. '* UPDATE GI *********************************************************
  173. '*********************************************************************
  174.  
  175. UpdateGI 0, 1:UpdateGI 1, 1:UpdateGI 2, 1
  176.  
  177. '*********************************************************************
  178. '*********************************************************************
  179. '*********************************************************************
  180. '* END OF TABLE INIT *************************************************
  181. '*********************************************************************
  182. '*********************************************************************
  183. '*********************************************************************
  184.  
  185. End Sub
  186.  
  187. '*********************************************************************
  188. '* KEYS **************************************************************
  189. '*********************************************************************
  190.  
  191. Sub TWD_KeyDown(ByVal Keycode)
  192. If keycode = PlungerKey Then Plunger.PullBack:End If
  193.  
  194. If keycode = CenterTiltKey Then Nudge 0, 5
  195. If vpmKeyDown(keycode) Then Exit Sub
  196.  
  197.     If keycode = LeftFlipperKey Then
  198.         LeftFlipper.RotateToEnd
  199.         PlaySound SoundFX("Stern_FlipperUpLeft",DOFFlippers)
  200.     End If
  201.  
  202.     If keycode = RightFlipperKey Then
  203.         RightFlipper.RotateToEnd
  204.         PlaySound SoundFX("Stern_FlipperUpRight",DOFFlippers)
  205.     End If
  206.  
  207.     If keycode = LeftTiltKey Then
  208.         Nudge 90, 2
  209.     End If
  210.    
  211.     If keycode = RightTiltKey Then
  212.         Nudge 270, 2
  213.     End If
  214.    
  215.     If keycode = CenterTiltKey Then
  216.         Nudge 0, 2
  217.     End If
  218.  
  219. End Sub
  220.  
  221. Sub TWD_KeyUp(ByVal Keycode)
  222. If keycode = PlungerKey Then Plunger.Fire:If BIP=1 then Playsound "Stern_Plung" else If BIP=0 then Playsound "Stern_PlungEmpty":End If
  223.  
  224. If vpmKeyUp(keycode) Then Exit Sub
  225.  
  226.     If keycode = LeftFlipperKey Then
  227.         LeftFlipper.RotateToStart
  228.         PlaySound SoundFX("Stern_FlipperDownLeft",DOFFlippers)
  229.     End If
  230.    
  231.     If keycode = RightFlipperKey Then
  232.         RightFlipper.RotateToStart
  233.         PlaySound SoundFX("Stern_FlipperDownRight",DOFFlippers)
  234.     End If
  235.  
  236. End Sub
  237.  
  238. '*********************************************************************
  239. '* CONTROLLER PAUSE **************************************************
  240. '*********************************************************************
  241.  
  242. Sub TWD_Paused:Controller.Pause = 1:End Sub
  243. Sub TWD_unPaused:Controller.Pause = 0:End Sub
  244.  
  245. '*********************************************************************
  246. '* DRAIN HIT *********************************************************
  247. '*********************************************************************
  248.  
  249. Sub Drain_Hit:Playsound "Stern_Drain":bsTrough.AddBall Me:End Sub
  250. Sub Drain1_Hit:Playsound "Stern_Drain":bsTrough.AddBall Me:End Sub
  251. Sub Drain2_Hit:Playsound "Stern_Drain":bsTrough.AddBall Me:End Sub
  252.  
  253. '*********************************************************************
  254. '* POP BUMPERS *******************************************************
  255. '*********************************************************************
  256.  
  257. Sub LeftBumper_Hit:vpmTimer.PulseSw 30:PlaySound SoundFX("Stern_Bumper2",DOFContactors):End Sub
  258.  
  259. Sub TopBumper_Hit:vpmTimer.PulseSw 32:PlaySound SoundFx("Stern_Bumper1",DOFContactors):End Sub
  260.  
  261. Sub RightBumper_Hit:vpmTimer.PulseSw 31:PlaySound SoundFX("Stern_Bumper3",DOFContactors):End Sub
  262.  
  263. '*********************************************************************
  264. '* SLINGSHOTS ********************************************************
  265. '*********************************************************************
  266.  
  267. Dim LSlingStep
  268. Sub LeftSlingShot_Slingshot
  269. LeftSlingRubber.visible=0
  270. LeftSlingRubber_A.visible=1
  271. PlaySound SoundFX("Stern_LeftSlingshot",DOFContactors)
  272. vpmTimer.PulseSw 26
  273. LSlingStep = 0
  274. Me.TimerEnabled = 1
  275. End Sub
  276.  
  277. Sub LeftSlingShot_Timer
  278. Select Case LSlingStep
  279. Case 2:LeftSlingRubber_A.visible = 0:LeftSlingRubber_B.visible = 1
  280. Case 3:LeftSlingRubber_B.visible = 0:LeftSlingRubber_C.visible = 1
  281. Case 4:LeftSlingRubber_C.visible = 0:LeftSlingRubber_B.visible = 1
  282. Case 5:LeftSlingRubber_B.visible = 0:LeftSlingRubber_A.visible = 1
  283. Case 6:LeftSlingRubber_A.visible = 0:LeftSlingRubber.visible = 1:Me.TimerEnabled = 0
  284. End Select
  285. LSlingStep = LSlingStep + 1
  286. End Sub
  287.  
  288. Dim RSlingStep
  289. Sub RightSlingShot_Slingshot
  290. RightSlingRubber.visible=0
  291. RightSlingRubber_A.visible=1
  292. PlaySound SoundFX("Stern_RightSlingshot",DOFContactors)
  293. vpmTimer.PulseSw 27
  294. RSlingStep = 0
  295. Me.TimerEnabled = 1
  296. End Sub
  297.  
  298. Sub RightSlingShot_Timer
  299. Select Case RSlingStep
  300. Case 2:RightSlingRubber_A.visible = 0:RightSlingRubber_B.visible = 1
  301. Case 3:RightSlingRubber_B.visible = 0:RightSlingRubber_C.visible = 1
  302. Case 4:RightSlingRubber_C.visible = 0:RightSlingRubber_B.visible = 1
  303. Case 5:RightSlingRubber_B.visible = 0:RightSlingRubber_A.visible = 1
  304. Case 6:RightSlingRubber_A.visible = 0:RightSlingRubber.visible = 1:Me.TimerEnabled = 0
  305. End Select
  306. RSlingStep = RSlingStep + 1
  307. End Sub
  308.  
  309. '*********************************************************************
  310. '* DROP TARGETS ******************************************************
  311. '*********************************************************************
  312.  
  313. Sub Dropbankreset (enabled)
  314. If enabled then
  315. Playsound SoundFX("Stern_Targetreset",DOFContactors)
  316. sw9Dir = 1
  317. SW9.TimerEnabled = 1
  318. sw10Dir = 1
  319. SW10.TimerEnabled = 1
  320. sw11Dir = 1
  321. SW11.TimerEnabled = 1
  322. Dropbank.DropSol_On
  323. End If
  324. End Sub
  325.  
  326. Sub sw9_Hit:Dropbank.Hit 1:sw9Dir = 0:SW9.TimerEnabled = 1:End Sub
  327. Sub sw10_Hit:Dropbank.Hit 2:sw10Dir = 0:SW10.TimerEnabled = 1:End Sub
  328. Sub sw11_Hit:Dropbank.Hit 3:sw11Dir = 0:SW11.TimerEnabled = 1:End Sub
  329.  
  330. '* WILL TARGET *******************************************
  331.  
  332. Sub sw9_Timer()
  333. Select Case sw9Pos
  334. Case 0: sw9P.z=0
  335. If sw9Dir = 1 then
  336. sw9.TimerEnabled = 0
  337. Else
  338. End if        
  339. Case 1: sw9P.z=0
  340. Case 2: sw9P.z=0
  341. Case 2: sw9P.z=-20
  342. Case 3: sw9P.z=-40
  343. Case 4: sw9P.z=-50
  344. Case 5: sw9P.z=-55
  345. If sw9Dir = 1 then
  346. Else
  347. sw9.TimerEnabled = 0
  348. End if
  349. End Select
  350. If sw9Dir = 1 then
  351. If sw9pos>0 then sw9pos=sw9pos-1
  352. Else
  353. If sw9pos<5 then sw9pos=sw9pos+1
  354. End if
  355. End Sub
  356.  
  357. '* YOU TARGET *******************************************
  358.  
  359. Sub sw10_Timer()   
  360. Select Case sw10Pos
  361. Case 0: sw10P.z=0
  362. If sw10Dir = 1 then
  363. sw10.TimerEnabled = 0
  364. Else
  365. End if        
  366. Case 1: sw10P.z=0
  367. Case 2: sw10P.z=0
  368. Case 2: sw10P.z=-20
  369. Case 3: sw10P.z=-40
  370. Case 4: sw10P.z=-50
  371. Case 5: sw10P.z=-55
  372. If sw10Dir = 1 then
  373. Else
  374. sw10.TimerEnabled = 0
  375. End if
  376. End Select
  377. If sw10Dir = 1 then
  378. If sw10pos>0 then sw10pos=sw10pos-1
  379. Else
  380. If sw10pos<5 then sw10pos=sw10pos+1
  381. End if
  382. End Sub
  383.  
  384. '* SURVIVE TARGET *******************************************
  385.  
  386. Sub sw11_Timer()   
  387. Select Case sw11Pos
  388. Case 0: sw11P.z=0
  389. If sw11Dir = 1 then
  390. sw11.TimerEnabled = 0
  391. Else
  392. End if        
  393. Case 1: sw11P.z=0
  394. Case 2: sw11P.z=0
  395. Case 2: sw11P.z=-20
  396. Case 3: sw11P.z=-40
  397. Case 4: sw11P.z=-50
  398. Case 5: sw11P.z=-55
  399. If sw11Dir = 1 then
  400. Else
  401. sw11.TimerEnabled = 0
  402. End if
  403. End Select
  404. If sw11Dir = 1 then
  405. If sw11pos>0 then sw11pos=sw11pos-1
  406. Else
  407. If sw11pos<5 then sw11pos=sw11pos+1
  408. End if
  409. End Sub
  410.  
  411. '*********************************************************************
  412. '* SOLENOIDS *********************************************************
  413. '*********************************************************************
  414.  
  415. SolCallback(1) = "solTrough"
  416. SolCallback(2) = "solAutofire"
  417. SolCallback(3) = "PrisonDoorsPower"
  418. SolCallback(4) = "PrisonDoorsHold"
  419. SolCallback(7) = "SolPrisonMagnet"
  420. SolCallback(8) = "SolShaker"
  421. 'SolCallback(9) = "SolLeftPop" 'left pop bumper
  422. 'SolCallback(10) = "SolRightPop" 'right pop bumper
  423. 'SolCallback(11) = "SolTopPop" 'top pop bumper
  424. SolCallback(12) = "Dropbankreset"
  425.  
  426. 'SolCallback(15) = "SolLFlipper"
  427. 'SolCallback(16) = "SolRFlipper"
  428. SolCallback(17) = "setlamp 117,"
  429. SolCallback(18) = "setlamp 118,"
  430. SolCallback(19) = "setlamp 119,"
  431. 'SolCallback(21) = "HordeFlash" 'horde flasher
  432. SolCallback(22) = "setlamp 122,"
  433. SolCallback(23) = "setlamp 123,"
  434. 'SolCallback(24) = "vpmSolSound SoundFX(""knocker""),"
  435. SolCallback(25) = "setlamp 125,"
  436. SolCallback(26) = "setlamp 126,"
  437. SolCallback(27) = "setlamp 127,"
  438. SolCallback(28) = "setlamp 128,"
  439. SolCallback(29) = "setlamp 129,"
  440. 'SolCallback(32) = "CenterLane" 'center lane flasher
  441.  
  442. Sub solTrough(Enabled)
  443.     If Enabled Then
  444.         bsTrough.ExitSol_On
  445.         vpmTimer.PulseSw 22
  446.     End If
  447.  End Sub
  448.  
  449. Sub solAutofire(Enabled)
  450.     If Enabled Then
  451.         PlungerIM.AutoFire
  452.     End If
  453.  End Sub
  454.  
  455. Sub SolShaker(Enabled)
  456.     If enabled Then
  457.     PlaySound SoundFX("Stern_Shaker",DOFShaker)
  458.     End If
  459. End Sub
  460.  
  461. '*********************************************************************
  462. '*********************************************************************
  463. '* SWITCHES **********************************************************
  464. '*********************************************************************
  465. '*********************************************************************
  466.  
  467. '*********************************************************************
  468. '* ROLLOVER SWITCHES *************************************************
  469. '*********************************************************************
  470.  
  471. Sub SW12_Hit:Controller.Switch(12) = 1:PlaySound "":End Sub
  472. Sub SW12_UnHit:Controller.Switch(12) = 0:End Sub
  473.  
  474. Sub SW13_Hit:Controller.Switch(13) = 1:PlaySound "":End Sub
  475. Sub SW13_UnHit:Controller.Switch(13) = 0:End Sub
  476.  
  477. Sub SW23_Hit:Controller.Switch(23) = 1:PlaySound "":End Sub
  478. Sub SW23_UnHit:Controller.Switch(23) = 0:End Sub
  479.  
  480. Sub SW24_Hit:Controller.Switch(24) = 1:PlaySound "":End Sub
  481. Sub SW24_UnHit:Controller.Switch(24) = 0:End Sub
  482.  
  483. Sub SW25_Hit:Controller.Switch(25) = 1:PlaySound "":End Sub
  484. Sub SW25_UnHit:Controller.Switch(25) = 0:End Sub
  485.  
  486. Sub SW28_Hit:Controller.Switch(28) = 1:PlaySound "":End Sub
  487. Sub SW28_UnHit:Controller.Switch(28) = 0:End Sub
  488.  
  489. Sub SW29_Hit:Controller.Switch(29) = 1:PlaySound "":End Sub
  490. Sub SW29_UnHit:Controller.Switch(29) = 0:End Sub
  491.  
  492. Sub SW33_Hit:Controller.Switch(33) = 1:PlaySound "":End Sub
  493. Sub SW33_UnHit:Controller.Switch(33) = 0:End Sub
  494.  
  495. Sub SW36_Hit:Controller.Switch(36) = 1:PlaySound "":End Sub
  496. Sub SW36_UnHit:Controller.Switch(36) = 0:End Sub
  497.  
  498. Sub SW37_Hit:Controller.Switch(37) = 1:PlaySound "":End Sub
  499. Sub SW37_UnHit:Controller.Switch(37) = 0:End Sub
  500.  
  501. Sub SW39_Hit:Controller.Switch(39) = 1:PlaySound "":End Sub
  502. Sub SW39_UnHit:Controller.Switch(39) = 0:End Sub
  503.  
  504. Sub SW41_Hit:Controller.Switch(41) = 1:PlaySound "":End Sub
  505. Sub SW41_UnHit:Controller.Switch(41) = 0:End Sub
  506.  
  507. Sub SW47_Hit:Controller.Switch(47) = 1:PlaySound "":End Sub
  508. Sub SW47_UnHit:Controller.Switch(47) = 0:End Sub
  509.  
  510. '* PRISON OPTO *********************************************
  511.  
  512. Sub SW46_Hit:Controller.Switch(46) = 1:PlaySound "":End Sub
  513. Sub SW46_UnHit:Controller.Switch(46) = 0:End Sub
  514.  
  515. '*********************************************************************
  516. '* TARGET SWITCHES ***************************************************
  517. '*********************************************************************
  518.  
  519. Sub SW3_Hit:vpmTimer.PulseSw 3:SW3P.X=457.8755:SW3P.Y=511.375:Me.TimerEnabled = 1:PlaySound SoundFX("Stern_Posthit",DOFContactors):End Sub
  520. Sub SW3_Timer:SW3P.X=457.875:SW3P.Y=515.875:Me.TimerEnabled = 0:End Sub
  521.  
  522. Sub SW4_Hit:vpmTimer.PulseSw 4:PlaySound SoundFX("Stern_PrisonDoorHit",DOFContactors):End Sub
  523.  
  524. Sub SW38_Hit:vpmTimer.PulseSw 38:SW38P.X=860.6875:SW38P.Y=333.9375:Me.TimerEnabled = 1:PlaySound SoundFX("Stern_Posthit",DOFContactors):End Sub
  525. Sub SW38_Timer:SW38P.X=853.6875:SW38P.Y=334.1875:Me.TimerEnabled = 0:End Sub
  526.  
  527. Sub SW44_Hit:vpmTimer.PulseSw 44:SW44P.X=372.4375:SW44P.Y=674.5625:Me.TimerEnabled = 1:PlaySound SoundFX("Stern_Posthit",DOFContactors):End Sub
  528. Sub SW44_Timer:SW44P.X=372.4375:SW44P.Y=679.0625:Me.TimerEnabled = 0:End Sub
  529.  
  530. Sub SW45_Hit:vpmTimer.PulseSw 45:SW45P.X=549.9375:SW45P.Y=673.8125:Me.TimerEnabled = 1:PlaySound SoundFX("Stern_Posthit",DOFContactors):End Sub
  531. Sub SW45_Timer:SW45P.X=549.9375:SW45P.Y=678.5625:Me.TimerEnabled = 0:End Sub
  532.  
  533. '*********************************************************************
  534. '* RAMP SWITCHES *****************************************************
  535. '*********************************************************************
  536.  
  537. Sub SW42_Hit:Controller.Switch(42) = 1:PlaySound "":End Sub
  538. Sub SW42_UnHit:Controller.Switch(42) = 0:End Sub
  539.  
  540. Sub SW43_Hit:Controller.Switch(43) = 1:PlaySound "":End Sub
  541. Sub SW43_UnHit:Controller.Switch(43) = 0:End Sub
  542.  
  543. Sub SW34_Hit:Controller.Switch(34) = 1:PlaySound "":End Sub
  544. Sub SW34_UnHit:Controller.Switch(34) = 0:End Sub
  545.  
  546. Sub SW35_Hit:Controller.Switch(35) = 1:PlaySound "":End Sub
  547. Sub SW35_UnHit:Controller.Switch(35) = 0:End Sub
  548.  
  549. '*********************************************************************
  550. '* WELL WALKER MOVEMENT **********************************************
  551. '*********************************************************************
  552.  
  553. WWSWHIT=0
  554.  
  555. Sub WWSW_Init:Controller.Switch (2) = 1:End Sub
  556.  
  557. Sub WWSW_Hit()
  558. Ballspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  559. If Ballspeed >5 then Playsound "Stern_Walkerhit":WWHit 1:WWSWHIT=1:Controller.Switch (2) = 0
  560. If Ballspeed <5 then Playsound "Stern_Metalhit":WWLowHit 1
  561. End Sub
  562.  
  563. Dim WWPos,WWLowpos
  564.  
  565. Sub WWHit (enabled)
  566. if enabled then
  567. WWTimer.Enabled=1
  568. End If
  569. End Sub
  570.  
  571. Sub WWLowHit (enabled)
  572. if enabled then
  573. WWLowTimer.Enabled=1
  574. End If
  575. End Sub
  576.  
  577. Sub WWTimer_Timer()
  578. Select Case WWPos
  579. Case 0: WellWalker.RotX=92
  580. Case 1: WellWalker.RotX=94
  581. Case 2: WellWalker.RotX=96
  582. Case 3: WellWalker.RotX=98
  583. Case 4: WellWalker.RotX=100
  584. Case 5: WellWalker.RotX=102
  585. Case 6: WellWalker.RotX=104
  586. Case 7: WellWalker.RotX=106
  587. Case 8: WellWalker.RotX=108
  588. Case 9: WellWalker.RotX=110
  589. Case 10: WellWalker.RotX=112
  590. Case 11: WellWalker.RotX=114
  591. Case 12: WellWalker.RotX=116
  592. Case 13: WellWalker.RotX=118
  593. Case 14: WellWalker.RotX=120
  594. Case 15: WellWalker.RotX=120
  595. Case 16: WellWalker.RotX=118
  596. Case 17: WellWalker.RotX=116
  597. Case 18: WellWalker.RotX=114
  598. Case 19: WellWalker.RotX=112
  599. Case 20: WellWalker.RotX=110
  600. Case 21: WellWalker.RotX=108
  601. Case 22: WellWalker.RotX=106
  602. Case 23: WellWalker.RotX=104
  603. Case 24: WellWalker.RotX=102
  604. Case 25: WellWalker.RotX=100
  605. Case 26: WellWalker.RotX=98
  606. Case 27: WellWalker.RotX=96
  607. Case 28: WellWalker.RotX=94
  608. Case 29: WellWalker.RotX=92
  609. Case 30: WellWalker.RotX=90
  610. Case 31: WellWalker.RotX=92
  611. Case 32: WellWalker.RotX=94
  612. Case 33: WellWalker.RotX=96
  613. Case 34: WellWalker.RotX=94
  614. Case 35: WellWalker.RotX=92
  615. Case 36: WellWalker.RotX=90
  616. Case 37: WellWalker.RotX=90:WWTimer.Enabled=0:WWPos=0:WWSWHIT=0:Controller.Switch (2) = 1
  617. End Select
  618.  
  619. If WWPos=>0 then WWPos=WWPos+1
  620. End Sub
  621.  
  622. Sub WWLowTimer_Timer() 
  623. Select Case WWLowpos
  624. Case 0: WellWalker.RotX=91
  625. Case 1: WellWalker.RotX=92
  626. Case 2: WellWalker.RotX=93
  627. Case 3: WellWalker.RotX=92
  628. Case 4: WellWalker.RotX=91
  629. Case 5: WellWalker.RotX=90:WWLowTimer.Enabled=0:WWLowpos=0
  630. End Select
  631.  
  632. If WWLowpos=>0 then WWLowpos=WWLowpos+1
  633. End Sub
  634.  
  635. '*********************************************************************
  636. '* PRISON MOVEMENT ***************************************************
  637. '*********************************************************************
  638. Dim PRISPos, PrisOpen
  639.  
  640. Sub PrisonDoorsPower(Enabled)
  641. If Enabled Then
  642. PRISONTIMER.Enabled=1
  643. PlaySound SoundFX("Stern_PrisonDoorOpen",DOFContactors)
  644. End If
  645. End Sub
  646.  
  647. Sub PRISONTIMER_Timer()
  648. Select Case PRISPos
  649. Case 0: PD_LEFT.RotY=5:PD_RIGHT.RotY=-5
  650. Case 1: PD_LEFT.RotY=10:PD_RIGHT.RotY=-10
  651. Case 2: PD_LEFT.RotY=15:PD_RIGHT.RotY=-15
  652. Case 3: PD_LEFT.RotY=20:PD_RIGHT.RotY=-20
  653. Case 4: PD_LEFT.RotY=25:PD_RIGHT.RotY=-25
  654. Case 5: PD_LEFT.RotY=30:PD_RIGHT.RotY=-30
  655. Case 6: PD_LEFT.RotY=35:PD_RIGHT.RotY=-35
  656. Case 7: PD_LEFT.RotY=40:PD_RIGHT.RotY=-40
  657. Case 8: PD_LEFT.RotY=45:PD_RIGHT.RotY=-45
  658. Case 9: PD_LEFT.RotY=50:PD_RIGHT.RotY=-50
  659. Case 10: PD_LEFT.RotY=55:PD_RIGHT.RotY=-55
  660. Case 11: PD_LEFT.RotY=60:PD_RIGHT.RotY=-60
  661. Case 12: PD_LEFT.RotY=65:PD_RIGHT.RotY=-65
  662. Case 13: PD_LEFT.RotY=70:PD_RIGHT.RotY=-70
  663. Case 14: PD_LEFT.RotY=75:PD_RIGHT.RotY=-75
  664. Case 15: PD_LEFT.RotY=80:PD_RIGHT.RotY=-80
  665. Case 16: PD_LEFT.RotY=85:PD_RIGHT.RotY=-85
  666. Case 17: PD_LEFT.RotY=90:PD_RIGHT.RotY=-90
  667. Case 18: PD_LEFT.RotY=95:PD_RIGHT.RotY=-95
  668. Case 19: PD_LEFT.RotY=100:PD_RIGHT.RotY=-95
  669. Case 20: PD_LEFT.RotY=102:PD_RIGHT.RotY=-95
  670. Case 21: PD_LEFT.RotY=102:PD_RIGHT.RotY=-95:PRISONTIMER.Enabled=0:PRISPos=0:Prisopen=1:SW4.isdropped=1:LDCOL.isdropped=0:RDCOL.isdropped=0
  671. End Select
  672.  
  673. If PRISPos=>0 then PRISPos=PRISPos+1
  674. End Sub
  675.  
  676. Dim PRIS2Pos, PrisClose
  677.  
  678. Sub PrisonDoorsHold(Enabled)
  679. If Enabled Then
  680. PRISONTIMER.Enabled=1
  681. Else
  682. PRISONTIMER2.Enabled=1
  683. PlaySound SoundFX("Stern_PrisonDoorOpen",DOFContactors)
  684. End If
  685. End Sub
  686.  
  687. Sub PRISONTIMER2_Timer()   
  688. Select Case PRIS2Pos
  689. Case 0: PD_LEFT.RotY=100:PD_RIGHT.RotY=-90
  690. Case 1: PD_LEFT.RotY=95:PD_RIGHT.RotY=-85
  691. Case 2: PD_LEFT.RotY=90:PD_RIGHT.RotY=-80
  692. Case 3: PD_LEFT.RotY=85:PD_RIGHT.RotY=-75
  693. Case 4: PD_LEFT.RotY=80:PD_RIGHT.RotY=-70
  694. Case 5: PD_LEFT.RotY=75:PD_RIGHT.RotY=-65
  695. Case 6: PD_LEFT.RotY=70:PD_RIGHT.RotY=-60
  696. Case 7: PD_LEFT.RotY=65:PD_RIGHT.RotY=-55
  697. Case 8: PD_LEFT.RotY=60:PD_RIGHT.RotY=-50
  698. Case 9: PD_LEFT.RotY=55:PD_RIGHT.RotY=-45
  699. Case 10: PD_LEFT.RotY=50:PD_RIGHT.RotY=-40
  700. Case 11: PD_LEFT.RotY=45:PD_RIGHT.RotY=-35
  701. Case 12: PD_LEFT.RotY=40:PD_RIGHT.RotY=-30
  702. Case 13: PD_LEFT.RotY=35:PD_RIGHT.RotY=-25
  703. Case 14: PD_LEFT.RotY=30:PD_RIGHT.RotY=-20
  704. Case 15: PD_LEFT.RotY=25:PD_RIGHT.RotY=-15
  705. Case 16: PD_LEFT.RotY=20:PD_RIGHT.RotY=-10
  706. Case 17: PD_LEFT.RotY=15:PD_RIGHT.RotY=-5
  707. Case 18: PD_LEFT.RotY=10:PD_RIGHT.RotY=-0
  708. Case 19: PD_LEFT.RotY=5:PD_RIGHT.RotY=-0
  709. Case 20: PD_LEFT.RotY=0:PD_RIGHT.RotY=-0
  710. Case 21: PD_LEFT.RotY=0:PD_RIGHT.RotY=-0:PRISONTIMER2.Enabled=0:PRIS2Pos=0:Prisclose=1:SW4.isdropped=0:LDCOL.isdropped=1:RDCOL.isdropped=1
  711. End Select
  712.  
  713. If PRIS2Pos=>0 then PRIS2Pos=PRIS2Pos+1
  714. End Sub
  715.  
  716. '*********************************************************************
  717. '* PRISON MAGNET *****************************************************
  718. '*********************************************************************
  719.  
  720. Sub SolPrisonMagnet(enabled)
  721.     If enabled Then
  722.         PrisonMagnet.MagnetOn = True
  723.     Else
  724.         ReleasePMagnet
  725.     End If
  726. End Sub
  727.  
  728. Sub ReleasePMagnet
  729.     Dim dir, speed, ball
  730.     For Each ball In PrisonMagnet.Balls
  731.         With ball
  732.             dir = Rnd * 6.28
  733.             speed = 5 + Rnd * 5
  734.             .VelX = speed * Sin(dir)
  735.             .VelY = speed * Cos(dir)
  736.         End With
  737.     Next
  738.     PrisonMagnet.MagnetOn = False
  739. End Sub
  740.  
  741. '*********************************************************************
  742. '* UPDATE GI ILLUMINATION ********************************************
  743. '*********************************************************************
  744.  
  745. Sub UpdateGI(no, step)
  746. Dim gistep, ii, a
  747. gistep = step / 8
  748. Select Case no
  749. Case 0
  750. For each ii in GI
  751. ii.IntensityScale = gistep
  752. Next
  753. Case 1
  754. For each ii in GI
  755. ii.IntensityScale = gistep
  756. Next
  757. Case 2
  758. For each ii in GI
  759. ii.IntensityScale = gistep
  760. Next
  761. End Select
  762. End Sub
  763.  
  764. '*********************************************************************
  765. '* JP FADING LIGHT SYSTEM ********************************************
  766. '*********************************************************************
  767.  
  768. Dim LampState(200), FadingLevel(200)
  769. Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
  770.  
  771. InitLamps()             ' turn off the lights and flashers and reset them to the default parameters
  772. LampTimer.Interval = 10 'lamp fading speed
  773. LampTimer.Enabled = 1
  774.  
  775. ' Lamp & Flasher Timers
  776.  
  777. Sub LampTimer_Timer()
  778. Dim chgLamp, num, chg, ii
  779. chgLamp = Controller.ChangedLamps
  780. If Not IsEmpty(chgLamp) Then
  781. For ii = 0 To UBound(chgLamp)
  782. LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1)       'keep the real state in an array
  783. FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
  784. Next
  785. End If
  786. UpdateLamps
  787. End Sub
  788.  
  789. '*********************************************************************
  790. '* INSERT LIGHTS *****************************************************
  791. '*********************************************************************
  792.  
  793. Sub UpdateLamps
  794.  
  795. NFadeL 3, l3
  796. NFadeL 4, l4
  797. NFadeL 5, l5
  798. NFadeL 6, l6
  799. NFadeL 7, l7
  800. NFadeL 8, l8
  801. NFadeL 9, l9
  802. NFadeL 10, l10
  803. NFadeL 11, l11
  804. NFadeL 12, l12
  805. NFadeL 13, l13
  806. NFadeL 14, l14
  807. NFadeL 15, l15
  808. NFadeL 16, l16
  809. NFadeL 17, l17
  810. NFadeL 18, l18
  811. NFadeL 19, l19
  812. NFadeL 20, l20
  813. NFadeL 21, l21
  814. NFadeL 22, l22
  815. NFadeL 23, l23
  816. NFadeL 24, l24
  817. NFadeL 25, l25
  818. NFadeL 26, l26
  819. NFadeL 27, l27
  820. NFadeL 28, l28
  821. NFadeL 29, l29
  822. NFadeL 30, l30
  823. NFadeL 31, l31
  824. NFadeL 32, l32
  825. NFadeL 33, l33
  826. NFadeL 34, l34
  827. NFadeL 35, l35
  828. NFadeL 36, l36
  829. NFadeL 37, l37
  830. NFadeL 38, l38
  831. NFadeL 39, l39
  832. NFadeLma 40, l40a
  833. 'NFadeLmb 40, l40b
  834. 'NFadeLmc 40, l40c
  835. NFadeLm 40, l40
  836. NFadeL 41, l41
  837. NFadeL 42, l42
  838. NFadeL 43, l43
  839. NFadeL 44, l44
  840. NFadeL 45, l45
  841. NFadeL 46, l46
  842. NFadeL 47, l47
  843. NFadeL 48, l48
  844. NFadeL 49, l49
  845. NFadeL 50, l50
  846. NFadeL 51, l51
  847. NFadeL 52, l52
  848. NFadeL 53, l53
  849. NFadeL 54, l54
  850. NFadeL 55, l55
  851. NFadeL 56, l56
  852. NFadeL 57, l57
  853. NFadeL 58, l58
  854. NFadeL 59, l59
  855. NFadeLm 60, l60b
  856. NFadeLmm 60, l60b
  857. NFadeL 60, l60
  858. NFadeLm 61, l61b
  859. NFadeLmm 61, l61b
  860. NFadeL 61, l61
  861. NFadeLm 62, l62b
  862. NFadeLmm 62, l62b
  863. NFadeL 62, l62
  864. NFadeL 63, l63
  865. NFadeL 64, l64
  866. NFadeL 65, l65
  867. NFadeL 66, l66
  868. NFadeL 67, l67
  869. NFadeL 68, l68
  870. NFadeL 69, l69
  871. NFadeLma 70, l70a
  872. NFadeLma 71, l71a
  873. NFadeLma 117, l73a
  874. NFadeLmb 117, l73b
  875. NFadeL 117, l73
  876. NFadeLma 118, l74a
  877. NFadeLmb 118, l74b
  878. NFadeL 118, l74
  879. NFadeLma 122, l75a
  880. NFadeLmb 122, l75b
  881. NFadeL 122, l75
  882. NFadeL 72, l72
  883. NFadeL 76, l76
  884. NFadeL 77, l77
  885. NFadeLma 78, l78a
  886. NFadeL 79, l79
  887. NFadeL 80, l80
  888.  
  889.  
  890.  
  891. '*********************************************************************
  892. '* FLASHER ***********************************************************
  893. '*********************************************************************
  894.  
  895. NFadeLm 119, F19
  896. NFadeL 119, F19b
  897. NFadeL 123, f23
  898. NFadeLm 125, F25b
  899. NFadeL 125, F25
  900. NFadeLm 126, F26
  901. NFadeLmm 126, F26b
  902. NFadeLma 126, f26c
  903. NFadeLmm 127, F27
  904. NFadeLm 127, F27b
  905. NFadeLm 128, F28
  906. NFadeLmc 128, F28c
  907. NFadeLm 129, F29
  908. 'NFadeLm 118, F18
  909. 'NFadeLm 119, F19
  910. 'NFadeL 120, f20
  911. 'NFadeLm 121, F21a
  912. 'NFadeL 121, F21
  913. 'NFadeLm 123, f23
  914. 'NFadeLm 125, F25
  915. 'NFadeLm 126, F26
  916. 'NFadeLm 127, F27
  917. 'NFadeL 128, f28
  918. 'NFadeLm 130, f30b
  919. 'NFadeL 130, f30a
  920.  
  921. '*********************************************************************
  922. '* OBJECT LIGHTS *****************************************************
  923. '*********************************************************************
  924.  
  925. FadeObj 70, XBOW, "2_OBJ_Crossbow-Fishtank_3", "2_OBJ_Crossbow-Fishtank_2", "2_OBJ_Crossbow-Fishtank_1", "2_OBJ_Crossbow-Fishtank"
  926. FadeObj 71, FISHTANK, "2_OBJ_Crossbow-Fishtank_3", "2_OBJ_Crossbow-Fishtank_2", "2_OBJ_Crossbow-Fishtank_1", "2_OBJ_Crossbow-Fishtank"
  927. FadeObj 78, L78p, "2_BicycleGirl_3", "2_BicycleGirl_2", "2_BicycleGirl_1", "2_BicycleGirl"
  928. FadeObj 40, MOD_Woodbury, "mods3", "mods2", "mods1", "mods"
  929. FadeObj 126, MOD_Hitchhiker, "mods3", "mods2", "mods1", "mods"
  930. FadeObj 127, F27P, "2_OBJ_Prison_3", "2_OBJ_Prison_2", "2_OBJ_Prison_1", "2_OBJ_Prison"
  931. FadeObjm 128, F28P, "FlasherRed_3", "FlasherRed_2", "FlasherRed_1", "FlasherRed"
  932. FadeObj 128, MOD_ExpressMart, "mods3", "mods2", "mods1", "mods"
  933. FadeObj 129, F29P, "FlasherRed_3", "FlasherRed_2", "FlasherRed_1", "FlasherRed"
  934. 'FadeObj 118, F18P, "Saucer_3", "Saucer_2", "Saucer_1", "Saucer"
  935. 'FadeObj 119, F19P, "Saucer_3", "Saucer_2", "Saucer_1", "Saucer"
  936. 'FadeObj 125, F25P, "Saucer_3", "Saucer_2", "Saucer_1", "Saucer"
  937. 'FadeObj 126, F26P, "Saucer_3", "Saucer_2", "Saucer_1", "Saucer"
  938. 'FadeObj 127, F27P, "Saucer_3", "Saucer_2", "Saucer_1", "Saucer"
  939.  
  940. End Sub
  941.  
  942. '*********************************************************************
  943. '* LAMP SUBS *********************************************************
  944. '*********************************************************************
  945.  
  946. Sub InitLamps()
  947. Dim x
  948. For x = 0 to 200
  949. LampState(x) = 0         ' current light state, independent of the fading level. 0 is off and 1 is on
  950. FadingLevel(x) = 4       ' used to track the fading state
  951. FlashSpeedUp(x) = 0.2    ' faster speed when turning on the flasher
  952. FlashSpeedDown(x) = 0.1  ' slower speed when turning off the flasher
  953. FlashMax(x) = 1          ' the maximum value when on, usually 1
  954. FlashMin(x) = 0          ' the minimum value when off, usually 0
  955. FlashLevel(x) = 0        ' the intensity of the flashers, usually from 0 to 1
  956. Next
  957. End Sub
  958.  
  959. Sub AllLampsOff
  960. Dim x
  961. For x = 0 to 200
  962. SetLamp x, 0
  963. Next
  964. End Sub
  965.  
  966. Sub SetLamp(nr, value)
  967. If value <> LampState(nr) Then
  968. LampState(nr) = abs(value)
  969. FadingLevel(nr) = abs(value) + 4
  970. End If
  971. End Sub
  972.  
  973. '*********************************************************************
  974. '* VPX STANDARD LIGHTS ***********************************************
  975. '*********************************************************************
  976.  
  977. Sub NFadeL(nr, object)
  978. Select Case FadingLevel(nr)
  979. Case 4:object.state = 0:FadingLevel(nr) = 0
  980. Case 5:object.state = 1:FadingLevel(nr) = 1
  981. End Select
  982. End Sub
  983.  
  984. Sub NFadeLm(nr, object) ' used for multiple lights
  985. Select Case FadingLevel(nr)
  986. Case 4:object.state = 0
  987. Case 5:object.state = 1
  988. End Select
  989. End Sub
  990.  
  991. Sub NFadeLmm(nr, object) ' used for multiple lights
  992. Select Case FadingLevel(nr)
  993. Case 4:object.state = 0
  994. Case 5:object.state = 1
  995. End Select
  996. End Sub
  997.  
  998. Sub NFadeLma(nr, object) ' used for multiple lights
  999. Select Case FadingLevel(nr)
  1000. Case 4:object.state = 0
  1001. Case 5:object.state = 1
  1002. End Select
  1003. End Sub
  1004.  
  1005. Sub NFadeLmb(nr, object) ' used for multiple lights
  1006. Select Case FadingLevel(nr)
  1007. Case 4:object.state = 0
  1008. Case 5:object.state = 1
  1009. End Select
  1010. End Sub
  1011.  
  1012. Sub NFadeLmc(nr, object) ' used for multiple lights
  1013. Select Case FadingLevel(nr)
  1014. Case 4:object.state = 0
  1015. Case 5:object.state = 1
  1016. End Select
  1017. End Sub
  1018.  
  1019. '*********************************************************************
  1020. '* VPX RAMP & PRIMITIVE LIGHTS ***************************************
  1021. '*********************************************************************
  1022.  
  1023. Sub FadeObj(nr, object, a, b, c, d)
  1024. Select Case FadingLevel(nr)
  1025. Case 4:object.image = b:FadingLevel(nr) = 6                   'fading to off...
  1026. Case 5:object.image = a:FadingLevel(nr) = 1                   'ON
  1027. Case 6, 7, 8:FadingLevel(nr) = FadingLevel(nr) + 1            'wait
  1028. Case 9:object.image = c:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
  1029. Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1         'wait
  1030. Case 13:object.image = d:FadingLevel(nr) = 0                  'Off
  1031. End Select
  1032. End Sub
  1033.  
  1034. Sub FadeObjm(nr, object, a, b, c, d)
  1035. Select Case FadingLevel(nr)
  1036. Case 4:object.image = b
  1037. Case 5:object.image = a
  1038. Case 9:object.image = c
  1039. Case 13:object.image = d
  1040. End Select
  1041. End Sub
  1042.  
  1043. Sub NFadeObj(nr, object, a, b)
  1044. Select Case FadingLevel(nr)
  1045. Case 4:object.image = b:FadingLevel(nr) = 0 'off
  1046. Case 5:object.image = a:FadingLevel(nr) = 1 'on
  1047. End Select
  1048. End Sub
  1049.  
  1050. Sub NFadeObjm(nr, object, a, b)
  1051. Select Case FadingLevel(nr)
  1052. Case 4:object.image = b
  1053. Case 5:object.image = a
  1054. End Select
  1055. End Sub
  1056.  
  1057. '*********************************************************************
  1058. '* VPX FLASHER OBJECTS ***********************************************
  1059. '*********************************************************************
  1060.  
  1061. Sub SetFlash(nr, stat)
  1062. FadingLevel(nr) = ABS(stat)
  1063. End Sub
  1064.  
  1065. Sub Flash(nr, object)
  1066. Select Case FadingLevel(nr)
  1067. Case 4 'off
  1068. FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
  1069. If FlashLevel(nr) < FlashMin(nr) Then
  1070. FlashLevel(nr) = FlashMin(nr)
  1071. FadingLevel(nr) = 0 'completely off
  1072. End if
  1073. Object.IntensityScale = FlashLevel(nr)
  1074. Case 5 ' on
  1075. FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
  1076. If FlashLevel(nr) > FlashMax(nr) Then
  1077. FlashLevel(nr) = FlashMax(nr)
  1078. FadingLevel(nr) = 1 'completely on
  1079. End if
  1080. Object.IntensityScale = FlashLevel(nr)
  1081. End Select
  1082. End Sub
  1083.  
  1084. Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
  1085. Object.IntensityScale = FlashLevel(nr)
  1086. End Sub
  1087.  
  1088. '*********************************************************************
  1089. '* VPX REELS & TEXT  *************************************************
  1090. '*********************************************************************
  1091.  
  1092. Sub FadeR(nr, object)
  1093. Select Case FadingLevel(nr)
  1094. Case 4:object.SetValue 1:FadingLevel(nr) = 6                   'fading to off...
  1095. Case 5:object.SetValue 0:FadingLevel(nr) = 1                   'ON
  1096. Case 6, 7, 8:FadingLevel(nr) = FadingLevel(nr) + 1             'wait
  1097. Case 9:object.SetValue 2:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
  1098. Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1          'wait
  1099. Case 13:object.SetValue 3:FadingLevel(nr) = 0                  'Off
  1100. End Select
  1101. End Sub
  1102.  
  1103. Sub FadeRm(nr, object)
  1104. Select Case FadingLevel(nr)
  1105. Case 4:object.SetValue 1
  1106. Case 5:object.SetValue 0
  1107. Case 9:object.SetValue 2
  1108. Case 3:object.SetValue 3
  1109. End Select
  1110. End Sub
  1111.  
  1112. Sub NFadeT(nr, object, message)
  1113. Select Case FadingLevel(nr)
  1114. Case 4:object.Text = "":FadingLevel(nr) = 0
  1115. Case 5:object.Text = message:FadingLevel(nr) = 1
  1116. End Select
  1117. End Sub
  1118.  
  1119. Sub NFadeTm(nr, object, b)
  1120. Select Case FadingLevel(nr)
  1121. Case 4:object.Text = ""
  1122. Case 5:object.Text = message
  1123. End Select
  1124. End Sub
  1125.  
  1126. '*********************************************************************
  1127. '* FLIPPER MODEL SYNC ************************************************
  1128. '*********************************************************************
  1129.  
  1130. Sub RightFlipperTimer_Timer:RightFlipperP.Rotz = RightFlipper.CurrentAngle:RightFlipperRubberP.Rotz = RightFlipper.CurrentAngle:End Sub
  1131.  
  1132. Sub LeftFlipperTimer_Timer:LeftFlipperP.Rotz = LeftFlipper.CurrentAngle -180:LeftFlipperRubberP.Rotz = LeftFlipper.CurrentAngle -180:End Sub
  1133.  
  1134.  
  1135. Sub Rdrophit_hit()
  1136. vpmTimer.AddTimer 90, "RDrop.enabled = 1 '"
  1137. End sub
  1138.  
  1139.  
  1140. Sub RDrop_Hit()
  1141. ActiveBall.VelZ = -2
  1142. ActiveBall.VelY = 0
  1143. ActiveBall.VelX = 0
  1144. PlaySound "Stern_Balldrop1"
  1145. RDrop.enabled = 0
  1146. End Sub
  1147.  
  1148. '*********************************************************************
  1149. '* OBJECT SOUND EFFECTS **********************************************
  1150. '*********************************************************************
  1151.  
  1152. Sub Post1_Hit():Playsound "Stern_Posthit":End Sub
  1153. Sub Post2_Hit():Playsound "Stern_Posthit":End Sub
  1154. Sub Post3_Hit():Playsound "Stern_Posthit":End Sub
  1155. Sub Post4_Hit():Playsound "RubberHit":End Sub
  1156. Sub Post5_Hit():Playsound "RubberHit":End Sub
  1157.  
  1158. Sub RightSlingRubber_Collide(parm):
  1159. Ballspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1160. If Ballspeed >5 then Playsound "RubberHit" End If:End Sub
  1161.  
  1162. Sub LeftSlingRubber_Hit():Playsound "RubberHit":End Sub
  1163.  
  1164. Sub LeftFlipper_Collide(parm):
  1165. Ballspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1166. If Ballspeed >5 then Playsound "RubberHit2" Else Playsound "RubberHitLow":End If:End Sub
  1167.  
  1168. Sub RightFlipper_Collide(parm):
  1169. Ballspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1170. If Ballspeed >5 then Playsound "RubberHit2" Else Playsound "RubberHitLow":End If:End Sub
  1171.  
  1172. '*********************************************************************
  1173. '* BALL SOUND FUNCTIONS **********************************************
  1174. '*********************************************************************
  1175.  
  1176. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  1177. Vol = Csng(BallVel(ball) ^2 / 2000)
  1178. End Function
  1179.  
  1180. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "TWD" is the name of the table
  1181. Dim tmp
  1182. tmp = ball.x * 2 / TWD.width-1
  1183. If tmp > 0 Then
  1184. Pan = Csng(tmp ^10)
  1185. Else
  1186. Pan = Csng(-((- tmp) ^10) )
  1187. End If
  1188. End Function
  1189.  
  1190. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1191. Pitch = BallVel(ball) * 20
  1192. End Function
  1193.  
  1194. Function BallVel(ball) 'Calculates the ball speed
  1195. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  1196. End Function
  1197.  
  1198. '*********************************************************************
  1199. '* JP VPX ROLLING SOUNDS *********************************************
  1200. '*********************************************************************
  1201.  
  1202. Const tnob = 5 ' total number of balls in this table is 4, but always use a higher number here because of the timing
  1203. ReDim rolling(tnob)
  1204. InitRolling
  1205.  
  1206. Sub InitRolling
  1207. Dim i
  1208. For i = 0 to tnob
  1209. rolling(i) = False
  1210. Next
  1211. End Sub
  1212.  
  1213. Sub RollingUpdate()
  1214. Dim BOT, b
  1215. BOT = GetBalls
  1216. ' stop the sound of deleted balls
  1217. For b = UBound(BOT) + 1 to tnob
  1218. rolling(b) = False
  1219. StopSound("fx_ballrolling" & b)
  1220. Next
  1221.  
  1222. ' exit the sub if no balls on the table
  1223. If UBound(BOT) = -1 Then Exit Sub
  1224. ' play the rolling sound for each ball
  1225. ' in this table we ignore the captive ball, it´s the 0
  1226. For b = 0 to UBound(BOT)
  1227. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  1228. rolling(b) = True
  1229. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  1230. Else
  1231. If rolling(b) = True Then
  1232. StopSound("fx_ballrolling" & b)
  1233. rolling(b) = False
  1234. End If
  1235. End If
  1236. Next
  1237. End Sub
  1238.  
  1239. '*********************************************************************
  1240. '* BALL COLLISION SOUNDS *********************************************
  1241. '*********************************************************************
  1242.  
  1243. Sub OnBallBallCollision(ball1, ball2, velocity)
  1244. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
  1245. End Sub
  1246.  
  1247. '*********************************************************************
  1248. '* REALTIME UPDATES **************************************************
  1249. '*********************************************************************
  1250.  
  1251. Set MotorCallback = GetRef("RealTimeUpdates")
  1252.  
  1253. Sub RealTimeUpdates
  1254. RollingUpdate
  1255. End Sub
  1256.  
  1257. '*********************************************************************
  1258. '* MOD MENU **********************************************************
  1259. '*********************************************************************
  1260.  
  1261. '* REGISTERED LOCATIONS **********************************************
  1262.  
  1263.  Const optOpenAtStart   = 1
  1264.  Const optExpr      = 32
  1265.  Const optHitch     = 64
  1266.  Const optWood      = 128
  1267.  Const optBarn      = 256
  1268.  Const optRamp      = 512
  1269.  Const optFlip      = 1024
  1270.  Const optCard      = 2048
  1271.  Const optWell      = 4096
  1272.  Const optRubb      = 8192
  1273.  Const optFish      = 16384
  1274.  Const optTank      = 32768
  1275.  Const optBlade     = 65536
  1276.  Const optSanc      = 131072
  1277.  Const optTower     = 262144   
  1278.  
  1279. '* MENU INIT *********************************************************
  1280.  
  1281.  Dim TableOptions, TableOptions2, TableName
  1282.  Private vpmShowDips1, vpmDips1, vpmDips2
  1283.  
  1284.  Sub InitializeOptions
  1285.   TableName="TWDP_VPX"
  1286.   Set vpmShowDips1 = vpmShowDips
  1287.   Set vpmShowDips = GetRef("TableShowDips")
  1288.   TableOptions = LoadValue(TableName,"Options")
  1289.  
  1290.   If TableOptions = "" Or optReset Then
  1291.    TableOptions = DefaultOptions
  1292.    TableShowOptions
  1293.    ElseIf (TableOptions And optOpenAtStart) Then
  1294.    TableOptions = TableOptions - optOpenAtStart
  1295.    TableShowOptions
  1296.    Else
  1297.    TableSetOptions
  1298.    End If
  1299.  End Sub
  1300.  
  1301.  Private Sub TableShowDips
  1302.     TableShowOptions
  1303.  End Sub
  1304.  
  1305.  Private Sub TableShowOptions
  1306.   Dim oldOptions : oldOptions = TableOptions
  1307.   Set vpmDips1 = New cvpmDips
  1308.   With vpmDips1
  1309.  .AddForm 1000, 1000, "THE WALKING DEAD - PAULOS MEZEL-MODS MENU"
  1310.  .AddLabel 0,10,250,30,"Choose your Mods you want to install on the Table."
  1311.  .AddLabel 0,25,250,30,"Please restart the Table for changes to take effect!"
  1312.  .AddFrameExtra 0,50,155,"Express Mart Mod",optExpr, Array("Install", 0, "Disabled", 32)
  1313.  .AddFrameExtra 0,100,155,"Hitchhiker Mod",optHitch, Array("Install", 0, "Disabled", 64)
  1314.  .AddFrameExtra 0,150,155,"Woodbury Mod",optWood, Array("Install", 0, "Disabled", 128)
  1315.  .AddFrameExtra 0,200,155,"Barn Mod", optBarn, Array("Install", 0, "Disabled", 256)
  1316.  .AddFrameExtra 0,250,155,"Well Walker Mod", optWell, Array("Install", 0, "Disabled", 4096)
  1317.  .AddFrameExtra 175,50,155,"Fish Tank Mod",optTank, Array("Install", 0, "Disabled", 32768)
  1318.  .AddFrameExtra 175,100,155,"Fish Tank Lights Only Mod",optFish, Array("Install", 0, "Disabled", 16384)
  1319.  .AddFrameExtra 175,150,155,"Pinblades Mod",optBlade, Array("Install", 0, "Disabled", 65536)
  1320.  .AddFrameExtra 175,200,155,"Bloody Ramp Decals Mod",optRamp, Array("Install", 0, "Disabled", 512)
  1321.  .AddFrameExtra 175,250,155,"Bloody Flippers Mod",optFlip, Array("Install", 0, "Disabled", 1024)
  1322.  .AddFrameExtra 350,50,155,"Prisontower Mod", optTower, Array("Install", 0, "Disabled", 262144)
  1323.  .AddFrameExtra 350,100,155,"No Sanctuary Mod", optSanc, Array("Install", 0, "Disabled", 131072)
  1324.  .AddFrameExtra 350,150,155,"Instruction and Coincard Mod", optCard, Array("Install", 0, "Stern Stock", 2048)
  1325.  .AddFrameExtra 350,200,155,"Flipper Rubber Color", optRubb, Array("Black", 0, "Red", 8192)
  1326.  .AddChkExtra 100,320,135, Array("Enable Menu Next Start", optOpenAtStart)
  1327.  End With
  1328.  TableOptions = vpmDips1.ViewDipsExtra(TableOptions)
  1329.  SaveValue TableName,"Options",TableOptions
  1330.  TableSetOptions
  1331.  End Sub
  1332.  
  1333. '* MENU ENTRYS *******************************************************
  1334.  
  1335.  Sub TableSetOptions        'defines required settings before table is run
  1336.   Express = (TableOptions And optExpr)
  1337.   Hitch = (TableOptions And optHitch)
  1338.   Wood = (TableOptions And optWood)
  1339.   Barn = (TableOptions And optBarn)
  1340.   Ramp = (TableOptions And optRamp)
  1341.   Flip = (TableOptions And optFlip)
  1342.   Card = (TableOptions And optCard)
  1343.   Well = (TableOptions And optWell)
  1344.   Rubb = (TableOptions And optRubb)
  1345.   Fish = (TableOptions And optFish)
  1346.   Tank = (TableOptions And optTank)
  1347.   Blade = (TableOptions And optBlade)
  1348.   Sanc = (TableOptions And optSanc)
  1349.   Tower = (TableOptions And optTower)
  1350.   SaveValue TableName,"Options",TableOptions
  1351.  End Sub
  1352.  
  1353. '* EXPRESS MART MOD **************************************************
  1354.  
  1355. If Express = 32 Then
  1356.  MOD_ExpressMart.Visible = 0
  1357.  F28c.visible = 0
  1358.  End If
  1359. If Express = 0 Then
  1360.  MOD_ExpressMart.Visible = 1
  1361.  F28c.visible = 1
  1362. End If
  1363.  
  1364. '* HITCHHIKER MOD ****************************************************
  1365.  
  1366. If Hitch = 64 Then
  1367.  MOD_Hitchhiker.Visible = 0
  1368.  f26c.visible = 0
  1369. End If
  1370. If Hitch = 0 Then
  1371.  MOD_Hitchhiker.Visible = 1
  1372.  f26c.visible = 1
  1373. End If
  1374.  
  1375. '* WOODBURY MOD ******************************************************
  1376.  
  1377. If wood = 128 Then
  1378.  MOD_Woodbury.Visible = 0
  1379.  l40a.visible = 0
  1380. End If
  1381. If wood = 0 Then
  1382.  MOD_Woodbury.Visible = 1
  1383.  l40a.visible = 1
  1384. End If
  1385.  
  1386. '* BARN MOD **********************************************************
  1387.  
  1388. If Barn = 256 Then
  1389.  MOD_Barn.Visible = 0
  1390.  Barnfire1.visible = 0
  1391.  Barnfire2.visible = 0
  1392.  Barnfire3.visible = 0
  1393. End If
  1394. If Barn = 0 Then
  1395.  MOD_Barn.Visible = 1
  1396.  Barnfire1.visible = 1
  1397.  Barnfire2.visible = 1
  1398.  Barnfire3.visible = 1
  1399. End If
  1400.    
  1401. '* BLOODY FLIPPERS MOD **********************************************
  1402.  
  1403. If Flip = 1024 Then
  1404.  RightFlipperP.image = "1_OBJ_FlipperYellow"
  1405.  LeftFlipperP.image = "1_OBJ_FlipperYellow"
  1406. End If
  1407. If Flip = 0 Then
  1408.  RightFlipperP.image = "3_MOD_BloodyFlipper"
  1409.  LeftFlipperP.image = "3_MOD_BloodyFlipper"
  1410. End If
  1411.  
  1412. '* INSTRUCTION AND COINCARD MOD **************************************
  1413.  
  1414. If Card = 2048 Then
  1415.  InstCard.image = "1_OBJ_Cards"
  1416.  CoinCard.image = "1_OBJ_Cards"
  1417. End If
  1418. If Card = 0 Then
  1419.  InstCard.image = "3_MOD_Cards"
  1420.  CoinCard.image = "3_MOD_Cards"
  1421. End If
  1422.  
  1423. '* WELL WALKER MOD ***************************************************
  1424.  
  1425. If Well = 4096 Then
  1426.  WellWalker.image = "2_OBJ_Wellwalker"
  1427.  Wellbase.image = "2_OBJ_Wellwalker"
  1428.  Wellbase.material = "Metal0.8"
  1429. End If
  1430. If Well = 0 Then
  1431.  WellWalker.image = "3_MOD_WellwalkerBelt"
  1432.  Wellbase.image = "3_MOD_WellwalkerBelt"
  1433.  Wellbase.material = "Glossy Target"
  1434. End If
  1435.  
  1436. '* FLIPPER RUBBER COLOR **********************************************
  1437.  
  1438. If Rubb = 8192 Then
  1439.  LeftFlipperRubberP.image = "1_OBJ_FlipperRubber_Red"
  1440.  RightFlipperRubberP.image = "1_OBJ_FlipperRubber_Red"
  1441. End If
  1442. If Rubb = 0 Then
  1443.  LeftFlipperRubberP.image = "1_OBJ_FlipperRubber_Black"
  1444.  RightFlipperRubberP.image = "1_OBJ_FlipperRubber_Black"
  1445. End If
  1446.  
  1447. '* FISHTANK LIGHTS MOD ***********************************************
  1448.  
  1449. If fish = 16384 Then
  1450.  l73b.visible=0
  1451.  l74b.visible=0
  1452.  l75b.visible=0
  1453. End If
  1454. If fish = 0 Then
  1455.  l73b.visible=1
  1456.  l74b.visible=1
  1457.  l75b.visible=1
  1458. End If
  1459.  
  1460. '* FISHTANK MOD ******************************************************
  1461.  
  1462. If Tank = 32768 Then
  1463.  MOD_Fishtank.visible = 0
  1464.  MOD_Fishtank_Glass.Visible=0
  1465.  MOD_Fishtank_Body.Visible=0
  1466.  l73.visible=0
  1467.  l74.visible=0
  1468.  l75.visible=0
  1469.  l73a.visible=0
  1470.  l74a.visible=0
  1471.  l75a.visible=0
  1472.  f23.visible=0
  1473. End If
  1474. If Tank = 0 Then
  1475.  MOD_Fishtank.visible = 1
  1476.  MOD_Fishtank_Glass.Visible=1
  1477.  MOD_Fishtank_Body.Visible=1
  1478.  l73.visible=1
  1479.  l74.visible=1
  1480.  l75.visible=1
  1481.  l73a.visible=1
  1482.  l74a.visible=1
  1483.  l75a.visible=1
  1484.  f23.visible=1
  1485.  fish=16384
  1486. End If
  1487.  
  1488. '* PINBLADES MOD ****************************************************
  1489.  
  1490. If Blade = 65536 Then
  1491.  MOD_Pinblade_Left.visible = 0
  1492.  MOD_Pinblade_Right.Visible=0
  1493. End If
  1494. If Blade = 0 Then
  1495.  MOD_Pinblade_Left.visible = 1
  1496.  MOD_Pinblade_Right.Visible=1
  1497. End If
  1498.  
  1499. '* SANCTUARY MOD ****************************************************
  1500.  
  1501. If Sanc = 131072 Then
  1502.  MOD_Sanctuary.visible = 0
  1503. End If
  1504. If Sanc = 0 Then
  1505.  MOD_Sanctuary.visible = 1
  1506. End If
  1507.  
  1508. '* PRISONTOWER MOD ***************************************************
  1509.  
  1510. If Tower = 262144 Then
  1511.  Mod_Tower.visible = 0
  1512. End If
  1513. If Tower = 0 Then
  1514.  Mod_Tower.visible = 1
  1515. End If
  1516.  
  1517. '*********************************************************************
  1518. '*********************************************************************
  1519. '*********************************************************************
  1520. '* END OF TABLE SCRIPT ***********************************************
  1521. '*********************************************************************
  1522. '*********************************************************************
  1523. '*********************************************************************
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top