Arngrim

Untitled

Mar 5th, 2018
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 46.81 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 "Can't open controller.vbs"
  7. On Error Goto 0
  8.  
  9. Const cGameName="Centaur",UseSolenoids=2,UseLamps=0,UseGI=0,SSolenoidOn="SolOn",SSolenoidOff="SolOff",SFlipperOn="fx_Flipperup",SFlipperOff="fx_Flipperdown"
  10. Const SCoin="coin"
  11.  
  12.  
  13. LoadVPM "01000100", "Bally.VBS", 2.24
  14.  
  15. Dim EnableBallControl
  16. EnableBallControl = false 'Change to true to enable manual ball control (or press C in-game) via the arrow keys and B (boost movement) keys
  17.  
  18. 'Solenoid Call backs
  19. '**********************************************************************************************************
  20. SolCallback(1) = "dtM.soldropup"
  21. SolCallback(2) = "Drop1"
  22. SolCallback(3) = "Drop2"
  23. SolCallback(4) = "Drop3"
  24. SolCallback(5) = "Drop4"
  25. SolCallback(6) = "vpmSolSound SoundFX(""Knocker"",DOFKnocker),"
  26. SolCallback(7) = "SRelease"
  27. SolCallback(8) = "dtLLdrop"
  28. SolCallback(9) = "dtLRdrop"
  29. SolCallback(14) = "OrbsOut"
  30. SolCallback(15) = "BRelease"
  31. SolCallback(19) = "vpmNudge.SolGameOn"
  32. SolCallback(20) = "mag.MagnetOn="
  33. 'SolCallback(sLLFlipper)="vpmSolFlipper LeftFlipper,nothing,"
  34. 'SolCallback(sLRFlipper)="vpmSolFlipper RightFlipper,nothing,"
  35.  
  36. SolCallback(sLRFlipper) = "SolRFlipper"
  37. SolCallback(sLLFlipper) = "SolLFlipper"
  38.  
  39. Sub SolLFlipper(Enabled)
  40. If Enabled Then
  41. PlaySound SoundFX("fx_Flipperup",DOFContactors):LeftFlipper.RotateToEnd
  42. Else
  43. PlaySound SoundFX("fx_Flipperdown",DOFContactors):LeftFlipper.RotateToStart
  44. End If
  45. End Sub
  46.  
  47. Sub SolRFlipper(Enabled)
  48. If Enabled Then
  49. PlaySound SoundFX("fx_Flipperup",DOFContactors):RightFlipper.RotateToEnd
  50. Else
  51. PlaySound SoundFX("fx_Flipperdown",DOFContactors):RightFlipper.RotateToStart
  52. End If
  53. End Sub
  54.  
  55. 'Solenoid Controlled toys
  56. '**********************************************************************************************************
  57. Sub Drop1(enabled) : If enabled Then: PlaySound SoundFX("DTReset",DOFDropTargets) :sw28.IsDropped = 1 : controller.switch(28) = 1 : drop1shadow.image="blank" : End If : End Sub
  58. Sub Drop2(enabled) : If enabled Then: PlaySound SoundFX("DTReset",DOFDropTargets) :sw27.IsDropped = 1 : controller.switch(27) = 1 : drop2shadow.image="blank" : End If : End Sub
  59. Sub Drop3(enabled) : If enabled Then: PlaySound SoundFX("DTReset",DOFDropTargets) :sw26.IsDropped = 1 : controller.switch(26) = 1 : drop3shadow.image="blank" : End If : End Sub
  60. Sub Drop4(enabled) : If enabled Then: PlaySound SoundFX("DTReset",DOFDropTargets) :sw25.IsDropped = 1 : controller.switch(25) = 1 : drop4shadow.image="blank" : End If : End Sub
  61.  
  62. Sub SRelease(enabled)
  63. If enabled Then
  64. If bsTrough.balls > 0 Then
  65. If bsTroughO.balls = 4 Then
  66. bsTrough.SolOut 1
  67. BallRelease.Createball
  68. BallRelease.Kick 150,7
  69. Else
  70. bsTrough.SolOut 1
  71. bsTroughO.AddBall 1
  72. End If
  73. End If
  74. End If
  75. End Sub
  76.  
  77. Sub BRelease(enabled)
  78. If enabled and bsTroughO.balls > 0 Then
  79. bsTroughO.SolOut 1
  80. bsTroughE.Addball 1
  81. End If
  82. End Sub
  83.  
  84. Sub OrbsOut(enabled)
  85. If enabled Then
  86. If bsTroughE.balls > 0 Then
  87. vpmtimer.addtimer 800,"OrbEject"
  88. End If
  89. End If
  90. End Sub
  91.  
  92. 'Orb Ejection and End of Trough Switch
  93. Sub OrbEject(aSw)
  94. If bsTroughE.balls > 0 Then
  95. bsTroughE.SolOut 1
  96. PlaySound "wireramp" ', -1, 0.1, 0.5
  97. Release2.CreateBall
  98. Release2.Kick 0,(57+(5*Rnd))
  99. vpmtimer.pulsesw 33 ' End of Trough Switch
  100. end If
  101. End Sub
  102.  
  103. Sub DTLLdrop(enabled)
  104. if enabled then
  105. dtLL.SolDropUp enabled
  106. bankshadow.Image="bank2"
  107. bankshadow.Image="bank3"
  108. bankshadow.Image="bank4"
  109. end if
  110. End Sub
  111.  
  112. Sub DTLRdrop(enabled)
  113. if enabled then
  114. dtLR.SolDropUp enabled
  115. drop1shadow.Image="drop1"
  116. drop2shadow.Image="drop2"
  117. drop3shadow.Image="drop3"
  118. drop4shadow.Image="drop4"
  119. end if
  120. End Sub
  121.  
  122. Sub Trigger1_hit
  123. me.timerenabled=1
  124. End sub
  125.  
  126. Sub Trigger1_timer
  127. multiguard_prim.rotx=-8
  128. me.timerenabled=0
  129. End sub
  130.  
  131. Sub Trigger2_hit
  132. stopsound "wireramp"
  133. trigger1.timerenabled=0
  134. me.timerenabled=1
  135. end sub
  136.  
  137. Sub Trigger2_timer
  138. multiguard_prim.rotx=0
  139. me.timerenabled=0
  140. End sub
  141.  
  142. '**********************************************************************************************************
  143.  
  144. 'Initiate Table
  145. '**********************************************************************************************************
  146.  
  147. Dim bsTrough, bsTroughE, bsTroughO, dtLR, dtM, dtLL, Mag
  148.  
  149. Sub Table1_Init
  150. ' vpmInit Me
  151. ' On Error Resume Next
  152. With Controller
  153. .GameName = cGameName
  154. If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description : Exit Sub
  155. .SplashInfoLine = "Centaur (Bally 1981)"
  156. .HandleMechanics=0
  157. .HandleKeyboard=0
  158. .ShowDMDOnly=1
  159. .ShowFrame=0
  160. .ShowTitle=0
  161. .hidden = 1
  162. If Err Then MsgBox Err.Description
  163. End With
  164. On Error Goto 0
  165. Controller.SolMask(0)=0
  166. vpmTimer.AddTimer 2000,"Controller.SolMask(0)=&Hffffffff'" 'ignore all solenoids - then add the timer to renable all the solenoids after 2 seconds
  167. Controller.Run
  168. If Err Then MsgBox Err.Description
  169. On Error Goto 0
  170.  
  171.  
  172. PinMAMETimer.Interval=PinMAMEInterval
  173. PinMAMETimer.Enabled=1
  174. vpmNudge.TiltSwitch = 15
  175. vpmNudge.Sensitivity = 3
  176. vpmNudge.TiltObj = Array(Bumper1,Bumper2,LeftSlingshot,RightSlingshot)
  177.  
  178. Set bsTrough = New cvpmBallStack
  179. bsTrough.Initsw 0,8,0,0,0,0,0,0
  180. bsTrough.InitExitSnd SoundFX("BallRelease",DOFContactors),SoundFX("solenoid",DOFContactors)
  181. bsTrough.Balls = 1
  182. bsTrough.CreateEvents "bsTrough", Drain
  183.  
  184. Set bsTroughE = New cvpmBallStack
  185. bsTroughE.Initsw 0,0,0,0,0,0,0,0
  186.  
  187. Set bsTroughO = New cvpmBallStack
  188. bsTroughO.Initsw 0,17,0,0,1,2,0,0
  189. bsTroughO.IsTrough = 1
  190. bsTroughO.Balls = 4
  191.  
  192. Set dtLR=New cvpmDropTarget
  193. dtLR.InitDrop Array(sw25,sw26,sw27,sw28),Array(25,26,27,28)
  194. dtLR.InitSnd SoundFX("DTDrop",DOFDropTargets),SoundFX("DTReset",DOFContactors)
  195.  
  196. Set dtM=New cvpmDropTarget
  197. dtM.InitDrop Array(sw29,sw30,sw31,sw32),Array(29,30,31,32)
  198. dtM.InitSnd SoundFX("DTDrop",DOFDropTargets),SoundFX("DTReset",DOFContactors)
  199.  
  200. Set dtLL=New cvpmDropTarget
  201. dtLL.InitDrop Array(sw41,sw42,sw43,sw44),Array(41,42,43,44)
  202. dtLL.InitSnd SoundFX("DTDrop",DOFDropTargets),SoundFX("DTReset",DOFContactors)
  203.  
  204. Set Mag = New cvpmMagnet
  205. Mag.initMagnet MagTrigger, 15
  206. Mag.X = 836
  207. Mag.Y = 318
  208. Mag.Size = 60
  209.  
  210. CapKicker.CreateBall
  211. CapKicker.Kick 180,2
  212. End Sub
  213.  
  214. '**********************************************************************************************************
  215. 'Plunger code
  216. '**********************************************************************************************************
  217.  
  218. Sub Table1_KeyDown(ByVal KeyCode)
  219. 'if keycode=rightmagnasave then '***********used for testing power orb ramp
  220. ' PlaySound "wireramp" ', -1, 0.1, 0.5
  221. ' Release2.CreateBall
  222. ' Release2.Kick 0,(57+(5*Rnd))
  223. 'end if
  224. if keycode = RightFlipperKey then Controller.Switch(21) = false
  225. if keycode = LeftFlipperKey then Controller.Switch(21) = false
  226. If KeyDownHandler(keycode) Then Exit Sub
  227. If keycode = PlungerKey Then Plunger.Pullback:playsound"plungerpull"
  228.  
  229. ' Manual Ball Control
  230. If keycode = 46 Then ' C Key
  231. If EnableBallControl = 1 Then
  232. EnableBallControl = 0
  233. Else
  234. EnableBallControl = 1
  235. End If
  236. End If
  237. If EnableBallControl = 1 Then
  238. If keycode = 48 Then ' B Key
  239. If BCboost = 1 Then
  240. BCboost = BCboostmulti
  241. Else
  242. BCboost = 1
  243. End If
  244. End If
  245. If keycode = 203 Then BCleft = 1 ' Left Arrow
  246. If keycode = 200 Then BCup = 1 ' Up Arrow
  247. If keycode = 208 Then BCdown = 1 ' Down Arrow
  248. If keycode = 205 Then BCright = 1 ' Right Arrow
  249. End If
  250.  
  251. End Sub
  252.  
  253. Sub Table1_KeyUp(ByVal KeyCode)
  254. if keycode = RightFlipperKey then Controller.Switch(21) = true
  255. if keycode = LeftFlipperKey then Controller.Switch(21) = true
  256. If KeyUpHandler(keycode) Then Exit Sub
  257. If keycode = PlungerKey Then Plunger.Fire:PlaySound"plunger"
  258.  
  259. 'Manual Ball Control
  260. If EnableBallControl = 1 Then
  261. If keycode = 203 Then BCleft = 0 ' Left Arrow
  262. If keycode = 200 Then BCup = 0 ' Up Arrow
  263. If keycode = 208 Then BCdown = 0 ' Down Arrow
  264. If keycode = 205 Then BCright = 0 ' Right Arrow
  265. End If
  266.  
  267. End Sub
  268. '**********************************************************************************************************
  269. '**********************************************************************************************************
  270.  
  271. 'switches
  272. '**********************************************************************************************************
  273. 'Multi Ball kicker
  274. Sub sw33_Hit : Controller.Switch(33) = 1: End Sub
  275. Sub sw33_UnHit : Controller.Switch(33) = 0 : End Sub
  276. 'Magnet
  277. Sub MagTrigger_Hit : mag.AddBall ActiveBall : End Sub
  278. Sub MagTrigger_UnHit : mag.RemoveBall ActiveBall : End Sub
  279.  
  280. ' Drain kickers
  281. Sub Drain_Hit:playsound"drain":End Sub
  282.  
  283. 'Drop Targets
  284. Sub Sw25_Dropped:dtLR.Hit 1 : drop4shadow.image="blank" : End Sub
  285. Sub Sw26_Dropped:dtLR.Hit 2 : drop3shadow.image="blank" : End Sub
  286. Sub Sw27_Dropped:dtLR.Hit 3 : drop2shadow.image="blank" : End Sub
  287. Sub Sw28_Dropped:dtLR.Hit 4 : drop1shadow.image="blank" : End Sub
  288.  
  289. Sub Sw29_Dropped:dtM.Hit 1 :End Sub
  290. Sub Sw30_Dropped:dtM.Hit 2 :End Sub
  291. Sub Sw31_Dropped:dtM.Hit 3 :End Sub
  292. Sub Sw32_Dropped:dtM.Hit 4 :End Sub
  293.  
  294. Sub Sw41_Dropped:dtLL.Hit 1 : bank1shadow.image="blank" : End Sub
  295. Sub Sw42_Dropped:dtLL.Hit 2 : bank2shadow.image="blank" : End Sub
  296. Sub Sw43_Dropped:dtLL.Hit 3 : bank3shadow.image="blank" : End Sub
  297. Sub Sw44_Dropped:dtLL.Hit 4 : bank4shadow.image="blank" : End Sub
  298.  
  299. 'Stand Up Targets
  300. Sub sw12a_Hit:vpmTimer.PulseSW 12:DOF 102, DOFPulse:End Sub
  301. Sub sw12b_Hit:vpmTimer.PulseSW 12:DOF 103, DOFPulse:End Sub
  302. Sub sw12c_Hit:vpmTimer.PulseSW 12:DOF 103, DOFPulse:End Sub
  303. Sub sw19_Hit:vpmTimer.PulseSW 19:End Sub
  304. Sub sw20_Hit:vpmTimer.PulseSW 20:End Sub
  305. Sub sw22_Hit:vpmTimer.PulseSW 22:End Sub
  306. Sub sw24_Hit:vpmTimer.PulseSW 24:End Sub
  307.  
  308. 'Bumpers
  309. Sub Bumper1_Hit:vpmTimer.PulseSw 39 : playsound SoundFX("fx_bumper1",DOFContactors): End Sub
  310. Sub Bumper2_Hit:vpmTimer.PulseSw 40 : playsound SoundFX("fx_bumper1",DOFContactors): End Sub
  311.  
  312. 'SlingShots
  313. Sub LeftSlingShot_Slingshot:vpmTimer.PulseSw 38:End Sub
  314. Sub RightSlingShot_Slingshot:vpmTimer.PulseSw 37:End Sub
  315.  
  316. 'Star Rollovers
  317. Sub sw12_Hit : Controller.Switch(12) = 1 : playsound"rollover" : DOF 101, DOFOn : End Sub
  318. Sub sw12_UnHit : Controller.Switch(12) = 0 : DOF 101, DOFOff : End Sub
  319. Sub sw18_Hit : Controller.Switch(18) = 1 : playsound"rollover" : End Sub
  320. Sub sw18_UnHit : Controller.Switch(18) = 0 : End Sub
  321. Sub sw18a_Hit : Controller.Switch(18) = 1 : playsound"rollover" : End Sub
  322. Sub sw18a_UnHit: Controller.Switch(18) = 0 : End Sub
  323.  
  324. 'Wire Triggers
  325. Sub sw3_Hit : Controller.Switch(3) = 1 : playsound"rollover" : End Sub
  326. Sub sw3_UnHit : Controller.Switch(3) = 0 : End Sub
  327. Sub sw4_Hit : Controller.Switch(4) = 1 : playsound"rollover" : End Sub
  328. Sub sw4_UnHit : Controller.Switch(4) = 0 : End Sub
  329. Sub sw5_Hit : Controller.Switch(5) = 1 : playsound"rollover" : End Sub
  330. Sub sw5_UnHit : Controller.Switch(5) = 0 : End Sub
  331. Sub sw45_Hit : Controller.Switch(45) = 1 : playsound"rollover" : End Sub
  332. Sub sw45_UnHit: Controller.Switch(45) = 0 : End Sub
  333. Sub sw46_Hit : Controller.Switch(46) = 1 : playsound"rollover" : End Sub
  334. Sub sw46_UnHit: Controller.Switch(46) = 0 : End Sub
  335. Sub sw47_Hit : Controller.Switch(47) = 1 : playsound"rollover" : End Sub
  336. Sub sw47_UnHit: Controller.Switch(47) = 0 : End Sub
  337. Sub sw48_Hit : Controller.Switch(48) = 1 : playsound"rollover" : End Sub
  338. Sub sw48_UnHit: Controller.Switch(48) = 0 : End Sub
  339.  
  340. 'GI Lights single Lamp source to control a collection
  341. Dim N1,O1, N2,O2, N3,O3
  342. N1=0:O1=0:N2=0:O2=0:N3=0:O3=0:
  343. Set LampCallback=GetRef("UpdateMultipleLamps")
  344. Sub UpdateMultipleLamps
  345. N1=Controller.Lamp(1) 'upper PF
  346. N2=Controller.Lamp(66) 'Right lower PF
  347. N3=Controller.Lamp(82) 'Left lower PF
  348. If N1<>O1 Then
  349. If N1 Then
  350. dim xx
  351. For each xx in GI1:xx.State = 1: Next
  352. metalright_prm.image="rightmetal"
  353. plasticsedgesGI1_prim.image="edgegi1"
  354. outerback_prim.image="outerback"
  355. woodlrightupper_prim.image="woodtopright"
  356. reargatebracket_prim.image="backgate"
  357. bumperring1_prim.image="bumperring1GION"
  358. bumperring2_prim.image="bumperring2GION"
  359. brackets_prim.image="gatebrackets"
  360. leftgatebracket_prim.image="leftgate"
  361. If l115.state=1 Then
  362. metalouter_prm.image="outermetalLAIRON"
  363. Else
  364. metalouter_prm.image="outermetal"
  365. End If
  366. If l100.state=0 Then
  367. metalrear_prm.image="backmetalSTAROFF"
  368. Else
  369. metalrear_prm.image="backmetal"
  370. End If
  371. Else
  372. For each xx in GI1:xx.State = 0: Next
  373. metalright_prm.image="rightmetalGIOFF"
  374. plasticsedgesGI1_prim.image="edgegi1GIOFF"
  375. outerback_prim.image="outerbackGIOFF"
  376. woodlrightupper_prim.image="woodtoprightGIOFF"
  377. reargatebracket_prim.image="backgateGIOFF"
  378. bumperring1_prim.image="bumperring1GIOFF"
  379. bumperring2_prim.image="bumperring2GIOFF"
  380. brackets_prim.image="gatebracketsGIOFF"
  381. leftgatebracket_prim.image="leftgateGIOFF"
  382. If l115.state=1 Then
  383. metalouter_prm.image="outermetalGIOFFLAIRON"
  384. Else
  385. metalouter_prm.image="outermetalGIOFF"
  386. End If
  387. If l100.state=0 Then
  388. metalrear_prm.image="backmetalGIOFFSTAROFF"
  389. Else
  390. metalrear_prm.image="backmetalGIOFF"
  391. End If
  392. End If
  393. O1=N1
  394. End If
  395. If N2<>O2 Then
  396. If N2 Then
  397. dim mm
  398. For each mm in GI2:mm.State = 1: Next
  399. plasticsedgesGI2_prim.image="edgegi2"
  400. outerright_prim.image="outerright"
  401. woodlrightlower_prim.image="rightwood"
  402. Else
  403. For each mm in GI2:mm.State = 0: Next
  404. plasticsedgesGI2_prim.image="edgegi2GIOFF"
  405. outerright_prim.image="outerrightGIOFF"
  406. woodlrightlower_prim.image="rightwoodGIOFF"
  407. End If
  408. O2=N2
  409. End If
  410. If N3<>O3 Then
  411. If N3 Then
  412. dim nn
  413. For each nn in GI3:nn.State = 1: Next
  414. plasticsedgesGI3_prim.image="edgegi3"
  415. woodleftlow_prim.image="leftwoodlow"
  416. outerleft_prim.image="outerleft"
  417. Else
  418. For each nn in GI3:nn.State = 0: Next
  419. plasticsedgesGI3_prim.image="edgegi3GIOFF"
  420. woodleftlow_prim.image="leftwoodlowGIOFF"
  421. outerleft_prim.image="outerleftGIOFF"
  422. End If
  423. O3=N3
  424. End If
  425. End Sub
  426.  
  427. '***************************************************
  428. ' JP's VP10 Fading Lamps & Flashers
  429. ' Based on PD's Fading Light System
  430. ' SetLamp 0 is Off
  431. ' SetLamp 1 is On
  432. ' fading for non opacity objects is 4 steps
  433. '***************************************************
  434.  
  435. Dim LampState(200), FadingLevel(200)
  436. Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
  437.  
  438. InitLamps() ' turn off the lights and flashers and reset them to the default parameters
  439. LampTimer.Interval = 5 'lamp fading speed
  440. LampTimer.Enabled = 1
  441.  
  442. ' Lamp & Flasher Timers
  443.  
  444. Sub LampTimer_Timer()
  445. Dim chgLamp, num, chg, ii
  446. chgLamp = Controller.ChangedLamps
  447. If Not IsEmpty(chgLamp) Then
  448. For ii = 0 To UBound(chgLamp)
  449. LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1) 'keep the real state in an array
  450. FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
  451. Next
  452. End If
  453. UpdateLamps
  454. End Sub
  455.  
  456. Sub UpdateLamps
  457. NFadeLm 2, l2
  458. NFadeLm 2, l2a
  459. NFadeLm 3, l3
  460. NFadeLm 3, l3a
  461. NFadeLm 4, l4
  462. NFadeLm 4, l4a
  463. NFadeLm 5, l5
  464. NFadeLm 5, l5a
  465. NFadeLm 6, l6
  466. NFadeLm 6, l6a
  467. NFadeLm 6, l6b
  468. NFadeLm 7, l7
  469. NFadeLm 7, l7a
  470. NFadeLm 8, l8
  471. NFadeLm 8, l8a
  472. NFadeLm 9, l9
  473. NFadeLm 9, l9a
  474. NFadeLm 10, l10
  475. NFadeLm 10, l10a
  476. NFadeLm 12, l12
  477. NFadeLm 12, l12a
  478. NFadeLm 14, l14
  479. NFadeLm 14, l14a
  480. NFadeLm 15, l15
  481. NFadeLm 15, l15a
  482. NFadeLm 15, l15b
  483. NFadeLm 17, l17
  484. NFadeLm 17, l17a
  485. NFadeLm 18, l18
  486. NFadeLm 18, l18a
  487. NFadeLm 19, l19
  488. NFadeLm 19, l19a
  489. NFadeLm 20, l20
  490. NFadeLm 20, l20a
  491. NFadeLm 21, l21
  492. NFadeLm 21, l21a
  493. NFadeLm 22, l22
  494. NFadeLm 22, l22a
  495. NFadeLm 23, l23
  496. NFadeLm 23, l23a
  497. NFadeLm 24, l24
  498. NFadeLm 24, l24a
  499. NFadeLm 25, l25
  500. NFadeLm 25, l25a
  501. NFadeLm 26, l26
  502. NFadeLm 26, l26a
  503. NFadeLm 28, l28
  504. NFadeLm 28, l28a
  505. NFadeLm 30, l30
  506. NFadeLm 30, l30a
  507. NFadeLm 31, l31
  508. NFadeLm 31, l31a
  509. NFadeLm 31, l31b
  510. NFadeLm 33, l33
  511. NFadeLm 33, l33a
  512. NFadeLm 34, l34
  513. NFadeLm 34, l34a
  514. NFadeLm 35, l35
  515. NFadeLm 35, l35a
  516. NFadeLm 36, l36
  517. NFadeLm 36, l36a
  518. NFadeLm 36, l36b
  519. NFadeLm 36, l36c
  520. NFadeLm 37, l37
  521. NFadeLm 37, l37a
  522. NFadeLm 38, l38
  523. NFadeLm 38, l38a
  524. NFadeLm 38, l38b
  525. NFadeLm 39, l39
  526. NFadeLm 39, l39a
  527. NFadeLm 40, l40
  528. NFadeLm 40, l40a
  529. NFadeLm 41, l41
  530. NFadeLm 41, l41a
  531. NFadeLm 42, l42
  532. NFadeLm 42, l42a
  533. NFadeLm 44, l44
  534. NFadeLm 44, l44a
  535. NFadeLm 46, l46
  536. NFadeLm 46, l46a
  537. NFadeLm 47, l47
  538. NFadeLm 47, l47a
  539. NFadeLm 47, l47b
  540. NFadeLm 49, l49
  541. NFadeLm 49, l49a
  542. NFadeLm 50, l50
  543. NFadeLm 50, l50a
  544. NFadeLm 51, l51
  545. NFadeLm 51, l51a
  546. NFadeLm 52, l52
  547. NFadeLm 52, l52a
  548. NFadeLm 52, l52b
  549. NFadeLm 53, l53
  550. NFadeLm 53, l53a
  551. NFadeLm 54, l54
  552. NFadeLm 54, l54a
  553. NFadeLm 55, l55
  554. NFadeLm 55, l55a
  555. NFadeLm 56, l56
  556. NFadeLm 56, l56a
  557. NFadeLm 57, l57
  558. NFadeLm 57, l57a
  559. NFadeLm 58, l58
  560. NFadeLm 58, l58a
  561. NFadeLm 59, l59
  562. NFadeLm 60, l60
  563. NFadeLm 60, l60a
  564. NFadeLm 62, l62
  565. NFadeLm 62, l62a
  566. NFadeLm 63, l63
  567. NFadeLm 63, l63a
  568. NFadeLm 63, l63b
  569. NFadeLm 65, l65
  570. NFadeLm 65, l65a
  571. NFadeLm 66, l66
  572. Nfadelm 67, l67
  573. Nfadelm 67, l67a
  574. Nfadelm 67, l67b
  575. Nfadelm 67, l67c
  576. If l67.state=1 Then
  577. If l83.state=0 Then
  578. If l99.state=0 Then
  579. If sw41.isdropped=0 Then
  580. bank1shadow.image="bank1l1"
  581. bank2shadow.image="bank2l1"
  582. bank3shadow.image="bank3l1"
  583. Else
  584. If sw42.isdropped=0 Then
  585. bank2shadow.image="bank2l1"
  586. bank3shadow.image="bank3l1"
  587. Else
  588. If sw43.isdropped=0 Then
  589. bank3shadow.image="bank3l1"
  590. Else
  591. bank3shadow.image="blank"
  592. End If
  593. bank2shadow.image="blank"
  594. End If
  595. bank1shadow.image="blank"
  596. End If
  597. plasticsedgesLair_prim.image="edgeslairL67"
  598. bankshadow.image="bankL1"
  599. bank4shadow.image="blank"
  600. Else
  601. If sw42.isdropped=0 Then
  602. bank2shadow.image="bank2"
  603. bank3shadow.image="bank3"
  604. Else
  605. If sw43.isdropped=0 Then
  606. bank3shadow.image="bank3"
  607. Else
  608. bank3shadow.image="blank"
  609. End If
  610. bank2shadow.image="blank"
  611. End If
  612. bank1shadow.image="blank"
  613. bank4shadow.image="bank4"
  614. bankshadow.image="bankON"
  615. plasticsedgesLair_prim.image="edgeslair"
  616. End If
  617. End If
  618. End If
  619. NFadeLm 68, l68
  620. NFadeLm 68, l68a
  621. NFadeLm 81, l81
  622. NFadeLm 81, l81a
  623. NFadeLm 82, l82
  624. Nfadelm 83, l83
  625. Nfadelm 83, l83a
  626. Nfadelm 83, l83b
  627. Nfadelm 83, l83c
  628. If l83.state=1 Then
  629. If l67.state=0 Then
  630. If l115.state=0 Then
  631. If sw41.isdropped=0 Then
  632. bank1shadow.image="bank1l2"
  633. bank2shadow.image="bank2l2"
  634. bank3shadow.image="bank3l2"
  635. Else
  636. If sw42.isdropped=0 Then
  637. bank2shadow.image="bank2l2"
  638. bank3shadow.image="bank3l2"
  639. Else
  640. If sw43.isdropped=0 Then
  641. bank3shadow.image="bank3l2"
  642. Else
  643. bank3shadow.image="blank"
  644. End If
  645. bank2shadow.image="blank"
  646. End If
  647. bank1shadow.image="blank"
  648. End If
  649. plasticsedgesLair_prim.image="edgeslairL83"
  650. bankshadow.image="bankL2"
  651. bank4shadow.image="blank"
  652. Else
  653. If sw42.isdropped=0 Then
  654. bank2shadow.image="bank2"
  655. bank3shadow.image="bank3"
  656. Else
  657. If sw43.isdropped=0 Then
  658. bank3shadow.image="bank3"
  659. Else
  660. bank3shadow.image="blank"
  661. End If
  662. bank2shadow.image="blank"
  663. End If
  664. bank4shadow.image="bank4"
  665. bankshadow.image="bankON"
  666. plasticsedgesLair_prim.image="edgeslair"
  667. End If
  668. End If
  669. bank1shadow.image="blank"
  670. End If
  671. NFadeLm 84, l84
  672. NFadeLm 84, l84a
  673. If l84.state=1 Then
  674. FadeObjm 84, metalleft_prm, "leftmetal", "leftmetal", "leftmetal", "leftmetalstaroff"
  675. Else
  676. metalleft_prm.image="leftmetalstaroff"
  677. End if
  678. NFadeLm 97, l97
  679. NFadeLm 97, l97a
  680. NFadeLM 98, L98
  681. If l98.state=1 Then
  682. If bumperring2_prim.image="bumperring2GION" Then
  683. bumpercap2_prim.image="bumpercap2ONGION"
  684. Else
  685. bumpercap2_prim.image="bumpercap2ONGIOFF"
  686. End If
  687. End If
  688. If l98.state=0 Then
  689. If bumperring2_prim.image="bumperring2GION" Then
  690. bumpercap2_prim.image="bumpercap2OFFGION"
  691. Else
  692. bumpercap2_prim.image="bumpercap2OFFGIOFF"
  693. End If
  694. End If
  695. Nfadelm 99, l99
  696. Nfadelm 99, l99a
  697. Nfadelm 99, l99b
  698. Nfadelm 99, l99c
  699. If l99.state=1 Then
  700. If l83.state=0 Then
  701. If l67.state=0 Then
  702. If sw42.isdropped=0 Then
  703. bank2shadow.image="bank2l3"
  704. bank3shadow.image="bank3l3"
  705. Else
  706. If sw43.isdropped=0 Then
  707. bank3shadow.image="bank3l3"
  708. Else
  709. bank3shadow.image="blank"
  710. End If
  711. bank2shadow.image="blank"
  712. bank1shadow.image="blank"
  713. End If
  714. plasticsedgesLair_prim.image="edgeslairL99"
  715. bankshadow.image="bankL3"
  716. bank1shadow.image="blank"
  717. bank4shadow.image="blank"
  718. Else
  719. If sw42.isdropped=0 Then
  720. bank2shadow.image="bank2"
  721. bank3shadow.image="bank3"
  722. Else
  723. If sw43.isdropped=0 Then
  724. bank3shadow.image="bank3"
  725. Else
  726. bank3shadow.image="blank"
  727. End If
  728. bank2shadow.image="blank"
  729. End If
  730. bankshadow.image="bankON"
  731. bank4shadow.image="bank4"
  732. plasticsedgesLair_prim.image="edgeslair"
  733. End If
  734. End If
  735. bank1shadow.image="blank"
  736. End If
  737. NFadeLm 100, l100
  738. NFadeLm 100, l100a
  739. NFadeLM 114, L114
  740. If l114.state=1 Then
  741. If bumperring1_prim.image="bumperring1GION" Then
  742. bumpercap1_prim.image="bumpercap1ONGION"
  743. Else
  744. bumpercap1_prim.image="bumpercap1ONGIOFF"
  745. End If
  746. End If
  747. If l114.state=0 Then
  748. If bumperring1_prim.image="bumperring1GION" Then
  749. bumpercap1_prim.image="bumpercap1OFFGION"
  750. Else
  751. bumpercap1_prim.image="bumpercap1OFFGIOFF"
  752. End If
  753. End If
  754.  
  755. Nfadelm 115, l115
  756. Nfadelm 115, l115a
  757. Nfadelm 115, l115b
  758. Nfadelm 115, l115c
  759. If l115.state=1 Then
  760. If metalouter_prm.image="outermetal" then
  761. metalouter_prm.image="outermetalLAIRON"
  762. Else
  763. FadeObjm 199, metalouter_prm, "outermetalGIOFFLairon", "outermetalGIOFFLairon", "outermetalGIOFFLairon", "outermetalGIOFF"
  764. End If
  765. If l99.state=0 Then
  766. If l83.state=0 Then
  767. If sw43.isdropped=0 Then
  768. bank3shadow.image="bank3l3"
  769. bank4shadow.image="bank4l4"
  770. Else
  771. If sw44.isdropped=0 Then
  772. bank4shadow.image="bank4l4"
  773. Else
  774. bank4shadow.image="blank"
  775. End If
  776. bank3shadow.image="blank"
  777. End If
  778. plasticsedgesLair_prim.image="edgeslairL115"
  779. bankshadow.image="bankL4"
  780. Else
  781. If sw43.isdropped=0 Then
  782. bank3shadow.image="bank3"
  783. bank4shadow.image="bank4"
  784. Else
  785. If sw44.isdropped=0 Then
  786. bank4shadow.image="bank4"
  787. Else
  788. bank4shadow.image="blank"
  789. End If
  790. bank3shadow.image="blank"
  791. End If
  792. bankshadow.image="bankON"
  793. bank4shadow.image="bank4"
  794. plasticsedgesLair_prim.image="edgeslair"
  795. End If
  796. End If
  797. bank1shadow.image="blank"
  798. End If
  799. If l115.state=0 Then
  800. If metalouter_prm.image="outermetal" then
  801. metalouter_prm.image="outermetal"
  802. Else
  803. metalouter_prm.image="outermetalGIOFF"
  804. End If
  805. End If
  806. End Sub
  807.  
  808. ' div lamp subs
  809.  
  810. Sub InitLamps()
  811. Dim x
  812. For x = 0 to 200
  813. LampState(x) = 0 ' current light state, independent of the fading level. 0 is off and 1 is on
  814. FadingLevel(x) = 4 ' used to track the fading state
  815. FlashSpeedUp(x) = 0.4 ' faster speed when turning on the flasher
  816. FlashSpeedDown(x) = 0.2 ' slower speed when turning off the flasher
  817. FlashMax(x) = 1 ' the maximum value when on, usually 1
  818. FlashMin(x) = 0 ' the minimum value when off, usually 0
  819. FlashLevel(x) = 0 ' the intensity of the flashers, usually from 0 to 1
  820. Next
  821. End Sub
  822.  
  823. Sub AllLampsOff
  824. Dim x
  825. For x = 0 to 200
  826. SetLamp x, 0
  827. Next
  828. End Sub
  829.  
  830. Sub FadePrim(nr, pri, a, b, c, d)
  831. Select Case FadingLevel(nr)
  832. Case 2:pri.image = d:FadingLevel(nr) = 0
  833. Case 3:pri.image = c:FadingLevel(nr) = 2
  834. Case 4:pri.image = b:FadingLevel(nr) = 3
  835. Case 5:pri.image = a:FadingLevel(nr) = 1
  836. End Select
  837. End Sub
  838.  
  839. Sub SetLamp(nr, value)
  840. If value <> LampState(nr) Then
  841. LampState(nr) = abs(value)
  842. FadingLevel(nr) = abs(value) + 4
  843. End If
  844. End Sub
  845.  
  846. ' Lights: used for VP10 standard lights, the fading is handled by VP itself
  847.  
  848. Sub NFadeL(nr, object)
  849. Select Case FadingLevel(nr)
  850. Case 4:object.state = 0:FadingLevel(nr) = 0
  851. Case 5:object.state = 1:FadingLevel(nr) = 1
  852. End Select
  853. End Sub
  854.  
  855. Sub NFadeLm(nr, object) ' used for multiple lights
  856. Select Case FadingLevel(nr)
  857. Case 4:object.state = 0
  858. Case 5:object.state = 1
  859. End Select
  860. End Sub
  861.  
  862. 'Lights, Ramps & Primitives used as 4 step fading lights
  863. 'a,b,c,d are the images used from on to off
  864.  
  865. Sub FadeObj(nr, object, a, b, c, d)
  866. Select Case FadingLevel(nr)
  867. Case 4:object.image = b:FadingLevel(nr) = 6 'fading to off...
  868. Case 5:object.image = a:FadingLevel(nr) = 1 'ON
  869. Case 6, 7, 8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  870. Case 9:object.image = c:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
  871. Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  872. Case 13:object.image = d:FadingLevel(nr) = 0 'Off
  873. End Select
  874. End Sub
  875.  
  876. Sub FadeObjm(nr, object, a, b, c, d)
  877. Select Case FadingLevel(nr)
  878. Case 4:object.image = b
  879. Case 5:object.image = a
  880. Case 9:object.image = c
  881. Case 13:object.image = d
  882. End Select
  883. End Sub
  884.  
  885. Sub NFadeObj(nr, object, a, b)
  886. Select Case FadingLevel(nr)
  887. Case 4:object.image = b:FadingLevel(nr) = 0 'off
  888. Case 5:object.image = a:FadingLevel(nr) = 1 'on
  889. End Select
  890. End Sub
  891.  
  892. Sub NFadeObjm(nr, object, a, b)
  893. Select Case FadingLevel(nr)
  894. Case 4:object.image = b
  895. Case 5:object.image = a
  896. End Select
  897. End Sub
  898.  
  899. ' Flasher objects
  900.  
  901. Sub Flash(nr, object)
  902. Select Case FadingLevel(nr)
  903. Case 4 'off
  904. FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
  905. If FlashLevel(nr) < FlashMin(nr) Then
  906. FlashLevel(nr) = FlashMin(nr)
  907. FadingLevel(nr) = 0 'completely off
  908. End if
  909. Object.IntensityScale = FlashLevel(nr)
  910. Case 5 ' on
  911. FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
  912. If FlashLevel(nr) > FlashMax(nr) Then
  913. FlashLevel(nr) = FlashMax(nr)
  914. FadingLevel(nr) = 1 'completely on
  915. End if
  916. Object.IntensityScale = FlashLevel(nr)
  917. End Select
  918. End Sub
  919.  
  920. Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
  921. Object.IntensityScale = FlashLevel(nr)
  922. End Sub
  923.  
  924. 'Reels
  925. Sub FadeReel(nr, reel)
  926. Select Case FadingLevel(nr)
  927. Case 2:FadingLevel(nr) = 0
  928. Case 3:FadingLevel(nr) = 2
  929. Case 4:reel.Visible = 0:FadingLevel(nr) = 3
  930. Case 5:reel.Visible = 1:FadingLevel(nr) = 1
  931. End Select
  932. End Sub
  933.  
  934. 'Inverted Reels
  935. Sub FadeIReel(nr, reel)
  936. Select Case FadingLevel(nr)
  937. Case 2:FadingLevel(nr) = 0
  938. Case 3:FadingLevel(nr) = 2
  939. Case 4:reel.Visible = 1:FadingLevel(nr) = 3
  940. Case 5:reel.Visible = 0:FadingLevel(nr) = 1
  941. End Select
  942. End Sub
  943.  
  944. '****************************************
  945. 'BackGlass Lights
  946. 'Set Lights(43)=Light43 'Warning
  947. 'Set Lights(29)=Light29 'High Score
  948. 'Set Lights(63)=Light63 'TILT
  949. 'Set Lights(45)=Light45 'GameOver
  950. 'Set Lights(11)=Light11 'shoot Again
  951. 'Set Lights(13)=Light13 'ball in play
  952. 'Set Lights(27)=Light27 'match
  953.  
  954. '**********************************************************************************************************
  955. 'Digital Display
  956. '**********************************************************************************************************
  957. Dim Digits(32)
  958.  
  959. ' 1st Player
  960. Digits(0) = Array(LED10,LED11,LED12,LED13,LED14,LED15,LED16)
  961. Digits(1) = Array(LED20,LED21,LED22,LED23,LED24,LED25,LED26)
  962. Digits(2) = Array(LED30,LED31,LED32,LED33,LED34,LED35,LED36)
  963. Digits(3) = Array(LED40,LED41,LED42,LED43,LED44,LED45,LED46)
  964. Digits(4) = Array(LED50,LED51,LED52,LED53,LED54,LED55,LED56)
  965. Digits(5) = Array(LED60,LED61,LED62,LED63,LED64,LED65,LED66)
  966. Digits(6) = Array(LED70,LED71,LED72,LED73,LED74,LED75,LED76)
  967.  
  968. ' 2nd Player
  969. Digits(7) = Array(LED80,LED81,LED82,LED83,LED84,LED85,LED86)
  970. Digits(8) = Array(LED90,LED91,LED92,LED93,LED94,LED95,LED96)
  971. Digits(9) = Array(LED100,LED101,LED102,LED103,LED104,LED105,LED106)
  972. Digits(10) = Array(LED110,LED111,LED112,LED113,LED114,LED115,LED116)
  973. Digits(11) = Array(LED120,LED121,LED122,LED123,LED124,LED125,LED126)
  974. Digits(12) = Array(LED130,LED131,LED132,LED133,LED134,LED135,LED136)
  975. Digits(13) = Array(LED140,LED141,LED142,LED143,LED144,LED145,LED146)
  976.  
  977. ' 3rd Player
  978. Digits(14) = Array(LED150,LED151,LED152,LED153,LED154,LED155,LED156)
  979. Digits(15) = Array(LED160,LED161,LED162,LED163,LED164,LED165,LED166)
  980. Digits(16) = Array(LED170,LED171,LED172,LED173,LED174,LED175,LED176)
  981. Digits(17) = Array(LED180,LED181,LED182,LED183,LED184,LED185,LED186)
  982. Digits(18) = Array(LED190,LED191,LED192,LED193,LED194,LED195,LED196)
  983. Digits(19) = Array(LED200,LED201,LED202,LED203,LED204,LED205,LED206)
  984. Digits(20) = Array(LED210,LED211,LED212,LED213,LED214,LED215,LED216)
  985.  
  986. ' 4th Player
  987. Digits(21) = Array(LED220,LED221,LED222,LED223,LED224,LED225,LED226)
  988. Digits(22) = Array(LED230,LED231,LED232,LED233,LED234,LED235,LED236)
  989. Digits(23) = Array(LED240,LED241,LED242,LED243,LED244,LED245,LED246)
  990. Digits(24) = Array(LED250,LED251,LED252,LED253,LED254,LED255,LED256)
  991. Digits(25) = Array(LED260,LED261,LED262,LED263,LED264,LED265,LED266)
  992. Digits(26) = Array(LED270,LED271,LED272,LED273,LED274,LED275,LED276)
  993. Digits(27) = Array(LED280,LED281,LED282,LED283,LED284,LED285,LED286)
  994.  
  995. ' Credits
  996. Digits(28) = Array(LED4,LED2,LED6,LED7,LED5,LED1,LED3)
  997. Digits(29) = Array(LED18,LED9,LED27,LED28,LED19,LED8,LED17)
  998. ' Balls
  999. Digits(30) = Array(LED39,LED37,LED48,LED49,LED47,LED29,LED38)
  1000. Digits(31) = Array(LED67,LED58,LED69,LED77,LED68,LED57,LED59)
  1001.  
  1002. Sub DisplayTimer_Timer
  1003. Dim ChgLED,ii,num,chg,stat,obj
  1004. ChgLed = Controller.ChangedLEDs(&Hffffffff, &Hffffffff)
  1005. If Not IsEmpty(ChgLED) Then
  1006. If not B2SOn then
  1007. For ii = 0 To UBound(chgLED)
  1008. num = chgLED(ii, 0) : chg = chgLED(ii, 1) : stat = chgLED(ii, 2)
  1009. if (num < 32) then
  1010. For Each obj In Digits(num)
  1011. If chg And 1 Then obj.State = stat And 1
  1012. chg = chg\2 : stat = stat\2
  1013. Next
  1014. else
  1015.  
  1016. end if
  1017. next
  1018. end if
  1019. end if
  1020. End Sub
  1021.  
  1022.  
  1023. '**********************************************************************************************************
  1024. '**********************************************************************************************************
  1025. 'Bally Centaur
  1026. 'added by Gaston
  1027. 'corrected by Inkochnito
  1028. Sub editDips
  1029. Dim vpmDips : Set vpmDips = New cvpmDips
  1030. With vpmDips
  1031. .AddForm 315,220,"Centaur - DIP switches"
  1032. .AddFrame 2,5,88,"Balls in play",&HC0000000,Array("2 balls",&HC0000000,"3 balls",0,"4 balls",&H80000000,"5 balls",&H40000000)'dip 31&32
  1033. .AddFrame 2,85,88,"Tilt settings",&H00400000, Array("Ball Tilt",&H00400000,"Game Tilt",0)'dip 23
  1034. .AddFrame 2,137,88,"Max. credits",&H03000000,Array("10 credits",0,"15 credits",&H01000000,"25 credits",&H02000000,"40 credits",&H03000000)'dip 25&26
  1035. .AddFrame 104,5,88,"Guardian release",&H000F8F1F,Array("Each time",&H58001,"Once per ball",&H50001)'dip 16
  1036. .AddFrame 104,52,88,"Drop targets",&H00000080,Array("Store dropped",&H00000080,"Reset always",0)'dip 8
  1037. .AddFrame 104,99,88,"Drop tgt. bonus",&H00002000,Array("Stored",&H00002000,"Not stored",0)'dip 14
  1038. .AddChk 105,150,95,Array("Store orbs",&H00004000)'dip 15
  1039. .AddChk 105,166,95,Array("Store multiplier",&H00000020)'dip 6
  1040. .AddChk 105,182,95,Array("Store bonus",&H00000040)'dip 7
  1041. .AddChk 105,198,200,Array("Fires ball every 15 min. at Game Over",&H20000000)'dip 30
  1042. .AddFrame 206,5,88,"Last ball release",&H00100000,Array("On",&H00100000,"Off",0)'dip 21
  1043. .AddFrame 206,52,88,"Right release",&H00800000,Array("Stays on",&H00800000,"Off",0)'dip 24
  1044. .AddFrame 206,99,88,"Initial orbs lit",&H00200000,Array("One",&H00200000,"None",0)'dip 22
  1045. .AddChk 207,150,95,Array("Match feature",&H08000000)'dip 28
  1046. .AddChk 207,166,95,Array("Credits display",&H04000000)'dip 27
  1047. .AddChk 207,182,100,Array("Unlimited replays",&H10000000)'dip 29
  1048. .AddLabel 2,220,308,20,"Set selftest position 16,17,18 and 19 to 03 for the best gameplay."
  1049. .AddLabel 2,240,300,20,"After hitting OK, press F3 to reset game with new settings."
  1050. .ViewDips
  1051. End With
  1052. End Sub
  1053. Set vpmShowDips = GetRef("editDips")
  1054. '**********************************************************************************************************
  1055. '**********************************************************************************************************
  1056. '**********************************************************************************************************
  1057. '**********************************************************************************************************
  1058.  
  1059.  
  1060. '**********Sling Shot Animations
  1061. ' Rstep and Lstep are the variables that increment the animation
  1062. '****************
  1063. Dim RStep, Lstep, LAstep, LBstep, LB2step, LCstep, LC2step, RCstep, RAStep, RA2Step, RBStep, RB2Step
  1064.  
  1065. Sub RightSlingShot_Slingshot
  1066. PlaySound SoundFX("left_slingshot",DOFContactors), 0, 1, 0.05, 0.05
  1067. RSling.Visible = 0
  1068. RSling1.Visible = 1
  1069. sling1.TransZ = -20
  1070. RStep = 0
  1071. RightSlingShot.TimerEnabled = 1
  1072. End Sub
  1073.  
  1074. Sub RightSlingShot_Timer
  1075. Select Case RStep
  1076. Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -10
  1077. Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.TransZ = 0:RightSlingShot.TimerEnabled = 0:
  1078. End Select
  1079. RStep = RStep + 1
  1080. End Sub
  1081.  
  1082. Sub LeftSlingShot_Slingshot
  1083. PlaySound SoundFX("right_slingshot",DOFContactors),0,1,-0.05,0.05
  1084. LSling.Visible = 0
  1085. LSling1.Visible = 1
  1086. sling2.TransZ = -20
  1087. LStep = 0
  1088. LeftSlingShot.TimerEnabled = 1
  1089. End Sub
  1090.  
  1091. Sub LeftSlingShot_Timer
  1092. Select Case LStep
  1093. Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -10
  1094. Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.TransZ = 0:LeftSlingShot.TimerEnabled = 0:
  1095. End Select
  1096. LStep = LStep + 1
  1097. End Sub
  1098.  
  1099. Sub WallLA_Hit
  1100. RubberLA.Visible = 0
  1101. RubberLA1.Visible = 1
  1102. LAstep = 0
  1103. WallLA.TimerEnabled = 1
  1104. End Sub
  1105.  
  1106. Sub WallLA_Timer
  1107. Select Case LAstep
  1108. Case 3:RubberLA1.Visible = 0:RubberLA2.Visible = 1
  1109. Case 4:RubberLA2.Visible = 0:RubberLA.Visible = 1:WallLA.TimerEnabled = 0:
  1110. End Select
  1111. LAstep = LAstep + 1
  1112. End Sub
  1113. '
  1114. Sub sw34a_Hit
  1115. vpmTimer.PulseSw 34
  1116. playsound"target"
  1117. RubberLB.Visible = 0
  1118. RubberLB1.Visible = 1
  1119. LBstep = 0
  1120. sw34a.TimerEnabled = 1
  1121. End Sub
  1122.  
  1123. Sub sw34a_Timer
  1124. Select Case LBstep
  1125. Case 3:RubberLB1.Visible = 0:RubberLB2.Visible = 1
  1126. Case 4:RubberLB2.Visible = 0:RubberLB.Visible = 1:sw34a.TimerEnabled = 0:
  1127. End Select
  1128. LBstep = LBstep + 1
  1129. End Sub
  1130.  
  1131. Sub sw34b_Hit
  1132. vpmTimer.PulseSw 34
  1133. playsound SoundFX("target",DOFTargets)
  1134. RubberLB.Visible = 0
  1135. RubberLB3.Visible = 1
  1136. LB2step = 0
  1137. sw34b.TimerEnabled = 1
  1138. End Sub
  1139.  
  1140. Sub sw34b_Timer
  1141. Select Case LB2step
  1142. Case 3:RubberLB3.Visible = 0:RubberLB4.Visible = 1
  1143. Case 4:RubberLB4.Visible = 0:RubberLB.Visible = 1:sw34b.TimerEnabled = 0:
  1144. End Select
  1145. LB2step = LB2step + 1
  1146. End Sub
  1147.  
  1148. Sub WallLC_Hit
  1149. RubberLC.Visible = 0
  1150. RubberLC1.Visible = 1
  1151. LCstep = 0
  1152. WallLC.TimerEnabled = 1
  1153. End Sub
  1154.  
  1155. Sub WallLC_Timer
  1156. Select Case LCstep
  1157. Case 3:RubberLC1.Visible = 0:RubberLC2.Visible = 1
  1158. Case 4:RubberLC2.Visible = 0:RubberLC.Visible = 1:WallLC.TimerEnabled = 0:
  1159. End Select
  1160. LCstep = LCstep + 1
  1161. End Sub
  1162.  
  1163. Sub Wall1RA_Hit
  1164. RubberRA.Visible = 0
  1165. RubberRA1.Visible = 1
  1166. RAstep = 0
  1167. Wall1RA.TimerEnabled = 1
  1168. End Sub
  1169.  
  1170. Sub Wall1RA_Timer
  1171. Select Case RAstep
  1172. Case 3:RubberRA1.Visible = 0:RubberRA2.Visible = 1
  1173. Case 4:RubberRA2.Visible = 0:RubberRA.Visible = 1:Wall1RA.TimerEnabled = 0:
  1174. End Select
  1175. RAstep = RAstep + 1
  1176. End Sub
  1177.  
  1178. Sub Wall2RA_Hit
  1179. vpmTimer.PulseSw 34
  1180. playsound SoundFX("target",DOFTargets)
  1181. RubberRA.Visible = 0
  1182. RubberRA2.Visible = 1
  1183. RA2step = 0
  1184. Wall2RA.TimerEnabled = 1
  1185. End Sub
  1186.  
  1187. Sub Wall2RA_Timer
  1188. Select Case RAstep
  1189. Case 3:RubberRA2.Visible = 0:RubberRA1.Visible = 1
  1190. Case 4:RubberRA1.Visible = 0:RubberRA.Visible = 1:Wall2RA.TimerEnabled = 0:
  1191. End Select
  1192. RA2step = RA2step + 1
  1193. End Sub
  1194.  
  1195. Sub sw34c_Hit
  1196. vpmTimer.PulseSw 34
  1197. playsound SoundFX("target",DOFTargets)
  1198. RubberRB.Visible = 0
  1199. RubberRB1.Visible = 1
  1200. RBstep = 0
  1201. sw34c.TimerEnabled = 1
  1202. End Sub
  1203.  
  1204. Sub sw34c_Timer
  1205. Select Case RBstep
  1206. Case 3:RubberRB1.Visible = 0:RubberRB2.Visible = 1
  1207. Case 4:RubberRB2.Visible = 0:RubberRB.Visible = 1:sw34c.TimerEnabled = 0:
  1208. End Select
  1209. RBstep = RBstep + 1
  1210. End Sub
  1211.  
  1212. Sub sw34d_Hit
  1213. vpmTimer.PulseSw 34
  1214. playsound SoundFX("target",DOFTargets)
  1215. RubberRB.Visible = 0
  1216. RubberRB2.Visible = 1
  1217. RB2step = 0
  1218. sw34d.TimerEnabled = 1
  1219. End Sub
  1220.  
  1221. Sub sw34d_Timer
  1222. Select Case RB2step
  1223. Case 3:RubberRB2.Visible = 0:RubberRB1.Visible = 1
  1224. Case 4:RubberRB1.Visible = 0:RubberRB.Visible = 1:sw34d.TimerEnabled = 0:
  1225. End Select
  1226. RB2step = RB2step + 1
  1227. End Sub
  1228.  
  1229. Sub WallRC_Hit
  1230. RubberRC.Visible = 0
  1231. RubberRC1.Visible = 1
  1232. RCstep = 0
  1233. WallRC.TimerEnabled = 1
  1234. End Sub
  1235.  
  1236. Sub WallRC_Timer
  1237. Select Case RCstep
  1238. Case 3:RubberRC1.Visible = 0:RubberRC2.Visible = 1
  1239. Case 4:RubberRC2.Visible = 0:RubberRC.Visible = 1:WallRC.TimerEnabled = 0:
  1240. End Select
  1241. RCstep = RCstep + 1
  1242. End Sub
  1243.  
  1244. ' *********************************************************************
  1245. ' Supporting Ball & Sound Functions
  1246. ' *********************************************************************
  1247.  
  1248. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  1249. Vol = Csng(BallVel(ball) ^2 / 2000)
  1250. End Function
  1251.  
  1252. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  1253. Dim tmp
  1254. tmp = ball.x * 2 / Table1.width-1
  1255. If tmp > 0 Then
  1256. Pan = Csng(tmp ^10)
  1257. Else
  1258. Pan = Csng(-((- tmp) ^10) )
  1259. End If
  1260. End Function
  1261.  
  1262. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1263. Pitch = BallVel(ball) * 20
  1264. End Function
  1265.  
  1266. Function BallVel(ball) 'Calculates the ball speed
  1267. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  1268. End Function
  1269.  
  1270. '*****************************************
  1271. ' rothbauerw's Manual Ball Control
  1272. '*****************************************
  1273.  
  1274. Dim BCup, BCdown, BCleft, BCright
  1275. Dim ControlBallInPlay, ControlActiveBall
  1276. Dim BCvel, BCyveloffset, BCboostmulti, BCboost
  1277.  
  1278. BCboost = 1 'Do Not Change - default setting
  1279. BCvel = 4 'Controls the speed of the ball movement
  1280. BCyveloffset = -0.01 'Offsets the force of gravity to keep the ball from drifting vertically on the table, should be negative
  1281. BCboostmulti = 3 'Boost multiplier to ball veloctiy (toggled with the B key)
  1282.  
  1283. ControlBallInPlay = false
  1284.  
  1285. Sub StartBallControl_Hit()
  1286. Set ControlActiveBall = ActiveBall
  1287. ControlBallInPlay = true
  1288. End Sub
  1289.  
  1290. Sub StopBallControl_Hit()
  1291. ControlBallInPlay = false
  1292. End Sub
  1293.  
  1294. Sub BallControlTimer_Timer()
  1295. If EnableBallControl and ControlBallInPlay then
  1296. If BCright = 1 Then
  1297. ControlActiveBall.velx = BCvel*BCboost
  1298. ElseIf BCleft = 1 Then
  1299. ControlActiveBall.velx = -BCvel*BCboost
  1300. Else
  1301. ControlActiveBall.velx = 0
  1302. End If
  1303.  
  1304. If BCup = 1 Then
  1305. ControlActiveBall.vely = -BCvel*BCboost
  1306. ElseIf BCdown = 1 Then
  1307. ControlActiveBall.vely = BCvel*BCboost
  1308. Else
  1309. ControlActiveBall.vely = bcyveloffset
  1310. End If
  1311. End If
  1312. End Sub
  1313.  
  1314. '*****************************************
  1315. ' JP's VP10 Rolling Sounds
  1316. '*****************************************
  1317.  
  1318. Const tnob = 5 ' total number of balls
  1319. ReDim rolling(tnob)
  1320. InitRolling
  1321.  
  1322. Sub InitRolling
  1323. Dim i
  1324. For i = 0 to tnob
  1325. rolling(i) = False
  1326. Next
  1327. End Sub
  1328.  
  1329. Sub RollingTimer_Timer()
  1330. Dim BOT, b
  1331. BOT = GetBalls
  1332.  
  1333. ' stop the sound of deleted balls
  1334. For b = UBound(BOT) + 1 to tnob
  1335. rolling(b) = False
  1336. StopSound("fx_ballrolling" & b)
  1337. Next
  1338.  
  1339. ' exit the sub if no balls on the table
  1340. If UBound(BOT) = -1 Then Exit Sub
  1341.  
  1342. ' play the rolling sound for each ball
  1343. For b = 0 to UBound(BOT)
  1344. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  1345. rolling(b) = True
  1346. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  1347. Else
  1348. If rolling(b) = True Then
  1349. StopSound("fx_ballrolling" & b)
  1350. rolling(b) = False
  1351. End If
  1352. End If
  1353. Next
  1354. End Sub
  1355.  
  1356. '**********************
  1357. ' Ball Collision Sound
  1358. '**********************
  1359.  
  1360. Sub OnBallBallCollision(ball1, ball2, velocity)
  1361. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
  1362. End Sub
  1363.  
  1364. '*****************************************
  1365. ' ninuzzu's FLIPPER SHADOWS
  1366. '*****************************************
  1367.  
  1368. sub FlipperTimer_Timer()
  1369. FlipperLSh.RotZ = LeftFlipper.currentangle
  1370. FlipperRSh.RotZ = RightFlipper.currentangle
  1371. flipperleft_prim.rotz = leftflipper.currentangle
  1372. flipperright_prim.rotz = rightflipper.currentangle
  1373.  
  1374. End Sub
  1375.  
  1376. '*****************************************
  1377. ' ninuzzu's BALL SHADOW
  1378. '*****************************************
  1379. Dim BallShadow
  1380. BallShadow = Array (BallShadow1,BallShadow2,BallShadow3,BallShadow4,BallShadow5)
  1381.  
  1382. Sub BallShadowUpdate_timer()
  1383. Dim BOT, b
  1384. BOT = GetBalls
  1385. ' hide shadow of deleted balls
  1386. If UBound(BOT)<(tnob-1) Then
  1387. For b = (UBound(BOT) + 1) to (tnob-1)
  1388. BallShadow(b).visible = 0
  1389. Next
  1390. End If
  1391. ' exit the Sub if no balls on the table
  1392. If UBound(BOT) = -1 Then Exit Sub
  1393. ' render the shadow for each ball
  1394. For b = 0 to UBound(BOT)
  1395. If BOT(b).X < Table1.Width/2 Then
  1396. BallShadow(b).X = ((BOT(b).X) - (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/7)) + 13
  1397. Else
  1398. BallShadow(b).X = ((BOT(b).X) + (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/7)) - 13
  1399. End If
  1400. ballShadow(b).Y = BOT(b).Y + 8
  1401. If BOT(b).Z > 20 Then
  1402. BallShadow(b).visible = 1
  1403. Else
  1404. BallShadow(b).visible = 0
  1405. End If
  1406. Next
  1407. End Sub
  1408.  
  1409. '************************************
  1410. ' What you need to add to your table
  1411. '************************************
  1412.  
  1413. ' a timer called RollingTimer. With a fast interval, like 10
  1414. ' one collision sound, in this script is called fx_collide
  1415. ' as many sound files as max number of balls, with names ending with 0, 1, 2, 3, etc
  1416. ' for ex. as used in this script: fx_ballrolling0, fx_ballrolling1, fx_ballrolling2, fx_ballrolling3, etc
  1417.  
  1418.  
  1419. '******************************************
  1420. ' Explanation of the rolling sound routine
  1421. '******************************************
  1422.  
  1423. ' sounds are played based on the ball speed and position
  1424.  
  1425. ' the routine checks first for deleted balls and stops the rolling sound.
  1426.  
  1427. ' The For loop goes through all the balls on the table and checks for the ball speed and
  1428. ' if the ball is on the table (height lower than 30) then then it plays the sound
  1429. ' otherwise the sound is stopped, like when the ball has stopped or is on a ramp or flying.
  1430.  
  1431. ' The sound is played using the VOL, PAN and PITCH functions, so the volume and pitch of the sound
  1432. ' will change according to the ball speed, and the PAN function will change the stereo position according
  1433. ' to the position of the ball on the table.
  1434.  
  1435.  
  1436. '**************************************
  1437. ' Explanation of the collision routine
  1438. '**************************************
  1439.  
  1440. ' The collision is built in VP.
  1441. ' You only need to add a Sub OnBallBallCollision(ball1, ball2, velocity) and when two balls collide they
  1442. ' 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
  1443. ' depending of the speed of the collision.
  1444.  
  1445.  
  1446. Sub Pins_Hit (idx)
  1447. PlaySound "pinhit_low", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  1448. End Sub
  1449.  
  1450. Sub Targets_Hit (idx)
  1451. PlaySound "target", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  1452. End Sub
  1453.  
  1454. Sub Metals_Thin_Hit (idx)
  1455. PlaySound "metalhit_thin", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1456. End Sub
  1457.  
  1458. Sub Metals_Medium_Hit (idx)
  1459. PlaySound "metalhit_medium", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1460. End Sub
  1461.  
  1462. Sub Metals2_Hit (idx)
  1463. PlaySound "metalhit2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1464. End Sub
  1465.  
  1466. Sub Gates_Hit (idx)
  1467. PlaySound "gate4", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1468. End Sub
  1469.  
  1470. Sub Spinner_Spin
  1471. PlaySound "fx_spinner",0,.25,0,0.25
  1472. End Sub
  1473.  
  1474. Sub Rubbers_Hit(idx)
  1475. dim finalspeed
  1476. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1477. If finalspeed > 20 then
  1478. PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1479. End if
  1480. If finalspeed >= 6 AND finalspeed <= 20 then
  1481. RandomSoundRubber()
  1482. End If
  1483. End Sub
  1484.  
  1485. Sub Posts_Hit(idx)
  1486. dim finalspeed
  1487. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1488. If finalspeed > 16 then
  1489. PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1490. End if
  1491. If finalspeed >= 6 AND finalspeed <= 16 then
  1492. RandomSoundRubber()
  1493. End If
  1494. End Sub
  1495.  
  1496. Sub RandomSoundRubber()
  1497. Select Case Int(Rnd*3)+1
  1498. Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1499. Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1500. Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1501. End Select
  1502. End Sub
  1503.  
  1504. Sub LeftFlipper_Collide(parm)
  1505. RandomSoundFlipper()
  1506. End Sub
  1507.  
  1508. Sub RightFlipper_Collide(parm)
  1509. RandomSoundFlipper()
  1510. End Sub
  1511.  
  1512. Sub RandomSoundFlipper()
  1513. Select Case Int(Rnd*3)+1
  1514. Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1515. Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1516. Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1517. End Select
  1518. End Sub
  1519.  
  1520. Sub table1_Paused:Controller.Pause = 1:End Sub
  1521. Sub table1_unPaused:Controller.Pause = 0:End Sub
  1522.  
  1523. Sub table1_Exit:Controller.Stop:End Sub
Advertisement
Add Comment
Please, Sign In to add comment