Guest User

Untitled

a guest
Nov 29th, 2019
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.74 KB | None | 0 0
  1. Option Explicit
  2. Randomize
  3.  
  4. On Error Resume Next
  5. ExecuteGlobal GetTextFile("controller.vbs")
  6. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  7. On Error Goto 0
  8.  
  9. Const cGameName="sprbrks",UseSolenoids=1,UseLamps=0,UseGI=0,SSolenoidOn="SolOn",SSolenoidOff="SolOff", SCoin="coin"
  10.  
  11. Const Ballsize = 50
  12. 'Const BallMass = 1.5
  13.  
  14. LoadVPM "01200000","sys80.vbs",3.2
  15.  
  16. Dim DesktopMode: DesktopMode = Table1.ShowDT
  17.  
  18. If DesktopMode = True Then 'Show Desktop components
  19. Ramp16.visible=1
  20. Ramp15.visible=1
  21. Primitive13.visible=1
  22. Else
  23. Ramp16.visible=0
  24. Ramp15.visible=0
  25. Primitive13.visible=0
  26. End if
  27.  
  28. '*************************************************************
  29. 'Solenoid Call backs
  30. '**********************************************************************************************************
  31.  
  32. SolCallback(1)= "SetLamp 101,"
  33. SolCallback(2)= "dtC.SolDropUp" 'drop targets
  34. SolCallback(3)= "bsSaucer.SolOut"
  35. SolCallback(4)= "SolAutoFire" 'Plunger
  36. SolCallback(5)= "dtR.SolDropUp" 'drop targets
  37. SolCallback(6)= "dtT.SolDropUp" 'drop targets
  38. SolCallback(7)= "SetLamp 108,"
  39. SolCallback(8)= "vpmSolSound SoundFX(""Knocker"",DOFKnocker),"
  40. SolCallback(9)= "bsTrough.SolIn" 'outhole
  41.  
  42. SolCallback(sLRFlipper) = "SolRFlipper"
  43. SolCallback(sLLFlipper) = "SolLFlipper"
  44.  
  45. Sub sollFlipper(Enabled)
  46. If Enabled Then
  47. PlaySound SoundFX("fx_Flipperup",DOFContactors):LeftFlipper.RotateToEnd:LeftFlipper1.RotateToEnd
  48. Else
  49. PlaySound SoundFX("fx_Flipperdown",DOFContactors):LeftFlipper.RotateToStart:LeftFlipper1.RotateToStart
  50. End If
  51. End Sub
  52.  
  53. Sub solrflipper(Enabled)
  54. If Enabled Then
  55. PlaySound SoundFX("fx_Flipperup",DOFContactors):RightFlipper.RotateToEnd:RightFlipper1.RotateToEnd
  56. Else
  57. PlaySound SoundFX("fx_Flipperdown",DOFContactors):RightFlipper.RotateToStart:RightFlipper1.RotateToStart
  58. End If
  59. End Sub
  60.  
  61. '**********************************************************************************************************
  62.  
  63. 'Solenoid Controlled toys
  64. '**********************************************************************************************************
  65.  
  66. Sub SolAutoFire(Enabled)
  67. If enabled Then
  68. PlungerIM.AutoFire
  69. End If
  70. End Sub
  71.  
  72. Sub solTrough(Enabled) 'Light12
  73. If Enabled Then
  74. bsTrough.ExitSol_On'If bsTrough.Balls Then bsTrough.ExitSol_On
  75. Else
  76.  
  77. End If
  78. End Sub
  79.  
  80. 'Playfield GI
  81. Sub PFGI(Enabled) 'Light13 ????????????????????
  82. If Enabled Then
  83. dim xx
  84. For each xx in GI:xx.State = 0: Next
  85. PlaySound "fx_relay"
  86. Else
  87. For each xx in GI:xx.State = 1: Next
  88. PlaySound "fx_relay"
  89. End If
  90. End Sub
  91.  
  92. Sub SolAux1(Enabled) '????????????????????
  93. If Enabled Then
  94. dim xxx
  95. For each xxx in AuxBoard1:xxx.State = 2: Next
  96. PlaySound "fx_relay"
  97. Else
  98. For each xxx in AuxBoard1:xxx.State = 0: Next
  99. End If
  100. End Sub
  101.  
  102. Sub SolAux2(Enabled) '????????????????????
  103. If Enabled Then
  104. dim xxxx
  105. For each xxxx in AuxBoard2:xxxx.State = 2: Next
  106. PlaySound "fx_relay"
  107. Else
  108. For each xxxx in AuxBoard2:xxxx.State = 0: Next
  109. End If
  110. End Sub
  111.  
  112.  
  113. '**********************************************************************************************************
  114.  
  115. 'Initiate Table
  116. '**********************************************************************************************************
  117.  
  118. Dim bsTrough, bsSaucer, dtC, dtT, dtR
  119.  
  120. Sub Table1_Init
  121.  
  122. On Error Resume Next
  123. With Controller
  124. .GameName = cGameName
  125. If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description : Exit Sub
  126. .SplashInfoLine = "Spring Break"
  127. .HandleMechanics=0
  128. .HandleKeyboard=0
  129. .ShowDMDOnly=1
  130. .ShowFrame=0
  131. .ShowTitle=0
  132. .hidden = 1
  133. If Err Then MsgBox Err.Description
  134. End With
  135. On Error Goto 0
  136. Controller.SolMask(0)=0
  137. vpmTimer.AddTimer 2000,"Controller.SolMask(0)=&Hffffffff'" 'ignore all solenoids - then add the timer to renable all the solenoids after 2 seconds
  138. Controller.Run
  139. If Err Then MsgBox Err.Description
  140. On Error Goto 0
  141.  
  142. PinMAMETimer.Interval=PinMAMEInterval
  143. PinMAMETimer.Enabled=1
  144.  
  145. vpmNudge.TiltSwitch=57
  146. vpmNudge.Sensitivity=2
  147. vpmNudge.TiltObj = Array(Bumper1,Bumper2,Bumper3,RightSlingShot)
  148.  
  149. Set bsTrough=New cvpmBallstack
  150. bsTrough.InitSw 66,55,65,75,0,0,0,0 '65 is not realy needed
  151. bsTrough.InitKick BallRelease,80,5
  152. bsTrough.InitExitSnd SoundFX("ballrelease",DOFContactors), SoundFX("Solenoid",DOFContactors)
  153. bsTrough.Balls=3
  154.  
  155. Set bsSaucer=New cvpmBallstack
  156. bsSaucer.InitSaucer sw22,22,0,20
  157. bsSaucer.InitExitSnd SoundFX("Popper",DOFContactors), SoundFX("Solenoid",DOFContactors)
  158.  
  159. Set dtC=New cvpmDropTarget
  160. dtC.InitDrop Array(Targ2a,Targ2b,Targ2c),Array(50,60,70)
  161. dtC.InitSnd SoundFX("DTDrop",DOFContactors),SoundFX("DTReset",DOFContactors)
  162.  
  163. Set dtT=New cvpmDropTarget
  164. dtT.InitDrop Array(Targ3a,Targ3b,Targ3c),Array(52,62,72)
  165. dtT.InitSnd SoundFX("DTDrop",DOFContactors),SoundFX("DTReset",DOFContactors)
  166.  
  167. Set dtR=New cvpmDropTarget
  168. dtR.InitDrop Array(Targ1a,Targ1b,Targ1c),Array(51,61,71)
  169. dtR.InitSnd SoundFX("DTDrop",DOFContactors),SoundFX("DTReset",DOFContactors)
  170.  
  171. bsTrough.AddBall 0
  172.  
  173. End Sub
  174.  
  175.  
  176.  
  177. '**********************************************************************************************************
  178. 'Plunger code
  179. '**********************************************************************************************************
  180.  
  181. Sub Table1_KeyDown(ByVal KeyCode)
  182.  
  183. If KeyCode=RightFlipperKey Then Controller.Switch(35)=1
  184.  
  185. If vpmKeyDown(KeyCode) Then Exit Sub
  186. End Sub
  187.  
  188. Sub Table1_KeyUp(ByVal KeyCode)
  189.  
  190. If KeyCode=RightFlipperKey Then Controller.Switch(35)=0
  191.  
  192. If vpmKeyUp(KeyCode) Then Exit Sub
  193. End Sub
  194.  
  195. Dim plungerIM
  196. Const IMPowerSetting = 42 ' Plunger Power
  197. Const IMTime = 0.6 ' Time in seconds for Full Plunge
  198. Set plungerIM = New cvpmImpulseP
  199. With plungerIM
  200. .InitImpulseP swplunger, IMPowerSetting, IMTime
  201. .Random 0.3
  202. .InitExitSnd SoundFX("Popper",DOFContactors), SoundFX("Solenoid",DOFContactors)
  203. .CreateEvents "plungerIM"
  204. End With
  205.  
  206. '**********************************************************************************************************
  207.  
  208. Sub Drain_Hit:bsTrough.AddBall Me : playsound"drain" : End Sub
  209. Sub sw22_Hit:bsSaucer.AddBall 0 : playsound "rollover": End Sub
  210.  
  211. 'Drop Targets
  212. Sub Targ2a_Dropped:dtc.Hit 1:End Sub
  213. Sub Targ2b_Dropped:dtc.Hit 2:End Sub
  214. Sub Targ2c_Dropped:dtc.Hit 3:End Sub
  215.  
  216. Sub Targ3a_Dropped:DTT.Hit 1:End Sub
  217. Sub Targ3b_Dropped:DTT.Hit 2:End Sub
  218. Sub Targ3c_Dropped:DTT.Hit 3:End Sub
  219.  
  220. Sub Targ1a_Dropped:DTR.Hit 1:End Sub
  221. Sub Targ1b_Dropped:DTR.Hit 2:End Sub
  222. Sub Targ1c_Dropped:DTR.Hit 3:End Sub
  223.  
  224. 'Wire Triggers
  225. Sub sw20_Hit:Controller.Switch(20)=1 : playsound"rollover" : End Sub
  226. Sub sw20_unHit:Controller.Switch(20)=0:End Sub
  227. Sub sw21_Hit:Controller.Switch(21)=1 : playsound"rollover" : End Sub
  228. Sub sw21_unHit:Controller.Switch(21)=0:End Sub
  229. Sub sw30_Hit:Controller.Switch(30)=1 : playsound"rollover" : End Sub
  230. Sub sw30_unHit:Controller.Switch(30)=0:End Sub
  231. Sub sw40_Hit:Controller.Switch(40)=1 : playsound"rollover" : End Sub
  232. Sub sw40_unHit:Controller.Switch(40)=0:End Sub
  233. Sub sw45_Hit:Controller.Switch(45)=1 : playsound"rollover" : End Sub
  234. Sub sw45_unHit:Controller.Switch(45)=0:End Sub
  235. Sub sw53_Hit:Controller.Switch(53)=1 : playsound"rollover" : End Sub
  236. Sub sw53_unHit:Controller.Switch(53)=0:End Sub
  237. Sub sw63_Hit:Controller.Switch(63)=1 : playsound"rollover" : End Sub
  238. Sub sw63_unHit:Controller.Switch(63)=0:End Sub
  239. Sub sw73_Hit:Controller.Switch(73)=1 : playsound"rollover" : End Sub
  240. Sub sw73_unHit:Controller.Switch(73)=0:End Sub
  241.  
  242. 'Stand Up Targets sound by collection
  243. Sub sw54_Hit:vpmTimer.pulseSw 54 : End Sub
  244. Sub sw64_Hit:vpmTimer.pulseSw 64 : End Sub
  245. Sub sw74_Hit:vpmTimer.pulseSw 74 : End Sub
  246.  
  247. 'Gate Triggers sound by collection
  248. Sub sw23_Hit:vpmTimer.pulseSw 23 : End Sub
  249. Sub sw31_Hit:vpmTimer.pulseSw 31 : End Sub
  250. Sub sw32_Hit:vpmTimer.pulseSw 32 : End Sub
  251. Sub sw33_Hit:vpmTimer.pulseSw 33 : End Sub
  252. Sub sw41_Hit:vpmTimer.pulseSw 41 : End Sub
  253. Sub sw42_Hit:vpmTimer.pulseSw 42 : End Sub
  254. Sub sw43_Hit:vpmTimer.pulseSw 43 : End Sub
  255.  
  256. 'Bumpers
  257. Sub Bumper1_Hit:vpmTimer.PulseSw(44) : playsound SoundFX("fx_bumper1",DOFContactors): End Sub
  258. Sub Bumper2_Hit:vpmTimer.PulseSw(24) : playsound SoundFX("fx_bumper1",DOFContactors): End Sub
  259. Sub Bumper3_Hit:vpmTimer.PulseSw(34) : playsound SoundFX("fx_bumper1",DOFContactors): End Sub
  260.  
  261. 'Generic Sounds
  262. Sub Trigger001_Hit:PlaySound "Wire Ramp":End Sub
  263. Sub Trigger002_Hit:stopSound "Wire Ramp"::End Sub
  264.  
  265.  
  266. '***************************************************
  267. ' JP's VP10 Fading Lamps & Flashers
  268. ' Based on PD's Fading Light System
  269. ' SetLamp 0 is Off
  270. ' SetLamp 1 is On
  271. ' fading for non opacity objects is 4 steps
  272. '***************************************************
  273.  
  274. Dim LampState(200), FadingLevel(200)
  275. Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
  276.  
  277. InitLamps() ' turn off the lights and flashers and reset them to the default parameters
  278. LampTimer.Interval = 5 'lamp fading speed
  279. LampTimer.Enabled = 1
  280.  
  281. ' Lamp & Flasher Timers
  282.  
  283. Sub LampTimer_Timer()
  284. Dim chgLamp, num, chg, ii
  285. chgLamp = Controller.ChangedLamps
  286. If Not IsEmpty(chgLamp) Then
  287. For ii = 0 To UBound(chgLamp)
  288. LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1) 'keep the real state in an array
  289. FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
  290.  
  291. 'Special Handling
  292. If chgLamp(ii,0) = 12 Then solTrough chgLamp(ii,1) 'BallRlease
  293. ' If chgLamp(ii,0) = 13 Then PFGI chgLamp(ii,1) 'GI
  294. If chgLamp(ii,0) = 13 Then SolAux1 chgLamp(ii,1) 'Aux Board
  295. If chgLamp(ii,0) = 14 Then SolAux2 chgLamp(ii,1) 'Aux Board
  296. Next
  297. End If
  298. UpdateLamps
  299. End Sub
  300.  
  301.  
  302. Sub UpdateLamps()
  303. 'NFadeL 0, light0 'Game Over Relay
  304. 'NFadeL 1, light1 'Tilt
  305. NFadeLm 2, L2a 'Dome Lights X2
  306. NFadeL 2, L2b
  307. NFadeL 3, Light3
  308. NFadeL 4, light4 '???????
  309. NFadeL 5, light5
  310. NFadeL 6, light6
  311. NFadeL 7, light7
  312. NFadeL 8, light8
  313. NFadeL 9, light9
  314. NFadeL 10, light10
  315. NFadeL 11, light11
  316. 'NFadeL 12, light12 'BallRelease
  317. 'NFadeL 13, light13 'Shoot Lamp Relay "A"
  318. 'NFadeL 14, light14 'Aux. and Lightbox Lamp Relay "B"
  319. NFadeLm 15, Light15
  320. NFadeL 15, Light15a
  321. Flashm 16, Flasher16a
  322. Flash 16, Flasher16b
  323. Flashm 17, Flasher17a
  324. Flash 17, Flasher17b
  325. Flashm 18, Flasher18a
  326. Flash 18, Flasher18b
  327. Flashm 19, Flasher19a
  328. Flash 19, Flasher19b
  329. Flashm 20, Flasher20a
  330. Flash 20, Flasher20b
  331. NFadeL 21, Light21 'Bumper2
  332. NFadeL 22, light22 'Bumper3
  333. NFadeL 23, light23 'Bumper1
  334. NFadeL 24, light24
  335. NFadeL 25, light25
  336. NFadeL 26, light26
  337. NFadeL 27, light27
  338. NFadeLm 28, light28
  339. NFadeL 28, light28a
  340. NFadeLm 29, light29
  341. NFadeL 29, light29a
  342. NFadeL 30, light30
  343. NFadeL 31, light31
  344. NFadeL 32, light32
  345. NFadeL 33, light33
  346. NFadeL 34, light34
  347. NFadeL 35, light35
  348. NFadeL 36, light36
  349. NFadeL 37, light37
  350. NFadeL 38, light38
  351. NFadeL 39, light39
  352. NFadeL 40, light40
  353. NFadeL 41, light41
  354. NFadeL 42, light42
  355. NFadeL 43, light43
  356. NFadeL 44, light44
  357. NFadeL 45, light45
  358. NFadeL 46, light46
  359. NFadeL 47, light47
  360.  
  361. 'Solenoid Controlled Lights
  362.  
  363. NFadeLm 101, S101a
  364. NFadeLm 101, S101b
  365. NFadeLm 101, S101c
  366. NFadeL 101, S101d
  367.  
  368. NFadeLm 108, S108a
  369. NFadeLm 108, S108b
  370. NFadeLm 108, S108c
  371. NFadeLm 108, S108d
  372. NFadeLm 108, S108e
  373. NFadeLm 108, S108f
  374. NFadeL 108, S108g
  375.  
  376. End Sub
  377.  
  378.  
  379. ' div lamp subs
  380.  
  381. Sub InitLamps()
  382. Dim x
  383. For x = 0 to 200
  384. LampState(x) = 0 ' current light state, independent of the fading level. 0 is off and 1 is on
  385. FadingLevel(x) = 4 ' used to track the fading state
  386. FlashSpeedUp(x) = 0.4 ' faster speed when turning on the flasher
  387. FlashSpeedDown(x) = 0.2 ' slower speed when turning off the flasher
  388. FlashMax(x) = 1 ' the maximum value when on, usually 1
  389. FlashMin(x) = 0 ' the minimum value when off, usually 0
  390. FlashLevel(x) = 0 ' the intensity of the flashers, usually from 0 to 1
  391. Next
  392. End Sub
  393.  
  394. Sub AllLampsOff
  395. Dim x
  396. For x = 0 to 200
  397. SetLamp x, 0
  398. Next
  399. End Sub
  400.  
  401. Sub SetLamp(nr, value)
  402. If value <> LampState(nr) Then
  403. LampState(nr) = abs(value)
  404. FadingLevel(nr) = abs(value) + 4
  405. End If
  406. End Sub
  407.  
  408. ' Lights: used for VP10 standard lights, the fading is handled by VP itself
  409.  
  410. Sub NFadeL(nr, object)
  411. Select Case FadingLevel(nr)
  412. Case 4:object.state = 0:FadingLevel(nr) = 0
  413. Case 5:object.state = 1:FadingLevel(nr) = 1
  414. End Select
  415. End Sub
  416.  
  417. Sub NFadeLm(nr, object) ' used for multiple lights
  418. Select Case FadingLevel(nr)
  419. Case 4:object.state = 0
  420. Case 5:object.state = 1
  421. End Select
  422. End Sub
  423.  
  424. 'Lights, Ramps & Primitives used as 4 step fading lights
  425. 'a,b,c,d are the images used from on to off
  426.  
  427. Sub FadeObj(nr, object, a, b, c, d)
  428. Select Case FadingLevel(nr)
  429. Case 4:object.image = b:FadingLevel(nr) = 6 'fading to off...
  430. Case 5:object.image = a:FadingLevel(nr) = 1 'ON
  431. Case 6, 7, 8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  432. Case 9:object.image = c:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
  433. Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  434. Case 13:object.image = d:FadingLevel(nr) = 0 'Off
  435. End Select
  436. End Sub
  437.  
  438. Sub FadeObjm(nr, object, a, b, c, d)
  439. Select Case FadingLevel(nr)
  440. Case 4:object.image = b
  441. Case 5:object.image = a
  442. Case 9:object.image = c
  443. Case 13:object.image = d
  444. End Select
  445. End Sub
  446.  
  447. Sub NFadeObj(nr, object, a, b)
  448. Select Case FadingLevel(nr)
  449. Case 4:object.image = b:FadingLevel(nr) = 0 'off
  450. Case 5:object.image = a:FadingLevel(nr) = 1 'on
  451. End Select
  452. End Sub
  453.  
  454. Sub NFadeObjm(nr, object, a, b)
  455. Select Case FadingLevel(nr)
  456. Case 4:object.image = b
  457. Case 5:object.image = a
  458. End Select
  459. End Sub
  460.  
  461. ' Flasher objects
  462.  
  463. Sub Flash(nr, object)
  464. Select Case FadingLevel(nr)
  465. Case 4 'off
  466. FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
  467. If FlashLevel(nr) < FlashMin(nr) Then
  468. FlashLevel(nr) = FlashMin(nr)
  469. FadingLevel(nr) = 0 'completely off
  470. End if
  471. Object.IntensityScale = FlashLevel(nr)
  472. Case 5 ' on
  473. FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
  474. If FlashLevel(nr) > FlashMax(nr) Then
  475. FlashLevel(nr) = FlashMax(nr)
  476. FadingLevel(nr) = 1 'completely on
  477. End if
  478. Object.IntensityScale = FlashLevel(nr)
  479. End Select
  480. End Sub
  481.  
  482. Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
  483. Object.IntensityScale = FlashLevel(nr)
  484. End Sub
  485.  
  486.  
  487. '**********************************************************************************************************
  488. 'Digital Display
  489. '**********************************************************************************************************
  490. Dim Digits(40)
  491. Digits(0)=Array(a00, a05, a0c, a0d, a08, a01, a06, a0f, a02, a03, a04, a07, a0b, a0a, a09, a0e)
  492. Digits(1)=Array(a10, a15, a1c, a1d, a18, a11, a16, a1f, a12, a13, a14, a17, a1b, a1a, a19, a1e)
  493. Digits(2)=Array(a20, a25, a2c, a2d, a28, a21, a26, a2f, a22, a23, a24, a27, a2b, a2a, a29, a2e)
  494. Digits(3)=Array(a30, a35, a3c, a3d, a38, a31, a36, a3f, a32, a33, a34, a37, a3b, a3a, a39, a3e)
  495. Digits(4)=Array(a40, a45, a4c, a4d, a48, a41, a46, a4f, a42, a43, a44, a47, a4b, a4a, a49, a4e)
  496. Digits(5)=Array(a50, a55, a5c, a5d, a58, a51, a56, a5f, a52, a53, a54, a57, a5b, a5a, a59, a5e)
  497. Digits(6)=Array(a60, a65, a6c, a6d, a68, a61, a66, a6f, a62, a63, a64, a67, a6b, a6a, a69, a6e)
  498. Digits(7)=Array(a70, a75, a7c, a7d, a78, a71, a76, a7f, a72, a73, a74, a77, a7b, a7a, a79, a7e)
  499. Digits(8)=Array(a80, a85, a8c, a8d, a88, a81, a86, a8f, a82, a83, a84, a87, a8b, a8a, a89, a8e)
  500. Digits(9)=Array(a90, a95, a9c, a9d, a98, a91, a96, a9f, a92, a93, a94, a97, a9b, a9a, a99, a9e)
  501. Digits(10)=Array(aa0, aa5, aac, aad, aa8, aa1, aa6, aaf, aa2, aa3, aa4, aa7, aab, aaa, aa9, aae)
  502. Digits(11)=Array(ab0, ab5, abc, abd, ab8, ab1, ab6, abf, ab2, ab3, ab4, ab7, abb, aba, ab9, abe)
  503. Digits(12)=Array(ac0, ac5, acc, acd, ac8, ac1, ac6, acf, ac2, ac3, ac4, ac7, acb, aca, ac9, ace)
  504. Digits(13)=Array(ad0, ad5, adc, add, ad8, ad1, ad6, adf, ad2, ad3, ad4, ad7, adb, ada, ad9, ade)
  505. Digits(14)=Array(ae0, ae5, aec, aed, ae8, ae1, ae6, aef, ae2, ae3, ae4, ae7, aeb, aea, ae9, aee)
  506. Digits(15)=Array(af0, af5, afc, afd, af8, af1, af6, aff, af2, af3, af4, af7, afb, afa, af9, afe)
  507. Digits(16)=Array(b00, b05, b0c, b0d, b08, b01, b06, b0f, b02, b03, b04, b07, b0b, b0a, b09, b0e)
  508. Digits(17)=Array(b10, b15, b1c, b1d, b18, b11, b16, b1f, b12, b13, b14, b17, b1b, b1a, b19, b1e)
  509. Digits(18)=Array(b20, b25, b2c, b2d, b28, b21, b26, b2f, b22, b23, b24, b27, b2b, b2a, b29, b2e)
  510. Digits(19)=Array(b30, b35, b3c, b3d, b38, b31, b36, b3f, b32, b33, b34, b37, b3b, b3a, b39, b3e)
  511.  
  512. Digits(20)=Array(b40, b45, b4c, b4d, b48, b41, b46, b4f, b42, b43, b44, b47, b4b, b4a, b49, b4e)
  513. Digits(21)=Array(b50, b55, b5c, b5d, b58, b51, b56, b5f, b52, b53, b54, b57, b5b, b5a, b59, b5e)
  514. Digits(22)=Array(b60, b65, b6c, b6d, b68, b61, b66, b6f, b62, b63, b64, b67, b6b, b6a, b69, b6e)
  515. Digits(23)=Array(b70, b75, b7c, b7d, b78, b71, b76, b7f, b72, b73, b74, b77, b7b, b7a, b79, b7e)
  516. Digits(24)=Array(b80, b85, b8c, b8d, b88, b81, b86, b8f, b82, b83, b84, b87, b8b, b8a, b89, b8e)
  517. Digits(25)=Array(b90, b95, b9c, b9d, b98, b91, b96, b9f, b92, b93, b94, b97, b9b, b9a, b99, b9e)
  518. Digits(26)=Array(ba0, ba5, bac, bad, ba8, ba1, ba6, baf, ba2, ba3, ba4, ba7, bab, baa, ba9, bae)
  519. Digits(27)=Array(bb0, bb5, bbc, bbd, bb8, bb1, bb6, bbf, bb2, bb3, bb4, bb7, bbb, bba, bb9, bbe)
  520. Digits(28)=Array(bc0, bc5, bcc, bcd, bc8, bc1, bc6, bcf, bc2, bc3, bc4, bc7, bcb, bca, bc9, bce)
  521. Digits(29)=Array(bd0, bd5, bdc, bdd, bd8, bd1, bd6, bdf, bd2, bd3, bd4, bd7, bdb, bda, bd9, bde)
  522. Digits(30)=Array(be0, be5, bec, bed, be8, be1, be6, bef, be2, be3, be4, be7, beb, bea, be9, bee)
  523. Digits(31)=Array(bf0, bf5, bfc, bfd, bf8, bf1, bf6, bff, bf2, bf3, bf4, bf7, bfb, bfa, bf9, bfe)
  524. Digits(32)=Array(ac18, ac16, acc1, acd1, ac19, ac17, ac15, acf1, ac11, ac13, ac12, ac14, acb1, aca1, ac10, ace1)
  525. Digits(33)=Array(ad18, ad16, adc1, add1, ad19, ad17, ad15, adf1, ad11, ad13, ad12, ad14, adb1, ada1, ad10, ade1)
  526. Digits(34)=Array(ae18, ae16, aec1, aed1, ae19, ae17, ae15, aef1, ae11, ae13, ae12, ae14, aeb1, aea1, ae10, aee1)
  527. Digits(35)=Array(af18, af16, afc1, afd1, af19, af17, af15, aff1, af11, af13, af12, af14, afb1, afa1, af10, afe1)
  528. Digits(36)=Array(b9, b7, b0c1, b0d1, b100, b8, b6, b0f1, b2, b4, b3, b5, b0b1, b0a1, b1,b0e1)
  529. Digits(37)=Array(b109, b107, b1c1, b1d1, b110, b108, b106, b1f1, b102, b104, b103, b105, b1b1, b1a1, b101,b1e1)
  530. Digits(38)=Array(b119, b117, b2c1, b2d1, b120, b118, b116, b2f1, b112, b114, b113, b115, b2b1, b2a1, b111, b2e1)
  531. Digits(39)=Array(b129, b127, b3c1, b3d1, b130, b128, b126, b3f1, b122, b3b1, b123, b125, b3b1, b3a1, b121, b3e1)
  532.  
  533.  
  534. Sub DisplayTimer_Timer
  535. Dim ChgLED, ii, jj, num, chg, stat, obj, b, x
  536. ChgLED=Controller.ChangedLEDs(&Hffffffff, &Hffffffff)
  537. If Not IsEmpty(ChgLED)Then
  538. If DesktopMode = True Then
  539. For ii=0 To UBound(chgLED)
  540. num=chgLED(ii, 0) : chg=chgLED(ii, 1) : stat=chgLED(ii, 2)
  541. if (num < 40) then
  542. For Each obj In Digits(num)
  543. If chg And 1 Then obj.State=stat And 1
  544. chg=chg\2 : stat=stat\2
  545. Next
  546. Else
  547. end if
  548. Next
  549. end if
  550. End If
  551. End Sub
  552. '**********************************************************************************************************
  553. '**********************************************************************************************************
  554.  
  555.  
  556. 'Gottlieb Spring Break
  557. 'added by Inkochnito
  558. Sub editDips
  559. Dim vpmDips : Set vpmDips = New cvpmDips
  560. With vpmDips
  561. .AddForm 700,400,"Spring Break - DIP switches"
  562. .AddFrame 2,4,190,"Maximum credits",49152,Array("8 credits",0,"10 credits",32768,"15 credits",&H00004000,"20 credits",49152)'dip 15&16
  563. .AddFrame 2,80,190,"Coin chute 1 and 2 control",&H00002000,Array("seperate",0,"same",&H00002000)'dip 14
  564. .AddFrame 2,126,190,"Playfield special",&H00200000,Array("replay",0,"extra ball",&H00200000)'dip 22
  565. .AddFrame 2,172,190,"High games to date control",&H00000020,Array("no effect",0,"reset high games 2-5 on power off",&H00000020)'dip 6
  566. '.AddFrame 2,218,190,"Auto-percentage control",&H00000080,Array("disabled (normal high score mode)",0,"enabled",&H00000080)'dip 8
  567. .AddFrame 2,218,190,"Game start multiball",&H40000000,Array("no multiball at the start",0,"start with multiball",&H40000000)'dip 31
  568. .AddFrame 2,264,190,"Game option",&H80000000,Array("off",0,"on",&H80000000)'dip 32
  569. .AddFrame 205,4,190,"High game to date awards",&H00C00000,Array("not displayed and no award",0,"displayed and no award",&H00800000,"displayed and 2 replays",&H00400000,"displayed and 3 replays",&H00C00000)'dip 23&24
  570. .AddFrame 205,80,190,"Balls per game",&H01000000,Array("5 balls",0,"3 balls",&H01000000)'dip 25
  571. .AddFrame 205,126,190,"Replay limit",&H04000000,Array("no limit",0,"one per game",&H04000000)'dip 27
  572. .AddFrame 205,172,190,"Novelty",&H08000000,Array("normal",0,"extra ball and replay scores 500K",&H08000000)'dip 28
  573. .AddFrame 205,218,190,"Game mode",&H10000000,Array("replay",0,"extra ball",&H10000000)'dip 29
  574. .AddFrame 205,264,190,"3rd coin chute credits control",&H20000000,Array("no effect",0,"add 9",&H20000000)'dip 30
  575. .AddChk 2,316,180,Array("Match feature",&H02000000)'dip 26
  576. .AddLabel 50,335,300,20,"After hitting OK, press F3 to reset game with new settings."
  577. .ViewDips
  578. End With
  579. End Sub
  580. Set vpmShowDips = GetRef("editDips")
  581.  
  582. Sub Table1_Exit ' in some tables this needs to be Table1_Exit
  583. Controller.Stop
  584. End Sub
  585.  
  586. '**********************************************************************************************************
  587.  
  588. '**********Sling Shot Animations
  589. ' Rstep and Lstep are the variables that increment the animation
  590. '****************
  591. Dim RStep
  592.  
  593. Sub RightSlingShot_Slingshot
  594. vpmTimer.PulseSw(25)
  595. PlaySound SoundFX("right_slingshot",DOFContactors), 0, 1, 0.05, 0.05
  596. RSling.Visible = 0
  597. RSling1.Visible = 1
  598. sling1.TransZ = -20
  599. RStep = 0
  600. RightSlingShot.TimerEnabled = 1
  601. End Sub
  602.  
  603. Sub RightSlingShot_Timer
  604. Select Case RStep
  605. Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -10
  606. Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.TransZ = 0:RightSlingShot.TimerEnabled = 0:
  607. End Select
  608. RStep = RStep + 1
  609. End Sub
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617. '*********************************************************************
  618. ' Positional Sound Playback Functions
  619. '*********************************************************************
  620.  
  621. ' Play a sound, depending on the X,Y position of the table element (especially cool for surround speaker setups, otherwise stereo panning only)
  622. ' parameters (defaults): loopcount (1), volume (1), randompitch (0), pitch (0), useexisting (0), restart (1))
  623. ' Note that this will not work (currently) for walls/slingshots as these do not feature a simple, single X,Y position
  624. Sub PlayXYSound(soundname, tableobj, loopcount, volume, randompitch, pitch, useexisting, restart)
  625. PlaySound soundname, loopcount, volume, AudioPan(tableobj), randompitch, pitch, useexisting, restart, AudioFade(tableobj)
  626. End Sub
  627.  
  628. ' Similar subroutines that are less complicated to use (e.g. simply use standard parameters for the PlaySound call)
  629. Sub PlaySoundAt(soundname, tableobj)
  630. PlaySound soundname, 1, 1, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
  631. End Sub
  632.  
  633. Sub PlaySoundAtBall(soundname)
  634. PlaySoundAt soundname, ActiveBall
  635. End Sub
  636.  
  637.  
  638. '*********************************************************************
  639. ' Supporting Ball & Sound Functions
  640. '*********************************************************************
  641.  
  642. Function AudioFade(tableobj) ' Fades between front and back of the table (for surround systems or 2x2 speakers, etc), depending on the Y position on the table. "table1" is the name of the table
  643. Dim tmp
  644. tmp = tableobj.y * 2 / table1.height-1
  645. If tmp > 0 Then
  646. AudioFade = Csng(tmp ^10)
  647. Else
  648. AudioFade = Csng(-((- tmp) ^10) )
  649. End If
  650. End Function
  651.  
  652. Function AudioPan(tableobj) ' Calculates the pan for a tableobj based on the X position on the table. "table1" is the name of the table
  653. Dim tmp
  654. tmp = tableobj.x * 2 / table1.width-1
  655. If tmp > 0 Then
  656. AudioPan = Csng(tmp ^10)
  657. Else
  658. AudioPan = Csng(-((- tmp) ^10) )
  659. End If
  660. End Function
  661.  
  662. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  663. Vol = Csng(BallVel(ball) ^2 / 2000)
  664. End Function
  665.  
  666. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  667. Pitch = BallVel(ball) * 20
  668. End Function
  669.  
  670. Function BallVel(ball) 'Calculates the ball speed
  671. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  672. End Function
  673.  
  674.  
  675.  
  676.  
  677. '********************************************************************
  678. ' JP's VP10 Rolling Sounds (+rothbauerw's Dropping Sounds)
  679. '********************************************************************
  680.  
  681. Const tnob = 5 ' total number of balls
  682. ReDim rolling(tnob)
  683. InitRolling
  684.  
  685. Sub InitRolling
  686. Dim i
  687. For i = 0 to tnob
  688. rolling(i) = False
  689. Next
  690. End Sub
  691.  
  692. Sub RollingTimer_Timer()
  693. Dim BOT, b
  694. BOT = GetBalls
  695.  
  696. ' stop the sound of deleted balls
  697. For b = UBound(BOT) + 1 to tnob
  698. rolling(b) = False
  699. StopSound("fx_ballrolling" & b)
  700. Next
  701.  
  702. ' exit the sub if no balls on the table
  703. If UBound(BOT) = -1 Then Exit Sub
  704.  
  705. For b = 0 to UBound(BOT)
  706. ' play the rolling sound for each ball
  707. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  708. rolling(b) = True
  709. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b)), AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  710. Else
  711. If rolling(b) = True Then
  712. StopSound("fx_ballrolling" & b)
  713. rolling(b) = False
  714. End If
  715. End If
  716.  
  717. ' play ball drop sounds
  718. If BOT(b).VelZ < -1 and BOT(b).z < 55 and BOT(b).z > 27 Then 'height adjust for ball drop sounds
  719. PlaySound "fx_ball_drop" & b, 0, ABS(BOT(b).velz)/17, AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  720. End If
  721. Next
  722. End Sub
  723.  
  724. '**********************
  725. ' Ball Collision Sound
  726. '**********************
  727.  
  728. Sub OnBallBallCollision(ball1, ball2, velocity)
  729. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, AudioPan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1)
  730. End Sub
  731.  
  732.  
  733. '*****************************************
  734. ' ninuzzu's FLIPPER SHADOWS
  735. '*****************************************
  736.  
  737. sub FlipperTimer_Timer()
  738. FlipperLSh.RotZ = LeftFlipper.currentangle
  739. FlipperRSh.RotZ = RightFlipper.currentangle
  740. FlipperLSh1.RotZ = LeftFlipper1.currentangle
  741. FlipperRSh1.RotZ = RightFlipper1.currentangle
  742.  
  743. FlipperT1.roty = LeftFlipper.currentangle + 237
  744. FlipperT5.roty = RightFlipper.currentangle + 120
  745. FlipperT2.roty = LeftFlipper1.currentangle + 237
  746.  
  747. rightFlipper1Bat.roty = RightFlipper1.currentangle + 120
  748. rightFlipper1Rubber.roty = RightFlipper1.currentangle + 120
  749. rightFlipper1screw.roty = RightFlipper1.currentangle + 120
  750.  
  751. End Sub
  752.  
  753. '*****************************************
  754. ' ninuzzu's BALL SHADOW
  755. '*****************************************
  756. Dim BallShadow
  757. BallShadow = Array (BallShadow1,BallShadow2,BallShadow3,BallShadow4,BallShadow5)
  758.  
  759. Sub BallShadowUpdate_timer()
  760. Dim BOT, b
  761. BOT = GetBalls
  762. ' hide shadow of deleted balls
  763. If UBound(BOT)<(tnob-1) Then
  764. For b = (UBound(BOT) + 1) to (tnob-1)
  765. BallShadow(b).visible = 0
  766. Next
  767. End If
  768. ' exit the Sub if no balls on the table
  769. If UBound(BOT) = -1 Then Exit Sub
  770. ' render the shadow for each ball
  771. For b = 0 to UBound(BOT)
  772. If BOT(b).X < Table1.Width/2 Then
  773. BallShadow(b).X = ((BOT(b).X) - (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/7)) + 6
  774. Else
  775. BallShadow(b).X = ((BOT(b).X) + (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/7)) - 6
  776. End If
  777. ballShadow(b).Y = BOT(b).Y + 12
  778. If BOT(b).Z > 20 Then
  779. BallShadow(b).visible = 1
  780. Else
  781. BallShadow(b).visible = 0
  782. End If
  783. Next
  784. End Sub
  785.  
  786.  
  787.  
  788. '************************************
  789. ' What you need to add to your table
  790. '************************************
  791.  
  792. ' a timer called RollingTimer. With a fast interval, like 10
  793. ' one collision sound, in this script is called fx_collide
  794. ' as many sound files as max number of balls, with names ending with 0, 1, 2, 3, etc
  795. ' for ex. as used in this script: fx_ballrolling0, fx_ballrolling1, fx_ballrolling2, fx_ballrolling3, etc
  796.  
  797.  
  798. '******************************************
  799. ' Explanation of the rolling sound routine
  800. '******************************************
  801.  
  802. ' sounds are played based on the ball speed and position
  803.  
  804. ' the routine checks first for deleted balls and stops the rolling sound.
  805.  
  806. ' The For loop goes through all the balls on the table and checks for the ball speed and
  807. ' if the ball is on the table (height lower than 30) then then it plays the sound
  808. ' otherwise the sound is stopped, like when the ball has stopped or is on a ramp or flying.
  809.  
  810. ' The sound is played using the VOL, AUDIOPAN, AUDIOFADE and PITCH functions, so the volume and pitch of the sound
  811. ' will change according to the ball speed, and the AUDIOPAN & AUDIOFADE functions will change the stereo position
  812. ' according to the position of the ball on the table.
  813.  
  814.  
  815. '**************************************
  816. ' Explanation of the collision routine
  817. '**************************************
  818.  
  819. ' The collision is built in VP.
  820. ' You only need to add a Sub OnBallBallCollision(ball1, ball2, velocity) and when two balls collide they
  821. ' will call this routine. What you add in the sub is up to you. As an example is a simple Playsound with volume and paning
  822. ' depending of the speed of the collision.
  823.  
  824.  
  825. Sub Pins_Hit (idx)
  826. PlaySound "pinhit_low", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  827. End Sub
  828.  
  829. Sub Targets_Hit (idx)
  830. PlaySound "target", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  831. End Sub
  832.  
  833. Sub Metals_Thin_Hit (idx)
  834. PlaySound "metalhit_thin", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  835. End Sub
  836.  
  837. Sub Metals_Medium_Hit (idx)
  838. PlaySound "metalhit_medium", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  839. End Sub
  840.  
  841. Sub Metals2_Hit (idx)
  842. PlaySound "metalhit2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  843. End Sub
  844.  
  845. Sub Gates_Hit (idx)
  846. PlaySound "gate4", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  847. End Sub
  848.  
  849. Sub Spinner_Spin
  850. PlaySound "fx_spinner", 0, .25, AudioPan(Spinner), 0.25, 0, 0, 1, AudioFade(Spinner)
  851. End Sub
  852.  
  853. Sub Rubbers_Hit(idx)
  854. dim finalspeed
  855. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  856. If finalspeed > 20 then
  857. PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  858. End if
  859. If finalspeed >= 6 AND finalspeed <= 20 then
  860. RandomSoundRubber()
  861. End If
  862. End Sub
  863.  
  864. Sub Posts_Hit(idx)
  865. dim finalspeed
  866. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  867. If finalspeed > 16 then
  868. PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  869. End if
  870. If finalspeed >= 6 AND finalspeed <= 16 then
  871. RandomSoundRubber()
  872. End If
  873. End Sub
  874.  
  875. Sub RandomSoundRubber()
  876. Select Case Int(Rnd*3)+1
  877. Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  878. Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  879. Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  880. End Select
  881. End Sub
  882.  
  883. Sub LeftFlipper_Collide(parm)
  884. RandomSoundFlipper()
  885. End Sub
  886.  
  887. Sub RightFlipper_Collide(parm)
  888. RandomSoundFlipper()
  889. End Sub
  890.  
  891. Sub RandomSoundFlipper()
  892. Select Case Int(Rnd*3)+1
  893. Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  894. Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  895. Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  896. End Select
  897. End Sub
Advertisement
Add Comment
Please, Sign In to add comment