Outhere

Robo-War

Nov 23rd, 2021
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.03 KB | None | 0 0
  1. Option Explicit
  2. Randomize
  3.  
  4. On Error Resume Next
  5. ExecuteGlobal GetTextFile("controller.vbs")
  6. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  7. On Error Goto 0
  8.  
  9.  
  10.  
  11. Const cGameName="robowars",UseSolenoids=1,UseLamps=1,UseGI=0,SSolenoidOn="SolOn",SSolenoidOff="SolOff",SFlipperOn="Flipper2",SFlipperOff="Flipper"
  12. Const SCoin="coin3",cCredits=""
  13.  
  14. Const Ballsize = 50
  15. 'Const BallMass = 1.5
  16.  
  17. LoadVPM "01210000", "sys80.vbs", 3.1
  18. 'LoadVPM "01200000","sys80.vbs",3.2
  19. Ramp18.visible=0
  20. Ramp43.visible=0
  21. wall14.visible=0
  22. Wall26.visible=0
  23. Set LampCallback=GetRef("UpdateMultipleLamps")
  24.  
  25. gion()
  26.  
  27.  
  28. sub gion()
  29. gi_1.state=1
  30. gi_2.state=1
  31. GI_3.state=1
  32. GI_4.state=1
  33. gi_5.state=1
  34. GI_6.state=1
  35. GI_7.state=1
  36. gi_8.state=1
  37. gi_9.state=1
  38. GI_10.state=1
  39. gi_11.state=1
  40. GI_12.state=1
  41. gi_13.state=1
  42. gi_15.state=1
  43. gi_20.state=1
  44. gi_21.state=1
  45. GI_22.state=1
  46. 'GI_25.state=1
  47. GI_28.state=1
  48. GI_29.state=1
  49. gi_31.state=1
  50. GI_32.state=1
  51. GI_34.state=1
  52. GI_35.state=1
  53. GI_36.state=1
  54. GI_43.state=1
  55. GI_48.state=1
  56. GI_49.state=1
  57. GI_50.state=1
  58. GI_53.state=1
  59. GI_54.state=1
  60. End Sub
  61.  
  62. sub gioff()
  63. gi_1.state=0
  64. gi_2.state=0
  65. gi_3.state=0
  66. gi_4.state=0
  67. gi_5.state=0
  68. GI_6.state=0
  69. GI_7.state=0
  70. gi_8.state=0
  71. gi_9.state=0
  72. GI_10.state=0
  73. gi_11.state=0
  74. GI_12.state=0
  75. gi_13.state=0
  76. gi_15.state=0
  77. gi_20.state=0
  78. gi_21.state=0
  79. GI_22.state=0
  80. GI_28.state=0
  81. GI_29.state=0
  82. gi_31.state=0
  83. GI_32.state=0
  84. GI_34.state=0
  85. GI_35.state=0
  86. GI_36.state=0
  87. GI_43.state=0
  88. GI_48.state=0
  89. GI_49.state=0
  90. GI_50.state=0
  91. GI_53.state=0
  92. GI_54.state=0
  93. End Sub
  94.  
  95. ball4.CreateSizedBall(25)
  96. ball4.Kick 180,1
  97. ball4.enabled=false
  98. ball5.CreateSizedBall(25)
  99. ball5.Kick 180,1
  100. ball5.enabled=false
  101.  
  102. '*************************************************************
  103. 'Solenoid Call backs
  104. '**********************************************************************************************************
  105.  
  106. SolCallback(sLRFlipper) = "SolRFlipper"
  107. SolCallback(sLLFlipper) = "SolLFlipper"
  108. SolCallback(1)="sol1" '"DT1.SolDropUp" ' 1 Reset Alpha I / Top Left Flasher 3
  109. SolCallback(2)="sol2" '"DT2.SolDropUp" ' 2 Reset Alpha II / Top Left Flasher 2
  110. SolCallback(3)="sol3" '"K3" ' 3 Top Kicker / Stargate Flashers
  111. SolCallback(4)="sol4" '"K2" ' 4 Right Under-Plastic Flasher
  112. SolCallback(5)="sol5" '"dt3.SolDropUp" ' 5 Reset Alpha III / Top Left Flasher 1
  113. SolCallback(6)="sol6" '"dt4.SolDropUp" ' 6 Reset Beta / Top Right Flasher
  114. SolCallback(7)="sol7" '"vpmFlasher Array(sb1,sb2,sb3,sb4,sb5,sb6,sb7,sb8)," ' 7 Left Under-Plastic Flasher
  115. SolCallback(8)="vpmSolSound""knocker""," 'knocker
  116. SolCallback(9)="k4" 'outhole
  117.  
  118. sub sol1 (enabled)
  119. if enabled Then
  120. if light12.state =1 Then
  121. lightsol1.state=1
  122. Else
  123. DT1.DropSol_on
  124. lightsol1.state=0
  125. end If
  126. Else
  127.  
  128. lightsol1.state=0
  129.  
  130. end If
  131.  
  132. end Sub
  133. sub sol2 (enabled)
  134. if enabled Then
  135. if light12.state =1 Then
  136. lightsol2.state=1
  137. Else
  138. DT2.DropSol_on
  139. lightsol2.state=0
  140. end If
  141. Else
  142. lightsol2.state=0
  143. end If
  144. end Sub
  145. sub sol3 (enabled)
  146. if enabled Then
  147. if light12.state =1 Then
  148. lightsol3.state=1
  149. lightsol3a.state=1
  150. Else
  151. Kicker3.kick 135,25
  152.  
  153. lightsol3.state=0
  154. lightsol3a.state=0
  155. end If
  156. Else
  157. lightsol3.state=0
  158. lightsol3a.state=0
  159.  
  160.  
  161. end If
  162.  
  163. end Sub
  164. sub sol4 (enabled)
  165. if enabled Then
  166. if light12.state =1 Then
  167. lightsol4.state=1
  168. Else
  169. 'DT1.DropSol_on
  170. lightsol4.state=0
  171. end If
  172. Else
  173. lightsol4.state=0
  174.  
  175.  
  176. end If
  177.  
  178. end Sub
  179. sub sol5 (enabled)
  180. if enabled Then
  181. if light12.state =1 Then
  182. lightsol5.state=1
  183. Else
  184. dt3.DropSol_on
  185. lightsol5.state=0
  186. end If
  187. Else
  188. lightsol5.state=0
  189.  
  190.  
  191. end If
  192.  
  193. end Sub
  194. sub sol6 (enabled)
  195. if enabled Then
  196. if light12.state =1 Then
  197. lightsol6.state=1
  198. Else
  199. dt4.DropSol_on
  200. lightsol6.state=0
  201. end If
  202. Else
  203. lightsol6.state=0
  204.  
  205.  
  206. end If
  207.  
  208. end Sub
  209. sub sol7 (enabled)
  210. if enabled Then
  211. if light12.state =1 Then
  212. lightsol7.state=1
  213. Else
  214. 'DT1.DropSol_on
  215. lightsol7.state=0
  216. end If
  217. Else
  218. lightsol7.state=0
  219.  
  220.  
  221. end If
  222.  
  223. end Sub
  224. Sub SolOne(Enabled)
  225. If Enabled Then
  226. lightsol1.state=1
  227. lightsol1a.state=1
  228. Else
  229. lightsol1.state=0
  230. lightsol1a.state=0
  231. End If
  232. End Sub
  233. Sub sollFlipper(Enabled)
  234. If Enabled Then
  235. PlaySound SoundFX("fx_Flipperup",DOFContactors):LeftFlipper.RotateToEnd
  236. Else
  237. PlaySound SoundFX("fx_Flipperdown",DOFContactors):LeftFlipper.RotateToStart
  238. End If
  239. End Sub
  240.  
  241. Sub solrflipper(Enabled)
  242. If Enabled Then
  243. PlaySound SoundFX("fx_Flipperup",DOFContactors):RightFlipper.RotateToEnd
  244. Else
  245. PlaySound SoundFX("fx_Flipperdown",DOFContactors):RightFlipper.RotateToStart
  246. End If
  247. End Sub
  248.  
  249. '**********************************************************************************************************
  250.  
  251. 'Solenoid Controlled toys
  252. '**********************************************************************************************************
  253.  
  254. Dim FlipperActive
  255.  
  256.  
  257.  
  258.  
  259. 'Primitive Flipper
  260. Sub FlipperTimer_Timer
  261. FlipperT1.roty = LeftFlipper.currentangle + 237
  262. FlipperT5.roty = RightFlipper.currentangle + 120
  263.  
  264.  
  265. End Sub
  266.  
  267.  
  268. Dim VarRol, VarHidden
  269.  
  270. Dim L4,OL4
  271. OL4=0
  272.  
  273.  
  274.  
  275. Sub UpdateMultipleLamps
  276.  
  277. 'light15a.State = light15.State
  278.  
  279.  
  280.  
  281.  
  282.  
  283. End Sub
  284.  
  285.  
  286.  
  287. '**********************************************************************************************************
  288.  
  289. 'Initiate Table
  290. '**********************************************************************************************************
  291.  
  292. Dim bsTrough, bsKicker, bsHole, DT1, DT2, dt3, dt4,bssaucer,k1
  293.  
  294. Sub Table1_Init
  295.  
  296. On Error Resume Next
  297. With Controller
  298. .GameName = cGameName
  299. If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description : Exit Sub
  300. .SplashInfoLine = "Robo-War"
  301. .HandleMechanics=0
  302. .HandleKeyboard=0
  303. .ShowDMDOnly=1
  304. .ShowFrame=0
  305. .ShowTitle=0
  306. .hidden = 1
  307. If Err Then MsgBox Err.Description
  308. End With
  309. On Error Goto 0
  310. Controller.SolMask(0)=0
  311. vpmTimer.AddTimer 2000,"Controller.SolMask(0)=&Hffffffff'" 'ignore all solenoids - then add the timer to renable all the solenoids after 2 seconds
  312. Controller.Run
  313. If Err Then MsgBox Err.Description
  314. On Error Goto 0
  315.  
  316. PinMAMETimer.Interval=PinMAMEInterval
  317. PinMAMETimer.Enabled=1
  318.  
  319. vpmNudge.TiltSwitch=57
  320. vpmNudge.Sensitivity=5
  321. vpmNudge.TiltObj = Array(Bumper1,Bumper2,Bumper3)
  322.  
  323. Set dt4=New cvpmDropTarget
  324. dt4.InitDrop Array(Targ4a,Targ4b,Targ4c,Targ4d),Array(40,50,60,70)
  325. dt4.InitSnd "flapclos","flapopen"
  326.  
  327. Set dt3=New cvpmDropTarget
  328. dt3.InitDrop Array(Targ3a,Targ3b,Targ3c),Array(41,51,61)
  329. dt3.InitSnd "flapclos","flapopen"
  330.  
  331.  
  332. Set dt2=New cvpmDropTarget
  333. dt2.InitDrop Array(Targ2a,Targ2b),Array(42,52)
  334. dt2.InitSnd "flapclos","flapopen"
  335.  
  336.  
  337. Set dt1=New cvpmDropTarget
  338. dt1.InitDrop Array(Targ1a),Array(43)
  339. dt1.InitSnd "flapclos","flapopen"
  340.  
  341.  
  342.  
  343.  
  344.  
  345. End Sub
  346. '**********************************************************************************************************
  347. 'Plunger code
  348. '**********************************************************************************************************
  349.  
  350. 'Sub Table1_KeyDown(ByVal KeyCode)
  351. ' If KeyDownHandler(keycode) Then Exit Sub
  352. ' If keycode = PlungerKey Then Plunger.Pullback:playsound"plungerpull"
  353. 'End Sub
  354.  
  355. 'Sub Table1_KeyUp(ByVal KeyCode)
  356. ' If KeyUpHandler(keycode) Then Exit Sub
  357. ' If keycode = PlungerKey Then Plunger.Fire:PlaySound"plunger"
  358. 'End Sub
  359. '**********************************************************************************************************
  360. 'Plunger code
  361. '**********************************************************************************************************
  362.  
  363. Sub Table1_KeyDown(ByVal KeyCode)
  364.  
  365. If KeyCode=RightFlipperKey Then Controller.Switch(46)=1
  366. If keycode = PlungerKey Then Plunger.Pullback:playsound"plungerpull"
  367. If vpmKeyDown(KeyCode) Then Exit Sub
  368. End Sub
  369.  
  370. Sub Table1_KeyUp(ByVal KeyCode)
  371.  
  372. If KeyCode=RightFlipperKey Then Controller.Switch(46)=0
  373. If keycode = PlungerKey Then Plunger.Fire:PlaySound"plunger"
  374. If vpmKeyUp(KeyCode) Then Exit Sub
  375. End Sub
  376.  
  377. '**********************************************************************************************************
  378.  
  379.  
  380.  
  381.  
  382. Sub Targ1a_dropped:DT1.Hit 1:End Sub
  383. Sub Targ2a_dropped:DT2.Hit 1:End Sub
  384. Sub Targ2b_dropped:DT2.Hit 2:End Sub
  385. Sub Targ3a_dropped:DT3.Hit 1:End Sub
  386. Sub Targ3b_dropped:dt3.Hit 2:End Sub
  387. Sub Targ3c_dropped:dt3.Hit 3:End Sub
  388. Sub Targ4a_dropped:dt4.Hit 1:End Sub
  389. Sub Targ4b_dropped:dt4.Hit 2:End Sub
  390. Sub Targ4c_dropped:dt4.Hit 3:End Sub
  391. Sub Targ4d_dropped:dt4.Hit 4:End Sub
  392. Sub sw34_Hit:Controller.Switch(34)=1:End Sub 'switch 34
  393. Sub sw34_unHit:Controller.Switch(34)=0:End Sub 'switch 34
  394. Sub sw74_Hit:Controller.Switch(74)=1:End Sub 'switch 74
  395. Sub sw74_unHit:Controller.Switch(74)=0:End Sub 'switch 74
  396. Sub sw54_Hit:Controller.Switch(54)=1:End Sub 'switch 54
  397. Sub sw54_unHit:Controller.Switch(54)=0:End Sub 'switch 54
  398. Sub sw64_Hit:Controller.Switch(64)=1:End Sub 'switch 64
  399. Sub sw64_unHit:Controller.Switch(64)=0:End Sub 'switch 64
  400.  
  401. Sub sw20_Hit:Controller.Switch(20)=1:End Sub 'switch 20
  402. Sub sw20_unHit:Controller.Switch(20)=0:End Sub 'switch 20
  403.  
  404. Sub sw40_Hit:Controller.Switch(40)=1:End Sub 'switch 40
  405. Sub sw40_unHit:Controller.Switch(40)=0:End Sub 'switch 40
  406. Sub sw21_Hit:Controller.Switch(21)=1:End Sub'switch 21
  407. Sub sw21_unHit:Controller.Switch(21)=0:End Sub'switch 21
  408.  
  409. Sub sw55_Hit:Controller.Switch(55)=1:End Sub'switch 55
  410. Sub sw55_unHit:Controller.Switch(55)=0:End Sub'switch 55
  411. Sub sw65_Hit:Controller.Switch(65)=1:End Sub'switch 65
  412. Sub sw65_unHit:Controller.Switch(65)=0:End Sub'switch 65
  413. Sub sw75_Hit:Controller.Switch(75)=1:End Sub'switch 75
  414. Sub sw75_unHit:Controller.Switch(75)=0:End Sub'switch 75
  415. Sub sw66_Hit:Controller.Switch(66)=1:End Sub'switch 66
  416. Sub sw66_unHit:Controller.Switch(66)=0:End Sub'switch 66
  417.  
  418.  
  419. Sub sw62_Hit:vpmTimer.PulseSw(62):End Sub 'switch 62
  420. Sub sw72_Hit:vpmTimer.PulseSw(72):End Sub 'switch 72
  421. Sub sw31_Hit:vpmTimer.PulseSw(31):End Sub 'switch 31
  422. Sub sw32_Hit:vpmTimer.PulseSw(32):End Sub 'switch 32
  423. Sub sw33_Hit:vpmTimer.PulseSw(33):End Sub 'switch 33
  424. Sub sw41_Spin:vpmTimer.PulseSw(41):End Sub 'switch 41
  425. Sub sw42_Hit:vpmTimer.PulseSw(42):End Sub 'switch 42
  426. Sub sw43_Hit:vpmTimer.PulseSw(43):End Sub 'switch 43
  427. Sub sw30_Spin:vpmTimer.PulseSw(30):End Sub 'switch 30 'switch 57 Tilt
  428. Sub sw71_hit:vpmTimer.PulseSw(71):End Sub 'switch 71
  429. Sub Drain_Hit:bsTrough.AddBall Me: End Sub
  430. Sub Kicker1_Hit:K1.AddBall 0:End Sub
  431. Sub KickerRight_Hit:bsSaucer.AddBall 0:End Sub
  432. Sub sw56_Hit:Controller.Switch(56)=1:End Sub'switch 56
  433. Sub sw56_unHit:Controller.Switch(56)=0:End Sub'switch 56
  434.  
  435. Sub Bumper1_Hit:vpmTimer.PulseSw(44):RandomSoundbumper:End Sub 'switch 44
  436. Sub Bumper2_Hit:vpmTimer.PulseSw(24):RandomSoundbumper:End Sub 'switch 24
  437. Sub Bumper3_Hit:vpmTimer.PulseSw(34):RandomSoundbumper:End Sub 'switch 34
  438.  
  439. ' Plunger1.fire
  440. Sub sw53_Hit:Controller.Switch(53)=1:End Sub'switch 53
  441. Sub sw53_unHit:Controller.Switch(53)=0:End Sub'switch 53
  442. Sub sw63_Hit:Controller.Switch(63)=1:End Sub'switch 63
  443. Sub sw63_unHit:Controller.Switch(63)=0:End Sub'switch 63
  444. Sub sw73_Hit:Controller.Switch(73)=1:End Sub'switch 73
  445. Sub sw73_unHit:Controller.Switch(73)=0:End Sub'switch 73
  446. Sub sw45_Hit:Controller.Switch(45)=1:End Sub'switch 45
  447. Sub sw45_unHit:Controller.Switch(45)=0:End Sub'switch 45
  448. Sub sw76_Hit:Controller.Switch(76)=1:End Sub'switch 76
  449. Sub sw76_unHit:Controller.Switch(76)=0:End Sub'switch 76
  450. sub k2(Enabled)
  451. Kicker2.kick 0,50
  452. End Sub
  453.  
  454.  
  455. sub k4(Enabled)
  456. Kicker4.kick 70,20
  457. End Sub
  458. Dim BallsInPlay
  459.  
  460.  
  461.  
  462. '**********************************************************************************************************
  463. ' Map Lights to Array
  464. '**********************************************************************************************************
  465. set Lights(13)=light13
  466. set lights(12)=light12
  467. set Lights(2)=light2
  468. set lights(3)=Light3
  469. set lights(5)=light5
  470. set lights(4)=light4
  471. set lights(6)=light6
  472. set lights(7)=light7
  473. set lights(8)=light8
  474. set lights(9)=light9
  475. set lights(10)=light10
  476. set lights(11)=light11
  477. set lights(1)=light1
  478. set lights(14)=light14
  479. set lights(15)=Light15
  480. set lights(16)=Light16
  481. set lights(17)=Light17
  482. set lights(18)=Light18
  483. set lights(19)=Light19
  484. set lights(20)=Light20
  485. set lights(21)=Light21
  486. set lights(22)=light22
  487. set lights(23)=light23
  488. set lights(24)=light24
  489. set lights(25)=light25
  490. set lights(26)=light26
  491. set lights(27)=light27
  492. set lights(28)=light28
  493. set lights(29)=light29
  494. set lights(30)=light30
  495. set lights(31)=light31
  496. set lights(32)=light32
  497. set lights(33)=light33
  498. set lights(34)=light34
  499. set lights(35)=light35
  500. set lights(36)=light36
  501. set lights(37)=light37
  502. set lights(38)=light38
  503. set lights(39)=light39
  504. set lights(40)=light40
  505. set lights(41)=light41
  506. set lights(42)=light42
  507. set lights(43)=light43
  508. set lights(44)=light44
  509. set lights(45)=light45
  510. set lights(46)=light46
  511. set lights(47)=light47
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526. '**********************************************************************************************************
  527. ' Backglass Light Displays
  528. '**********************************************************************************************************
  529.  
  530.  
  531. Sub LampTimer_Timer()
  532.  
  533. 'light15a.State = light15.State
  534.  
  535.  
  536. 'light28a.state=light28.state
  537. 'light29a.state=light29.state
  538.  
  539. if light13.state =1 Then
  540. htt1.enabled=1
  541. ht1.state=2
  542. ht2.state=2
  543. ht3.state=2
  544. ht4.state=2
  545. ht5.state=2
  546. ht6.state=2
  547. ht7.state=2
  548. ht8.state=2
  549. ht9.state=2
  550. ht10.state=2
  551. ht11.state=2
  552. ht12.state=2
  553. ht13.state=2
  554. ht14.state=2
  555. ht15.state=2
  556. ht16.state=2
  557. ht17.state=2
  558. ht18.state=2
  559. ht19.state=2
  560. ht20.state=2
  561.  
  562. Else
  563. htt1.enabled=0
  564. htt=0
  565. ht1.state=0
  566. ht2.state=0
  567. ht3.state=0
  568. ht4.state=0
  569. ht5.state=0
  570. ht6.state=0
  571. ht7.state=0
  572. ht8.state=0
  573. ht9.state=0
  574. ht10.state=0
  575. ht11.state=0
  576. ht12.state=0
  577. ht13.state=0
  578. ht14.state=0
  579. ht15.state=0
  580. ht16.state=0
  581. ht17.state=0
  582. ht18.state=0
  583. ht19.state=0
  584. ht20.state=0
  585.  
  586. htt1.enabled=0
  587.  
  588. lightf1.visible=0
  589. lightf2.visible=0
  590. lightf3.visible=0
  591. lightf4.visible=0
  592. lightf5.visible=0
  593. lightf6.visible=0
  594. lightf7.visible=0
  595. lightf8.visible=0
  596. lightf9.visible=0
  597. lightf10.visible=0
  598. end If
  599.  
  600.  
  601.  
  602. if light1.state=0 Then
  603. gion()
  604. Else
  605. gioff()
  606. end If
  607.  
  608. L4=light2.State
  609. 'If L4<>OL4 Then
  610. If L4=1 Then
  611.  
  612. releasein.collidable=1
  613. releaseout.collidable=0
  614. Else
  615. releaseout.collidable=1
  616. releasein.collidable=0
  617.  
  618.  
  619.  
  620. End If
  621.  
  622. 'End If
  623.  
  624.  
  625. OL4=L4
  626.  
  627.  
  628.  
  629. If light14.state=1 Then 'STARGATE RAMP
  630. Ramp7.HeightBottom = 70
  631. Ramp7.Collidable = False
  632. Ramp18.visible=1
  633. Wall14.visible=1
  634. wall26.visible=1
  635. Ramp25.visible=0
  636. Wall21.visible=0
  637. wall23.visible=0
  638. Else
  639. Ramp7.HeightBottom = 0
  640. Ramp7.Collidable = True
  641. wall21.visible=1
  642. Wall23.visible=1
  643. Ramp25.visible=1
  644. Ramp18.visible=0
  645. Wall14.visible=0
  646. wall26.visible=0
  647. End If
  648.  
  649.  
  650. end Sub
  651. dim htt
  652. htt=0
  653. sub htt1_timer
  654.  
  655. htt=htt+1
  656. if htt>10 then htt=1
  657. select Case htt
  658. case 1: lightf1.visible=1:lightf10.visible=0
  659. case 2: lightf2.visible=1:lightf1.visible=0
  660. case 3: lightf3.visible=1:lightf2.visible=0
  661. case 4: lightf4.visible=1:lightf3.visible=0
  662. case 5: lightf5.visible=1:lightf4.visible=0
  663. case 6: lightf6.visible=1:lightf5.visible=0
  664. case 7: lightf7.visible=1:lightf6.visible=0
  665. case 8: lightf8.visible=1:lightf7.visible=0
  666. case 9: lightf9.visible=1:lightf8.visible=0
  667. case 10: lightf10.visible=1:lightf9.visible=0
  668. end Select
  669. end Sub
  670. Sub DisplayTimer_Timer
  671. Dim ChgLED,ii,num,chg,stat,obj
  672. ChgLed = Controller.ChangedLEDs(&Hffffffff, &Hffffffff)
  673.  
  674.  
  675.  
  676.  
  677.  
  678. End Sub
  679.  
  680. ' Dip Switches
  681. ' ==================================================================
  682. ' Gottlieb Robo-War
  683. ' originally added by Inkochnito
  684. ' Updated Switches 8, 31, and 32
  685. Sub editDips
  686. Dim vpmDips : Set vpmDips = New cvpmDips
  687. With vpmDips
  688. .AddForm 700,400,"Robo-War - DIP switches"
  689. .AddFrame 2,4,190,"Maximum Credits",49152,Array("8",0,"10",32768,"15",&H00004000,"20",49152)'dip 15&16
  690. .AddFrame 2,80,190,"Coin Chute Left and Right Control",&H00002000,Array("Separate",0,"Same",&H00002000)'dip 14
  691. .AddFrame 2,126,190,"Playfield Special",&H00200000,Array("Special",0,"Extra Ball",&H00200000)'dip 22
  692. .AddFrame 2,172,190,"Highest Games to Date Control",&H00000020,Array("No Effect",0,"Reset High Games #2-#5 on Power Off",&H00000020)'dip 6
  693. .AddFrame 2, 218, 190, "Auto-Percentage Control", &H00000080, Array("Disabled (Normal High Score Mode)", 0, "Enabled", &H00000080)'dip 8
  694. .AddFrame 2, 264, 190, "Alpha Drop Bank Sequence", &H40000000, Array("Also Award ROBOWAR Letter", 0, "Light Extra Ball Only", &H40000000)'dip 31
  695. .AddFrame 2, 310, 190, "Number of Active ADV X Targets", &H80000000, Array("More", 0, "Less", &H80000000)'dip 32
  696. .AddFrame 205,4,190,"Highest Game to Date Awards",&H00C00000,Array("None (Not Displayed)",0,"None",&H00800000,"2 Replay",&H00400000,"3 Replay",&H00C00000)'dip 23&24
  697. .AddFrame 205,80,190,"Balls/Game",&H01000000,Array("5",0,"3",&H01000000)'dip 25
  698. .AddFrame 205,126,190,"Replay Limit",&H04000000,Array("No Limit",0,"1",&H04000000)'dip 27
  699. .AddFrame 205,172,190,"Novelty",&H08000000,Array("Normal",0,"Score 500,000 in Place of Extra Ball and Special",&H08000000)'dip 28
  700. .AddFrame 205,218,190,"Game Mode",&H10000000,Array("Replay",0,"Extra Ball",&H10000000)'dip 29
  701. .AddFrame 205,264,190,"3rd Coin Chute Credit Control",&H20000000,Array("No Effect",0,"Add 9",&H20000000)'dip 30
  702. .AddChk 205,316,180,Array("Match",&H02000000)'dip 26
  703. .AddChk 205,331,190,Array("Attract Mode Sound",&H00000040)'dip 7
  704. .AddLabel 50,360,300,20,"After hitting OK, press F3 to reset game with new settings."
  705. .ViewDips
  706. End With
  707. End Sub
  708. Set vpmShowDips = GetRef("editDips")
  709.  
  710. Sub Table1_Exit ' in some tables this needs to be Table1_Exit
  711. Controller.Stop
  712. End Sub
  713.  
  714. '**********************************************************************************************************
  715.  
  716. '**********Sling Shot Animations
  717. ' Rstep and Lstep are the variables that increment the animation
  718. '****************
  719. Dim RStep,LStep
  720.  
  721. Sub RightSlingShot_Slingshot
  722. vpmTimer.PulseSw(33)
  723. PlaySound SoundFXDOF("right_slingshot",102 , DOFPulse, DOFContactors), 0, 1, 0.05, 0.05
  724. RSling.Visible = 0
  725. RSling1.Visible = 1
  726. sling1.TransZ = -20
  727. RStep = 0
  728. RightSlingShot.TimerEnabled = 1
  729. End Sub
  730.  
  731. Sub RightSlingShot_Timer
  732. Select Case RStep
  733. Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -10
  734. Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.TransZ = 0:RightSlingShot.TimerEnabled = 0:
  735. End Select
  736. RStep = RStep + 1
  737. End Sub
  738.  
  739.  
  740. Sub leftSlingShot_Slingshot
  741. vpmTimer.PulseSw(33)
  742. PlaySound SoundFXDOF("left_slingshot",101 , DOFPulse, DOFContactors), 0, 1, 0.05, 0.05
  743. LSling.Visible = 0
  744. LSling1.Visible = 1
  745. sling2.TransZ = -20
  746. LStep = 0
  747. leftSlingShot.TimerEnabled = 1
  748. End Sub
  749.  
  750. Sub leftSlingShot_Timer
  751. Select Case LStep
  752. Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -10
  753. Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.TransZ = 0:leftSlingShot.TimerEnabled = 0:
  754. End Select
  755. LStep = LStep + 1
  756. End Sub
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765. ' *********************************************************************
  766. ' Supporting Ball & Sound Functions
  767. ' *********************************************************************
  768.  
  769. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  770. Vol = Csng(BallVel(ball) ^2 / 2000)
  771. End Function
  772.  
  773. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  774. Dim tmp
  775. tmp = ball.x * 2 / table1.width-1
  776. If tmp > 0 Then
  777. Pan = Csng(tmp ^10)
  778. Else
  779. Pan = Csng(-((- tmp) ^10) )
  780. End If
  781. End Function
  782.  
  783. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  784. Pitch = BallVel(ball) * 20
  785. End Function
  786.  
  787. Function BallVel(ball) 'Calculates the ball speed
  788. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  789. End Function
  790.  
  791. '*****************************************
  792. ' JP's VP10 Rolling Sounds
  793. '*****************************************
  794.  
  795. Const tnob = 5 ' total number of balls
  796. ReDim rolling(tnob)
  797. InitRolling
  798.  
  799. Sub InitRolling
  800. Dim i
  801. For i = 0 to tnob
  802. rolling(i) = False
  803. Next
  804. End Sub
  805.  
  806. Sub RollingTimer_Timer()
  807. Dim BOT, b
  808. BOT = GetBalls
  809.  
  810. ' stop the sound of deleted balls
  811. For b = UBound(BOT) + 1 to tnob
  812. rolling(b) = False
  813. StopSound("fx_ballrolling" & b)
  814. Next
  815.  
  816. ' exit the sub if no balls on the table
  817. If UBound(BOT) = -1 Then Exit Sub
  818.  
  819. ' play the rolling sound for each ball
  820. For b = 0 to UBound(BOT)
  821. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  822. rolling(b) = True
  823. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  824. Else
  825. If rolling(b) = True Then
  826. StopSound("fx_ballrolling" & b)
  827. rolling(b) = False
  828. End If
  829. End If
  830. Next
  831. End Sub
  832.  
  833. '**********************
  834. ' Ball Collision Sound
  835. '**********************
  836.  
  837. Sub OnBallBallCollision(ball1, ball2, velocity)
  838. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
  839. End Sub
  840.  
  841.  
  842.  
  843. '************************************
  844. ' What you need to add to your table
  845. '************************************
  846.  
  847. ' a timer called RollingTimer. With a fast interval, like 10
  848. ' one collision sound, in this script is called fx_collide
  849. ' as many sound files as max number of balls, with names ending with 0, 1, 2, 3, etc
  850. ' for ex. as used in this script: fx_ballrolling0, fx_ballrolling1, fx_ballrolling2, fx_ballrolling3, etc
  851.  
  852.  
  853. '******************************************
  854. ' Explanation of the rolling sound routine
  855. '******************************************
  856.  
  857. ' sounds are played based on the ball speed and position
  858.  
  859. ' the routine checks first for deleted balls and stops the rolling sound.
  860.  
  861. ' The For loop goes through all the balls on the table and checks for the ball speed and
  862. ' if the ball is on the table (height lower than 30) then then it plays the sound
  863. ' otherwise the sound is stopped, like when the ball has stopped or is on a ramp or flying.
  864.  
  865. ' The sound is played using the VOL, PAN and PITCH functions, so the volume and pitch of the sound
  866. ' will change according to the ball speed, and the PAN function will change the stereo position according
  867. ' to the position of the ball on the table.
  868.  
  869.  
  870. '**************************************
  871. ' Explanation of the collision routine
  872. '**************************************
  873.  
  874. ' The collision is built in VP.
  875. ' You only need to add a Sub OnBallBallCollision(ball1, ball2, velocity) and when two balls collide they
  876. ' 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
  877. ' depending of the speed of the collision.
  878.  
  879. Sub rollingmetal_Hit (idx)
  880. PlaySound "Wire Ramp", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  881. End Sub
  882.  
  883.  
  884. Sub Pins_Hit (idx)
  885. PlaySound "pinhit_low", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  886. End Sub
  887.  
  888.  
  889.  
  890. Sub Metals_Thin_Hit (idx)
  891. PlaySound "metalhit_thin", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  892. End Sub
  893.  
  894. Sub Metals_Medium_Hit (idx)
  895. PlaySound "metalhit_medium", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  896. End Sub
  897.  
  898.  
  899. Sub Gates_Hit (idx)
  900. PlaySound "gate4", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  901. End Sub
  902.  
  903.  
  904.  
  905. Sub Rubbers_Hit(idx)
  906. dim finalspeed
  907. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  908. If finalspeed > 20 then
  909. PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  910. End if
  911. If finalspeed >= 6 AND finalspeed <= 20 then
  912. RandomSoundRubber()
  913. End If
  914. End Sub
  915.  
  916.  
  917.  
  918. Sub RandomSoundRubber()
  919. Select Case Int(Rnd*3)+1
  920. Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  921. Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  922. Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  923. End Select
  924. End Sub
  925.  
  926. Sub RandomSoundbumper()
  927. Select Case Int(Rnd*5)+1
  928. Case 1 : PlaySound SoundFX("fx_Bumper",DOFContactors)
  929. Case 2 : PlaySound SoundFX("fx_Bumper1",DOFContactors)
  930. Case 3 : PlaySound SoundFX("fx_Bumper2",DOFContactors)
  931. Case 4 : PlaySound SoundFX("fx_bumper3",DOFContactors)
  932. Case 5 : PlaySound SoundFX("fx_bumper4",DOFContactors)
  933. End Select
  934. End Sub
  935.  
  936. Sub LeftFlipper_Collide(parm)
  937. RandomSoundFlipper()
  938. End Sub
  939. Sub LeftFlipper1_Collide(parm)
  940. RandomSoundFlipper()
  941. End Sub
  942.  
  943. Sub RightFlipper_Collide(parm)
  944. RandomSoundFlipper()
  945. End Sub
  946. Sub RightFlipper1_Collide(parm)
  947. RandomSoundFlipper()
  948. End Sub
  949.  
  950. Sub RandomSoundFlipper()
  951. Select Case Int(Rnd*3)+1
  952. Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  953. Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  954. Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  955. End Select
  956. End Sub
  957.  
  958.  
  959.  
  960.  
  961.  
Advertisement
Add Comment
Please, Sign In to add comment