Advertisement
Guest User

Untitled

a guest
Nov 3rd, 2016
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 44.90 KB | None | 0 0
  1. 'No Good Gofers by Bodydump
  2. 'Models by Dark
  3. Option Explicit
  4. Randomize
  5.  
  6. On Error Resume Next
  7. ExecuteGlobal GetTextFile("controller.vbs")
  8. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  9. On Error Goto 0
  10.  
  11. Const BallSize = 50
  12.  
  13. '***Apron Style***
  14. ' 0 = Standard apron
  15. ' 1 = Custom apron
  16. apronstyle = 0
  17.  
  18. '**************************
  19. 'Desktop/Fullscreen Changes
  20. '**************************
  21.  
  22. If Table.ShowDT = true then
  23. Ramp15.visible = True
  24. Ramp16.visible = True
  25. Ramp17.visible = True
  26. Light47.Intensity = 0
  27. else
  28. Ramp15.visible = False
  29. Ramp16.visible = False
  30. Ramp17.visible = False
  31. end if
  32.  
  33.  
  34. LoadVPM"01520000","WPC.VBS",3.1
  35.  
  36.  
  37.  
  38. '********************
  39. 'Standard definitions
  40. '********************
  41.  
  42. Dim xx, apronstyle
  43. Dim Bump1, Bump2, Bump3, RGoferIsUp, RightRampUp, LGoferIsUp, LeftRampUp
  44. Dim bsTrough, bsLeftEject, bsPuttOutPopper, bsJetPopper, bsUpperRightEject, mTT, cbCaptive
  45. LGoferIsUp = 0
  46. LeftRampUp = 0
  47. RGoferIsUp = 0
  48. RightRampUp = 0
  49. Const cGameName = "ngg_13"
  50. Const UseSolenoids = 1
  51. Const UseLamps = 0
  52. Const UseGI = 0
  53. Const UseSync = 0
  54. Const HandleMechs = 1
  55.  
  56. Set GICallback = GetRef("UpdateGIon")
  57. Set GICallback2 = GetRef("UpdateGI")
  58.  
  59. Const SSolenoidOn="fx_Solenoid"
  60. Const SSolenoidOff="fx_solenoidoff"
  61. Const sCoin="fx_Coin"
  62.  
  63. '***********
  64. ' Solenoids
  65. ' the commented solenoids are not in used in this script
  66. '***********
  67.  
  68. SolCallback(1)="vpmSolAutoPlunger Plunger1,3," 'Autofire
  69. SolCallback(2)="vpmSolAutoPlunger KickBack,3," 'KickBack
  70. SolCallback(3)="SolPuttOut" 'Clubhouse Kicker
  71. SolCallback(4)="SolLeftGoferUP" 'Left Gofer Up
  72. SolCallback(5)="SolRightGoferUP" 'Right Gofer Up
  73. SolCallback(6)="bsJetPopper.SolOut" 'Jet Popper
  74. SolCallback(7)="bsLeftEject.SolOut" 'Left Eject (Sand Trap)
  75. SolCallback(8)="bsUpperRightEject.SolOut" 'Upper Right Eject
  76. SolCallback(9)="SolBallRelease" 'Trough Eject
  77. ' 'SolCallback(10)="vpmSolSound ""Sling""," 'Left Slingshot
  78. ' 'SolCallback(11)="vpmSolSound ""Sling""," 'Right Slingshot
  79. ' 'SolCallback(12)="vpmSolSound ""Jet3""," 'Top Jet Bumper
  80. ' 'SolCallback(13)="vpmSolSound ""Jet3""," 'Middle Jet Bumper
  81. ' 'SolCallback(14)="vpmSolSound ""Jet3""," 'Bottom Jet Bumper
  82. SolCallback(15)="SolLeftGoferDown" 'Left Gofer Down
  83. SolCallback(16)="SolRightGoferDown" 'Right Gofer Down
  84. SolCallback(17)="SetLamp 170," 'Jet Flasher
  85. SolCallback(18)="SetLamp 178," 'Lower Left Flasher
  86. SolCallback(19)="SetLamp 180," 'Left Spinner Flasher
  87. SolCallback(20)="SetLamp 122," 'Right Spinner Flasher
  88. SolCallback(21)="SetLamp 179," 'Lower Right Flasher
  89. SolCallback(24)="SolSubway" 'Underground Pass
  90. SolCallback(25)="SetLamp 131," 'Sand Trap Flasher
  91. SolCallback(26)="SetLamp 190," 'Wheel Flasher
  92. SolCallback(27)="SolLeftRampDown" 'Left Ramp Down
  93. SolCallback(28)="SolRightRampDown" 'Right Ramp Down
  94. SolCallback(35)="SolSlamRamp" 'Ball Launch Ramp
  95. SolCallback(51)="SetLamp 177," 'Upper Right Flasher 1
  96. SolCallback(52)="SetLamp 175," 'Upper Right Flasher 2
  97. SolCallback(53)="SetLamp 173," 'Upper Right Flasher 3
  98. SolCallback(56)="SetLamp 176," 'Upper Left Flasher 1
  99. SolCallback(57)="SetLamp 174," 'Upper Left Flasher 2
  100. SolCallback(58)="SetLamp 172," 'Upper Left Flasher 3
  101. ' SolCallback(sLRFlipper)="vpmSolFlipper RightFlipper,Nothing,"
  102. ' SolCallback(sLLFlipper)="vpmSolFlipper LeftFlipper,Nothing,"
  103. ' SolCallback(sURFlipper)="vpmSolFlipper UpperFlipper,Nothing,"
  104. SolCallback(54)="SetLamp 145,"
  105. SolCallback(55)="SetLamp 146,"
  106. '
  107. Sub SolBallRelease(Enabled)
  108. If Enabled Then
  109. If bsTrough.Balls Then
  110. vpmTimer.PulseSw 31
  111. End If
  112. bsTrough.ExitSol_On
  113. End If
  114. End Sub
  115.  
  116. Sub SolPuttOut(Enabled)
  117. If Enabled Then
  118. If bsPuttOutPopper.Balls Then
  119. bsPuttOutPopper.InitKick sw44a,170,12
  120. PlaySound"scoopexit"
  121. End If
  122. bsPuttOutPopper.ExitSol_On
  123. End If
  124. End Sub
  125. Sub SolSubway(Enabled)
  126. If Enabled Then
  127. If bsPuttOutPopper.Balls Then
  128. bsPuttOutPopper.InitKick subwaystart,180,3
  129. bsPuttOutPopper.ExitSol_On
  130. End If
  131. End If
  132. End Sub
  133.  
  134. Sub SolLeftGoferUP(Enabled)
  135. If Enabled Then
  136. LrampTimer.Enabled = 0
  137. If LGoferIsUp = 0 Then
  138. Controller.Switch(41)=0
  139. Controller.Switch(47)=0
  140. LGofer.IsDropped=0
  141. LGoferUp.Enabled = 1
  142. LGoferDown.Enabled = 0
  143. Lramp.collidable=0
  144. Lramp1.collidable=1
  145. LeftRampUp = 1
  146. Else
  147. Controller.Switch(41)=0
  148. Controller.Switch(47)=0
  149. LGoferUp.Enabled = 1
  150. LeftGoferBlock.collidable = 1
  151. LGPos = 6
  152. End If
  153. End If
  154. End Sub
  155.  
  156. Sub SolRightGoferUP(Enabled)
  157. If Enabled Then
  158. RrampTimer.Enabled = 0
  159. If RGoferIsUp = 0 Then
  160. Controller.Switch(42)=0
  161. Controller.Switch(48)=0
  162. RGofer.IsDropped=0
  163. RGoferUp.Enabled = 1
  164. RGoferDown.Enabled = 0
  165. Rramp.collidable=0
  166. Rramp1.collidable=1
  167. RightRampUp = 1
  168. Else
  169. Controller.Switch(42)=0
  170. Controller.Switch(48)=0
  171. RGoferUp.Enabled = 1
  172. RGPos = 6
  173. End If
  174. End If
  175. End Sub
  176.  
  177. Sub SolLeftGoferDown(Enabled)
  178. If Enabled Then
  179. Controller.Switch(41)=1
  180. LGoferDown.Enabled = 1
  181. LGoferUp.Enabled = 0
  182. LGofer.IsDropped=1
  183. End If
  184. End Sub
  185.  
  186. Sub SolRightGoferDown(Enabled)
  187. If Enabled Then
  188. Controller.Switch(42)=1
  189. RGoferDown.Enabled = 1
  190. RGoferUp.Enabled = 0
  191. RGofer.IsDropped = 1
  192. End If
  193. End Sub
  194.  
  195. Sub SolLeftRampDown(Enabled)
  196. If Enabled Then
  197. RightRampUp = 0
  198. LrampDir = 1
  199. Lramp.collidable=1
  200. Lramp1.collidable=0
  201. PlaySound "gate"
  202. LrampTimer.Enabled = 1
  203.  
  204. Else
  205.  
  206. End If
  207. End Sub
  208.  
  209. Sub SolRightRampDown(Enabled)
  210. If Enabled Then
  211. RightRampUp = 0
  212. RrampDir = 1
  213. Rramp.collidable=1
  214. Rramp1.collidable=0
  215. PlaySound "gate"
  216. RrampTimer.Enabled = 1
  217.  
  218. Else
  219.  
  220. End If
  221. End Sub
  222.  
  223. Sub SolSlamRamp(Enabled)
  224. If Enabled Then
  225. For each xx in aslamramp:xx.IsDropped=0:Next
  226. For each xx in aslamrampup:xx.IsDropped=1:Next
  227. jumpramptrigger.enabled = 1
  228. jumpramp.Collidable=1
  229. slamrampup.Collidable = 0
  230. Flipper1.RotateToEnd
  231. rampshadow.visible = 0
  232. SlamRampDownTimer.Enabled = 1
  233. Else
  234.  
  235. End If
  236. End Sub
  237.  
  238. Sub SlamRampDownTimer_Timer()
  239. SlamRampUpTimer.Enabled = 1
  240. SlamRampDownTimer.Enabled = 0
  241. End Sub
  242. Sub SlamRampUpTimer_Timer()
  243. For each xx in aslamramp:xx.IsDropped=1:Next
  244. For each xx in aslamrampup:xx.IsDropped=9:Next
  245. jumpramp.Collidable=0
  246. slamrampup.Collidable = 1
  247. jumpramptrigger.enabled = 0
  248. Flipper1.RotateToStart
  249. rampshadow.visible = 1
  250. SlamRampUpTimer.Enabled = 0
  251. End Sub
  252.  
  253. '************
  254. ' Table init.
  255. '************
  256.  
  257. Sub Table_Init
  258. vpmInit me
  259. With Controller
  260. .GameName = cGameName
  261. If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description:Exit Sub
  262. .SplashInfoLine="No Good Gofers" & vbNewLine & "VP Table by Bodydump"
  263. .HandleKeyboard=0
  264. .ShowTitle=0
  265. .ShowDMDOnly=1
  266. .ShowFrame=0
  267. .HandleMechanics=1
  268. .Hidden=0
  269. On Error Resume Next
  270. .Run GetPlayerHWnd
  271. If Err Then MsgBox Err.Description
  272. On Error Goto 0
  273. End With
  274. 'Nudging
  275. vpmNudge.TiltSwitch=14
  276. vpmNudge.Sensitivity=1
  277. vpmNudge.TiltObj=Array(Bumper1,Bumper2,Bumper3,LeftSlingshot,RightSlingshot)
  278.  
  279. 'Trough
  280. Set bsTrough=New cvpmBallStack
  281. With bsTrough
  282. .InitSw 0,32,33,34,35,36,37,0
  283. .InitKick BallRelease,105,5
  284. .InitEntrySnd "fx_Solenoid", "fx_Solenoid"
  285. .InitExitSnd SoundFX("fx_ballrel",DOFContactors), SoundFX("fx_Solenoid",DOFContactors)
  286. .Balls=6
  287. End With
  288.  
  289. 'Sand Trap Eject
  290. Set bsLeftEject=New cvpmBallStack
  291. With bsLeftEject
  292. .InitSaucer LeftEject,78,78,20
  293. .InitExitSnd SoundFX("fx_Popper",DOFContactors), SoundFX("fx_Solenoid",DOFContactors)
  294. End With
  295.  
  296. 'Putt Out Popper
  297. Set bsPuttOutPopper=New cvpmBallStack
  298. With bsPuttOutPopper
  299. .InitSw 0,44,0,0,0,0,0,0
  300. .InitKick sw44a,170,12
  301. End With
  302.  
  303. 'Jet Popper
  304. Set bsJetPopper=New cvpmBallStack
  305. With bsJetPopper
  306. .InitSw 0,38,25,0,0,0,0,0
  307. .InitKick JetPopper,180,10
  308. .InitExitSnd SoundFX("fx_Popper",DOFContactors), SoundFX("fx_Solenoid",DOFContactors)
  309. End With
  310.  
  311. 'Upper Right Eject
  312. Set bsUpperRightEject=New cvpmBallStack
  313. With bsUpperRightEject
  314. .InitSw 0,46,0,0,0,0,0,0
  315. .InitKick upperrightkicker,120,5
  316. .InitExitSnd SoundFX("fx_Popper",DOFContactors), SoundFX("fx_Solenoid",DOFContactors)
  317. End With
  318.  
  319. 'Turntable
  320. Set mTT=New cvpmTurnTable
  321. With mTT
  322. .InitTurnTable TurnTable,40
  323. .SpinUp=40
  324. .SpinDown=40
  325. .CreateEvents "mTT"
  326. End With
  327. Blur.Enabled = 0
  328.  
  329. 'Captive Ball
  330. Set cbCaptive=New cvpmCaptiveBall
  331. With cbCaptive
  332. .InitCaptive Captive,CWALL,Array(Captive1,Captive2),350
  333. .NailedBalls=1
  334. .Start
  335. .ForceTrans=0.9
  336. .MinForce=4
  337. .CreateEvents "cbCaptive"
  338. End With
  339. Captive1.CreateBall
  340. If apronstyle = 0 Then
  341. apron.IsDropped = 1
  342. apron1.IsDropped = 0
  343. Else
  344. apron.IsDropped = 0
  345. apron1.IsDropped = 1
  346. End If
  347.  
  348. If nightday<5 then
  349. For each xx in extraambient:xx.intensityscale = 1:Next
  350. End If
  351. If nightday>5 then
  352. For each xx in extraambient:xx.intensity = xx.intensity*.9:Next
  353. End If
  354. If nightday>10 then
  355. For each xx in extraambient:xx.intensity = xx.intensity*.7:Next
  356. For each xx in GIleft:xx.intensity = xx.intensity*.9:Next
  357. For each xx in GIright:xx.intensity = xx.intensity*.9:Next
  358. End If
  359. If nightday>20 then
  360. For each xx in extraambient:xx.intensity = xx.intensity*.6:Next
  361. For each xx in GIleft:xx.intensity = xx.intensity*.8:Next
  362. For each xx in GIright:xx.intensity = xx.intensity*.8:Next
  363. End If
  364. If nightday>30 then
  365. For each xx in extraambient:xx.intensity = xx.intensity*.4:Next
  366. For each xx in GIleft:xx.intensity = xx.intensity*.7:Next
  367. For each xx in GIright:xx.intensity = xx.intensity*.7:Next
  368. End If
  369.  
  370.  
  371.  
  372. ' '**Main Timer init
  373. PinMAMETimer.Enabled = 1
  374.  
  375. Plunger1.PullBack
  376. Kickback.PullBack
  377. Controller.Switch(22)=1 'close coin door
  378. Controller.Switch(24)=0 'always closed
  379. Controller.Switch(41)=1 'drop left gofer
  380. Controller.Switch(42)=1 'drop right gofer
  381. Controller.Switch(47)=1 'left ramp down
  382. Controller.Switch(48)=1 'right ramp down
  383. LGofer.IsDropped = 1
  384. RGofer.IsDropped = 1
  385. Rramp1.collidable=0
  386. Lramp1.collidable=0
  387.  
  388. End Sub
  389.  
  390. Sub Table_Paused:Controller.Pause = 1:End Sub
  391. Sub Table_unPaused:Controller.Pause = 0:End Sub
  392.  
  393. '**********
  394. ' Keys
  395. '**********
  396.  
  397. Sub table_KeyDown(ByVal Keycode)
  398. If keycode = PlungerKey Then Plunger.Pullback:PlaySound SoundFX("fx_plungerpull",DOFContactors)
  399. If keycode = LeftTiltKey Then vpmNudge.DoNudge 90, 3:PlaySound SoundFX("fx_nudge",0), 0, 1, -0.1, 0.25
  400. If keycode = RightTiltKey Then vpmNudge.DoNudge 270, 3:PlaySound SoundFX("fx_nudge",0), 0, 1, 0.1, 0.25
  401. If keycode = CenterTiltKey Then vpmNudge.DoNudge 0, 4:PlaySound SoundFX("fx_nudge",0), 0, 1, 0, 0.25
  402. If vpmKeyDown(keycode) Then Exit Sub
  403. End Sub
  404.  
  405. Sub table_KeyUp(ByVal Keycode)
  406. If keycode = PlungerKey Then Plunger.Fire:PlaySound SoundFX("fx_plunger",DOFContactors)
  407. If vpmKeyUp(keycode) Then Exit Sub
  408. End Sub
  409.  
  410.  
  411. '********************
  412. ' Flippers
  413. '********************
  414.  
  415. SolCallback(sLRFlipper) = "SolRFlipper"
  416. SolCallback(sLLFlipper) = "SolLFlipper"
  417.  
  418. Sub SolLFlipper(Enabled)
  419. If Enabled Then
  420. PlaySound SoundFX("fx_flipperup",DOFContactors), 0, 1, -0.1, 0.05
  421. LeftFlipper.RotateToEnd
  422. Else
  423. PlaySound SoundFX("fx_flipperdown",DOFContactors), 0, 1, -0.1, 0.05
  424. LeftFlipper.RotateToStart
  425. End If
  426. End Sub
  427.  
  428. Sub SolRFlipper(Enabled)
  429. If Enabled Then
  430. PlaySound SoundFX("fx_flipperup",DOFContactors), 0, 1, 0.1, 0.05
  431. RightFlipper.RotateToEnd
  432. UpperFlipper.RotateToEnd
  433. Else
  434. PlaySound SoundFX("fx_flipperdown",DOFContactors), 0, 1, 0.1, 0.05
  435. RightFlipper.RotateToStart
  436. UpperFlipper.RotateToStart
  437. End If
  438. End Sub
  439.  
  440. '****************************
  441. ' Drain holes, vuks & saucers
  442. '****************************
  443. Sub Drain_Hit:Playsound "fx_drain":bsTrough.AddBall Me:End Sub
  444. Sub LeftEject_Hit:PlaySound "fx_kicker_enter", 0, 1, -0.05, 0.05:bsLeftEject.AddBall 0:End Sub 'Sand Trap Eject
  445. Sub sw44a_Hit:PlaySound "ball_bounce", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  446. Sub sw44b_Hit:PlaySound "ball_bounce", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  447. Sub sw44c_Hit:PlaySound "ball_bounce", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  448. Sub sw44d_Hit:PlaySound "ball_bounce", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  449. Sub sw44e_Hit:PlaySound "ball_bounce", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  450. Sub sw44f_Hit:PlaySound "ball_bounce", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  451. Sub sw44g_Hit:PlaySound "ball_bounce", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  452. Sub sw44h_Hit:PlaySound "ball_bounce", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  453. Sub sw44i_Hit:PlaySound "ball_bounce", 0, 1, 0.05, 0.05:bsPuttOutPopper.AddBall Me:End Sub 'Putt Out Popper
  454. Sub subwayend_Hit:bsJetPopper.AddBall Me:End Sub 'Underground Pass
  455. Sub holeinone_Hit:PlaySound "ball_bounce", 0, 1, 0.05, 0.05:Me.DestroyBall:vpmTimer.PulseSwitch(68),160,"HandleTopHole":End Sub
  456. Sub behindleftgofer_Hit:PlaySound "fx_kicker_enter", 0, 1, -0.05, 0.05:Me.DestroyBall:vpmTimer.PulseSwitch(67),100,"HandlePuttOut":End Sub
  457. Sub rightpopperjam_Hit:PlaySound "fx_kicker_enter", 0, 1, 0.05, 0.05:Me.DestroyBall:vpmTimer.PulseSwitch(45),160,"HandleRightGofer":End Sub
  458. Sub HandleTopHole(swNo):vpmTimer.PulseSwitch(67),100,"HandlePuttOut":End Sub
  459. Sub HandlePuttOut(swNo):bsPuttOutPopper.AddBall 0:End Sub
  460. Sub HandleRightGofer(swNo):bsUpperRightEject.AddBall 0:End Sub
  461.  
  462. '***************
  463. ' Slingshots
  464. '***************
  465. '**********Sling Shot Animations
  466. ' Rstep and Lstep are the variables that increment the animation
  467. '****************
  468. Dim RStep, Lstep
  469.  
  470. Sub RightSlingShot_Slingshot
  471. PlaySound SoundFX("right_slingshot",DOFContactors), 0, 1, 0.05, 0.05
  472. vpmTimer.PulseSw 52
  473. RSling.Visible = 0
  474. RSling1.Visible = 1
  475. sling1.TransZ = -20
  476. RStep = 0
  477. RightSlingShot.TimerEnabled = 1
  478. End Sub
  479.  
  480. Sub RightSlingShot_Timer
  481. Select Case RStep
  482. Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -10
  483. Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.TransZ = 0:RightSlingShot.TimerEnabled = 0
  484. End Select
  485. RStep = RStep + 1
  486. End Sub
  487.  
  488. Sub LeftSlingShot_Slingshot
  489. PlaySound SoundFX("left_slingshot",DOFContactors), 0, 1, -0.05, 0.05
  490. vpmTimer.PulseSw 51
  491. LSling.Visible = 0
  492. LSling1.Visible = 1
  493. sling2.TransZ = -20
  494. LStep = 0
  495. LeftSlingShot.TimerEnabled = 1
  496. End Sub
  497.  
  498. Sub LeftSlingShot_Timer
  499. Select Case LStep
  500. Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -10
  501. Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.TransZ = 0:LeftSlingShot.TimerEnabled = 0
  502. End Select
  503. LStep = LStep + 1
  504. End Sub
  505.  
  506. '***************
  507. ' Bumpers
  508. '***************
  509. Sub Bumper1_Hit:vpmTimer.PulseSw 54:PlaySound SoundFX("fx_bumper",DOFContactors), 0, 1, -0.03, 0.05:End Sub
  510. Sub Bumper2_Hit:vpmTimer.PulseSw 53:PlaySound SoundFX("fx_bumper",DOFContactors), 0, 1, -0.05, 0.05:End Sub
  511. Sub Bumper3_Hit:vpmTimer.PulseSw 55:PlaySound SoundFX("fx_bumper",DOFContactors), 0, 1, -0.05, 0.05:End Sub
  512.  
  513.  
  514. '************
  515. ' Spinners
  516. '************
  517. Sub Spinner1_Spin():vpmTimer.PulseSwitch(61),0,"":PlaySound "fx_spinner", 0, 1, -0.05, 0.05: End Sub
  518. Sub Spinner2_Spin():vpmTimer.PulseSwitch(62),0,"":PlaySound "fx_spinner", 0, 1, 0.05, 0.05: End Sub
  519.  
  520. '*********************
  521. ' Switches & Rollovers
  522. '*********************
  523. Sub sw18_Hit:Controller.Switch(18)=1:PlaySound "fx_sensor":End Sub
  524. Sub sw18_UnHit:Controller.Switch(18)=0:End Sub
  525. Sub sw16_Hit:Controller.Switch(16)=1:PlaySound "fx_sensor":End Sub
  526. Sub sw16_UnHit:Controller.Switch(16)=0:End Sub
  527. Sub sw17_Hit:Controller.Switch(17)=1:PlaySound "fx_sensor":End Sub
  528. Sub sw17_UnHit:Controller.Switch(17)=0:End Sub
  529. Sub sw26_Hit:Controller.Switch(26)=1:PlaySound "fx_sensor":End Sub
  530. Sub sw26_UnHit:Controller.Switch(26)=0:End Sub
  531. Sub sw27_Hit:Controller.Switch(27)=1:PlaySound "fx_sensor":End Sub
  532. Sub sw27_UnHit:Controller.Switch(27)=0:End Sub
  533. Sub sw28_Hit:Controller.Switch(28)=1:PlaySound "fx_sensor":End Sub
  534. Sub sw28_UnHit:Controller.Switch(28)=0:End Sub
  535. Sub sw71_Hit:Controller.Switch(71)=1:PlaySound "fx_sensor":End Sub
  536. Sub sw71_UnHit:Controller.Switch(71)=0:End Sub
  537. Sub sw72_Hit:Controller.Switch(72)=1:PlaySound "fx_sensor":End Sub
  538. Sub sw72_UnHit:Controller.Switch(72)=0:End Sub
  539. Sub sw86_Hit:Controller.Switch(86)=1:PlaySound "fx_sensor":End Sub
  540. Sub sw86_UnHit:Controller.Switch(86)=0:End Sub
  541.  
  542. '***************
  543. ' Targets
  544. '***************
  545.  
  546. Sub sw23_Hit
  547. vpmTimer.PulseSw 23
  548. PlaySound SoundFX("fx_target",DOFContactors), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  549. End Sub
  550.  
  551. Sub sw56_Hit
  552. vpmTimer.PulseSw 56
  553. PlaySound SoundFX("fx_target",DOFContactors), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  554. End Sub
  555.  
  556. Sub sw57_Hit
  557. vpmTimer.PulseSw 57
  558. PlaySound SoundFX("fx_target",DOFContactors), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  559. End Sub
  560.  
  561. Sub sw58_Hit
  562. vpmTimer.PulseSw 58
  563. PlaySound SoundFX("fx_target",DOFContactors), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  564. End Sub
  565.  
  566. Sub sw77_Hit
  567. vpmTimer.PulseSw 77
  568. PlaySound SoundFX("fx_target",DOFContactors), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  569. End Sub
  570.  
  571. Sub sw81_Hit
  572. vpmTimer.PulseSw 81
  573. PlaySound SoundFX("fx_target",DOFContactors), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  574. End Sub
  575.  
  576. Sub sw82_Hit
  577. vpmTimer.PulseSw 82
  578. PlaySound SoundFX("fx_target",DOFContactors), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  579. End Sub
  580.  
  581. Sub sw83_Hit
  582. vpmTimer.PulseSw 83
  583. PlaySound SoundFX("fx_target",DOFContactors), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  584. End Sub
  585.  
  586. Sub sw84_Hit
  587. vpmTimer.PulseSw 84
  588. PlaySound SoundFX("fx_target",DOFContactors), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  589. End Sub
  590.  
  591. Sub sw85_Hit
  592. vpmTimer.PulseSw 85
  593. PlaySound SoundFX("fx_target",DOFContactors), 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  594. End Sub
  595.  
  596. '*********************
  597. ' Random Switches
  598. '*********************
  599. Sub Gate4_Hit():vpmTimer.PulseSw 12:End Sub
  600. Sub sw15_Hit():vpmTimer.PulseSw 15:End Sub
  601. Sub cart_Hit():PlaySound "plastichit":vpmTimer.PulseSw 74:GolfCart.Y = 218:WheelTargetPosition.Y = 217:Me.TimerEnabled = 1:End Sub 'Golf Cart
  602. Sub cart_Timer:GolfCart.Y = 215:WheelTargetPosition.Y = 211:Me.TimerEnabled = 0:End Sub
  603. Sub sw73_Hit():vpmTimer.PulseSw 73:End Sub
  604. Sub LGofer_Hit():PlaySound "plastichit":vpmTimer.PulseSw 65:LeftGoferBlock.Y = 441:Me.TimerEnabled = 1:End Sub
  605. Sub LGofer_Timer:LeftGoferBlock.Y = 449:Me.TimerEnabled = 0:End Sub
  606. Sub RGofer_Hit():PlaySound "plastichit":vpmTimer.PulseSw 75:RightGoferBlock.Y = 516.625:Me.TimerEnabled = 1:End Sub
  607. Sub RGofer_Timer:RightGoferBlock.Y = 524.625:Me.TimerEnabled = 0:End Sub
  608.  
  609. '****************
  610. 'Gofer Animations
  611. '****************
  612.  
  613. Dim LGPos, LGDir, RGPos, RGPos2, RGDir, LrampPos, LrampDir, RrampPos, RrampDir
  614. LGPos=22:RGPos=22:LrampPos=22:RrampPos=22
  615. LGDir=0:RGDir=0:LrampDir=1:RrampDir=1
  616. LGofer.TimerEnabled=1:RGofer.TimerEnabled=1:LrampTimer.Enabled=1
  617.  
  618. Sub LGoferUp_Timer()
  619. Select Case LGPos
  620. Case 0: LeftGoferBlock.z=-20
  621. LGoferIsUp = 1
  622. LGoferUp.Enabled = 0
  623. Lramp.HeightBottom=110
  624. Case 1: LeftGoferBlock.z=-25:Lramp.HeightBottom=104
  625. Case 2: LeftGoferBlock.z=-31:Lramp.HeightBottom=102
  626. Case 3: LeftGoferBlock.z=-37:Lramp.HeightBottom=100
  627. Case 4: LeftGoferBlock.z=-31:Lramp.HeightBottom=102
  628. Case 5: LeftGoferBlock.z=-25:Lramp.HeightBottom=104
  629. Case 6: LeftGoferBlock.z=-20:Lramp.HeightBottom=110
  630. Case 7: LeftGoferBlock.z=-25:Lramp.HeightBottom=104
  631. Case 8: LeftGoferBlock.z=-31:Lramp.HeightBottom=98
  632. Case 9: LeftGoferBlock.z=-37:Lramp.HeightBottom=91
  633. Case 10: LeftGoferBlock.z=-43:Lramp.HeightBottom=84
  634. Case 11: LeftGoferBlock.z=-49:Lramp.HeightBottom=77
  635. Case 12: LeftGoferBlock.z=-55:Lramp.HeightBottom=70
  636. Case 13: LeftGoferBlock.z=-61:Lramp.HeightBottom=63
  637. Case 14: LeftGoferBlock.z=-67:Lramp.HeightBottom=56
  638. Case 15: LeftGoferBlock.z=-73:Lramp.HeightBottom=49
  639. Case 16: LeftGoferBlock.z=-79:Lramp.HeightBottom=42
  640. Case 17: LeftGoferBlock.z=-85:Lramp.HeightBottom=35
  641. Case 18: LeftGoferBlock.z=-91:Lramp.HeightBottom=28
  642. Case 19: LeftGoferBlock.z=-97:Lramp.HeightBottom=21
  643. Case 20: LeftGoferBlock.z=-103:Lramp.HeightBottom=14
  644. Case 21: LeftGoferBlock.z=-109:Lramp.HeightBottom=7
  645. Case 22: LeftGoferBlock.z=-115:Lramp.HeightBottom=0
  646. End Select
  647. If LGpos>0 then LGpos=LGpos-1
  648. End Sub
  649.  
  650. Sub LGoferDown_Timer()
  651. Select Case LGPos
  652. Case 0: LeftGoferBlock.z=-19
  653. Case 1: LeftGoferBlock.z=-25
  654. Case 2: LeftGoferBlock.z=-31
  655. Case 3: LeftGoferBlock.z=-37
  656. Case 4: LeftGoferBlock.z=-43
  657. Case 5: LeftGoferBlock.z=-49
  658. Case 6: LeftGoferBlock.z=-55
  659. Case 7: LeftGoferBlock.z=-61
  660. Case 8: LeftGoferBlock.z=-67
  661. Case 9: LeftGoferBlock.z=-73
  662. Case 10: LeftGoferBlock.z=-79
  663. Case 11: LeftGoferBlock.z=-85
  664. Case 12: LeftGoferBlock.z=-91
  665. Case 13: LeftGoferBlock.z=-97
  666. Case 14: LeftGoferBlock.z=-103
  667. Case 15: LeftGoferBlock.z=-109
  668. Case 16: LeftGoferBlock.z=-115
  669. LGoferDown.Enabled = 0
  670. LGoferIsUp = 0
  671. End Select
  672. If LGpos<16 then LGpos=LGpos+1
  673. End Sub
  674.  
  675. Sub RGoferUp_Timer()
  676. Select Case RGPos
  677. Case 0: RightGoferBlock.z=-20
  678. RGoferIsUp = 1
  679. RGoferUp.Enabled = 0
  680. Rramp.HeightBottom=110
  681. Case 1: RightGoferBlock.z=-25:Rramp.HeightBottom=104
  682. Case 2: RightGoferBlock.z=-31:Rramp.HeightBottom=102
  683. Case 3: RightGoferBlock.z=-37:Rramp.HeightBottom=100
  684. Case 4: RightGoferBlock.z=-31:Rramp.HeightBottom=102
  685. Case 5: RightGoferBlock.z=-25:Rramp.HeightBottom=104
  686. Case 6: RightGoferBlock.z=-20:Rramp.HeightBottom=110
  687. Case 7: RightGoferBlock.z=-25:Rramp.HeightBottom=104
  688. Case 8: RightGoferBlock.z=-31:Rramp.HeightBottom=98
  689. Case 9: RightGoferBlock.z=-37:Rramp.HeightBottom=91
  690. Case 10: RightGoferBlock.z=-43:Rramp.HeightBottom=84
  691. Case 11: RightGoferBlock.z=-49:Rramp.HeightBottom=77
  692. Case 12: RightGoferBlock.z=-55:Rramp.HeightBottom=70
  693. Case 13: RightGoferBlock.z=-61:Rramp.HeightBottom=63
  694. Case 14: RightGoferBlock.z=-67:Rramp.HeightBottom=56
  695. Case 15: RightGoferBlock.z=-73:Rramp.HeightBottom=49
  696. Case 16: RightGoferBlock.z=-79:Rramp.HeightBottom=42
  697. Case 17: RightGoferBlock.z=-85:Rramp.HeightBottom=35
  698. Case 18: RightGoferBlock.z=-91:Rramp.HeightBottom=28
  699. Case 19: RightGoferBlock.z=-97:Rramp.HeightBottom=21
  700. Case 20: RightGoferBlock.z=-103:Rramp.HeightBottom=14
  701. Case 21: RightGoferBlock.z=-109:Rramp.HeightBottom=7
  702. Case 22: RightGoferBlock.z=-115:Rramp.HeightBottom=0
  703. End Select
  704. If RGpos>0 then RGpos=RGpos-1
  705. End Sub
  706.  
  707. Sub RGoferDown_Timer()
  708. Select Case RGPos
  709. Case 0: RightGoferBlock.z=-19
  710. Case 1: RightGoferBlock.z=-25
  711. Case 2: RightGoferBlock.z=-31
  712. Case 3: RightGoferBlock.z=-37
  713. Case 4: RightGoferBlock.z=-43
  714. Case 5: RightGoferBlock.z=-49
  715. Case 6: RightGoferBlock.z=-55
  716. Case 7: RightGoferBlock.z=-61
  717. Case 8: RightGoferBlock.z=-67
  718. Case 9: RightGoferBlock.z=-73
  719. Case 10: RightGoferBlock.z=-79
  720. Case 11: RightGoferBlock.z=-85
  721. Case 12: RightGoferBlock.z=-91
  722. Case 13: RightGoferBlock.z=-97
  723. Case 14: RightGoferBlock.z=-103
  724. Case 15: RightGoferBlock.z=-109
  725. Case 16: RightGoferBlock.z=-115
  726. RGoferDown.Enabled = 0
  727. RGoferIsUp = 0
  728. End Select
  729. If RGpos<16 then RGpos=RGpos+1
  730. End Sub
  731.  
  732. Sub LrampTimer_Timer()
  733. If LGoferIsUp = 0 Then
  734. Select Case LrampPos
  735. Case 0: Lramp.HeightBottom=110
  736. Case 1: Lramp.HeightBottom=104
  737. Case 2: Lramp.HeightBottom=102
  738. Case 3: Lramp.HeightBottom=100
  739. Case 4: Lramp.HeightBottom=102
  740. Case 5: Lramp.HeightBottom=104
  741. Case 6: Lramp.HeightBottom=110
  742. Case 7: Lramp.HeightBottom=104
  743. Case 8: Lramp.HeightBottom=98
  744. Case 9: Lramp.HeightBottom=91
  745. Case 10: Lramp.HeightBottom=84
  746. Case 11: Lramp.HeightBottom=77
  747. Case 12: Lramp.HeightBottom=70
  748. Case 13: Lramp.HeightBottom=63
  749. Case 14: Lramp.HeightBottom=56
  750. Case 15: Lramp.HeightBottom=49
  751. Case 16: Lramp.HeightBottom=42
  752. Case 17: Lramp.HeightBottom=35
  753. Case 18: Lramp.HeightBottom=28
  754. Case 19: Lramp.HeightBottom=21
  755. Case 20: Lramp.HeightBottom=14
  756. Case 21: Lramp.HeightBottom=7
  757. Case 22: Lramp.HeightBottom=0:Controller.Switch(47)=1:LeftRampUp = 0:LrampTimer.Enabled = 0
  758. If Lramppos<22 then Lramppos=Lramppos+1
  759. End Select
  760. End If
  761. End Sub
  762.  
  763.  
  764. Sub RrampTimer_Timer()
  765. If RGoferIsUp = 0 Then
  766. Select Case RrampPos
  767. Case 0: Rramp.HeightBottom=110
  768. Case 1: Rramp.HeightBottom=104
  769. Case 2: Rramp.HeightBottom=102
  770. Case 3: Rramp.HeightBottom=100
  771. Case 4: Rramp.HeightBottom=102
  772. Case 5: Rramp.HeightBottom=104
  773. Case 6: Rramp.HeightBottom=110
  774. Case 7: Rramp.HeightBottom=104
  775. Case 8: Rramp.HeightBottom=98
  776. Case 9: Rramp.HeightBottom=91
  777. Case 10: Rramp.HeightBottom=84
  778. Case 11: Rramp.HeightBottom=77
  779. Case 12: Rramp.HeightBottom=70
  780. Case 13: Rramp.HeightBottom=63
  781. Case 14: Rramp.HeightBottom=56
  782. Case 15: Rramp.HeightBottom=49
  783. Case 16: Rramp.HeightBottom=42
  784. Case 17: Rramp.HeightBottom=35
  785. Case 18: Rramp.HeightBottom=28
  786. Case 19: Rramp.HeightBottom=21
  787. Case 20: Rramp.HeightBottom=14
  788. Case 21: Rramp.HeightBottom=7
  789. Case 22: Rramp.HeightBottom=0:Controller.Switch(48)=1:RightRampUp = 0:RrampTimer.Enabled = 0
  790. If Rramppos<22 then Rramppos=Rramppos+1
  791. End Select
  792. End If
  793. End Sub
  794.  
  795. '**************
  796. 'Turntable Subs
  797. '**************
  798.  
  799. Set MotorCallback=GetRef("SRPRoutine")
  800. Dim WheelSpeed, WheelCW, WheelPosPrev
  801.  
  802. Sub SRPRoutine
  803. Dim WheelPos
  804.  
  805. WheelPos = Controller.GetMech(4)
  806. If WheelPos = WheelPosPrev Then Exit Sub
  807. WheelPosPrev = WheelPos
  808.  
  809. WheelSpeed = INT(Controller.GetMech(5))
  810. If WheelSpeed < 0 Then
  811. WheelCW = True
  812. BlurDir = 1
  813. WheelSpeed = ABS(WheelSpeed)
  814. Else
  815. BlurDir = 0
  816. WheelCW = False
  817. End If
  818.  
  819. if WheelSpeed > 50 Then
  820. mTT.SolMotorState WheelCW,True
  821. mTT.Speed = WheelSpeed
  822. Else
  823. mTT.SolMotorState WheelCW,False
  824.  
  825. end if
  826. if WheelSpeed > 95 Then
  827. Blur.Enabled = 1
  828. Else
  829. if Blur.Enabled Then
  830. Blur.Enabled = 0
  831. disc.image = "NGG_Map"
  832. End If
  833. end if
  834. disc.roty = 360 - WheelPos + 22
  835. End Sub
  836.  
  837. Dim DiskArray, BlurDir, Blurlevel
  838. DiskArray=Array("12","350","335","305","282","258","235","215","190","168","146","125","100","80","55","32")
  839. Blurlevel = 1
  840. Sub Blur_Timer()
  841. Select Case Blurlevel
  842. Case 1: disc.image = "NGG_Map_Mblur1"
  843. Case 2: disc.image = "NGG_Map_Mblur2"
  844. Case 3: disc.image = "NGG_Map_Mblur3"
  845. Case 4: disc.image = "NGG_Map_Mblur4"
  846. Case 5: disc.image = "NGG_Map_Mblur5"
  847. Case 6: disc.image = "NGG_Map_Mblur6"
  848. If BlurDir = 0 Then
  849. Blurlevel = 1
  850. End If
  851. End Select
  852. If BlurDir = 1 Then
  853. If Blurlevel>0 then Blurlevel = Blurlevel - 1 else BlurLevel = 6
  854. Else
  855. If Blurlevel<6 Then Blurlevel = Blurlevel + 1 else BlurLevel = 1
  856. End If
  857. End Sub
  858.  
  859.  
  860. '***************************************************
  861. ' JP's VP10 Fading Lamps & Flashers
  862. ' Based on PD's Fading Light System
  863. ' SetLamp 0 is Off
  864. ' SetLamp 1 is On
  865. ' fading for non opacity objects is 4 steps
  866. '***************************************************
  867.  
  868. Dim LampState(200), FadingLevel(200)
  869. Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
  870.  
  871. InitLamps() ' turn off the lights and flashers and reset them to the default parameters
  872. LampTimer.Interval = 10 'lamp fading speed
  873. LampTimer.Enabled = 1
  874.  
  875. ' Lamp & Flasher Timers
  876.  
  877. Sub LampTimer_Timer()
  878. Dim chgLamp, num, chg, ii
  879. chgLamp = Controller.ChangedLamps
  880. If Not IsEmpty(chgLamp) Then
  881. For ii = 0 To UBound(chgLamp)
  882. LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1) 'keep the real state in an array
  883. FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
  884. Next
  885. End If
  886. UpdateLamps
  887. End Sub
  888.  
  889.  
  890. Sub UpdateLamps
  891. NFadeL 11, L11
  892. NFadeL 12, L12
  893. NFadeL 13, L13
  894. NFadeL 14, L14
  895. NFadeL 15, L15
  896. NFadeL 16, L16
  897. NFadeL 17, L17
  898. NFadeL 18, L18
  899. NFadeL 21, L21
  900. NFadeL 22, L22
  901. NFadeL 23, L23
  902. NFadeL 24, L24
  903. NFadeL 25, L25
  904. NFadeL 26, L26
  905. NFadeL 27, L27
  906. NFadeL 28, L28
  907. NFadeL 31, L31
  908. NFadeL 32, L32
  909. NFadeL 33, L33
  910. NFadeL 34, L34
  911. NFadeL 35, L35
  912. NFadeL 36, L36
  913. NFadeL 37, L37
  914. NFadeL 38, L38
  915. NFadeL 41, L41
  916. NFadeL 42, L42
  917. NFadeL 43, L43
  918. NFadeL 44, L44
  919. NFadeL 45, L45
  920. NFadeL 46, L46
  921. NFadeL 47, L47
  922. NFadeL 48, L48
  923. NFadeL 51, L51
  924. NFadeL 52, L52
  925. NFadeL 53, L53
  926. NFadeL 54, L54
  927. NFadeLm 55, L55b
  928. NFadeL 55, L55
  929. NFadeL 56, L56
  930. NFadeL 57, L57
  931. NFadeL 58, L58
  932. NFadeL 61, L61
  933. NFadeL 62, L62
  934. NFadeL 63, L63
  935. NFadeL 64, L64
  936. NFadeL 65, L65
  937. NFadeL 66, L66
  938. NFadeL 67, L67
  939. NFadeL 68, L68
  940. NFadeLm 71, L71b
  941. NFadeL 71, L71
  942. NFadeL 72, L72
  943. NFadeL 73, L73
  944. NFadeL 74, L74
  945. NFadeL 75, L75
  946. NFadeL 76, L76
  947. NFadeL 77, L77
  948. NFadeLm 78, bump3light1
  949. NFadeL 78, bump3light
  950. NFadeL 81, L81
  951. NFadeL 82, L82
  952. NFadeL 83, L83
  953. NFadeL 84, L84
  954. NFadeL 85, L85
  955. NFadeLm 86, bump2light1
  956. NFadeL 86, bump2light
  957. NFadeLm 87, bump1light1
  958. NFadeL 87, bump1light
  959. ' FadeL 88, L88, L88a 'start button
  960. NFadeL 122, L122
  961. NFadeLm 131, L131b
  962. NFadeLm 131, L131a
  963. NFadeL 131, L131
  964. 'NFadeL 145, L145
  965. 'NFadeL 146, L146
  966. NFadeARmCombi 145, 146, upperplayfield, "upperplayfield", "upperplayfieldright", "upperplayfieldleft", "upperplayfieldboth", Combifor145and146
  967. NFadeLm 170, L170b
  968. NFadeLm 170, L170a
  969. NFadeL 170, L170
  970. NFadeLm 172, L172a
  971. NFadeLm 172, L172b
  972. NFadeL 172, L172
  973. NFadeLm 173, L173a
  974. NFadeLm 173, L173b
  975. NFadeL 173, L173
  976. NFadeLm 174, L174a
  977. NFadeLm 174, L174b
  978. NFadeL 174, L174
  979. NFadeLm 175, L175a
  980. NFadeLm 175, L175b
  981. NFadeL 175, L175
  982. NFadeLm 176, L176a
  983. NFadeLm 176, L176b
  984. NFadeL 176, L176
  985. NFadeLm 177, L177a
  986. NFadeLm 177, L177b
  987. NFadeL 177, L177
  988. NFadeLm 178, L178a
  989. NFadeLm 178, L178b
  990. NFadeL 178, L178
  991. NFadeLm 179, L179a
  992. NFadeLm 179, L179b
  993. NFadeL 179, L179
  994. NFadeLm 180, L180a
  995. NFadeLm 180, L180b
  996. NFadeLm 180, L180c
  997. NFadeL 180, L180
  998. NFadeLm 190, L190b
  999. NFadeLm 190, L190a
  1000. NFadeL 190, L190
  1001. End Sub
  1002. '
  1003. 'Sub FlasherTimer_Timer()
  1004. ' Flash 11, h11
  1005. ' Flash 12, h12
  1006. ' Flash 13, h13
  1007. ' Flash 14, h14
  1008. ' Flash 15, h15
  1009. ' Flash 16, h16
  1010. ' Flash 17, h17
  1011. ' Flash 18, h18
  1012. ' Flash 21, h21
  1013. ' Flash 22, h22
  1014. ' Flash 23, h23
  1015. ' Flash 24, h24
  1016. ' Flash 25, h25
  1017. ' Flash 26, h26
  1018. ' Flash 27, h27
  1019. ' Flash 28, h28
  1020. ' Flash 31, h31
  1021. ' Flash 32, h32
  1022. ' Flash 33, h33
  1023. ' Flash 34, h34
  1024. ' Flash 35, h35
  1025. ' Flash 36, h36
  1026. ' Flash 37, h37
  1027. ' Flash 38, h38
  1028. ' Flash 41, h41
  1029. ' Flash 42, h42
  1030. ' Flash 43, h43
  1031. ' Flash 44, h44
  1032. ' Flash 45, h45
  1033. ' Flash 46, h46
  1034. ' Flash 47, h47
  1035. ' Flash 48, h48
  1036. ' Flash 51, h51
  1037. ' Flash 52, h52
  1038. ' Flash 53, h53
  1039. ' Flash 54, h54
  1040. ' Flashm 55, h55a
  1041. ' Flash 55, h55
  1042. ' Flash 56, h56
  1043. ' Flash 57, h57
  1044. ' Flash 58, h58
  1045. ' Flash 61, h61
  1046. ' Flash 62, h62
  1047. ' Flash 63, h63
  1048. ' Flash 64, h64
  1049. ' Flash 65, h65
  1050. ' Flash 66, h66
  1051. ' Flash 68, h68
  1052. ' Flashm 71, h71a
  1053. ' Flash 71, h71
  1054. ' Flash 72, h72
  1055. ' Flash 73, h73
  1056. ' Flash 74, h74
  1057. ' Flash 75, h75
  1058. ' Flash 77, h77
  1059. ' Flash 78, h78
  1060. ' Flash 81, h81
  1061. ' Flash 82, h82
  1062. ' Flash 83, h83
  1063. ' Flash 84, h84
  1064. ' Flash 85, h85
  1065. ' Flash 86, h86
  1066. ' Flash 87, h87
  1067. ' Flashm 120, Flasher19
  1068. ' Flash 120, Flasher1
  1069. ' Flashm 121, Flasher20
  1070. ' Flash 121, Flasher2
  1071. ' Flashm 122, Flasher21
  1072. ' Flashm 122, Flasher4
  1073. ' Flash 122, Flasher3
  1074. ' Flash 123, Flasher5
  1075. ' Flashm 124, Flasher15
  1076. ' Flash 124, Flasher6
  1077. ' Flashm 125, Flasher18
  1078. ' Flash 125, Flasher7
  1079. ' Flash 126, Flasher8
  1080. ' Flash 127, Flasher9
  1081. ' Flashm 128, Flasher17
  1082. ' Flash 128, Flasher10
  1083. ' Flashm 129, Flasher16
  1084. ' Flash 129, Flasher11
  1085. ' Flash 130, Flasher12
  1086. ' Flashm 131, Flasher14
  1087. ' Flash 131, Flasher13
  1088. ' End Sub
  1089. '
  1090.  
  1091. ' div lamp subs
  1092.  
  1093. Sub InitLamps()
  1094. Dim x
  1095. For x = 0 to 200
  1096. LampState(x) = 0 ' current light state, independent of the fading level. 0 is off and 1 is on
  1097. FadingLevel(x) = 4 ' used to track the fading state
  1098. FlashSpeedUp(x) = 0.4 ' faster speed when turning on the flasher
  1099. FlashSpeedDown(x) = 0.2 ' slower speed when turning off the flasher
  1100. FlashMax(x) = 1 ' the maximum value when on, usually 1
  1101. FlashMin(x) = 0 ' the minimum value when off, usually 0
  1102. FlashLevel(x) = 0 ' the intensity of the flashers, usually from 0 to 1
  1103. Next
  1104. End Sub
  1105.  
  1106. Sub AllLampsOff
  1107. Dim x
  1108. For x = 0 to 200
  1109. SetLamp x, 0
  1110. Next
  1111. End Sub
  1112.  
  1113. Sub SetLamp(nr, value)
  1114. If value <> LampState(nr) Then
  1115. LampState(nr) = abs(value)
  1116. FadingLevel(nr) = abs(value) + 4
  1117. End If
  1118. End Sub
  1119.  
  1120. ' Lights: used for VP10 standard lights, the fading is handled by VP itself
  1121.  
  1122. Sub NFadeL(nr, object)
  1123. Select Case FadingLevel(nr)
  1124. Case 4:object.state = 0:FadingLevel(nr) = 0
  1125. Case 5:object.state = 1:FadingLevel(nr) = 1
  1126. End Select
  1127. End Sub
  1128.  
  1129. Sub NFadeLm(nr, object) ' used for multiple lights
  1130. Select Case FadingLevel(nr)
  1131. Case 4:object.state = 0
  1132. Case 5:object.state = 1
  1133. End Select
  1134. End Sub
  1135.  
  1136. 'Lights, Ramps & Primitives used as 4 step fading lights
  1137. 'a,b,c,d are the images used from on to off
  1138.  
  1139. Sub FadeObj(nr, object, a, b, c, d)
  1140. Select Case FadingLevel(nr)
  1141. Case 4:object.image = b:FadingLevel(nr) = 6 'fading to off...
  1142. Case 5:object.image = a:FadingLevel(nr) = 1 'ON
  1143. Case 6, 7.8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  1144. Case 9:object.image = c:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
  1145. Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  1146. Case 13:object.image = d:FadingLevel(nr) = 0 'Off
  1147. End Select
  1148. End Sub
  1149.  
  1150. Sub FadeObjm(nr, object, a, b, c, d)
  1151. Select Case FadingLevel(nr)
  1152. Case 4:object.image = b
  1153. Case 5:object.image = a
  1154. Case 9:object.image = c
  1155. Case 13:object.image = d
  1156. End Select
  1157. End Sub
  1158.  
  1159. Sub NFadeObj(nr, object, a, b)
  1160. Select Case FadingLevel(nr)
  1161. Case 4:object.image = b:FadingLevel(nr) = 0 'off
  1162. Case 5:object.image = a:FadingLevel(nr) = 1 'on
  1163. End Select
  1164. End Sub
  1165.  
  1166. Sub NFadeObjm(nr, object, a, b)
  1167. Select Case FadingLevel(nr)
  1168. Case 4:object.image = b
  1169. Case 5:object.image = a
  1170. End Select
  1171. End Sub
  1172.  
  1173. ' Flasher objects
  1174.  
  1175. Sub Flash(nr, object)
  1176. Select Case FadingLevel(nr)
  1177. Case 4 'off
  1178. FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
  1179. If FlashLevel(nr) < FlashMin(nr) Then
  1180. FlashLevel(nr) = FlashMin(nr)
  1181. FadingLevel(nr) = 0 'completely off
  1182. End if
  1183. Object.IntensityScale = FlashLevel(nr)
  1184. Case 5 ' on
  1185. FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
  1186. If FlashLevel(nr) > FlashMax(nr) Then
  1187. FlashLevel(nr) = FlashMax(nr)
  1188. FadingLevel(nr) = 1 'completely on
  1189. End if
  1190. Object.IntensityScale = FlashLevel(nr)
  1191. End Select
  1192. End Sub
  1193.  
  1194. Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
  1195. Object.IntensityScale = FlashLevel(nr)
  1196. End Sub
  1197.  
  1198. ' Desktop Objects: Reels & texts (you may also use lights on the desktop)
  1199.  
  1200. ' Reels
  1201. Dim NewCombiResult, Combifor145and146
  1202. Sub NFadeARmCombi(nr1, nr2, ramp, aOff, a1, a2, aBoth, OldCombiResult)
  1203. NewCombiResult=LampState(nr1)+(2*LampState(nr2))
  1204. If OldCombiResult=NewCombiResult Then Exit Sub
  1205. Select Case NewCombiResult
  1206. Case 0:ramp.image=aOff
  1207. Case 1:ramp.image=a1
  1208. Case 2:ramp.image=a2
  1209. Case 3:ramp.image=aBoth
  1210. End Select
  1211. OldCombiResult=NewCombiResult
  1212. End Sub
  1213.  
  1214. Sub FadeR(nr, object)
  1215. Select Case FadingLevel(nr)
  1216. Case 4:object.SetValue 1:FadingLevel(nr) = 6 'fading to off...
  1217. Case 5:object.SetValue 0:FadingLevel(nr) = 1 'ON
  1218. Case 6, 7.8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  1219. Case 9:object.SetValue 2:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
  1220. Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
  1221. Case 13:object.SetValue 3:FadingLevel(nr) = 0 'Off
  1222. End Select
  1223. End Sub
  1224.  
  1225. Sub FadeRm(nr, object)
  1226. Select Case FadingLevel(nr)
  1227. Case 4:object.SetValue 1
  1228. Case 5:object.SetValue 0
  1229. Case 9:object.SetValue 2
  1230. Case 3:object.SetValue 3
  1231. End Select
  1232. End Sub
  1233.  
  1234. 'Texts
  1235.  
  1236. Sub NFadeT(nr, object, message)
  1237. Select Case FadingLevel(nr)
  1238. Case 4:object.Text = "":FadingLevel(nr) = 0
  1239. Case 5:object.Text = message:FadingLevel(nr) = 1
  1240. End Select
  1241. End Sub
  1242.  
  1243. Sub NFadeTm(nr, object, b)
  1244. Select Case FadingLevel(nr)
  1245. Case 4:object.Text = ""
  1246. Case 5:object.Text = message
  1247. End Select
  1248. End Sub
  1249.  
  1250. '***********
  1251. ' Update GI
  1252. '***********
  1253. Dim gistep, Giswitch
  1254. Giswitch = 0
  1255.  
  1256. Sub UpdateGIOn(no, Enabled)
  1257. Select Case no
  1258. Case 0 'GIright
  1259. If Enabled Then
  1260. For each xx in GIright:xx.State = 1: Next
  1261. Else
  1262. For each xx in GIright:xx.state = 0: Next
  1263. End If
  1264. Case 1
  1265. If Enabled Then
  1266. For Each xx in GIleft:xx.state = 1: Next
  1267. else
  1268. For Each xx in GIleft:xx.state = 0: Next
  1269. End If
  1270. Case 2
  1271. If Enabled Then
  1272. For Each xx in GIother:xx.state = 1: Next
  1273. Else
  1274. For Each xx in GIother:xx.state = 0: Next
  1275. End If
  1276. End Select
  1277. End Sub
  1278.  
  1279.  
  1280. Sub UpdateGI(no, step)
  1281. Dim ii
  1282. If step = 0 then exit sub 'only values from 1 to 8 are visible and reliable. 0 is not reliable and 7 & 8 are the same so...
  1283. gistep = (step-1) / 7
  1284. Select Case no
  1285. Case 0
  1286. For each ii in GIleft
  1287. ii.IntensityScale = gistep
  1288. Next
  1289. Case 1
  1290. For each ii in GIright
  1291. ii.IntensityScale = gistep
  1292. Next
  1293. Case 2 ' also the bumpers er GI
  1294. For each ii in GIother
  1295. ii.IntensityScale = gistep
  1296. Next
  1297. Select case gistep
  1298. Case 0
  1299. GolfCart.image = "GolfCartMap"
  1300. Case 1
  1301. GolfCart.image = "GolfCartMap_ON1"
  1302. Case 2
  1303. GolfCart.image = "GolfCartMap_ON1"
  1304. Case 3
  1305. GolfCart.image = "GolfCartMap_ON2"
  1306. Case 4
  1307. GolfCart.image = "GolfCartMap_ON3"
  1308. Case 5
  1309. GolfCart.image = "GolfCartMap_ON4"
  1310. Case 6
  1311. GolfCart.image = "GolfCartMap_ON4"
  1312. Case 7
  1313. GolfCart.image = "GolfCartMap_ON5"
  1314. End Select
  1315. End Select
  1316. ' ' change the intensity of the flasher depending on the gi to compensate for the gi lights being off
  1317. ' For ii = 0 to 200
  1318. ' FlashMax(ii) = 6 - gistep * 3 ' the maximum value of the flashers
  1319. ' Next
  1320. End Sub
  1321.  
  1322.  
  1323. '''Ramp Helpers
  1324.  
  1325. 'Sub centerramphelper_Hit():ActiveBall.Vely=ActiveBall.Vely*1.3:End Sub
  1326. 'Sub centerramphelper2_Hit():Activeball.Velx=ActiveBall.Velx-20:End Sub
  1327. 'Sub upperhelper_Hit():ActiveBall.Velx=ActiveBall.Velx*1.2:End Sub
  1328. 'Sub upperhelper2_Hit():ActiveBall.Vely=ActiveBall.Vely*1.3:End Sub
  1329. 'Sub jumpramptrigger_Hit():ActiveBall.Vely=ActiveBall.Vely*1.3:End Sub
  1330. 'Sub upperjump_Hit():ActiveBall.Vely=ActiveBall.Vely*1.5:End Sub
  1331. 'Sub upperjump_UnHit():ActiveBall.Velz=ActiveBall.Velz=0:End Sub
  1332.  
  1333.  
  1334. Sub Game_timer()
  1335. slamrampP.z = Flipper1.CurrentAngle
  1336. If RightRampUp = 0 Then RrampTimer.Enabled = 1
  1337. If LeftRampUp = 0 Then LRampTimer.Enabled = 1
  1338. End Sub
  1339.  
  1340.  
  1341.  
  1342. ' *********************************************************************
  1343. ' Supporting Ball & Sound Functions
  1344. ' *********************************************************************
  1345.  
  1346. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  1347. Vol = Csng(BallVel(ball) ^2 / 2000)
  1348. End Function
  1349.  
  1350. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table" is the name of the table
  1351. Dim tmp
  1352. tmp = ball.x * 2 / table.width-1
  1353. If tmp > 0 Then
  1354. Pan = Csng(tmp ^10)
  1355. Else
  1356. Pan = Csng(-((- tmp) ^10) )
  1357. End If
  1358. End Function
  1359.  
  1360. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  1361. Pitch = BallVel(ball) * 20
  1362. End Function
  1363.  
  1364. Function BallVel(ball) 'Calculates the ball speed
  1365. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  1366. End Function
  1367.  
  1368. '*****************************************
  1369. ' JP's VP10 Rolling Sounds
  1370. '*****************************************
  1371.  
  1372. Const tnob = 8 ' total number of balls in this table is 4, but always use a higher number here bacuse of the timing
  1373. ReDim rolling(tnob)
  1374. InitRolling
  1375.  
  1376. Sub InitRolling
  1377. Dim i
  1378. For i = 0 to tnob
  1379. rolling(i) = False
  1380. Next
  1381. End Sub
  1382.  
  1383. Sub RollingTimer_Timer()
  1384. Dim BOT, b
  1385. BOT = GetBalls
  1386.  
  1387. ' stop the sound of deleted balls
  1388. For b = UBound(BOT) + 1 to tnob
  1389. rolling(b) = False
  1390. StopSound("fx_ballrolling" & b)
  1391. Next
  1392.  
  1393. ' exit the sub if no balls on the table
  1394. If UBound(BOT) = -1 Then Exit Sub
  1395.  
  1396. ' play the rolling sound for each ball
  1397. For b = 0 to UBound(BOT)
  1398. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
  1399. rolling(b) = True
  1400. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  1401. Else
  1402. If rolling(b) = True Then
  1403. StopSound("fx_ballrolling" & b)
  1404. rolling(b) = False
  1405. End If
  1406. End If
  1407. Next
  1408. End Sub
  1409.  
  1410. '**********************
  1411. ' Ball Collision Sound
  1412. '**********************
  1413.  
  1414. Sub OnBallBallCollision(ball1, ball2, velocity)
  1415. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
  1416. End Sub
  1417.  
  1418. Sub platformdrop_Unhit()
  1419. If ActiveBall.Vely>0 then PlaySound "ball_bounce"
  1420. End Sub
  1421.  
  1422. Sub rightrampdrop_UnHit():PlaySound "ball_bounce":End Sub
  1423. Sub leftrampdrop_UnHit():PlaySound "ball_bounce":End Sub
  1424.  
  1425. Sub jumpramptrigger_Hit():PlaySound "metalhit_medium":End Sub
  1426.  
  1427. Sub Pins_Hit (idx)
  1428. PlaySound "pinhit_low", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  1429. End Sub
  1430.  
  1431. Sub Targets_Hit (idx)
  1432. PlaySound "target", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  1433. End Sub
  1434.  
  1435. Sub Metals_Thin_Hit (idx)
  1436. PlaySound "metalhit_thin", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1437. End Sub
  1438.  
  1439. Sub Metals_Medium_Hit (idx)
  1440. PlaySound "metalhit_medium", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1441. End Sub
  1442.  
  1443. Sub Metals2_Hit (idx)
  1444. PlaySound "metalhit2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1445. End Sub
  1446.  
  1447. Sub Gates_Hit (idx)
  1448. PlaySound "gate4", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1449. End Sub
  1450.  
  1451. Sub Rubbers_Hit(idx)
  1452. dim finalspeed
  1453. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1454. If finalspeed > 20 then
  1455. PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1456. End if
  1457. If finalspeed >= 6 AND finalspeed <= 20 then
  1458. RandomSoundRubber()
  1459. End If
  1460. End Sub
  1461.  
  1462. Sub Posts_Hit(idx)
  1463. dim finalspeed
  1464. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  1465. If finalspeed > 16 then
  1466. PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1467. End if
  1468. If finalspeed >= 6 AND finalspeed <= 16 then
  1469. RandomSoundRubber()
  1470. End If
  1471. End Sub
  1472.  
  1473. Sub RandomSoundRubber()
  1474. Select Case Int(Rnd*3)+1
  1475. Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1476. Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1477. Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1478. End Select
  1479. End Sub
  1480.  
  1481. Sub LeftFlipper_Collide(parm)
  1482. RandomSoundFlipper()
  1483. End Sub
  1484.  
  1485. Sub RightFlipper_Collide(parm)
  1486. RandomSoundFlipper()
  1487. End Sub
  1488.  
  1489. Sub UpperFlipper_Collide(parm)
  1490. RandomSoundFlipper()
  1491. End Sub
  1492.  
  1493. Sub RandomSoundFlipper()
  1494. Select Case Int(Rnd*3)+1
  1495. Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1496. Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1497. Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  1498. End Select
  1499. End Sub
  1500.  
  1501. Sub upperjump_UnHit():ActiveBall.Velz=ActiveBall.Velz=0:End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement