Advertisement
Arngrim

avengers controller.vbs

Jun 5th, 2017
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 80.30 KB | None | 0 0
  1. '********Avengers (Stern 2012) by GTXJOE
  2. '********* VPX version by sliderpoint
  3.  
  4. Option Explicit
  5. Randomize
  6.  
  7. On Error Resume Next
  8. ExecuteGlobal GetTextFile("controller.vbs")
  9. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  10. On Error Goto 0
  11.  
  12. Const BallMass = 1.25
  13. '******************* Options *********************
  14.  
  15. 'DMD Color
  16. Const DMDColor = 4 '1 = Red, 2 = Green, 3=Blue, 4=Normal (do not touch)
  17.  
  18. 'General Illumination Color
  19. Const GIColor = 1 '1 = Red/Green/Blue GI, 2 = White GI
  20.  
  21. 'Enable GI flashing
  22. Const GIFlashing = 1 '0 = GI Flashing Disable, 1 = GI Flashing Enabled
  23.  
  24. ' DMD Rotation
  25. Const cDMDRotation = 99 '0 or 1 for a DMD rotation of 90°, 99 for do not touch
  26.  
  27. ' Enable / disable analog plunger motion device
  28. 'Const MotionDeviceEnabled = 0 '0 disable, 1 enable.
  29.  
  30. '******************* Options *********************
  31. 'Sub LoadCoreVBS
  32. ' On Error Resume Next
  33. ' ExecuteGlobal GetTextFile("core.vbs")
  34. ' If Err Then MsgBox "Can't open core.vbs"
  35. ' On Error Goto 0
  36. 'End Sub
  37.  
  38. LoadVPM "01560000", "sam.VBS", 3.10
  39.  
  40. '********************
  41. 'Standard definitions
  42. '********************
  43.  
  44. Const cGameName = "avs_170"
  45.  
  46. Const UseSolenoids = 1
  47. Const UseLamps = 1
  48. Const UseSync = 1
  49. Const HandleMech = 0
  50.  
  51. 'Standard Sounds
  52. Const SSolenoidOn = "fx_solenoid"
  53. Const SSolenoidOff = ""
  54. Const SCoin = "Coin_In"
  55.  
  56.  
  57. 'Variables
  58. Dim bsL,mHulkMag,tbTrough,dtBank,Bump1, Bump2, Bump3, bsRHole, MsLHole, bsHole, bsTrough, visibleLock ,bsSaucer, mDiverter
  59. Dim PlungerIM
  60.  
  61. Dim DesktopMode: DesktopMode = Table1.ShowDT
  62.  
  63. 'Table Init
  64. Sub Table1_Init
  65. vpmInit Me
  66. With Controller
  67. .GameName = cGameName
  68. .SplashInfoLine = "Avengers Pro Stern 2012"
  69. .HandleKeyboard = 0
  70. .ShowTitle = 0
  71. .ShowDMDOnly = 1
  72. .ShowFrame = 0
  73. .HandleMechanics = 1
  74. .Hidden = 0
  75. ' If cDMDRotation <> 99 Then
  76. ' .Games(cGameName).Settings.Value("rol") = cDMDRotation
  77. ' End If
  78. '
  79. ' Select Case DMDColor:
  80. ' Case 1:
  81. ' .Games(cGameName).Settings.Value("dmd_red") = 255
  82. ' .Games(cGameName).Settings.Value("dmd_green") = 0
  83. ' .Games(cGameName).Settings.Value("dmd_blue") = 0
  84. ' Case 2:
  85. ' .Games(cGameName).Settings.Value("dmd_red") = 0
  86. ' .Games(cGameName).Settings.Value("dmd_green") = 255
  87. ' .Games(cGameName).Settings.Value("dmd_blue") = 0
  88. ' Case 3:
  89. ' .Games(cGameName).Settings.Value("dmd_red") = 0
  90. ' .Games(cGameName).Settings.Value("dmd_green") = 0
  91. ' .Games(cGameName).Settings.Value("dmd_blue") = 255
  92. ' End Select
  93.  
  94. On Error Resume Next
  95. .Run GetPlayerHWnd
  96. If Err Then MsgBox Err.Description
  97. End With
  98.  
  99. On Error Goto 0
  100.  
  101. '**Trough
  102. Set bsTrough = New cvpmBallStack
  103. bsTrough.InitSw 0, 21, 20, 19, 18, 0, 0, 0
  104. bsTrough.InitKick BallRelease, 80 , 8
  105. bsTrough.InitExitSnd SoundFX("fx_ballrel",DOFContactors), SoundFX("fx_solenoid",DOFContactors)
  106. bsTrough.Balls = 4
  107.  
  108. ' Loki Lock Init - Optos used so switch is opposite (1=no ball, 0=ball). Default to 1
  109. Controller.Switch(51) = 1
  110. Controller.Switch(50) = 1
  111. Controller.Switch(49) = 1
  112. Post51.IsDropped = 1
  113. Post50.IsDropped = 1
  114. Post49.IsDropped = 0
  115.  
  116. Set dtBank = New cvpmDropTarget 'HULK
  117. dtBank.InitDrop Array(Sw52,Sw53,Sw54,Sw55),Array(52,53,54,55) 'Walls<->Switch No.
  118. dtBank.InitSnd SoundFX("droptarget",DOFDropTargets),SoundFX("droptargetreset",DOFContactors)
  119.  
  120. RampControlGate.IsDropped = 1
  121.  
  122. ' Impulse Plunger
  123. Const IMPowerSetting = 55
  124. Const IMTime = 0.6
  125. Set plungerIM = New cvpmImpulseP
  126. With plungerIM
  127. .InitImpulseP swplunger, IMPowerSetting, IMTime
  128. .Random .5
  129. .InitExitSnd SoundFX("fx_plunger2",DOFContactors), SoundFX("fx_plunger",DOFContactors)
  130. .CreateEvents "plungerIM"
  131. End With
  132.  
  133.  
  134. 'Hulk Eject
  135. Set bsHole = New cvpmSaucer
  136. bsHole.InitKicker HulkEject, 62, 25, 11, 2
  137. bsHole.InitSounds "kicker_enter_left","fx_solenoid","popper_ball"
  138. ' bsHole.InitEntrySnd "kicker_enter_left", "kicker_enter_left"
  139. 'bsHole.kickanglevar=15
  140. 'bsHole.kickZ = 0.5
  141. 'bsHole.KickForceVar = 2
  142. 'Init Hulk
  143. 'HulkInit
  144.  
  145. 'Init Tesseract
  146. Dim obj
  147. For Each obj In colLampPoles:obj.IsDropped = 1:Next
  148. For Each obj In colLampPoles2:obj.IsDropped = 1:Next
  149. lampSpinSpeed = 0:lampLastPos = -1:SpinTimer.Enabled = True ' force update
  150.  
  151.  
  152.  
  153. Set mHulkMag= New cvpmMagnet
  154. With mHulkMag
  155. .InitMagnet HulkMag, 16
  156. .GrabCenter = True
  157. .solenoid=23
  158. .CreateEvents "mHulkMag"
  159. End With
  160.  
  161.  
  162. 'DropTargets
  163. ' Targets_Init
  164.  
  165. '**Main Timer init
  166. PinMAMETimer.Enabled = 1
  167.  
  168. 'Nudging
  169. vpmNudge.TiltSwitch=-7
  170. vpmNudge.Sensitivity=7
  171. vpmNudge.TiltObj=Array(Bumper1b,Bumper2b,Bumper3b,LeftSlingshot,RightSlingshot)
  172.  
  173. '**Bumper Rings init
  174. ' Ring1a1.IsDropped = 1:Ring1b1.IsDropped = 1
  175. ' Ring1a2.IsDropped = 1:Ring1b2.IsDropped = 1
  176. ' Ring3a.IsDropped = 1:Ring3b.IsDropped = 1
  177.  
  178. 'BumperLights init
  179. 'B1Off
  180. 'B2Off
  181. 'B3Off
  182.  
  183. 'Slings
  184. ' For each xx in RhammerA:xx.IsDropped=1:Next
  185. ' For each xx in RhammerB:xx.IsDropped=1:Next
  186. ' For each xx in RhammerC:xx.IsDropped=1:Next
  187. ' For each xx in LhammerA:xx.IsDropped=1:Next
  188. ' For each xx in LhammerB:xx.IsDropped=1:Next
  189. ' For each xx in LhammerC:xx.IsDropped=1:Next
  190.  
  191. 'GI Init
  192. ' SetLamp 135,1
  193. ' SetLamp 136,1
  194. ' SetLamp 137,1
  195. ' SetLamp 140,1
  196. '
  197. vpmMapLights AllLights
  198.  
  199. DayNight = table1.NightDay
  200. Intensity 'sets GI brightness depending on day/night slider settings
  201.  
  202. End Sub
  203.  
  204. Sub Table1_Paused:Controller.Pause = 1:End Sub
  205. Sub Table1_unPaused:Controller.Pause = 0:End Sub
  206. Sub Table1_exit():Controller.Stop: End sub
  207. 'Sub Table1_exit()
  208. ' Controller.Pause = False
  209. ' Controller.Stop
  210. 'End Sub
  211.  
  212. '*****Keys
  213. Sub Table1_KeyDown(ByVal keycode)
  214. '*****DEBUG
  215. '*****DEBUG
  216. '*****DEBUG
  217. ' rampCheck keycode 'Test Ramps
  218. If Keycode = StartGameKey Then Controller.Switch(16) = 1
  219. If Keycode = LeftFlipperKey then
  220. SolLFlipper true
  221. '*****DEBUG
  222. '*****DEBUG
  223. '*****DEBUG
  224. 'vpmtimer.pulsesw (25) 'loki multiball
  225. 'hulkprim.roty = hulkprim.roty-5
  226. End If
  227.  
  228. If Keycode = RightFlipperKey then
  229. SolRFlipper true
  230. 'hulkprim.roty = hulkprim.roty+5
  231. End If
  232. If keycode = PlungerKey Then Plunger.Pullback:Playsound"fx_plungerpull"
  233. If keycode = LeftTiltKey Then playsound SoundFX("fx_nudge_left",0)
  234. If keycode = RightTiltKey Then playsound SoundFX("fx_nudge_right",0)
  235. If keycode = CenterTiltKey Then playsound SoundFX("fx_nudge_forward",0)
  236. If vpmKeyDown(keycode) Then Exit Sub
  237. End Sub
  238.  
  239. Sub Table1_KeyUp(ByVal keycode)
  240.  
  241. If Keycode = StartGameKey Then Controller.Switch(16) = 0
  242. If vpmKeyUp(keycode) Then Exit Sub
  243. If Keycode = LeftFlipperKey then
  244. SolLFlipper false
  245. End If
  246. If Keycode = RightFlipperKey then
  247. SolRFlipper False
  248. End If
  249.  
  250. If keycode = PlungerKey Then
  251. Plunger.Fire
  252. If(BallinPlunger = 1) then 'the ball is in the plunger lane
  253. PlaySound "fx_Plunger2"
  254. else
  255. PlaySound "fx_Plunger"
  256. end if
  257. End If
  258. End Sub
  259.  
  260.  
  261. 'Sub Launchz_Hit
  262. ' ActiveBall.velz = 0
  263. 'End Sub
  264.  
  265. 'Solenoids
  266. SolCallback(1) = "solTrough"
  267. SolCallback(2) = "solAutofire"
  268. SolCallback(3) = "solHulkCCW"
  269. SolCallback(4) = "solHulkCW"
  270. SolCallback(5) = "bsHole.SolOut"
  271. SolCallback(6) = "solRaiseDtBank"
  272. SolCallback(7) = "OrbitControlGate"
  273. SolCallback(9) = "vpmSolSound SoundFX(""bumper"",DOFContactors),"
  274. SolCallback(10) = "vpmSolSound SoundFX(""bumper"",DOFContactors),"
  275. SolCallback(11) = "vpmSolSound SoundFX(""bumper"",DOFContactors),"
  276. SolCallback(12) = "solRampControlGate"
  277. 'SolCallback(15) = "SolLFlipper" ' Adding this to keydown and up to avoid slight vpm lag in flipper reaction
  278. 'SolCallback(16) = "SolRFlipper"
  279. SolCallBack(17) = "solHulkArms" 'Hulk Arms
  280. SolCallback(18) = "Flash18"'"SetLamp 118," 'Left Flasher
  281. 'SolCallback(19) = "SetLamp 119," 'Right Flasher
  282. SolCallback(20) = "Flash20" '"SetLamp 120," 'Sling Flashers
  283. SolCallback(21) = "Flash21" 'Hulk Flashers
  284. SolCallback(22) = "solLokiLockup"
  285. SolCallback(25) = "Flash25" '"SetLamp 125," 'Pop Bumper Flasher
  286. SolCallback(26) = "Flash26" '"SetLamp 126," 'Teseract Cube Flasher
  287. SolCallback(27) = "Flash27" '"SetLamp 127," 'Backwall Flasher
  288. SolCallback(28) = "Flash28" '"SetLamp 128," 'Backwall Flasher
  289. SolCallback(29) = "Flash29" '"SetLamp 129," 'Backwall Flasher
  290. SolCallback(30) = "Flash30" '"SetLamp 130," 'Backwall Flasher
  291. SolCallback(31) = "Flash31" '"SetLamp 131," 'Backwall Flasher
  292. SolCallback(32) = "Flash32" '"SetLamp 132," 'Backwall Flasher
  293.  
  294. set GICallback = GetRef("UpdateGI")
  295.  
  296. 'GI related
  297. 'SolCallback(35) = "ClearLamp 135," '
  298. 'SolCallback(36) = "ClearLamp 136," '
  299. 'SolCallback(37) = "GIClearLamp37" 'Toggle GI 140
  300. 'SolCallback(38) = "GIClearLamp38" 'Toggle GI 140
  301. 'SolCallback(39) = "GIClearLamp39" 'Toggle GI 140
  302. 'SolCallback(40) = "GIClearLamp40" 'Toggle GI 140
  303.  
  304. Sub GIClearLamp37 (enabled)
  305. If GIFlashing = 1 Then
  306. ClearLamp 140,enabled
  307. 'debug.print "Sol: 37 " & enabled
  308. End If
  309. End Sub
  310. Sub GIClearLamp38 (enabled)
  311. If GIFlashing = 1 Then
  312. ClearLamp 140,enabled
  313. 'debug.print "Sol: 38 " & enabled
  314. End If
  315. End Sub
  316. Sub GIClearLamp39 (enabled)
  317. If GIFlashing = 1 Then
  318. ClearLamp 140,enabled
  319. 'debug.print "Sol: 39 " & enabled
  320. End If
  321. End Sub
  322. Sub GIClearLamp40 (enabled)
  323. If GIFlashing = 1 Then
  324. ClearLamp 140,enabled
  325. 'debug.print "Sol: 40 " & enabled
  326. End If
  327. End Sub
  328.  
  329. Sub Flash18(enabled)
  330. If Enabled Then
  331. Flasher19a.State = 1
  332. Flasher19b.State = 1
  333. Flasher19p.image = "DomeOn"
  334. Else
  335. Flasher19a.State = 0
  336. Flasher19b.State = 0
  337. Flasher19p.image = "DomeOff"
  338. End If
  339. End Sub
  340.  
  341. Sub Flash20(enabled)
  342. If Enabled Then
  343. Flasher20a.State = 1
  344. Flasher20b.State = 1
  345. Flasher20c.State = 1
  346. Flasher20d.State = 1
  347. Spot20a.State = 1
  348. Spot20b.State = 1
  349. Flasher20p1.image = "DomeOn"
  350. Flasher20p2.image = "DomeOn"
  351. Else
  352. Flasher20a.State = 0
  353. Flasher20b.State = 0
  354. Flasher20c.State = 0
  355. Flasher20d.State = 0
  356. Spot20a.State = 0
  357. Spot20b.State = 0
  358. Flasher20p1.image = "DomeOff"
  359. Flasher20p2.image = "DomeOff"
  360. end If
  361. End Sub
  362.  
  363.  
  364. Sub Flash21(enabled)
  365. If Enabled Then
  366. Spot21a.State = 1
  367. Spot21b.State = 1
  368. Else
  369. Spot21a.State = 0
  370. Spot21b.State = 0
  371. End If
  372. End Sub
  373.  
  374.  
  375. Sub Flash25(Enabled)
  376. If Enabled then
  377. Flasher25.State = 1
  378. Else
  379. Flasher25.State = 0
  380. End If
  381. End Sub
  382.  
  383. Sub Flash26(Enabled)
  384. If Enabled then
  385. Flasher26a.State = 1
  386. Flasher26b.State = 1
  387. Flasher26c.State = 1
  388. Else
  389. Flasher26a.State = 0
  390. Flasher26b.State = 0
  391. Flasher26c.State = 0
  392. End If
  393. End Sub
  394.  
  395.  
  396. Sub Flash27(enabled)
  397. If Enabled Then
  398. Flasher27a.State = 1
  399. Flasher27b.State = 1
  400. Flasher27p.Image = "DomeOn"
  401. Else
  402. Flasher27a.State = 0
  403. Flasher27b.state = 0
  404. Flasher27p.Image = "DomeOff"
  405. End If
  406. End Sub
  407.  
  408. Sub Flash28(enabled)
  409. If Enabled Then
  410. Flasher28a.State = 1
  411. Flasher28b.State = 1
  412. Flasher28p.Image = "DomeOn"
  413. Else
  414. Flasher28a.State = 0
  415. Flasher28b.state = 0
  416. Flasher28p.Image = "DomeOff"
  417. End If
  418. End Sub
  419.  
  420. Sub Flash29(enabled)
  421. If Enabled Then
  422. Flasher29a.State = 1
  423. Flasher29b.State = 1
  424. Flasher29p.Image = "DomeOn"
  425. Else
  426. Flasher29a.State = 0
  427. Flasher29b.state = 0
  428. Flasher29p.Image = "DomeOff"
  429. End If
  430. End Sub
  431.  
  432. Sub Flash30(enabled)
  433. If Enabled Then
  434. Flasher30a.State = 1
  435. Flasher30b.State = 1
  436. Flasher30p.Image = "DomeOn"
  437. Else
  438. Flasher30a.State = 0
  439. Flasher30b.state = 0
  440. Flasher30p.Image = "DomeOff"
  441. End If
  442. End Sub
  443.  
  444. Sub Flash31(enabled)
  445. If Enabled Then
  446. Flasher31a.State = 1
  447. Flasher31b.State = 1
  448. Flasher31p.Image = "DomeOn"
  449. Else
  450. Flasher31a.State = 0
  451. Flasher31b.state = 0
  452. Flasher31p.Image = "DomeOff"
  453. End If
  454. End Sub
  455.  
  456. Sub Flash32(enabled)
  457. If Enabled Then
  458. Flasher32a.State = 1
  459. Flasher32b.State = 1
  460. Flasher32p.Image = "DomeOn"
  461. Else
  462. Flasher32a.State = 0
  463. Flasher32b.state = 0
  464. Flasher32p.Image = "DomeOff"
  465. End If
  466. End Sub
  467.  
  468.  
  469. '***DEBUG
  470. '***DEBUG
  471. '***DEBUG
  472. 'SolCallBack(3)="solcheck 3," 'Hulk CCW
  473. 'SolCallBack(4)="solcheck 4," 'Hulk CW
  474. 'SolCallBack(13)="solcheck 13,"
  475. 'SolCallBack(14)="solcheck 14,"
  476. 'SolCallBack(17)="solcheck 17," 'Hulk Arms
  477. 'SolCallBack(23)="solcheck 23," 'Hulk Magnet
  478. 'SolCallBack(24)="solcheck 24," 'Coin Meter
  479. 'SolCallBack(33)="solcheck 33,"
  480. 'SolCallBack(34)="solcheck 34,"
  481.  
  482. 'SolCallBack(35)="solcheck 35," 'toggled a lot
  483. 'SolCallBack(36)="solcheck 36," 'toggled a lot
  484. 'SolCallBack(37)="solcheck 37,"
  485. 'SolCallBack(38)="solcheck 38,"
  486. 'SolCallBack(39)="solcheck 39,"
  487. 'SolCallBack(40)="solcheck 40,"
  488. SolCallBack(41)="solcheck 41,"
  489. SolCallBack(42)="solcheck 42,"
  490. SolCallBack(43)="solcheck 43,"
  491. SolCallBack(44)="solcheck 44,"
  492. SolCallBack(45)="solcheck 45,"
  493. SolCallBack(46)="solcheck 46,"
  494. SolCallBack(47)="solcheck 47,"
  495. SolCallBack(48)="solcheck 48,"
  496.  
  497. sub solcheck(value,enabled)
  498. dim solx
  499. Select Case value
  500. Case 3: solx = "Hulk CCW"
  501. Case 4: solx = "Hulk CW"
  502. Case 5: solx = "Hulk Eject"
  503. Case 7: solx = "Orbit Control Gate"
  504. Case 8: solx = "Shaker"
  505. Case 12: solx = "Ramp Control Gate Left"
  506. Case 13: solx = "LeftSling"
  507. Case 14: solx = "RightSling"
  508. Case 17: solx = "Hulk Arms"
  509. Case 18: solx = "Flash Left"
  510. Case 19: solx = "Flash Right"
  511. Case 20: solx = "Flash Slings"
  512. Case 21: solx = "Flash Hulk"
  513. Case 23: solx = "Hulk Magnet"
  514. Case 24: solx = "Coin Meter"
  515. Case 25: solx = "Flash Pop Bumper"
  516. Case 27: solx = "Flash Back1"
  517. Case 28: solx = "Flash Back2"
  518. Case 29: solx = "Flash Back3"
  519. Case 30: solx = "Flash Back4"
  520. Case 31: solx = "Flash Back5"
  521. Case 32: solx = "Flash Back6"
  522. End Select
  523.  
  524. 'debug.print solx &": solenoid " & value &"="&enabled
  525. ' Msgbox solx &": solenoid " & value &"="&enabled
  526. End Sub
  527.  
  528.  
  529. Sub solTrough(Enabled)
  530. If Enabled Then
  531. bsTrough.ExitSol_On
  532. vpmTimer.PulseSw 22
  533. End If
  534. End Sub
  535.  
  536. sub solHulkCCW (enabled)
  537. If enabled Then
  538. HulkPrim.Roty = HulkPrim.roty + 20
  539. HulkPrim1.Roty = HulkPrim.Roty
  540. HulkPrim2.Roty = HulkPrim.Roty
  541. HulkArm1.RotateToEnd
  542. Else
  543. HulkPrim.Roty = 180
  544. HulkPrim1.Roty = HulkPrim.Roty
  545. HulkPrim2.Roty = HulkPrim.Roty
  546. HulkArm1.RotateToStart
  547. End if
  548. End Sub
  549.  
  550. sub solHulkCW (enabled)
  551. If enabled Then
  552. HulkPrim.Roty = HulkPrim.roty - 20
  553. HulkPrim1.Roty = HulkPrim.Roty
  554. HulkPrim2.Roty = HulkPrim.Roty
  555. HulkArm2.RotateToEnd
  556. Else
  557. HulkPrim.Roty = 180
  558. HulkPrim1.Roty = HulkPrim.Roty
  559. HulkPrim2.Roty = HulkPrim.Roty
  560. HulkArm2.RotateToStart
  561. End If
  562. End Sub
  563.  
  564. Dim armsup:armsup=False
  565. Sub solHulkArms (enabled)
  566. If enabled Then
  567. HulkArm1.Enabled = 0
  568. HulkArm2.Enabled = 0
  569. armsup = True
  570. Else
  571. HulkArm1.Enabled = 1
  572. HulkArm2.Enabled = 1
  573. armsup = False
  574. End If
  575. End Sub
  576.  
  577. Sub solRaiseDtBank(enabled)
  578. If enabled Then
  579. dtBank.DropSol_On
  580. ' sw52back.IsDropped=0
  581. ' sw53back.IsDropped=0
  582. ' sw54back.IsDropped=0
  583. ' sw55back.IsDropped=0
  584. sw52.IsDropped=0
  585. sw53.IsDropped=0
  586. sw54.IsDropped=0
  587. sw55.IsDropped=0
  588. End If
  589. End Sub
  590.  
  591. Sub solLokiLockup(Enabled)
  592. If Enabled Then
  593. post49.isdropped = 1: playsound SoundFX("fx_woodhit2",DOFContactors): 'DEBUG.PRINT "POST1 DOWN"
  594. Else
  595. post49.isdropped = 0: playsound SoundFX("fx_woodhit",DOFContactors)
  596. End If
  597. End Sub
  598.  
  599. 'Sub lokiTimer_Timer ()
  600. ' post49.isdropped = 0: playsound "fx_woodhit": DEBUG.PRINT "POST1 UP"
  601. ' lokiTimer.Enabled=0
  602. 'End Sub
  603.  
  604. Sub solRampControlGate(Enabled)
  605. If Enabled Then
  606. RampControlGate.IsDropped = 0: PlaySound SoundFX("fx_diverter",DOFContactors)
  607. Else
  608. RampControlGate.IsDropped = 1: PlaySound SoundFX("fx_diverter",DOFContactors)
  609. End If
  610. End Sub
  611.  
  612. Sub OrbitControlGate(enabled)
  613. If Enabled Then
  614. gate1.open=True
  615. Else
  616. gate1.open=False
  617. End If
  618. End Sub
  619.  
  620. Sub solAutofire(Enabled)
  621. If Enabled Then
  622. PlungerIM.AutoFire
  623. End If
  624. End Sub
  625.  
  626. 'Sub HulkEjectTrigger_Hit
  627. ' If ActiveBall.VelY < -15 OR ActiveBall.VelX > 15 OR ActiveBall.VelX < -15 Then
  628. ' HulkEject.Enabled = False
  629. '' HulkEjectDisableTimer.Interval = 300
  630. '' HulkEjectDisableTimer.Enabled = 1
  631. ' End If
  632. 'End Sub
  633.  
  634. Sub HulkEject_Hit
  635. ' PlaySound "kicker_enter_left"
  636. bsHole.addball me
  637. ' HulkEject.Enabled = False
  638. End Sub
  639.  
  640. 'Sub HulkEjectDisableTimer_Timer
  641. ' HulkEject.Enabled = True
  642. ' HulkEjectDisableTimer.Enabled = 0
  643. 'End Sub
  644. '
  645. '
  646. 'Sub HulkEjectDisable 'Hulk Eject too easy, so this will disable eject sometime''
  647. ' 'HulkEjectTrigger.Enabled = False
  648. ' 'HulkEjectDisableTimer.Interval = 300
  649. ' 'HulkEjectDisableTimer.Enabled = 1
  650. ' 'debug.print timer & "hulkejecttrigger disabled for 300ms"
  651. 'End Sub
  652.  
  653. 'Sub HulkEjectTrigger_Hit
  654. 'debug.print timer & "hulkejecttrigger_hit"
  655. ' HulkEject.Enabled = True
  656. 'End Sub
  657.  
  658. 'Sub HulkEject_Hit
  659. ' PlaySound "kicker_enter_left"
  660. ' 'debug.print timer & "hulkeject_hit"
  661. ' bsHole.addball 0
  662. ' HulkEject.Enabled = False
  663. 'End Sub
  664.  
  665. 'Sub HulkEjectDisable 'Hulk Eject too easy, so this will disable eject sometime''
  666. ' HulkEjectTrigger.Enabled = False
  667. ' HulkEjectDisableTimer.Interval = 300
  668. ' HulkEjectDisableTimer.Enabled = 1
  669. ' 'debug.print timer & "hulkejecttrigger disabled for 300ms"
  670. 'End Sub
  671.  
  672. 'Sub HulkEjectDisableTimer_Timer
  673. ' HulkEjectTrigger.Enabled = True
  674. ' HulkEjectDisableTimer.Enabled = 0
  675. ' 'debug.print timer & "hulkejecttrigger re-enabled"
  676. 'End Sub
  677.  
  678.  
  679.  
  680. 'Sub SolDiverter(enabled)
  681. ' If enabled Then
  682. ' 'Playsound "Diverter"
  683. ' RampDiverter.speed=0.5
  684. ' RampDiverter.rotatetoend : PlaySound "Diverter"
  685. '
  686. ' Else
  687. ' 'Playsound "Diverter"
  688. ' RampDiverter.speed=5.0
  689. ' RampDiverter.rotatetostart : PlaySound "Diverter"
  690. ' End If
  691. 'End Sub
  692.  
  693.  
  694. Sub Drain_Hit:Playsound "fx_drain":bsTrough.AddBall Me:End Sub
  695.  
  696. 'Sub sw1_Hit:Controller.Switch(1) = 1:PlaySound "fx_target_loud":End Sub 'THOR targets
  697. 'Sub sw1_UnHit:Controller.Switch(1) = 0:End Sub
  698. 'Sub sw2_Hit:Controller.Switch(2) = 1:PlaySound "fx_target_loud":End Sub 'THOR targets
  699. 'Sub sw2_UnHit:Controller.Switch(2) = 0:End Sub
  700. 'Sub sw3_Hit:Controller.Switch(3) = 1:PlaySound "fx_target_loud":End Sub 'THOR targets
  701. 'Sub sw3_UnHit:Controller.Switch(3) = 0:End Sub
  702. 'Sub sw4_Hit:Controller.Switch(4) = 1:PlaySound "fx_target_loud":End Sub 'THOR targets
  703. 'Sub sw4_UnHit:Controller.Switch(4) = 0:End Sub
  704. 'Sub sw7_Hit:Controller.Switch(7) = 1:PlaySound "fx_target_loud":End sub 'tesseract single target
  705. 'Sub sw7_UnHit:Controller.Switch(7) = 0:End Sub
  706. Sub sw10_Hit:Controller.Switch(10) = 1:PlaySound "fx_sensor":End Sub 'top lanes
  707. Sub sw10_UnHit:Controller.Switch(10) = 0:End Sub
  708. Sub sw11_Hit:Controller.Switch(11) = 1:PlaySound "fx_sensor":End Sub
  709. Sub sw11_UnHit:Controller.Switch(11) = 0:End Sub
  710. Sub sw12_Hit:Controller.Switch(12) = 1:PlaySound "fx_sensor":End Sub
  711. Sub sw12_UnHit:Controller.Switch(12) = 0:End Sub
  712. 'Sub sw13_Hit:Controller.Switch(13) = 1:PlaySound "fx_target_loud":End Sub 'tesseract targets
  713. 'Sub sw13_UnHit:Controller.Switch(13) = 0:End Sub
  714. 'Sub sw14_Hit:Controller.Switch(14) = 1:PlaySound "fx_target_loud":End Sub
  715. 'Sub sw14_UnHit:Controller.Switch(14) = 0:End Sub
  716. Sub sw23_Hit:Controller.Switch(23) = 1:clockwise=0:End sub 'shooter lane
  717. Sub sw23_UnHit:Controller.Switch(23) = 0:End Sub
  718. Sub sw24_Hit:Controller.Switch(24) = 1:PlaySound "fx_sensor":End Sub 'lanes
  719. Sub sw24_UnHit:Controller.Switch(24) = 0:End Sub
  720. Sub sw25_Hit:Controller.Switch(25) = 1:PlaySound "fx_sensor":End Sub 'lanes
  721. Sub sw25_UnHit:Controller.Switch(25) = 0:End Sub
  722. Sub sw28_Hit:Controller.Switch(28) = 1:PlaySound "fx_sensor":End Sub 'lanes
  723. Sub sw28_UnHit:Controller.Switch(28) = 0:End Sub
  724. Sub sw29_Hit:Controller.Switch(29) = 1:PlaySound "fx_sensor":End Sub 'lanes
  725. Sub sw29_UnHit:Controller.Switch(29) = 0:End Sub
  726. Sub sw33_Hit:Controller.Switch(33) = 1:End Sub 'Capt America inner loop
  727. Sub sw33_UnHit:Controller.Switch(33) = 0:End Sub
  728. 'Sub sw34_Hit:Controller.Switch(34) = 1:PlaySound "fx_target_loud":End Sub 'Shield Target
  729. 'Sub sw34_UnHit:Controller.Switch(34) = 0:End Sub
  730. 'Sub sw35_Hit:Controller.Switch(35) = 1:PlaySound "fx_target_loud":End Sub 'Right 2 bank
  731. 'Sub sw35_UnHit:Controller.Switch(35) = 0:End Sub
  732. 'Sub sw36_Hit:Controller.Switch(36) = 1:PlaySound "fx_target_loud":End Sub 'Right 2 bank
  733. 'Sub sw36_UnHit:Controller.Switch(36) = 0:End Sub
  734. Sub sw43_Hit:Controller.Switch(43) = 1:End Sub 'Black widow ramp
  735. Sub sw43_UnHit:Controller.Switch(43) = 0:End Sub
  736. Sub sw44_Spin():vpmtimer.pulsesw 44:End Sub 'Spinner
  737. Const TesseractSw1 = 45
  738. Const TesseractSw2 = 46
  739. Sub sw47_Hit:Controller.Switch(47) = 1:PlaySound "fx_sensor":End Sub 'Hawkeye outer loop
  740. Sub sw47_UnHit:Controller.Switch(47) = 0:End Sub
  741. Dim clockwise
  742. Sub sw48_Hit
  743. if clockwise = 1 then ' only register from left loop
  744. Controller.Switch(48) = 1
  745. clockwise = 0
  746. end if
  747. End Sub
  748. Sub sw48_UnHit:Controller.Switch(48) = 0:End Sub
  749. Sub Sw48a_Hit: clockwise = 1: end sub
  750. Sub sw51_hit():Controller.Switch(51) = false::end sub 'Loki Locks
  751. Sub sw51_unhit():Controller.Switch(51) = true:end sub
  752. Sub sw50_hit():Controller.Switch(50) = false:post51.isdropped = false:debug.print "POST3 UP":end sub
  753. Sub sw50_unhit():Controller.Switch(50) = true:post51.isdropped = true:debug.print "POST3 DOWN": end sub
  754. Sub sw49_hit():Controller.Switch(49) = false:post50.isdropped = false:debug.print "POST2 UP":end sub
  755. Sub sw49_unhit():Controller.Switch(49) = true:post50.isdropped = true:debug.print "POST2 DOWN":end sub
  756. Sub sw52_Hit: dtBank.Hit 1:End Sub'sw52back.IsDropped=1:HulkEjectDisable:End Sub
  757. Sub sw53_Hit: dtBank.Hit 2:End Sub 'sw53back.IsDropped=1:HulkEjectDisable:End Sub
  758. Sub sw54_Hit: dtBank.Hit 3:End Sub 'sw54back.IsDropped=1:HulkEjectDisable:End Sub
  759. Sub sw55_Hit: dtBank.Hit 4:End Sub 'sw55back.IsDropped=1
  760. Sub sw57_Hit:Controller.Switch(57) = 1:PlaySound "fx_sensor":End Sub
  761. Sub sw57_UnHit:Controller.Switch(57) = 0:End Sub
  762. Sub sw61_Hit:Controller.Switch(61) = 1:PlaySound "fx_sensor":End Sub 'Iron Man outer loop
  763. Sub sw61_UnHit:Controller.Switch(61) = 0:End Sub
  764. 'Sub sw63_Hit:Controller.Switch(63) = 1:PlaySound "fx_target_loud":End Sub 'Right 2 bank
  765. 'Sub sw63_UnHit:Controller.Switch(63) = 0:End Sub
  766. Sub swTopRight_Hit:PlaySound "fx_gate":End Sub
  767.  
  768.  
  769. 'Sub Realtime_Timer
  770. ' ' update realtime variables
  771. ' RollingSound
  772. 'End Sub
  773.  
  774. 'Animated targets/switches
  775. 'Dim Sw1cnt,Sw2cnt,Sw3cnt,Sw4cnt,Sw7cnt,Sw13cnt,Sw14cnt,Sw34cnt,Sw35cnt,Sw36cnt,Sw63cnt
  776. 'Sub Targets_Init
  777. ' Sw1a.IsDropped = 1
  778. ' Sw2a.IsDropped = 1
  779. ' Sw3a.IsDropped = 1
  780. ' Sw4a.IsDropped = 1
  781. ' Sw7a.IsDropped = 1
  782. ' Sw13a.IsDropped = 1
  783. ' Sw14a.IsDropped = 1
  784. ' Sw34a.IsDropped = 1
  785. ' Sw35a.IsDropped = 1
  786. ' Sw36a.IsDropped = 1
  787. ' Sw63a.IsDropped = 1
  788. 'End Sub
  789.  
  790. Sub Sw1_Hit:
  791. ' If Not Sw1.TimerEnabled Then
  792. ' Me.TimerEnabled = 1
  793. ' Me.TimerInterval = 200
  794. ' Sw1cnt = 0
  795. ' Sw1.IsDropped = 1
  796. ' Sw1a.IsDropped = 0
  797. vpmTimer.PulseSw 1
  798. PlaySound SoundFX("fx_target_loud",DOFTargets)
  799. ' End If
  800. End Sub
  801. 'Sub Sw1_Timer
  802. ' Sw1cnt=Sw1cnt+1
  803. ' Select Case Sw1cnt
  804. ' Case 1:Sw1.IsDropped=0:Sw1a.IsDropped=1:Me.TimerEnabled = 0
  805. ' End Select
  806. 'End Sub
  807.  
  808. Sub Sw2_Hit:
  809. ' If Not Sw2.TimerEnabled Then
  810. ' Me.TimerEnabled = 1
  811. ' Me.TimerInterval = 200
  812. ' Sw2cnt = 0
  813. ' Sw2.IsDropped = 1
  814. ' Sw2a.IsDropped = 0
  815. vpmTimer.PulseSw 2
  816. PlaySound SoundFX("fx_target_loud",DOFTargets)
  817. ' End If
  818. End Sub
  819. 'Sub Sw2_Timer
  820. ' Sw2cnt=Sw2cnt+1
  821. ' Select Case Sw2cnt
  822. ' Case 1:Sw2.IsDropped=0:Sw2a.IsDropped=1:Me.TimerEnabled = 0
  823. ' End Select
  824. 'End Sub
  825.  
  826. Sub Sw3_Hit:
  827. ' If Not Sw3.TimerEnabled Then
  828. ' Me.TimerEnabled = 1
  829. ' Me.TimerInterval = 200
  830. ' Sw3cnt = 0
  831. ' Sw3.IsDropped = 1
  832. ' Sw3a.IsDropped = 0
  833. vpmTimer.PulseSw 3
  834. PlaySound SoundFX("fx_target_loud",DOFTargets)
  835. ' End If
  836. End Sub
  837. 'Sub Sw3_Timer
  838. ' Sw3cnt=Sw3cnt+1
  839. ' Select Case Sw3cnt
  840. ' Case 1:Sw3.IsDropped=0:Sw3a.IsDropped=1:Me.TimerEnabled = 0
  841. ' End Select
  842. 'End Sub
  843.  
  844. Sub Sw4_Hit:
  845. ' If Not Sw4.TimerEnabled Then
  846. ' Me.TimerEnabled = 1
  847. ' Me.TimerInterval = 200
  848. ' Sw4cnt = 0
  849. ' Sw4.IsDropped = 1
  850. ' Sw4a.IsDropped = 0
  851. vpmTimer.PulseSw 4
  852. PlaySound SoundFX("fx_target_loud",DOFTargets)
  853. ' End If
  854. End Sub
  855. 'Sub Sw4_Timer
  856. ' Sw4cnt=Sw4cnt+1
  857. ' Select Case Sw4cnt
  858. ' Case 1:Sw4.IsDropped=0:Sw4a.IsDropped=1:Me.TimerEnabled = 0
  859. ' End Select
  860. 'End Sub
  861.  
  862. Sub Sw7_Hit:
  863. ' If Not Sw7.TimerEnabled Then
  864. ' Me.TimerEnabled = 1
  865. ' Me.TimerInterval = 200
  866. ' Sw7cnt = 0
  867. ' Sw7.IsDropped = 1
  868. ' Sw7a.IsDropped = 0
  869. vpmTimer.PulseSw 7
  870. PlaySound SoundFX("fx_target_loud",DOFTargets)
  871. ' End If
  872. End Sub
  873. 'Sub Sw7_Timer
  874. ' Sw7cnt=Sw7cnt+1
  875. ' Select Case Sw7cnt
  876. ' Case 1:Sw7.IsDropped=0:Sw7a.IsDropped=1:Me.TimerEnabled = 0
  877. ' End Select
  878. 'End Sub
  879.  
  880. Sub Sw13_Hit:
  881. ' If Not Sw13.TimerEnabled Then
  882. ' Me.TimerEnabled = 1
  883. ' Me.TimerInterval = 200
  884. ' Sw13cnt = 0
  885. ' Sw13.IsDropped = 1
  886. ' Sw13a.IsDropped = 0
  887. vpmTimer.PulseSw 13
  888. PlaySound SoundFX("fx_target_loud",DOFTargets)
  889. ' End If
  890. End Sub
  891. 'Sub Sw13_Timer
  892. ' Sw13cnt=Sw13cnt+1
  893. ' Select Case Sw13cnt
  894. ' Case 1:Sw13.IsDropped=0:Sw13a.IsDropped=1:Me.TimerEnabled = 0
  895. ' End Select
  896. 'End Sub
  897.  
  898. Sub Sw14_Hit:
  899. ' If Not Sw14.TimerEnabled Then
  900. ' Me.TimerEnabled = 1
  901. ' Me.TimerInterval = 200
  902. ' Sw14cnt = 0
  903. ' Sw14.IsDropped = 1
  904. ' Sw14a.IsDropped = 0
  905. vpmTimer.PulseSw 14
  906. PlaySound SoundFX("fx_target_loud",DOFTargets)
  907. ' End If
  908. End Sub
  909. 'Sub Sw14_Timer
  910. ' Sw14cnt=Sw14cnt+1
  911. ' Select Case Sw14cnt
  912. ' Case 1:Sw14.IsDropped=0:Sw14a.IsDropped=1:Me.TimerEnabled = 0
  913. ' End Select
  914. 'End Sub
  915.  
  916. Sub Sw34_Hit:
  917. ' If Not Sw34.TimerEnabled Then
  918. ' Me.TimerEnabled = 1
  919. ' Me.TimerInterval = 200
  920. ' Sw34cnt = 0
  921. ' Sw34.IsDropped = 1
  922. ' Sw34a.IsDropped = 0
  923. vpmTimer.PulseSw 34
  924. PlaySound SoundFX("fx_target_loud",DOFTargets)
  925. ' End If
  926. End Sub
  927. 'Sub Sw34_Timer
  928. ' Sw34cnt=Sw34cnt+1
  929. ' Select Case Sw34cnt
  930. ' Case 1:Sw34.IsDropped=0:Sw34a.IsDropped=1:Me.TimerEnabled = 0
  931. ' End Select
  932. 'End Sub
  933.  
  934. Sub Sw35_Hit:
  935. ' If Not Sw35.TimerEnabled Then
  936. ' Me.TimerEnabled = 1
  937. ' Me.TimerInterval = 200
  938. ' Sw35cnt = 0
  939. ' Sw35.IsDropped = 1
  940. ' Sw35a.IsDropped = 0
  941. vpmTimer.PulseSw 35
  942. PlaySound SoundFX("fx_target_loud",DOFTargets)
  943. ' End If
  944. End Sub
  945. 'Sub Sw35_Timer
  946. ' Sw35cnt=Sw35cnt+1
  947. ' Select Case Sw35cnt
  948. ' Case 1:Sw35.IsDropped=0:Sw35a.IsDropped=1:Me.TimerEnabled = 0
  949. ' End Select
  950. 'End Sub
  951. Sub Sw36_Hit:
  952. ' If Not Sw36.TimerEnabled Then
  953. ' Me.TimerEnabled = 1
  954. ' Me.TimerInterval = 200
  955. ' Sw36cnt = 0
  956. ' Sw36.IsDropped = 1
  957. ' Sw36a.IsDropped = 0
  958. vpmTimer.PulseSw 36
  959. PlaySound SoundFX("fx_target_loud",DOFTargets)
  960. ' End If
  961. End Sub
  962. 'Sub Sw36_Timer
  963. ' Sw36cnt=Sw36cnt+1
  964. ' Select Case Sw36cnt
  965. ' Case 1:Sw36.IsDropped=0:Sw36a.IsDropped=1:Me.TimerEnabled = 0
  966. ' End Select
  967. 'End Sub
  968. Sub Sw63_Hit:
  969. ' If Not Sw63.TimerEnabled Then
  970. ' Me.TimerEnabled = 1
  971. ' Me.TimerInterval = 200
  972. ' Sw63cnt = 0
  973. ' Sw63.IsDropped = 1
  974. ' Sw63a.IsDropped = 0
  975. PlaySound SoundFX("fx_target_loud",DOFTargets)
  976. vpmTimer.PulseSw 63
  977. ' End If
  978. End Sub
  979. 'Sub Sw63_Timer
  980. ' Sw63cnt=Sw63cnt+1
  981. ' Select Case Sw63cnt
  982. ' Case 1:Sw63.IsDropped=0:Sw63a.IsDropped=1:Me.TimerEnabled = 0
  983. ' End Select
  984. 'End Sub
  985.  
  986. '******************************************
  987. 'Added by JF
  988. '******************************************
  989.  
  990. 'Dim StartLeftFlipperStrength, StartRightFlipperStrength
  991. 'Dim StartLeftFlipperSpeed, StartRightFlipperSpeed
  992. 'Dim StartLeftFlipperReturn, StartRightFlipperReturn
  993. '
  994. 'StartLeftFlipperStrength=LeftFlipper.Strength
  995. 'StartRightFlipperStrength=RightFlipper.Strength
  996. 'StartLeftFlipperSpeed=LeftFlipper.Speed
  997. 'StartRightFlipperSpeed=RightFlipper.Speed
  998. 'StartLeftFlipperReturn=LeftFlipper.Return
  999. 'StartRightFlipperReturn=RightFlipper.Return
  1000.  
  1001.  
  1002. '******************************************
  1003. ' Use FlipperTimers to call div subs
  1004. '******************************************
  1005.  
  1006. 'Dim LFTCount:LFTCount=1
  1007. '
  1008. 'Sub LeftFlipperTimer_Timer()
  1009. ' If LFTCount < 6 Then
  1010. ' LFTCount = LFTCount + 1
  1011. '' LeftFlipper.Strength = StartLeftFlipperStrength*(LFTCount/6)
  1012. ' Else
  1013. ' Me.Enabled=0
  1014. ' End If
  1015. 'End Sub
  1016. '
  1017. 'Dim RFTCount:RFTCount=1
  1018. '
  1019. 'Sub RightFlipperTimer_Timer()
  1020. ' If RFTCount < 6 Then
  1021. ' RFTCount = RFTCount + 1
  1022. '' RightFlipper.Strength = StartRightFlipperStrength*(RFTCount/6)
  1023. ' Else
  1024. ' Me.Enabled=0
  1025. ' End If
  1026. 'End Sub
  1027.  
  1028.  
  1029. Sub SolLFlipper(Enabled)
  1030. If Enabled Then
  1031. ' LeftFlipperTimer.Enabled=0
  1032. PlaySound SoundFX("flipperup",DOFFlippers)
  1033. LeftFlipper.RotateToEnd
  1034. 'Llogo.IsDropped = 1:Llogo2.IsDropped = 0
  1035. Else
  1036. ' LFTCount=1
  1037. PlaySound SoundFX("flipperdown",DOFFlippers)
  1038. ' LeftFlipper.Speed=.05 'Temporarily drop speed for slower back draw to help visuals on quick tap
  1039. ' LeftFlipper.Return=.3 'Increase Return strength to compensate for speed drop on return to help against weak ball hit strength from underneath flipper (draining position)
  1040. LeftFlipper.RotateToStart
  1041. ' LeftFlipper.Strength = StartLeftFlipperStrength*(LFTCount/6)
  1042. ' LeftFlipperTimer.Enabled=1
  1043. ' LeftFlipper.Speed=StartLeftFlipperSpeed
  1044. ' LeftFlipper.Return=StartLeftFlipperReturn
  1045. ' Llogo.IsDropped = 0:Llogo2.IsDropped = 1
  1046. End If
  1047. ' Llogo.IsDropped = Enabled
  1048. ' Llogo2.IsDropped = Not Enabled
  1049. End Sub
  1050.  
  1051. Sub SolRFlipper(Enabled)
  1052. If Enabled Then
  1053. ' RightFlipperTimer.Enabled=0
  1054. PlaySound SoundFX("flipperup",DOFFlippers)
  1055. RightFlipper.RotateToEnd':RightFlipper1.RotateToEnd
  1056. 'Rlogo.IsDropped = 1:Rlogo2.IsDropped = 0
  1057. Else
  1058. ' RFTCount=1
  1059. PlaySound SoundFX("flipperdown",DOFFlippers)
  1060. ' RightFlipper.Speed=.05 'Temporarily drop speed for slower back draw to help visuals on quick tap
  1061. ' RightFlipper.Return=.3 'Increase Return strength to compensate for speed drop on return to help against weak ball hit strength from underneath flipper (draining position)
  1062. RightFlipper.RotateToStart':RightFlipper1.RotateToStart
  1063. ' RightFlipper.Strength = StartRightFlipperStrength*(RFTCount/6)
  1064. ' RightFlipperTimer.Enabled=1
  1065. ' RightFlipper.Speed=StartRightFlipperSpeed
  1066. ' RightFlipper.Return=StartRightFlipperReturn
  1067. 'Rlogo.IsDropped = 0:Rlogo2.IsDropped = 1
  1068. End If
  1069. 'Rlogo.IsDropped = Enabled
  1070. 'Rlogo2.IsDropped = Not Enabled
  1071. End Sub
  1072.  
  1073.  
  1074. Sub BallRelease_UnHit():End Sub
  1075.  
  1076. '***Slings and rubbers
  1077. ' Slings
  1078. Dim LStep, RStep
  1079.  
  1080. Sub LeftSlingShot_Slingshot
  1081. vpmTimer.PulseSw 26
  1082. PlaySound SoundFX("slingshot",DOFContactors)
  1083. End Sub
  1084.  
  1085. Sub RightSlingShot_Slingshot
  1086. vpmTimer.PulseSw 27
  1087. PlaySound SoundFX("slingshot",DOFContactors)
  1088. End Sub
  1089.  
  1090. 'Bumpers
  1091. Sub Bumper1b_Hit:vpmTimer.PulseSw 31:PlaySound SoundFX("bumper",DOFContactors):bump1 = 1:End Sub
  1092. Sub Bumper2b_Hit:vpmTimer.PulseSw 30:PlaySound SoundFX("bumper",DOFContactors):bump2 = 1:End Sub
  1093. Sub Bumper3b_Hit:vpmTimer.PulseSw 32:PlaySound SoundFX("bumper",DOFContactors):bump3 = 1:End Sub
  1094. 'Sounds
  1095. dim speedx
  1096. dim speedy
  1097. dim finalspeed
  1098.  
  1099. 'Sub Rubbers_Hit(IDX)
  1100. ' finalspeed=SQR(ActiveBall.velx * ActiveBall.velx + ActiveBall.vely * ActiveBall.vely)
  1101. ' if finalspeed > 11 then PlaySound "fx_rubber" else PlaySound "fx_rubber_Flipper":end if
  1102. 'End Sub
  1103.  
  1104. 'Rubber Sounds
  1105. Sub Rubbers_Hit(idx)
  1106. dim finalspeed
  1107. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1108. If finalspeed > 14 then
  1109. PlaySound "bump"
  1110. End if
  1111. If finalspeed >= 4 AND finalspeed <= 14 then
  1112. RandomSoundRubber()
  1113. End If
  1114. If finalspeed < 4 AND finalspeed > 1 then
  1115. RandomSoundRubberLowVolume()
  1116. End If
  1117. Dampen 12, .80, 3
  1118. End sub
  1119.  
  1120. Sub RandomSoundRubber()
  1121. Select Case Int(Rnd*3)+1
  1122. Case 1 : PlaySound "rubber_hit_1"
  1123. Case 2 : PlaySound "rubber_hit_2"
  1124. Case 3 : PlaySound "rubber_hit_3"
  1125. End Select
  1126. End Sub
  1127.  
  1128. Sub RandomSoundRubberLowVolume()
  1129. Select Case Int(Rnd*3)+1
  1130. Case 1 : PlaySound "rubber_hit_1_low"
  1131. Case 2 : PlaySound "rubber_hit_2_low"
  1132. Case 3 : PlaySound "rubber_hit_3_low"
  1133. End Select
  1134. End Sub
  1135.  
  1136.  
  1137. Sub Gates_Hit(IDX):PlaySound"fx_gate":End Sub
  1138.  
  1139. 'Sub LeftFlipper_Collide(parm)
  1140. ' PlaySound "fx_rubber_Flipper"
  1141. 'End Sub
  1142. '
  1143. 'Sub RightFlipper_Collide(parm)
  1144. ' PlaySound "fx_rubber_Flipper"
  1145. 'End Sub
  1146.  
  1147. 'Flipper Collide Sounds
  1148.  
  1149. Sub LeftFlipper_Collide(parm)
  1150. dim finalspeed
  1151. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1152. If finalspeed > 4 then
  1153. RandomSoundFlipper()
  1154. Else
  1155. RandomSoundFlipperLowVolume()
  1156. End If
  1157. End Sub
  1158.  
  1159. Sub RightFlipper_Collide(parm)
  1160. dim finalspeed
  1161. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1162. If finalspeed > 4 then
  1163. RandomSoundFlipper()
  1164. Else
  1165. RandomSoundFlipperLowVolume()
  1166. End If
  1167. End Sub
  1168.  
  1169.  
  1170. Sub RandomSoundFlipper()
  1171. Select Case Int(Rnd*3)+1
  1172. Case 1 : PlaySound "flip_hit_1"
  1173. Case 2 : PlaySound "flip_hit_2"
  1174. Case 3 : PlaySound "flip_hit_3"
  1175. End Select
  1176. End Sub
  1177.  
  1178. Sub RandomSoundFlipperLowVolume()
  1179. Select Case Int(Rnd*3)+1
  1180. Case 1 : PlaySound "flip_hit_1_low"
  1181. Case 2 : PlaySound "flip_hit_2_low"
  1182. Case 3 : PlaySound "flip_hit_3_low"
  1183. End Select
  1184. End Sub
  1185.  
  1186.  
  1187. Sub DropLeft_Hit
  1188. PlaySound "drop_left"
  1189. End Sub
  1190.  
  1191. Sub DropLeft2_Hit
  1192. PlaySound "drop_left"
  1193. End Sub
  1194.  
  1195. Sub DropRight_Hit
  1196. PlaySound "drop_right"
  1197. End Sub
  1198.  
  1199. Sub Post49_Hit
  1200. PlaySound "fx_plastichit"
  1201. End Sub
  1202.  
  1203. Sub Post50_Hit
  1204. PlaySound "fx_ballpool"
  1205. End Sub
  1206.  
  1207. Sub Post51_Hit
  1208. PlaySound "fx_ballpool"
  1209. End Sub
  1210.  
  1211. Sub MetalRamp_Hit
  1212. PlaySound "rail"
  1213. End Sub
  1214. Sub MetalRamp_UnHit
  1215. StopSound "rail"
  1216. End Sub
  1217.  
  1218. 'Dim PlayMetalSound
  1219. 'Dim PlayMetalSound2
  1220. 'Sub MetalIn_Hit
  1221. ' PlayMetalSound = 1
  1222. ' PlayMetalSound2 = 0
  1223. 'End Sub
  1224. '
  1225. 'Sub MetalOut_Hit
  1226. ' if PlayMetalSound = 1 then
  1227. ' PlaySound "rail"
  1228. ' End If
  1229. ' PlayMetalSound = 0
  1230. ' PlayMetalSound2 = 0
  1231. 'End Sub
  1232. '
  1233. 'Sub MetalOut2_Hit
  1234. ' if PlayMetalSound2 = 1 then
  1235. ' PlaySound "rail"
  1236. ' End If
  1237. ' PlayMetalSound = 0
  1238. ' PlayMetalSound2 = 0
  1239. 'End Sub
  1240. '*************************
  1241. ' Plunger kicker animation
  1242. '*************************
  1243. '****************************************
  1244.  
  1245. ' SetLamp 0 is Off
  1246. ' SetLamp 1 is On
  1247. ' LampState(x) current state
  1248. '****************************************
  1249.  
  1250. 'GI - add any new GI lights to the collection "GI" to control them together.
  1251. Dim ig
  1252.  
  1253. Sub UpdateGI(no, Enabled)
  1254. Select Case no
  1255. Case 0 'Top
  1256. If Enabled Then
  1257. DOF 102, DOFOn
  1258. For each ig in GI:ig.State = 1:Next
  1259. For each ig in GIbulbs:ig.State = 1:Next
  1260. Else
  1261. DOF 102, DOFOff
  1262. For each ig in GI:ig.State = 0:Next
  1263. For each ig in GIbulbs:ig.State = 0:Next
  1264. End If
  1265. End Select
  1266. End Sub
  1267.  
  1268.  
  1269. Dim GILevel, DayNight, xx
  1270.  
  1271. Sub Intensity
  1272. If DayNight <= 20 Then
  1273. GILevel = .5
  1274. ElseIf DayNight <= 40 Then
  1275. GILevel = .4125
  1276. ElseIf DayNight <= 60 Then
  1277. GILevel = .325
  1278. ElseIf DayNight <= 80 Then
  1279. GILevel = .2375
  1280. Elseif DayNight <= 100 Then
  1281. GILevel = .15
  1282. End If
  1283.  
  1284. For each xx in GI: xx.IntensityScale = xx.IntensityScale * (GILevel*2): Next
  1285. For each xx in GIbulbs: xx.IntensityScale = xx.IntensityScale * (GILevel*2): Next
  1286. End Sub
  1287. ' end GI subs
  1288.  
  1289.  
  1290. '
  1291. '
  1292. ' Dim LampState(200)
  1293. ' Dim x,RefreshARlight
  1294. ' AllLampsOff()
  1295. ' LampTimer.Interval = 40
  1296. ' LampTimer.Enabled = 1
  1297. '
  1298. ' Sub LampTimer_Timer()
  1299. ' Dim chgLamp, num, chg, ii
  1300. ' chgLamp = Controller.ChangedLamps
  1301. ' If Not IsEmpty(chgLamp) Then
  1302. ' For ii = 0 To UBound(chgLamp)
  1303. ' LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4
  1304. ' Next
  1305. ' End If
  1306. '
  1307. ' UpdateLamps
  1308. ' End Sub
  1309. '
  1310. '
  1311. '
  1312. ' Sub UpdateLamps
  1313. ' FadeL 3, l3, l3a
  1314. ' FadeL2 4, l4
  1315. ' FadeL2 5, l5
  1316. ' FadeL2 6, l6
  1317. ' FadeL2 7, l7
  1318. ' FadeL2 8, l8
  1319. ' FadeL2 9, l9
  1320. ' FadeL2 10, l10
  1321. ' FadeL2 11, l11
  1322. ' FadeL2 12, l12
  1323. ' FadeL2 13, l13
  1324. ' FadeL2 14, l14
  1325. ' FadeL2 15, l15
  1326. ' FadeL2 16, l16
  1327. ' FadeL2 17, l17
  1328. ' FadeL 18, l18, l18a
  1329. ' FadeL 19, l19, l19a
  1330. ' FadeLm 20, l20, l20a
  1331. ' FadeL 20, l20x, l20xa
  1332. ' FadeL 21, l21, l21a
  1333. ' FadeL 22, l22, l22a
  1334. ' FadeL2 23, l23
  1335. ' FadeL 24, l24, l24a
  1336. ' FadeL 25, l25, l25a
  1337. ' FadeL 26, l26, l26a
  1338. ' FadeL 27, l27, l27a
  1339. ' FadeL 28, l28, l28a
  1340. ' FadeL 29, l29, l29a
  1341. ' FadeL 30, l30, l30a
  1342. ' FadeL 31, l31, l31a
  1343. ' FadeL 32, l32, l32a
  1344. ' FadeL 33, l33, l33a
  1345. ' FadeL 34, l34, l34a
  1346. ' FadeL 35, l35, l35a
  1347. ' FadeL 36, l36, l36a
  1348. ' FadeL 37, l37, l37a
  1349. ' FadeL 38, l38, l38a
  1350. ' FadeL 39, l39, l39a
  1351. '' FadeL 40, l40, l40a
  1352. ' FadeL2 41, l41
  1353. ' FadeL2 42, l42
  1354. ' FadeL2 43, l43
  1355. ' FadeL2 44, l44
  1356. ' FadeL2 45, l45
  1357. ' FadeL2 46, l46
  1358. ' FadeL2 47, l47
  1359. '' Reflection 48,l48_r 'hulk target reflection
  1360. ' FadeL2 48, l48
  1361. '' Reflection 49,l49_r 'hulk target reflection
  1362. ' FadeL2 49, l49
  1363. '' Reflection 50,l50_r 'hulk target reflection
  1364. ' FadeL2 50, l50
  1365. ' FadeL2 51, l51
  1366. ' FadeL2 52, l52
  1367. ' FadeL 53, l53, l53a
  1368. ' FadeL 54, l54, l54a
  1369. ' FadeL 55, l55, l55a
  1370. '' FadeL 56, l56, l56a
  1371. ' FadeL 57, l57, l57a
  1372. ' FadeL 58, l58, l58a
  1373. '' FadeL 59, l59, l59a
  1374. '' FlashAR 59, f59b, "wf_on", "wf_a", "wf_b", ARRefresh
  1375. '' FadeL 60, l60, l60 'bumpers
  1376. '' FadeL 61, l61, l61
  1377. '' FadeL 62, l62, l62
  1378. ' 'Reflection 63,l63_r
  1379. ' FadeL 63, l63, l63a
  1380. ' 'debug.print "63:" &lampstate(63)
  1381. ' FadeL 65, l65, l65a
  1382. ' FadeL 66, l66, l66a
  1383. ' FadeL 67, l67, l67a
  1384. ' FadeL 68, l68, l68a
  1385. ' FadeL 69, l69, l69a
  1386. ' 'Reflection 70,l70_r
  1387. ' FadeL 70, l70, l70a
  1388. ' FadeL 78, l78, l78a
  1389. '' FadeL 71, l71, l71a
  1390. ''
  1391. ''
  1392. '' FlashARm 117, f117b, "bf_on", "bf_a", "bf_b", ARRefresh
  1393. '' FlashAR 118, f118, "rf_on", "rf_a", "rf_b", ARRefresh
  1394. '' FlashARm 119, f119a, "rf_on", "rf_a", "rf_b", ARRefresh
  1395. '' FlashAR 119, f119, "rf_on", "rf_a", "rf_b", ARRefresh
  1396. '' FlashARm 120, f120b, "rf_on", "rf_a", "rf_b", ARRefresh
  1397. '' FlashAR 120, f120, "rf_on", "rf_a", "rf_b", ARRefresh
  1398. '' FlashAR 121, f121, "gf_on", "gf_a", "gf_b", ARRefresh
  1399. '' FlashAR 125, f125, "wf_on", "wf_a", "wf_b", ARRefresh
  1400. '' FlashAR 126, f126, "bf_on", "bf_a", "bf_b", ARRefresh
  1401. '' FlashAR 127, f127, "bf_on", "bf_a", "bf_b", ARRefresh
  1402. '' FlashAR 128, f128, "lf_on", "lf_a", "lf_b", ARRefresh
  1403. '' FlashAR 129, f129, "gf_on", "gf_a", "gf_b", ARRefresh
  1404. '' FlashAR 130, f130, "rf_on", "rf_a", "rf_b", ARRefresh
  1405. '' FlashAR 131, f131, "wf_on", "wf_a", "wf_b", ARRefresh
  1406. '' FlashAR 132, f132, "yf_on", "yf_a", "yf_b", ARRefresh
  1407. '' FlashAR 71, f171, "gf_on", "gf_a", "gf_b", ARRefresh
  1408. '' FlashAR 73, f173, "gf_on", "gf_a", "gf_b", ARRefresh
  1409. '' FlashAR 75, f175, "gf_on", "gf_a", "gf_b", ARRefresh
  1410. ''
  1411. '' FlashAR 60, f160, "rf_on", "rf_a", "rf_b", ARRefresh 'bumpers
  1412. '' FlashAR 61, f161, "bf_on", "bf_a", "bf_b", ARRefresh
  1413. '' FlashAR 62, f162, "wf_on", "wf_a", "wf_b", ARRefresh
  1414. '
  1415. ' 'GI hulk blinks 136/137, ramp blinks 135/136 guessing =greenGI, 137=blueGI, 136= redGI
  1416. ' 'black widow when it says black widow all gi went off
  1417. ' ' tessaract when it starts glowing, gi stays blue
  1418. ' 'sol38 for thor - blue,
  1419. ' ' when hulk say bridge out, pf goes green, when yelling pf flash off /green. then blue/red flashing during mball play. green flashed 3:48(jackpot) 3:56, 4;07 when hulk animate
  1420. ' 'https://www.youtube.com/watch?v=VyIqeS1QGKk
  1421. '
  1422. ' If GIColor = 1 Then
  1423. ' FadeGixm 140, gir_pf1, "r", 8
  1424. ' FadeGixm 140, gir_pf4, "r", 8
  1425. ' FadeGixm 140, gir_pf5, "r", 8
  1426. ' FadeGixm 140, gir_pf6, "r", 8
  1427. ' FadeGixm 140, gir_pf8, "r", 8
  1428. ' FadeGixm 140, gir_Plastic1, "r", 8
  1429. ' FadeGixm 140, gir_Plastic10, "r", 8
  1430. ' FadeGixm 140, gir_Plastic11, "r", 8
  1431. ' FadeGixm 140, gir_Plastic12, "r", 8
  1432. ' FadeGixm 140, gir_Plastic13, "r", 8
  1433. ' FadeGixm 140, gir_Plastic4, "r", 8
  1434. ' FadeGixm 140, gir_Plastic5, "r", 5
  1435. ' FadeGixm 140, gir_Plastic6, "r", 5
  1436. ' FadeGixm 140, gir_Plastic7, "r", 5
  1437. ' FadeGixm 140, gir_Plastic9, "r", 8
  1438. '
  1439. ' FadeGixm 140, gig_pf1, "g", 3
  1440. ' FadeGixm 140, gig_pf10, "g", 8
  1441. ' FadeGixm 140, gig_pf100, "g", 8
  1442. ' FadeGixm 140, gig_pf101, "g", 8
  1443. ' FadeGixm 140, gig_pf11, "g", 8
  1444. ' FadeGixm 140, gig_pf14, "g", 8
  1445. ' FadeGixm 140, gig_pf15, "g", 5
  1446. ' FadeGixm 140, gig_pf18, "g", 8
  1447. ' FadeGixm 140, gig_pf2, "g", 8
  1448. ' FadeGixm 140, gig_pf4, "g", 3
  1449. ' FadeGixm 140, gig_pf5, "g", 8
  1450. ' FadeGixm 140, gig_pf6, "g", 5
  1451. ' FadeGixm 140, gig_pf7, "g", 8
  1452. ' FadeGixm 140, gig_pf8, "g", 8
  1453. ' FadeGixm 140, gig_pf9, "g", 8
  1454. ' FadeGixm 140, gig_Plastic1, "g", 8
  1455. ' FadeGixm 140, gig_Plastic10, "g", 8
  1456. ' FadeGixm 140, gig_Plastic11, "g", 8
  1457. ' FadeGixm 140, gig_Plastic12, "g", 8
  1458. ' FadeGixm 140, gig_Plastic13, "g", 8
  1459. ' FadeGixm 140, gig_Plastic15, "g", 8
  1460. ' FadeGixm 140, gig_Plastic16, "g", 8
  1461. ' FadeGixm 140, gig_Plastic17, "g", 8
  1462. ' FadeGixm 140, gig_Plastic18, "g", 8
  1463. ' FadeGixm 140, gig_Plastic2, "g", 8
  1464. ' FadeGixm 140, gig_Plastic3, "g", 8
  1465. ' FadeGixm 140, gig_Plastic4, "g", 8
  1466. ' FadeGixm 140, gig_Plastic5, "g", 8
  1467. ' FadeGixm 140, gig_Plastic6, "g", 8
  1468. ' FadeGixm 140, gig_Plastic8, "g", 8
  1469. ' FadeGixm 140, gig_Plastic9, "g", 8
  1470. '
  1471. ' FadeGixm 140, gib_pf1, "b", 8
  1472. ' FadeGixm 140, gib_pf10, "b", 5
  1473. ' FadeGixm 140, gib_pf11, "b", 5
  1474. ' FadeGixm 140, gib_pf2, "b", 8
  1475. ' FadeGixm 140, gib_pf3, "b", 8
  1476. ' FadeGixm 140, gib_pf4, "b", 8
  1477. ' FadeGixm 140, gib_pf5, "b", 8
  1478. ' FadeGixm 140, gib_pf6, "b", 8
  1479. ' FadeGixm 140, gib_pf8, "b", 5
  1480. ' FadeGixm 140, gib_pf9, "b", 5
  1481. ' FadeGixm 140, gib_Plastic1, "b", 8
  1482. ' FadeGixm 140, gib_Plastic2, "b", 8
  1483. ' FadeGixm 140, gib_Plastic3, "b", 8
  1484. ' FadeGixm 140, gib_Plastic4, "b", 8
  1485. ' FadeGixm 140, gib_Plastic5, "b", 8
  1486. ' FadeGixm 140, gib_Plastic6, "b", 8
  1487. ' FadeGixm 140, gib_Plastic7, "b", 8
  1488. ' FadeGixm 140, gib_Plastic8, "b", 8
  1489. ' FadeGixm 140, gib_Plastic9, "b", 8
  1490. ' FadeGixm 140, gib_Plastic10, "b", 8
  1491. ' FadeGixm 140, gib_Plastic11, "b", 8
  1492. ' FadeGixm 140, gib_Plastic12, "b", 8
  1493. ' FadeGix 140, gib_Plastic13, "b", 8
  1494. '
  1495. ' Else
  1496. ' FadeGixm 140, gir_pf1, "", 8
  1497. ' FadeGixm 140, gir_pf4, "", 8
  1498. ' FadeGixm 140, gir_pf5, "", 8
  1499. ' FadeGixm 140, gir_pf6, "", 8
  1500. ' FadeGixm 140, gir_pf8, "", 8
  1501. ' FadeGixm 140, gir_Plastic1, "", 8
  1502. ' FadeGixm 140, gir_Plastic10, "", 8
  1503. ' FadeGixm 140, gir_Plastic11, "r", 8
  1504. ' FadeGixm 140, gir_Plastic12, "r", 8
  1505. ' FadeGixm 140, gir_Plastic13, "r", 8
  1506. ' FadeGixm 140, gir_Plastic4, "", 8
  1507. ' FadeGixm 140, gir_Plastic5, "", 5
  1508. ' FadeGixm 140, gir_Plastic6, "", 5
  1509. ' FadeGixm 140, gir_Plastic7, "", 5
  1510. ' FadeGixm 140, gir_Plastic9, "", 8
  1511. '
  1512. ' FadeGixm 140, gig_pf1, "", 3
  1513. ' FadeGixm 140, gig_pf10, "", 8
  1514. ' FadeGixm 140, gig_pf100, "g", 8
  1515. ' FadeGixm 140, gig_pf101, "g", 8
  1516. ' FadeGixm 140, gig_pf11, "g", 8
  1517. ' FadeGixm 140, gig_pf14, "g", 8
  1518. ' FadeGixm 140, gig_pf15, "", 5
  1519. ' FadeGixm 140, gig_pf18, "g", 8
  1520. ' FadeGixm 140, gig_pf2, "", 8
  1521. ' FadeGixm 140, gig_pf4, "", 3
  1522. ' FadeGixm 140, gig_pf5, "", 8
  1523. ' FadeGixm 140, gig_pf6, "", 5
  1524. ' FadeGixm 140, gig_pf7, "", 8
  1525. ' FadeGixm 140, gig_pf8, "", 8
  1526. ' FadeGixm 140, gig_pf9, "", 8
  1527. ' FadeGixm 140, gig_Plastic1, "", 8
  1528. ' FadeGixm 140, gig_Plastic10, "", 8
  1529. ' FadeGixm 140, gig_Plastic11, "g", 8
  1530. ' FadeGixm 140, gig_Plastic12, "", 8
  1531. ' FadeGixm 140, gig_Plastic13, "", 8
  1532. ' FadeGixm 140, gig_Plastic15, "", 8
  1533. ' FadeGixm 140, gig_Plastic16, "", 8
  1534. ' FadeGixm 140, gig_Plastic17, "", 8
  1535. ' FadeGixm 140, gig_Plastic18, "g", 8
  1536. ' FadeGixm 140, gig_Plastic2, "", 8
  1537. ' FadeGixm 140, gig_Plastic3, "", 8
  1538. ' FadeGixm 140, gig_Plastic4, "", 8
  1539. ' FadeGixm 140, gig_Plastic5, "", 8
  1540. ' FadeGixm 140, gig_Plastic6, "", 8
  1541. ' FadeGixm 140, gig_Plastic8, "", 8
  1542. ' FadeGixm 140, gig_Plastic9, "", 8
  1543. '
  1544. ' FadeGixm 140, gib_pf1, "", 8
  1545. ' FadeGixm 140, gib_pf10, "", 5
  1546. ' FadeGixm 140, gib_pf11, "", 5
  1547. ' FadeGixm 140, gib_pf2, "", 8
  1548. ' FadeGixm 140, gib_pf3, "", 8
  1549. ' FadeGixm 140, gib_pf4, "", 8
  1550. ' FadeGixm 140, gib_pf5, "", 8
  1551. ' FadeGixm 140, gib_pf6, "", 8
  1552. ' FadeGixm 140, gib_pf8, "", 5
  1553. ' FadeGixm 140, gib_pf9, "", 5
  1554. ' FadeGixm 140, gib_Plastic1, "", 8
  1555. ' FadeGixm 140, gib_Plastic2, "", 8
  1556. ' FadeGixm 140, gib_Plastic3, "", 8
  1557. ' FadeGixm 140, gib_Plastic4, "", 8
  1558. ' FadeGixm 140, gib_Plastic5, "", 8
  1559. ' FadeGixm 140, gib_Plastic6, "", 8
  1560. ' FadeGixm 140, gib_Plastic7, "", 8
  1561. ' FadeGixm 140, gib_Plastic8, "", 8
  1562. ' FadeGixm 140, gib_Plastic9, "", 8
  1563. ' FadeGixm 140, gib_Plastic10, "", 8
  1564. ' FadeGixm 140, gib_Plastic11, "", 8
  1565. ' FadeGixm 140, gib_Plastic12, "", 8
  1566. ' FadeGix 140, gib_Plastic13, "", 8
  1567. ' End If
  1568. '' FlashARm 118, f118b, "of_on", "of_a", "of_b", ARRefresh
  1569. '' FlashAR 118, f118, "of_on", "of_a", "of_b", ARRefresh
  1570. '' FlashAR 121, f121, "yf_on", "yf_a", "yf_b", ARRefresh
  1571. '' FlashAR 122, f122, "rf_on", "rf_a", "rf_b", ARRefresh
  1572. '' FlashAR 125, f125, "wf_on", "wf_a", "wf_b", ARRefresh
  1573. '' FlashAR 127, f127, "rf_on", "rf_a", "rf_b", ARRefresh
  1574. '' FlashARm 128, f128, "yf_on", "yf_a", "yf_b", ARRefresh
  1575. '' FlashARm 128, f128a, "wf_on", "wf_a", "wf_b", ARRefresh
  1576. '' FlashAR 128, f128b, "yf_on", "yf_a", "yf_b", ARRefresh
  1577. '' FlashARm 129, f129, "wf_on", "wf_a", "wf_b", ARRefresh
  1578. '' FlashAR 129, f129a, "yf_on", "yf_a", "yf_b", ARRefresh
  1579. '' FlashAR 131, f131, "rf_on", "rf_a", "rf_b", ARRefresh
  1580. ''
  1581. '
  1582. ''example
  1583. '' FadeGim 100, gi_Plastic12, "", true
  1584. '' FadeGim 100, gi_Plastic13, "", true
  1585. '' FadeGi 100, gi_Plastic14, "", true
  1586. '
  1587. ' End Sub
  1588. '
  1589. 'Sub FadeGix (nr, ramp, color, max)
  1590. 'dim col
  1591. ' col = "gi" & color
  1592. ' Select Case max
  1593. '' Case 8: FlashAr nr, ramp, col & 8, col & 5, col & 2, ARRefresh
  1594. '' Case 6: FlashAr nr, ramp, col & 6, col & 3, col & 2, ARRefresh
  1595. '' Case 5: FlashAr nr, ramp, col & 5, col & 3, col & 2, ARRefresh
  1596. '' Case 3: FlashAr nr, ramp, col & 3, col & 2, col & 2, ARRefresh
  1597. '' Case 2: FlashAr nr, ramp, col & 2, col & 2, col & 2, ARRefresh
  1598. ' End Select
  1599. 'end sub
  1600. '
  1601. 'Sub FadeGixm (nr, ramp, color, max)
  1602. 'dim col
  1603. ' col = "gi" & color
  1604. ' Select Case max
  1605. '' Case 8: FlashArm nr, ramp, col & 8, col & 5, col & 2, ARRefresh
  1606. '' Case 6: FlashArm nr, ramp, col & 6, col & 3, col & 2, ARRefresh
  1607. '' Case 5: FlashArm nr, ramp, col & 5, col & 3, col & 2, ARRefresh
  1608. '' Case 3: FlashArm nr, ramp, col & 3, col & 2, col & 2, ARRefresh
  1609. '' Case 2: FlashArm nr, ramp, col & 2, col & 2, col & 2, ARRefresh
  1610. ' End Select
  1611. 'end sub
  1612. '
  1613. ''Sub Reflection(nr, ramp) 'used for reflections when there is no off ramp
  1614. '' Select Case LampState(nr)
  1615. ''' Case 2:ramp.alpha = 0':ramp.TriggerSingleUpdate:LampState(nr) = 0 'Off
  1616. ''' Case 3:ramp.alpha = 0'.3:ramp.TriggerSingleUpdate:LampState(nr) = 2 'fading...
  1617. ''' Case 4:ramp.alpha = 0'.6:ramp.TriggerSingleUpdate:LampState(nr) = 3 'fading...
  1618. ''' Case 6:ramp.alpha = 1':ramp.TriggerSingleUpdate:LampState(nr) = 1 'ON
  1619. '' End Select
  1620. ''End Sub
  1621. ''
  1622. ''Sub FlashARm(nr, ramp, imga, imgb, imgc, r) 'used for reflections when the off is transparent - no ramp
  1623. '' Select Case LampState(nr)
  1624. '' Case 2:ramp.alpha = 0
  1625. '' r.State = ABS(r.state -1)
  1626. '' Case 3:ramp.image = imgc
  1627. '' r.State = ABS(r.state -1)
  1628. '' Case 4:ramp.image = imgb
  1629. '' r.State = ABS(r.state -1)
  1630. '' Case 5:ramp.alpha = 1
  1631. '' ramp.image = imgb
  1632. '' r.State = ABS(r.state -1)
  1633. '' Case 6:ramp.image = imga
  1634. '' r.State = ABS(r.state -1)
  1635. '' End Select
  1636. ''End Sub
  1637. ''
  1638. ''
  1639. ''Sub FlashAR(nr, ramp, imga, imgb, imgc, r) 'used for reflections when the off is transparent - no ramp
  1640. '' Select Case LampState(nr)
  1641. '' Case 2:ramp.alpha = 0
  1642. '' r.State = ABS(r.state -1)
  1643. '' LampState(nr) = 0 'Off
  1644. '' Case 3:ramp.image = imgc
  1645. '' r.State = ABS(r.state -1)
  1646. '' LampState(nr) = 2 'fading...
  1647. '' Case 4:ramp.image = imgb
  1648. '' r.State = ABS(r.state -1)
  1649. '' LampState(nr) = 3 'fading...
  1650. '' Case 5:ramp.alpha = 1
  1651. '' ramp.image = imgb
  1652. '' r.State = ABS(r.state -1)
  1653. '' LampState(nr) = 6 ' 1/2 ON
  1654. '' Case 6:ramp.image = imga
  1655. '' r.State = ABS(r.state -1)
  1656. '' LampState(nr) = 1 'ON
  1657. '' End Select
  1658. ''End Sub
  1659. '
  1660. ' Sub AllLampsOff():For x = 1 to 200:LampState(x) = 4:Next:UpdateLamps:UpdateLamps:Updatelamps:End Sub
  1661. '
  1662. ' Sub SetLamp(nr, value):LampState(nr) = abs(value) + 4:End Sub
  1663. ' Sub ClearLamp(nr, value)
  1664. ' if value = 0 then
  1665. ' LampState(nr) = abs(1) + 4 ' Opposite of Setlamp
  1666. ' else
  1667. ' LampState(nr) = abs(0) + 4 ' Opposite of Setlamp
  1668. ' End if
  1669. 'End sub
  1670. '
  1671. ' Sub FadeWm(nr, a, b, c)
  1672. ' Select Case LampState(nr)
  1673. ' Case 2:c.IsDropped = 1
  1674. ' Case 3:b.IsDropped = 1:c.IsDropped = 0
  1675. ' Case 4:a.IsDropped = 1:b.IsDropped = 0
  1676. ' Case 5:b.IsDropped = 1:c.IsDropped = 0
  1677. ' Case 6:c.IsDropped = 1:a.IsDropped = 0
  1678. ' End Select
  1679. ' End Sub
  1680. '
  1681. ' Sub FadeW(nr, a, b, c)
  1682. ' Select Case LampState(nr)
  1683. ' Case 2:c.IsDropped = 1:LampState(nr) = 0 'Off
  1684. ' Case 3:b.IsDropped = 1:c.IsDropped = 0:LampState(nr) = 2 'fading...
  1685. ' Case 4:a.IsDropped = 1:b.IsDropped = 0:LampState(nr) = 3 'fading...
  1686. ' Case 5:b.IsDropped = 1:c.IsDropped = 0:LampState(nr) = 6 'turning ON
  1687. ' Case 6:c.IsDropped = 1:a.IsDropped = 0:LampState(nr) = 1 'ON
  1688. ' End Select
  1689. ' End Sub
  1690. '
  1691. ' Sub FadeLm(nr, a, b)
  1692. ' Select Case LampState(nr)
  1693. ' Case 2:b.state = 0
  1694. ' Case 3:b.state = 1
  1695. ' Case 4:a.state = 0
  1696. ' Case 5:a.state = 1
  1697. ' 'Case 5:b.state = 1
  1698. ' 'Case 6:a.state = 1
  1699. ' End Select
  1700. ' End Sub
  1701. '
  1702. ' Sub FadeL(nr, a, b)
  1703. ' Select Case LampState(nr)
  1704. ' Case 2:b.state = 0:LampState(nr) = 0
  1705. ' Case 3:b.state = 1:LampState(nr) = 2
  1706. ' Case 4:a.state = 0:LampState(nr) = 3
  1707. ' Case 5:a.state = 1:LampState(nr) = 1
  1708. '' Case 5:b.state = 1:LampState(nr) = 6
  1709. '' Case 6:a.state = 1:LampState(nr) = 1
  1710. ' End Select
  1711. ' End Sub
  1712. '
  1713. ' Sub FadeL2m(nr, a)
  1714. ' Select Case LampState(nr)
  1715. ' Case 2:a.state = 0:
  1716. ' Case 6:a.state = 1:
  1717. ' End Select
  1718. ' End Sub
  1719. '
  1720. ' Sub FadeL2(nr, a)
  1721. ' Select Case LampState(nr)
  1722. ' Case 2:a.state = 0:LampState(nr) = 0
  1723. ' Case 3:LampState(nr) = 2
  1724. ' Case 4:LampState(nr) = 3
  1725. ' Case 5::LampState(nr) = 6
  1726. ' Case 6:a.state = 1:LampState(nr) = 1
  1727. ' End Select
  1728. ' End Sub
  1729.  
  1730. 'Dim LenghtRamp:LenghtRamp=470
  1731. 'Dim LenghtRampl:LenghtRampl=900
  1732. 'Dim LenghtRamps:LenghtRamps=390
  1733. '
  1734. '
  1735. 'Sub HideRamp (aRamp)
  1736. ' aRamp.WidthBottom = 0
  1737. ' aRamp.WidthTop = 0
  1738. 'End Sub
  1739. '
  1740. 'Sub ShowRamp (aRamp, Width)
  1741. ' aRamp.WidthBottom = Width
  1742. ' aRamp.WidthTop = Width
  1743. 'End Sub
  1744. '
  1745. 'Sub UpdateChangedRamp (aLight)
  1746. ' aLight.State = ABS(aLight.state -1)
  1747. '
  1748. 'End Sub
  1749.  
  1750.  
  1751. '***********************
  1752. 'Alpha Ramp Plunger
  1753. '***********************
  1754.  
  1755. Dim PNewPos, POldPos
  1756. Dim BallinPlunger
  1757. 'InitARPlunger
  1758. 'Dim PlungerWidth
  1759. 'PlungerWidth = 25
  1760.  
  1761. 'Sub InitARPlunger
  1762. ' Dim i
  1763. ' PRefresh.State = ABS(PRefresh.state -1)
  1764. ' PNewPos = 0:POldPos = 0
  1765. ' BallinPlunger = 0
  1766. 'End Sub
  1767.  
  1768. Sub swPlunger_Hit:BallinPlunger = 1:End Sub 'CallGI(1) 'in this sub you may add a switch, for example Controller.Switch(14) = 1
  1769.  
  1770. Sub swPlunger_UnHit:BallinPlunger = 0:End Sub 'in this sub you may add a switch, for example Controller.Switch(14) = 0
  1771.  
  1772.  
  1773. '*************************************
  1774. ' Nudge System
  1775. '*************************************
  1776. '
  1777. 'Dim LeftNudgeEffect, RightNudgeEffect, NudgeEffect
  1778. '
  1779. 'Sub LeftNudge(angle, strength, delay)
  1780. ' vpmNudge.DoNudge angle, (strength * (delay-LeftNudgeEffect) / delay) + RightNudgeEffect / delay
  1781. ' LeftNudgeEffect = delay
  1782. ' RightNudgeEffect = 0
  1783. ' RightNudgeTimer.Enabled = 0
  1784. ' LeftNudgeTimer.Interval = delay
  1785. ' LeftNudgeTimer.Enabled = 1
  1786. 'End Sub
  1787. '
  1788. 'Sub RightNudge(angle, strength, delay)
  1789. ' vpmNudge.DoNudge angle, (strength * (delay-RightNudgeEffect) / delay) + LeftNudgeEffect / delay
  1790. ' RightNudgeEffect = delay
  1791. ' LeftNudgeEffect = 0
  1792. ' LeftNudgeTimer.Enabled = 0
  1793. ' RightNudgeTimer.Interval = delay
  1794. ' RightNudgeTimer.Enabled = 1
  1795. 'End Sub
  1796. '
  1797. 'Sub CenterNudge(angle, strength, delay)
  1798. ' vpmNudge.DoNudge angle, strength * (delay-NudgeEffect) / delay
  1799. ' NudgeEffect = delay
  1800. ' NudgeTimer.Interval = delay
  1801. ' NudgeTimer.Enabled = 1
  1802. 'End Sub
  1803. '
  1804. 'Sub LeftNudgeTimer_Timer()
  1805. ' LeftNudgeEffect = LeftNudgeEffect-1
  1806. ' If LeftNudgeEffect = 0 then LeftNudgeTimer.Enabled = 0
  1807. 'End Sub
  1808. '
  1809. 'Sub RightNudgeTimer_Timer()
  1810. ' RightNudgeEffect = RightNudgeEffect-1
  1811. ' If RightNudgeEffect = 0 then RightNudgeTimer.Enabled = 0
  1812. 'End Sub
  1813. '
  1814. 'Sub NudgeTimer_Timer()
  1815. ' NudgeEffect = NudgeEffect-1
  1816. ' If NudgeEffect = 0 then NudgeTimer.Enabled = 0
  1817. 'End Sub
  1818.  
  1819. 'Sub NewBallID ' Assign new ball object and give it ID for tracking
  1820. 'End Sub
  1821. '
  1822. 'Sub ClearBallID
  1823. 'On Error Resume Next ' Error handling for debugging purposes
  1824. ' On Error Goto 0
  1825. 'End Sub
  1826.  
  1827.  
  1828.  
  1829. ' *********************************************************************
  1830. ' Supporting Ball & Sound Functions
  1831. '**********************************************************************
  1832. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  1833. Vol = Csng(BallVel(ball) ^2 / 2000)
  1834. End Function
  1835.  
  1836. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  1837. Dim tmp
  1838. tmp = ball.x * 2 / table1.width-1
  1839. If tmp > 0 Then
  1840. Pan = Csng(tmp ^10)
  1841. Else
  1842. Pan = Csng(-((- tmp) ^10) )
  1843. End If
  1844. End Function
  1845.  
  1846. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1847. Pitch = BallVel(ball) * 20
  1848. End Function
  1849.  
  1850. Function BallVel(ball) 'Calculates the ball speed
  1851. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  1852. End Function
  1853.  
  1854. '*****************************************
  1855. ' JP's VP10 Rolling Sounds
  1856. '*****************************************
  1857. Const tnob = 5 ' total number of balls
  1858. ReDim rolling(tnob)
  1859. InitRolling
  1860.  
  1861. Sub InitRolling
  1862. Dim i
  1863. For i = 0 to tnob
  1864. rolling(i) = False
  1865. Next
  1866. End Sub
  1867.  
  1868. Sub RollingTimer_Timer()
  1869. Dim BOT, b
  1870. BOT = GetBalls
  1871.  
  1872. ' stop the sound of deleted balls
  1873. For b = UBound(BOT) + 1 to tnob
  1874. rolling(b) = False
  1875. StopSound("fx_ballrolling" & b)
  1876. Next
  1877.  
  1878. ' exit the sub if no balls on the table
  1879. If UBound(BOT) = -1 Then Exit Sub
  1880.  
  1881. ' play the rolling sound for each ball
  1882. For b = 0 to UBound(BOT)
  1883. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  1884. rolling(b) = True
  1885. PlaySound("fx_ballrolling" & b), -1, (Vol(BOT(b) )*2), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  1886. Else
  1887. If rolling(b) = True Then
  1888. StopSound("fx_ballrolling" & b)
  1889. rolling(b) = False
  1890. End If
  1891. End If
  1892. Next
  1893. End Sub
  1894.  
  1895. '**********************
  1896. ' Ball Collision Sound
  1897. '**********************
  1898. Sub OnBallBallCollision(ball1, ball2, velocity)
  1899. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
  1900. End Sub
  1901.  
  1902.  
  1903. ''*****************************************************************************
  1904. ''***************** Ball Rolling Sounds ****************************
  1905. ''*****************************************************************************
  1906. 'Dim VeloY(3), VeloX(3), rolling(3), b
  1907. 'b = 0
  1908. '
  1909. 'Sub RollingSound()
  1910. ' b = b + 1
  1911. ' If b> 3 Then b = 1
  1912. ' If BallStatus(b) = 0 Then
  1913. ' If rolling(b) = True Then
  1914. ' StopSound "fx_ballrolling" &b
  1915. ' rolling(b) = False
  1916. ' Exit Sub
  1917. ' Else
  1918. ' Exit Sub
  1919. ' End If
  1920. ' End if
  1921. '
  1922. ' VeloY(b) = Cint(CurrentBall(b).VelY)
  1923. ' VeloX(b) = Cint(CurrentBall(b).VelX)
  1924. ' If(ABS(VeloY(b) )> 3 or ABS(VeloX(b) )> 3) and CurrentBall(b).Z <55 Then
  1925. ' If rolling(b) = True then
  1926. ' Exit Sub
  1927. ' Else
  1928. ' rolling(b) = True
  1929. ' PlaySound "fx_ballrolling" &b
  1930. ' End If
  1931. ' Else
  1932. ' If rolling(b) = True Then
  1933. ' StopSound "fx_ballrolling" &b
  1934. ' rolling(b) = False
  1935. ' End If
  1936. ' End If
  1937. 'End Sub
  1938. '
  1939. ''*****************************************************************************
  1940. ''***************** B2B ****************************
  1941. ''*****************************************************************************
  1942. '
  1943. 'Set vpmCreateBall = GetRef("mypersonalcreateballroutine")
  1944. 'Function mypersonalcreateballroutine(aKicker)
  1945. ' For cnt = 1 to ubound(ballStatus) ' Loop through all possible ball IDs
  1946. ' If ballStatus(cnt) = 0 Then ' If ball ID is available...
  1947. ' If Not IsEmpty(vpmBallImage) Then
  1948. ' Set currentball(cnt) = aKicker.CreateBall ' Set ball object with the first available ID
  1949. ' Else
  1950. ' Set currentball(cnt) = aKicker.CreateBall
  1951. ' End If
  1952. ' Set mypersonalcreateballroutine = aKicker
  1953. ' currentball(cnt).uservalue = cnt ' Assign the ball's uservalue to it's new ID
  1954. ' ballStatus(cnt) = 1 ' Mark this ball status active
  1955. ' ballStatus(0) = ballStatus(0) + 1 ' Increment ballStatus(0), the number of active balls
  1956. ' If coff = False Then ' If collision off, overrides auto-turn on collision detection
  1957. ' ' If more than one ball active, start collision detection process
  1958. ' If ballStatus(0)> 1 and XYdata.enabled = False Then XYdata.enabled = True
  1959. ' End If
  1960. ' Exit For ' New ball ID assigned, exit loop
  1961. ' End If
  1962. ' Next
  1963. 'End Function
  1964. '
  1965. '
  1966. 'Dim tnopb, nosf
  1967. ''
  1968. 'tnopb = 10
  1969. 'nosf = 10
  1970. '
  1971. 'Dim currentball(10), ballStatus(10)
  1972. 'Dim iball, cnt, coff, errMessage
  1973. '
  1974. 'XYdata.interval = 1
  1975. 'coff = False
  1976. '
  1977. 'For cnt = 0 to ubound(ballStatus)
  1978. ' ballStatus(cnt) = 0
  1979. 'Next
  1980. '
  1981. '' Create ball in kicker and assign a Ball ID used mostly in non-vpm tables
  1982. 'Sub CreateBallID(Kickername)
  1983. ' For cnt = 1 to ubound(ballStatus)
  1984. ' If ballStatus(cnt) = 0 Then
  1985. ' Set currentball(cnt) = Kickername.createball
  1986. ' currentball(cnt).uservalue = cnt
  1987. ' ballStatus(cnt) = 1
  1988. ' ballStatus(0) = ballStatus(0) + 1
  1989. ' If coff = False Then
  1990. ' If ballStatus(0)> 1 and XYdata.enabled = False Then XYdata.enabled = True
  1991. ' End If
  1992. ' Exit For
  1993. ' End If
  1994. ' Next
  1995. 'End Sub
  1996. '
  1997. 'Sub ClearBallID
  1998. ' On Error Resume Next
  1999. ' iball = ActiveBall.uservalue
  2000. ' currentball(iball).UserValue = 0
  2001. ' If Err Then Msgbox Err.description & vbCrLf & iball
  2002. ' ballStatus(iBall) = 0
  2003. ' ballStatus(0) = ballStatus(0) -1
  2004. ' On Error Goto 0
  2005. 'End Sub
  2006. '
  2007. '' Ball data collection and B2B Collision detection. jpsalas: added height check
  2008. 'ReDim baX(tnopb, 4), baY(tnopb, 4), baZ(tnopb, 4), bVx(tnopb, 4), bVy(tnopb, 4), TotalVel(tnopb, 4)
  2009. 'Dim cForce, bDistance, xyTime, cFactor, id, id2, id3, B1, B2
  2010. '
  2011. 'Sub XYdata_Timer()
  2012. ' xyTime = Timer + (XYdata.interval * .001)
  2013. ' If id2 >= 4 Then id2 = 0
  2014. ' id2 = id2 + 1
  2015. ' For id = 1 to ubound(ballStatus)
  2016. ' If ballStatus(id) = 1 Then
  2017. ' baX(id, id2) = round(currentball(id).x, 2)
  2018. ' baY(id, id2) = round(currentball(id).y, 2)
  2019. ' baZ(id, id2) = round(currentball(id).z, 2)
  2020. ' bVx(id, id2) = round(currentball(id).velx, 2)
  2021. ' bVy(id, id2) = round(currentball(id).vely, 2)
  2022. ' TotalVel(id, id2) = (bVx(id, id2) ^2 + bVy(id, id2) ^2)
  2023. ' If TotalVel(id, id2)> TotalVel(0, 0) Then TotalVel(0, 0) = int(TotalVel(id, id2) )
  2024. ' End If
  2025. ' Next
  2026. '
  2027. ' id3 = id2:B2 = 2:B1 = 1
  2028. ' Do
  2029. ' If ballStatus(B1) = 1 and ballStatus(B2) = 1 Then
  2030. ' bDistance = int((TotalVel(B1, id3) + TotalVel(B2, id3) ) ^1.04)
  2031. ' If ABS(baZ(B1, id3) - baZ(B2, id3) ) <50 Then
  2032. ' If((baX(B1, id3) - baX(B2, id3) ) ^2 + (baY(B1, id3) - baY(B2, id3) ) ^2) <2800 + bDistance Then collide B1, B2:Exit Sub
  2033. ' End If
  2034. ' End If
  2035. ' B1 = B1 + 1
  2036. ' If B1 >= ballStatus(0) Then Exit Do
  2037. ' If B1 >= B2 then B1 = 1:B2 = B2 + 1
  2038. ' Loop
  2039. '
  2040. ' If ballStatus(0) <= 1 Then XYdata.enabled = False
  2041. '
  2042. ' If XYdata.interval >= 40 Then coff = True:XYdata.enabled = False
  2043. ' If Timer> xyTime * 3 Then coff = True:XYdata.enabled = False
  2044. ' If Timer> xyTime Then XYdata.interval = XYdata.interval + 1
  2045. 'End Sub
  2046. '
  2047. ''Calculate the collision force and play sound
  2048. 'Dim cTime, cb1, cb2, avgBallx, cAngle, bAngle1, bAngle2
  2049. '
  2050. 'Sub Collide(cb1, cb2)
  2051. ' If TotalVel(0, 0) / 1.8> cFactor Then cFactor = int(TotalVel(0, 0) / 1.8)
  2052. ' avgBallx = (bvX(cb2, 1) + bvX(cb2, 2) + bvX(cb2, 3) + bvX(cb2, 4) ) / 4
  2053. ' If avgBallx <bvX(cb2, id2) + .1 and avgBallx> bvX(cb2, id2) -.1 Then
  2054. ' If ABS(TotalVel(cb1, id2) - TotalVel(cb2, id2) ) <.000005 Then Exit Sub
  2055. ' End If
  2056. ' If Timer <cTime Then Exit Sub
  2057. ' cTime = Timer + .1
  2058. ' GetAngle baX(cb1, id3) - baX(cb2, id3), baY(cb1, id3) - baY(cb2, id3), cAngle
  2059. ' id3 = id3 - 1:If id3 = 0 Then id3 = 4
  2060. ' GetAngle bVx(cb1, id3), bVy(cb1, id3), bAngle1
  2061. ' GetAngle bVx(cb2, id3), bVy(cb2, id3), bAngle2
  2062. ' cForce = Cint((abs(TotalVel(cb1, id3) * Cos(cAngle-bAngle1) ) + abs(TotalVel(cb2, id3) * Cos(cAngle-bAngle2) ) ) )
  2063. ' If cForce <4 Then Exit Sub
  2064. ' cForce = Cint((cForce) / (cFactor / nosf) )
  2065. ' If cForce> nosf-1 Then cForce = nosf-1
  2066. ' PlaySound("fx_collide" & cForce)
  2067. 'End Sub
  2068. '
  2069. '' Get angle
  2070. 'Dim Xin, Yin, rAngle, Radit, wAngle, Pi
  2071. 'Pi = Round(4 * Atn(1), 6) '3.1415926535897932384626433832795
  2072. '
  2073. 'Sub GetAngle(Xin, Yin, wAngle)
  2074. ' If Sgn(Xin) = 0 Then
  2075. ' If Sgn(Yin) = 1 Then rAngle = 3 * Pi / 2 Else rAngle = Pi / 2
  2076. ' If Sgn(Yin) = 0 Then rAngle = 0
  2077. ' Else
  2078. ' rAngle = atn(- Yin / Xin)
  2079. ' End If
  2080. ' If sgn(Xin) = -1 Then Radit = Pi Else Radit = 0
  2081. ' If sgn(Xin) = 1 and sgn(Yin) = 1 Then Radit = 2 * Pi
  2082. ' wAngle = round((Radit + rAngle), 4)
  2083. 'End Sub
  2084.  
  2085. 'Sub Trigger1_hit
  2086. ' PlaySound "DROP_LEFT"
  2087. ' End Sub
  2088. '
  2089. ' Sub Trigger2_hit
  2090. ' PlaySound "DROP_RIGHT"
  2091. ' End Sub
  2092.  
  2093.  
  2094. '==========================================================================================
  2095. ' This code may be freely distributed, but is not to be included with any profit-making
  2096. ' software or product without the express permission from this script author, JimmyFingers.
  2097. '==========================================================================================
  2098. ' '
  2099. ' '
  2100. '==========================================================================================
  2101. ' Many thanks to all of the who people contribute towards the VP code, table builds, scans /
  2102. ' graphics, script writers, etc. Enjoy and if you use in a table build / release, please
  2103. ' only change parameters and not the main script / code (credit would also be appreciated
  2104. '==========================================================================================
  2105.  
  2106. '*****Requires B2B script addition placed before this script addition*****
  2107.  
  2108. '******************************************
  2109. ' Momentum Funtions
  2110. '******************************************
  2111. '
  2112. 'const MomentumEnabled=False
  2113. '
  2114. 'dim m, BallRollAngle, MXQuotient, MYUQuotient, MYDDecayQuotient, XDelta, RealVelX, RealVelY
  2115. 'dim AngleMultiplierX, ChangeFactorX, AngleMultiplierY, ChangeFactorY, BallRollDegrees
  2116. 'ReDim PreviousVeloX(tnopb)
  2117. '
  2118. 'For m = 1 To Ubound(PreviousVeloX)
  2119. ' PreviousVeloX(m)=0
  2120. 'Next
  2121. '
  2122. ''MXThreshold=6 (previously 9)
  2123. ''MXCutoff=.5 (previously 1)
  2124. ''MXLevel=.045 (previously .035)
  2125. ''MYULevel=.09 (previously .08)
  2126. ''MYDThreshold=1 (previously 2)
  2127. '
  2128. 'const MXThreshold=6 'Speed at which X momentum equation kicks in
  2129. 'const MXCutoff=.5 'Speed at which X momentum equation cuts-off
  2130. 'const MXLevel=.045 'Factor for 1 + MXLevel - calculations
  2131. 'MXQuotient=MXThreshold/MXLevel
  2132. '
  2133. 'const MYUThreshold=-6 'Speed at which Y Up momentum equation kicks in (- for up table)
  2134. 'const MYUCutoff=-.5 'Speed at which Y Up momentum equation cuts-off (- for up table)
  2135. 'const MYULevel=.09 'Factor for 1 + MYULevel - calculations
  2136. 'MYUQuotient=ABS(MYUThreshold/MYULevel)
  2137. '
  2138. 'const MYDThreshold=1 'Speed at which Y Down momentum equation kicks in
  2139. 'const MYDMAX=32 'Speed at which Y Down momentum equation steps out
  2140. 'const MYDLevel=.072 'Factor for 1 + MYDLevel - calculations
  2141. 'MYDDecayQuotient=ABS(MYDMAX/MYDLevel)
  2142. '
  2143. 'MomentumTimer.Interval = 60 'Should remain at 60 for proper operation
  2144. '
  2145. ''******************************************
  2146. '' Use Timer to call Momentum subs
  2147. ''******************************************
  2148. '
  2149. 'Sub MomentumTimer_Timer()
  2150. ' Momentum
  2151. 'End Sub
  2152. '
  2153. 'Sub Momentum()
  2154. ' If MomentumEnabled=False Then Exit Sub
  2155. ' 'This section handles Ball Physics, updating all balls every timer interval
  2156. ' For m = 1 to ubound(BallStatus)
  2157. ' If BallStatus(m) = 1 Then
  2158. ' XDelta=ABS(PreviousVeloX(m))-ABS(CurrentBall(m).VelX)
  2159. ' RealVelX = CurrentBall(m).VelX
  2160. ' RealVelY = CurrentBall(m).VelY
  2161. ' GetAngle Cint(RealVelX),Cint(RealVelY), BallRollAngle
  2162. ' BallRollDegrees = Round(BallRollAngle*180/3.141592,3)
  2163. '
  2164. ' If ABS(RealVelX) <= MXThreshold AND ABS(RealVelX) > MXCutoff Then
  2165. ' If XDelta > 0 Then
  2166. ' AngleMultiplierX=Round(ABS(cos(BallRollAngle)),3)
  2167. ' ChangeFactorX=Round(AngleMultiplierX*(MXLevel-ABS(RealVelX)/MXQuotient),3)
  2168. ' CurrentBall(m).VelX=CurrentBall(m).VelX*(1 + ChangeFactorX)
  2169. ' If RealVelX < 0 Then
  2170. ' BlinkLeftLight
  2171. ' ElseIf RealVelX > 0 Then
  2172. ' BlinkRightLight
  2173. ' End If
  2174. ' End If
  2175. ' End If
  2176. ' PreviousVeloX(m)=CurrentBall(m).VelX
  2177. '
  2178. ' If BallRollDegrees >= 0 OR BallRollDegrees <= 180 Then
  2179. ' If RealVelY >= MYUThreshold AND RealVelY < MYUCutoff Then
  2180. ' AngleMultiplierY=Round(ABS(sin(BallRollAngle)),3)
  2181. ' ChangeFactorY=Round(AngleMultiplierY*(MYULevel-ABS(RealVelY)/MYUQuotient),3)
  2182. ' CurrentBall(m).VelY=CurrentBall(m).VelY*(1 + ChangeFactorY)
  2183. ' BlinkUpLight
  2184. ' End If
  2185. ' End If
  2186. '
  2187. ' If BallRollDegrees <= 360 AND BallRollDegrees > 180 Then
  2188. ' If RealVelY >= MYDThreshold AND RealVelY < MYDMAX Then
  2189. ' AngleMultiplierY=Round(ABS(sin(BallRollAngle)),3)
  2190. ' ChangeFactorY=Round(AngleMultiplierY*(MYDLevel-ABS(RealVelY)/MYDDecayQuotient),3)
  2191. ' CurrentBall(m).VelY=CurrentBall(m).VelY*(1 + ChangeFactorY)
  2192. ' BlinkDownLight
  2193. ' End If
  2194. ' End If
  2195. ' End If
  2196. ' Next
  2197. 'End Sub
  2198. '
  2199. 'MXLeftLight.TimerInterval=MomentumTimer.Interval
  2200. 'MXRightLight.TimerInterval=MomentumTimer.Interval
  2201. 'MYULight.TimerInterval=MomentumTimer.Interval
  2202. 'MYDLight.TimerInterval=MomentumTimer.Interval
  2203.  
  2204. 'Sub BlinkLeftLight()
  2205. ' MXLeftLight.State=1
  2206. ' MXLeftLight.TimerEnabled=1
  2207. 'End Sub
  2208. '
  2209. 'Sub MXLeftLight_Timer()
  2210. ' MXLeftLight.State=0
  2211. ' Me.TimerEnabled=0
  2212. 'End Sub
  2213. '
  2214. 'Sub BlinkRightLight()
  2215. ' MXRightLight.State=1
  2216. ' MXRightLight.TimerEnabled=1
  2217. 'End Sub
  2218. '
  2219. 'Sub MXRightLight_Timer()
  2220. ' MXRightLight.State=0
  2221. ' Me.TimerEnabled=0
  2222. 'End Sub
  2223. '
  2224. 'Sub BlinkUpLight()
  2225. ' MYULight.State=1
  2226. ' MYULight.TimerEnabled=1
  2227. 'End Sub
  2228. '
  2229. 'Sub MYULight_Timer()
  2230. ' MYULight.State=0
  2231. ' Me.TimerEnabled=0
  2232. 'End Sub
  2233. '
  2234. 'Sub BlinkDownLight()
  2235. ' MYDLight.State=1
  2236. ' MYDLight.TimerEnabled=1
  2237. 'End Sub
  2238.  
  2239. 'Sub MYDLight_Timer()
  2240. ' MYDLight.State=0
  2241. ' Me.TimerEnabled=0
  2242. 'End Sub
  2243. '
  2244. 'Sub ToggleMomentum()
  2245. ' If MomentumTimer.Enabled=True Then
  2246. ' MomentumTimer.Enabled=0
  2247. ' ElseIf MomentumTimer.Enabled=False Then
  2248. ' MomentumTimer.Enabled=1
  2249. ' End If
  2250. 'End Sub
  2251. '
  2252. '
  2253. '
  2254. 'Sub Dampen(dt,df,r) 'dt is threshold speed, df is dampen factor 0 to 1 (higher more dampening), r is randomness
  2255. ' Dim dfRandomness
  2256. ' r=cint(r)
  2257. ' dfRandomness=INT(RND*(2*r+1))
  2258. ' df=df+(r-dfRandomness)*.01
  2259. ' If ABS(activeball.velx) > dt Then activeball.velx=activeball.velx*(1-df*(ABS(activeball.velx)/100))
  2260. ' If ABS(activeball.vely) > dt Then activeball.vely=activeball.vely*(1-df*(ABS(activeball.vely)/100))
  2261. 'End Sub
  2262. '
  2263. 'Sub DampenXY (dtx,dfx,rx, dty, dfy, ry) 'dt is threshold speed, df is dampen factor 0 to 1 (higher more dampening), r is randomness
  2264. ' Dim dfxRandomness
  2265. ' Dim dfyRandomness
  2266. ' rx=cint(rx)
  2267. ' ry=cint(ry)
  2268. ' dfxRandomness=INT(RND*(2*rx+1))
  2269. ' dfyRandomness=INT(RND*(2*ry+1))
  2270. ' dfx=dfx+(rx-dfxRandomness)*.01
  2271. ' dfy=dfy+(ry-dfyRandomness)*.01
  2272. ' If ABS(activeball.velx) > dtx Then activeball.velx=activeball.velx*(1-dfx*(ABS(activeball.velx)/100))
  2273. ' If ABS(activeball.vely) > dty Then activeball.vely=activeball.vely*(1-dfy*(ABS(activeball.vely)/100))
  2274. 'End Sub
  2275. '
  2276. 'Sub FlipperDampener_Hit ()
  2277. ' Dim YThreshold:YThreshold=-10 'Ball speed threshold to activate routine (-Y veloctiy for up table)
  2278. ' Dim Level:Level=4 'Choose 1-10, 0 for off
  2279. ' Dim XFactor:XFactor=2 'Straightening factor on X axis (higher value for straighter shots)
  2280. ' Dim BallTriggerAngle, AngleMultiplier 'Angle calculated to apply less straightening on more lateral shots (further away from center line yields lower SIN result - used as coefficient)
  2281. ' If ActiveBall.VelY < YThreshold AND Level <> 0 Then
  2282. ' GetAngle ActiveBall.VelX, ActiveBall.VelY, BallTriggerAngle
  2283. ' AngleMultiplier=Round(ABS(sin(BallTriggerAngle)),3)
  2284. ' ActiveBall.VelY = ActiveBall.VelY*((1-(ABS(ActiveBall.VelY)/(200*10/Level-10*Level))))
  2285. ' ActiveBall.VelX = ActiveBall.VelX*((1-XFactor*AngleMultiplier*(ABS(ActiveBall.VelY)/(200*10/Level-10*Level))))
  2286. ' End If
  2287. 'End Sub
  2288.  
  2289.  
  2290.  
  2291. 'sub flashon
  2292. ' SetLamp 127,1
  2293. ' SetLamp 128,1
  2294. ' SetLamp 129,1
  2295. ' SetLamp 130,1
  2296. ' SetLamp 131,1
  2297. ' SetLamp 132,1
  2298. 'end sub
  2299. '
  2300. 'sub flashoff
  2301. ' SetLamp 127,0
  2302. ' SetLamp 128,0
  2303. ' SetLamp 129,0
  2304. ' SetLamp 130,0
  2305. ' SetLamp 131,0
  2306. ' SetLamp 132,0
  2307. 'end sub
  2308.  
  2309.  
  2310. '***************
  2311. 'Lamp Simulator -From TOTAN
  2312. '***************
  2313.  
  2314. Dim lampPosition, lampSpinSpeed, lampLastPos
  2315. Const cLampSpeedMult = 180 ' 180 - Affects speed transfer to object (deg/sec)
  2316. Const cLampFriction = 2.0 ' 2.0 - Friction coefficient (deg/sec/sec)
  2317. Const cLampMinSpeed = 16 ' 20 - Object stops at this speed (deg/sec)
  2318. Const cLampRadius = 72
  2319. Const cBallSpeedDampeningEffect = 0.45 ' 45 - The ball retains this fraction of its speed due to energy absorption by hitting the lamp.
  2320.  
  2321. ' Draw lamp
  2322. Sub SpinTimer_Timer
  2323. Dim curPos
  2324. Dim oldLampSpeed:oldLampSpeed = lampSpinSpeed
  2325. lampPosition = lampPosition + lampSpinSpeed * Me.Interval / 1000
  2326. lampSpinSpeed = lampSpinSpeed * (1 - cLampFriction * Me.Interval / 1000)
  2327. Do While lampPosition < 0
  2328. lampPosition = lampPosition + 360
  2329. Loop
  2330. Do While lampPosition > 360
  2331. lampPosition = lampPosition - 360
  2332. Loop
  2333. curPos = Int((lampPosition * colLampPoles.Count) / 360)
  2334.  
  2335.  
  2336. If curPos <> lampLastPos Then
  2337. 'LampPr.RotZ = 360 -lampPosition 'Not applicable
  2338. If lampLastPos >= 0 Then ' not first time
  2339. colLampPoles(lampLastPos).IsDropped = True
  2340. colLampPoles2(lampLastPos).IsDropped = True
  2341.  
  2342. DOF 101, DOFOn
  2343.  
  2344. cube.ObjRotZ = -curPos*10
  2345. cubeb.ObjRotZ = -curPos*10
  2346. tessbase.ObjRotZ = -curPos*10
  2347.  
  2348. End If
  2349. DOF 101, DOFOff
  2350.  
  2351. On Error Resume Next
  2352. colLampPoles(curPos).IsDropped = False
  2353. If Err Then msgbox curPoles
  2354. colLampPoles2(curPos).IsDropped = False
  2355.  
  2356. If oldLampSpeed > 0 And lampLastPos > curPos Then
  2357. 'rev anticlockwise
  2358. vpmTimer.PulseSw TesseractSW1
  2359. ElseIf oldLampSpeed < 0 And lampLastPos < curPos Then
  2360. 'rev clockwise
  2361. vpmTimer.PulseSw TesseractSW2
  2362. End If
  2363. lampLastPos = curPos
  2364. End If
  2365.  
  2366. If Abs(lampSpinSpeed) < cLampMinSpeed Then
  2367. lampSpinSpeed = 0:Me.Enabled = False
  2368. End If
  2369. End Sub
  2370.  
  2371. Sub colLampPoles_Hit(idx)
  2372.  
  2373. 'play rubber sound
  2374. dim finalspeed
  2375. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  2376. If finalspeed > 14 then
  2377. PlaySound "bump"
  2378. End if
  2379. If finalspeed >= 4 AND finalspeed <= 14 then
  2380. RandomSoundRubber()
  2381. End If
  2382. If finalspeed < 4 AND finalspeed > 1 then
  2383. RandomSoundRubberLowVolume()
  2384. End If
  2385.  
  2386.  
  2387. Dim pi:pi = 3.14159265358979323846
  2388. dim lampangle
  2389. lampangle = NormAngle((idx) / Me.Count * 2 * pi + (pi / 17.6) + pi) ' added (pi / 17.6) because the first lamp post (18) is not quite at 0 angle, added another pi to make it standard angle
  2390.  
  2391. dim mball, mlamp, rlamp, ilamp
  2392.  
  2393. dim collisionangle
  2394. dim ballspeedin, ballspeedout, lampspeedin, lampspeedout
  2395.  
  2396. dim fudge:fudge = cLampSpeedMult / 2
  2397.  
  2398. With ActiveBall
  2399. collisionangle = GetCollisionAngle(idx, Me.Count, .X, -.Y) ' this is the angle from the center of ball to the center of post
  2400.  
  2401. Set ballspeedout = new jVector
  2402. ballspeedout.SetXY .VelX, -.VelY
  2403. ballspeedout.ShiftAxes - collisionangle
  2404.  
  2405. lampSpinSpeed = lampSpinSpeed + sqr(.VelX ^2 + .VelY ^2) * sin(collisionangle - lampangle) * fudge
  2406. ballspeedout.SetXY ballspeedout.x, ballspeedout.y * cos(collisionangle - lampangle)
  2407.  
  2408. ballspeedout.ShiftAxes collisionangle
  2409. ' we can give a more accurate ball return speed or let the normal VP physics give the ball speed
  2410. '.VelX = ballspeedout.x * cBallSpeedDampeningEffect
  2411. '.VelY = - ballspeedout.y * cBallSpeedDampeningEffect
  2412. End With
  2413. SpinTimer.Enabled = True
  2414. End Sub
  2415.  
  2416. Function GetCollisionAngle(idx, count, X, Y)
  2417. Dim pi:pi = 3.14159265358979323846
  2418. dim angle, postx, posty, dX, dY
  2419. Dim ang
  2420. angle = (idx) / count * 2 * pi + (pi / 17.6) ' added (pi / 17.6) because the first lamp post (18) is not quite at 0 angle
  2421. postx = 551 - 60.25 * Cos(angle) ' 551 and 825.25 are the actual coordinates of the center of the lamp
  2422. posty = 885.25 + 60.25 * Sin(angle) ' 60.25 is the radius of the circle with center at the center of the lamp and edge at the centers of all the lamp posts
  2423. posty = -1 * posty
  2424. Dim collisionV:Set collisionV = new jVector
  2425. collisionV.SetXY postx - X, posty - Y
  2426. GetCollisionAngle = collisionV.ang
  2427. End Function
  2428.  
  2429. Function NormAngle(angle)
  2430. NormAngle = angle
  2431. Dim pi:pi = 3.14159265358979323846
  2432. Do While NormAngle > 2 * pi
  2433. NormAngle = NormAngle - 2 * pi
  2434. Loop
  2435. Do While NormAngle < 0
  2436. NormAngle = NormAngle + 2 * pi
  2437. Loop
  2438. End Function
  2439.  
  2440. Class jVector
  2441. Private m_mag, m_ang, pi
  2442.  
  2443. Sub Class_Initialize
  2444. m_mag = CDbl(0)
  2445. m_ang = CDbl(0)
  2446. pi = CDbl(3.14159265358979323846)
  2447. End Sub
  2448.  
  2449. Public Function add(anothervector)
  2450. Dim tx, ty, theta
  2451. If TypeName(anothervector) = "jVector" then
  2452. Set add = new jVector
  2453. add.SetXY x + anothervector.x, y + anothervector.y
  2454. End If
  2455. End Function
  2456.  
  2457. Public Function multiply(scalar)
  2458. Set multiply = new jVector
  2459. multiply.SetXY x * scalar, y * scalar
  2460. End Function
  2461.  
  2462. Sub ShiftAxes(theta)
  2463. ang = ang - theta
  2464. end Sub
  2465.  
  2466. Sub SetXY(tx, ty)
  2467.  
  2468. if tx = 0 And ty = 0 Then
  2469. ang = 0
  2470. elseif tx = 0 And ty < 0 then
  2471. ang = - pi / 180 ' -90 degrees
  2472. elseif tx = 0 And ty > 0 then
  2473. ang = pi / 180 ' 90 degrees
  2474. else
  2475. ang = atn(ty / tx)
  2476. if tx < 0 then ang = ang + pi ' Add 180 deg if in quadrant 2 or 3
  2477. End if
  2478.  
  2479. mag = sqr(tx ^2 + ty ^2)
  2480. End Sub
  2481.  
  2482. Property Let mag(nmag)
  2483. m_mag = nmag
  2484. End Property
  2485.  
  2486. Property Get mag
  2487. mag = m_mag
  2488. End Property
  2489.  
  2490. Property Let ang(nang)
  2491. m_ang = nang
  2492. Do While m_ang > 2 * pi
  2493. m_ang = m_ang - 2 * pi
  2494. Loop
  2495. Do While m_ang < 0
  2496. m_ang = m_ang + 2 * pi
  2497. Loop
  2498. End Property
  2499.  
  2500. Property Get ang
  2501. Do While m_ang > 2 * pi
  2502. m_ang = m_ang - 2 * pi
  2503. Loop
  2504. Do While m_ang < 0
  2505. m_ang = m_ang + 2 * pi
  2506. Loop
  2507. ang = m_ang
  2508. End Property
  2509.  
  2510. Property Get x
  2511. x = m_mag * cos(ang)
  2512. End Property
  2513.  
  2514. Property Get y
  2515. y = m_mag * sin(ang)
  2516. End Property
  2517.  
  2518. Property Get dump
  2519. dump = "vector "
  2520. Select Case CInt(ang + pi / 8)
  2521. case 0, 8:dump = dump & "->"
  2522. case 1:dump = dump & "/'"
  2523. case 2:dump = dump & "/\"
  2524. case 3:dump = dump & "'\"
  2525. case 4:dump = dump & "<-"
  2526. case 5:dump = dump & ":/"
  2527. case 6:dump = dump & "\/"
  2528. case 7:dump = dump & "\:"
  2529. End Select
  2530.  
  2531. dump = dump & " mag:" & CLng(mag * 10) / 10 & ", ang:" & CLng(ang * 180 / pi) & ", x:" & CLng(x * 10) / 10 & ", y:" & CLng(y * 10) / 10
  2532. End Property
  2533. End Class
  2534.  
  2535.  
  2536. 'Custom Vlock for optos
  2537. ' Class cvpmVOptoLock
  2538. ' Private mTrig, mKick, mSw(), mSize, mBalls, mGateOpen, mRealForce, mBallSnd, mNoBallSnd
  2539. ' Public ExitDir, ExitForce, KickForceVar
  2540. '
  2541. ' Private Sub Class_Initialize
  2542. ' mBalls = 0 : ExitDir = 0 : ExitForce = 0 : KickForceVar = 0 : mGateOpen = False
  2543. ' vpmTimer.addResetObj Me
  2544. ' End Sub
  2545. '
  2546. ' Public Sub InitVLock(aTrig, aKick, aSw)
  2547. ' Dim ii
  2548. ' mSize = vpmSetArray(mTrig, aTrig)
  2549. ' If vpmSetArray(mKick, aKick) <> mSize Then MsgBox "cvpmVLock: Unmatched kick+trig" : Exit Sub
  2550. ' On Error Resume Next
  2551. ' ReDim mSw(mSize)
  2552. ' If IsArray(aSw) Then
  2553. ' For ii = 0 To UBound(aSw) : mSw(ii) = aSw(ii) : Next
  2554. ' ElseIf aSw = 0 Or Err Then
  2555. ' For ii = 0 To mSize: mSw(ii) = mTrig(ii).TimerInterval : Next
  2556. ' Else
  2557. ' mSw(0) = aSw
  2558. ' End If
  2559. '
  2560. ' 'Init optolock to 1 "No ball present
  2561. ' For ii = 0 To mSize
  2562. ' Controller.Switch(mSw(ii)) = True
  2563. ' Next
  2564. '
  2565. ' End Sub
  2566. '
  2567. ' Public Sub InitSnd(aBall, aNoBall) : mBallSnd = aBall : mNoBallSnd = aNoBall : End Sub
  2568. ' Public Sub CreateEvents(aName)
  2569. ' Dim ii
  2570. ' If Not vpmCheckEvent(aName, Me) Then Exit Sub
  2571. ' For ii = 0 To mSize
  2572. ' vpmBuildEvent mTrig(ii), "Hit", aName & ".TrigHit ActiveBall," & ii+1
  2573. ' vpmBuildEvent mTrig(ii), "Unhit", aName & ".TrigUnhit ActiveBall," & ii+1
  2574. ' vpmBuildEvent mKick(ii), "Hit", aName & ".KickHit " & ii+1
  2575. ' Next
  2576. ' End Sub
  2577. '
  2578. ' Public Sub SolExit(aEnabled)
  2579. ' Dim ii
  2580. ' msgbox "solexit" & aEnabled
  2581. ' mGateOpen = aEnabled
  2582. ' If Not aEnabled Then Exit Sub
  2583. ' If mBalls > 0 Then PlaySound mBallSnd : Else PlaySound mNoBallSnd : Exit Sub
  2584. ' For ii = 0 To mBalls-1
  2585. ' mKick(ii).Enabled = False : If mSw(ii) Then Controller.Switch(mSw(ii)) = True 'False
  2586. ' Next
  2587. ' If ExitForce > 0 Then ' Up
  2588. ' mRealForce = ExitForce + (Rnd - 0.5)*KickForceVar : mKick(mBalls-1).Kick ExitDir, mRealForce
  2589. ' Else ' Down
  2590. ' mKick(0).Kick 0, 0
  2591. ' End If
  2592. ' End Sub
  2593. '
  2594. ' Public Sub Reset
  2595. ' Dim ii : If mBalls = 0 Then Exit Sub
  2596. ' For ii = 0 To mBalls-1
  2597. ' If mSw(ii) Then Controller.Switch(mSw(ii)) = False 'True
  2598. ' Next
  2599. ' End Sub
  2600. '
  2601. ' Public Property Get Balls : Balls = mBalls : End Property
  2602. '
  2603. ' Public Property Let Balls(aBalls)
  2604. ' Dim ii : mBalls = aBalls
  2605. ' For ii = 0 To mSize
  2606. ' If ii >= aBalls Then
  2607. ' mKick(ii).DestroyBall : If mSw(ii) Then Controller.Switch(mSw(ii)) = True 'False
  2608. ' Else
  2609. ' vpmCreateBall mKick(ii) : If mSw(ii) Then Controller.Switch(mSw(ii)) = False 'True
  2610. ' End If
  2611. ' Next
  2612. ' End Property
  2613. '
  2614. ' Public Sub TrigHit(aBall, aNo)
  2615. ' msgbox "trighit" & aNo & ":" & mGateOpen
  2616. '
  2617. ' aNo = aNo - 1 : If mSw(aNo) Then Controller.Switch(mSw(aNo)) = False 'True
  2618. ' If aBall.VelY < -1 Then Exit Sub ' Allow small upwards speed
  2619. ' If aNo = mSize Then mBalls = mBalls + 1
  2620. ' If mBalls > aNo Then mKick(aNo).Enabled = Not mGateOpen
  2621. ' End Sub
  2622. '
  2623. ' Public Sub TrigUnhit(aBall, aNo)
  2624. ' msgbox "untrighit" & aNo
  2625. ' aNo = aNo - 1 : If mSw(aNo) Then Controller.Switch(mSw(aNo)) = True 'False
  2626. ' If aBall.VelY > -1 Then
  2627. ' If aNo = 0 Then mBalls = mBalls - 1
  2628. ' If aNo < mSize Then mKick(aNo+1).Kick 0, 0
  2629. ' Else
  2630. ' If aNo = mSize Then mBalls = mBalls - 1
  2631. ' If aNo > 0 Then mKick(aNo-1).Kick ExitDir, mRealForce
  2632. ' End If
  2633. ' End Sub
  2634. '
  2635. ' Public Sub KickHit(aNo) : mKick(aNo-1).Enabled = False : msgbox "kickHit" & aNo: End Sub
  2636. 'End Class
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642. '****DEBUG
  2643. '****DEBUG
  2644. '****DEBUG
  2645.  
  2646. 'InitRampGuides
  2647. 'Sub InitRampGuides
  2648. ' RampGuideSetMode 0
  2649. ' rampTempCnt=0
  2650. 'End Sub
  2651. '
  2652. 'Dim rampKeycode,rampKeycodeCount, rampTempCnt, rampModesMax
  2653. 'rampKeycode = 3 'Specify button to enable posts: 3=Extra Ball button or use LeftMagnaSave or RightMagnaSave or any key
  2654. 'rampKeycodeCount = 3 '# of consecutive keypresses before Training Posts feature works(so it is not accidentally enabled)
  2655. 'rampModesMax = 5
  2656. '
  2657. 'Sub rampCheck (keyc)
  2658. ' If keyc = rampKeycode Then
  2659. ' rampTempCnt = rampTempCnt+1
  2660. ' RampGuideSetMode rampTempCnt Mod rampModesMax
  2661. ' End If
  2662. 'End Sub
  2663.  
  2664. 'Sub RampGuideSetMode (input) '+1 for up, -1 for down
  2665. ' Select Case input
  2666. ' Case 0 'No Lanes
  2667. ' Rampguide1.Isdropped=1
  2668. ' Rampguide2.Isdropped=1
  2669. ' Rampguide3.Isdropped=1
  2670. ' Rampguide4.Isdropped=1
  2671. ' Rampguide5.Isdropped=1
  2672. ' Rampguide6.Isdropped=1
  2673. ' Rampguide7.Isdropped=1
  2674. '
  2675. ' Case 1 'All Lanes no flipperwall
  2676. ' Rampguide1.Isdropped=0
  2677. ' Rampguide2.Isdropped=1
  2678. ' Rampguide3.Isdropped=1
  2679. ' Rampguide4.Isdropped=1
  2680. ' Rampguide5.Isdropped=1
  2681. ' Rampguide6.Isdropped=1
  2682. ' Rampguide7.Isdropped=1
  2683. ' Case 2 'All Lanes plus flipperwall
  2684. ' Rampguide1.Isdropped=1
  2685. ' Rampguide2.Isdropped=0
  2686. ' Rampguide3.Isdropped=0
  2687. ' Rampguide4.Isdropped=1
  2688. ' Rampguide5.Isdropped=1
  2689. ' Rampguide6.Isdropped=1
  2690. ' Rampguide7.Isdropped=1
  2691. ' Case 3 'Outer Lanes only
  2692. ' Rampguide1.Isdropped=1
  2693. ' Rampguide2.Isdropped=1
  2694. ' Rampguide3.Isdropped=1
  2695. ' Rampguide4.Isdropped=0
  2696. ' Rampguide5.Isdropped=0
  2697. ' Rampguide6.Isdropped=1
  2698. ' Rampguide7.Isdropped=1
  2699. ' Case 4 'Center Lane only
  2700. ' Rampguide1.Isdropped=1
  2701. ' Rampguide2.Isdropped=1
  2702. ' Rampguide3.Isdropped=1
  2703. ' Rampguide4.Isdropped=1
  2704. ' Rampguide5.Isdropped=1
  2705. ' Rampguide6.Isdropped=0
  2706. ' Rampguide7.Isdropped=0
  2707. ' End Select
  2708. 'End Sub
  2709.  
  2710.  
  2711.  
  2712. 'to do (future release)
  2713. ' lamp in hulk ramp
  2714. ' hulk arm animation
  2715. ' add light reflections
  2716. ' hulk image lighting
  2717.  
  2718. Dim armmove
  2719. Sub Timer1_Timer()
  2720. armmove = 0
  2721. If armsup = false and HulkPrim1.RotX > 130 then armmove = -4
  2722. If armsup = true and HulkPrim1.RotX < 250 then armmove = 4
  2723. HulkPrim1.RotX = HulkPrim1.RotX + armmove
  2724. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement