Advertisement
Arngrim

flight 2000 fix

Apr 12th, 2017
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.70 KB | None | 0 0
  1. 'Flight 2000 (Stern 1980) for VPX by bord
  2. 'lock script courtesy of JP Salas
  3.  
  4. Option Explicit
  5. Randomize
  6.  
  7. Const cGameName = "flight2k"
  8.  
  9. On Error Resume Next
  10. ExecuteGlobal GetTextFile("controller.vbs")
  11. If Err Then MsgBox "Can't open controller.vbs"
  12. On Error Goto 0
  13.  
  14. LoadVPM "01550000", "stern.VBS", 3.26
  15.  
  16. Dim DesktopMode: DesktopMode = table1.ShowDT
  17.  
  18. '************************************************
  19. '************************************************
  20. '************************************************
  21. '************************************************
  22. '************************************************
  23. Const UseSolenoids = True
  24. Const UseLamps = True
  25. Const UseGI = False
  26. Const UseSync = False
  27.  
  28. ' Standard Sounds
  29. Const SSolenoidOn = "fx_solenoid"
  30. Const SSolenoidOff = "fx_solenoidoff"
  31. Const SCoin = "fx_coin"
  32.  
  33. Dim bsTrough, dtL, dtR, bump1, bump2, plLane1, plLane2, hiddenvalue
  34.  
  35. If DesktopMode = True Then 'Show Desktop components
  36. CabinetRailLeft.visible=1
  37. CabinetRailRight.visible=1
  38. hiddenvalue=0
  39. Else
  40. CabinetRailLeft.visible=0
  41. CabinetRailRight.visible=0
  42. hiddenvalue=1
  43. End if
  44.  
  45. Sub SolLFlipper(Enabled)
  46. If Enabled Then
  47. PlaySound SoundFX("fx_flipperup",DOFFlippers), 0, 1, -0.1, 0.25
  48. LeftFlipper.RotateToEnd
  49. Else
  50. PlaySound SoundFX("fx_flipperdown",DOFFlippers), 0, 1, -0.1, 0.25
  51. LeftFlipper.RotateToStart
  52. End If
  53. End Sub
  54.  
  55. Sub SolRFlipper(Enabled)
  56. If Enabled Then
  57. PlaySound SoundFX("fx_flipperup",DOFFlippers), 0, 1, 0.1, 0.25
  58. RightFlipper.RotateToEnd
  59. Else
  60. PlaySound SoundFX("fx_flipperdown",DOFFlippers), 0, 1, 0.1, 0.25
  61. RightFlipper.RotateToStart
  62. End If
  63. End Sub
  64.  
  65. Sub FlipperTimer_Timer
  66. 'Add flipper, gate and spinner rotations here
  67. LFLogo1.RotY = LeftFlipper.CurrentAngle
  68. RFLogo1.RotY = RightFlipper.CurrentAngle
  69. End Sub
  70.  
  71. Sub Table1_Init
  72. With Controller
  73. .GameName = cGameName
  74. If Err Then MsgBox "Can't start Game " & cGameName & vbNewLine & Err.Description:Exit Sub
  75. .SplashInfoLine = "Flight 2000 (Stern 1980)"&chr(13)&"by bord"
  76. .HandleKeyboard = 0
  77. .ShowTitle = 0
  78. .ShowDMDOnly = 1
  79. .ShowFrame = 0
  80. .HandleMechanics = False
  81. .Hidden = hiddenvalue
  82. On Error Resume Next
  83. .Run GetPlayerHWnd
  84. If Err Then MsgBox Err.Description
  85. On Error Goto 0
  86. End With
  87.  
  88. PinMAMETimer.Interval = PinMAMEInterval
  89. PinMAMETimer.Enabled = 1
  90.  
  91.  
  92. '************************************************
  93. ' Solenoids
  94. '************************************************
  95.  
  96. 'SolCallback(1)
  97. 'SolCallback(2)
  98. 'SolCallback(3)
  99. 'SolCallback(4)
  100. 'SolCallback(5)
  101. 'SolCallback(6)
  102. SolCallback(7) = "SolLeftTargetReset"
  103. SolCallback(8) = "dtL.SolunHit 5,"
  104. SolCallback(9) = "SolBallLock"
  105. SolCallback(10) = "bsTrough.SolOut"
  106. SolCallback(11) = "dtL.SolUnHit 4,"
  107. SolCallback(12) = "dtL.SolUnHit 3,"
  108. SolCallback(13) = "dtL.SolUnHit 1,"
  109. SolCallback(14) = "dtL.SolUnHit 2,"
  110. SolCallback(15) = "SolRightTargetReset"
  111. 'SolCallback(16)
  112. SolCallback(17) = "SolLane2"
  113. 'SolCallback(18)
  114. 'SolCallback(19)
  115. SolCallback(20) = "SolLane1"
  116.  
  117. SolCallback(sLRFlipper) = "SolRFlipper"
  118. SolCallback(sLLFlipper) = "SolLFlipper"
  119.  
  120. 'Trough
  121. Set bsTrough=New cvpmBallStack
  122. with bsTrough
  123. .InitSw 0,33,34,35,0,0,0,0
  124. .InitKick BallRelease,90,7
  125. .InitExitSnd Soundfx("fx_ballrel",DOFContactors), Soundfx("fx_solenoid",DOFContactors)
  126. .IsTrough = 1
  127. .Balls=3
  128. end with
  129.  
  130. ' Lane1 Impulse Plunger (by JP Salas)
  131. Const IMPowerSetting = 36 'Plunger Power
  132. Const IMTime = 0.6 ' Time in seconds for Full Plunge
  133. Set plLane1 = New cvpmImpulseP
  134. With plLane1
  135. .InitImpulseP sw15, IMPowerSetting, IMTime
  136. .Random 0.3
  137. .switch 15
  138. .InitExitSnd SoundFX("fx_popper", DOFContactors), SoundFX("fx_popper", DOFContactors)
  139. .CreateEvents "plLane1"
  140. End With
  141.  
  142. ' Lane2 Impulse Plunger (by JP Salas)
  143. Const IMPowerSetting2 = 40 'Plunger Power
  144. Const IMTime2 = 0.6 ' Time in seconds for Full Plunge
  145. Set plLane2 = New cvpmImpulseP
  146. With plLane2
  147. .InitImpulseP sw16, IMPowerSetting2, IMTime2
  148. .Random 0.3
  149. .switch 16
  150. .InitExitSnd SoundFX("fx_popper", DOFContactors), SoundFX("fx_popper", DOFContactors)
  151. .CreateEvents "plLane2"
  152. End With
  153.  
  154. ' Nudging
  155. vpmNudge.TiltSwitch = 7
  156. vpmNudge.Sensitivity = 3
  157. vpmNudge.TiltObj = Array(leftslingshot1, leftslingshot2, rightslingshot1, sw13, sw14)
  158.  
  159. Set dtL=New cvpmDropTarget
  160. dtL.InitDrop Array(sw28,sw29,sw30,sw31,sw32),Array(28,29,30,31,32)
  161. dtL.InitSnd SoundFX("fx2_droptarget",DOFTargets),SoundFX("fx2_DTReset",DOFContactors)
  162.  
  163. Set dtR=New cvpmDropTarget
  164. dtR.InitDrop Array(sw25,sw26,sw27),Array(25,26,27)
  165. dtR.InitSnd SoundFX("fx2_droptarget2",DOFTargets),SoundFX("fx2_DTReset",DOFContactors)
  166.  
  167.  
  168. '*****Drop Lights Off
  169. dim xx
  170.  
  171. For each xx in DTLeftLights: xx.state=0:Next
  172. For each xx in DTRightLights: xx.state=0:Next
  173.  
  174. GILights 1
  175.  
  176. End Sub
  177.  
  178. Sub GILights (enabled)
  179. Dim light
  180. For each light in GI:light.State = Enabled: Next
  181. End Sub
  182.  
  183. Sub Table1_KeyDown(ByVal keycode)
  184. If keycode = LeftTiltKey Then Nudge 90, 2
  185. If keycode = RightTiltKey Then Nudge 270, 2
  186. If keycode = CenterTiltKey Then Nudge 0, 2
  187.  
  188. If vpmKeyDown(keycode) Then Exit Sub
  189. If keycode = PlungerKey Then Plunger.PullBack: PlaySound "fx_plungerpull",0,1,0.25,0.25: End If
  190. End Sub
  191.  
  192. Sub Table1_KeyUp(ByVal keycode)
  193. If keycode = PlungerKey Then Plunger.Fire: PlaySound "fx_plunger",0,1,0.25,0.25
  194. If vpmKeyUp(keycode) Then Exit Sub
  195. End Sub
  196.  
  197. Sub ShooterLane_Hit
  198. End Sub
  199.  
  200. Sub BallRelease_UnHit
  201. End Sub
  202.  
  203. Sub Drain_Hit()
  204. PlaySound "fx2_drain2",0,1,0,0.25 : bstrough.addball me
  205. End Sub
  206.  
  207. '*****************
  208. ' Lock Script Courtesy of JP Salas
  209. '*****************
  210.  
  211. Sub lock3_Hit:Playsound "fx_sensor":Controller.Switch(39) = 1:End Sub
  212.  
  213. Sub SolBallLock(Enabled)
  214. If Enabled Then
  215. Controller.Switch(39) = 0
  216. lock1a.IsDropped = 1:lock2a.IsDropped = 1:lock3a.IsDropped = 1
  217. PlaySound SoundFX("fx_popper",DOFContactors)
  218. lock1.kick 180, 4:lock2.kick 180, 4:lock3.kick 180, 4
  219. Else
  220. lock1a.IsDropped = 0:lock2a.IsDropped = 0:lock3a.IsDropped = 0
  221. End If
  222. End Sub
  223.  
  224. 'Drop Targets
  225. Sub sw28_Dropped:dtL.Hit 1 : End Sub
  226. Sub Sw29_Dropped:dtL.Hit 2 : End Sub
  227. Sub Sw30_Dropped:dtL.Hit 3 : End Sub
  228. Sub Sw31_Dropped:dtL.Hit 4 : GI_Ldrop1.state=1 : End Sub
  229. Sub Sw32_Dropped:dtL.Hit 5 : GI_Ldrop2.state=1 : End Sub
  230.  
  231. Sub Sw25_Dropped:dtR.Hit 1 : GI_Rdrop1_1.state=1 : GI_Rdrop2_1.state=1 : End Sub
  232. Sub Sw26_Dropped:dtR.Hit 2 : GI_Rdrop1_2.state=1 : GI_Rdrop2_2.state=1 : End Sub
  233. Sub Sw27_Dropped:dtR.Hit 3 : GI_Rdrop2_3.state=1 : End Sub
  234.  
  235. Sub SolRightTargetReset(enabled)
  236. dim xx
  237. if enabled then
  238. dtR.SolDropUp enabled
  239. For each xx in DTRightLights: xx.state=0:Next
  240. end if
  241. End Sub
  242.  
  243. Sub SolLeftTargetReset(enabled)
  244. dim xx
  245. if enabled then
  246. dtL.SolDropUp enabled
  247. For each xx in DTLeftLights: xx.state=0:Next
  248. end if
  249. End Sub
  250.  
  251. 'Bumpers
  252.  
  253. Sub sw13_Hit : vpmTimer.PulseSw 13 : playsound SoundFX("fx2_bumper_1",DOFContactors): End Sub
  254. Sub sw14_Hit : vpmTimer.PulseSw 14 : playsound SoundFX("fx2_bumper_1",DOFContactors): End Sub
  255.  
  256. 'Wire Triggers
  257. Sub SW36_Hit:Controller.Switch(36)=1 : End Sub
  258. Sub SW36_unHit:Controller.Switch(36)=0:End Sub
  259. Sub SW17_Hit:Controller.Switch(17)=1 : DOF 101, DOFOn : End Sub
  260. Sub SW17_unHit:Controller.Switch(17)=0: DOF 101, DOFOff : End Sub
  261. Sub SW24_Hit:Controller.Switch(24)=1 : End Sub
  262. Sub SW24_unHit:Controller.Switch(24)=0:End Sub
  263. Sub SW23_Hit:Controller.Switch(23)=1 : End Sub
  264. Sub SW23_unHit:Controller.Switch(23)=0:End Sub
  265. Sub SW22_Hit:Controller.Switch(22)=1 : End Sub
  266. Sub SW22_unHit:Controller.Switch(22)=0:End Sub
  267. Sub SW37_Hit:Controller.Switch(37)=1 : End Sub
  268. Sub SW37_unHit:Controller.Switch(37)=0:End Sub
  269. Sub SW40_Hit:Controller.Switch(40)=1 : End Sub
  270. Sub SW40_unHit:Controller.Switch(40)=0:End Sub
  271. Sub SW18_Hit:Controller.Switch(18)=1 : End Sub
  272. Sub SW18_unHit:Controller.Switch(18)=0:End Sub
  273. Sub SW19_Hit:Controller.Switch(19)=1 : End Sub
  274. Sub SW19_unHit:Controller.Switch(19)=0:End Sub
  275. Sub SW20_Hit:Controller.Switch(20)=1 : End Sub
  276. Sub SW20_unHit:Controller.Switch(20)=0:End Sub
  277. Sub SW21_Hit:Controller.Switch(21)=1 : End Sub
  278. Sub SW21_unHit:Controller.Switch(21)=0:End Sub
  279.  
  280. 'Targets
  281. Sub sw17a_Hit:vpmTimer.PulseSw (17):DOF 102, DOFPulse:End Sub
  282. Sub sw17c_Hit:vpmTimer.PulseSw (17):DOF 103, 103, DOFPulse:End Sub
  283. Sub sw38_Hit:vpmTimer.PulseSw (38):End Sub
  284.  
  285.  
  286. 'Spinners
  287. Sub sw4_Spin : vpmTimer.PulseSw (4) :PlaySound "fx_spinner": End Sub
  288. Sub sw5_Spin : vpmTimer.PulseSw (5) :PlaySound "fx_spinner": End Sub
  289.  
  290. Sub SolKnocker(Enabled)
  291. If Enabled Then PlaySound SoundFX("Knocker",DOFKnocker)
  292. End Sub
  293.  
  294. '**********Sling Shot Animations
  295. ' Rstep and Lstep are the variables that increment the animation
  296. '****************
  297. Dim RStep1, RStep2, LStep1, RRStep, LUStep, LURStep, RLStep, RLaStep, RLa2Step, R2DropStep, RRRTStep, RRRUStep, RRRLStep
  298.  
  299. Sub RightSlingShot1_Slingshot
  300. PlaySound SoundFX("fx_slingshot",DOFContactors), 0, 1, 0.05, 0.05
  301. vpmtimer.PulseSw(12)
  302. RSling.Visible = 0
  303. RSling1.Visible = 1
  304. sling1.TransZ = -30
  305. RStep1 = 0
  306. RightSlingShot1.TimerEnabled = 1
  307. End Sub
  308.  
  309. Sub RightSlingShot1_Timer
  310. Select Case RStep1
  311. Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -10
  312. Case 4:RSLing2.Visible = 0:RSLing3.Visible = 1:sling1.TransZ = 0
  313. Case 5:RSLing3.Visible = 0:RSLing.Visible = 1:RightSlingShot1.TimerEnabled = 0
  314. End Select
  315. RStep1 = RStep1 + 1
  316. End Sub
  317.  
  318. Sub RightSlingShot2_Slingshot
  319. PlaySound SoundFX("fx_slingshot",DOFContactors), 0, 1, 0.05, 0.05
  320. vpmtimer.PulseSw(10)
  321. RUSling.Visible = 0
  322. RUSling1.Visible = 1
  323. sling4.TransZ = -30
  324. RStep2 = 0
  325. RightSlingShot2.TimerEnabled = 1
  326. End Sub
  327.  
  328. Sub RightSlingShot2_Timer
  329. Select Case RStep2
  330. Case 3:RUSLing1.Visible = 0:RUSLing2.Visible = 1:sling4.TransZ = -10
  331. Case 4:RUSLing2.Visible = 0:RUSLing3.Visible = 1:sling4.TransZ = 0
  332. Case 5:RUSLing3.Visible = 0:RUSLing.Visible = 1:RightSlingShot2.TimerEnabled = 0
  333. End Select
  334. RStep2 = RStep2 + 1
  335. End Sub
  336.  
  337. Sub RRubberSlingShot_hit
  338. RRubber.Visible = 0
  339. RRubber1.Visible = 1
  340. RRStep = 0
  341. RRubberSlingShot.TimerEnabled = 1
  342. End Sub
  343.  
  344. Sub RRubberSlingShot_Timer
  345. Select Case RRStep
  346. Case 3:RRubber1.Visible = 0:RRubber2.Visible = 1
  347. Case 4:RRubber2.Visible = 0:RRubber.Visible = 1:RRubberSlingShot.TimerEnabled = 0
  348. End Select
  349. RRStep = RRStep + 1
  350. End Sub
  351.  
  352. Sub LeftSlingShot1_Slingshot
  353. PlaySound SoundFX("fx_slingshot",DOFContactors), 0, 1, 0.05, 0.05
  354. vpmtimer.PulseSw(11)
  355. LSling.Visible = 0
  356. LSling1.Visible = 1
  357. sling2.TransZ = -36
  358. LStep1 = 0
  359. LeftSlingShot1.TimerEnabled = 1
  360. End Sub
  361.  
  362. Sub LeftSlingShot1_Timer
  363. Select Case LStep1
  364. Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -10
  365. Case 4:LSLing2.Visible = 0:LSLing3.Visible = 1:sling2.TransZ = 0
  366. Case 5:LSLing3.Visible = 0:LSLing.Visible = 1:LeftSlingShot1.TimerEnabled = 0
  367. End Select
  368. LStep1 = LStep1 + 1
  369. End Sub
  370.  
  371. Sub LeftSlingShot2_Slingshot
  372. PlaySound SoundFX("fx_slingshot",DOFContactors), 0, 1, 0.05, 0.05
  373. vpmtimer.PulseSw(9)
  374. LUSling.Visible = 0
  375. LUSling1.Visible = 1
  376. sling3.TransZ = -38
  377. LUStep = 0
  378. LeftSlingShot2.TimerEnabled = 1
  379. End Sub
  380.  
  381. Sub LeftSlingShot2_Timer
  382. Select Case LUStep
  383. Case 3:LUSLing1.Visible = 0:LUSLing2.Visible = 1:sling3.TransZ = -10
  384. Case 4:LUSLing2.Visible = 0:LUSLing3.Visible = 1:sling3.TransZ = 0
  385. Case 5:LUSLing3.Visible = 0:LUSLing.Visible = 1:LeftSlingShot2.TimerEnabled = 0
  386. End Select
  387. LUStep = LUStep + 1
  388. End Sub
  389.  
  390. Sub LURubberSling_hit
  391. LUSling.Visible = 0
  392. LUSling4.Visible = 1
  393. LURStep = 0
  394. LURubberSling.TimerEnabled = 1
  395. End Sub
  396.  
  397. Sub LURubberSling_Timer
  398. Select Case LURstep
  399. Case 3:LUSling4.Visible = 0:LUSling5.Visible = 1
  400. Case 4:LUSling5.Visible = 0:LUSling.Visible = 1:LURubberSling.TimerEnabled = 0
  401. End Select
  402. LURStep = LURStep + 1
  403. End Sub
  404.  
  405. Sub RubberLSling_hit
  406. RubberL.Visible = 0
  407. RubberL1.Visible = 1
  408. RLStep = 0
  409. RubberLSling.TimerEnabled = 1
  410. End Sub
  411.  
  412. Sub RubberLSling_Timer
  413. Select Case RLstep
  414. Case 3:RubberL1.Visible = 0:RubberL2.Visible = 1
  415. Case 4:RubberL2.Visible = 0:RubberL.Visible = 1:RubberLSling.TimerEnabled = 0
  416. End Select
  417. RLStep = RLStep + 1
  418. End Sub
  419.  
  420. Sub RubberLaSling_hit
  421. RubberLa.Visible = 0
  422. RubberLa1.Visible = 1
  423. RLaStep = 0
  424. RubberLaSling.TimerEnabled = 1
  425. End Sub
  426.  
  427. Sub RubberLaSling_Timer
  428. Select Case RLastep
  429. Case 3:RubberLa1.Visible = 0:RubberLa2.Visible = 1
  430. Case 4:RubberLa2.Visible = 0:RubberLa.Visible = 1:RubberLaSling.TimerEnabled = 0
  431. End Select
  432. RLaStep = RLaStep + 1
  433. End Sub
  434.  
  435. Sub RubberLaSling1_hit
  436. RubberLa.Visible = 0
  437. RubberLa3.Visible = 1
  438. RLa2Step = 0
  439. RubberLaSling1.TimerEnabled = 1
  440. End Sub
  441.  
  442. Sub RubberLaSling1_Timer
  443. Select Case RLa2step
  444. Case 3:RubberLa3.Visible = 0:RubberLa4.Visible = 1
  445. Case 4:RubberLa4.Visible = 0:RubberLa.Visible = 1:RubberLaSling1.TimerEnabled = 0
  446. End Select
  447. RLa2Step = RLa2Step + 1
  448. End Sub
  449.  
  450. Sub Rubber2DropSling_hit
  451. Rubber2Drop.Visible = 0
  452. Rubber2Drop1.Visible = 1
  453. R2DropStep = 0
  454. Rubber2DropSling.TimerEnabled = 1
  455. End Sub
  456.  
  457. Sub Rubber2DropSling_Timer
  458. Select Case R2Dropstep
  459. Case 3:Rubber2Drop1.Visible = 0:Rubber2Drop2.Visible = 1
  460. Case 4:Rubber2Drop2.Visible = 0:Rubber2Drop3.Visible = 1
  461. Case 5:Rubber2Drop3.Visible = 0:Rubber2Drop.Visible = 1:Rubber2DropSling.TimerEnabled = 0
  462. End Select
  463. R2DropStep = R2DropStep + 1
  464. End Sub
  465.  
  466. Sub RRRTSling_hit
  467. RRRubber.Visible = 0
  468. RRRubber1.Visible = 1
  469. RRRTStep = 0
  470. RRRTSling.TimerEnabled = 1
  471. End Sub
  472.  
  473. Sub RRRTSling_Timer
  474. Select Case RRRTstep
  475. Case 3:RRRubber1.Visible = 0:RRRubber2.Visible = 1
  476. Case 4:RRRubber2.Visible = 0:RRRubber.Visible = 1:RRRTSling.TimerEnabled = 0
  477. End Select
  478. RRRTStep = RRRTStep + 1
  479. End Sub
  480.  
  481. Sub RRRUSling_hit
  482. RRRubber.Visible = 0
  483. RRRubber3.Visible = 1
  484. RRRUStep = 0
  485. RRRUSling.TimerEnabled = 1
  486. End Sub
  487.  
  488. Sub RRRUSling_Timer
  489. Select Case RRRUstep
  490. Case 3:RRRubber3.Visible = 0:RRRubber4.Visible = 1
  491. Case 4:RRRubber4.Visible = 0:RRRubber.Visible = 1:RRRUSling.TimerEnabled = 0
  492. End Select
  493. RRRUStep = RRRUStep + 1
  494. End Sub
  495.  
  496. Sub RRRLSling_hit
  497. RRRubber.Visible = 0
  498. RRRubber5.Visible = 1
  499. RRRLStep = 0
  500. RRRLSling.TimerEnabled = 1
  501. End Sub
  502.  
  503. Sub RRRLSling_Timer
  504. Select Case RRRLstep
  505. Case 3:RRRubber5.Visible = 0:RRRubber6.Visible = 1
  506. Case 4:RRRubber6.Visible = 0:RRRubber.Visible = 1:RRRLSling.TimerEnabled = 0
  507. End Select
  508. RRRLStep = RRRLStep + 1
  509. End Sub
  510.  
  511. 'Kicker Animations (by JP Salas)
  512. Dim sw15Step, sw16Step
  513.  
  514. Sub SolLane1(Enabled)
  515. If Enabled Then
  516. plLane1.AutoFire
  517. sw15Step = 0
  518. Remk2.RotX = 26
  519. sw15t.TimerEnabled = 1
  520. End If
  521. End Sub
  522.  
  523. Sub sw15t_Timer
  524. Select Case sw15Step
  525. Case 1:Remk2.RotX = 14
  526. Case 2:Remk2.RotX = 2
  527. Case 3:Remk2.RotX = -10:sw15t.TimerEnabled = 0
  528. End Select
  529.  
  530. sw15Step = sw15Step + 1
  531. End Sub
  532.  
  533. Sub SolLane2(Enabled)
  534. If Enabled Then
  535. plLane2.AutoFire
  536. sw16Step = 0
  537. Remk1.RotX = 26
  538. sw16t.TimerEnabled = 1
  539. End If
  540. End Sub
  541.  
  542. Sub sw16t_Timer
  543. Select Case sw16Step
  544. Case 1:Remk1.RotX = 14
  545. Case 2:Remk1.RotX = 2
  546. Case 3:Remk1.RotX = -10:sw16t.TimerEnabled = 0
  547. End Select
  548.  
  549. sw16Step = sw16Step + 1
  550. End Sub
  551.  
  552. ' *********************************************************************
  553. ' Supporting Ball & Sound Functions
  554. ' *********************************************************************
  555.  
  556. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  557. Vol = Csng(BallVel(ball) ^2 / 2000)
  558. End Function
  559.  
  560. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  561. Dim tmp
  562. tmp = ball.x * 2 / table1.width-1
  563. If tmp > 0 Then
  564. Pan = Csng(tmp ^10)
  565. Else
  566. Pan = Csng(-((- tmp) ^10) )
  567. End If
  568. End Function
  569.  
  570. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  571. Pitch = BallVel(ball) * 20
  572. End Function
  573.  
  574. Function BallVel(ball) 'Calculates the ball speed
  575. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  576. End Function
  577.  
  578. '*****************************************
  579. ' JP's VP10 Rolling Sounds
  580. '*****************************************
  581.  
  582. Const tnob = 20 ' total number of balls
  583. ReDim rolling(tnob)
  584. InitRolling
  585.  
  586. Sub InitRolling
  587. Dim i
  588. For i = 0 to tnob
  589. rolling(i) = False
  590. Next
  591. End Sub
  592.  
  593. Sub RollingTimer_Timer()
  594. Dim BOT, b
  595. BOT = GetBalls
  596.  
  597. ' stop the sound of deleted balls
  598. For b = UBound(BOT) + 1 to tnob
  599. rolling(b) = False
  600. StopSound("fx_ballrolling" & b)
  601. Next
  602.  
  603. ' exit the sub if no balls on the table
  604. If UBound(BOT) = -1 Then Exit Sub
  605.  
  606. ' play the rolling sound for each ball
  607. For b = 0 to UBound(BOT)
  608. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  609. rolling(b) = True
  610. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  611. Else
  612. If rolling(b) = True Then
  613. StopSound("fx_ballrolling" & b)
  614. rolling(b) = False
  615. End If
  616. End If
  617. Next
  618. End Sub
  619.  
  620. '**********************
  621. ' Ball Collision Sound
  622. '**********************
  623.  
  624. Sub OnBallBallCollision(ball1, ball2, velocity)
  625. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
  626. End Sub
  627.  
  628. '******************************
  629. ' Diverse Collection Hit Sounds
  630. '******************************
  631.  
  632. 'Sub aBumpers_Hit (idx): PlaySound SoundFX("fx_bumper", DOFContactors), 0, 1, pan(ActiveBall): End Sub
  633. Sub aRollovers_Hit(idx):PlaySound "fx_sensor", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  634. Sub aGates_Hit(idx):PlaySound "fx_Gate", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  635. Sub aMetals_Hit(idx):PlaySound "fx_MetalHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  636. Sub aRubber_Bands_Hit(idx):PlaySound "fx_rubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  637. Sub aRubbers_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  638. Sub aRubber_Posts_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  639. Sub aRubber_Pins_Hit(idx):PlaySound "fx_postrubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  640. Sub aPlastics_Hit(idx):PlaySound "fx_PlasticHit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  641. Sub aTargets_Hit(idx):PlaySound "fx2_target", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  642. Sub aWoods_Hit(idx):PlaySound "fx_Woodhit", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
  643.  
  644. '-------------------------------------
  645. ' Map lights into array
  646. ' Set unmapped lamps to Nothing
  647. '-------------------------------------
  648.  
  649. Set Lights(1) = l1
  650. Set Lights(2) = l2
  651. Set Lights(3) = l3
  652. Set Lights(4) = l4
  653. Set Lights(5) = l5
  654. Set Lights(6) = l6
  655. Set Lights(7) = l7
  656. Set Lights(8) = l8
  657. Set Lights(9) = l9
  658. Set Lights(10) = l10
  659. Set Lights(11) = l11
  660. Set Lights(12) = l12
  661. 'Set Lights(13) = l13 High Score to Date
  662. Set Lights(14) = l14
  663. Set Lights(15) = l15
  664. 'Set Lights(16) = l16
  665. Set Lights(17) = l17
  666. Set Lights(18) = l18
  667. Set Lights(19) = l19
  668. Set Lights(20) = l20
  669. Set Lights(21) = l21
  670. Set Lights(22) = l22
  671. Set Lights(23) = l23
  672. Set Lights(24) = l24
  673. Set Lights(25) = l25
  674. Set Lights(26) = l26
  675. Set Lights(27) = l27
  676. Set Lights(28) = l28
  677. Set Lights(29) = l29
  678. Set Lights(30) = l30
  679. Set Lights(31) = l31
  680. 'Set Lights(32) = l32
  681. Set Lights(33) = l33
  682. Set Lights(34) = l34
  683. Set Lights(35) = l35
  684. Set Lights(36) = l36
  685. Set Lights(37) = l37
  686. Set Lights(38) = l38
  687. Set Lights(39) = l39
  688. Set Lights(40) = l40
  689. Set Lights(41) = l41
  690. Set Lights(42) = l42
  691. Set Lights(43) = l43
  692. Set Lights(44) = l44
  693. 'Set Lights(45) = l45 Game Over
  694. Set Lights(46) = l46
  695. 'Set Lights(47) = l47
  696. 'Set Lights(48) = l48
  697. Set Lights(49) = l49
  698. Set Lights(50) = l50
  699. Set Lights(51) = l51
  700. Set Lights(52) = l52
  701. Set Lights(53) = l53
  702. Set Lights(54) = l54
  703. Set Lights(55) = l55
  704. Set Lights(56) = l56
  705. Set Lights(57) = l57
  706. Set Lights(58) = l58
  707. Set Lights(59) = l59
  708. Set Lights(60) = l60
  709. 'Set Lights(61) = l61 TILT
  710. Set Lights(62) = l62
  711. '63 Match
  712. 'Set Lights(64) = l64
  713.  
  714. 'Stern Flight 2000
  715. 'added by Inkochnito
  716. Sub editDips
  717. Dim vpmDips:Set vpmDips = New cvpmDips
  718. With vpmDips
  719. .AddForm 700, 400, "Flight 2000 - DIP switches"
  720. .AddChk 2, 10, 180, Array("Match feature", &H00100000) 'dip 21
  721. .AddChk 2, 25, 115, Array("Credits display", &H00080000) 'dip 20
  722. .AddFrame 2, 45, 190, "Maximum credits", &H00060000, Array("10 credits", 0, "15 credits", &H00020000, "25 credits", &H00040000, "40 credits", &H00060000) 'dip 18&19
  723. .AddFrame 2, 120, 190, "High game to date", 49152, Array("points", 0, "1 free game", &H00004000, "2 free games", 32768, "3 free games", 49152) 'dip 15&16
  724. .AddFrame 2, 195, 190, "High score feature", &H00000020, Array("extra ball", 0, "replay", &H00000020) 'dip 6
  725. .AddFrame 2, 241, 190, "Spot 1 or 2 'F' lites", &H00001000, Array("spot one 'F'", 0, "spot two 'FF'", &H00001000) 'dip 13
  726. .AddFrame 2, 287, 190, "Right spinner lites", &H00200000, Array("start fresh", 0, "retain", &H00200000) 'dip 22
  727. .AddChk 205, 10, 190, Array("Talking sound", &H00010000) 'dip 17
  728. .AddChk 205, 25, 190, Array("Background sound", &H00002000) 'dip 14
  729. .AddFrame 205, 45, 190, "Special award", &HC0000000, Array("no award", 0, "100,000 points", &H40000000, "free ball", &H80000000, "free game", &HC0000000) 'dip 31&32
  730. .AddFrame 205, 120, 190, "Add a ball memory", &H00000090, Array("one ball", 0, "three balls", &H00000010, "five balls", &H00000090) 'dip 5&8
  731. .AddFrame 205, 195, 190, "Balls per game", &H00000040, Array("3 balls", 0, "5 balls", &H00000040) 'dip 7
  732. .AddFrame 205, 241, 190, "Special limit", &H10000000, Array("no limit", 0, "one replay per ball", &H10000000) 'dip 29
  733. .AddFrame 205, 287, 190, "Apollo 1 and 2 lites", &H00800000, Array("are left off at start of the game", 0, "are turned on at start game", &H00800000) 'dip24
  734. .AddFrame 100, 333, 190, "Bonus multiplier", &H20000000, Array("kept in memory", 0, "reset", &H20000000) 'dip30
  735. .AddLabel 50, 385, 300, 20, "After hitting OK, press F3 to reset game with new settings."
  736. .ViewDips
  737. End With
  738. End Sub
  739.  
  740. Sub table1_Paused:Controller.Pause = 1:End Sub
  741. Sub table1_unPaused:Controller.Pause = 0:End Sub
  742. Sub table1_Exit:Controller.Stop:End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement