Outhere

Chicago Cubs Triple Play (32assassin_Gottlieb 1985)2.0

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