Arngrim

Untitled

Oct 29th, 2016
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 44.97 KB | None | 0 0
  1. 'No Good Gofers by Bodydump
  2. 'Models by Dark
  3. Option Explicit
  4. Randomize
  5.  
  6. On Error Resume Next
  7. ExecuteGlobal GetTextFile("controller.vbs")
  8. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  9. On Error Goto 0
  10.  
  11. Const BallSize = 50
  12.  
  13. '***Apron Style***
  14. ' 0 = Standard apron
  15. ' 1 = Custom apron
  16. apronstyle = 0
  17.  
  18. '**************************
  19. 'Desktop/Fullscreen Changes
  20. '**************************
  21.  
  22. If Table.ShowDT = true then
  23. Ramp15.visible = True
  24. Ramp16.visible = True
  25. Ramp17.visible = True
  26. Light47.Intensity = 0
  27. else
  28. Ramp15.visible = False
  29. Ramp16.visible = False
  30. Ramp17.visible = False
  31. end if
  32.  
  33.  
  34. LoadVPM"01520000","WPC.VBS",3.1
  35.  
  36.  
  37.  
  38. '********************
  39. 'Standard definitions
  40. '********************
  41.  
  42. Dim xx, apronstyle
  43. Dim Bump1, Bump2, Bump3, RGoferIsUp, RightRampUp, LGoferIsUp, LeftRampUp
  44. Dim bsTrough, bsLeftEject, bsPuttOutPopper, bsJetPopper, bsUpperRightEject, mTT, cbCaptive
  45. LGoferIsUp = 0
  46. LeftRampUp = 0
  47. RGoferIsUp = 0
  48. RightRampUp = 0
  49. Const cGameName = "ngg_13"
  50. Const UseSolenoids = 1
  51. Const UseLamps = 0
  52. Const UseGI = 0
  53. Const UseSync = 0
  54. Const HandleMechs = 1
  55.  
  56. Set GICallback = GetRef("UpdateGIon")
  57. Set GICallback2 = GetRef("UpdateGI")
  58.  
  59. Const SSolenoidOn="fx_Solenoid"
  60. Const SSolenoidOff="fx_solenoidoff"
  61. Const sCoin="fx_Coin"
  62.  
  63. '***********
  64. ' Solenoids
  65. ' the commented solenoids are not in used in this script
  66. '***********
  67.  
  68. SolCallback(1)="vpmSolAutoPlunger Plunger1,3," 'Autofire
  69. SolCallback(2)="vpmSolAutoPlunger KickBack,3," 'KickBack
  70. SolCallback(3)="SolPuttOut" 'Clubhouse Kicker
  71. SolCallback(4)="SolLeftGoferUP" 'Left Gofer Up
  72. SolCallback(5)="SolRightGoferUP" 'Right Gofer Up
  73. SolCallback(6)="bsJetPopper.SolOut" 'Jet Popper
  74. SolCallback(7)="bsLeftEject.SolOut" 'Left Eject (Sand Trap)
  75. SolCallback(8)="bsUpperRightEject.SolOut" 'Upper Right Eject
  76. SolCallback(9)="SolBallRelease" 'Trough Eject
  77. ' 'SolCallback(10)="vpmSolSound ""Sling""," 'Left Slingshot
  78. ' 'SolCallback(11)="vpmSolSound ""Sling""," 'Right Slingshot
  79. ' 'SolCallback(12)="vpmSolSound ""Jet3""," 'Top Jet Bumper
  80. ' 'SolCallback(13)="vpmSolSound ""Jet3""," 'Middle Jet Bumper
  81. ' 'SolCallback(14)="vpmSolSound ""Jet3""," 'Bottom Jet Bumper
  82. SolCallback(15)="SolLeftGoferDown" 'Left Gofer Down
  83. SolCallback(16)="SolRightGoferDown" 'Right Gofer Down
  84. SolCallback(17)="SetLamp 170," 'Jet Flasher
  85. SolCallback(18)="SetLamp 178," 'Lower Left Flasher
  86. SolCallback(19)="SetLamp 180," 'Left Spinner Flasher
  87. SolCallback(20)="SetLamp 122," 'Right Spinner Flasher
  88. SolCallback(21)="SetLamp 179," 'Lower Right Flasher
  89. SolCallback(24)="SolSubway" 'Underground Pass
  90. SolCallback(25)="SetLamp 131," 'Sand Trap Flasher
  91. SolCallback(26)="SetLamp 190," 'Wheel Flasher
  92. SolCallback(27)="SolLeftRampDown" 'Left Ramp Down
  93. SolCallback(28)="SolRightRampDown" 'Right Ramp Down
  94. SolCallback(35)="SolSlamRamp" 'Ball Launch Ramp
  95. SolCallback(51)="SetLamp 177," 'Upper Right Flasher 1
  96. SolCallback(52)="SetLamp 175," 'Upper Right Flasher 2
  97. SolCallback(53)="SetLamp 173," 'Upper Right Flasher 3
  98. SolCallback(56)="SetLamp 176," 'Upper Left Flasher 1
  99. SolCallback(57)="SetLamp 174," 'Upper Left Flasher 2
  100. SolCallback(58)="SetLamp 172," 'Upper Left Flasher 3
  101. ' SolCallback(sLRFlipper)="vpmSolFlipper RightFlipper,Nothing,"
  102. ' SolCallback(sLLFlipper)="vpmSolFlipper LeftFlipper,Nothing,"
  103. ' SolCallback(sURFlipper)="vpmSolFlipper UpperFlipper,Nothing,"
  104. SolCallback(54)="SetLamp 145,"
  105. SolCallback(55)="SetLamp 146,"
  106. '
  107. Sub SolBallRelease(Enabled)
  108. If Enabled Then
  109. If bsTrough.Balls Then
  110. vpmTimer.PulseSw 31
  111. End If
  112. bsTrough.ExitSol_On
  113. End If
  114. End Sub
  115.  
  116. Sub SolPuttOut(Enabled)
  117. If Enabled Then
  118. If bsPuttOutPopper.Balls Then
  119. bsPuttOutPopper.InitKick sw44a,170,12
  120. PlaySound SoundFX("scoopexit",DOFContactors)
  121. End If
  122. bsPuttOutPopper.ExitSol_On
  123. End If
  124. End Sub
  125. Sub SolSubway(Enabled)
  126. If Enabled Then
  127. If bsPuttOutPopper.Balls Then
  128. bsPuttOutPopper.InitKick subwaystart,180,3
  129. bsPuttOutPopper.ExitSol_On
  130. End If
  131. End If
  132. End Sub
  133.  
  134. Sub SolLeftGoferUP(Enabled)
  135. If Enabled Then
  136. LrampTimer.Enabled = 0
  137. If LGoferIsUp = 0 Then
  138. DOF 101, DOFPulse
  139. Controller.Switch(41)=0
  140. Controller.Switch(47)=0
  141. LGofer.IsDropped=0
  142. LGoferUp.Enabled = 1
  143. LGoferDown.Enabled = 0
  144. Lramp.collidable=0
  145. Lramp1.collidable=1
  146. LeftRampUp = 1
  147. Else
  148. DOF 102, DOFPulse
  149. Controller.Switch(41)=0
  150. Controller.Switch(47)=0
  151. LGoferUp.Enabled = 1
  152. LeftGoferBlock.collidable = 1
  153. LGPos = 6
  154. End If
  155. End If
  156. End Sub
  157.  
  158. Sub SolRightGoferUP(Enabled)
  159. If Enabled Then
  160. RrampTimer.Enabled = 0
  161. If RGoferIsUp = 0 Then
  162. DOF 101, DOFPulse
  163. Controller.Switch(42)=0
  164. Controller.Switch(48)=0
  165. RGofer.IsDropped=0
  166. RGoferUp.Enabled = 1
  167. RGoferDown.Enabled = 0
  168. Rramp.collidable=0
  169. Rramp1.collidable=1
  170. RightRampUp = 1
  171. Else
  172. DOF 102, DOFPulse
  173. Controller.Switch(42)=0
  174. Controller.Switch(48)=0
  175. RGoferUp.Enabled = 1
  176. RGPos = 6
  177. End If
  178. End If
  179. End Sub
  180.  
  181. Sub SolLeftGoferDown(Enabled)
  182. If Enabled Then
  183. DOF 101, DOFPulse
  184. Controller.Switch(41)=1
  185. LGoferDown.Enabled = 1
  186. LGoferUp.Enabled = 0
  187. LGofer.IsDropped=1
  188. End If
  189. End Sub
  190.  
  191. Sub SolRightGoferDown(Enabled)
  192. If Enabled Then
  193. DOF 101, DOFPulse
  194. Controller.Switch(42)=1
  195. RGoferDown.Enabled = 1
  196. RGoferUp.Enabled = 0
  197. RGofer.IsDropped = 1
  198. End If
  199. End Sub
  200.  
  201. Sub SolLeftRampDown(Enabled)
  202. If Enabled Then
  203. RightRampUp = 0
  204. LrampDir = 1
  205. Lramp.collidable=1
  206. Lramp1.collidable=0
  207. PlaySound "gate"
  208. LrampTimer.Enabled = 1
  209.  
  210. Else
  211.  
  212. End If
  213. End Sub
  214.  
  215. Sub SolRightRampDown(Enabled)
  216. If Enabled Then
  217. RightRampUp = 0
  218. RrampDir = 1
  219. Rramp.collidable=1
  220. Rramp1.collidable=0
  221. PlaySound "gate"
  222. RrampTimer.Enabled = 1
  223.  
  224. Else
  225.  
  226. End If
  227. End Sub
  228.  
  229. Sub SolSlamRamp(Enabled)
  230. If Enabled Then
  231. For each xx in aslamramp:xx.IsDropped=0:Next
  232. For each xx in aslamrampup:xx.IsDropped=1:Next
  233. jumpramptrigger.enabled = 1
  234. jumpramp.Collidable=1
  235. slamrampup.Collidable = 0
  236. Flipper1.RotateToEnd
  237. rampshadow.visible = 0
  238. SlamRampDownTimer.Enabled = 1
  239. Else
  240.  
  241. End If
  242. End Sub
  243.  
  244. Sub SlamRampDownTimer_Timer()
  245. SlamRampUpTimer.Enabled = 1
  246. SlamRampDownTimer.Enabled = 0
  247. End Sub
  248. Sub SlamRampUpTimer_Timer()
  249. For each xx in aslamramp:xx.IsDropped=1:Next
  250. For each xx in aslamrampup:xx.IsDropped=9:Next
  251. jumpramp.Collidable=0
  252. slamrampup.Collidable = 1
  253. jumpramptrigger.enabled = 0
  254. Flipper1.RotateToStart
  255. rampshadow.visible = 1
  256. SlamRampUpTimer.Enabled = 0
  257. End Sub
  258.  
  259. '************
  260. ' Table init.
  261. '************
  262.  
  263. Sub Table_Init
  264. vpmInit me
  265. With Controller
  266. .GameName = cGameName
  267. If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description:Exit Sub
  268. .SplashInfoLine="No Good Gofers" & vbNewLine & "VP Table by Bodydump"
  269. .HandleKeyboard=0
  270. .ShowTitle=0
  271. .ShowDMDOnly=1
  272. .ShowFrame=0
  273. .HandleMechanics=1
  274. .Hidden=1
  275. On Error Resume Next
  276. .Run GetPlayerHWnd
  277. If Err Then MsgBox Err.Description
  278. On Error Goto 0
  279. End With
  280. 'Nudging
  281. vpmNudge.TiltSwitch=14
  282. vpmNudge.Sensitivity=1
  283. vpmNudge.TiltObj=Array(Bumper1,Bumper2,Bumper3,LeftSlingshot,RightSlingshot)
  284.  
  285. 'Trough
  286. Set bsTrough = New cvpmTrough
  287. With bsTrough
  288. .size = 6
  289. .initSwitches Array(32, 33, 34, 35,36,37)
  290. .Initexit BallRelease, 105,5
  291. .InitEntrySounds "fx_drain", "fx_Solenoid", "fx_Solenoid"
  292. .InitExitSounds SoundFX("fx_Solenoid",DOFContactors), SoundFX("fx_ballrel",DOFContactors)
  293. .Balls = 6
  294. End With
  295.  
  296. 'Sand Trap Eject
  297. Set bsLeftEject = New cvpmSaucer
  298. With bsLeftEject
  299. .InitKicker LeftEject, 78, 78, 30, 0
  300. .InitSounds "fx_kicker_enter", SoundFX("fx_Solenoid",DOFContactors), SoundFX("fx_Popper",DOFContactors)
  301. End With
  302.  
  303. 'Putt Out Popper
  304. Set bsPuttOutPopper=New cvpmBallStack
  305. With bsPuttOutPopper
  306. .InitSw 0,44,0,0,0,0,0,0
  307. .InitKick sw44a,170,12
  308. End With
  309.  
  310. 'Jet Popper
  311. Set bsJetPopper=New cvpmBallStack
  312. With bsJetPopper
  313. .InitSw 0,38,25,0,0,0,0,0
  314. .InitKick JetPopper,180,10
  315. .InitExitSnd SoundFX("fx_Popper",DOFContactors), SoundFX("fx_Solenoid",DOFContactors)
  316. End With
  317.  
  318. 'Upper Right Eject
  319. Set bsUpperRightEject=New cvpmBallStack
  320. With bsUpperRightEject
  321. .InitSw 0,46,0,0,0,0,0,0
  322. .InitKick upperrightkicker,120,5
  323. .InitExitSnd SoundFX("fx_Popper",DOFContactors), SoundFX("fx_Solenoid",DOFContactors)
  324. End With
  325.  
  326. 'Turntable
  327. Set mTT=New cvpmTurnTable
  328. With mTT
  329. .InitTurnTable TurnTable,40
  330. .SpinUp=40
  331. .SpinDown=40
  332. .CreateEvents "mTT"
  333. End With
  334.  
  335. 'Captive Ball
  336. Set cbCaptive=New cvpmCaptiveBall
  337. With cbCaptive
  338. .InitCaptive Captive,CWALL,Array(Captive1,Captive2),350
  339. .NailedBalls=1
  340. .Start
  341. .ForceTrans=0.9
  342. .MinForce=4
  343. .CreateEvents "cbCaptive"
  344. End With
  345. Captive1.CreateBall
  346. If apronstyle = 0 Then
  347. apron.IsDropped = 1
  348. apron1.IsDropped = 0
  349. Else
  350. apron.IsDropped = 0
  351. apron1.IsDropped = 1
  352. End If
  353.  
  354. If nightday<5 then
  355. For each xx in extraambient:xx.intensityscale = 1:Next
  356. End If
  357. If nightday>5 then
  358. For each xx in extraambient:xx.intensity = xx.intensity*.9:Next
  359. End If
  360. If nightday>10 then
  361. For each xx in extraambient:xx.intensity = xx.intensity*.7:Next
  362. For each xx in GIleft:xx.intensity = xx.intensity*.9:Next
  363. For each xx in GIright:xx.intensity = xx.intensity*.9:Next
  364. End If
  365. If nightday>20 then
  366. For each xx in extraambient:xx.intensity = xx.intensity*.6:Next
  367. For each xx in GIleft:xx.intensity = xx.intensity*.8:Next
  368. For each xx in GIright:xx.intensity = xx.intensity*.8:Next
  369. End If
  370. If nightday>30 then
  371. For each xx in extraambient:xx.intensity = xx.intensity*.4:Next
  372. For each xx in GIleft:xx.intensity = xx.intensity*.7:Next
  373. For each xx in GIright:xx.intensity = xx.intensity*.7:Next
  374. End If
  375.  
  376.  
  377.  
  378. ' '**Main Timer init
  379. PinMAMETimer.Enabled = 1
  380.  
  381. Plunger1.PullBack
  382. Kickback.PullBack
  383. Controller.Switch(22)=1 'close coin door
  384. Controller.Switch(24)=0 'always closed
  385. Controller.Switch(41)=1 'drop left gofer
  386. Controller.Switch(42)=1 'drop right gofer
  387. Controller.Switch(47)=1 'left ramp down
  388. Controller.Switch(48)=1 'right ramp down
  389. LGofer.IsDropped = 1
  390. RGofer.IsDropped = 1
  391. Rramp1.collidable=0
  392. Lramp1.collidable=0
  393.  
  394. End Sub
  395.  
  396. Sub Table_Paused:Controller.Pause = 1:End Sub
  397. Sub Table_unPaused:Controller.Pause = 0:End Sub
  398.  
  399. '**********
  400. ' Keys
  401. '**********
  402.  
  403. Sub table_KeyDown(ByVal Keycode)
  404. If keycode = PlungerKey Then Plunger.Pullback:PlaySound SoundFX("fx_plungerpull",DOFContactors)
  405. If keycode = LeftTiltKey Then Nudge 90, 3:PlaySound SoundFX("fx_nudge",0), 0, 1, -0.1, 0.25
  406. If keycode = RightTiltKey Then Nudge 270, 3:PlaySound SoundFX("fx_nudge",0), 0, 1, 0.1, 0.25
  407. If keycode = CenterTiltKey Then Nudge 0, 4:PlaySound SoundFX("fx_nudge",0), 0, 1, 0, 0.25
  408. If vpmKeyDown(keycode) Then Exit Sub
  409. End Sub
  410.  
  411. Sub table_KeyUp(ByVal Keycode)
  412. If keycode = PlungerKey Then Plunger.Fire:PlaySound SoundFX("fx_plunger",DOFContactors)
  413. If vpmKeyUp(keycode) Then Exit Sub
  414. End Sub
  415.  
  416.  
  417. '********************
  418. ' Flippers
  419. '********************
  420.  
  421. SolCallback(sLRFlipper) = "SolRFlipper"
  422. SolCallback(sLLFlipper) = "SolLFlipper"
  423.  
  424. Sub SolLFlipper(Enabled)
  425. If Enabled Then
  426. PlaySound SoundFX("fx_flipperup",DOFContactors), 0, 1, -0.1, 0.05
  427. LeftFlipper.RotateToEnd
  428. Else
  429. PlaySound SoundFX("fx_flipperdown",DOFContactors), 0, 1, -0.1, 0.05
  430. LeftFlipper.RotateToStart
  431. End If
  432. End Sub
  433.  
  434. Sub SolRFlipper(Enabled)
  435. If Enabled Then
  436. PlaySound SoundFX("fx_flipperup",DOFContactors), 0, 1, 0.1, 0.05
  437. RightFlipper.RotateToEnd
  438. UpperFlipper.RotateToEnd
  439. Else
  440. PlaySound SoundFX("fx_flipperdown",DOFContactors), 0, 1, 0.1, 0.05
  441. RightFlipper.RotateToStart
  442. UpperFlipper.RotateToStart
  443. End If
  444. End Sub
  445.  
  446. '****************************
  447. ' Drain holes, vuks & saucers
  448. '****************************
  449. Sub Drain_Hit:bsTrough.AddBall Me:End Sub
  450. Sub LeftEject_Hit:bsLeftEject.AddBall 0:End Sub 'Sand Trap Eject
  451. Sub sw44a_Hit:PlaySound "trough", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  452. Sub sw44b_Hit:PlaySound "trough", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  453. Sub sw44c_Hit:PlaySound "trough", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  454. Sub sw44d_Hit:PlaySound "trough", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  455. Sub sw44e_Hit:PlaySound "trough", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  456. Sub sw44f_Hit:PlaySound "trough", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  457. Sub sw44g_Hit:PlaySound "trough", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  458. Sub sw44h_Hit:PlaySound "trough", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  459. Sub sw44i_Hit:PlaySound "trough", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  460. Sub subwayend_Hit:bsJetPopper.AddBall Me:End Sub 'Underground Pass
  461. Sub holeinone_Hit:PlaySound "holeinone", 0, 1, 0.05, 0.05:Me.DestroyBall:vpmTimer.PulseSwitch 68,160,"HandleTopHole'":End Sub
  462. Sub behindleftgofer_Hit:PlaySound "fx_kicker_enter", 0, 1, -0.05, 0.05:Me.DestroyBall:vpmTimer.PulseSwitch 67,100,"bsPuttOutPopper.AddBall 0'":End Sub
  463. Sub rightpopperjam_Hit:PlaySound "fx_kicker_enter", 0, 1, 0.05, 0.05:Me.DestroyBall:vpmTimer.PulseSwitch 45,160,"bsUpperRightEject.AddBall 0'":End Sub
  464. Sub HandleTopHole:vpmTimer.PulseSwitch 67,100,"bsPuttOutPopper.AddBall 0'":End Sub
  465.  
  466. '***************
  467. ' Slingshots
  468. '***************
  469. '**********Sling Shot Animations
  470. ' Rstep and Lstep are the variables that increment the animation
  471. '****************
  472. Dim RStep, Lstep
  473.  
  474. Sub RightSlingShot_Slingshot
  475. PlaySound SoundFX("right_slingshot",DOFContactors), 0, 1, 0.05, 0.05
  476. vpmTimer.PulseSw 52
  477. RSling.Visible = 0
  478. RSling1.Visible = 1
  479. sling1.TransZ = -20
  480. RStep = 0
  481. RightSlingShot.TimerEnabled = 1
  482. End Sub
  483.  
  484. Sub RightSlingShot_Timer
  485. Select Case RStep
  486. Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -10
  487. Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.TransZ = 0:RightSlingShot.TimerEnabled = 0
  488. End Select
  489. RStep = RStep + 1
  490. End Sub
  491.  
  492. Sub LeftSlingShot_Slingshot
  493. PlaySound SoundFX("left_slingshot",DOFContactors), 0, 1, -0.05, 0.05
  494. vpmTimer.PulseSw 51
  495. LSling.Visible = 0
  496. LSling1.Visible = 1
  497. sling2.TransZ = -20
  498. LStep = 0
  499. LeftSlingShot.TimerEnabled = 1
  500. End Sub
  501.  
  502. Sub LeftSlingShot_Timer
  503. Select Case LStep
  504. Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -10
  505. Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.TransZ = 0:LeftSlingShot.TimerEnabled = 0
  506. End Select
  507. LStep = LStep + 1
  508. End Sub
  509.  
  510. '***************
  511. ' Bumpers
  512. '***************
  513. Sub Bumper1_Hit:vpmTimer.PulseSw 54:PlaySound SoundFX("fx_bumper",DOFContactors), 0, 1, -0.03, 0.05:End Sub
  514. Sub Bumper2_Hit:vpmTimer.PulseSw 53:PlaySound SoundFX("fx_bumper",DOFContactors), 0, 1, -0.05, 0.05:End Sub
  515. Sub Bumper3_Hit:vpmTimer.PulseSw 55:PlaySound SoundFX("fx_bumper",DOFContactors), 0, 1, -0.05, 0.05:End Sub
  516.  
  517.  
  518. '************
  519. ' Spinners
  520. '************
  521. Sub Spinner1_Spin():vpmTimer.PulseSw 61:PlaySound "fx_spinner", 0, 1, -0.05, 0.05: End Sub
  522. Sub Spinner2_Spin():vpmTimer.PulseSw 62:PlaySound "fx_spinner", 0, 1, 0.05, 0.05: End Sub
  523.  
  524. '*********************
  525. ' Switches & Rollovers
  526. '*********************
  527. Sub sw18_Hit:Controller.Switch(18)=1:PlaySound "fx_sensor":End Sub
  528. Sub sw18_UnHit:Controller.Switch(18)=0:End Sub
  529. Sub sw16_Hit:Controller.Switch(16)=1:PlaySound "fx_sensor":End Sub
  530. Sub sw16_UnHit:Controller.Switch(16)=0:End Sub
  531. Sub sw17_Hit:Controller.Switch(17)=1:PlaySound "fx_sensor":End Sub
  532. Sub sw17_UnHit:Controller.Switch(17)=0:End Sub
  533. Sub sw26_Hit:Controller.Switch(26)=1:PlaySound "fx_sensor":End Sub
  534. Sub sw26_UnHit:Controller.Switch(26)=0:End Sub
  535. Sub sw27_Hit:Controller.Switch(27)=1:PlaySound "fx_sensor":End Sub
  536. Sub sw27_UnHit:Controller.Switch(27)=0:End Sub
  537. Sub sw28_Hit:Controller.Switch(28)=1:PlaySound "fx_sensor":End Sub
  538. Sub sw28_UnHit:Controller.Switch(28)=0:End Sub
  539. Sub sw71_Hit:Controller.Switch(71)=1:PlaySound "fx_sensor":End Sub
  540. Sub sw71_UnHit:Controller.Switch(71)=0:End Sub
  541. Sub sw72_Hit:Controller.Switch(72)=1:PlaySound "fx_sensor":End Sub
  542. Sub sw72_UnHit:Controller.Switch(72)=0:End Sub
  543. Sub sw86_Hit:Controller.Switch(86)=1:PlaySound "fx_sensor":End Sub
  544. Sub sw86_UnHit:Controller.Switch(86)=0:End Sub
  545.  
  546. '***************
  547. ' Targets
  548. '***************
  549.  
  550. Sub sw23_Hit
  551. vpmTimer.PulseSw 23
  552. PlaySound SoundFX("fx_target",DOFContactors), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  553. End Sub
  554.  
  555. Sub sw56_Hit
  556. vpmTimer.PulseSw 56
  557. PlaySound SoundFX("fx_target",DOFContactors), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  558. End Sub
  559.  
  560. Sub sw57_Hit
  561. vpmTimer.PulseSw 57
  562. PlaySound SoundFX("fx_target",DOFContactors), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  563. End Sub
  564.  
  565. Sub sw58_Hit
  566. vpmTimer.PulseSw 58
  567. PlaySound SoundFX("fx_target",DOFContactors), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  568. End Sub
  569.  
  570. Sub sw77_Hit
  571. vpmTimer.PulseSw 77
  572. PlaySound SoundFX("fx_target",DOFContactors), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  573. End Sub
  574.  
  575. Sub sw81_Hit
  576. vpmTimer.PulseSw 81
  577. PlaySound SoundFX("fx_target",DOFContactors), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  578. End Sub
  579.  
  580. Sub sw82_Hit
  581. vpmTimer.PulseSw 82
  582. PlaySound SoundFX("fx_target",DOFContactors), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  583. End Sub
  584.  
  585. Sub sw83_Hit
  586. vpmTimer.PulseSw 83
  587. PlaySound SoundFX("fx_target",DOFContactors), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  588. End Sub
  589.  
  590. Sub sw84_Hit
  591. vpmTimer.PulseSw 84
  592. PlaySound SoundFX("fx_target",DOFContactors), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  593. End Sub
  594.  
  595. Sub sw85_Hit
  596. vpmTimer.PulseSw 85
  597. PlaySound SoundFX("fx_target",DOFContactors), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  598. End Sub
  599.  
  600. '*********************
  601. ' Random Switches
  602. '*********************
  603. Sub Gate4_Hit():vpmTimer.PulseSw 12:End Sub
  604. Sub sw15_Hit():vpmTimer.PulseSw 15:End Sub
  605. Sub cart_Hit():PlaySound "plastichit":vpmTimer.PulseSw 74:GolfCart.Y = 218:WheelTargetPosition.Y = 217:Me.TimerEnabled = 1:End Sub 'Golf Cart
  606. Sub cart_Timer:GolfCart.Y = 215:WheelTargetPosition.Y = 211:Me.TimerEnabled = 0:End Sub
  607. Sub sw73_Hit():vpmTimer.PulseSw 73:End Sub
  608. Sub LGofer_Hit():PlaySound "plastichit":vpmTimer.PulseSw 65:LeftGoferBlock.Y = 441:Me.TimerEnabled = 1:End Sub
  609. Sub LGofer_Timer:LeftGoferBlock.Y = 449:Me.TimerEnabled = 0:End Sub
  610. Sub RGofer_Hit():PlaySound "plastichit":vpmTimer.PulseSw 75:RightGoferBlock.Y = 516.625:Me.TimerEnabled = 1:End Sub
  611. Sub RGofer_Timer:RightGoferBlock.Y = 524.625:Me.TimerEnabled = 0:End Sub
  612.  
  613. '****************
  614. 'Gofer Animations
  615. '****************
  616.  
  617. Dim LGPos, LGDir, RGPos, RGPos2, RGDir, LrampPos, LrampDir, RrampPos, RrampDir
  618. LGPos=22:RGPos=22:LrampPos=22:RrampPos=22
  619. LGDir=0:RGDir=0:LrampDir=1:RrampDir=1
  620. LGofer.TimerEnabled=1:RGofer.TimerEnabled=1:LrampTimer.Enabled=1
  621.  
  622. Sub LGoferUp_Timer()
  623. Select Case LGPos
  624. Case 0: LeftGoferBlock.z=-20
  625. LGoferIsUp = 1
  626. LGoferUp.Enabled = 0
  627. Lramp.HeightBottom=110
  628. Case 1: LeftGoferBlock.z=-25:Lramp.HeightBottom=104
  629. Case 2: LeftGoferBlock.z=-31:Lramp.HeightBottom=102
  630. Case 3: LeftGoferBlock.z=-37:Lramp.HeightBottom=100
  631. Case 4: LeftGoferBlock.z=-31:Lramp.HeightBottom=102
  632. Case 5: LeftGoferBlock.z=-25:Lramp.HeightBottom=104
  633. Case 6: LeftGoferBlock.z=-20:Lramp.HeightBottom=110
  634. Case 7: LeftGoferBlock.z=-25:Lramp.HeightBottom=104
  635. Case 8: LeftGoferBlock.z=-31:Lramp.HeightBottom=98
  636. Case 9: LeftGoferBlock.z=-37:Lramp.HeightBottom=91
  637. Case 10: LeftGoferBlock.z=-43:Lramp.HeightBottom=84
  638. Case 11: LeftGoferBlock.z=-49:Lramp.HeightBottom=77
  639. Case 12: LeftGoferBlock.z=-55:Lramp.HeightBottom=70
  640. Case 13: LeftGoferBlock.z=-61:Lramp.HeightBottom=63
  641. Case 14: LeftGoferBlock.z=-67:Lramp.HeightBottom=56
  642. Case 15: LeftGoferBlock.z=-73:Lramp.HeightBottom=49
  643. Case 16: LeftGoferBlock.z=-79:Lramp.HeightBottom=42
  644. Case 17: LeftGoferBlock.z=-85:Lramp.HeightBottom=35
  645. Case 18: LeftGoferBlock.z=-91:Lramp.HeightBottom=28
  646. Case 19: LeftGoferBlock.z=-97:Lramp.HeightBottom=21
  647. Case 20: LeftGoferBlock.z=-103:Lramp.HeightBottom=14
  648. Case 21: LeftGoferBlock.z=-109:Lramp.HeightBottom=7
  649. Case 22: LeftGoferBlock.z=-115:Lramp.HeightBottom=0
  650. End Select
  651. If LGpos>0 then LGpos=LGpos-1
  652. End Sub
  653.  
  654. Sub LGoferDown_Timer()
  655. Select Case LGPos
  656. Case 0: LeftGoferBlock.z=-19
  657. Case 1: LeftGoferBlock.z=-25
  658. Case 2: LeftGoferBlock.z=-31
  659. Case 3: LeftGoferBlock.z=-37
  660. Case 4: LeftGoferBlock.z=-43
  661. Case 5: LeftGoferBlock.z=-49
  662. Case 6: LeftGoferBlock.z=-55
  663. Case 7: LeftGoferBlock.z=-61
  664. Case 8: LeftGoferBlock.z=-67
  665. Case 9: LeftGoferBlock.z=-73
  666. Case 10: LeftGoferBlock.z=-79
  667. Case 11: LeftGoferBlock.z=-85
  668. Case 12: LeftGoferBlock.z=-91
  669. Case 13: LeftGoferBlock.z=-97
  670. Case 14: LeftGoferBlock.z=-103
  671. Case 15: LeftGoferBlock.z=-109
  672. Case 16: LeftGoferBlock.z=-115
  673. LGoferDown.Enabled = 0
  674. LGoferIsUp = 0
  675. End Select
  676. If LGpos<16 then LGpos=LGpos+1
  677. End Sub
  678.  
  679. Sub RGoferUp_Timer()
  680. Select Case RGPos
  681. Case 0: RightGoferBlock.z=-20
  682. RGoferIsUp = 1
  683. RGoferUp.Enabled = 0
  684. Rramp.HeightBottom=110
  685. Case 1: RightGoferBlock.z=-25:Rramp.HeightBottom=104
  686. Case 2: RightGoferBlock.z=-31:Rramp.HeightBottom=102
  687. Case 3: RightGoferBlock.z=-37:Rramp.HeightBottom=100
  688. Case 4: RightGoferBlock.z=-31:Rramp.HeightBottom=102
  689. Case 5: RightGoferBlock.z=-25:Rramp.HeightBottom=104
  690. Case 6: RightGoferBlock.z=-20:Rramp.HeightBottom=110
  691. Case 7: RightGoferBlock.z=-25:Rramp.HeightBottom=104
  692. Case 8: RightGoferBlock.z=-31:Rramp.HeightBottom=98
  693. Case 9: RightGoferBlock.z=-37:Rramp.HeightBottom=91
  694. Case 10: RightGoferBlock.z=-43:Rramp.HeightBottom=84
  695. Case 11: RightGoferBlock.z=-49:Rramp.HeightBottom=77
  696. Case 12: RightGoferBlock.z=-55:Rramp.HeightBottom=70
  697. Case 13: RightGoferBlock.z=-61:Rramp.HeightBottom=63
  698. Case 14: RightGoferBlock.z=-67:Rramp.HeightBottom=56
  699. Case 15: RightGoferBlock.z=-73:Rramp.HeightBottom=49
  700. Case 16: RightGoferBlock.z=-79:Rramp.HeightBottom=42
  701. Case 17: RightGoferBlock.z=-85:Rramp.HeightBottom=35
  702. Case 18: RightGoferBlock.z=-91:Rramp.HeightBottom=28
  703. Case 19: RightGoferBlock.z=-97:Rramp.HeightBottom=21
  704. Case 20: RightGoferBlock.z=-103:Rramp.HeightBottom=14
  705. Case 21: RightGoferBlock.z=-109:Rramp.HeightBottom=7
  706. Case 22: RightGoferBlock.z=-115:Rramp.HeightBottom=0
  707. End Select
  708. If RGpos>0 then RGpos=RGpos-1
  709. End Sub
  710.  
  711. Sub RGoferDown_Timer()
  712. Select Case RGPos
  713. Case 0: RightGoferBlock.z=-19
  714. Case 1: RightGoferBlock.z=-25
  715. Case 2: RightGoferBlock.z=-31
  716. Case 3: RightGoferBlock.z=-37
  717. Case 4: RightGoferBlock.z=-43
  718. Case 5: RightGoferBlock.z=-49
  719. Case 6: RightGoferBlock.z=-55
  720. Case 7: RightGoferBlock.z=-61
  721. Case 8: RightGoferBlock.z=-67
  722. Case 9: RightGoferBlock.z=-73
  723. Case 10: RightGoferBlock.z=-79
  724. Case 11: RightGoferBlock.z=-85
  725. Case 12: RightGoferBlock.z=-91
  726. Case 13: RightGoferBlock.z=-97
  727. Case 14: RightGoferBlock.z=-103
  728. Case 15: RightGoferBlock.z=-109
  729. Case 16: RightGoferBlock.z=-115
  730. RGoferDown.Enabled = 0
  731. RGoferIsUp = 0
  732. End Select
  733. If RGpos<16 then RGpos=RGpos+1
  734. End Sub
  735.  
  736. Sub LrampTimer_Timer()
  737. If LGoferIsUp = 0 Then
  738. Select Case LrampPos
  739. Case 0: Lramp.HeightBottom=110
  740. Case 1: Lramp.HeightBottom=104
  741. Case 2: Lramp.HeightBottom=102
  742. Case 3: Lramp.HeightBottom=100
  743. Case 4: Lramp.HeightBottom=102
  744. Case 5: Lramp.HeightBottom=104
  745. Case 6: Lramp.HeightBottom=110
  746. Case 7: Lramp.HeightBottom=104
  747. Case 8: Lramp.HeightBottom=98
  748. Case 9: Lramp.HeightBottom=91
  749. Case 10: Lramp.HeightBottom=84
  750. Case 11: Lramp.HeightBottom=77
  751. Case 12: Lramp.HeightBottom=70
  752. Case 13: Lramp.HeightBottom=63
  753. Case 14: Lramp.HeightBottom=56
  754. Case 15: Lramp.HeightBottom=49
  755. Case 16: Lramp.HeightBottom=42
  756. Case 17: Lramp.HeightBottom=35
  757. Case 18: Lramp.HeightBottom=28
  758. Case 19: Lramp.HeightBottom=21
  759. Case 20: Lramp.HeightBottom=14
  760. Case 21: Lramp.HeightBottom=7
  761. Case 22: Lramp.HeightBottom=0:Controller.Switch(47)=1:LeftRampUp = 0:LrampTimer.Enabled = 0
  762. If Lramppos<22 then Lramppos=Lramppos+1
  763. End Select
  764. End If
  765. End Sub
  766.  
  767.  
  768. Sub RrampTimer_Timer()
  769. If RGoferIsUp = 0 Then
  770. Select Case RrampPos
  771. Case 0: Rramp.HeightBottom=110
  772. Case 1: Rramp.HeightBottom=104
  773. Case 2: Rramp.HeightBottom=102
  774. Case 3: Rramp.HeightBottom=100
  775. Case 4: Rramp.HeightBottom=102
  776. Case 5: Rramp.HeightBottom=104
  777. Case 6: Rramp.HeightBottom=110
  778. Case 7: Rramp.HeightBottom=104
  779. Case 8: Rramp.HeightBottom=98
  780. Case 9: Rramp.HeightBottom=91
  781. Case 10: Rramp.HeightBottom=84
  782. Case 11: Rramp.HeightBottom=77
  783. Case 12: Rramp.HeightBottom=70
  784. Case 13: Rramp.HeightBottom=63
  785. Case 14: Rramp.HeightBottom=56
  786. Case 15: Rramp.HeightBottom=49
  787. Case 16: Rramp.HeightBottom=42
  788. Case 17: Rramp.HeightBottom=35
  789. Case 18: Rramp.HeightBottom=28
  790. Case 19: Rramp.HeightBottom=21
  791. Case 20: Rramp.HeightBottom=14
  792. Case 21: Rramp.HeightBottom=7
  793. Case 22: Rramp.HeightBottom=0:Controller.Switch(48)=1:RightRampUp = 0:RrampTimer.Enabled = 0
  794. If Rramppos<22 then Rramppos=Rramppos+1
  795. End Select
  796. End If
  797. End Sub
  798.  
  799. '**************
  800. 'Turntable Subs
  801. '**************
  802.  
  803. Set MotorCallback=GetRef("SRPRoutine")
  804. Dim WheelNewPos,WheelOldPos, currentdiscy, finaldiscy, accdiscy, maxacc
  805. WheelOldPos=0:currentdiscy=22.5:maxacc=0
  806.  
  807. Sub SRPRoutine
  808. FlipperLP.RotY = LeftFlipper.CurrentAngle
  809. FlipperRP.RotY = RightFlipper.CurrentAngle
  810. FlipperRUP.RotY = UpperFlipper.CurrentAngle
  811.  
  812. WheelNewPos=Controller.GetMech(0)
  813. If WheelNewPos<>WheelOldPos Then
  814. TTtimer.Enabled=1
  815. mTT.MotorOn = True
  816. End If
  817.  
  818. WheelOldPos=WheelNewPos
  819. End Sub
  820.  
  821.  
  822. Sub TTtimer_Timer
  823. finaldiscy = -(WheelNewPos * 5.625) + 22.5 + 360
  824.  
  825. accdiscy = finaldiscy - currentdiscy
  826.  
  827. If accdiscy > 180 Then
  828. accdiscy = accdiscy - 360
  829. ElseIf accdiscy < -180 Then
  830. accdiscy = accdiscy + 360
  831. End If
  832.  
  833. If ABS(accdiscy) > 0.1 Then
  834.  
  835. If accdiscy < -15 Then
  836. currentdiscy = currentdiscy + (accdiscy/20)
  837. disc.image = "NGG_Map_Mblur5"
  838. mTT.Speed=-50
  839. ElseIf accdiscy < 0 Then
  840. currentdiscy = currentdiscy + (accdiscy/100)
  841. disc.image = "NGG_Map"
  842. mTT.Speed=-10
  843. ElseIf accdiscy < 15 Then
  844. currentdiscy = currentdiscy + (accdiscy/100)
  845. disc.image = "NGG_Map"
  846. mTT.Speed=10
  847. Else
  848. currentdiscy = currentdiscy + (accdiscy/20)
  849. disc.image = "NGG_Map_Mblur5"
  850. mTT.Speed=50
  851. End If
  852.  
  853. Else
  854. mTT.MotorOn = False
  855. TTtimer.Enabled = 0
  856. End If
  857.  
  858. If currentdiscy > 382.5 Then
  859. currentdiscy = currentdiscy - 360
  860. ElseIf currentdiscy < 22.5 Then
  861. currentdiscy = currentdiscy + 360
  862. End If
  863.  
  864. disc.roty = currentdiscy
  865.  
  866. End Sub
  867.  
  868. '***************************************************
  869. ' JP's VP10 Fading Lamps & Flashers
  870. ' Based on PD's Fading Light System
  871. ' SetLamp 0 is Off
  872. ' SetLamp 1 is On
  873. ' fading for non opacity objects is 4 steps
  874. '***************************************************
  875.  
  876. Dim LampState(200), FadingLevel(200)
  877. Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
  878.  
  879. InitLamps() ' turn off the lights and flashers and reset them to the default parameters
  880. LampTimer.Interval = 10 'lamp fading speed
  881. LampTimer.Enabled = 1
  882.  
  883. ' Lamp & Flasher Timers
  884.  
  885. Sub LampTimer_Timer()
  886. Dim chgLamp, num, chg, ii
  887. chgLamp = Controller.ChangedLamps
  888. If Not IsEmpty(chgLamp) Then
  889. For ii = 0 To UBound(chgLamp)
  890. LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1) 'keep the real state in an array
  891. FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
  892. Next
  893. End If
  894. UpdateLamps
  895. End Sub
  896.  
  897.  
  898. Sub UpdateLamps
  899. NFadeL 11, L11
  900. NFadeL 12, L12
  901. NFadeL 13, L13
  902. NFadeL 14, L14
  903. NFadeL 15, L15
  904. NFadeL 16, L16
  905. NFadeL 17, L17
  906. NFadeL 18, L18
  907. NFadeL 21, L21
  908. NFadeL 22, L22
  909. NFadeL 23, L23
  910. NFadeL 24, L24
  911. NFadeL 25, L25
  912. NFadeL 26, L26
  913. NFadeL 27, L27
  914. NFadeL 28, L28
  915. NFadeL 31, L31
  916. NFadeL 32, L32
  917. NFadeL 33, L33
  918. NFadeL 34, L34
  919. NFadeL 35, L35
  920. NFadeL 36, L36
  921. NFadeL 37, L37
  922. NFadeL 38, L38
  923. NFadeL 41, L41
  924. NFadeL 42, L42
  925. NFadeL 43, L43
  926. NFadeL 44, L44
  927. NFadeL 45, L45
  928. NFadeL 46, L46
  929. NFadeL 47, L47
  930. NFadeL 48, L48
  931. NFadeL 51, L51
  932. NFadeL 52, L52
  933. NFadeL 53, L53
  934. NFadeL 54, L54
  935. NFadeLm 55, L55b
  936. NFadeL 55, L55
  937. NFadeL 56, L56
  938. NFadeL 57, L57
  939. NFadeL 58, L58
  940. NFadeL 61, L61
  941. NFadeL 62, L62
  942. NFadeL 63, L63
  943. NFadeL 64, L64
  944. NFadeL 65, L65
  945. NFadeL 66, L66
  946. NFadeL 67, L67
  947. NFadeL 68, L68
  948. NFadeLm 71, L71b
  949. NFadeL 71, L71
  950. NFadeL 72, L72
  951. NFadeL 73, L73
  952. NFadeL 74, L74
  953. NFadeL 75, L75
  954. NFadeL 76, L76
  955. NFadeL 77, L77
  956. NFadeLm 78, bump3light1
  957. NFadeL 78, bump3light
  958. NFadeL 81, L81
  959. NFadeL 82, L82
  960. NFadeL 83, L83
  961. NFadeL 84, L84
  962. NFadeL 85, L85
  963. NFadeLm 86, bump2light1
  964. NFadeL 86, bump2light
  965. NFadeLm 87, bump1light1
  966. NFadeL 87, bump1light
  967. ' FadeL 88, L88, L88a 'start button
  968. NFadeL 122, L122
  969. NFadeLm 131, L131b
  970. NFadeLm 131, L131a
  971. NFadeL 131, L131
  972. 'NFadeL 145, L145
  973. 'NFadeL 146, L146
  974. NFadeARmCombi 145, 146, upperplayfield, "upperplayfield", "upperplayfieldright", "upperplayfieldleft", "upperplayfieldboth", Combifor145and146
  975. NFadeLm 170, L170b
  976. NFadeLm 170, L170a
  977. NFadeL 170, L170
  978. NFadeLm 172, L172a
  979. NFadeLm 172, L172b
  980. NFadeL 172, L172
  981. NFadeLm 173, L173a
  982. NFadeLm 173, L173b
  983. NFadeL 173, L173
  984. NFadeLm 174, L174a
  985. NFadeLm 174, L174b
  986. NFadeL 174, L174
  987. NFadeLm 175, L175a
  988. NFadeLm 175, L175b
  989. NFadeL 175, L175
  990. NFadeLm 176, L176a
  991. NFadeLm 176, L176b
  992. NFadeL 176, L176
  993. NFadeLm 177, L177a
  994. NFadeLm 177, L177b
  995. NFadeL 177, L177
  996. NFadeLm 178, L178a
  997. NFadeLm 178, L178b
  998. NFadeL 178, L178
  999. NFadeLm 179, L179a
  1000. NFadeLm 179, L179b
  1001. NFadeL 179, L179
  1002. NFadeLm 180, L180a
  1003. NFadeLm 180, L180b
  1004. NFadeLm 180, L180c
  1005. NFadeL 180, L180
  1006. NFadeLm 190, L190b
  1007. NFadeLm 190, L190a
  1008. NFadeL 190, L190
  1009. End Sub
  1010. '
  1011. 'Sub FlasherTimer_Timer()
  1012. ' Flash 11, h11
  1013. ' Flash 12, h12
  1014. ' Flash 13, h13
  1015. ' Flash 14, h14
  1016. ' Flash 15, h15
  1017. ' Flash 16, h16
  1018. ' Flash 17, h17
  1019. ' Flash 18, h18
  1020. ' Flash 21, h21
  1021. ' Flash 22, h22
  1022. ' Flash 23, h23
  1023. ' Flash 24, h24
  1024. ' Flash 25, h25
  1025. ' Flash 26, h26
  1026. ' Flash 27, h27
  1027. ' Flash 28, h28
  1028. ' Flash 31, h31
  1029. ' Flash 32, h32
  1030. ' Flash 33, h33
  1031. ' Flash 34, h34
  1032. ' Flash 35, h35
  1033. ' Flash 36, h36
  1034. ' Flash 37, h37
  1035. ' Flash 38, h38
  1036. ' Flash 41, h41
  1037. ' Flash 42, h42
  1038. ' Flash 43, h43
  1039. ' Flash 44, h44
  1040. ' Flash 45, h45
  1041. ' Flash 46, h46
  1042. ' Flash 47, h47
  1043. ' Flash 48, h48
  1044. ' Flash 51, h51
  1045. ' Flash 52, h52
  1046. ' Flash 53, h53
  1047. ' Flash 54, h54
  1048. ' Flashm 55, h55a
  1049. ' Flash 55, h55
  1050. ' Flash 56, h56
  1051. ' Flash 57, h57
  1052. ' Flash 58, h58
  1053. ' Flash 61, h61
  1054. ' Flash 62, h62
  1055. ' Flash 63, h63
  1056. ' Flash 64, h64
  1057. ' Flash 65, h65
  1058. ' Flash 66, h66
  1059. ' Flash 68, h68
  1060. ' Flashm 71, h71a
  1061. ' Flash 71, h71
  1062. ' Flash 72, h72
  1063. ' Flash 73, h73
  1064. ' Flash 74, h74
  1065. ' Flash 75, h75
  1066. ' Flash 77, h77
  1067. ' Flash 78, h78
  1068. ' Flash 81, h81
  1069. ' Flash 82, h82
  1070. ' Flash 83, h83
  1071. ' Flash 84, h84
  1072. ' Flash 85, h85
  1073. ' Flash 86, h86
  1074. ' Flash 87, h87
  1075. ' Flashm 120, Flasher19
  1076. ' Flash 120, Flasher1
  1077. ' Flashm 121, Flasher20
  1078. ' Flash 121, Flasher2
  1079. ' Flashm 122, Flasher21
  1080. ' Flashm 122, Flasher4
  1081. ' Flash 122, Flasher3
  1082. ' Flash 123, Flasher5
  1083. ' Flashm 124, Flasher15
  1084. ' Flash 124, Flasher6
  1085. ' Flashm 125, Flasher18
  1086. ' Flash 125, Flasher7
  1087. ' Flash 126, Flasher8
  1088. ' Flash 127, Flasher9
  1089. ' Flashm 128, Flasher17
  1090. ' Flash 128, Flasher10
  1091. ' Flashm 129, Flasher16
  1092. ' Flash 129, Flasher11
  1093. ' Flash 130, Flasher12
  1094. ' Flashm 131, Flasher14
  1095. ' Flash 131, Flasher13
  1096. ' End Sub
  1097. '
  1098.  
  1099. ' div lamp subs
  1100.  
  1101. Sub InitLamps()
  1102. Dim x
  1103. For x = 0 to 200
  1104. LampState(x) = 0 ' current light state, independent of the fading level. 0 is off and 1 is on
  1105. FadingLevel(x) = 4 ' used to track the fading state
  1106. FlashSpeedUp(x) = 0.4 ' faster speed when turning on the flasher
  1107. FlashSpeedDown(x) = 0.2 ' slower speed when turning off the flasher
  1108. FlashMax(x) = 1 ' the maximum value when on, usually 1
  1109. FlashMin(x) = 0 ' the minimum value when off, usually 0
  1110. FlashLevel(x) = 0 ' the intensity of the flashers, usually from 0 to 1
  1111. Next
  1112. End Sub
  1113.  
  1114. Sub AllLampsOff
  1115. Dim x
  1116. For x = 0 to 200
  1117. SetLamp x, 0
  1118. Next
  1119. End Sub
  1120.  
  1121. Sub SetLamp(nr, value)
  1122. If value <> LampState(nr) Then
  1123. LampState(nr) = abs(value)
  1124. FadingLevel(nr) = abs(value) + 4
  1125. End If
  1126. End Sub
  1127.  
  1128. ' Lights: used for VP10 standard lights, the fading is handled by VP itself
  1129.  
  1130. Sub NFadeL(nr, object)
  1131. Select Case FadingLevel(nr)
  1132. Case 4:object.state = 0:FadingLevel(nr) = 0
  1133. Case 5:object.state = 1:FadingLevel(nr) = 1
  1134. End Select
  1135. End Sub
  1136.  
  1137. Sub NFadeLm(nr, object) ' used for multiple lights
  1138. Select Case FadingLevel(nr)
  1139. Case 4:object.state = 0
  1140. Case 5:object.state = 1
  1141. End Select
  1142. End Sub
  1143.  
  1144. 'Lights, Ramps & Primitives used as 4 step fading lights
  1145. 'a,b,c,d are the images used from on to off
  1146.  
  1147. Sub FadeObj(nr, object, a, b, c, d)
  1148. Select Case FadingLevel(nr)
  1149. Case 4:object.image = b:FadingLevel(nr) = 6 'fading to off...
  1150. Case 5:object.image = a:FadingLevel(nr) = 1 'ON
  1151. Case 6, 7.8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  1152. Case 9:object.image = c:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
  1153. Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  1154. Case 13:object.image = d:FadingLevel(nr) = 0 'Off
  1155. End Select
  1156. End Sub
  1157.  
  1158. Sub FadeObjm(nr, object, a, b, c, d)
  1159. Select Case FadingLevel(nr)
  1160. Case 4:object.image = b
  1161. Case 5:object.image = a
  1162. Case 9:object.image = c
  1163. Case 13:object.image = d
  1164. End Select
  1165. End Sub
  1166.  
  1167. Sub NFadeObj(nr, object, a, b)
  1168. Select Case FadingLevel(nr)
  1169. Case 4:object.image = b:FadingLevel(nr) = 0 'off
  1170. Case 5:object.image = a:FadingLevel(nr) = 1 'on
  1171. End Select
  1172. End Sub
  1173.  
  1174. Sub NFadeObjm(nr, object, a, b)
  1175. Select Case FadingLevel(nr)
  1176. Case 4:object.image = b
  1177. Case 5:object.image = a
  1178. End Select
  1179. End Sub
  1180.  
  1181. ' Flasher objects
  1182.  
  1183. Sub Flash(nr, object)
  1184. Select Case FadingLevel(nr)
  1185. Case 4 'off
  1186. FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
  1187. If FlashLevel(nr) < FlashMin(nr) Then
  1188. FlashLevel(nr) = FlashMin(nr)
  1189. FadingLevel(nr) = 0 'completely off
  1190. End if
  1191. Object.IntensityScale = FlashLevel(nr)
  1192. Case 5 ' on
  1193. FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
  1194. If FlashLevel(nr) > FlashMax(nr) Then
  1195. FlashLevel(nr) = FlashMax(nr)
  1196. FadingLevel(nr) = 1 'completely on
  1197. End if
  1198. Object.IntensityScale = FlashLevel(nr)
  1199. End Select
  1200. End Sub
  1201.  
  1202. Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
  1203. Object.IntensityScale = FlashLevel(nr)
  1204. End Sub
  1205.  
  1206. ' Desktop Objects: Reels & texts (you may also use lights on the desktop)
  1207.  
  1208. ' Reels
  1209. Dim NewCombiResult, Combifor145and146
  1210. Sub NFadeARmCombi(nr1, nr2, ramp, aOff, a1, a2, aBoth, OldCombiResult)
  1211. NewCombiResult=LampState(nr1)+(2*LampState(nr2))
  1212. If OldCombiResult=NewCombiResult Then Exit Sub
  1213. Select Case NewCombiResult
  1214. Case 0:ramp.image=aOff
  1215. Case 1:ramp.image=a1
  1216. Case 2:ramp.image=a2
  1217. Case 3:ramp.image=aBoth
  1218. End Select
  1219. OldCombiResult=NewCombiResult
  1220. End Sub
  1221.  
  1222. Sub FadeR(nr, object)
  1223. Select Case FadingLevel(nr)
  1224. Case 4:object.SetValue 1:FadingLevel(nr) = 6 'fading to off...
  1225. Case 5:object.SetValue 0:FadingLevel(nr) = 1 'ON
  1226. Case 6, 7.8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  1227. Case 9:object.SetValue 2:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
  1228. Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  1229. Case 13:object.SetValue 3:FadingLevel(nr) = 0 'Off
  1230. End Select
  1231. End Sub
  1232.  
  1233. Sub FadeRm(nr, object)
  1234. Select Case FadingLevel(nr)
  1235. Case 4:object.SetValue 1
  1236. Case 5:object.SetValue 0
  1237. Case 9:object.SetValue 2
  1238. Case 3:object.SetValue 3
  1239. End Select
  1240. End Sub
  1241.  
  1242. 'Texts
  1243.  
  1244. Sub NFadeT(nr, object, message)
  1245. Select Case FadingLevel(nr)
  1246. Case 4:object.Text = "":FadingLevel(nr) = 0
  1247. Case 5:object.Text = message:FadingLevel(nr) = 1
  1248. End Select
  1249. End Sub
  1250.  
  1251. Sub NFadeTm(nr, object, b)
  1252. Select Case FadingLevel(nr)
  1253. Case 4:object.Text = ""
  1254. Case 5:object.Text = message
  1255. End Select
  1256. End Sub
  1257.  
  1258. '***********
  1259. ' Update GI
  1260. '***********
  1261. Dim gistep, Giswitch
  1262. Giswitch = 0
  1263.  
  1264. Sub UpdateGIOn(no, Enabled)
  1265. Select Case no
  1266. Case 0 'GIright
  1267. If Enabled Then
  1268. For each xx in GIright:xx.State = 1: Next
  1269. Else
  1270. For each xx in GIright:xx.state = 0: Next
  1271. End If
  1272. Case 1
  1273. If Enabled Then
  1274. For Each xx in GIleft:xx.state = 1: Next
  1275. else
  1276. For Each xx in GIleft:xx.state = 0: Next
  1277. End If
  1278. Case 2
  1279. If Enabled Then
  1280. For Each xx in GIother:xx.state = 1: Next
  1281. Else
  1282. For Each xx in GIother:xx.state = 0: Next
  1283. End If
  1284. End Select
  1285. End Sub
  1286.  
  1287.  
  1288. Sub UpdateGI(no, step)
  1289. Dim ii
  1290. If step = 0 then exit sub 'only values from 1 to 8 are visible and reliable. 0 is not reliable and 7 & 8 are the same so...
  1291. gistep = (step-1) / 7
  1292. Select Case no
  1293. Case 0
  1294. For each ii in GIleft
  1295. ii.IntensityScale = gistep
  1296. Next
  1297. Case 1
  1298. For each ii in GIright
  1299. ii.IntensityScale = gistep
  1300. Next
  1301. Case 2 ' also the bumpers er GI
  1302. For each ii in GIother
  1303. ii.IntensityScale = gistep
  1304. Next
  1305. Select case gistep
  1306. Case 0
  1307. GolfCart.image = "GolfCartMap"
  1308. Case 1
  1309. GolfCart.image = "GolfCartMap_ON1"
  1310. Case 2
  1311. GolfCart.image = "GolfCartMap_ON1"
  1312. Case 3
  1313. GolfCart.image = "GolfCartMap_ON2"
  1314. Case 4
  1315. GolfCart.image = "GolfCartMap_ON3"
  1316. Case 5
  1317. GolfCart.image = "GolfCartMap_ON4"
  1318. Case 6
  1319. GolfCart.image = "GolfCartMap_ON4"
  1320. Case 7
  1321. GolfCart.image = "GolfCartMap_ON5"
  1322. End Select
  1323. End Select
  1324. ' ' change the intensity of the flasher depending on the gi to compensate for the gi lights being off
  1325. ' For ii = 0 to 200
  1326. ' FlashMax(ii) = 6 - gistep * 3 ' the maximum value of the flashers
  1327. ' Next
  1328. End Sub
  1329.  
  1330.  
  1331. '''Ramp Helpers
  1332.  
  1333. 'Sub centerramphelper_Hit():ActiveBall.Vely=ActiveBall.Vely*1.3:End Sub
  1334. 'Sub centerramphelper2_Hit():Activeball.Velx=ActiveBall.Velx-20:End Sub
  1335. 'Sub upperhelper_Hit():ActiveBall.Velx=ActiveBall.Velx*1.2:End Sub
  1336. 'Sub upperhelper2_Hit():ActiveBall.Vely=ActiveBall.Vely*1.3:End Sub
  1337. 'Sub jumpramptrigger_Hit():ActiveBall.Vely=ActiveBall.Vely*1.3:End Sub
  1338. 'Sub upperjump_Hit():ActiveBall.Vely=ActiveBall.Vely*1.5:End Sub
  1339. 'Sub upperjump_UnHit():ActiveBall.Velz=ActiveBall.Velz=0:End Sub
  1340.  
  1341.  
  1342. Sub Game_timer()
  1343. slamrampP.z = Flipper1.CurrentAngle
  1344. If RightRampUp = 0 Then RrampTimer.Enabled = 1
  1345. If LeftRampUp = 0 Then LRampTimer.Enabled = 1
  1346. End Sub
  1347.  
  1348.  
  1349.  
  1350. ' *********************************************************************
  1351. ' Supporting Ball & Sound Functions
  1352. ' *********************************************************************
  1353.  
  1354. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  1355. Vol = Csng(BallVel(ball) ^2 / 500)
  1356. End Function
  1357.  
  1358. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table" is the name of the table
  1359. Dim tmp
  1360. tmp = ball.x * 2 / table.width-1
  1361. If tmp > 0 Then
  1362. Pan = Csng(tmp ^10)
  1363. Else
  1364. Pan = Csng(-((- tmp) ^10) )
  1365. End If
  1366. End Function
  1367.  
  1368. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1369. Pitch = BallVel(ball) * 20
  1370. End Function
  1371.  
  1372. Function BallVel(ball) 'Calculates the ball speed
  1373. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  1374. End Function
  1375.  
  1376. '*****************************************
  1377. ' JP's VP10 Rolling Sounds
  1378. '*****************************************
  1379.  
  1380. Const tnob = 8 ' total number of balls in this table is 4, but always use a higher number here bacuse of the timing
  1381. ReDim rolling(tnob)
  1382. InitRolling
  1383.  
  1384. Sub InitRolling
  1385. Dim i
  1386. For i = 0 to tnob
  1387. rolling(i) = False
  1388. Next
  1389. End Sub
  1390.  
  1391. Sub RollingTimer_Timer()
  1392. Dim BOT, b
  1393. BOT = GetBalls
  1394.  
  1395. ' stop the sound of deleted balls
  1396. For b = UBound(BOT) + 1 to tnob
  1397. rolling(b) = False
  1398. StopSound("fx_ballrolling" & b)
  1399. Next
  1400.  
  1401. ' exit the sub if no balls on the table
  1402. If UBound(BOT) = -1 Then Exit Sub
  1403.  
  1404. ' play the rolling sound for each ball
  1405. For b = 0 to UBound(BOT)
  1406. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  1407. rolling(b) = True
  1408. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  1409. Else
  1410. If rolling(b) = True Then
  1411. StopSound("fx_ballrolling" & b)
  1412. rolling(b) = False
  1413. End If
  1414. End If
  1415. Next
  1416. End Sub
  1417.  
  1418. '**********************
  1419. ' Ball Collision Sound
  1420. '**********************
  1421.  
  1422. Sub OnBallBallCollision(ball1, ball2, velocity)
  1423. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 1000, Pan(ball1), 0, Pitch(ball1), 0, 0
  1424. End Sub
  1425.  
  1426. Sub platformdrop_Unhit()
  1427. If ActiveBall.Vely>0 then PlaySound "ball_bounce"
  1428. End Sub
  1429.  
  1430. Sub rightrampdrop_UnHit():PlaySound "ball_bounce":End Sub
  1431. Sub leftrampdrop_UnHit():PlaySound "ball_bounce":End Sub
  1432.  
  1433. Sub jumpramptrigger_Hit():PlaySound "metalhit_medium":End Sub
  1434.  
  1435. Sub Pins_Hit (idx)
  1436. PlaySound "pinhit_low", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  1437. End Sub
  1438.  
  1439. Sub Targets_Hit (idx)
  1440. PlaySound "target", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  1441. End Sub
  1442.  
  1443. Sub Metals_Thin_Hit (idx)
  1444. PlaySound "metalhit_thin", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1445. End Sub
  1446.  
  1447. Sub Metals_Medium_Hit (idx)
  1448. PlaySound "metalhit_medium", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1449. End Sub
  1450.  
  1451. Sub Metals2_Hit (idx)
  1452. PlaySound "metalhit2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1453. End Sub
  1454.  
  1455. Sub Gates_Hit (idx)
  1456. PlaySound "gate4", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1457. End Sub
  1458.  
  1459. Sub Rubbers_Hit(idx)
  1460. dim finalspeed
  1461. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1462. If finalspeed > 20 then
  1463. PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1464. End if
  1465. If finalspeed >= 6 AND finalspeed <= 20 then
  1466. RandomSoundRubber()
  1467. End If
  1468. End Sub
  1469.  
  1470. Sub Posts_Hit(idx)
  1471. dim finalspeed
  1472. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1473. If finalspeed > 16 then
  1474. PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1475. End if
  1476. If finalspeed >= 6 AND finalspeed <= 16 then
  1477. RandomSoundRubber()
  1478. End If
  1479. End Sub
  1480.  
  1481. Sub RandomSoundRubber()
  1482. Select Case Int(Rnd*3)+1
  1483. Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1484. Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1485. Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1486. End Select
  1487. End Sub
  1488.  
  1489. Sub LeftFlipper_Collide(parm)
  1490. RandomSoundFlipper()
  1491. End Sub
  1492.  
  1493. Sub RightFlipper_Collide(parm)
  1494. RandomSoundFlipper()
  1495. End Sub
  1496.  
  1497. Sub UpperFlipper_Collide(parm)
  1498. RandomSoundFlipper()
  1499. End Sub
  1500.  
  1501. Sub RandomSoundFlipper()
  1502. Select Case Int(Rnd*3)+1
  1503. Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1504. Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1505. Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1506. End Select
  1507. End Sub
  1508.  
  1509. Sub upperjump_UnHit():ActiveBall.Velz=ActiveBall.Velz=0:End Sub
Advertisement
Add Comment
Please, Sign In to add comment