Arngrim

sttng vpx dof

Mar 4th, 2017
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 56.05 KB | None | 0 0
  1. '*********************************************************************************************************************************************************************
  2. '*********************************************************************************************************************************************************************
  3. '*********************************************************************************************************************************************************************
  4. '*********************************************************************************************************************************************************************
  5. ' #####, #######, ,##### ####### ;#####, ####### ######' ##, ###
  6. ' ###### :####### ###### ####### ###### ,######, ###### ,## ###
  7. ' ### .## ### ;## ##` ##' ,## ### ##'###
  8. ' ###: ### ;; ## ##+;### ;; ##;;##' ## #####
  9. ' #### ## ## `## .###### +## ####### '###### #####.
  10. ' ##, ### ##. ### ##+,### ##. ##,,##, ######. ##`##
  11. ' ##. ##` ;#; ##. ## ##+ :## '## ## .## '## ##`
  12. ' ,####### :## .####### ### ## ##: ##. '## ######' ##. ##+
  13. ' #######` ##, ######## ##` ### .## ,## ##. ###### ,## ,##
  14. ' `#####: .## ########,;## ##` ### ##; ,## ####### ##; ##
  15. '
  16. ' ###### :## .## ######' '######: ######' `## ###; #######, ####### :###### ####### ###### `######` ,##### #######, ##. ####### '######:
  17. ' `###### ##: ##+ ###### #######, ###### ## #### :####### ######## ######,`####### +###### ####### ###### :####### :## :####### #######,
  18. ' .## ## ### .## ### #####: .## .## ### ### ##. ## ### ### .## ##: ##; ##'.## .##
  19. ' :;; ###;;### ## ;;: ### ## '###: ### :;; ;;;; ### ## ##`,## ###;'## ;; ## ### .## `## ## ##' ###
  20. ' ##, #######`'###### ## ## '###### ###: ## ##. ###. ###### +## ;## ######: ######; ## `## ## ### ### ### ## ##
  21. ' .## ###,,+## ######. ### ### ######. #### ### ,## .### ####### ##. ##,`###### :##,:## ##. ### ### ## ## ## ### ###
  22. ' ##+ ##. ##,.## ## ##`.## #####: ##` ##; ##; ##` :## .## ### ##: :## ;#; ##. ##` ### ### '## ## ##`
  23. ' ## :## .## ######' '## :## ######' ####.'## :## `####### :###### ##; ##' ###### `## ##: .####### :## ##` #######.+## :##
  24. ' ### ##: ##' ###### ##. ##: ###### ;###. ## ##, ######## ######,.## ## +###### ### `## ######## ##, ;## ,####### ##. ##:
  25. ' ##` .## ## ####### ,## .## ####### ### ## .## '#####' .###### ### ### ######` ## ### ########, .## ##: ###### ,## .##
  26. '*********************************************************************************************************************************************************************
  27. '*********************************************************************************************************************************************************************
  28. '*********************************************************************************************************************************************************************
  29. '*********************************************************************************************************************************************************************
  30.  
  31. '*********************************************************************
  32. '*********************************************************************
  33. '1993 Star Trek - The Next Generation by Williams Pinball
  34. '*********************************************************************
  35. '*********************************************************************
  36. 'Concept by: Steve Ritchie
  37. 'Design by: Steve Ritchie, Dwight Sullivan, Greg Freres
  38. 'Art by: Greg Freres
  39. 'Dots/Animation by: Scott Slomiany, Eugene Geer
  40. 'Mechanics by: Carl Biagi
  41. 'Music by: Dan Forden
  42. 'Sound by: Dan Forden
  43. 'Software by: Dwight Sullivan, Matt Coriale
  44. '*********************************************************************
  45. '*********************************************************************
  46. 'recreated for Visual Pinball by Knorr and Clark Kent
  47. '*********************************************************************
  48. '*********************************************************************
  49.  
  50. Option Explicit
  51. Randomize
  52.  
  53. On Error Resume Next
  54. ExecuteGlobal GetTextFile("controller.vbs")
  55. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  56. On Error Goto 0
  57.  
  58. Dim DesktopMode
  59. DesktopMode = Table1.ShowDT
  60. Dim UseVPMDMD
  61. UseVPMDMD = DesktopMode
  62. 'UseVPMDMD = 1
  63. Const UseVPMModSol = 1
  64.  
  65. '**********
  66. '***Mods***
  67. '**********
  68.  
  69. '1 for ON, 0 for OFF
  70.  
  71. InlanesMod = 0 'with this mod the inlanes are about 1cm/0,39inch longer
  72. BorgMod = 0 'changes the Original Model to a Custom Model
  73.  
  74. RGBMod = 0 'RGB
  75. RGBBumpers = 1
  76. RGBArrows = 1
  77.  
  78. LaserMod = 0 'Activate Lasers on the Cannons
  79. LaserColor = 1 '1 = RED, 2 = GREEN, 3 = BLUE
  80. LaserType = 1 '1 = Fast, turns off after the ball is shoot, 2 = Slow, turns off after the cannon is back initial_pos
  81.  
  82.  
  83. '********************
  84. 'Standard definitions
  85. '********************
  86.  
  87. LoadVPM "01560000", "wpc.VBS", 3.36
  88.  
  89. '***ROM***ROM***ROM***ROM***
  90. Const cGameName = "sttng_s7"
  91. '***************************
  92.  
  93. Const UseSolenoids = 1
  94. Const UseLamps = 0
  95. Const HandleMech = 0
  96. Const SSolenoidOn = "SolOn"
  97. Const SSolenoidOff = "SolOff"
  98. Const SFlipperOn = "FlipperUp"
  99. Const SFlipperOff = "FlipperDown"
  100. Const SCoin = "Coin4"
  101. Dim bsTrough,TopDrop, LeftCannonMech, RightCannonMech, BorgLock
  102. Dim KB, CP, UnderDiverterTop1, UnderDiverterBottom1
  103. Dim InlanesMod, BorgMod, FlipperMod, LaserMod, LaserColor, LaserType, RGBMod, RGBBumpers, RGBArrows
  104.  
  105.  
  106. 'Set LampCallback = GetRef("UpdateMultipleLamps")
  107. Set MotorCallback = GetRef("RealTimeUpdates")
  108. Set GiCallback2 = GetRef("UpdateGI")
  109. BSize = 25.5
  110. BMass = 1
  111.  
  112. '************
  113. ' Table Init
  114. '************
  115.  
  116. Sub table1_Init
  117. vpmInit Me
  118. With Controller
  119. .GameName = cGameName
  120. If Err Then MsgBox "Can't start Game " & cGameName & vbNewLine & Err.Description:Exit Sub
  121. .Games(cGameName).Settings.Value("rol") = 1
  122. .HandleKeyboard = 0
  123. .ShowTitle = 0
  124. .ShowDMDOnly = 1
  125. .ShowFrame = 0
  126. .HandleMechanics = 0
  127. .Hidden = DesktopMode
  128. '.SetDisplayPosition 0, 0, GetPlayerHWnd 'uncomment this line if you don't see the DMD
  129. On Error Resume Next
  130. .Run GetPlayerHWnd
  131. If Err Then MsgBox Err.Description
  132. On Error Goto 0
  133. .Switch(22) = 1 'close coin door
  134. .Switch(24) = 1 'and keep it close
  135. PinMAMETimer.Interval = PinMAMEInterval
  136. PinMAMETimer.Enabled = true
  137. vpmNudge.TiltSwitch = 14
  138. vpmNudge.Sensitivity = 2
  139. End With
  140.  
  141. Set bsTrough = New cvpmBallStack
  142. With bsTrough
  143. .InitSw 0, 66, 65, 64, 63, 62, 61, 0
  144. .InitKick BallRelease, 80, 10
  145. .InitExitSnd SoundFX("BallRelease", DOFContactors), SoundFX("fx_Solenoid", DOFContactors)
  146. .Balls = 6
  147. End With
  148.  
  149. Set TopDrop = New cvpmDropTarget
  150. With TopDrop
  151. .InitDrop sw57, 57
  152. .InitSnd SoundFX("Dropdown",DOFDropTargets), SoundFX("DropUp",DOFDropTargets)
  153. End With
  154.  
  155. Set BorgLock = New cvpmBallStack
  156. With BorgLock
  157. .InitSw 0, 31, 0, 0, 0, 0, 0, 0
  158. .InitKick BorgKicker, 180, 24
  159. .InitExitSnd SoundFX("popper",DOFContactors), SoundFX("Solenoid",DOFContactors)
  160. ' .Balls = 0
  161. End With
  162.  
  163. '**********************
  164. '***DesktopMode Init***
  165. '**********************
  166.  
  167. If table1.ShowDt = False then
  168. Korpus.visible = 0
  169. Korpus1.visible = 1
  170. LeftSideRail.visible = 0
  171. RightSideRail.visible = 0
  172. Else
  173. Korpus.visible = 1
  174. Korpus1.visible = 0
  175. LeftSideRail.visible = 1
  176. RightSideRail.visible = 1
  177. End if
  178.  
  179. '****************************
  180. '***Switches/Diverter Init***
  181. '****************************
  182.  
  183.  
  184. Controller.Switch(127) = 1
  185. Controller.Switch(122) = 1
  186. Controller.Switch(125) = 1
  187. Controller.Switch(126) = 1
  188. DiverterFRG.isDropped = 1
  189. DiverterFLG.isDropped = 0
  190. sw57.isDropped = 1
  191. sw41dr.isDropped = 1
  192. sw35dr.isDropped = 1
  193. sw36dr.isDropped = 1
  194. sw37dr.isDropped = 1
  195. sw37dr1.isDropped = 0
  196. sw42dr.isDropped = 1
  197. sw43dr.isDropped = 1
  198. sw47dr.isDropped = 1
  199.  
  200. '**************
  201. '***Mods Init***
  202. '**************
  203.  
  204. If InlanesMod = 1 then
  205. leftinlanewall.collidable = 0
  206. rightinlanewall.collidable = 0
  207. inlanemetal.visible = 0
  208. leftinlanewallmod.collidable = 1
  209. rightinlanewallmod.collidable = 1
  210. inlanemetalmod.visible = 1
  211. Else
  212. leftinlanewall.collidable = 1
  213. rightinlanewall.collidable = 1
  214. inlanemetal.visible = 1
  215. leftinlanewallmod.collidable = 0
  216. rightinlanewallmod.collidable = 0
  217. inlanemetalmod.visible = 0
  218. End if
  219.  
  220.  
  221. If BorgMod = 1 then
  222. borgshipcustom.visible = 1
  223. borgshipcustomledoff.visible = 1
  224. borgshipcustomwiresplines.visible = 1
  225. deltarampendborgcustom.visible = 1
  226.  
  227. l78a.Intensity = 30
  228. l78b.Intensity = 30
  229. l78c.Intensity = 6
  230. l78d.Intensity = 30
  231. l78e.Intensity = 10
  232. l78a1.State = 1
  233. l78b1.State = 1
  234. l78c1.State = 1
  235. l78d1.State = 1
  236. l78e1.State = 1
  237.  
  238. borgshiporiginal.visible = 0
  239. borgledoriginal.visible = 0
  240. deltarampendborg.visible = 0
  241. l78borga.Intensity = 0
  242. l78borgb.Intensity = 0
  243. l78borgc.Intensity = 0
  244. l78borgd.Intensity = 0
  245. l78borge.Intensity = 0
  246. l78borga1.State = 0
  247. l78borgb1.State = 0
  248. l78borgc1.State = 0
  249. l78borgd1.State = 0
  250. l78borge1.State = 0
  251. Else
  252. borgshipcustom.visible = 0
  253. borgshipcustomledoff.visible = 0
  254. borgshipcustomwiresplines.visible = 0
  255. deltarampendborgcustom.visible = 0
  256.  
  257. l78a.Intensity = 0
  258. l78b.Intensity = 0
  259. l78c.Intensity = 0
  260. l78d.Intensity = 0
  261. l78e.Intensity = 0
  262. l78a1.State = 0
  263. l78b1.State = 0
  264. l78c1.State = 0
  265. l78d1.State = 0
  266. l78e1.State = 0
  267.  
  268. borgshiporiginal.visible = 1
  269. borgledoriginal.visible = 1
  270. deltarampendborg.visible = 1
  271. l78borga.Intensity = 15
  272. l78borgb.Intensity = 50
  273. l78borgc.Intensity = 60
  274. l78borgd.Intensity = 30
  275. l78borge.Intensity = 50
  276. l78borga1.State = 1
  277. l78borgb1.State = 1
  278. l78borgc1.State = 1
  279. l78borgd1.State = 1
  280. l78borge1.State = 1
  281. End if
  282.  
  283. If RGBMod = 1 then RGBTimer.Enabled = 1
  284. If RGBBumpers = 1 And RGBMod = 1 then
  285. BumperCap1.Image = "bumpero_weis"
  286. BumperCap2.Image = "bumpero_weis"
  287. BumperCap3.Image = "bumpero_weis_half"
  288. End if
  289.  
  290.  
  291. If LaserColor = 1 then LaserL.Material = "LaserRed"
  292. If LaserColor = 1 then LaserL1.Material = "LaserRed1"
  293. If LaserColor = 1 then LaserR.Material = "LaserRed"
  294. If LaserColor = 1 then LaserR1.Material = "LaserRed1"
  295.  
  296. If LaserColor = 2 then LaserL.Material = "LaserGreen"
  297. If LaserColor = 2 then LaserL1.Material = "LaserGreen1"
  298. If LaserColor = 2 then LaserR.Material = "LaserGreen"
  299. If LaserColor = 2 then LaserR1.Material = "LaserGreen1"
  300.  
  301. If LaserColor = 3 then LaserL.Material = "LaserBlue"
  302. If LaserColor = 3 then LaserL1.Material = "LaserBlue1"
  303. If LaserColor = 3 then LaserR.Material = "LaserBlue"
  304. If LaserColor = 3 then LaserR1.Material = "LaserBlue1"
  305. End Sub
  306.  
  307. '*********
  308. 'Solenoids
  309. '*********
  310.  
  311. SolCallback(1) = "LeftCannonKicker"
  312. SolCallback(2) = "RightCannonKicker"
  313. SolCallback(3) = "UnderLeftGun"
  314. SolCallback(4) = "UnderRightGun"
  315. SolCallback(5) = "LeftLock"
  316. SolCallback(6) = "AutoPlunge"
  317. SolCallback(7) = "vpmSolSound SoundFX(""Knocker"",DOFKnocker),"
  318. SolCallBack(8) = "Kickback"
  319. SolCallBack(11) = "SolRelease"
  320. SolCallBack(15) = "TopDiverter"
  321. SolCallBack(16) = "BorgLock.SolOut"
  322. SolCallback(17) = "LeftCannonMotor"
  323. SolCallback(18) = "RightCannonMotor"
  324. SolCallBack(51) = "UnderDiverterTop"
  325. SolCallBack(52) = "UnderDiverterBottom"
  326. SolCallBack(53) = "TopDrop.SolDropUp"
  327. SolCallBack(54) = "TopDrop.SolDropDown"
  328.  
  329. '***Flasher***
  330. SolModCallBack(20) = "Flash120" 'JetsFlasher
  331. SolModCallBack(21) = "Flash121" 'RightPopperFlasher
  332. SolModCallBack(22) = "Flash122" 'MiddleRampFlasher
  333. SolModCallBack(23) = "Flash123" 'ShieldsFlasher
  334. SolCallBack(24) = "SetLamp 124," 'AutofireFlasher
  335. SolModCallBack(25) = "Flash125" 'ExitUnGndFlasher
  336. SolModCallBack(26) = "Flash126" 'RightBorgFlasher
  337. SolModCallBack(27) = "Flash127" 'LeftBorgFlasher
  338. SolModCallBack(28) = "Flash128" 'CenterBorgFlasher
  339. SolModCallBack(55) = "Flash141" 'RomulanFlasher
  340. SolModCallBack(56) = "Flash142" 'RightRampFlasher
  341.  
  342.  
  343. Sub SolRelease(Enabled)
  344. If Enabled And bsTrough.Balls> 0 Then
  345. vpmTimer.PulseSw 67
  346. bsTrough.ExitSol_On
  347. End If
  348. End Sub
  349.  
  350. Sub Drain_Hit
  351. PlaySound "Drain", 0, 0.4, 0
  352. bsTrough.AddBall Me
  353. End Sub
  354.  
  355.  
  356. Sub AutoPlunge(Enabled)
  357. if enabled then
  358. AutoPlunger.Kick 0, 145
  359. PlaySound SoundFX("PlungerCatapult",DOFContactors)
  360. ' Catapult.RotX = Catapult.RotX +17
  361. CP = True
  362. Else
  363. Controller.Switch(68) = 0
  364. CP = False
  365. ' Catapult.RotX = Catapult.RotX -17
  366. End if
  367. End Sub
  368. Sub AutoPlunger_Hit:Controller.Switch(68) = 1:End Sub
  369.  
  370.  
  371. Sub TopDiverter(enabled)
  372. If Enabled Then
  373. diverter.rotatetoend
  374. topdiverterwall.isdropped = 0
  375. PlaySound SoundFX("TopdiverterOn",DOFContactors)
  376. Else
  377. diverter.rotatetostart
  378. topdiverterwall.isdropped = 1
  379. PlaySound SoundFX("TopdiverterOff",DOFContactors)
  380. End If
  381. End Sub
  382.  
  383. Sub UnderDiverterTop(enabled)
  384. If enabled Then
  385. DiverterFRG.isDropped = 0
  386. sw37dr1.isDropped = 1
  387. Else
  388. DiverterFRG.isDropped = 1
  389. sw37dr1.isDropped = 0
  390. End If
  391. End Sub
  392.  
  393. Sub UnderDiverterBottom(enabled)
  394. If enabled Then
  395. DiverterFLG.isDropped = 1
  396. Else
  397. ' vpmtimer.addtimer 1250, "DiverterFLG.isDropped = 0'"
  398. DiverterFLG.isDropped = 0
  399. End If
  400. End Sub
  401.  
  402.  
  403. Sub BorgKicker1_Hit()
  404. borglock.Addball Me
  405. End Sub
  406.  
  407. Sub KickBack(Enabled)
  408. If enabled Then
  409. KickbackPlunger.Fire
  410. KB = True
  411. KickBackTimer.Enabled = 1
  412. Playsound SoundFX("Kickback", DOFContactors)
  413. Else
  414. End if
  415. End Sub
  416.  
  417. Sub LeftCannonMotor(enabled)
  418. If enabled Then
  419. CML = True
  420. CannonLTimer.Enabled = 1
  421. PlaySound SoundFX("LGunMotor",DOFGear)
  422. Else
  423. CannonLTimer.Enabled = 0
  424. StopSound "LGunMotor"
  425. End If
  426. End Sub
  427.  
  428. Sub RightCannonMotor(enabled)
  429. If enabled Then
  430. CMR = True
  431. CannonRTimer.Enabled = 1
  432. PlaySound SoundFX("RGunMotor",DOFGear)
  433. Else
  434. CannonRTimer.Enabled = 0
  435. StopSound "RGunMotor"
  436. End If
  437. End Sub
  438.  
  439. Sub UnderLeftGun(Enabled)
  440. If enabled then
  441. sw36.kick 161, 50, 1.4
  442. PlaySound SoundFX("LGunPopper",DOFContactors)
  443. Else
  444. Controller.Switch(36) = 0
  445. vpmtimer.addtimer 1000, "sw36dr.isDropped = 1'"
  446. End if
  447. End Sub
  448.  
  449. Sub UnderRightGun(Enabled)
  450. If enabled then
  451. sw37.kick 199, 50, 1.4
  452. PlaySound SoundFX("RGunPopper",DOFContactors)
  453. Else
  454. Controller.Switch(37) = 0
  455. vpmtimer.addtimer 1000, "sw37dr.isDropped = 1'"
  456. End if
  457. End Sub
  458.  
  459. Sub LeftLock(Enabled)
  460. If enabled then
  461. sw41.kick 255, 50, 1.4
  462. PlaySound SoundFX("LeftPopper",DOFContactors)
  463. Else
  464. Controller.Switch(41) = 0
  465. ' vpmtimer.addtimer 1000, "sw41dr.isDropped = 1'"
  466. sw41dr.isDropped = 1
  467. End if
  468. End Sub
  469.  
  470.  
  471. '*********
  472. ' Bumper
  473. '*********
  474.  
  475. Sub LeftJetBumper_hit:vpmTimer.pulseSw 71:Playsound SoundFX("BumperLeft", DOFContactors):Me.TimerEnabled = 1:End Sub
  476. Sub LeftJetBumper_Timer:Me.Timerenabled = 0:End Sub
  477.  
  478. Sub RightJetBumper_hit:vpmTimer.pulseSw 72:Playsound SoundFX("BumperRight", DOFContactors):Me.TimerEnabled = 1:End Sub
  479. Sub RightJetBumper_Timer:Me.Timerenabled = 0:End Sub
  480.  
  481. Sub BottomJetBumper_hit:vpmTimer.pulseSw 73:Playsound SoundFX("BumperMiddle", DOFContactors):Me.TimerEnabled = 1:End Sub
  482. Sub BottomJetBumper_Timer:Me.Timerenabled = 0:End Sub
  483.  
  484.  
  485. '*********
  486. ' Switches
  487. '*********
  488.  
  489. Sub sw15_Hit:Controller.Switch(15) = 1:PlaySound "metalhit_thin":End Sub
  490. Sub sw15_UnHit:Controller.Switch(15) = 0:End Sub
  491.  
  492. Sub sw16_Hit:Controller.Switch(16) = 1:End Sub
  493. Sub sw16_UnHit:Controller.Switch(16) = 0:End Sub
  494.  
  495. Sub sw17_Hit:Controller.Switch(17) = 1:End Sub
  496. Sub sw17_UnHit:Controller.Switch(17) = 0:End Sub
  497.  
  498. Sub sw18_Hit:Controller.Switch(18) = 1:PlaySound "metalhit_thin":End Sub
  499. Sub sw18_UnHit:Controller.Switch(18) = 0:End Sub
  500.  
  501. Sub sw117spinner_Spin():vpmTimer.PulseSw 117:PlaySound "fx_spinner":End Sub
  502.  
  503. Sub sw44_Hit:Controller.Switch(44) = 1:End Sub
  504. Sub sw44_UnHit:Controller.Switch(44) = 0:End Sub
  505. Sub sw48_Hit:Controller.Switch(48) = 1:End Sub
  506. Sub sw48_UnHit:Controller.Switch(48) = 0:End Sub
  507.  
  508. Sub sw57_Hit:TopDrop.hit 1:End Sub
  509.  
  510. Sub sw58_Hit:Controller.Switch(58) = 1:PlaySound "metalhit_thin":End Sub
  511. Sub sw58_UnHit:Controller.Switch(58) = 0:End Sub
  512.  
  513. Sub sw76_Hit:Controller.Switch(76) = 1:PlaySound "metalhit_thin":End Sub
  514. Sub sw76_UnHit:Controller.Switch(76) = 0:End Sub
  515.  
  516. Sub sw77_Hit:Controller.Switch(77) = 1:PlaySound "metalhit_thin":End Sub
  517. Sub sw77_UnHit:Controller.Switch(77) = 0:End Sub
  518.  
  519. Sub sw78_Hit:Controller.Switch(78) = 1:PlaySound "metalhit_thin":End Sub
  520. Sub sw78_UnHit:Controller.Switch(78) = 0:End Sub
  521.  
  522.  
  523. Sub sw25_Hit:vpmTimer.PulseSw 25: End Sub 'right Ramp
  524. Sub sw87_Hit:vpmTimer.PulseSw 87: End Sub
  525.  
  526. Sub sw88_Hit:vpmTimer.PulseSw 88: End Sub 'left Ramp
  527. Sub sw83_Hit:vpmTimer.PulseSw 83: sw83wire.RotX = 110:Me.TimerEnabled = 1:End Sub
  528. Sub sw83_Timer: sw83wire.RotX = 90: Me.TimerEnabled = 0: End Sub
  529.  
  530. Sub sw23_Hit:vpmTimer.PulseSw 23: sw23wire.RotX = 110:Me.TimerEnabled = 1:End Sub 'middle Ramp
  531. Sub sw23_Timer: sw23wire.RotX = 90: Me.TimerEnabled = 0: End Sub
  532.  
  533. Sub BallCatcher1_Hit:If ActiveBall.VelY <= -20 then ActiveBall.VelY = -20:End if:End Sub
  534.  
  535. 'GunSwitches
  536.  
  537. Sub sw32_Hit:Controller.Switch(32) = 1:End Sub
  538. Sub sw32_UnHit:Controller.Switch(32) = 0:End Sub
  539. Sub sw36_Hit:Controller.Switch(36) = 1:sw36dr.isDropped = 0:End Sub
  540.  
  541. Sub sw33_Hit:Controller.Switch(33) = 1:End Sub
  542. Sub sw33_UnHit:Controller.Switch(33) = 0:End Sub
  543. Sub sw37_Hit:Controller.Switch(37) = 1:sw37dr.isDropped = 0:End Sub
  544.  
  545. 'LeftLock
  546.  
  547. Sub sw41_Hit:Controller.Switch(41) = 1:sw41dr.isDropped = 0:End Sub
  548.  
  549. Sub sw35_Hit:Controller.Switch(35) = 1:sw35dr.isDropped = 0:End Sub
  550. Sub sw35_UnHit:Controller.Switch(35) = 0:sw35dr.isDropped = 1:End Sub
  551.  
  552. Sub sw42_Hit:Controller.Switch(42) = 1:sw42dr.isDropped = 0:End Sub
  553. Sub sw42_UnHit:Controller.Switch(42) = 0:sw42dr.isDropped = 1:End Sub
  554.  
  555. Sub sw43_Hit:Controller.Switch(43) = 1:sw43dr.isDropped = 0:End Sub
  556. Sub sw43_UnHit:Controller.Switch(43) = 0:sw43dr.isDropped = 1:End Sub
  557.  
  558. '***Holes***
  559.  
  560. Sub sw27_Hit: vpmTimer.PulseSw 27:T27P.RotX = 100:T27P2.RotX = 100:PlaySound SoundFX("target",DOFTargets):T27.TimerEnabled = 1:SoundNeutralZone:End Sub
  561. Sub sw45_Hit: SoundNeutralZone:End Sub
  562. Sub sw45t_Hit: Controller.Switch(45) = 1:End Sub
  563. Sub sw45t_UnHit: Controller.Switch(45) = 0:End Sub
  564. Sub sw46t_Hit: Controller.Switch(46) = 1:PlaySound "CommandD":End Sub
  565. Sub sw46t_UnHit: Controller.Switch(46) = 0:End Sub
  566. Sub sw47t_Hit: Controller.Switch(47) = 1:sw47dr.isDropped = 0:End Sub
  567. Sub sw47_Hit:PlaySound "StartMission1":End Sub
  568. Sub sw47t_UnHit: Controller.Switch(47) = 0:sw47dr.isDropped = 1:End Sub
  569.  
  570.  
  571. '***Targets***
  572. 'T27 only pulse with sw27(Hole) to prevent double hits
  573. Sub T26_Hit:vpmTimer.PulseSw 26:PlaySound SoundFX("target",DOFTargets):End Sub
  574. 'Sub T27_Hit:T27P.RotX = 100:T27P2.RotX = 100:PlaySound "target":T27.TimerEnabled = 1:End Sub
  575. Sub T27_Timer:T27P.RotX = 90:T27P2.RotX = 90:End Sub
  576. Sub T28_Hit:vpmTimer.PulseSw 28:PlaySound SoundFX("target",DOFTargets):End Sub
  577.  
  578. Sub T51_Hit:vpmTimer.PulseSw 51:PlaySound SoundFX("target",DOFTargets):End Sub
  579. Sub T52_Hit:vpmTimer.PulseSw 52:PlaySound SoundFX("target",DOFTargets):End Sub
  580. Sub T53_Hit:vpmTimer.PulseSw 53:PlaySound SoundFX("target",DOFTargets):End Sub
  581.  
  582. Sub T54_Hit:vpmTimer.PulseSw 54:PlaySound SoundFX("target",DOFTargets):End Sub
  583. Sub T55_Hit:vpmTimer.PulseSw 55:PlaySound SoundFX("target",DOFTargets):End Sub
  584. Sub T56_Hit:vpmTimer.PulseSw 56:PlaySound SoundFX("target",DOFTargets):End Sub
  585.  
  586. Sub T81_Hit:vpmTimer.PulseSw 81:PlaySound SoundFX("target",DOFTargets):End Sub
  587. Sub T82_Hit:vpmTimer.PulseSw 82:PlaySound SoundFX("target",DOFTargets):End Sub
  588.  
  589. Sub T84_Hit:vpmTimer.PulseSw 84:PlaySound SoundFX("target",DOFTargets):End Sub
  590.  
  591. Sub T85_Hit:vpmTimer.PulseSw 85:PlaySound SoundFX("target",DOFTargets):End Sub
  592. Sub T86_Hit:vpmTimer.PulseSw 86:PlaySound SoundFX("target",DOFTargets):End Sub
  593.  
  594.  
  595. 'KickerAnimation
  596.  
  597.  
  598. '***************
  599. ' ToysAnimation
  600. '***************
  601.  
  602.  
  603. '***Cannons***
  604.  
  605. Dim CannonSpeed, CannonSteps, CannonAnimationSteps, CannonLBall, CannonRBall, RadiusL, RadiusR, CannonAngleL, CannonAngleR
  606. Dim RadiusRL, RadiusLL, CML, CMR, CPL, CPR
  607. Dim ForceL, ForceR, LaserLON, LaserRON
  608.  
  609. CannonSpeed = 600 'Timer with 1 = 1000/Second
  610. CannonSteps = 82
  611.  
  612. Const Pi = 3.14159265358979
  613. RadiusL = CannonBaseL.Y - kicker1.Y
  614. RadiusR = CannonBaseR.Y - kicker2.Y
  615. RadiusLL = CannonBaseL.Y - l52.Y
  616. RadiusRL = CannonBaseR.Y - l82.Y
  617.  
  618.  
  619. Sub Kicker1_Hit()
  620. me.destroyball
  621. Set CannonLBall = kicker1.createball
  622. Controller.Switch(38) = 1
  623. me.Enabled = False
  624. If LaserMod = 1 then
  625. LaserL.visible = 1
  626. LaserL1.visible = 1
  627. LaserZTimer.Enabled = 1
  628. LaserLON = 1
  629. End if
  630. End Sub
  631.  
  632. Sub Kicker2_Hit()
  633. me.destroyball
  634. Set CannonRBall = kicker2.createball
  635. Controller.Switch(34) = 1
  636. me.Enabled = False
  637. If LaserMod = 1 then
  638. LaserR.visible = 1
  639. LaserR1.visible = 1
  640. LaserZTimer1.Enabled = 1
  641. LaserRON = 1
  642. End if
  643. End Sub
  644.  
  645.  
  646.  
  647.  
  648. Sub CannonLTimer_Timer()
  649. If CML = True and CannonBaseL.ObjRotZ < 64 Then
  650. CannonBaseL.ObjRotZ = CannonBaseL.ObjRotZ +(CannonSteps*2)/CannonSpeed
  651. End if
  652. If CML = False and CannonBaseL.ObjRotZ > -19 then
  653. CannonBaseL.ObjRotZ = CannonBaseL.ObjRotZ -(CannonSteps*2)/CannonSpeed
  654. End if
  655. If CannonBaseL.ObjRotZ >= 64 then CML = False
  656. If CannonBaseL.ObjRotZ >= -20 And CannonBaseL.ObjRotZ <= -17 then Controller.Switch(127) = 1: Else Controller.Switch(127) = 0
  657. If CannonBaseL.ObjRotZ >= -20 And CannonBaseL.ObjRotZ <= 9 then Controller.Switch(122) = 1:ForceL = 25: Else Controller.Switch(122) = 0: ForceL = 50
  658.  
  659. If Not IsEmpty(CannonLBall) Then
  660. CannonLBall.X= CannonBaseL.X - RadiusL*sin(-CannonBaseL.ObjRotZ*(Pi/180))
  661. CannonLBall.Y= CannonBaseL.Y - RadiusL*cos(-CannonBaseL.ObjRotZ*(Pi/180))
  662. CannonLBall.Z=105 + BSize
  663. CannonAngleL = CannonBaseL.ObjRotZ
  664. End If
  665. CannonL.ObjRotZ = CannonBaseL.ObjRotZ
  666. CannonDomeL.ObjRotZ = CannonBaseL.ObjRotZ
  667. CannonPinL.ObjRotZ = CannonBaseL.ObjRotZ
  668. l52.X = CannonBaseL.X - RadiusRL*sin(-CannonBaseL.ObjRotZ*(Pi/180))
  669. l52.Y = CannonBaseL.Y - RadiusRL*cos(-CannonBaseL.ObjRotZ*(Pi/180))
  670. LaserL.ObjRotZ = CannonBaseL.ObjRotZ
  671. LaserL1.ObjRotZ = CannonBaseL.ObjRotZ
  672. End Sub
  673.  
  674.  
  675.  
  676. Sub CannonRTimer_Timer()
  677. If CMR = True and CannonBaseR.ObjRotZ < 64 Then
  678. CannonBaseR.ObjRotZ = CannonBaseR.ObjRotZ +(CannonSteps*2)/CannonSpeed
  679. End if
  680. If CMR = False and CannonBaseR.ObjRotZ > -19 then
  681. CannonBaseR.ObjRotZ = CannonBaseR.ObjRotZ -(CannonSteps*2)/CannonSpeed
  682. End if
  683. If CannonBaseR.ObjRotZ >= 64 then CMR = False
  684. If CannonBaseR.ObjRotZ >= -20 And CannonBaseR.ObjRotZ <= -17 then Controller.Switch(125) = 1: Else Controller.Switch(125) = 0
  685. If CannonBaseR.ObjRotZ >= -20 And CannonBaseR.ObjRotZ <= 9 then Controller.Switch(126) = 1:ForceR = 25: Else Controller.Switch(126) = 0: ForceR = 50
  686.  
  687. If Not IsEmpty(CannonRBall) Then
  688. CannonRBall.X= CannonBaseR.X - RadiusR*sin(+CannonBaseR.ObjRotZ*(Pi/180))
  689. CannonRBall.Y= CannonBaseR.Y - RadiusR*cos(+CannonBaseR.ObjRotZ*(Pi/180))
  690. CannonRBall.Z=105 + BSize
  691. CannonAngleR = CannonBaseR.ObjRotZ- (CannonBaseR.ObjRotZ*2)
  692. End If
  693. CannonR.ObjRotZ = CannonBaseR.ObjRotZ
  694. CannonDomeR.ObjRotZ = CannonBaseR.ObjRotZ
  695. CannonPinR.ObjRotZ = CannonBaseR.ObjRotZ
  696. l82.X = CannonBaseR.X - RadiusRL*sin(+CannonBaseR.ObjRotZ*(Pi/180))
  697. l82.Y = CannonBaseR.Y - RadiusRL*cos(+CannonBaseR.ObjRotZ*(Pi/180))
  698. LaserR.ObjRotZ = CannonBaseR.ObjRotZ
  699. LaserR1.ObjRotZ = CannonBaseR.ObjRotZ
  700. End Sub
  701.  
  702. '***CannonShoot***
  703.  
  704. Sub LeftCannonKicker(Enabled)
  705. If Enabled then
  706. CPL = True
  707. If Not IsEmpty(CannonLBall) Then
  708. Kicker1.kick CannonAngleL, ForceL
  709. Playsound SoundFX("LGunKicker", DOFContactors)
  710. Controller.Switch(38) = 0
  711. CannonLBall = Empty
  712. Kicker1.Enabled = True
  713. LaserLON = 0
  714. If LaserType = 1 then
  715. LaserL.Visible = 0
  716. LaserL1.Visible = 0
  717. LaserZTimer.Enabled = 0
  718. End if
  719. End if
  720. End if
  721. End Sub
  722.  
  723.  
  724. Sub RightCannonKicker(Enabled)
  725. If Enabled then
  726. CPR = True
  727. If Not IsEmpty(CannonRBall) Then
  728. Kicker2.kick CannonAngleR, ForceR
  729. Playsound SoundFX("RGunKicker", DOFContactors)
  730. Controller.Switch(34) = 0
  731. CannonRBall = Empty
  732. Kicker2.Enabled = True
  733. LaserRON = 0
  734. If LaserType = 1 then
  735. LaserR.Visible = 0
  736. LaserR1.Visible = 0
  737. LaserZTimer1.Enabled = 0
  738. End if
  739. End if
  740. End if
  741. End Sub
  742.  
  743.  
  744. '***LaserZTimer***
  745.  
  746. Sub LaserZTimer_Timer()
  747. If CannonBaseL.ObjRotZ >= -20 And CannonBaseL.ObjRotZ <= -17 then LaserL.Size_Z = 0.3: LaserL1.Size_Z = 0.3
  748. If CannonBaseL.ObjRotZ >= -16.99 And CannonBaseL.ObjRotZ <= -8 then LaserL.Size_Z = 0.3: LaserL1.Size_Z = 0.25
  749. If CannonBaseL.ObjRotZ >= -7.99 And CannonBaseL.ObjRotZ <= -5 then LaserL.Size_Z = 0.3: LaserL1.Size_Z = 0.3
  750. If CannonBaseL.ObjRotZ >= -4.99 And CannonBaseL.ObjRotZ <= -1 then LaserL.Size_Z = 0.67: LaserL1.Size_Z = 0.67
  751. If CannonBaseL.ObjRotZ >= 0.99 And CannonBaseL.ObjRotZ <= 5.99 then LaserL.Size_Z = 1: LaserL1.Size_Z = 1
  752.  
  753. If BorgMod = 0 then
  754. If CannonBaseL.ObjRotZ >= 6 And CannonBaseL.ObjRotZ <= 21.99 then LaserL.Size_Z = 0.75: LaserL1.Size_Z = 0.75
  755. End if
  756. If BorgMod = 1 then
  757. If CannonBaseL.ObjRotZ >= 6 And CannonBaseL.ObjRotZ <= 21.99 then LaserL.Size_Z = 1: LaserL1.Size_Z = 1
  758. End if
  759.  
  760. If CannonBaseL.ObjRotZ >= 22 And CannonBaseL.ObjRotZ <= 56.99 then LaserL.Size_Z = 1: LaserL1.Size_Z = 1
  761. If CannonBaseL.ObjRotZ >= 57 And CannonBaseL.ObjRotZ <= 62.99 then LaserL.Size_Z = 0.48: LaserL1.Size_Z = 0.48
  762. If CannonBaseL.ObjRotZ >= 63 then LaserL.Size_Z = 1:LaserL1.Size_Z = 1
  763.  
  764. If CannonBaseL.ObjRotZ <= -18 And LaserLON = 0 Then
  765. LaserL.Visible = 0
  766. LaserL1.Visible = 0
  767. LaserZTimer.Enabled = 0
  768. End if
  769. End Sub
  770.  
  771. Sub LaserZTimer1_Timer()
  772. If CannonBaseR.ObjRotZ >= -20 And CannonBaseR.ObjRotZ <= -18 then LaserR.Size_Z = 1: LaserR1.Size_Z = 1
  773. If CannonBaseR.ObjRotZ >= -17.99 And CannonBaseR.ObjRotZ <= -8 then LaserR.Size_Z = 0.235: LaserR1.Size_Z = 0.235
  774. If CannonBaseR.ObjRotZ >= -7.99 And CannonBaseR.ObjRotZ <= 8.99 then LaserR.Size_Z = 1: LaserR1.Size_Z = 1
  775.  
  776. If BorgMod = 0 then
  777. If CannonBaseR.ObjRotZ >= 9 And CannonBaseR.ObjRotZ <= 22.99 then LaserR.Size_Z = 0.76: LaserR1.Size_Z = 0.76
  778. End if
  779. If BorgMod = 1 then
  780. If CannonBaseR.ObjRotZ >= 9 And CannonBaseR.ObjRotZ <= 22.99 then LaserR.Size_Z = 1: LaserR1.Size_Z = 1
  781. End if
  782.  
  783. If CannonBaseR.ObjRotZ >= 23 And CannonBaseR.ObjRotZ <= 28.99 then LaserR.Size_Z = 1: LaserR1.Size_Z = 1
  784. If CannonBaseR.ObjRotZ >= 29 And CannonBaseR.ObjRotZ <= 32.99 then LaserR.Size_Z = 0.785: LaserR1.Size_Z = 0.785
  785. If CannonBaseR.ObjRotZ >= 33 And CannonBaseR.ObjRotZ <= 50.99 then LaserR.Size_Z = 1: LaserR1.Size_Z = 1
  786. If CannonBaseR.ObjRotZ >= 51 And CannonBaseR.ObjRotZ <= 57.99 then LaserR.Size_Z = 0.51: LaserR1.Size_Z = 0.51
  787. If CannonBaseR.ObjRotZ >= 58 And CannonBaseR.ObjRotZ <= 62.99 then LaserR.Size_Z = 0.49: LaserR1.Size_Z = 0.49
  788. If CannonBaseR.ObjRotZ >= 63 then LaserR.Size_Z = 1: LaserR1.Size_Z = 1
  789.  
  790. If CannonBaseR.ObjRotZ <= -18 And LaserRON = 0 Then
  791. LaserR.Visible = 0
  792. LaserR1.Visible = 0
  793. LaserZTimer1.Enabled = 0
  794. End if
  795. End Sub
  796.  
  797. '***CannonPin Animation***
  798.  
  799. Sub CannonPinLTimer_Timer()
  800. If CPL = True and CannonPinL.TransZ < 35 then CannonPinL.TransZ = CannonPinL.TransZ + 10
  801. If CPL = False and CannonPinL.TransZ > 0 then CannonPinL.TransZ = CannonPinL.TransZ -10
  802. If CannonPinL.TransZ >= 35 then CPL = False
  803. End Sub
  804.  
  805.  
  806. Sub CannonPinRTimer_Timer()
  807. If CPR = True and CannonPinR.TransZ < 35 then CannonPinR.TransZ = CannonPinR.TransZ + 10
  808. If CPR = False and CannonPinR.TransZ > 0 then CannonPinR.TransZ = CannonPinR.TransZ -10
  809. If CannonPinR.TransZ >= 35 then CPR = False
  810. End Sub
  811.  
  812. '***Kickback Animation***
  813.  
  814. Sub KickBackTimer_Timer()
  815. if KB = True and KickBackP.TransZ < 60 then KickBackP.TransZ = KickBackP.TransZ +10
  816. if KB = False and KickBackP.TransZ > 0 then KickBackP.TransZ = KickBackP.TransZ -10
  817. if KickBackP.TransZ >= 60 then KB = False
  818. End Sub
  819.  
  820. '***Catapult Animation***
  821.  
  822. Sub CatapultTimer_Timer()
  823. if CP = True and Catapult.RotX < 110 then Catapult.RotX = Catapult.RotX +10
  824. if CP = False and Catapult.RotX > 90 then Catapult.RotX = Catapult.RotX -10
  825. ' if Catapult.RotX >= 107 then CP = False
  826. End Sub
  827.  
  828. '************
  829. ' SlingShots
  830. '************
  831.  
  832.  
  833. Dim RStep, Lstep
  834.  
  835. Sub SlingShotRight_Slingshot
  836. PlaySound SoundFX("SlingshotRight", DOFContactors), 0, 1, 0.05, 0.05
  837. RSling.Visible = 0
  838. RSling1.Visible = 1
  839. sling1.TransZ = -20
  840. RStep = 0
  841. SlingShotRight.TimerEnabled = 1
  842. vpmTimer.PulseSw 74
  843. End Sub
  844.  
  845. Sub SlingShotRight_Timer
  846. Select Case RStep
  847. Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -10
  848. Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.TransZ = 0:SlingShotRight.TimerEnabled = 0
  849. End Select
  850. RStep = RStep + 1
  851. End Sub
  852.  
  853. Sub SlingShotLeft_Slingshot
  854. PlaySound SoundFX("SlingshotLeft", DOFContactors), 0, 1, -0.05, 0.05
  855. LSling.Visible = 0
  856. LSling1.Visible = 1
  857. sling2.TransZ = -20
  858. LStep = 0
  859. SlingShotLeft.TimerEnabled = 1
  860. vpmTimer.PulseSw 75
  861. End Sub
  862.  
  863. Sub SlingShotLeft_Timer
  864. Select Case LStep
  865. Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -10
  866. Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.TransZ = 0:SlingShotLeft.TimerEnabled = 0
  867. End Select
  868. LStep = LStep + 1
  869. End Sub
  870.  
  871. '**********
  872. ' Keys
  873. '**********
  874.  
  875. Sub table1_KeyDown(ByVal Keycode)
  876. If KeyCode = MechanicalTilt Then
  877. vpmTimer.PulseSw vpmNudge.TiltSwitch
  878. Exit Sub
  879. End if
  880. If keycode = PlungerKey Then Controller.Switch(12) = 1
  881. If keycode = keyFront Then Controller.Switch(11) = 1
  882. If vpmKeyDown(keycode) Then Exit Sub
  883.  
  884. ' If keycode = LeftFlipperKey Then
  885. ' flipnf 0, 1
  886. ' end if
  887. ' If keycode = RightFlipperKey Then
  888. ' flipnf 1, 1
  889. ' end if
  890. End Sub
  891.  
  892. Sub table1_KeyUp(ByVal Keycode)
  893. If keycode = PlungerKey Then Controller.Switch(12) = 0
  894. If keycode = keyFront Then Controller.Switch(11) = 0
  895. If vpmKeyUp(keycode) Then Exit Sub
  896.  
  897. ' If keycode = LeftFlipperKey Then
  898. ' flipnf 0, 0
  899. ' end if
  900. ' If keycode = RightFlipperKey Then
  901. ' flipnf 1, 0
  902. ' end if
  903. End Sub
  904.  
  905. Sub table1_Paused:Controller.Pause = True:End Sub
  906. Sub table1_unPaused:Controller.Pause = False:End Sub
  907. Sub table1_exit():Controller.Pause = False:Controller.Stop:End Sub
  908.  
  909.  
  910. '******************
  911. ' Special Flippers
  912. '******************
  913.  
  914. dim FlippersEnabled
  915.  
  916. SolCallback(31) = "TiltSol"
  917.  
  918. Sub TiltSol(Enabled)
  919. FlippersEnabled = Enabled
  920. if Enabled Then
  921. ' vpmnudge.solgameon true
  922. Elseif not Enabled Then
  923. ' vpmnudge.solgameon false
  924. if FlipperL.startangle > FlipperL.endangle Then
  925. if FlipperL.currentangle < FlipperL.startangle then FlipperL.rotatetostart : leftflippersound 0 : end if
  926. elseif FlipperL.startangle < FlipperL.endangle Then
  927. if FlipperL.currentangle > FlipperL.startangle then FlipperL.rotatetostart : leftflippersound 0 : end If
  928. end If
  929. if FlipperR.startangle > FlipperR.endangle Then
  930. if FlipperR.currentangle < FlipperR.startangle then FlipperR.rotatetostart : rightflippersound 0 : end if
  931. elseif FlipperR.startangle < FlipperR.endangle Then
  932. if FlipperR.currentangle > FlipperR.startangle then FlipperR.rotatetostart : rightflippersound 0 : end If
  933. end If
  934. end if
  935. end sub
  936.  
  937.  
  938. sub flipnf(LR, DU)
  939. if LR = 0 Then 'left flipper
  940. if DU = 1 then
  941. If FlippersEnabled = True then
  942. FlipperL.rotatetoend
  943. LeftFlipperSound 1
  944. end if
  945. controller.Switch(swLLFlip) = True
  946. Elseif DU = 0 then
  947. If FlippersEnabled = True then
  948. FlipperL.rotatetoStart
  949. LeftFlipperSound 0
  950. end if
  951. controller.Switch(swLLFlip) = False
  952. end if
  953. elseif LR = 1 then ''right flipper
  954. if DU = 1 then
  955. If FlippersEnabled = True then
  956. FlipperR.rotatetoend
  957. FlipperR1.rotatetoend
  958. RightFlipperSound 1
  959. end if
  960. controller.Switch(swLRFlip) = True
  961. Elseif DU = 0 then
  962. If FlippersEnabled = True then
  963. FlipperR.rotatetoStart
  964. FlipperR1.rotatetoStart
  965. RightFlipperSound 0
  966. end if
  967. controller.Switch(swLRFlip) = False
  968. end if
  969. end if
  970. end sub
  971.  
  972. sub LeftFlipperSound(updown)'called along with the flipper, so feel free to add stuff, EOStorque tweaks, animation updates, upper flippers, whatever.
  973. if updown = 1 Then
  974. playsound SoundFX("Flipperupleft",DOFFlippers) 'flip
  975. Else
  976. playsound SoundFX("Flipperdown",DOFFlippers)'return
  977. end if
  978. end sub
  979. sub RightFlipperSound(updown)
  980. if updown = 1 Then
  981. playsound SoundFX("Flipperuprightboth",DOFFlippers) 'flip
  982. Else
  983. playsound SoundFX("Flipperdown",DOFFlippers)'return
  984. end if
  985. end sub
  986.  
  987.  
  988.  
  989. '**************
  990. ' Flipper Subs
  991. '**************
  992.  
  993. SolCallback(sLRFlipper) = "SolRFlipper"
  994. SolCallback(sLLFlipper) = "SolLFlipper"
  995.  
  996.  
  997. Sub SolLFlipper(Enabled)
  998. If Enabled Then
  999. PlaySound SoundFX("FlipperUpLeft", DOFFlippers):FlipperL.RotateToEnd
  1000. Else
  1001. PlaySound SoundFX("FlipperDown", DOFFlippers):FlipperL.RotateToStart
  1002. End If
  1003. End Sub
  1004.  
  1005. Sub SolRFlipper(Enabled)
  1006. If Enabled Then
  1007. PlaySound SoundFX("FlipperUpRightBoth", DOFFlippers):FlipperR.RotateToEnd:FlipperR1.RotateToEnd
  1008. Else
  1009. PlaySound SoundFX("FlipperDown", DOFFlippers):FlipperR.RotateToStart:FlipperR1.RotateToStart
  1010. End If
  1011. End Sub
  1012.  
  1013. '***************************************************
  1014. ' JP's VP10 Fading Lamps & Flashers
  1015. ' Based on PD's Fading Light System
  1016. ' SetLamp 0 is Off
  1017. ' SetLamp 1 is On
  1018. ' fading for non opacity objects is 4 steps
  1019. '***************************************************
  1020.  
  1021. Dim LampState(200), FadingLevel(200)
  1022. Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
  1023. Dim ccount
  1024.  
  1025. InitLamps() ' turn off the lights and flashers and reset them to the default parameters
  1026. LampTimer.Interval = 10 'lamp fading speed
  1027. LampTimer.Enabled = 1
  1028.  
  1029. Sub LampTimer_Timer()
  1030. Dim chgLamp, num, chg, ii
  1031. chgLamp = Controller.ChangedLamps
  1032. If Not IsEmpty(chgLamp) Then
  1033. For ii = 0 To UBound(chgLamp)
  1034. LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1) 'keep the real state in an array
  1035. FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
  1036. Next
  1037. End If
  1038. UpdateLamps
  1039. End Sub
  1040.  
  1041.  
  1042.  
  1043. Sub InitLamps()
  1044. Dim x
  1045. For x = 0 to 200
  1046. LampState(x) = 0 ' current light state, independent of the fading level. 0 is off and 1 is on
  1047. FadingLevel(x) = 4 ' used to track the fading state
  1048. FlashSpeedUp(x) = 0.5 ' faster speed when turning on the flasher
  1049. FlashSpeedDown(x) = 0.1 ' slower speed when turning off the flasher
  1050. FlashMax(x) = 1 ' the maximum value when on, usually 1
  1051. FlashMin(x) = 0 ' the minimum value when off, usually 0
  1052. FlashLevel(x) = 0 ' the intensity of the flashers, usually from 0 to 1
  1053. Next
  1054. End Sub
  1055.  
  1056. Sub UpdateLamps
  1057. 'Inserts
  1058. NFadeLm 11, l11
  1059. NFadeLm 11, l11b
  1060. NFadeLm 12, l12
  1061. NFadeLm 12, l12b
  1062. NFadeLm 13, l13
  1063. NFadeLm 13, l13b
  1064. NFadeLm 14, l14
  1065. NFadeLm 14, l14b
  1066. NFadeLm 15, l15
  1067. NFadeLm 15, l15b
  1068. NFadeLm 16, l16
  1069. NFadeLm 16, l16b
  1070. NFadeLm 17, l17
  1071. NFadeLm 17, l17b
  1072. NFadeLm 18, l18
  1073. NFadeLm 18, l18b
  1074.  
  1075. NFadeLm 21, l21
  1076. NFadeLm 21, l21b
  1077. NFadeLm 22, l22
  1078. NFadeLm 22, l22b
  1079. NFadeLm 23, l23
  1080. NFadeLm 23, l23b
  1081. NFadeLm 24, l24
  1082. NFadeLm 24, l24b
  1083. NFadeLm 25, l25
  1084. NFadeLm 25, l25b
  1085. Flash 26, f26
  1086. NFadeObjm 26, l26blue, "bulbcover_blueOn", "bulbcover_blue"
  1087. NFadeLm 26, l26
  1088. NFadeLm 26, l26b
  1089. NFadeLm 27, l27
  1090. NFadeLm 27, l27b
  1091. NFadeLm 28, l28
  1092. NFadeLm 28, l28b
  1093.  
  1094. NFadeLm 31, l31
  1095. NFadeLm 31, l31b
  1096. NFadeLm 32, l32
  1097. NFadeLm 32, l32b
  1098. NFadeLm 33, l33
  1099. NFadeLm 33, l33b
  1100. NFadeLm 34, l34
  1101. NFadeLm 34, l34b
  1102. NFadeLm 35, l35
  1103. NFadeLm 35, l35b
  1104. NFadeLm 36, l36
  1105. NFadeLm 36, l36b
  1106. NFadeLm 37, l37
  1107. NFadeLm 37, l37b
  1108. NFadeLm 38, l38
  1109. NFadeLm 38, l38b
  1110.  
  1111. NFadeLm 41, l41
  1112. NFadeLm 41, l41b
  1113. NFadeLm 42, l42
  1114. NFadeLm 42, l42b
  1115. NFadeLm 43, l43
  1116. NFadeLm 43, l43b
  1117. NFadeLm 44, l44
  1118. NFadeLm 44, l44b
  1119. NFadeLm 45, l45
  1120. NFadeLm 45, l45b
  1121. NFadeLm 46, l46
  1122. NFadeLm 46, l46b
  1123. NFadeLm 47, l47
  1124. NFadeLm 47, l47b
  1125. NFadeLm 48, l48
  1126. NFadeLm 48, l48b
  1127.  
  1128. NFadeLm 51, l51
  1129. NFadeLm 51, l51b
  1130. Flash 52, f52
  1131. NFadeLm 52, l52
  1132. Flash 53, f53
  1133. NFadeObjm 53, l53yellow, "bulbcover_yellowOn", "bulbcover_yellow"
  1134. NFadeLm 54, l54
  1135. NFadeLm 54, l54b
  1136. NFadeLm 55, l55
  1137. NFadeLm 55, l55b
  1138. NFadeLm 56, l56
  1139. NFadeLm 56, l56b
  1140. NFadeLm 57, l57
  1141. NFadeLm 57, l57b
  1142. NFadeLm 58, l58
  1143. NFadeLm 58, l58b
  1144.  
  1145. NFadeLm 61, l61
  1146. NFadeLm 61, l61b
  1147. NFadeLm 62, l62
  1148. NFadeLm 62, l62b
  1149. NFadeLm 63, l63
  1150. NFadeLm 63, l63b
  1151. NFadeLm 64, l64
  1152. NFadeLm 64, l64b
  1153. NFadeLm 65, l65
  1154. NFadeLm 65, l65b
  1155. NFadeLm 66, l66
  1156. NFadeLm 66, l66b
  1157. NFadeLm 67, l67
  1158. NFadeLm 67, l67b
  1159. NFadeLm 68, l68
  1160. NFadeLm 68, l68b
  1161.  
  1162. NFadeLm 71, l71
  1163. NFadeLm 71, l71b
  1164. NFadeLm 72, l72
  1165. NFadeLm 72, l72b
  1166. NFadeLm 73, l73
  1167. NFadeLm 73, l73b
  1168. NFadeLm 74, l74
  1169. NFadeLm 74, l74b
  1170. NFadeLm 75, l75
  1171. NFadeLm 75, l75b
  1172. NFadeLm 76, l76
  1173. NFadeLm 76, l76b
  1174. NFadeLm 77, l77
  1175. NFadeLm 77, l77b
  1176. NFadeLm 78, l78a
  1177. NFadeLm 78, l78b
  1178. NFadeLm 78, l78c
  1179. NFadeLm 78, l78d
  1180. NFadeLm 78, l78e
  1181.  
  1182. NFadeLm 78, l78borga
  1183. NFadeLm 78, l78borgb
  1184. NFadeLm 78, l78borgc
  1185. NFadeLm 78, l78borgd
  1186. NFadeLm 78, l78borge
  1187.  
  1188. NFadeLm 81, l81
  1189. NFadeLm 81, l81b
  1190. Flash 82, f82
  1191. NFadeLm 82, l82
  1192. NFadeLm 84, l84
  1193. NFadeLm 84, l84b
  1194. Flash 85, f85
  1195. NFadeObjm 85, l85green, "bulbcover_greenOn", "bulbcover_green"
  1196. Flash 86, f86
  1197. NFadeObjm 86, l86red, "bulbcover_redOn", "bulbcover_red"
  1198. NFadeLm 124, l124
  1199. NFadeLm 124, l124b
  1200. End Sub
  1201.  
  1202.  
  1203. Sub SetLamp(nr, value)
  1204. If value <> LampState(nr) Then
  1205. LampState(nr) = abs(value)
  1206. FadingLevel(nr) = abs(value) + 4
  1207. End If
  1208. End Sub
  1209.  
  1210. ' Lights: used for VP10 standard lights, the fading is handled by VP itself
  1211.  
  1212. Sub NFadeL(nr, object)
  1213. Select Case FadingLevel(nr)
  1214. Case 4:object.state = 0:FadingLevel(nr) = 0
  1215. Case 5:object.state = 1:FadingLevel(nr) = 1
  1216. End Select
  1217. End Sub
  1218.  
  1219. Sub NFadeLm(nr, object) ' used for multiple lights
  1220. Select Case FadingLevel(nr)
  1221. Case 4:object.state = 0
  1222. Case 5:object.state = 1
  1223. End Select
  1224. End Sub
  1225.  
  1226. Sub NFadeLmb(nr, object) ' used for multiple lights with blinking
  1227. Select Case FadingLevel(nr)
  1228. Case 4:object.state = 0
  1229. Case 5:object.state = 2
  1230. End Select
  1231. End Sub
  1232.  
  1233. 'Lights, Ramps & Primitives used as 4 step fading lights
  1234. 'a,b,c,d are the images used from on to off
  1235.  
  1236. Sub FadeObj(nr, object, a, b, c, d)
  1237. Select Case FadingLevel(nr)
  1238. Case 2:object.image = d:FadingLevel(nr) = 0 'Off
  1239. Case 3:object.image = c:FadingLevel(nr) = 2 'fading...
  1240. Case 4:object.image = b:FadingLevel(nr) = 3 'fading...
  1241. Case 5:object.image = a:FadingLevel(nr) = 1 'ON
  1242. End Select
  1243. End Sub
  1244.  
  1245. Sub FadeObjm(nr, object, a, b, c, d)
  1246. Select Case FadingLevel(nr)
  1247. Case 2:object.image = d
  1248. Case 3:object.image = c
  1249. Case 4:object.image = b
  1250. Case 5:object.image = d
  1251. End Select
  1252. End Sub
  1253.  
  1254. Sub NFadeObj(nr, object, a, b)
  1255. Select Case FadingLevel(nr)
  1256. Case 4:object.image = b:FadingLevel(nr) = 0 'off
  1257. Case 5:object.image = a:FadingLevel(nr) = 1 'on
  1258. End Select
  1259. End Sub
  1260.  
  1261. Sub NFadeObjm(nr, object, a, b)
  1262. Select Case FadingLevel(nr)
  1263. Case 4:object.image = b
  1264. Case 5:object.image = a
  1265. End Select
  1266. End Sub
  1267.  
  1268. ' Flasher objects
  1269.  
  1270. Sub Flash(nr, object)
  1271. Select Case FadingLevel(nr)
  1272. Case 4 'off
  1273. FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
  1274. If FlashLevel(nr) < FlashMin(nr) Then
  1275. FlashLevel(nr) = FlashMin(nr)
  1276. FadingLevel(nr) = 0 'completely off
  1277. End if
  1278. Object.IntensityScale = FlashLevel(nr)
  1279. Case 5 ' on
  1280. FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
  1281. If FlashLevel(nr) > FlashMax(nr) Then
  1282. FlashLevel(nr) = FlashMax(nr)
  1283. FadingLevel(nr) = 1 'completely on
  1284. End if
  1285. Object.IntensityScale = FlashLevel(nr)
  1286. End Select
  1287. End Sub
  1288.  
  1289. Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
  1290. Object.IntensityScale = FlashLevel(nr)
  1291. End Sub
  1292.  
  1293.  
  1294. '***SolModFlasher***
  1295.  
  1296. Sub Flash120(Enabled) 'JetsFlasher
  1297. l120.Intensity = enabled / 10
  1298. If enabled then
  1299. l83.State = 1
  1300. l83.Intensity = enabled / 10
  1301. Else
  1302. l83.Intensity = 20
  1303. l83.State = 0
  1304. End If
  1305. End Sub
  1306.  
  1307. Sub Flash121(Enabled) 'RightPopper
  1308. l121.Intensity = enabled / 10
  1309. End Sub
  1310.  
  1311. Sub Flash122(Enabled) 'MiddleRamp
  1312. f122.Opacity = enabled * 10
  1313. f122b.Opacity = enabled
  1314. End Sub
  1315.  
  1316. Sub Flash123(Enabled) 'ShieldFlasher
  1317. f123.Opacity = enabled * 10
  1318. f123a.Opacity = enabled * 3
  1319. End Sub
  1320.  
  1321.  
  1322. Sub Flash125(Enabled) 'LeftPopper
  1323. l125.Intensity = enabled / 10
  1324. End Sub
  1325.  
  1326. Sub Flash126(Enabled) 'RightBorgFlasher
  1327. f126.Opacity = enabled *12
  1328. f126s.Opacity = enabled /2
  1329. l78d1.Intensity = enabled
  1330. l78e1.Intensity = enabled
  1331. l78borgb1.Intensity = enabled
  1332. l78borga1.Intensity = enabled
  1333. End Sub
  1334.  
  1335. Sub Flash127(Enabled) 'LeftBorgFlasher
  1336. f127.Opacity = enabled * 8
  1337. f127s.Opacity = enabled /2
  1338. l78b1.Intensity = enabled
  1339. l78c1.Intensity = enabled
  1340. l78borgd1.Intensity = enabled
  1341. l78borge1.Intensity = enabled
  1342. End Sub
  1343.  
  1344. Sub Flash128(Enabled) 'CenterBorgFlasher
  1345. f128.Opacity = enabled * 8
  1346. f128s.Opacity = enabled
  1347. GiBigGreen.Opacity = enabled *2
  1348. l78a1.Intensity = enabled *2
  1349. l78borgc1.Intensity = enabled *2
  1350. End Sub
  1351.  
  1352. Sub Flash141(Enabled) 'RomulanFlasher
  1353. f141.Opacity = enabled *50
  1354. f141s.Opacity = enabled
  1355. f141s1.Opacity = enabled
  1356. l141.Intensity = enabled / 5
  1357. l141a.Intensity = enabled / 10
  1358. GiBigGreen.Opacity = enabled *2
  1359. End Sub
  1360.  
  1361. Sub Flash142(Enabled) 'RightRampFlasher
  1362. If Enabled Then
  1363. FlasherCapRed.Image = "dome4redOn"
  1364. Else
  1365. FlasherCapRed.Image = "dome4red"
  1366. End if
  1367. GiBigRed.Opacity = enabled *2
  1368. GiBigRed1.Opacity = enabled *2
  1369. f142.Opacity = enabled *12
  1370. l142.Intensity = enabled
  1371. f142s.Opacity = enabled
  1372. f142s1.Opacity = enabled
  1373. End Sub
  1374.  
  1375.  
  1376. 'BorgLampTimer - turns OFF the blue lamps while the green flasher are ON
  1377. Sub BorgLampTimer_Timer()
  1378. If BorgMod = 1 then
  1379. If l78a1.Intensity >= 10 Then l78a.Intensity = 0:Else:l78a.Intensity = 30:End if
  1380. If l78b1.Intensity >= 10 Then l78b.Intensity = 0:Else:l78b.Intensity = 30:End if
  1381. If l78c1.Intensity >= 10 Then l78c.Intensity = 0:Else:l78c.Intensity = 6:End if
  1382. If l78d1.Intensity >= 10 Then l78d.Intensity = 0:Else:l78d.Intensity = 30:End if
  1383. If l78e1.Intensity >= 10 Then l78e.Intensity = 0:Else:l78e.Intensity = 10:End if
  1384. End if
  1385. If BorgMod = 0 then
  1386. If l78borga1.Intensity >= 10 Then l78borga.Intensity = 0:Else:l78borga.Intensity = 15:End if
  1387. If l78borgb1.Intensity >= 10 Then l78borgb.Intensity = 0:Else:l78borgb.Intensity = 50:End if
  1388. If l78borgc1.Intensity >= 10 Then l78borgc.Intensity = 0:Else:l78borgc.Intensity = 60:End if
  1389. If l78borgd1.Intensity >= 10 Then l78borgd.Intensity = 0:Else:l78borgd.Intensity = 30:End if
  1390. If l78borge1.Intensity >= 10 Then l78borge.Intensity = 0:Else:l78borge.Intensity = 50:End if
  1391. End if
  1392. End Sub
  1393.  
  1394. '**************
  1395. '***RGB Mode***
  1396. '**************
  1397.  
  1398. Dim RGBStep, RGBFactor, Red, Green, Blue
  1399.  
  1400. RGBStep = 0
  1401. RGBFactor = 1
  1402. Red = 255
  1403. Green = 0
  1404. Blue = 0
  1405.  
  1406. Sub RGBTimer_timer 'rainbow light color changing
  1407. Select Case RGBStep
  1408. Case 0 'Green
  1409. Green = Green + RGBFactor
  1410. If Green > 255 then
  1411. Green = 255
  1412. RGBStep = 1
  1413. End If
  1414. Case 1 'Red
  1415. Red = Red - RGBFactor
  1416. If Red < 0 then
  1417. Red = 0
  1418. RGBStep = 2
  1419. End If
  1420. Case 2 'Blue
  1421. Blue = Blue + RGBFactor
  1422. If Blue > 255 then
  1423. Blue = 255
  1424. RGBStep = 3
  1425. End If
  1426. Case 3 'Green
  1427. Green = Green - RGBFactor
  1428. If Green < 0 then
  1429. Green = 0
  1430. RGBStep = 4
  1431. End If
  1432. Case 4 'Red
  1433. Red = Red + RGBFactor
  1434. If Red > 255 then
  1435. Red = 255
  1436. RGBStep = 5
  1437. End If
  1438. Case 5 'Blue
  1439. Blue = Blue - RGBFactor
  1440. If Blue < 0 then
  1441. Blue = 0
  1442. RGBStep = 0
  1443. End If
  1444. End Select
  1445. 'Light1.color = RGB(Red\10, Green\10, Blue\10)
  1446. ' light1.colorfull = RGB(Red, Green, Blue)
  1447.  
  1448. If RGBBumpers = 1 then
  1449. lbumperr.colorfull = RGB(Red, Green, Blue)
  1450. lbumperr1.colorfull = RGB(Red, Green, Blue)
  1451. lbumperr2.colorfull = RGB(Red, Green, Blue)
  1452. lbumperr3.colorfull = RGB(Red, Green, Blue)
  1453. lbumperr4.colorfull = RGB(Red, Green, Blue)
  1454. lbumperr5.colorfull = RGB(Red, Green, Blue)
  1455. End if
  1456. If RGBArrows = 1 then
  1457. l42.colorfull = RGB(Red, Green, Blue)
  1458. l42b.colorfull = RGB(Red, Green, Blue)
  1459. l46.colorfull = RGB(Red, Green, Blue)
  1460. l46b.colorfull = RGB(Red, Green, Blue)
  1461. l54.colorfull = RGB(Red, Green, Blue)
  1462. l54b.colorfull = RGB(Red, Green, Blue)
  1463. l61.colorfull = RGB(Red, Green, Blue)
  1464. l61b.colorfull = RGB(Red, Green, Blue)
  1465. l64.colorfull = RGB(Red, Green, Blue)
  1466. l64b.colorfull = RGB(Red, Green, Blue)
  1467. l71.colorfull = RGB(Red, Green, Blue)
  1468. l71b.colorfull = RGB(Red, Green, Blue)
  1469. l76.colorfull = RGB(Red, Green, Blue)
  1470. l76b.colorfull = RGB(Red, Green, Blue)
  1471. End if
  1472. 'Gi
  1473. ' gi4.colorfull = RGB(Red, Green, Blue)
  1474. ' gis7.colorfull = RGB(Red, Green, Blue)
  1475. ' gi8.colorfull = RGB(Red, Green, Blue)
  1476. ' gis8.colorfull = RGB(Red, Green, Blue)
  1477.  
  1478. End Sub
  1479.  
  1480.  
  1481. '***********
  1482. ' Update GI
  1483. '***********
  1484.  
  1485. Dim gistep, xx, obj
  1486. gistep = 1 / 8
  1487.  
  1488. Sub UpdateGI(no, step)
  1489. If step > 1 Then
  1490. DOF 200, DOFOn
  1491. Else
  1492. DOF 200, DOFOff
  1493. End If
  1494. ' If step = 0 or step = 7 then Table1.ColorGradeImage = "grade_1": exit sub
  1495. Select Case no
  1496. Case 0
  1497. For each xx in St1Shields:xx.IntensityScale = gistep*step:next
  1498. ' Case 1
  1499. ' For each xx in St2Gi1:xx.IntensityScale = gistep*step:next
  1500. ' Table1.ColorGradeImage = "grade_" & step
  1501. ' Case 2
  1502. ' For each xx in St3Gi2:xx.IntensityScale = gistep*step:next
  1503. ' Table1.ColorGradeImage = "grade_" & step
  1504. Case 3
  1505. For each xx in St4PFGI:xx.IntensityScale = gistep*step:next
  1506. Table1.ColorGradeImage = "grade_" & step
  1507. For each xx in St4PFGI: if xx.IntensityScale = 0 then Table1.ColorGradeImage = "grade_1":End if:next
  1508. Case 4
  1509. For each xx in St5ReLa:xx.IntensityScale = gistep*step:next
  1510. Table1.ColorGradeImage = "grade_" & step
  1511. For each xx in St5ReLa: if xx.IntensityScale = 0 then Table1.ColorGradeImage = "grade_1":End if:next
  1512. End Select
  1513. End Sub
  1514.  
  1515. '****************************
  1516. ' Realtime Updates
  1517. ' called by the MotorCallBack
  1518. '****************************
  1519.  
  1520. Sub RealTimeUpdates
  1521. 'flippers,gates
  1522. FlipperLP.RotY = FlipperL.CurrentAngle
  1523. FlipperRP.RotY = FlipperR.CurrentAngle
  1524. FlipperRP1.RotY = FlipperR1.CurrentAngle
  1525. diverterp.RotY = diverter.CurrentAngle
  1526. sw25spinnerp.RotX = sw25spinner.CurrentAngle +90
  1527. sw87spinnerp.RotX = sw87spinner.CurrentAngle +90
  1528. sw88spinnerp.RotX = sw88spinner.CurrentAngle +90
  1529. ' rolling sound
  1530. RollingSoundUpdate
  1531. End Sub
  1532.  
  1533. '*******************
  1534. ' WireRampDropSounds
  1535. '*******************
  1536.  
  1537. Dim SoundBall
  1538.  
  1539. Sub LeftPopperTriggerStart_Hit()
  1540. Set SoundBall = ActiveBall
  1541. vpmTimer.AddTimer 100, "WireHit'"
  1542. PlaySound "WireRamp", -1, 0.1, Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1543. End Sub
  1544.  
  1545. Sub LeftWireTriggerStart_Hit()
  1546. Set SoundBall = ActiveBall
  1547. PlaySound "WireRamp", -1, 0.1, Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1548. End Sub
  1549.  
  1550. Sub LeftWireTriggerEnd_Hit()
  1551. StopSound "WireRamp"
  1552. PlaySound "wireramp_stop", 0, 0.1, -0.2
  1553. vpmTimer.AddTimer 200, "BallDropSoundLeft'"
  1554. End Sub
  1555.  
  1556. Sub RightWireTriggerStart_Hit()
  1557. Set SoundBall = ActiveBall
  1558. PlaySound "WireRamp", -1, 0.1, Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1559. End Sub
  1560.  
  1561. Sub RightWireTriggerEnd_Hit()
  1562. StopSound "WireRamp"
  1563. PlaySound "wireramp_stop", 0, 0.1, 0.2
  1564. vpmTimer.AddTimer 200, "BallDropSoundRight'"
  1565. End Sub
  1566.  
  1567. Sub MiddleWireTriggerStart_Hit()
  1568. Set SoundBall = ActiveBall
  1569. PlaySound "WireRamp", -1, 0.1, Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1570. End Sub
  1571.  
  1572. Sub MiddleWireTriggerEnd_Hit()
  1573. ' StopSound "WireRamp"
  1574. PlaySound "wireramp_hit", 0, 0.1, 0.2
  1575. End Sub
  1576.  
  1577. Sub PlungerWireTriggerStart_Hit()
  1578. Set SoundBall = ActiveBall
  1579. PlaySound "WireRamp", -1, 0.3, Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1580. End Sub
  1581.  
  1582. Sub PlungerWireTriggerEnd_Hit()
  1583. StopSound "WireRamp"
  1584. vpmTimer.AddTimer 100, "BallDropSoundRight'"
  1585. End Sub
  1586.  
  1587. Sub BorgTrigger_Hit()
  1588. vpmTimer.AddTimer 100, "BallDropSoundCenter'"
  1589. End Sub
  1590.  
  1591. Sub BallDropSoundCenter()
  1592. PlaySound "BallDrop"
  1593. End Sub
  1594.  
  1595. Sub BallDropSoundLeft()
  1596. PlaySound "BallDrop", 0, 0.6, -0.2
  1597. End Sub
  1598.  
  1599. Sub BallDropSoundRight()
  1600. PlaySound "BallDrop", 0, 0.6, 0.2
  1601. End Sub
  1602.  
  1603. Sub WireHit()
  1604. PlaySound "WireRamp_Hit", 0, 0.6, -0.2
  1605. End Sub
  1606.  
  1607.  
  1608. ' *********************************************************************
  1609. ' Supporting Ball & Sound Functions
  1610. ' *********************************************************************
  1611.  
  1612. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  1613. Vol = Csng(BallVel(ball) ^2 / 1800)
  1614. End Function
  1615.  
  1616. Function Vol2(ball1, ball2) ' Calculates the Volume of the sound based on the speed of two balls
  1617. Vol2 = (Vol(ball1) + Vol(ball2) ) / 2
  1618. End Function
  1619.  
  1620. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  1621. Dim tmp
  1622. tmp = ball.x * 2 / table1.width-1
  1623. If tmp > 0 Then
  1624. Pan = Csng(tmp ^10)
  1625. Else
  1626. Pan = Csng(-((- tmp) ^10) )
  1627. End If
  1628. End Function
  1629.  
  1630. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1631. Pitch = BallVel(ball) * 20
  1632. End Function
  1633.  
  1634. Function BallVel(ball) 'Calculates the ball speed
  1635. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  1636. End Function
  1637.  
  1638. '*****************************************
  1639. ' JP's VP10 Rolling Sounds
  1640. '*****************************************
  1641.  
  1642. Const tnob = 6 ' total number of balls
  1643. ReDim rolling(tnob)
  1644. InitRolling
  1645.  
  1646. Sub InitRolling
  1647. Dim i
  1648. For i = 0 to tnob
  1649. rolling(i) = FALSE
  1650. Next
  1651. End Sub
  1652.  
  1653. Sub RollingSoundUpdate()
  1654. Dim BOT, b
  1655. BOT = GetBalls
  1656.  
  1657. ' stop the sound of deleted balls
  1658. For b = UBound(BOT) + 1 to tnob
  1659. rolling(b) = FALSE
  1660. StopSound("fx_ballrolling" & b)
  1661. Next
  1662.  
  1663. ' exit the sub if no balls on the table
  1664. If UBound(BOT) = -1 Then Exit Sub
  1665.  
  1666. ' play the rolling sound for each ball
  1667. For b = 0 to UBound(BOT)
  1668. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  1669. rolling(b) = TRUE
  1670. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  1671. Else
  1672. If rolling(b) = TRUE Then
  1673. StopSound("fx_ballrolling" & b)
  1674. rolling(b) = FALSE
  1675. End If
  1676. End If
  1677. Next
  1678. End Sub
  1679.  
  1680. '**********************
  1681. ' Ball Collision Sound
  1682. '**********************
  1683.  
  1684. Sub OnBallBallCollision(ball1, ball2, velocity)
  1685. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
  1686. End Sub
  1687.  
  1688. '
  1689. ''******************************
  1690. '' Diverse Collection Hit Sounds
  1691. ''******************************
  1692. '
  1693. '
  1694. 'Sub Metals_Medium_Hit(idx)
  1695. ' PlaySound "metalhit_medium", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1696. 'End Sub
  1697.  
  1698. 'Sub MetalBallGuide_Hit(idx)
  1699. ' PlaySound "metalhit_medium", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1700. 'End Sub
  1701.  
  1702. 'Sub Gates_Hit(idx)
  1703. ' PlaySound "gate", 0, 0.9, Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1704. 'End Sub
  1705.  
  1706. 'Sub Spinner_Hit(idx)
  1707. ' PlaySound "gate4", 0, 0.7, 0, 0.25
  1708. 'End Sub
  1709.  
  1710. 'Sub Rubbers_Hit(idx)
  1711. ' dim finalspeed
  1712. ' finalspeed = SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1713. ' If finalspeed > 20 then
  1714. ' PlaySound "rubber_hit_4", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1715. ' End if
  1716. ' If finalspeed >= 6 AND finalspeed <= 20 then
  1717. ' RandomSoundRubber()
  1718. ' End If
  1719. 'End Sub
  1720.  
  1721. 'Sub RandomSoundRubber()
  1722. ' Select Case Int(Rnd * 3) + 1
  1723. ' Case 1:PlaySound "rubber_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1724. ' Case 2:PlaySound "rubber_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1725. ' Case 3:PlaySound "rubber_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1726. ' End Select
  1727. 'End Sub
  1728.  
  1729. 'Sub Wall38_Hit()
  1730. ' PlaySound "rubber_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1731. 'End Sub
  1732.  
  1733. Sub FlipperL_Collide(parm)
  1734. RandomSoundFlipper()
  1735. End Sub
  1736.  
  1737. Sub FlipperR_Collide(parm)
  1738. RandomSoundFlipper()
  1739. End Sub
  1740. Sub FlipperR1_Collide(parm)
  1741. RandomSoundFlipper()
  1742. End Sub
  1743.  
  1744.  
  1745. Sub RandomSoundFlipper()
  1746. Select Case Int(Rnd * 3) + 1
  1747. Case 1:PlaySound "flip_hit_1", 0, 1, Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1748. Case 2:PlaySound "flip_hit_2", 0, 1, Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1749. Case 3:PlaySound "flip_hit_3", 0, 1, Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1750. End Select
  1751. End Sub
  1752.  
  1753. Sub SoundNeutralZone()
  1754. Select Case Int(Rnd * 3) + 1
  1755. Case 1:PlaySound "NeutralZone1"
  1756. Case 2:PlaySound "NeutralZone2"
  1757. Case 3:PlaySound "Lock"
  1758. End Select
  1759. End Sub
  1760.  
  1761.  
  1762.  
  1763. '*****************************************
  1764. ' Ball Shadow
  1765. '*****************************************
  1766.  
  1767. Dim BallShadow
  1768. BallShadow = Array (BallShadow1, BallShadow2, BallShadow3, BallShadow4, BallShadow5, BallShadow6)
  1769.  
  1770. Sub BallShadowUpdate_Timer()
  1771. Dim BOT, b
  1772. BOT = GetBalls
  1773.  
  1774. ' render the shadow for each ball
  1775. For b = 0 to UBound(BOT)
  1776. If BOT(b).X < Table1.Width/2 Then
  1777. BallShadow(b).X = ((BOT(b).X) - (50/6) + ((BOT(b).X - (Table1.Width/2))/7)) + 10
  1778. Else
  1779. BallShadow(b).X = ((BOT(b).X) + (50/6) + ((BOT(b).X - (Table1.Width/2))/7)) - 10
  1780. End If
  1781.  
  1782. BallShadow(b).Y = BOT(b).Y + 20
  1783. BallShadow(b).Z = 1
  1784. If BOT(b).Z > 20 Then
  1785. BallShadow(b).visible = 1
  1786. Else
  1787. BallShadow(b).visible = 0
  1788. End If
  1789. Next
  1790. End Sub
Advertisement
Add Comment
Please, Sign In to add comment