Outhere

Devil's Dare (Gottlieb 1992) 1.0.0

Jun 8th, 2021 (edited)
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.47 KB | None | 0 0
  1. 'DOF updated by outhere on 6/8/2021
  2. '103 left slingshot
  3. '104 right slingshot
  4. '105 Bumper Back Left
  5. '106 Bumper Back Center
  6. '107 Bumper Back Right
  7. '108 LeftMagnaSave (Left Ball Save Kicker)
  8.  
  9.  
  10. Option Explicit
  11. Randomize
  12.  
  13. On Error Resume Next
  14. ExecuteGlobal GetTextFile("controller.vbs")
  15. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  16. On Error Goto 0
  17.  
  18. Const cGameName="dvlsdre",UseSolenoids=1,UseLamps=1,UseGI=0,SSolenoidOn="SolOn",SSolenoidOff="SolOff", SCoin="coin"
  19.  
  20. LoadVPM "01560000","SYS80.VBS",3.2
  21. Dim DesktopMode: DesktopMode = Table1.ShowDT
  22.  
  23. If DesktopMode = True Then 'Show Desktop components
  24. Ramp16.visible=1
  25. Ramp15.visible=1
  26. Primitive13.visible=1
  27. Else
  28. Ramp16.visible=0
  29. Ramp15.visible=0
  30. Primitive13.visible=0
  31. End if
  32.  
  33. '*************************************************************
  34. 'Solenoid Call backs
  35. '**********************************************************************************************************
  36.  
  37. SolCallback(1) = "DTT.SolDropUp"
  38. SolCallback(2) = "bsKicker.SolOut"
  39. SolCallback(3) = "bsHole.SolOut"
  40. SolCallback(4) = "SolBallSaver"
  41. SolCallback(5) = "DTL.SolDropUp"
  42. SolCallback(6) = "DTR.SolDropUp"
  43. SolCallback(8) = "vpmSolSound SoundFX(""Knocker"",DOFKnocker),"
  44. SolCallback(9) = "bsTrough.SolIn"
  45. SolCallback(10) = "Sol10"
  46.  
  47. SolCallback(sLRFlipper) = "SolRFlipper"
  48. SolCallback(sLLFlipper) = "SolLFlipper"
  49.  
  50. Sub SolLFlipper(Enabled)
  51. If Enabled Then
  52. PlaySound SoundFX("fx_Flipperup",DOFContactors):LeftFlipper.RotateToEnd
  53. Else
  54. PlaySound SoundFX("fx_Flipperdown",DOFContactors):LeftFlipper.RotateToStart
  55. End If
  56. End Sub
  57.  
  58. Sub SolRFlipper(Enabled)
  59. If Enabled Then
  60. PlaySound SoundFX("fx_Flipperup",DOFContactors):RightFlipper.RotateToEnd:RightFlipper1.RotateToEnd
  61. Else
  62. PlaySound SoundFX("fx_Flipperdown",DOFContactors):RightFlipper.RotateToStart:RightFlipper1.RotateToStart
  63. End If
  64. End Sub
  65.  
  66. '**********************************************************************************************************
  67.  
  68. 'Solenoid Controlled toys
  69. '**********************************************************************************************************
  70.  
  71. Dim BallSaverActive,FlipperActive
  72. Sub SolBallSaver(Enabled)
  73. if enabled then BallSaverActive = True
  74. End Sub
  75.  
  76. Sub Sol10(Enabled)
  77. FlipperActive = enabled
  78. if not Flipperactive then
  79. LeftFlipper.RotateToStart
  80. RightFlipper.RotateToStart
  81. RightFlipper1.RotateToStart
  82. end if
  83. End Sub
  84.  
  85.  
  86. '*****GI Lights On
  87. dim xx
  88. For each xx in GI:xx.State = 1: Next
  89.  
  90. 'Primitive Flipper
  91. Sub FlipperTimer_Timer
  92. FlipperT1.roty = LeftFlipper.currentangle + 237
  93. FlipperT5.roty = RightFlipper.currentangle + 120
  94. FlipperT2.roty = RightFlipper1.currentangle + 180
  95. End Sub
  96.  
  97. '**********************************************************************************************************
  98.  
  99. 'Initiate Table
  100. '**********************************************************************************************************
  101.  
  102. Dim bsTrough, bsKicker, bsHole, DTT, DTL, DTR
  103.  
  104. Sub Table1_Init
  105. vpmInit Me
  106. On Error Resume Next
  107. With Controller
  108. .GameName = cGameName
  109. If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description : Exit Sub
  110. .SplashInfoLine = "Devil's Dare"&chr(13)&"You Suck"
  111. .HandleMechanics=0
  112. .HandleKeyboard=0
  113. .ShowDMDOnly=1
  114. .ShowFrame=0
  115. .ShowTitle=0
  116. .hidden = 1
  117. If Err Then MsgBox Err.Description
  118. End With
  119. On Error Goto 0
  120. Controller.SolMask(0)=0
  121. vpmTimer.AddTimer 2000,"Controller.SolMask(0)=&Hffffffff'" 'ignore all solenoids - then add the timer to renable all the solenoids after 2 seconds
  122. Controller.Run
  123. If Err Then MsgBox Err.Description
  124. On Error Goto 0
  125.  
  126. PinMAMETimer.Interval=PinMAMEInterval
  127. PinMAMETimer.Enabled=1
  128.  
  129. vpmNudge.TiltSwitch=57
  130. vpmNudge.Sensitivity=5
  131. vpmNudge.TiltObj = Array(Bumper1,Bumper2,Bumper3,LeftslingShot,RightslingShot)
  132.  
  133. Set bsTrough=New cvpmBallStack
  134. bsTrough.InitSw 55,50,99,51,0,0,0,0
  135. bsTrough.InitKick BallRelease,90,5
  136. bsTrough.InitExitSnd SoundFX("ballrelease",DOFContactors), SoundFX("Solenoid",DOFContactors)
  137. bsTrough.Balls=3
  138.  
  139. Set bsKicker=New cvpmBallStack
  140. bsKicker.InitSaucer Kicker,5,0,22
  141. bsKicker.InitExitSnd SoundFX("Popper",DOFContactors), SoundFX("Solenoid",DOFContactors)
  142.  
  143. Set bsHole=New cvpmBallStack
  144. bsHole.InitSaucer Hole,6,180,5
  145. bsHole.InitExitSnd SoundFX("Popper",DOFContactors), SoundFX("Solenoid",DOFContactors)
  146.  
  147. set DTT = new cvpmDropTarget
  148. DTT.InitDrop Array(sw4,sw14,sw24), Array(4,14,24)
  149. DTT.InitSnd SoundFX("DTDrop",DOFContactors),SoundFX("DTReset",DOFContactors)
  150.  
  151. set DTL = new cvpmDropTarget
  152. DTL.InitDrop Array(sw0,sw10,sw20,sw30,sw40), Array(0,10,20,30,40)
  153. DTL.InitSnd SoundFX("DTDrop",DOFContactors),SoundFX("DTReset",DOFContactors)
  154.  
  155. set DTR = new cvpmDropTarget
  156. DTR.InitDrop Array(sw1,sw11,sw21,sw31,sw41), Array(1,11,21,31,41)
  157. DTR.InitSnd SoundFX("DTDrop",DOFContactors),SoundFX("DTReset",DOFContactors)
  158.  
  159. BallSaverActive = False
  160. BallSaveKicker.pullback
  161.  
  162. End Sub
  163.  
  164. '**********************************************************************************************************
  165. 'Plunger code
  166. '**********************************************************************************************************
  167.  
  168. Sub Table1_KeyDown(ByVal KeyCode)
  169. If KeyDownHandler(keycode) Then Exit Sub
  170. If keycode = LeftFlipperKey Then bLutActive = True
  171. If keycode = RightMagnaSave Then
  172. If bLutActive Then NextLUT: End If
  173. End If
  174. If keycode = PlungerKey Then Plunger.Pullback:playsound"plungerpull"
  175. If keycode = LeftMagnaSave then
  176. if BallSaverActive then
  177. BallSaveKicker.fire
  178. PlaySound SoundFXDOF( "Popper", 108, DOFPulse,DOFContactors) 'Kicker
  179. BallSaveTimer.enabled = True
  180. end if
  181. end if
  182. End Sub
  183.  
  184. Sub Table1_KeyUp(ByVal KeyCode)
  185. If KeyUpHandler(keycode) Then Exit Sub
  186. If keycode = LeftFlipperKey Then bLutActive = False
  187. If keycode = PlungerKey Then Plunger.Fire:PlaySound"plunger"
  188. If keycode = LeftMagnaSave then
  189. BallSaveKicker.pullback
  190. end if
  191. End Sub
  192.  
  193. '**********************************************************************************************************
  194.  
  195. ' Drain hole
  196. Sub Drain_Hit : playsound"drain" : bsTrough.addball me : End Sub
  197. Sub Kicker_Hit : bsKicker.addball me : playsound "popper_ball" : End Sub
  198. Sub Hole_Hit : bsHole.addball me : playsound "popper_ball" : End Sub
  199.  
  200. 'Bumpers
  201. Sub Bumper1_Hit : vpmTimer.PulseSw(34) : playsound SoundFXDOF("fx_bumper1", 105, DOFPulse,DOFContactors): End Sub
  202. Sub Bumper2_Hit : vpmTimer.PulseSw(34) : playsound SoundFXDOF("fx_bumper1", 106, DOFPulse,DOFContactors): End Sub
  203. Sub Bumper3_Hit : vpmTimer.PulseSw(34) : playsound SoundFXDOF("fx_bumper1", 107, DOFPulse,DOFContactors): End Sub
  204.  
  205. 'Drop Targets
  206. Sub sw0_Dropped:DTL.Hit 1:End Sub
  207. Sub sw10_Dropped:DTL.Hit 2:End Sub
  208. Sub sw20_Dropped:DTL.Hit 3:End Sub
  209. Sub sw30_Dropped:DTL.Hit 4:End Sub
  210. Sub sw40_Dropped:DTL.Hit 5:End Sub
  211.  
  212. Sub sw1_Dropped:DTR.Hit 1:End Sub
  213. Sub sw11_Dropped:DTR.Hit 2:End Sub
  214. Sub sw21_Dropped:DTR.Hit 3:End Sub
  215. Sub sw31_Dropped:DTR.Hit 4:End Sub
  216. Sub sw41_Dropped:DTR.Hit 5:End Sub
  217.  
  218. Sub sw4_Dropped:DTT.Hit 1:End Sub
  219. Sub sw14_Dropped:DTT.Hit 2:End Sub
  220. Sub sw24_Dropped:DTT.Hit 3:End Sub
  221.  
  222.  
  223. 'Stand Up Targets
  224. Sub sw2_Hit : vpmTimer.PulseSw 2 : PlaySound SoundFX("Target",DOFTargets):End Sub
  225. Sub sw12_Hit : vpmTimer.PulseSw 12 : PlaySound SoundFX("Target",DOFTargets):End Sub
  226. Sub sw22_Hit : vpmTimer.PulseSw 22 : PlaySound SoundFX("Target",DOFTargets):End Sub
  227. Sub sw32_Hit : vpmTimer.PulseSw 32 : PlaySound SoundFX("Target",DOFTargets):End Sub
  228.  
  229. Sub sw45_Hit : vpmTimer.PulseSw 45 : PlaySound SoundFX("Target",DOFTargets):End Sub
  230. Sub sw46_Hit : vpmTimer.PulseSw 46 : PlaySound SoundFX("Target",DOFTargets):End Sub
  231.  
  232. Sub sw3_Hit : vpmTimer.PulseSw 3: PlaySound SoundFX("Target",DOFTargets):End Sub
  233. Sub sw13_Hit : vpmTimer.PulseSw 13 : PlaySound SoundFX("Target",DOFTargets):End Sub
  234. Sub sw23_Hit : vpmTimer.PulseSw 23 : PlaySound SoundFX("Target",DOFTargets):End Sub
  235. Sub sw33_Hit : vpmTimer.PulseSw 33 : PlaySound SoundFX("Target",DOFTargets):End Sub
  236.  
  237. Sub sw25_Hit : vpmTimer.PulseSw 25 : PlaySound SoundFX("Target",DOFTargets):End Sub
  238. Sub sw25a_Hit : vpmTimer.PulseSw 25 : PlaySound SoundFX("Target",DOFTargets):End Sub
  239.  
  240. 'Wire Triggers
  241. Sub sw36_Hit:Controller.Switch(36)=1 : playsound"rollover" : End Sub
  242. Sub sw36_unHit:Controller.Switch(36)=0:End Sub
  243. Sub sw54_Hit:Controller.Switch(54)=1 : playsound"rollover" : End Sub
  244. Sub sw54_unHit:Controller.Switch(54)=0:End Sub
  245. Sub sw53_Hit:Controller.Switch(53)=1 : playsound"rollover" : End Sub
  246. Sub sw53_unHit:Controller.Switch(53)=0:End Sub
  247. Sub sw42_Hit:Controller.Switch(42)=1 : playsound"rollover" : End Sub
  248. Sub sw42_unHit:Controller.Switch(42)=0:End Sub
  249. Sub sw43_Hit:Controller.Switch(43)=1 : playsound"rollover" : End Sub
  250. Sub sw43_unHit:Controller.Switch(43)=0:End Sub
  251. Sub sw44_Hit:Controller.Switch(44)=1 : playsound"rollover" : End Sub
  252. Sub sw44_unHit:Controller.Switch(44)=0:End Sub
  253.  
  254. 'Gate Trigger
  255. Sub sw16_Hit : vpmTimer.PulseSw(16) : PlaySound "Gate5":End Sub
  256. Sub Gate1_Hit():PlaySound "Gate5":End Sub
  257. Sub Gate2_Hit():PlaySound "Gate5":End Sub
  258. Sub Gate3_Hit():PlaySound "Gate5":End Sub
  259. 'Spinners
  260. Sub sw26_Spin:vpmTimer.PulseSw 26 : playsound"fx_spinner" : End Sub
  261. Sub sw15_Spin:vpmTimer.PulseSw 15 : playsound"fx_spinner" : End Sub
  262.  
  263. 'Scoring Rubbers
  264. Sub sw52a_Slingshot:vpmTimer.PulseSw 52 : playsound"rubber_hit_3" : End Sub
  265. Sub sw52b_Slingshot:vpmTimer.PulseSw 52 : playsound"rubber_hit_3" : End Sub
  266. Sub sw52c_Slingshot:vpmTimer.PulseSw 52 : playsound"rubber_hit_3" : End Sub
  267. Sub sw35a_Slingshot:vpmTimer.PulseSw 35 : playsound"rubber_hit_3" : End Sub
  268. Sub sw35b_Slingshot:vpmTimer.PulseSw 35 : playsound"rubber_hit_3" : End Sub
  269.  
  270. '**********************************************************************************************************
  271. ' Map Lights to Array
  272. '**********************************************************************************************************
  273.  
  274. set lights(3) = lamp3 'shoot again pf
  275. set lights(4) = lamp4
  276. set lights(5) = lamp5
  277. set lights(6) = lamp6
  278. set lights(7) = lamp7
  279. set lights(12) = l12
  280. set lights(15) = lamp15
  281. lights(16) = array(L16a,L16b,L16c) 'Bumper Lights
  282. set lights(17) = lamp17
  283. set lights(18) = lamp18
  284. set lights(19) = lamp19
  285. set lights(20) = lamp20
  286. set lights(21) = lamp21
  287. set lights(22) = lamp22
  288. set lights(23) = lamp23
  289. set lights(24) = lamp24
  290. set lights(25) = lamp25
  291. set lights(26) = lamp26
  292. set lights(27) = lamp27
  293. set lights(28) = lamp28
  294. set lights(29) = lamp29
  295. set lights(30) = lamp30
  296. set lights(31) = lamp31
  297. set lights(32) = lamp32
  298. set lights(33) = lamp33
  299. set lights(34) = lamp34
  300. set lights(35) = lamp35
  301. set lights(36) = lamp36
  302. set lights(37) = lamp37
  303. set lights(38) = lamp38
  304. set lights(39) = lamp39
  305. lights(40) = array(lamp40a,lamp40b)
  306. set lights(41) = lamp41
  307. set lights(42) = lamp42
  308. set lights(43) = lamp43
  309. set lights(44) = lamp44
  310. set lights(45) = lamp45
  311. set lights(46) = lamp46
  312. set lights(47) = lamp47
  313.  
  314. 'BackGlass
  315. 'set lights(0) = l0 'ballinplay
  316. 'set lights(1) = l1 'tilt
  317. 'set lights(2) = l2 'shoot again lb = pf
  318. 'set lights(8) = l8 '??? lb
  319. 'set lights(9) = l9 'multi-mode
  320. 'set lights(10) = l10 'highscore
  321. 'set lights(11) = l11 'gameover
  322. 'set lights(12) = l12 'ball release
  323. 'set lights(13) = l13 'multi-bonus
  324. 'set lights(14) = l14 '???
  325.  
  326.  
  327. 'Lamp Callback for Ball Release and Ballsaver
  328. Sub LampTimer_Timer
  329. If (L12.State <> 0) and (not BallRelease.timerenabled) Then
  330. BallRelease.timerenabled = True
  331. bsTrough.ExitSol_On
  332. End if
  333.  
  334. if BallSaverActive then
  335. BallSaveA.state = Lightstateon
  336. BallSaveB.state = Lightstateon
  337. xLBallSaver.state = Lightstateon
  338. else
  339. BallSaveA.state = Lightstateoff
  340. BallSaveB.state = Lightstateoff
  341. xLBallSaver.state = Lightstateoff
  342. end if
  343.  
  344.  
  345.  
  346. xL50.state = controller.switch(50)
  347. xL51.state = controller.switch(51)
  348. xL55.state = controller.switch(55)
  349.  
  350. if controller.switch(51) then 'deactivate on last Ball drain
  351. BallSaverActive = False
  352. end if
  353. End sub
  354.  
  355. Sub BallSaveTimer_Timer
  356. BallSaveTimer.enabled = False
  357. BallSaverActive = False
  358. End Sub
  359.  
  360. Sub BallRelease_timer
  361. BallRelease.timerenabled = False
  362. End Sub
  363.  
  364. '**********************************************************************************************************
  365. ' Backglass Light Displays
  366. '**********************************************************************************************************
  367.  
  368. Dim Digits(44)
  369. Digits(0)=Array(a00,a01,a02,a03,a04,a05,a06,n,a08)
  370. Digits(1)=Array(a10,a11,a12,a13,a14,a15,a16,n,a18)
  371. Digits(2)=Array(a20,a21,a22,a23,a24,a25,a26,n,a28)
  372. Digits(3)=Array(a30,a31,a32,a33,a34,a35,a36,n,a38)
  373. Digits(4)=Array(a40,a41,a42,a43,a44,a45,a46,n,a48)
  374. Digits(5)=Array(a50,a51,a52,a53,a54,a55,a56,n,a58)
  375. Digits(6)=Array(b00,b01,b02,b03,b04,b05,b06,n,b08)
  376.  
  377. Digits(7)=Array(b10,b11,b12,b13,b14,b15,b16,n,b18)
  378. Digits(8)=Array(b20,b21,b22,b23,b24,b25,b26,n,b28)
  379. Digits(9)=Array(b30,b31,b32,b33,b34,b35,b36,n,b38)
  380. Digits(10)=Array(b40,b41,b42,b43,b44,b45,b46,n,b48)
  381. Digits(11)=Array(b50,b51,b52,b53,b54,b55,b56,n,b58)
  382. Digits(12)=Array(c00,c01,c02,c03,c04,c05,c06,n,c08)
  383. Digits(13)=Array(c10,c11,c12,c13,c14,c15,c16,n,c18)
  384.  
  385. Digits(14)=Array(c20,c21,c22,c23,c24,c25,c26,n,c28)
  386. Digits(15)=Array(c30,c31,c32,c33,c34,c35,c36,n,c38)
  387. Digits(16)=Array(c40,c41,c42,c43,c44,c45,c46,n,c48)
  388. Digits(17)=Array(c50,c51,c52,c53,c54,c55,c56,n,c58)
  389. Digits(18)=Array(d00,d01,d02,d03,d04,d05,d06,n,d08)
  390. Digits(19)=Array(d10,d11,d12,d13,d14,d15,d16,n,d18)
  391. Digits(20)=Array(d20,d21,d22,d23,d24,d25,d26,n,d28)
  392.  
  393. Digits(21)=Array(d30,d31,d32,d33,d34,d35,d36,n,d38)
  394. Digits(22)=Array(d40,d41,d42,d43,d44,d45,d46,n,d48)
  395. Digits(23)=Array(d50,d51,d52,d53,d54,d55,d56,n,d58)
  396. Digits(24)=Array(e00,e01,e02,e03,e04,e05,e06,n,e08)
  397. Digits(25)=Array(e10,e11,e12,e13,e14,e15,e16,n,e18)
  398. Digits(26)=Array(f00,f01,f02,f03,f04,f05,f06,n,f08)
  399. Digits(27)=Array(f10,f11,f12,f13,f14,f15,f16,n,f18)
  400.  
  401. 'credit -- Ball In Play
  402. Digits(28) = Array(e2,e3,e7,e4,e5,e1,e6,n,e23)
  403. Digits(29) = Array(e9,e17,e22,e19,e20,e8,e21,n,e24)
  404. Digits(30) = Array(f2,f3,f7,f4,f5,f1,f6,n,f23)
  405. Digits(31) = Array(f9,f17,f22,f19,f20,f8,f21,n,f24)
  406.  
  407.  
  408. Digits(32)=Array(d2,d3,d7,d4,d5,d1,d6,n,d62)
  409. Digits(33)=Array(d9,d17,d37,d19,d27,d8,d29,n,d63)
  410. Digits(34)=Array(d47,d49,d61,d57,d59,d39,d60,n,d64)
  411. Digits(35)=Array(e26,e27,e31,e28,e29,e25,e30,n,e39)
  412. Digits(36)=Array(e33,e34,e38,e35,e36,e32,e37,n,e40)
  413. Digits(37)=Array(f26,f27,f31,f28,f29,f25,f30,n,f39)
  414.  
  415.  
  416. Digits(38)=Array(f33,f34,f38,f35,f36,f32,f37,n,f40)
  417. Digits(39)=Array(d82,d83,d87,d84,d85,d81,d86,n,d85)
  418. Digits(40)=Array(d89,d90,d94,d91,d92,d88,d93,n,d96)
  419. Digits(41)=Array(e58,e59,e63,e60,e61,e57,e62,n,e71)
  420. Digits(42)=Array(e65,e66,e70,e67,e68,e64,e69,n,e72)
  421. Digits(43)=Array(f50,f51,f55,f52,f53,f49,f54,n,f56)
  422.  
  423.  
  424. Sub DisplayTimer_Timer
  425. Dim ChgLED,ii,num,chg,stat,obj
  426. ChgLed = Controller.ChangedLEDs(&Hffffffff, &Hffffffff)
  427. If Not IsEmpty(ChgLED) Then
  428. If DesktopMode = True Then
  429. For ii = 0 To UBound(chgLED)
  430. num = chgLED(ii, 0) : chg = chgLED(ii, 1) : stat = chgLED(ii, 2)
  431. if (num < 44) then
  432. For Each obj In Digits(num)
  433. If chg And 1 Then obj.State = stat And 1
  434. chg = chg\2 : stat = stat\2
  435. Next
  436. else
  437. 'if char(stat) > "" then msg(num) = char(stat)
  438. end if
  439. next
  440. end if
  441. end if
  442. End Sub
  443.  
  444.  
  445. '**********************************************************************************************************
  446. '**********************************************************************************************************
  447. 'Gottlieb Devils Dare
  448. 'added by Inkochnito
  449. Sub editDips
  450. Dim vpmDips : Set vpmDips = New cvpmDips
  451. With vpmDips
  452. .AddForm 700,400,"Devils Dare - DIP switches"
  453. .AddChk 7,10,100,Array("Match feature",&H02000000)'dip 26
  454. .AddChkExtra 110,10,100,Array("Speech",&H0020)'SS-board dip 6
  455. .AddChkExtra 220,10,110,Array("Background sound",&H0010)'SS-board dip 5
  456. .AddFrame 2,30,190,"Maximum credits",49152,Array("8 credits",0,"10 credits",32768,"15 credits",&H00004000,"25 credits",49152)'dip 15&16
  457. .AddFrame 2,106,190,"Coin chute 1 and 2 control",&H00002000,Array("seperate",0,"same",&H00002000)'dip 14
  458. .AddFrame 2,152,190,"Playfield special",&H00200000,Array("replay",0,"extra ball",&H00200000)'dip 22
  459. .AddFrame 2,198,190,"3rd coin chute credits control",&H20000000,Array("no effect",0,"add 9",&H20000000)'dip 30
  460. .AddFrame 2,244,190,"High score to date awards",&H00C00000,Array("not displayed and no award",0,"displayed and no award",&H00800000,"displayed and 2 credits",&H00400000,"displayed and 3 credits",&H00C00000)'dip 23&24
  461. .AddFrameExtra 205,30,190,"Attract Sound",&H000C,Array("off",0,"every 10 seconds",&H0004,"every 2 minutes",&H0008,"every 4 minutes",&H000C)'sounddip 3&4
  462. .AddFrame 205,106,190,"Balls per game",&H01000000,Array("5 balls",0,"3 balls",&H01000000)'dip 25
  463. .AddFrame 205,152,190,"Replay limit",&H04000000,Array("no limit",0,"one per ball",&H04000000)'dip 27
  464. .AddFrame 205,198,190,"Novelty mode",&H08000000,Array("normal game mode",0,"50,000 points per special/extra ball",&H08000000)'dip 28
  465. .AddFrame 205,244,190,"Game mode",&H10000000,Array("replay",0,"extra ball",&H10000000)'dip 29
  466. .AddLabel 50,325,300,20,"After hitting OK, press F3 to reset game with new settings."
  467. End With
  468. Dim extra
  469. extra = Controller.Dip(4) + Controller.Dip(5)*256
  470. extra = vpmDips.ViewDipsExtra(extra)
  471. Controller.Dip(4) = extra And 255
  472. Controller.Dip(5) = (extra And 65280)\256 And 255
  473. End Sub
  474. Set vpmShowDips = GetRef("editDips")
  475.  
  476.  
  477. ' *********************************************************************
  478. ' *********************************************************************
  479.  
  480. 'Start of VPX call back Functions
  481.  
  482. ' *********************************************************************
  483. ' *********************************************************************
  484.  
  485.  
  486. '**********Sling Shot Animations
  487. ' Rstep and Lstep are the variables that increment the animation
  488. '****************
  489. Dim RStep, Lstep
  490.  
  491. Sub RightSlingShot_Slingshot
  492. vpmTimer.PulseSw 52
  493. PlaySound SoundFXDOF("right_slingshot", 104, DOFPulse,DOFContactors), 0, 1, 0.05, 0.05
  494. RSling.Visible = 0
  495. RSling1.Visible = 1
  496. sling1.TransZ = -20
  497. RStep = 0
  498. RightSlingShot.TimerEnabled = 1
  499. End Sub
  500.  
  501. Sub RightSlingShot_Timer
  502. Select Case RStep
  503. Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -10
  504. Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.TransZ = 0:RightSlingShot.TimerEnabled = 0:
  505. End Select
  506. RStep = RStep + 1
  507. End Sub
  508.  
  509. Sub LeftSlingShot_Slingshot
  510. vpmTimer.PulseSw 52
  511. PlaySound SoundFXDOF("left_slingshot", 103, DOFPulse,DOFContactors),0,1,-0.05,0.05
  512. LSling.Visible = 0
  513. LSling1.Visible = 1
  514. sling2.TransZ = -20
  515. LStep = 0
  516. LeftSlingShot.TimerEnabled = 1
  517. End Sub
  518.  
  519. Sub LeftSlingShot_Timer
  520. Select Case LStep
  521. Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -10
  522. Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.TransZ = 0:LeftSlingShot.TimerEnabled = 0:
  523. End Select
  524. LStep = LStep + 1
  525. End Sub
  526.  
  527.  
  528. '*************
  529. ' JP'S LUT
  530. '*************
  531.  
  532. Dim bLutActive, LUTImage
  533. Sub LoadLUT
  534. Dim x
  535. x = LoadValue(cGameName, "LUTImage")
  536. If(x <> "") Then LUTImage = x Else LUTImage = 0
  537. UpdateLUT
  538. End Sub
  539.  
  540. Sub SaveLUT
  541. SaveValue cGameName, "LUTImage", LUTImage
  542. End Sub
  543.  
  544. Sub NextLUT: LUTImage = (LUTImage +1 ) MOD 10: UpdateLUT: SaveLUT: End Sub
  545.  
  546. Sub UpdateLUT
  547. Select Case LutImage
  548. Case 0: table1.ColorGradeImage = "LUT0"
  549. Case 1: table1.ColorGradeImage = "LUT1"
  550. Case 2: table1.ColorGradeImage = "LUT2"
  551. Case 3: table1.ColorGradeImage = "LUT3"
  552. Case 4: table1.ColorGradeImage = "LUT4"
  553. Case 5: table1.ColorGradeImage = "LUT5"
  554. Case 6: table1.ColorGradeImage = "LUT6"
  555. Case 7: table1.ColorGradeImage = "LUT7"
  556. Case 8: table1.ColorGradeImage = "LUT8"
  557. Case 9: table1.ColorGradeImage = "LUT9"
  558.  
  559. End Select
  560. End Sub
  561.  
  562. '*********************************************************************
  563. ' Positional Sound Playback Functions
  564. '*********************************************************************
  565.  
  566. ' Play a sound, depending on the X,Y position of the table element (especially cool for surround speaker setups, otherwise stereo panning only)
  567. ' parameters (defaults): loopcount (1), volume (1), randompitch (0), pitch (0), useexisting (0), restart (1))
  568. ' Note that this will not work (currently) for walls/slingshots as these do not feature a simple, single X,Y position
  569. Sub PlayXYSound(soundname, tableobj, loopcount, volume, randompitch, pitch, useexisting, restart)
  570. PlaySound soundname, loopcount, volume, AudioPan(tableobj), randompitch, pitch, useexisting, restart, AudioFade(tableobj)
  571. End Sub
  572.  
  573. ' Similar subroutines that are less complicated to use (e.g. simply use standard parameters for the PlaySound call)
  574. Sub PlaySoundAt(soundname, tableobj)
  575. PlaySound soundname, 1, 1, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
  576. End Sub
  577.  
  578. Sub PlaySoundAtBall(soundname)
  579. PlaySoundAt soundname, ActiveBall
  580. End Sub
  581.  
  582.  
  583. '*********************************************************************
  584. ' Supporting Ball & Sound Functions
  585. '*********************************************************************
  586.  
  587. 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
  588. Dim tmp
  589. tmp = tableobj.y * 2 / table1.height-1
  590. If tmp > 0 Then
  591. AudioFade = Csng(tmp ^10)
  592. Else
  593. AudioFade = Csng(-((- tmp) ^10) )
  594. End If
  595. End Function
  596.  
  597. Function AudioPan(tableobj) ' Calculates the pan for a tableobj based on the X position on the table. "table1" is the name of the table
  598. Dim tmp
  599. tmp = tableobj.x * 2 / table1.width-1
  600. If tmp > 0 Then
  601. AudioPan = Csng(tmp ^10)
  602. Else
  603. AudioPan = Csng(-((- tmp) ^10) )
  604. End If
  605. End Function
  606.  
  607. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  608. Vol = Csng(BallVel(ball) ^2 / 2000)
  609. End Function
  610.  
  611. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  612. Pitch = BallVel(ball) * 20
  613. End Function
  614.  
  615. Function BallVel(ball) 'Calculates the ball speed
  616. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  617. End Function
  618.  
  619.  
  620. '********************************************************************
  621. ' JP's VP10 Rolling Sounds (+rothbauerw's Dropping Sounds)
  622. '********************************************************************
  623.  
  624. Const tnob = 5 ' total number of balls
  625. ReDim rolling(tnob)
  626. InitRolling
  627.  
  628. Sub InitRolling
  629. Dim i
  630. For i = 0 to tnob
  631. rolling(i) = False
  632. Next
  633. End Sub
  634.  
  635. Sub RollingTimer_Timer()
  636. Dim BOT, b
  637. BOT = GetBalls
  638.  
  639. ' stop the sound of deleted balls
  640. For b = UBound(BOT) + 1 to tnob
  641. rolling(b) = False
  642. StopSound "fx_ballrolling" & b
  643. StopSound "fx_plasticrolling" & b
  644. StopSound "fx_metalrolling" & b
  645. Next
  646.  
  647. ' exit the sub if no balls on the table
  648. If UBound(BOT) = -1 Then Exit Sub
  649.  
  650. ' play the rolling sound for each ball
  651. For b = 0 to UBound(BOT)
  652. If BallVel(BOT(b) ) > 1 Then
  653. rolling(b) = True
  654. If BOT(b).Z > 30 Then
  655. ' ball on plastic ramp
  656. StopSound "fx_ballrolling" & b
  657. StopSound "fx_metalrolling" & b
  658. PlaySound "fx_plasticrolling" & b, -1, Vol(BOT(b)) / 2, AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  659. Else
  660. ' ball on playfield
  661. StopSound "fx_plasticrolling" & b
  662. StopSound "fx_metalrolling" & b
  663. PlaySound "fx_ballrolling" & b, -1, Vol(BOT(b)) / 2, AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  664. End If
  665. Else
  666. If rolling(b) Then
  667. StopSound "fx_ballrolling" & b
  668. StopSound "fx_plasticrolling" & b
  669. StopSound "fx_metalrolling" & b
  670. rolling(b) = False
  671. End If
  672. End If
  673.  
  674. ' ball drop sounds matching the adjusted height params but not the way down the ramps
  675. If BOT(b).VelZ < -1 And BOT(b).Z < 55 And BOT(b).Z > 27 then 'And Not InRect(BOT(b).X, BOT(b).Y, 610,320, 740,320, 740,550, 610,550) And Not InRect(BOT(b).X, BOT(b).Y, 180,400, 230,400, 230, 550, 180,550) Then
  676. PlaySound "fx_ball_drop" & Int(Rnd()*3), 0, ABS(BOT(b).VelZ)/17*5, AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
  677. End If
  678.  
  679. Next
  680. End Sub
  681.  
  682. '**********************
  683. ' Ball Collision Sound
  684. '**********************
  685.  
  686. Sub OnBallBallCollision(ball1, ball2, velocity)
  687. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, AudioPan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1)
  688. End Sub
  689.  
  690. '*****************************************
  691. ' ninuzzu's FLIPPER SHADOWS
  692. '*****************************************
  693.  
  694. sub FlipperTimer_Timer()
  695. FlipperLSh.RotZ = LeftFlipper.currentangle
  696. FlipperRSh.RotZ = RightFlipper.currentangle
  697.  
  698. 'Primitive Flipper
  699.  
  700. FlipperT1.roty = LeftFlipper.currentangle + 237
  701. FlipperT5.roty = RightFlipper.currentangle + 120
  702. FlipperT2.roty = RightFlipper1.currentangle + 180
  703. End Sub
  704.  
  705.  
  706. '*****************************************
  707. ' ninuzzu's BALL SHADOW
  708. '*****************************************
  709. Dim BallShadow
  710. BallShadow = Array (BallShadow1,BallShadow2,BallShadow3,BallShadow4,BallShadow5)
  711.  
  712. Sub BallShadowUpdate_timer()
  713. Dim BOT, b
  714. BOT = GetBalls
  715. ' hide shadow of deleted balls
  716. If UBound(BOT)<(tnob-1) Then
  717. For b = (UBound(BOT) + 1) to (tnob-1)
  718. BallShadow(b).visible = 0
  719. Next
  720. End If
  721. ' exit the Sub if no balls on the table
  722. If UBound(BOT) = -1 Then Exit Sub
  723. ' render the shadow for each ball
  724. For b = 0 to UBound(BOT)
  725. If BOT(b).X < Table1.Width/2 Then
  726. BallShadow(b).X = ((BOT(b).X) - (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/7)) + 6
  727. Else
  728. BallShadow(b).X = ((BOT(b).X) + (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/7)) - 6
  729. End If
  730. ballShadow(b).Y = BOT(b).Y + 12
  731. If BOT(b).Z > 20 Then
  732. BallShadow(b).visible = 1
  733. Else
  734. BallShadow(b).visible = 0
  735. End If
  736. Next
  737. End Sub
  738.  
  739.  
  740. '************************************
  741. ' What you need to add to your table
  742. '************************************
  743.  
  744. ' a timer called RollingTimer. With a fast interval, like 10
  745. ' one collision sound, in this script is called fx_collide
  746. ' as many sound files as max number of balls, with names ending with 0, 1, 2, 3, etc
  747. ' for ex. as used in this script: fx_ballrolling0, fx_ballrolling1, fx_ballrolling2, fx_ballrolling3, etc
  748.  
  749.  
  750. '******************************************
  751. ' Explanation of the rolling sound routine
  752. '******************************************
  753.  
  754. ' sounds are played based on the ball speed and position
  755.  
  756. ' the routine checks first for deleted balls and stops the rolling sound.
  757.  
  758. ' The For loop goes through all the balls on the table and checks for the ball speed and
  759. ' if the ball is on the table (height lower than 30) then then it plays the sound
  760. ' otherwise the sound is stopped, like when the ball has stopped or is on a ramp or flying.
  761.  
  762. ' The sound is played using the VOL, AUDIOPAN, AUDIOFADE and PITCH functions, so the volume and pitch of the sound
  763. ' will change according to the ball speed, and the AUDIOPAN & AUDIOFADE functions will change the stereo position
  764. ' according to the position of the ball on the table.
  765.  
  766.  
  767. '**************************************
  768. ' Explanation of the collision routine
  769. '**************************************
  770.  
  771. ' The collision is built in VP.
  772. ' You only need to add a Sub OnBallBallCollision(ball1, ball2, velocity) and when two balls collide they
  773. ' 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
  774. ' depending of the speed of the collision.
  775.  
  776.  
  777. Sub Pins_Hit (idx)
  778. PlaySound "pinhit_low", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  779. End Sub
  780.  
  781. Sub Targets_Hit (idx)
  782. PlaySound "target", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
  783. End Sub
  784.  
  785. Sub Metals_Thin_Hit (idx)
  786. PlaySound "metalhit_thin", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  787. End Sub
  788.  
  789. Sub Metals_Medium_Hit (idx)
  790. PlaySound "metalhit_medium", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  791. End Sub
  792.  
  793. Sub Metals2_Hit (idx)
  794. PlaySound "metalhit2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  795. End Sub
  796.  
  797. Sub Gates_Hit (idx)
  798. PlaySound "Gate5", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  799. End Sub
  800.  
  801. Sub Spinner_Spin
  802. PlaySound "fx_spinner", 0, .25, AudioPan(Spinner), 0.25, 0, 0, 1, AudioFade(Spinner)
  803. End Sub
  804.  
  805. Sub Rubbers_Hit(idx)
  806. dim finalspeed
  807. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  808. If finalspeed > 20 then
  809. PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  810. End if
  811. If finalspeed >= 6 AND finalspeed <= 20 then
  812. RandomSoundRubber()
  813. End If
  814. End Sub
  815.  
  816. Sub Posts_Hit(idx)
  817. dim finalspeed
  818. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  819. If finalspeed > 16 then
  820. PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  821. End if
  822. If finalspeed >= 6 AND finalspeed <= 16 then
  823. RandomSoundRubber()
  824. End If
  825. End Sub
  826.  
  827. Sub RandomSoundRubber()
  828. Select Case Int(Rnd*3)+1
  829. Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  830. Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  831. Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  832. End Select
  833. End Sub
  834.  
  835. Sub LeftFlipper_Collide(parm)
  836. RandomSoundFlipper()
  837. End Sub
  838.  
  839. Sub RightFlipper_Collide(parm)
  840. RandomSoundFlipper()
  841. End Sub
  842.  
  843. Sub RandomSoundFlipper()
  844. Select Case Int(Rnd*3)+1
  845. Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  846. Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  847. Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
  848. End Select
  849. End Sub
  850.  
  851.  
  852. Sub Table1_Exit()
  853. If B2SOn Then
  854. Controller.Pause = False
  855. Controller.Stop
  856. End If
  857. End Sub
Add Comment
Please, Sign In to add comment