Arngrim

stle neo

Jun 25th, 2017
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 96.92 KB | None | 0 0
  1. '**********************************************
  2. 'DOWNLOADED FREE AND ONLY FROM WWW.VPINBALL.COM
  3. '**********************************************
  4.  
  5. Option Explicit
  6. Randomize
  7.  
  8. On Error Resume Next
  9. ExecuteGlobal GetTextFile("controller.vbs")
  10. If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
  11. On Error Goto 0
  12.  
  13. Const cGameName = "st_161h" 'change the romname here
  14.  
  15. Const GIOnDuringAttractMode = 1 '1 - GI on during attract, 0 - GI off during attract
  16.  
  17. Const VengeanceDisable = 0 'Default: 0 - Kicker is enabled. 1 - Kicker is disabled (Test)
  18.  
  19. Const GIColorMode = 1 '1 - GI Color linked to mode selection, 0 - Standard GI
  20.  
  21. Const PewPew = 1 '1 - lasers enabled, 0 - lasers disabled (performance increase)
  22.  
  23. Sub LoadCoreVBS
  24. On Error Resume Next
  25. ExecuteGlobal GetTextFile("core.vbs")
  26. If Err Then MsgBox "Can't open core.vbs"
  27. On Error Goto 0
  28. End Sub
  29.  
  30. Dim VarHidden, UseVPMDMD
  31. If Table.ShowDT = true then
  32. UseVPMDMD = True
  33. VarHidden = 1
  34. lockdown.visible = true
  35. fireplate.visible = true
  36. pushbutton.visible = true
  37. wallsprim.visible = false
  38. wallsstraight.visible = true
  39. leftrail.visible = true
  40. rightrail.visible = true
  41. else
  42. UseVPMDMD = False
  43. VarHidden = 0
  44. lockdown.visible = false
  45. fireplate.visible = false
  46. pushbutton.visible = false
  47. wallsprim.visible = true
  48. wallsstraight.visible = false
  49. leftrail.visible = false
  50. rightrail.visible = false
  51. end if
  52.  
  53. LoadVPM "01560000", "sam.VBS", 3.10
  54.  
  55. '********************
  56. 'Standard definitions
  57. '********************
  58.  
  59. Const UseSolenoids = 1
  60. Const UseLamps = 0
  61. Const UseSync = 1
  62. Const HandleMech = 0
  63.  
  64. 'Standard Sounds
  65. Const SSolenoidOn = "Solenoid"
  66. Const SSolenoidOff = ""
  67. Const SCoin = "coin"
  68.  
  69. '************
  70. ' Table init.
  71. '************
  72. 'Variables
  73. Dim Bump1,Bump2,Bump3,Mech3bank,bsTrough,bsVUK,visibleLock,bsTEject,bsSVUK,bsRScoop
  74. Dim dtSingle
  75. Dim PlungerIM
  76. Dim PMag
  77. Dim mag2
  78. Dim bsRHole
  79. Dim FireButtonFlag:FireButtonFlag = 0
  80. Dim light1pos(2)
  81. Dim light2pos(2)
  82. Dim light3pos(2)
  83. Dim light4pos(2)
  84. Dim light5pos(2)
  85. Dim light6pos(2)
  86. Dim light7pos(2)
  87. Dim light8pos(2)
  88. Dim light9pos(2)
  89. Dim light10pos(2)
  90. Dim light11pos(2)
  91. Dim light12pos(2)
  92. Dim light13pos(2)
  93. Dim light14pos(2)
  94. Dim light15pos(2)
  95. Dim light16pos(2)
  96. Dim light17pos(2)
  97. Dim light18pos(2)
  98. Dim light19pos(2)
  99. Dim light20pos(2)
  100. Dim light21pos(2)
  101. Dim light22pos(2)
  102. Dim light23pos(2)
  103. Dim light24pos(2)
  104. Dim light25pos(2)
  105. Dim light26pos(2)
  106. Dim light27pos(2)
  107. Dim light28pos(2)
  108. Dim light29pos(2)
  109. Dim light30pos(2)
  110. Dim light31pos(2)
  111. Dim light32pos(2)
  112. Dim light33pos(2)
  113. Dim light34pos(2)
  114. Dim light35pos(2)
  115. Dim light36pos(2)
  116. Dim light37pos(2)
  117. Dim light38pos(2)
  118. Dim light39pos(2)
  119. Dim light40pos(2)
  120. Dim light41pos(2)
  121. Dim light42pos(2)
  122. Dim light43pos(2)
  123. Dim light44pos(2)
  124. Dim light45pos(2)
  125. Dim light46pos(2)
  126. Dim light47pos(2)
  127. Dim light48pos(2)
  128. Dim light49pos(2)
  129. Dim light50pos(2)
  130. Dim light51pos(2)
  131. Dim light52pos(2)
  132. Dim light53pos(2)
  133. Dim light54pos(2)
  134. Dim light55pos(2)
  135. Dim light56pos(2)
  136. Dim light57pos(2)
  137. Dim light58pos(2)
  138. Dim light59pos(2)
  139. Dim light60pos(2)
  140. Dim light61pos(2)
  141. Dim light62pos(2)
  142. Dim light63pos(2)
  143. Dim light64pos(2)
  144. Dim light65pos(2)
  145. Dim light66pos(2)
  146. Dim light67pos(2)
  147. Dim light68pos(2)
  148. Dim light69pos(2)
  149. Dim light70pos(2)
  150. Dim light71pos(2)
  151. Dim light72pos(2)
  152. Dim light73pos(2)
  153. Dim light74pos(2)
  154. Dim light75pos(2)
  155. Dim light76pos(2)
  156. Dim light77pos(2)
  157. Dim light78pos(2)
  158. Dim light79pos(2)
  159. Dim light80pos(2)
  160. Dim light81pos(2)
  161. Dim light82pos(2)
  162. Dim light83pos(2)
  163. Dim light84pos(2)
  164. Dim light85pos(2)
  165. Dim light86pos(2)
  166. Dim light87pos(2)
  167. Dim light88pos(2)
  168. Dim light89pos(2)
  169. Dim light90pos(2)
  170. Dim light91pos(2)
  171. Dim light92pos(2)
  172. Dim light93pos(2)
  173. Dim light94pos(2)
  174. Dim light95pos(2)
  175. Dim light96pos(2)
  176. Dim light97pos(2)
  177. Dim light98pos(2)
  178. Dim light99pos(2)
  179. Dim light100pos(2)
  180. Dim light101pos(2)
  181. Dim light102pos(2)
  182. Dim light103pos(2)
  183. Dim light104pos(2)
  184. Dim light105pos(2)
  185. Dim light106pos(2)
  186. Dim light107pos(2)
  187. Dim light108pos(2)
  188. Dim light109pos(2)
  189. Dim light110pos(2)
  190. Dim light111pos(2)
  191. Dim light112pos(2)
  192. Dim light113pos(2)
  193. Dim light114pos(2)
  194. Dim light115pos(2)
  195. Dim light116pos(2)
  196. Dim light117pos(2)
  197. Dim light118pos(2)
  198. Dim light119pos(2)
  199. Dim light120pos(2)
  200.  
  201. Sub Table_Init
  202.  
  203. '*****
  204. light1pos(0) = laser1.x: light1pos(1) = laser1.y
  205. light2pos(0) = Laser2.x: light2pos(1) = Laser2.y
  206. light3pos(0) = Laser3.x: light3pos(1) = Laser3.y
  207. light4pos(0) = Laser4.x: light4pos(1) = Laser4.y
  208. light5pos(0) = Laser5.x: light5pos(1) = Laser5.y
  209. light6pos(0) = Laser6.x: light6pos(1) = laser6.y
  210. light7pos(0) = Laser7.x: light7pos(1) = Laser7.y
  211. light8pos(0) = Laser8.x: light8pos(1) = Laser8.y
  212. light9pos(0) = Laser9.x: light9pos(1) = Laser9.y
  213. light10pos(0) = Laser10.x: light10pos(1) = Laser10.y
  214. light11pos(0) = Laser11.x: light11pos(1) = Laser11.y
  215. light12pos(0) = Laser12.x: light12pos(1) = Laser12.y
  216. light13pos(0) = Laser13.x: light13pos(1) = Laser13.y
  217. light14pos(0) = Laser14.x: light14pos(1) = Laser14.y
  218. light15pos(0) = Laser15.x: light15pos(1) = Laser15.y
  219. light16pos(0) = Laser16.x: light16pos(1) = Laser16.y
  220. light17pos(0) = Laser17.x: light17pos(1) = Laser17.y
  221. light18pos(0) = Laser18.x: light18pos(1) = Laser18.y
  222. light19pos(0) = Laser19.x: light19pos(1) = Laser19.y
  223. light20pos(0) = Laser20.x: light20pos(1) = Laser20.y
  224. light21pos(0) = laser21.x: light21pos(1) = laser21.y
  225. light22pos(0) = Laser22.x: light22pos(1) = Laser22.y
  226. light23pos(0) = Laser23.x: light23pos(1) = Laser23.y
  227. light24pos(0) = Laser24.x: light24pos(1) = Laser24.y
  228. light25pos(0) = Laser25.x: light25pos(1) = Laser25.y
  229. light26pos(0) = Laser26.x: light26pos(1) = laser26.y
  230. light27pos(0) = Laser27.x: light27pos(1) = Laser27.y
  231. light28pos(0) = Laser28.x: light28pos(1) = Laser28.y
  232. light29pos(0) = Laser29.x: light29pos(1) = Laser29.y
  233. light30pos(0) = Laser30.x: light30pos(1) = Laser30.y
  234. light31pos(0) = Laser31.x: light31pos(1) = Laser31.y
  235. light32pos(0) = Laser32.x: light32pos(1) = Laser32.y
  236. light33pos(0) = Laser33.x: light33pos(1) = Laser33.y
  237. light34pos(0) = Laser34.x: light34pos(1) = Laser34.y
  238. light35pos(0) = Laser35.x: light35pos(1) = Laser35.y
  239. light36pos(0) = Laser36.x: light36pos(1) = Laser36.y
  240. light37pos(0) = Laser37.x: light37pos(1) = Laser37.y
  241. light38pos(0) = Laser38.x: light38pos(1) = Laser38.y
  242. light39pos(0) = Laser39.x: light39pos(1) = Laser39.y
  243. light40pos(0) = Laser40.x: light40pos(1) = Laser40.y
  244. light41pos(0) = Laser41.x - 50: light41pos(1) = laser41.y - 500
  245. light42pos(0) = Laser42.x - 50: light42pos(1) = laser42.y - 500
  246. light43pos(0) = Laser43.x - 50: light43pos(1) = laser43.y - 500
  247. light44pos(0) = Laser44.x - 50: light44pos(1) = laser44.y - 500
  248. light45pos(0) = Laser45.x - 50: light45pos(1) = laser45.y - 500
  249. light46pos(0) = Laser46.x - 50: light46pos(1) = laser46.y - 500
  250. light47pos(0) = Laser47.x - 50: light47pos(1) = laser47.y - 500
  251. light48pos(0) = Laser48.x - 50: light48pos(1) = laser48.y - 500
  252. light49pos(0) = Laser49.x - 50: light49pos(1) = laser49.y - 500
  253. light50pos(0) = Laser50.x - 50: light50pos(1) = laser50.y - 500
  254. light51pos(0) = Laser51.x - 50: light51pos(1) = laser51.y - 500
  255. light52pos(0) = Laser52.x - 50: light52pos(1) = laser52.y - 500
  256. light53pos(0) = Laser53.x - 50: light53pos(1) = laser53.y - 500
  257. light54pos(0) = Laser54.x - 50: light54pos(1) = laser54.y - 500
  258. light55pos(0) = Laser55.x - 50: light55pos(1) = laser55.y - 500
  259. light56pos(0) = Laser56.x - 50: light56pos(1) = laser56.y - 500
  260. light57pos(0) = Laser57.x - 50: light57pos(1) = laser57.y - 500
  261. light58pos(0) = Laser58.x - 50: light58pos(1) = laser58.y - 500
  262. light59pos(0) = Laser59.x - 50: light59pos(1) = laser59.y - 500
  263. light60pos(0) = Laser60.x - 50: light60pos(1) = laser60.y - 500
  264. light61pos(0) = Laser61.x - 50: light61pos(1) = laser61.y - 500
  265. light62pos(0) = Laser62.x - 50: light62pos(1) = laser62.y - 500
  266. light63pos(0) = Laser63.x - 50: light63pos(1) = laser63.y - 500
  267. light64pos(0) = Laser64.x - 50: light64pos(1) = laser64.y - 500
  268. light65pos(0) = Laser65.x - 50: light65pos(1) = laser65.y - 500
  269. light66pos(0) = Laser66.x - 50: light66pos(1) = laser66.y - 500
  270. light67pos(0) = Laser67.x - 50: light67pos(1) = laser67.y - 500
  271. light68pos(0) = Laser68.x - 50: light68pos(1) = laser68.y - 500
  272. light69pos(0) = Laser69.x - 50: light69pos(1) = laser69.y - 500
  273. light70pos(0) = Laser70.x - 50: light70pos(1) = laser70.y - 500
  274. light71pos(0) = Laser71.x - 50: light71pos(1) = laser71.y - 500
  275. light72pos(0) = Laser72.x - 50: light72pos(1) = laser72.y - 500
  276. light73pos(0) = Laser73.x - 50: light73pos(1) = laser73.y - 500
  277. light74pos(0) = Laser74.x - 50: light74pos(1) = laser74.y - 500
  278. light75pos(0) = Laser75.x - 50: light75pos(1) = laser75.y - 500
  279. light76pos(0) = Laser76.x - 50: light76pos(1) = laser76.y - 500
  280. light77pos(0) = Laser77.x - 50: light77pos(1) = laser77.y - 500
  281. light78pos(0) = Laser78.x - 50: light78pos(1) = laser78.y - 500
  282. light79pos(0) = Laser79.x - 50: light79pos(1) = laser79.y - 500
  283. light80pos(0) = Laser80.x - 50: light80pos(1) = laser80.y - 500
  284. light81pos(0) = Laser81.x: light81pos(1) = laser81.y + 300
  285. light82pos(0) = Laser82.x: light82pos(1) = laser82.y + 300
  286. light83pos(0) = Laser83.x: light83pos(1) = laser83.y + 300
  287. light84pos(0) = Laser84.x: light84pos(1) = laser84.y + 300
  288. light85pos(0) = Laser85.x: light85pos(1) = laser85.y + 300
  289. light86pos(0) = Laser86.x: light86pos(1) = laser86.y + 300
  290. light87pos(0) = Laser87.x: light87pos(1) = laser87.y + 300
  291. light88pos(0) = Laser88.x: light88pos(1) = laser88.y + 300
  292. light89pos(0) = Laser89.x: light89pos(1) = laser89.y + 300
  293. light90pos(0) = Laser90.x: light90pos(1) = laser90.y + 300
  294. light91pos(0) = Laser91.x: light91pos(1) = laser91.y + 300
  295. light92pos(0) = Laser92.x: light92pos(1) = laser92.y + 300
  296. light93pos(0) = Laser93.x: light93pos(1) = laser93.y + 300
  297. light94pos(0) = Laser94.x: light94pos(1) = laser94.y + 300
  298. light95pos(0) = Laser95.x: light95pos(1) = laser95.y + 300
  299. light96pos(0) = Laser96.x: light96pos(1) = laser96.y + 300
  300. light97pos(0) = Laser97.x: light97pos(1) = laser97.y + 300
  301. light98pos(0) = Laser98.x: light98pos(1) = laser98.y + 300
  302. light99pos(0) = Laser99.x: light99pos(1) = laser99.y + 300
  303. light100pos(0) = Laser100.x: light100pos(1) = laser100.y + 300
  304. light101pos(0) = Laser101.x: light101pos(1) = laser101.y + 300
  305. light102pos(0) = Laser102.x: light102pos(1) = laser102.y + 300
  306. light103pos(0) = Laser103.x: light103pos(1) = laser103.y + 300
  307. light104pos(0) = Laser104.x: light104pos(1) = laser104.y + 300
  308. light105pos(0) = Laser105.x: light105pos(1) = laser105.y + 300
  309. light106pos(0) = Laser106.x: light106pos(1) = laser106.y + 300
  310. light107pos(0) = Laser107.x: light107pos(1) = laser107.y + 300
  311. light108pos(0) = Laser108.x: light108pos(1) = laser108.y + 300
  312. light109pos(0) = Laser109.x: light109pos(1) = laser109.y + 300
  313. light110pos(0) = Laser110.x: light110pos(1) = laser110.y + 300
  314. light111pos(0) = Laser111.x: light111pos(1) = laser111.y + 300
  315. light112pos(0) = Laser112.x: light112pos(1) = laser112.y + 300
  316. light113pos(0) = Laser113.x: light113pos(1) = laser113.y + 300
  317. light114pos(0) = Laser114.x: light114pos(1) = laser114.y + 300
  318. light115pos(0) = Laser115.x: light115pos(1) = laser115.y + 300
  319. light116pos(0) = Laser116.x: light116pos(1) = laser116.y + 300
  320. light117pos(0) = Laser117.x: light117pos(1) = laser117.y + 300
  321. light118pos(0) = Laser118.x: light118pos(1) = laser118.y + 300
  322. light119pos(0) = Laser119.x: light119pos(1) = laser119.y + 300
  323. light120pos(0) = Laser120.x: light120pos(1) = laser120.y + 300
  324.  
  325. ' Laser.UpdateInterval = 5
  326. ' Laser.Play SeqScrewRightOn,340,100
  327.  
  328. kickback2.Pullback
  329.  
  330. With Controller
  331. .GameName = cGameName
  332. If Err Then MsgBox "Can't start Game " & cGameName & vbNewLine & Err.Description:Exit Sub
  333. .SplashInfoLine = "Star Trek (Stern 2013)"
  334. .HandleKeyboard = 0
  335. .ShowTitle = 0
  336. .ShowDMDOnly = 1
  337. .ShowFrame = 0
  338. .HandleMechanics = 1
  339. .Hidden = VarHidden
  340. .Games(cGameName).Settings.Value("sound") = 1
  341. On Error Resume Next
  342. .Run GetPlayerHWnd
  343. If Err Then MsgBox Err.Description
  344. End With
  345.  
  346. On Error Goto 0
  347.  
  348. Const IMPowerSetting = 50
  349. Const IMTime = 0.6
  350. Set plungerIM = New cvpmImpulseP
  351. With plungerIM
  352. .InitImpulseP swplunger, IMPowerSetting, IMTime
  353. .Random 0.3
  354. .Switch 71
  355. .InitExitSnd SoundFX("plunger",DOFContactors), SoundFX("plunger",DOFContactors)
  356. .CreateEvents "plungerIM"
  357. End With
  358.  
  359. '**Trough
  360. Set bsTrough = New cvpmBallStack
  361. bsTrough.InitSw 0, 21, 20, 19, 18, 0, 0, 0
  362. bsTrough.InitKick BallRelease, 50, 10
  363. bsTrough.InitExitSnd SoundFX("ballrel",DOFContactors), SoundFX("Solenoid",DOFContactors)
  364. bsTrough.Balls = 4
  365.  
  366. Set mag2= New cvpmMagnet
  367. With mag2
  368. .InitMagnet Magnet2, 55
  369. .GrabCenter = True
  370. .solenoid=3
  371. .CreateEvents "mag2"
  372. End With
  373.  
  374. set dtSingle=new cvpmDropTarget
  375. dtSingle.InitDrop sw11,11
  376. dtSingle.InitSnd SoundFX("flapclos",DOFContactors),SoundFX("flapopen",DOFContactors)
  377.  
  378. Set bsRHole = New cvpmSaucer
  379. With bsRHole
  380. '.InitKicker kicker3, 10, 184, 22, 0
  381. if scoopposition = 0 Then 'scoop kicks out to flipper
  382. '.InitSw 0, 10, 0, 0, 0, 0, 0, 0
  383. '.InitKicker kicker3, 10, 184, 22, 0
  384. '.KickZ = 55
  385. '.InitExitSnd SoundFX("scoopexit",DOFContactors), SoundFX("Solenoid",DOFContactors)
  386. '.KickForceVar = 2
  387. End If
  388. If scoopposition = 1 Then 'scoop kicks up to ramp
  389. '.InitAltKick 0, 180
  390. '.InitSw 0, 10, 0, 0, 0, 0, 0, 0
  391. '.KickZ 90
  392. '.InitKicker kicker3, 10, 0, 22, 180
  393. '.KickZ = 90
  394. '.InitExitSnd SoundFX("scoopexit",DOFContactors), SoundFX("Solenoid",DOFContactors)
  395. '.KickForceVar = 2
  396. End If
  397. End With
  398.  
  399. '**Nudging
  400. vpmNudge.TiltSwitch=-7
  401. vpmNudge.Sensitivity=1
  402. vpmNudge.TiltObj=Array(Bumper1,Bumper2,Bumper3,LeftSlingshot,RightSlingshot)
  403.  
  404. '**Main Timer init
  405. PinMAMETimer.Interval = PinMAMEInterval
  406. PinMAMETimer.Enabled = 1
  407.  
  408. If GIOnDuringAttractMode = 1 Then GI_AllOn
  409.  
  410. End Sub
  411.  
  412. '*****Keys
  413. Sub Table_KeyDown(ByVal Keycode)
  414. If vpmKeyDown(keycode) Then Exit Sub
  415. If Keycode = LeftFlipperKey then
  416. Controller.Switch(84)=1
  417. Exit Sub
  418. End If
  419. If Keycode = RightFlipperKey then
  420. Controller.Switch(90)=1
  421. Controller.Switch(82)=1
  422. ' dim bulb
  423. ' debug.print "laser enabled"
  424. ' for each bulb in LasersPew
  425. ' bulb.state = 1
  426. ' Next
  427. ' Laser.UpdateInterval = 5
  428. ' Laser.Play SeqScrewRightOn,340,100
  429. ' timer3.enabled = 1
  430. Exit Sub
  431. End If
  432. ' If keycode = RightMagnaSave and FireButtonFlag = 1 then VengeanceHit 1:else vpmTimer.PulseSw 71:End If
  433. ' If keycode = LeftMagnaSave and FireButtonFlag = 1 then VengeanceHit 1:else vpmTimer.PulseSw 71:End If
  434. If keycode = RightMagnaSave then Controller.Switch(71) = 0:End If
  435. If keycode = LeftMagnaSave then Controller.Switch(71) = 0:End If
  436. If keycode = PlungerKey Then Plunger.Pullback
  437. If keycode = LeftTiltKey Then nudgebobble(keycode):End If
  438. If keycode = RightTiltKey Then nudgebobble(keycode):End If
  439. If Keycode = StartGameKey Then vpmTimer.PulseSw 16
  440. ' If vpmKeyDown(keycode) Then Exit Sub
  441. End Sub
  442.  
  443. Sub Table_KeyUp(ByVal keycode)
  444. If vpmKeyUp(keycode) Then Exit Sub
  445. If Keycode = LeftFlipperKey then
  446. Controller.Switch(84)=0
  447. Exit Sub
  448. End If
  449. If Keycode = RightFlipperKey then
  450. Controller.Switch(90)=0
  451. Controller.Switch(82)=0
  452. ' dim bulb
  453. ' debug.print "laser disabled"
  454. ' Laser.StopPlay
  455. ' for each bulb in LasersPew
  456. ' bulb.state = 0
  457. ' Next
  458. ' timer3.enabled = 0
  459. ' Exit Sub
  460. End If
  461. 'If Keycode = StartGameKey Then Controller.Switch(16) = 0
  462. If keycode = RightMagnaSave then Controller.Switch(71) = 1:End If
  463. If keycode = LeftMagnaSave then Controller.Switch(71) = 1:End If
  464. If Keycode = PlungerKey Then Plunger.Fire:playsound "plunger2"
  465. End Sub
  466.  
  467.  
  468. 'Solenoids
  469. SolCallback(1) = "solTrough"
  470. SolCallback(2) = "solAutofire"
  471. 'sol 3 magnet (done)
  472. SolCallback(4) = "dtSingle.SolDropUp"
  473. SolCallback(5) = "dtSingle.SolHit 1,"
  474. SolCallback(6) = "LeftKickout"
  475. SolCallback(7) = "SolKickback"
  476. SolCallback(8) = "SolShaker"
  477. 'sol9 left pop
  478. 'sol10 right pop
  479. 'sol11 bottom pop
  480. 'sol12 upper right flip
  481. 'sol13 left sling
  482. 'sol14 right sling
  483. SolCallback(15) = "SolLFlipper"
  484. SolCallback(16) = "SolRFlipper"
  485. SolCallback(17) = "Sol17"
  486. SolCallback(18) = "Sol18"
  487. SolCallback(19) = "Sol19" 'left ramp flash
  488. SolCallback(20) = "Sol20" 'right ramp flash
  489. SolCallback(21) = "Sol21"
  490. SolCallback(22) = "LaserMotor"
  491. SolCallback(23) = "Sol23"
  492. 'sol24 Optional
  493. SolCallback(24) = "SolKnocker"
  494. SolCallback(25) = "FlashPops"
  495. SolCallback(26) = "Sol26"
  496. SolCallback(27) = "Sol27"
  497. SolCallback(28) = "Sol28"
  498. SolCallback(29) = "Sol29" 'left loop / spinner
  499. SolCallback(30) = "Sol30"
  500. SolCallback(31) = "VengFlash" 'vengeance ship
  501. SolCallback(32) = "LeftSpot"
  502. SolCallback(59) = "RightSpot" '(actually 41)
  503. 'sol60 flash backbox x2 (actually 42)
  504. 'sol61 flash backbox x2 (actually 43)
  505. 'sol62 flash backbox (actually 44)
  506. 'sol63 flash backbox (actually 45)
  507. 'sol64 flash backbox (actually 46)
  508. 'SolCallback(51) = "Gate3.Collidable ="
  509. 'SolCallback(52) = "Gate2.Collidable ="
  510. SolCallback(51) = "Gate3Sol"
  511. SolCallback(52) = "Gate2Sol"
  512. SolCallback(53) = "VengeanceLE"
  513. SolCallback(54) = "KickbackPlunger"
  514. SolCallback(55) = "ScoopRot"
  515. 'sol56 vengeance ship latch
  516.  
  517. Sub Gate3Sol(enabled)
  518. If enabled Then
  519. Gate3.Collidable = 0
  520. Else
  521. Gate3.Collidable = 1
  522. End If
  523. End Sub
  524.  
  525. Sub Gate2Sol(enabled)
  526. If enabled Then
  527. Gate2.Collidable = 0
  528. Else
  529. Gate2.Collidable = 1
  530. End If
  531. End Sub
  532.  
  533. Sub Sol17(enabled)
  534. If Enabled Then
  535. SetLamp 357, 1
  536. Else
  537. SetLamp 357, 0
  538. End If
  539. End Sub
  540.  
  541. Sub Sol18(enabled)
  542. If Enabled Then
  543. SetLamp 358, 1
  544. Else
  545. SetLamp 358, 0
  546. End If
  547. End Sub
  548.  
  549. Sub Sol19(enabled)
  550. If Enabled Then
  551. SetLamp 339, 1
  552. Else
  553. SetLamp 339, 0
  554. End If
  555. End Sub
  556.  
  557. Sub Sol20(enabled)
  558. If Enabled Then
  559. SetLamp 340, 1
  560. Else
  561. SetLamp 340, 0
  562. End If
  563. End Sub
  564.  
  565. Sub Sol21(enabled)
  566. If Enabled Then
  567. SetLamp 342, 1
  568. Else
  569. SetLamp 342, 0
  570. End If
  571. End Sub
  572. Dim LatchOn:LatchOn = False
  573. Sub Sol23(enabled)
  574. If Enabled Then
  575. SetLamp 333, 1
  576. Else
  577. SetLamp 333, 0
  578. End If
  579. End Sub
  580.  
  581. Sub Sol26(enabled)
  582. If Enabled Then
  583. SetLamp 326, 1
  584. Else
  585. SetLamp 326, 0
  586. End If
  587. End Sub
  588.  
  589. Sub Sol27(enabled)
  590. If Enabled Then
  591. SetLamp 327, 1
  592. Else
  593. SetLamp 327, 0
  594. End If
  595. End Sub
  596.  
  597. Sub Sol28(enabled)
  598. If Enabled Then
  599. SetLamp 328, 1
  600. Else
  601. SetLamp 328, 0
  602. End If
  603. End Sub
  604.  
  605. Sub Sol29(enabled)
  606. If Enabled Then
  607. SetLamp 349, 1
  608. Else
  609. SetLamp 349, 0
  610. End If
  611. End Sub
  612.  
  613. Sub Sol30(enabled)
  614. If Enabled Then
  615. SetLamp 330, 1
  616. Else
  617. SetLamp 330, 0
  618. End If
  619. End Sub
  620.  
  621. Sub Latch(enabled)
  622. If Enabled then
  623. debug.print "latch disabled"
  624. LatchOn = False
  625. Else
  626. debug.print "latch enabled"
  627. LatchOn = True
  628. End If
  629. End Sub
  630.  
  631. SolCallback(sLRFlipper) = "SolRFlipper"
  632. SolCallback(sLLFlipper) = "SolLFlipper"
  633.  
  634. Sub LeftKickout(enabled)
  635. If Enabled Then
  636. 'debug.print "leftkickout!!!"
  637. If scoopposition = 0 Then
  638. kicker3.kick 184, 22
  639. Controller.Switch(10) = 0
  640. playsound SoundFX("gunpopper",DOFContactors)
  641. End If
  642. If scoopposition = 1 Then
  643. kicker3.kick 0, 50, 90
  644. Controller.Switch(10) = 0
  645. playsound SoundFX("warehousekick",DOFContactors)
  646. End If
  647. Else
  648. End If
  649. End Sub
  650.  
  651. Sub SolShaker(enabled)
  652. End Sub
  653.  
  654. Sub SolKnocker(enabled)
  655. End Sub
  656.  
  657. Sub FlashPops(Enabled)
  658. If Enabled Then
  659. SetLamp 325, 1
  660. SetFlash 325, 1
  661. Else
  662. SetLamp 325, 0
  663. SetFlash 325, 0
  664. End If
  665. End Sub
  666.  
  667. Sub LeftSpot(Enabled)
  668. If Enabled Then
  669. SetLamp 332, 1
  670. SetFlash 332, 1
  671. Else
  672. SetLamp 332, 0
  673. SetFlash 332, 0
  674. End If
  675. End Sub
  676.  
  677. Sub RightSpot(Enabled)
  678. If Enabled Then
  679. 'debug.print "sol41 enabled"
  680. SetLamp 341, 1
  681. SetFlash 341, 1
  682. Else
  683. SetLamp 341, 0
  684. SetFlash 341, 0
  685. End If
  686. End Sub
  687.  
  688. Sub solDTReset (enabled)
  689. If enabled Then
  690. sw11.isdropped = false
  691. End If
  692. End Sub
  693.  
  694. Sub solDTDown (enabled)
  695. If enabled Then
  696. sw11.isdropped = true
  697. End If
  698. End Sub
  699.  
  700. Sub VengFlash(Enabled)
  701. If Enabled Then
  702. 'vengflashGI.State = 1
  703. SetLamp 331, 1
  704. SetFlash 331, 1
  705. 'vengeancespot.state = 1
  706. vengEL.visible = 1
  707. Else
  708. 'vengflashGI.State = 0
  709. SetLamp 331, 0
  710. SetFlash 331, 0
  711. 'vengeancespot.state = 0
  712. vengEL.visible = 0
  713. End If
  714. End Sub
  715.  
  716. Sub Flash119(Enabled)
  717. If Enabled Then
  718. SetLamp 119, 1
  719. SetFlash 119, 1
  720. Else
  721. SetLamp 119, 0
  722. SetFlash 119, 0
  723. End If
  724. End Sub
  725.  
  726. Sub Flash120(Enabled)
  727. If Enabled Then
  728. SetLamp 120, 1
  729. SetFlash 120, 1
  730. Else
  731. SetLamp 120, 0
  732. SetFlash 120, 0
  733. End If
  734. End Sub
  735.  
  736. Sub solTrough(Enabled)
  737. If Enabled Then
  738. bsTrough.ExitSol_On
  739. vpmTimer.PulseSw 22
  740. End If
  741. End Sub
  742.  
  743. Sub solAutofire(Enabled)
  744. If Enabled Then
  745. PlungerIM.AutoFire
  746. End If
  747. End Sub
  748.  
  749. Sub LaserMotor(enabled)
  750. dim bulb
  751. If Enabled Then
  752. If PewPew = 1 then
  753. 'debug.print "laser enabled"
  754. for each bulb in LasersPew
  755. bulb.state = 1
  756. Next
  757. Laser.UpdateInterval = 5
  758. Laser.Play SeqScrewRightOn,340,100
  759. timer3.enabled = 1
  760. End If
  761. LaserSimple.State = 2
  762. Else
  763. If PewPew = 1 then
  764. 'debug.print "laser disabled"
  765. Laser.StopPlay
  766. for each bulb in LasersPew
  767. bulb.state = 0
  768. Next
  769. timer3.enabled = 0
  770. End If
  771. LaserSimple.State = 0
  772. End If
  773. End Sub
  774.  
  775. Sub KickbackPlunger(enabled)
  776. If Enabled Then
  777. kickback2.fire
  778. playsound SoundFX("plunger",DOFContactors)
  779. 'KickbackKicker2.Enabled = true
  780. 'debug.print "kickback enabled"
  781. Else
  782. 'kickback2.Fire
  783. 'KickbackKicker2.Enabled = false
  784. 'debug.print "kickback disabled"
  785. kickback2.TimerEnabled = true
  786. End If
  787. End Sub
  788.  
  789. Sub Kickback2_Timer()
  790. Kickback2.Pullback
  791. kickback2.TimerEnabled = False
  792. End Sub
  793.  
  794. dim scoopposition:scoopposition = 0
  795.  
  796. Sub ScoopRot(Enabled)
  797. If Enabled Then
  798. 'debug.print "scooprot!!!"
  799. ScoopFlipper.RotateToEnd
  800. scoopposition = 1
  801. Else
  802. ScoopFlipper.RotateToStart
  803. scoopposition = 0
  804. End If
  805. End Sub
  806.  
  807. 'Sub KickbackKicker2_Hit:KickbackKicker2.Kick 0, 55:End Sub
  808.  
  809. 'primitive flippers!
  810. dim MotorCallback
  811. Set MotorCallback = GetRef("GameTimer")
  812. Sub GameTimer
  813. UpdateFlipperLogos
  814. End Sub
  815.  
  816. Sub UpdateFlipperLogo_Timer
  817. LFLogo.RotY = LeftFlipper.CurrentAngle
  818. RFlogo.RotY = RightFlipper.CurrentAngle
  819. LFLogo1.RotY = LeftFlipper.CurrentAngle
  820. RFlogo2.RotY = RightFlipper.CurrentAngle
  821. RFlogo1.RotY = UpRightFlipper.CurrentAngle
  822. VengeancePrim.RotX = VengeanceFlipper.CurrentAngle
  823. f31.RotX = VengeancePrim.rotx
  824. vengEL.rotx = VengeancePrim.rotx
  825. scooprotate.RotY = ScoopFlipper.CurrentAngle
  826. End Sub
  827.  
  828. Sub SolLFlipper(Enabled)
  829. If Enabled Then
  830. PlaySound SoundFX("FlipperUpLeft",DOFFlippers)
  831. LeftFlipper.RotateToEnd
  832. Else
  833. PlaySound SoundFX("flipperdown",DOFFlippers)
  834. LeftFlipper.RotateToStart
  835. End If
  836. End Sub
  837.  
  838. Sub VengeanceLE(Enabled)
  839. If Enabled Then
  840. debug.print "vengeancele enabled"
  841. If LatchOn = True then
  842. ' debug.print "vengeancele enabled"
  843. 'PlaySound SoundFX("flipperup")
  844. 'VengeanceFlipper.RotateToEnd
  845. End If
  846. If LatchOn = False Then
  847. VengeanceFlipper.RotateToEnd
  848. VengeanceHit 1
  849. End If
  850.  
  851. Else
  852. debug.print "vengeancele disabled"
  853. If LatchOn = True Then
  854. ' debug.print "vengeancele disabled"
  855. ' PlaySound SoundFX("flipperdown")
  856. VengeanceFlipper.RotateToStart
  857. 'VengeanceFlipper2.RotateToStart
  858. VengeanceHit 0
  859. End If
  860. If LatchOn = False Then
  861. VengeanceFlipper.RotateToStart
  862. 'VengeanceFlipper2.RotateToStart
  863. End If
  864. End If
  865. End Sub
  866.  
  867. Sub SolRFlipper(Enabled)
  868. If Enabled Then
  869. PlaySound SoundFX("FlipperUpRight",DOFFlippers)
  870. RightFlipper.RotateToEnd
  871. UpRightFlipper.RotateToEnd
  872. Else
  873. PlaySound SoundFX("flipperdown",DOFFlippers)
  874. RightFlipper.RotateToStart
  875. UpRightFlipper.RotateToStart
  876. End If
  877. End Sub
  878.  
  879. Sub SolURFlipper(Enabled)
  880. If Enabled Then
  881. PlaySound SoundFX("flipperupright",DOFFlippers)
  882. UpRightFlipper.RotateToEnd
  883. Else
  884. PlaySound SoundFX("flipperdown",DOFFlippers)
  885. UpRightFlipper.RotateToStart
  886. End If
  887. End Sub
  888.  
  889. Sub LeftSlingShot_Slingshot
  890. Leftsling = True
  891. Controller.Switch(26) = 1
  892. PlaySound SoundFX("slingshot_left",DOFContactors):LeftSlingshot.TimerEnabled = 1
  893. End Sub
  894.  
  895. Dim Leftsling:Leftsling = False
  896.  
  897. Sub LS_Timer()
  898. If Leftsling = True and Left1.ObjRotZ < -7 then Left1.ObjRotZ = Left1.ObjRotZ + 2
  899. If Leftsling = False and Left1.ObjRotZ > -20 then Left1.ObjRotZ = Left1.ObjRotZ - 2
  900. If Left1.ObjRotZ >= -7 then Leftsling = False
  901. If Leftsling = True and Left2.ObjRotZ > -212.5 then Left2.ObjRotZ = Left2.ObjRotZ - 2
  902. If Leftsling = False and Left2.ObjRotZ < -199.5 then Left2.ObjRotZ = Left2.ObjRotZ + 2
  903. If Left2.ObjRotZ <= -212.5 then Leftsling = False
  904. If Leftsling = True and Left3.TransZ > -23 then Left3.TransZ = Left3.TransZ - 4
  905. If Leftsling = False and Left3.TransZ < -0 then Left3.TransZ = Left3.TransZ + 4
  906. If Left3.TransZ <= -23 then Leftsling = False
  907. End Sub
  908.  
  909. Sub LeftSlingShot_Timer:Me.TimerEnabled = 0:Controller.Switch(26) = 0:End Sub
  910.  
  911. Sub RightSlingShot_Slingshot
  912. Rightsling = True
  913. Controller.Switch(27) = 1
  914. PlaySound SoundFX("slingshot_right",DOFContactors):RightSlingshot.TimerEnabled = 1
  915. End Sub
  916.  
  917. Dim Rightsling:Rightsling = False
  918.  
  919. Sub RS_Timer()
  920. If Rightsling = True and Right1.ObjRotZ > 7 then Right1.ObjRotZ = Right1.ObjRotZ - 2
  921. If Rightsling = False and Right1.ObjRotZ < 20 then Right1.ObjRotZ = Right1.ObjRotZ + 2
  922. If Right1.ObjRotZ <= 7 then Rightsling = False
  923. If Rightsling = True and Right2.ObjRotZ < 212.5 then Right2.ObjRotZ = Right2.ObjRotZ + 2
  924. If Rightsling = False and Right2.ObjRotZ > 199.5 then Right2.ObjRotZ = Right2.ObjRotZ - 2
  925. If Right2.ObjRotZ >= 212.5 then Rightsling = False
  926. If Rightsling = True and Right3.TransZ > -23 then Right3.TransZ = Right3.TransZ - 4
  927. If Rightsling = False and Right3.TransZ < -0 then Right3.TransZ = Right3.TransZ + 4
  928. If Right3.TransZ <= -23 then Rightsling = False
  929. End Sub
  930.  
  931. Sub RightSlingShot_Timer:Me.TimerEnabled = 0:Controller.Switch(27) = 0:End Sub
  932.  
  933. Sub Bumper1_Hit:fb1.State = 1:fb1a.State = 1:vpmTimer.PulseSw 30:PlaySound SoundFX("bumper1",DOFContactors):Bumper1.TimerEnabled = 1:End Sub
  934. Sub Bumper1_Timer:Bumper1.TimerEnabled = 0:fb1.State = 0:fb1a.State = 0:End Sub
  935.  
  936. Sub Bumper2_Hit:fb2.State = 1:fb2a.State = 1:vpmTimer.PulseSw 31:PlaySound SoundFX("bumper1",DOFContactors):Bumper2.TimerEnabled = 1:End Sub
  937. Sub Bumper2_Timer:Bumper2.TimerEnabled = 0:fb2.State = 0:fb2a.State = 0:End Sub
  938.  
  939. Sub Bumper3_Hit:fb3.State = 1:fb3a.State = 1:vpmTimer.PulseSw 32:PlaySound SoundFX("bumper1",DOFContactors):Bumper3.TimerEnabled = 1:End Sub
  940. Sub Bumper3_Timer:Bumper3.TimerEnabled = 0:fb3.State = 0:fb3a.State = 0:End Sub
  941.  
  942. 'Drains and Kickers
  943. Dim BallInPlay:BallInPlay = 0
  944.  
  945. Sub Drain_Hit
  946. PlaySound "Drain"
  947. bsTrough.AddBall Me
  948. Drain.TimerInterval = 200
  949. Drain.TimerEnabled = 1
  950. BallInPlay = BallInPlay - 1
  951. End Sub
  952.  
  953.  
  954. Sub Drain_Timer
  955. If GI_TroughCheck = 4 And LampState(13) = 0 Then
  956. GI_AllOff 0
  957. End If
  958. Drain.TimerEnabled = False
  959. End Sub
  960.  
  961. Sub BallRelease_UnHit(): GI_AllOn: BallInPlay = BallInPlay + 1:End Sub
  962.  
  963. Sub RLS_Timer()
  964. sw12p.RotX = -(sw12.currentangle) +90
  965. End Sub
  966.  
  967. '''*****************************************************************************************
  968. '''*freneticamnesic level nudge script, based on rascals nudge bobble with help from gtxjoe*
  969. '''* add timers and "Nudgebobble(keycode)" to left and right tilt keys to activate *
  970. '''*****************************************************************************************
  971. Dim keycode
  972. Dim bgcharctr:bgcharctr = 2
  973. Dim centerlocation:centerlocation = 90
  974. Dim bgdegree:bgdegree = 7 'move +/- 7 degrees
  975. Dim bgdurationctr:bgdurationctr = 0
  976.  
  977. Sub LevelT_Timer()
  978. Dim loopctr
  979. Level.RotAndTra7 = Level.RotAndTra7 + bgcharctr 'change rotation value by bgcharctr
  980. 'debug.print "Degrees: " & Level.RotAndTra7 & " Max degree offset: " & bgdegree & " Cycle count: " & bgdurationctr ''debug print
  981. If Level.RotAndTra7 >= bgdegree + centerlocation then bgcharctr = -1:bgdurationctr = bgdurationctr + 1 'if level moves past max degrees, change direction and increate durationctr
  982. If Level.RotAndTra7 <= -bgdegree + centerlocation then bgcharctr = 1 'if level moves past min location, change direction
  983. If bgdurationctr = 4 then bgdegree = bgdegree - 2:bgdurationctr = 0 'if level has moved back and forth 5 times, decrease amount of movement by -2 and repeat by resetting durationctr
  984. If bgdegree <= 0 then LevelT.Enabled = False:bgdegree = 7 'if amount of movement is 0, turn off LevelT timer and reset movement back to max 7 degrees
  985. End Sub
  986.  
  987.  
  988. Sub Nudgebobble(keycode)
  989. If keycode = LeftTiltKey then bgcharctr = -1 'if nudge left, move in - direction
  990. If keycode = RightTiltKey then bgcharctr = 1 'if nudge right, move in + direction
  991. If keycode = CenterTiltKey then 'if nudge center, generate random number 1 or 2. If 1 change it to -2. use this number for initial direction
  992. Dim randombobble:randombobble = Int(2 * Rnd + 1)
  993. If randombobble = 1 then randombobble = -2
  994. bgcharctr = randombobble
  995. End If
  996. LevelT.Enabled = True:bgdurationctr = 0:bgdegree = 7
  997. End Sub
  998.  
  999. Sub bobblesome_Timer() 'This looks like a free running timer that 1 out of ten times will start movement
  1000. Dim chance
  1001. chance = Int(10*Rnd+1)
  1002. If chance = 5 then Nudgebobble(CenterTiltKey)
  1003. End Sub
  1004.  
  1005. '*******************************************************************************************
  1006.  
  1007. Sub SolKickBack(enabled)
  1008. if enabled then
  1009. if VengeanceDisable = 0 Then vengeancekb.Enabled = True
  1010. 'VengeanceHit 1
  1011. 'debug.print timer & " :solkickback"
  1012. else
  1013.  
  1014. End if
  1015. End Sub
  1016.  
  1017. Sub Vengeancekb_Hit()
  1018. 'debug.print timer & " :vkicker hit"
  1019. Vengeancekb.kick 175, 40
  1020. Vengeancekb.Enabled = False
  1021. PlaySound SoundFX("ballhit",DOFContactors)
  1022. End Sub
  1023.  
  1024. Dim aBall, aZpos
  1025.  
  1026. Sub Kicker3a_Hit
  1027. Set aBall = ActiveBall
  1028. aZpos = 50
  1029. kicker3a.TimerInterval = 2
  1030. kicker3a.TimerEnabled = 1
  1031. Controller.Switch(10) = 1
  1032. playsound "warehousehit"
  1033. End Sub
  1034.  
  1035. Sub Kicker3a_Timer
  1036. aBall.Z = aZpos
  1037. aZpos = aZpos-2
  1038. If aZpos <0 Then
  1039. kicker3a.TimerEnabled = 0
  1040. kicker3a.DestroyBall
  1041. 'bsRHole.AddBall Me
  1042. kicker3.CreateBall
  1043. kicker3a.Enabled = 0
  1044. unhittimer.Enabled = 1
  1045. End If
  1046. End Sub
  1047.  
  1048. Sub unhittimer_timer
  1049. 'Controller.Switch(10) = 0
  1050. unhittimer.enabled = 0
  1051. End Sub
  1052.  
  1053. Sub k3trig_hit
  1054. Kicker3a.enabled = 1
  1055. end sub
  1056.  
  1057. Sub k3trig_unHit
  1058. BallInPlunger = 0
  1059. End Sub
  1060.  
  1061. Sub sw1_Hit:Me.TimerEnabled = 1:Controller.Switch(1) = 1:PlaySound "rollover":End Sub
  1062. Sub sw1_Timer:Me.TimerEnabled = 0:Controller.Switch(1) = 0:End Sub
  1063. Sub sw2_Hit:Me.TimerEnabled = 1:Controller.Switch(2) = 1:PlaySound "rollover":End Sub
  1064. Sub sw2_Timer:Me.TimerEnabled = 0:Controller.Switch(2) = 0:End Sub
  1065. Sub sw4_Hit:Me.TimerEnabled = 1:Controller.Switch(4) = 1:PlaySound "rollover":End Sub
  1066. Sub sw4_Timer:Me.TimerEnabled = 0:Controller.Switch(4) = 0:End Sub
  1067.  
  1068. Sub sw7_Hit : vpmTimer.PulseSw 7:sw7.TimerEnabled = 1:sw7p.TransX = -4: playsound SoundFX("target",DOFTargets): End Sub
  1069. Sub sw7_Timer:Me.TimerEnabled = 0:sw7p.TransX = 0:End Sub
  1070. Sub sw8_Hit : vpmTimer.PulseSw 8:sw8.TimerEnabled = 1:sw8p.TransX = -4: playsound SoundFX("target",DOFTargets): End Sub
  1071. Sub sw8_Timer:Me.TimerEnabled = 0:sw8p.TransX = 0:End Sub
  1072. Sub sw9_Hit : vpmTimer.PulseSw 9:sw9.TimerEnabled = 1:sw9p.TransX = -4: playsound SoundFX("target",DOFTargets): End Sub
  1073. Sub sw9_Timer:Me.TimerEnabled = 0:sw9p.TransX = 0:End Sub
  1074.  
  1075. 'Sub sw11_Hit : dtSingle.Hit 1:VengeanceHit 1:GI_AllOff 1000: End Sub
  1076. Sub sw11_Hit : dtSingle.Hit 1:GI_AllOff 1000:End Sub
  1077.  
  1078. Sub sw11t_Timer()
  1079. sw11back.isdropped = sw11.isdropped
  1080. End Sub
  1081.  
  1082. Sub sw12_Spin:vpmTimer.PulseSw 12:PlaySound "spinner":End Sub 'left loop spinner
  1083.  
  1084. Sub sw13_Hit:Me.TimerEnabled = 1:Controller.Switch(13) = 1:End Sub
  1085. Sub sw13_Timer:Me.TimerEnabled = 0:Controller.Switch(13) = 0:End Sub
  1086. Sub sw14_Hit:Me.TimerEnabled = 1:Controller.Switch(14) = 1:opto2.opacity = 0:OptoOnT.Enabled = 0:End Sub
  1087. Sub sw14_Timer:Me.TimerEnabled = 0:Controller.Switch(14) = 0:opto2.opacity = 1000:OptoOnT.Enabled = 1:End Sub
  1088.  
  1089. Dim BallInPlunger:BallInPlunger = False
  1090. Sub sw23_Hit:Controller.Switch(23) = 1:BallInPlunger = True:PlaySound "rollover":End Sub
  1091. Sub sw23_unHit:BallInPlunger = False:Controller.Switch(23) = 0:End Sub
  1092.  
  1093. Sub sw24_Hit:Me.TimerEnabled = 1:Controller.Switch(24) = 1:PlaySound "rollover":End Sub
  1094. Sub sw24_Timer:Me.TimerEnabled = 0:Controller.Switch(24) = 0:End Sub
  1095. Sub sw25_Hit:Me.TimerEnabled = 1:Controller.Switch(25) = 1:PlaySound "rollover":End Sub
  1096. Sub sw25_Timer:Me.TimerEnabled = 0:Controller.Switch(25) = 0:End Sub
  1097. Sub sw28_Hit:Me.TimerEnabled = 1:Controller.Switch(28) = 1:PlaySound "rollover":End Sub
  1098. Sub sw28_Timer:Me.TimerEnabled = 0:Controller.Switch(28) = 0:End Sub
  1099. Sub sw29_Hit:Me.TimerEnabled = 1:Controller.Switch(29) = 1:PlaySound "rollover":End Sub
  1100. Sub sw29_Timer:Me.TimerEnabled = 0:Controller.Switch(29) = 0:End Sub
  1101.  
  1102. Sub sw33_Hit:Controller.Switch(33) = 1:opto9.opacity = 0:OptoOnT.Enabled = 0:End Sub
  1103. Sub sw33_unHit:Controller.Switch(33) = 0:opto9.opacity = 1000:OptoOnT.Enabled = 1:End Sub
  1104. Sub sw34_Hit:Me.TimerEnabled = 1:Controller.Switch(34) = 1:opto11.opacity = 0:OptoOnT.Enabled = 0:End Sub
  1105. Sub sw34_Timer:Me.TimerEnabled = 0:Controller.Switch(34) = 0:opto11.opacity = 1000:OptoOnT.Enabled = 1:End Sub
  1106.  
  1107. Sub sw35_Hit:Me.TimerEnabled = 1:Controller.Switch(35) = 1:opto3.opacity = 0:OptoOnT.Enabled = 0:End Sub
  1108. Sub sw35_Timer:Me.TimerEnabled = 0:Controller.Switch(35) = 0:opto3.opacity = 1000:OptoOnT.Enabled = 1:End Sub
  1109.  
  1110. Sub sw36_Hit:Me.TimerEnabled = 1:Controller.Switch(36) = 1:End Sub
  1111. Sub sw36_Timer:Me.TimerEnabled = 0:Controller.Switch(36) = 0:End Sub
  1112. Sub sw37_Hit:Me.TimerEnabled = 1:Controller.Switch(37) = 1:opto6.opacity = 0:OptoOnT.Enabled = 0:End Sub
  1113. Sub sw37_Timer:Me.TimerEnabled = 0:Controller.Switch(37) = 0:opto6.opacity = 1000:OptoOnT.Enabled = 1:End Sub
  1114. Sub sw38_Hit:Me.TimerEnabled = 1:Controller.Switch(38) = 1:opto7.opacity = 0:OptoOnT.Enabled = 0:End Sub
  1115. Sub sw38_Timer:Me.TimerEnabled = 0:Controller.Switch(38) = 0:opto7.opacity = 1000:OptoOnT.Enabled = 1:End Sub
  1116.  
  1117. Sub sw39_Hit : vpmTimer.PulseSw 39:sw39.TimerEnabled = 1:sw39p.TransX = -4: playsound SoundFX("target",DOFTargets): End Sub
  1118. Sub sw39_Timer:Me.TimerEnabled = 0:sw39p.TransX = 0:End Sub
  1119. Sub sw40_Hit : vpmTimer.PulseSw 40:sw40.TimerEnabled = 1:sw40p.TransX = -4: playsound SoundFX("target",DOFTargets): End Sub
  1120. Sub sw40_Timer:Me.TimerEnabled = 0:sw40p.TransX = 0:End Sub
  1121. Sub sw41_Hit : vpmTimer.PulseSw 41:sw41.TimerEnabled = 1:sw41p.TransX = -4: playsound SoundFX("target",DOFTargets): End Sub
  1122. Sub sw41_Timer:Me.TimerEnabled = 0:sw41p.TransX = 0:End Sub
  1123.  
  1124. Sub sw42_Hit : vpmTimer.PulseSw 42:sw42.TimerEnabled = 1:sw42p.TransX = -4: playsound SoundFX("target",DOFTargets): End Sub
  1125. Sub sw42_Timer:Me.TimerEnabled = 0:sw42p.TransX = 0:End Sub
  1126. Sub sw43_Hit : vpmTimer.PulseSw 43:sw43.TimerEnabled = 1:sw43p.TransX = -4: playsound SoundFX("target",DOFTargets): End Sub
  1127. Sub sw43_Timer:Me.TimerEnabled = 0:sw43p.TransX = 0:End Sub
  1128.  
  1129. Sub sw44_Hit:Me.TimerEnabled = 1:Controller.Switch(44) = 1:PlaySound "rollover":End Sub
  1130. Sub sw44_Timer:Me.TimerEnabled = 0:Controller.Switch(44) = 0:End Sub
  1131.  
  1132. Sub sw45_Hit : vpmTimer.PulseSw 45:sw45.TimerEnabled = 1:sw45p.TransX = -4: playsound SoundFX("target",DOFTargets): End Sub
  1133. Sub sw45_Timer:Me.TimerEnabled = 0:sw45p.TransX = 0:End Sub
  1134. Sub sw46_Hit : vpmTimer.PulseSw 46:sw46.TimerEnabled = 1:sw46p.TransX = -4: playsound SoundFX("target",DOFTargets): End Sub
  1135. Sub sw46_Timer:Me.TimerEnabled = 0:sw46p.TransX = 0:End Sub
  1136. Sub sw47_Hit : vpmTimer.PulseSw 47:sw47.TimerEnabled = 1:sw47p.TransX = -4: playsound SoundFX("target",DOFTargets): End Sub
  1137. Sub sw47_Timer:Me.TimerEnabled = 0:sw47p.TransX = 0:End Sub
  1138. Sub sw48_Hit : vpmTimer.PulseSw 48:sw48.TimerEnabled = 1:sw48p.TransX = -4: playsound SoundFX("target",DOFTargets): End Sub
  1139. Sub sw48_Timer:Me.TimerEnabled = 0:sw48p.TransX = 0:End Sub
  1140. Sub sw49_Hit : vpmTimer.PulseSw 49:sw49.TimerEnabled = 1:sw49p.TransX = -4: playsound SoundFX("target",DOFTargets): End Sub
  1141. Sub sw49_Timer:Me.TimerEnabled = 0:sw49p.TransX = 0:End Sub
  1142. Sub sw50_Hit : vpmTimer.PulseSw 50:sw50.TimerEnabled = 1:sw50p.TransX = -4: playsound SoundFX("target",DOFTargets): End Sub
  1143. Sub sw50_Timer:Me.TimerEnabled = 0:sw50p.TransX = 0:End Sub
  1144.  
  1145. Sub sw51_Hit:Me.TimerEnabled = 1:Controller.Switch(51) = 1:PlaySound "rollover":End Sub
  1146. Sub sw51_Timer:Me.TimerEnabled = 0:Controller.Switch(51) = 0:End Sub
  1147. Sub sw52_Hit:Me.TimerEnabled = 1:Controller.Switch(52) = 1:PlaySound "rollover":End Sub
  1148. Sub sw52_Timer:Me.TimerEnabled = 0:Controller.Switch(52) = 0:End Sub
  1149.  
  1150. Dim lastRGBDofColor
  1151.  
  1152. Sub StarfleetRGBs_Timer()
  1153.  
  1154. SetRGBLamp l1, Lampstate(84),Lampstate(85),Lampstate(86)
  1155. SetRGBLamp l2, Lampstate(81),Lampstate(87),Lampstate(88)
  1156. SetRGBLamp l3, Lampstate(83),Lampstate(82),Lampstate(89)
  1157. SetRGBLamp l4, Lampstate(92),Lampstate(91),Lampstate(90)
  1158. SetRGBLamp l5, Lampstate(93),Lampstate(94),Lampstate(95)
  1159. SetRGBLamp l6, Lampstate(96),Lampstate(97),Lampstate(98)
  1160. SetRGBLamp l7, Lampstate(99),Lampstate(100),Lampstate(101)
  1161. SetRGBLamp l8, Lampstate(102),Lampstate(103),Lampstate(104)
  1162. SetRGBLamp l9, Lampstate(113),Lampstate(114),Lampstate(115)
  1163. SetRGBLamp l10, Lampstate(116),Lampstate(117),Lampstate(118)
  1164. SetRGBLamp l11, Lampstate(119),Lampstate(120),Lampstate(121)
  1165. SetRGBLamp l12, Lampstate(122),Lampstate(123),Lampstate(124)
  1166. SetRGBLamp l13, Lampstate(125),Lampstate(126),Lampstate(127)
  1167. SetRGBLamp l14, Lampstate(128),Lampstate(129),Lampstate(130)
  1168. SetRGBLamp l15, Lampstate(131),Lampstate(133),Lampstate(132)
  1169. SetRGBLamp l16, Lampstate(134),Lampstate(136),Lampstate(135)
  1170. SetRGBLamp l17, Lampstate(146),Lampstate(147),Lampstate(148)
  1171. SetRGBLamp l18, Lampstate(149),Lampstate(150),Lampstate(151)
  1172. SetRGBLamp l19, Lampstate(152),Lampstate(153),Lampstate(154)
  1173. SetRGBLamp l20, Lampstate(155),Lampstate(156),Lampstate(157)
  1174. SetRGBLamp l21, Lampstate(158),Lampstate(159),Lampstate(160)
  1175. SetRGBLamp l22, Lampstate(161),Lampstate(162),Lampstate(163)
  1176. SetRGBLamp l23, Lampstate(164),Lampstate(165),Lampstate(166)
  1177. SetRGBLamp l24, Lampstate(167),Lampstate(168),Lampstate(169)
  1178. SetRGBLamp l25, Lampstate(170),Lampstate(171),Lampstate(172)
  1179. SetRGBLamp l26, Lampstate(179),Lampstate(177),Lampstate(178)
  1180. SetRGBLamp l27, Lampstate(182),Lampstate(180),Lampstate(181)
  1181. SetRGBLamp l28, Lampstate(185),Lampstate(183),Lampstate(184)
  1182. SetRGBLamp l29, Lampstate(186),Lampstate(187),Lampstate(188)
  1183. SetRGBLamp l30, Lampstate(189),Lampstate(190),Lampstate(191)
  1184. SetRGBLamp l31, Lampstate(192),Lampstate(193),Lampstate(194)
  1185. SetRGBLamp l32, Lampstate(195),Lampstate(197),Lampstate(196)
  1186. SetRGBLamp l33, Lampstate(198),Lampstate(200),Lampstate(199)
  1187. SetRGBLamp l34, Lampstate(214),Lampstate(215),Lampstate(216)
  1188. SetRGBLamp l35, Lampstate(211),Lampstate(217),Lampstate(218)
  1189. SetRGBLamp l36, Lampstate(213),Lampstate(212),Lampstate(219)
  1190. SetRGBLamp l37, Lampstate(222),Lampstate(221),Lampstate(220)
  1191. SetRGBLamp l38, Lampstate(223),Lampstate(224),Lampstate(225)
  1192. SetRGBLamp l39, Lampstate(226),Lampstate(227),Lampstate(228)
  1193. SetRGBLamp l40, Lampstate(229),Lampstate(230),Lampstate(231)
  1194. SetRGBLamp l41, Lampstate(232),Lampstate(233),Lampstate(234)
  1195. SetRGBLamp l42, Lampstate(235),Lampstate(236),Lampstate(237)
  1196. SetRGBLamp l43, Lampstate(238),Lampstate(239),Lampstate(240)
  1197. SetRGBLamp l44, Lampstate(241),Lampstate(242),Lampstate(243)
  1198. SetRGBLamp l45, Lampstate(244),Lampstate(245),Lampstate(246)
  1199. SetRGBLamp l46, Lampstate(247),Lampstate(248),Lampstate(249)
  1200. SetRGBLamp l47, Lampstate(250),Lampstate(251),Lampstate(252)
  1201. SetRGBLamp l48, Lampstate(253),Lampstate(254),Lampstate(255)
  1202. SetRGBLamp l49, Lampstate(256),Lampstate(257),Lampstate(258)
  1203. SetRGBLamp l52, Lampstate(278),Lampstate(279),Lampstate(280)
  1204. SetRGBLamp l53, Lampstate(281),Lampstate(283),Lampstate(282)
  1205. SetRGBLamp l54, Lampstate(284),Lampstate(286),Lampstate(285)
  1206. SetRGBLamp l55, Lampstate(287),Lampstate(289),Lampstate(288)
  1207. SetRGBLamp l58, Lampstate(308),Lampstate(309),Lampstate(310)
  1208. SetRGBLamp l59, Lampstate(311),Lampstate(312),Lampstate(313)
  1209. SetRGBLamp l60, Lampstate(314),Lampstate(315),Lampstate(316)
  1210. SetRGBLamp l61, Lampstate(317),Lampstate(319),Lampstate(318)
  1211. SetRGBLamp l62, Lampstate(320),Lampstate(322),Lampstate(321)
  1212. SetRGBLamp l63, Lampstate(300),Lampstate(302),Lampstate(301)
  1213. SetRGBLamp l64, Lampstate(303),Lampstate(305),Lampstate(304)
  1214.  
  1215. dim red, green, blue
  1216.  
  1217. if Lampstate(303) <> 0 or Lampstate(305) <> 0 or Lampstate(304) <> 0 Then
  1218. 'debug.print "R=" & Lampstate(303) & " G=" & Lampstate(305) & " B=" & Lampstate(304)
  1219. If Lampstate(303) <> 0 Then
  1220. If LampState(303) > 255 Then
  1221. red = 800
  1222. Else
  1223. red = 700
  1224. End If
  1225. Else
  1226. red = 600
  1227. End If
  1228.  
  1229. If Lampstate(305) <> 0 Then
  1230. If LampState(305) > 255 Then
  1231. green = 20
  1232. Else
  1233. green = 10
  1234. End If
  1235. Else
  1236. green = 0
  1237. End If
  1238.  
  1239. If Lampstate(304) <> 0 Then
  1240. If LampState(304) > 255 Then
  1241. blue = 2
  1242. Else
  1243. blue = 1
  1244. End If
  1245. Else
  1246. blue = 0
  1247. End If
  1248. end if
  1249.  
  1250.  
  1251. 'If LampState(84) > 0 or LampState(85) > 0 or LampState(86) > 0 then l1.Color=RGB(Lampstate(84),Lampstate(85),Lampstate(86)):l1.Colorfull=RGB(Lampstate(84),Lampstate(85),Lampstate(86)):l1.State = 1
  1252. 'If LampState(81) > 0 or LampState(87) > 0 or LampState(88) > 0 then l2.Color=RGB(Lampstate(81),Lampstate(87),Lampstate(88)):l2.Colorfull=RGB(Lampstate(81),Lampstate(87),Lampstate(88)):l2.State = 1
  1253. 'If LampState(82) > 0 or LampState(83) > 0 or LampState(89) > 0 then l3.Color=RGB(Lampstate(83),Lampstate(82),Lampstate(89)):l3.Colorfull=RGB(Lampstate(83),Lampstate(82),Lampstate(89)):l3.State = 1
  1254. 'If LampState(90) > 0 or LampState(91) > 0 or LampState(92) > 0 then l4.Color=RGB(Lampstate(92),Lampstate(91),Lampstate(90)):l4.Colorfull=RGB(Lampstate(92),Lampstate(91),Lampstate(90)):l4.State = 1
  1255. 'If LampState(93) > 0 or LampState(94) > 0 or LampState(95) > 0 then l5.Color=RGB(Lampstate(93),Lampstate(94),Lampstate(95)):l5.Colorfull=RGB(Lampstate(93),Lampstate(94),Lampstate(95)):l5.State = 1
  1256. 'If LampState(96) > 0 or LampState(97) > 0 or LampState(98) > 0 then l6.Color=RGB(Lampstate(96),Lampstate(97),Lampstate(98)):l6.Colorfull=RGB(Lampstate(96),Lampstate(97),Lampstate(98)):l6.State = 1
  1257. 'If LampState(99) > 0 or LampState(100) > 0 or LampState(101) > 0 then l7.Color=RGB(Lampstate(99),Lampstate(100),Lampstate(101)):l7.Colorfull=RGB(Lampstate(99),Lampstate(100),Lampstate(101)):l7.State = 1
  1258. 'If LampState(102) > 0 or LampState(103) > 0 or LampState(104) > 0 then l8.Color=RGB(Lampstate(102),Lampstate(103),Lampstate(104)):l8.Colorfull=RGB(Lampstate(102),Lampstate(103),Lampstate(104)):l8.State = 1
  1259. 'If LampState(113) > 0 or LampState(114) > 0 or LampState(115) > 0 then l9.Color=RGB(Lampstate(113),Lampstate(114),Lampstate(115)):l9.Colorfull=RGB(Lampstate(113),Lampstate(114),Lampstate(115)):l9.State = 1
  1260. 'If LampState(116) > 0 or LampState(117) > 0 or LampState(118) > 0 then l10.Color=RGB(Lampstate(116),Lampstate(117),Lampstate(118)):l10.Colorfull=RGB(Lampstate(116),Lampstate(117),Lampstate(118)):l10.State = 1
  1261. 'If LampState(119) > 0 or LampState(120) > 0 or LampState(121) > 0 then l11.Color=RGB(Lampstate(119),Lampstate(120),Lampstate(121)):l11.Colorfull=RGB(Lampstate(119),Lampstate(120),Lampstate(121)):l11.State = 1
  1262. 'If LampState(122) > 0 or LampState(123) > 0 or LampState(124) > 0 then l12.Color=RGB(Lampstate(122),Lampstate(123),Lampstate(124)):l12.Colorfull=RGB(Lampstate(122),Lampstate(123),Lampstate(124)):l12.State = 1
  1263. 'If LampState(125) > 0 or LampState(126) > 0 or LampState(127) > 0 then l13.Color=RGB(Lampstate(125),Lampstate(126),Lampstate(127)):l13.Colorfull=RGB(Lampstate(125),Lampstate(126),Lampstate(127)):l13.State = 1
  1264. 'If LampState(128) > 0 or LampState(129) > 0 or LampState(130) > 0 then l14.Color=RGB(Lampstate(128),Lampstate(129),Lampstate(130)):l14.Colorfull=RGB(Lampstate(128),Lampstate(129),Lampstate(130)):l14.State = 1
  1265. 'If LampState(131) > 0 or LampState(132) > 0 or LampState(133) > 0 then l15.Color=RGB(Lampstate(131),Lampstate(133),Lampstate(132)):l15.Colorfull=RGB(Lampstate(131),Lampstate(133),Lampstate(132)):l15.State = 1
  1266. 'If LampState(134) > 0 or LampState(135) > 0 or LampState(136) > 0 then l16.Color=RGB(Lampstate(134),Lampstate(136),Lampstate(135)):l16.Colorfull=RGB(Lampstate(134),Lampstate(136),Lampstate(135)):l16.State = 1
  1267. 'If LampState(146) > 0 or LampState(147) > 0 or LampState(148) > 0 then l17.Color=RGB(Lampstate(146),Lampstate(147),Lampstate(148)):l17.Colorfull=RGB(Lampstate(146),Lampstate(147),Lampstate(148)):l17.State = 1
  1268. 'If LampState(149) > 0 or LampState(150) > 0 or LampState(151) > 0 then l18.Color=RGB(Lampstate(149),Lampstate(150),Lampstate(151)):l18.Colorfull=RGB(Lampstate(149),Lampstate(150),Lampstate(151)):l18.State = 1
  1269. 'If LampState(152) > 0 or LampState(153) > 0 or LampState(154) > 0 then l19.Color=RGB(Lampstate(152),Lampstate(153),Lampstate(154)):l19.Colorfull=RGB(Lampstate(152),Lampstate(153),Lampstate(154)):l19.State = 1
  1270. 'If LampState(155) > 0 or LampState(156) > 0 or LampState(157) > 0 then l20.Color=RGB(Lampstate(155),Lampstate(156),Lampstate(157)):l20.Colorfull=RGB(Lampstate(155),Lampstate(156),Lampstate(157)):l20.State = 1
  1271. 'If LampState(158) > 0 or LampState(159) > 0 or LampState(160) > 0 then l21.Color=RGB(Lampstate(158),Lampstate(159),Lampstate(160)):l21.Colorfull=RGB(Lampstate(158),Lampstate(159),Lampstate(160)):l21.State = 1
  1272. 'If LampState(161) > 0 or LampState(162) > 0 or LampState(163) > 0 then l22.Color=RGB(Lampstate(161),Lampstate(162),Lampstate(163)):l22.Colorfull=RGB(Lampstate(161),Lampstate(162),Lampstate(163)):l22.State = 1
  1273. 'If LampState(164) > 0 or LampState(165) > 0 or LampState(166) > 0 then l23.Color=RGB(Lampstate(164),Lampstate(165),Lampstate(166)):l23.Colorfull=RGB(Lampstate(164),Lampstate(165),Lampstate(166)):l23.State = 1
  1274. 'If LampState(167) > 0 or LampState(168) > 0 or LampState(169) > 0 then l24.Color=RGB(Lampstate(167),Lampstate(168),Lampstate(169)):l24.Colorfull=RGB(Lampstate(167),Lampstate(168),Lampstate(169)):l24.State = 1
  1275. 'If LampState(170) > 0 or LampState(171) > 0 or LampState(172) > 0 then l25.Color=RGB(Lampstate(170),Lampstate(171),Lampstate(172)):l25.Colorfull=RGB(Lampstate(170),Lampstate(171),Lampstate(172)):l25.State = 1
  1276. 'If LampState(177) > 0 or LampState(178) > 0 or LampState(179) > 0 then l26.Color=RGB(Lampstate(179),Lampstate(177),Lampstate(178)):l26.Colorfull=RGB(Lampstate(179),Lampstate(177),Lampstate(178)):l26.State = 1
  1277. 'If LampState(180) > 0 or LampState(181) > 0 or LampState(182) > 0 then l27.Color=RGB(Lampstate(182),Lampstate(180),Lampstate(181)):l27.Colorfull=RGB(Lampstate(182),Lampstate(180),Lampstate(181)):l27.State = 1
  1278. 'If LampState(183) > 0 or LampState(184) > 0 or LampState(185) > 0 then l28.Color=RGB(Lampstate(185),Lampstate(183),Lampstate(184)):l28.Colorfull=RGB(Lampstate(185),Lampstate(183),Lampstate(184)):l28.State = 1
  1279. 'If LampState(186) > 0 or LampState(187) > 0 or LampState(188) > 0 then l29.Color=RGB(Lampstate(186),Lampstate(187),Lampstate(188)):l29.Colorfull=RGB(Lampstate(186),Lampstate(187),Lampstate(188)):l29.State = 1
  1280. 'If LampState(189) > 0 or LampState(190) > 0 or LampState(191) > 0 then l30.Color=RGB(Lampstate(189),Lampstate(190),Lampstate(191)):l30.Colorfull=RGB(Lampstate(189),Lampstate(190),Lampstate(191)):l30.State = 1
  1281. 'If LampState(192) > 0 or LampState(193) > 0 or LampState(194) > 0 then l31.Color=RGB(Lampstate(192),Lampstate(193),Lampstate(194)):l31.Colorfull=RGB(Lampstate(192),Lampstate(193),Lampstate(194)):l31.State = 1
  1282. 'If LampState(195) > 0 or LampState(196) > 0 or LampState(197) > 0 then l32.Color=RGB(Lampstate(195),Lampstate(197),Lampstate(196)):l32.Colorfull=RGB(Lampstate(195),Lampstate(197),Lampstate(196)):l32.State = 1
  1283. 'If LampState(198) > 0 or LampState(199) > 0 or LampState(200) > 0 then l33.Color=RGB(Lampstate(198),Lampstate(200),Lampstate(199)):l33.Colorfull=RGB(Lampstate(198),Lampstate(200),Lampstate(199)):l33.State = 1
  1284. 'If LampState(214) > 0 or LampState(215) > 0 or LampState(216) > 0 then l34.Color=RGB(Lampstate(214),Lampstate(215),Lampstate(216)):l34.Colorfull=RGB(Lampstate(214),Lampstate(215),Lampstate(216)):l34.State = 1
  1285. 'If LampState(211) > 0 or LampState(217) > 0 or LampState(218) > 0 then l35.Color=RGB(Lampstate(211),Lampstate(217),Lampstate(218)):l35.Colorfull=RGB(Lampstate(211),Lampstate(217),Lampstate(218)):l35.State = 1
  1286. 'If LampState(212) > 0 or LampState(213) > 0 or LampState(219) > 0 then l36.Color=RGB(Lampstate(213),Lampstate(212),Lampstate(219)):l36.Colorfull=RGB(Lampstate(213),Lampstate(212),Lampstate(219)):l36.State = 1
  1287. 'If LampState(220) > 0 or LampState(221) > 0 or LampState(222) > 0 then l37.Color=RGB(Lampstate(222),Lampstate(221),Lampstate(220)):l37.Colorfull=RGB(Lampstate(222),Lampstate(221),Lampstate(220)):l37.State = 1
  1288. 'If LampState(223) > 0 or LampState(224) > 0 or LampState(225) > 0 then l38.Color=RGB(Lampstate(223),Lampstate(224),Lampstate(225)):l38.Colorfull=RGB(Lampstate(223),Lampstate(224),Lampstate(225)):l38.State = 1
  1289. 'If LampState(226) > 0 or LampState(227) > 0 or LampState(228) > 0 then l39.Color=RGB(Lampstate(226),Lampstate(227),Lampstate(228)):l39.Colorfull=RGB(Lampstate(226),Lampstate(227),Lampstate(228)):l39.State = 1
  1290. 'If LampState(229) > 0 or LampState(230) > 0 or LampState(231) > 0 then l40.Color=RGB(Lampstate(229),Lampstate(230),Lampstate(231)):l40.Colorfull=RGB(Lampstate(229),Lampstate(230),Lampstate(231)):l40.State = 1
  1291. 'If LampState(232) > 0 or LampState(233) > 0 or LampState(234) > 0 then l41.Color=RGB(Lampstate(232),Lampstate(233),Lampstate(234)):l41.Colorfull=RGB(Lampstate(232),Lampstate(233),Lampstate(234)):l41.State = 1
  1292. 'If LampState(235) > 0 or LampState(236) > 0 or LampState(237) > 0 then l42.Color=RGB(Lampstate(235),Lampstate(236),Lampstate(237)):l42.Colorfull=RGB(Lampstate(235),Lampstate(236),Lampstate(237)):l42.State = 1
  1293. 'If LampState(238) > 0 or LampState(239) > 0 or LampState(240) > 0 then l43.Color=RGB(Lampstate(238),Lampstate(239),Lampstate(240)):l43.Colorfull=RGB(Lampstate(238),Lampstate(239),Lampstate(240)):l43.State = 1
  1294. 'If LampState(241) > 0 or LampState(242) > 0 or LampState(243) > 0 then l44.Color=RGB(Lampstate(241),Lampstate(242),Lampstate(243)):l44.Colorfull=RGB(Lampstate(241),Lampstate(242),Lampstate(243)):l44.State = 1
  1295. 'If LampState(244) > 0 or LampState(245) > 0 or LampState(246) > 0 then l45.Color=RGB(Lampstate(244),Lampstate(245),Lampstate(246)):l45.Colorfull=RGB(Lampstate(244),Lampstate(245),Lampstate(246)):l45.State = 1
  1296. 'If LampState(247) > 0 or LampState(248) > 0 or LampState(249) > 0 then l46.Color=RGB(Lampstate(247),Lampstate(248),Lampstate(249)):l46.Colorfull=RGB(Lampstate(247),Lampstate(248),Lampstate(249)):l46.State = 1
  1297. 'If LampState(250) > 0 or LampState(251) > 0 or LampState(252) > 0 then l47.Color=RGB(Lampstate(250),Lampstate(251),Lampstate(252)):l47.Colorfull=RGB(Lampstate(250),Lampstate(251),Lampstate(252)):l47.State = 1
  1298. 'If LampState(253) > 0 or LampState(254) > 0 or LampState(255) > 0 then l48.Color=RGB(Lampstate(253),Lampstate(254),Lampstate(255)):l48.Colorfull=RGB(Lampstate(253),Lampstate(254),Lampstate(255)):l48.State = 1
  1299. 'If LampState(256) > 0 or LampState(257) > 0 or LampState(258) > 0 then l49.Color=RGB(Lampstate(256),Lampstate(257),Lampstate(258)):l49.Colorfull=RGB(Lampstate(256),Lampstate(257),Lampstate(258)):l49.State = 1
  1300. 'If LampState(278) > 0 or LampState(279) > 0 or LampState(280) > 0 then l52.Color=RGB(Lampstate(278),Lampstate(279),Lampstate(280)):l52.Colorfull=RGB(Lampstate(278),Lampstate(279),Lampstate(280)):l52.State = 1
  1301. 'If LampState(281) > 0 or LampState(282) > 0 or LampState(283) > 0 then l53.Color=RGB(Lampstate(281),Lampstate(282),Lampstate(283)):l53.Colorfull=RGB(Lampstate(281),Lampstate(282),Lampstate(283)):l53.State = 1
  1302. 'If LampState(284) > 0 or LampState(285) > 0 or LampState(286) > 0 then l54.Color=RGB(Lampstate(284),Lampstate(285),Lampstate(286)):l54.Colorfull=RGB(Lampstate(284),Lampstate(285),Lampstate(286)):l54.State = 1
  1303. 'If LampState(287) > 0 or LampState(288) > 0 or LampState(289) > 0 then l55.Color=RGB(Lampstate(287),Lampstate(288),Lampstate(289)):l55.Colorfull=RGB(Lampstate(287),Lampstate(288),Lampstate(289)):l55.State = 1
  1304. 'If LampState(308) > 0 or LampState(309) > 0 or LampState(310) > 0 then l58.Color=RGB(Lampstate(308),Lampstate(309),Lampstate(310)):l58.Colorfull=RGB(Lampstate(308),Lampstate(309),Lampstate(310)):l58.State = 1
  1305. 'If LampState(311) > 0 or LampState(312) > 0 or LampState(313) > 0 then l59.Color=RGB(Lampstate(311),Lampstate(312),Lampstate(313)):l59.Colorfull=RGB(Lampstate(311),Lampstate(312),Lampstate(313)):l59.State = 1
  1306. 'If LampState(314) > 0 or LampState(315) > 0 or LampState(316) > 0 then l60.Color=RGB(Lampstate(314),Lampstate(315),Lampstate(316)):l60.Colorfull=RGB(Lampstate(314),Lampstate(315),Lampstate(316)):l60.State = 1
  1307. 'If LampState(317) > 0 or LampState(318) > 0 or LampState(319) > 0 then l61.Color=RGB(Lampstate(317),Lampstate(319),Lampstate(318)):l61.Colorfull=RGB(Lampstate(317),Lampstate(319),Lampstate(318)):l61.State = 1
  1308. 'If LampState(320) > 0 or LampState(321) > 0 or LampState(322) > 0 then l62.Color=RGB(Lampstate(320),Lampstate(322),Lampstate(321)):l62.Colorfull=RGB(Lampstate(320),Lampstate(322),Lampstate(321)):l62.State = 1
  1309. 'If LampState(300) > 0 or LampState(301) > 0 or LampState(302) > 0 then l63.Color=RGB(Lampstate(300),Lampstate(301),Lampstate(302)):l63.Colorfull=RGB(Lampstate(300),Lampstate(301),Lampstate(302)):l63.State = 1
  1310. 'If LampState(303) > 0 or LampState(304) > 0 or LampState(305) > 0 then l64.Color=RGB(Lampstate(303),Lampstate(304),Lampstate(305)):l64.Colorfull=RGB(Lampstate(303),Lampstate(304),Lampstate(305)):l64.State = 1
  1311. 'If LampState(84) = 0 and LampState(85) = 0 and LampState(86) = 0 then l1.State = 0
  1312. 'If LampState(81) = 0 and LampState(87) = 0 and LampState(88) = 0 then l2.State = 0
  1313. 'If LampState(82) = 0 and LampState(83) = 0 and LampState(89) = 0 then l3.State = 0
  1314. 'If LampState(90) = 0 and LampState(91) = 0 and LampState(92) = 0 then l4.State = 0
  1315. 'If LampState(93) = 0 and LampState(94) = 0 and LampState(95) = 0 then l5.State = 0
  1316. 'If LampState(96) = 0 and LampState(97) = 0 and LampState(98) = 0 then l6.State = 0
  1317. 'If LampState(99) = 0 and LampState(100) = 0 and LampState(101) = 0 then l7.State = 0
  1318. 'If LampState(102) = 0 and LampState(103) = 0 and LampState(104) = 0 then l8.State = 0
  1319. 'If LampState(113) = 0 and LampState(114) = 0 and LampState(115) = 0 then l9.State = 0
  1320. 'If LampState(116) = 0 and LampState(117) = 0 and LampState(118) = 0 then l10.State = 0
  1321. 'If LampState(119) = 0 and LampState(120) = 0 and LampState(121) = 0 then l11.State = 0
  1322. 'If LampState(122) = 0 and LampState(123) = 0 and LampState(124) = 0 then l12.State = 0
  1323. 'If LampState(125) = 0 and LampState(126) = 0 and LampState(127) = 0 then l13.State = 0
  1324. 'If LampState(128) = 0 and LampState(129) = 0 and LampState(130) = 0 then l14.State = 0
  1325. 'If LampState(131) = 0 and LampState(132) = 0 and LampState(133) = 0 then l15.State = 0
  1326. 'If LampState(134) = 0 and LampState(135) = 0 and LampState(136) = 0 then l16.State = 0
  1327. 'If LampState(146) = 0 and LampState(147) = 0 and LampState(148) = 0 then l17.State = 0
  1328. 'If LampState(149) = 0 and LampState(150) = 0 and LampState(151) = 0 then l18.State = 0
  1329. 'If LampState(152) = 0 and LampState(153) = 0 and LampState(154) = 0 then l19.State = 0
  1330. 'If LampState(155) = 0 and LampState(156) = 0 and LampState(157) = 0 then l20.State = 0
  1331. 'If LampState(158) = 0 and LampState(159) = 0 and LampState(160) = 0 then l21.State = 0
  1332. 'If LampState(161) = 0 and LampState(162) = 0 and LampState(163) = 0 then l22.State = 0
  1333. 'If LampState(164) = 0 and LampState(165) = 0 and LampState(166) = 0 then l23.State = 0
  1334. 'If LampState(167) = 0 and LampState(168) = 0 and LampState(169) = 0 then l24.State = 0
  1335. 'If LampState(170) = 0 and LampState(171) = 0 and LampState(172) = 0 then l25.State = 0
  1336. 'If LampState(177) = 0 and LampState(178) = 0 and LampState(179) = 0 then l26.State = 0
  1337. 'If LampState(180) = 0 and LampState(181) = 0 and LampState(182) = 0 then l27.State = 0
  1338. 'If LampState(183) = 0 and LampState(184) = 0 and LampState(185) = 0 then l28.State = 0
  1339. 'If LampState(186) = 0 and LampState(187) = 0 and LampState(188) = 0 then l29.State = 0
  1340. 'If LampState(189) = 0 and LampState(190) = 0 and LampState(191) = 0 then l30.State = 0
  1341. 'If LampState(192) = 0 and LampState(193) = 0 and LampState(194) = 0 then l31.State = 0
  1342. 'If LampState(195) = 0 and LampState(196) = 0 and LampState(197) = 0 then l32.State = 0
  1343. 'If LampState(198) = 0 and LampState(199) = 0 and LampState(200) = 0 then l33.State = 0
  1344. 'If LampState(214) = 0 and LampState(215) = 0 and LampState(216) = 0 then l34.State = 0
  1345. 'If LampState(211) = 0 and LampState(217) = 0 and LampState(218) = 0 then l35.State = 0
  1346. 'If LampState(212) = 0 and LampState(213) = 0 and LampState(219) = 0 then l36.State = 0
  1347. 'If LampState(220) = 0 and LampState(221) = 0 and LampState(222) = 0 then l37.State = 0
  1348. 'If LampState(223) = 0 and LampState(224) = 0 and LampState(225) = 0 then l38.State = 0
  1349. 'If LampState(226) = 0 and LampState(227) = 0 and LampState(228) = 0 then l39.State = 0
  1350. 'If LampState(229) = 0 and LampState(230) = 0 and LampState(231) = 0 then l40.State = 0
  1351. 'If LampState(232) = 0 and LampState(233) = 0 and LampState(234) = 0 then l41.State = 0
  1352. 'If LampState(235) = 0 and LampState(236) = 0 and LampState(237) = 0 then l42.State = 0
  1353. 'If LampState(238) = 0 and LampState(239) = 0 and LampState(240) = 0 then l43.State = 0
  1354. 'If LampState(241) = 0 and LampState(242) = 0 and LampState(243) = 0 then l44.State = 0
  1355. 'If LampState(244) = 0 and LampState(245) = 0 and LampState(246) = 0 then l45.State = 0
  1356. 'If LampState(247) = 0 and LampState(248) = 0 and LampState(249) = 0 then l46.State = 0
  1357. 'If LampState(250) = 0 and LampState(251) = 0 and LampState(252) = 0 then l47.State = 0
  1358. 'If LampState(253) = 0 and LampState(254) = 0 and LampState(255) = 0 then l48.State = 0
  1359. 'If LampState(256) = 0 and LampState(257) = 0 and LampState(258) = 0 then l49.State = 0
  1360. 'If LampState(278) = 0 and LampState(279) = 0 and LampState(280) = 0 then l52.State = 0
  1361. 'If LampState(281) = 0 and LampState(282) = 0 and LampState(283) = 0 then l53.State = 0
  1362. 'If LampState(284) = 0 and LampState(285) = 0 and LampState(286) = 0 then l54.State = 0
  1363. 'If LampState(287) = 0 and LampState(288) = 0 and LampState(289) = 0 then l55.State = 0
  1364. 'If LampState(308) = 0 and LampState(309) = 0 and LampState(310) = 0 then l58.State = 0
  1365. 'If LampState(311) = 0 and LampState(312) = 0 and LampState(313) = 0 then l59.State = 0
  1366. 'If LampState(314) = 0 and LampState(315) = 0 and LampState(316) = 0 then l60.State = 0
  1367. 'If LampState(317) = 0 and LampState(318) = 0 and LampState(319) = 0 then l61.State = 0
  1368. 'If LampState(320) = 0 and LampState(321) = 0 and LampState(322) = 0 then l62.State = 0
  1369. 'If LampState(300) = 0 and LampState(301) = 0 and LampState(302) = 0 then l63.State = 0
  1370. 'If LampState(303) = 0 and LampState(304) = 0 and LampState(305) = 0 then l64.State = 0
  1371. 'If LampState(78) = 0 then l66.State = 0
  1372. 'If LampState(77) = 0 then l67.State = 0
  1373. 'If LampState(76) = 0 then l68.State = 0
  1374. 'If LampState(78) > 0 then l66.State = 1
  1375. 'If LampState(77) > 0 then l67.State = 1
  1376. 'If LampState(76) > 0 then l68.State = 1
  1377. 'l80.state = LampState(277)
  1378. r53.Color = l53.Color
  1379. r54.Color = l54.Color
  1380. r55.Color = l55.Color
  1381. 'Light.color=RGB(r,g,b)
  1382. l80.Intensity = LampState(277) / 10
  1383. l50.Intensity = LampState(276) / 15
  1384. f80.Opacity = LampState(277) * 10
  1385. l50f.Opacity = LampState(276) * 1000
  1386. End Sub
  1387.  
  1388. 'RGBLamp 1, 84, 85, 86
  1389. 'Sub RGBLamp (MLamp, VPMLampR, VPMLampG, VPMLampB)
  1390. ' If ChgLamp(VPMLampR, 1) = 1 then RGBRed = 255 else RGBRed = 0
  1391. ' If ChgLamp(VPMLampG, 1) = 1 then RGBGreen = 255 else RGBGreen = 0
  1392. ' If ChgLamp(VPMLampB, 1) = 1 then RGBBlue = 255 else RGBBlue = 0
  1393. ' MLamp.color=RGB(RGBRed,RGBGreen,RGBBlue):MLamp.State = 1
  1394. '
  1395. ' 'MsgBox "Sub " & MyLight.Name & "_Timer : " & MyLight.name & ".State="& MyLight.name & ".UserValue: "& MyLight.name & ".TimerEnabled=False: End Sub"
  1396. ' ExecuteGlobal "Sub " & MLamp.Name & "_Timer : " & MLamp.name & ".State="& MLamp.name & ".UserValue: "& MLamp.name & ".TimerEnabled=False: End Sub"
  1397. 'End Sub
  1398.  
  1399. 'Dim RGBLamp(100)
  1400.  
  1401. Dim FadingLevel(360), FadingState(360)
  1402. Dim FlashState(360), FlashLevel(360)
  1403. Dim FlashSpeedUp, FlashSpeedDown
  1404. 'Dim x
  1405.  
  1406. 'AllLampsOff()
  1407. 'LampTimer.Interval = 35 'lamp fading speed
  1408. 'LampTimer.Enabled = 1
  1409. '
  1410. FlashInit()
  1411. FlasherTimer.Interval = 10 'flash fading speed
  1412. FlasherTimer.Enabled = 1
  1413.  
  1414. '' Lamp & Flasher Timers
  1415.  
  1416. 'Sub LampTimer_Timer()
  1417. ' Dim chgLamp, num, chg, ii
  1418. ' chgLamp = Controller.ChangedLamps
  1419. ' If Not IsEmpty(chgLamp) Then
  1420. ' For ii = 0 To UBound(chgLamp)
  1421. ' LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1)
  1422. ' FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4
  1423. ' FlashState(chgLamp(ii, 0) ) = chgLamp(ii, 1)
  1424.  
  1425. ' If GIColorMode = 1 and GI_Light.State = 1 Then 'If GI Color changing mode enabled and GI lights are on
  1426. ' Select Case chgLamp(ii, 0) 'Check if GI light needs to be changed
  1427. ' Case 9
  1428. ' If chgLamp(ii, 1) = 1 then red = 0:green = 0:blue = 255 : GISetDefaultColorTimer.enabled = 0: GISetDefaultColorTimer.enabled = 1
  1429. ' Case 15
  1430. ' If chgLamp(ii, 1) = 1 then red = 255:green = 0:blue = 0 : GISetDefaultColorTimer.enabled = 0: GISetDefaultColorTimer.enabled = 1
  1431. ' Case 10
  1432. ' If chgLamp(ii, 1) = 1 then red = 255:green = 255:blue = 0: GISetDefaultColorTimer.enabled = 0: GISetDefaultColorTimer.enabled = 1
  1433. ' Case 14
  1434. ' If chgLamp(ii, 1) = 1 then red = 0:green = 255:blue = 255 : GISetDefaultColorTimer.enabled = 0: GISetDefaultColorTimer.enabled = 1
  1435. ' Case 16
  1436. ' If chgLamp(ii, 1) = 1 then red = 128:green = 0:blue = 128: GISetDefaultColorTimer.enabled = 0: GISetDefaultColorTimer.enabled = 1
  1437. ' Case 11
  1438. ' If chgLamp(ii, 1) = 1 then red = 0:green = 255:blue = 0 : GISetDefaultColorTimer.enabled = 0: GISetDefaultColorTimer.enabled = 1
  1439. ' End Select
  1440. ' End If
  1441. ' If BallInPlunger = 0 Then 'if ball is not in plunger lane
  1442. ' Select Case chgLamp(ii, 0)
  1443. ' Case 3
  1444. ' If chgLamp(ii, 1) = 1 then FireButtonFlag = 1: FireButtonTimeoutTimer.Enabled= 0: FireButtonTimeoutTimer.Enabled = 1
  1445. ' End Select
  1446. ' End If
  1447. ' Next
  1448. ' End If
  1449. '
  1450. ' UpdateLamps
  1451. 'End
  1452.  
  1453. Dim LampState(400)
  1454. '
  1455. 'AllLampsOff()
  1456. 'LampTimer.Interval = 35
  1457. 'LampTimer.Enabled = 1
  1458. '
  1459. 'Sub LampTimer_Timer()
  1460. ' Dim chgLamp, ii
  1461. ' chgLamp = Controller.ChangedLamps
  1462. ' If Not IsEmpty(chgLamp) Then
  1463. ' For ii = 0 To UBound(chgLamp)
  1464. '
  1465. ' LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1)
  1466. '
  1467. ' 'Print Light state changes
  1468. ' debug.print "Lamp " & chgLamp(ii, 0) & ": " & chgLamp(ii, 1)
  1469. '
  1470. '
  1471. ' Next
  1472. ' End If
  1473. ' UpdateLamps
  1474. 'End Sub
  1475. '
  1476. 'Sub AllLampsOff()
  1477. ' On Error Resume Next
  1478. '
  1479. ' Dim x
  1480. ' For x = 0 to 360
  1481. ' LampState(x) = 0
  1482. ' Next
  1483. '
  1484. ' UpdateLamps:UpdateLamps:Updatelamps
  1485. 'End Sub
  1486. '
  1487. 'Sub SetLamp(nr, value)
  1488. ' If value <> LampState(nr) Then
  1489. ' LampState(nr) = abs(value)
  1490. ' End If
  1491. 'End Sub
  1492. '
  1493. Sub FireButtonTimeoutTimer_Timer
  1494. FireButtonFlag = 0
  1495. FireButtonTimeoutTimer.Enabled= 0
  1496. End Sub
  1497.  
  1498. GISetDefaultColorTimer.Interval = 1000
  1499. Sub GISetDefaultColorTimer_Timer 'If timer expires, no mode is running so set defaultGIcolor
  1500. If GI_Light.State = 1 Then
  1501. red = 0:green = 0:blue = 255
  1502. End If
  1503. GISetDefaultColorTimer.Enabled = 0
  1504. End Sub
  1505.  
  1506. Sub FlashInit
  1507. Dim i
  1508. For i = 0 to 200
  1509. FlashState(i) = 0
  1510. FlashLevel(i) = 0
  1511. Next
  1512.  
  1513. FlashSpeedUp = 50 ' fast speed when turning on the flasher
  1514. FlashSpeedDown = 35 ' slow speed when turning off the flasher, gives a smooth fading
  1515. AllFlashOff()
  1516. End Sub
  1517.  
  1518. Sub AllFlashOff
  1519. Dim i
  1520. For i = 0 to 360
  1521. FlashState(i) = 0
  1522. Next
  1523. End Sub
  1524.  
  1525. Sub Reflections_Timer()
  1526. If l53.State = 1 then r53.Opacity = 20 else r53.Opacity = 0
  1527. If l54.State = 1 then r54.Opacity = 20 else r54.Opacity = 0
  1528. If l55.State = 1 then r55.Opacity = 20 else r55.Opacity = 0
  1529. ' If f29.opacity = 0 then sw12p.image = "spinnert4"
  1530. ' If f29.opacity >= 1 and f29.opacity <= 20 then sw12p.image = "spinnert4_20"
  1531. ' If f29.opacity >= 21 and f29.opacity <= 40 then sw12p.image = "spinnert4_40"
  1532. ' If f29.opacity >= 41 and f29.opacity <= 60 then sw12p.image = "spinnert4_60"
  1533. ' If f29.opacity >= 61 and f29.opacity <= 80 then sw12p.image = "spinnert4_80"
  1534. ' If f29.opacity >= 81 then sw12p.image = "spinnert4_100"
  1535. End Sub
  1536.  
  1537. 'Dim LampState(400)
  1538.  
  1539. AllLampsOff()
  1540. LampTimer.Interval = 35
  1541. LampTimer.Enabled = 1
  1542.  
  1543. Sub LampTimer_Timer()
  1544. Dim chgLamp, ii
  1545. chgLamp = Controller.ChangedLamps
  1546. If Not IsEmpty(chgLamp) Then
  1547. For ii = 0 To UBound(chgLamp)
  1548.  
  1549. LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1) * 2
  1550.  
  1551. 'Print Light state changes
  1552. 'debug.print "Lamp " & chgLamp(ii, 0) & ": " & chgLamp(ii, 1)
  1553. 'LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1)
  1554. FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4
  1555. FlashState(chgLamp(ii, 0) ) = chgLamp(ii, 1)
  1556.  
  1557. If GIColorMode = 1 and GI_Light.State = 1 Then 'If GI Color changing mode enabled and GI lights are on
  1558. Select Case chgLamp(ii, 0) 'Check if GI light needs to be changed
  1559. Case 9
  1560. If chgLamp(ii, 1) = 1 then red = 0:green = 0:blue = 255 : GISetDefaultColorTimer.enabled = 0: GISetDefaultColorTimer.enabled = 1
  1561. Case 15
  1562. If chgLamp(ii, 1) = 1 then red = 255:green = 0:blue = 0 : GISetDefaultColorTimer.enabled = 0: GISetDefaultColorTimer.enabled = 1
  1563. Case 10
  1564. If chgLamp(ii, 1) = 1 then red = 255:green = 255:blue = 0: GISetDefaultColorTimer.enabled = 0: GISetDefaultColorTimer.enabled = 1
  1565. Case 14
  1566. If chgLamp(ii, 1) = 1 then red = 0:green = 255:blue = 255 : GISetDefaultColorTimer.enabled = 0: GISetDefaultColorTimer.enabled = 1
  1567. Case 16
  1568. If chgLamp(ii, 1) = 1 then red = 128:green = 0:blue = 128: GISetDefaultColorTimer.enabled = 0: GISetDefaultColorTimer.enabled = 1
  1569. Case 11
  1570. If chgLamp(ii, 1) = 1 then red = 0:green = 255:blue = 0 : GISetDefaultColorTimer.enabled = 0: GISetDefaultColorTimer.enabled = 1
  1571. End Select
  1572. End If
  1573. If BallInPlunger = 0 Then 'if ball is not in plunger lane
  1574. Select Case chgLamp(ii, 0)
  1575. Case 3
  1576. If chgLamp(ii, 1) = 1 then FireButtonFlag = 1: FireButtonTimeoutTimer.Enabled= 0: FireButtonTimeoutTimer.Enabled = 1
  1577. End Select
  1578. End If
  1579.  
  1580. Next
  1581. End If
  1582. UpdateLamps
  1583. End Sub
  1584.  
  1585. Sub AllLampsOff()
  1586. On Error Resume Next
  1587.  
  1588. Dim x
  1589. For x = 0 to 360
  1590. LampState(x) = 0
  1591. Next
  1592.  
  1593. UpdateLamps:UpdateLamps:Updatelamps
  1594. End Sub
  1595.  
  1596.  
  1597. Sub SetRGBLamp(Lamp, R, G, B)
  1598. 'dim IntensityValue
  1599. 'IntensityValue = .2126 * R + .7152 * G + .0722 * B
  1600. Lamp.Color = RGB(R, G, B)
  1601. Lamp.ColorFull = RGB(R, G, B)
  1602. 'Lamp.Intensity = IntensityValue *100 / 255
  1603. Lamp.State = 1
  1604. End Sub
  1605.  
  1606. 'Sub SetLamp(nr, value)
  1607. ' If value <> LampState(nr) Then
  1608. ' LampState(nr) = abs(value)
  1609. ' End If
  1610. 'End Sub
  1611.  
  1612. Sub UpdateLamps()
  1613. ' NFadeL 3, l3
  1614. ' NFadeL 4, l4
  1615. ' NFadeL 5, l5
  1616. ' NFadeL 7, l7
  1617. ' NFadeL 8, l8
  1618. ' NFadeL 9, l9
  1619. ' NFadeL 10, l10
  1620. ' NFadeL 11, l11
  1621. ' NFadeL 12, l12
  1622. ' NFadeL 13, l13
  1623. ' NFadeL 14, l14
  1624. ' NFadeL 15, l15
  1625. ' NFadeL 16, l16
  1626. ' NFadeL 17, l17
  1627. ' NFadeL 18, l18
  1628. ' NFadeL 19, l19
  1629. ' NFadeL 20, l20
  1630. ' NFadeL 21, l21
  1631. ' NFadeL 22, l22
  1632. ' NFadeL 23, l23
  1633. ' NFadeL 24, l24
  1634. ' NFadeL 32, l32
  1635. ' NFadeL 40, l40
  1636. ' NFadeL 48, l48
  1637. ' NFadeL 49, l49
  1638. ' NFadeL 50, l50
  1639. ' NFadeL 51, l51
  1640. ' NFadeL 52, l52
  1641. ' NFadeL 53, l53
  1642. ' NFadeL 54, l54
  1643. ' NFadeL 55, l55
  1644. ' NFadeL 56, l56
  1645. ' NFadeL 57, l57
  1646. ' NFadeL 59, l59
  1647. ' NFadeL 60, l60
  1648. ' NFadeL 61, l61
  1649. ' NFadeL 62, l62
  1650. ' NFadeL 63, l63
  1651. ' NFadeL 64, l64
  1652. ' NFadeL 65, l65
  1653. ' NFadeL 66, l66
  1654. ' NFadeL 67, l67
  1655. ' NFadeL 68, l68
  1656. ' NFadeL 69, l69
  1657. ' NFadeL 70, l70
  1658. ' NFadeL 71, l71
  1659. ' NFadeL 72, l72
  1660. ' NFadeL 73, l73
  1661. ' NFadeL 74, l74
  1662. ' NFadeL 75, l75
  1663. ' NFadeL 76, l76
  1664. NFadeLm 50, PhaseLE
  1665. NFadeL 50, PhaseRE
  1666. NFadeLm 51, PhaseL1
  1667. NFadeL 51, PhaseR1
  1668. NFadeLm 52, PhaseL2
  1669. NFadeL 52, PhaseR2
  1670. NFadeLm 53, PhaseL3
  1671. NFadeL 53, PhaseR3
  1672. NFadeLm 54, PhaseL4
  1673. NFadeL 54, PhaseR4
  1674. NFadeLm 55, PhaseL5
  1675. NFadeL 55, PhaseR5
  1676. NFadeLm 56, PhaseL6
  1677. NFadeL 56, PhaseR6
  1678. NFadeLm 57, PhaseL7
  1679. NFadeL 57, PhaseR7
  1680. NFadeLm 58, PhaseL8
  1681. NFadeL 58, PhaseR8
  1682. NFadeLm 59, PhaseL9
  1683. NFadeL 59, PhaseR9
  1684. NFadeLm 60, PhaseL10
  1685. NFadeL 60, PhaseR10
  1686. NFadeLm 61, PhaseL11
  1687. NFadeL 61, PhaseR11
  1688. NFadeLm 62, PhaseL12
  1689. NFadeL 62, PhaseR12
  1690. NFadeLm 63, PhaseL13
  1691. NFadeL 63, PhaseR13
  1692. NFadeLm 64, PhaseL14
  1693. NFadeL 64, PhaseR14
  1694. NFadeLm 65, PhaseL15
  1695. NFadeL 65, PhaseR15
  1696. NFadeLm 66, PhaseL16
  1697. NFadeL 66, PhaseR16
  1698. NFadeLm 67, PhaseL17
  1699. NFadeL 67, PhaseR17
  1700. NFadeLm 68, PhaseL18
  1701. NFadeL 68, PhaseR18
  1702. NFadeLm 69, PhaseL19
  1703. NFadeL 69, PhaseR19
  1704. NFadeLm 70, PhaseL20
  1705. NFadeL 70, PhaseR20
  1706. NFadeLm 71, PhaseL21
  1707. NFadeL 71, PhaseR21
  1708. NFadeLm 72, PhaseL22
  1709. NFadeL 72, PhaseR22
  1710. 'NFadeL 277, l80
  1711. NFadeL 358, f18
  1712. NFadeLm 339, f119a
  1713. NFadeLm 339, f119b
  1714. NFadeL 339, f119c
  1715. NFadeLm 340, f120a
  1716. NFadeLm 340, f120b
  1717. NFadeL 340, f120c
  1718. NFadeLm 349, f129a
  1719. NFadeL 349, Light42
  1720. 'NFadeL 276, l50
  1721. NFadeL 295, l70
  1722. NFadeL 292, l71
  1723. NFadeL 293, l72
  1724. NFadeL 294, l73
  1725. NFadeL 299, l74
  1726. NFadeL 296, l75
  1727. NFadeL 297, l76
  1728. NFadeL 298, l77
  1729. NFadeL 326, f26
  1730. NFadeL 357, f17
  1731. NFadeL 327, f27
  1732. NFadeL 332, f32
  1733. NFadeL 341, f41
  1734. NFadeLm 331, VengFlashGI
  1735. NFadeL 331, vengeancespot
  1736. NFadeL 328, f28
  1737. NFadeL 333, f23
  1738. NFadeL 342, f21
  1739. NFadeL 325, f25
  1740. NFadeL 330, f30
  1741. 'NFadeL 277, l80
  1742. End Sub
  1743.  
  1744. 'Sub FadePrim(nr, pri, a, b, c, d)
  1745. ' Select Case FadingLevel(nr)
  1746. ' Case 2:pri.image = d:FadingLevel(nr) = 0
  1747. ' Case 3:pri.image = c:FadingLevel(nr) = 1
  1748. ' Case 4:pri.image = b:FadingLevel(nr) = 2
  1749. ' Case 5:pri.image = a:FadingLevel(nr) = 3
  1750. ' End Select
  1751. 'End Sub
  1752. '
  1753. '''Lights
  1754. '
  1755. 'Sub FadeL(nr, a, b)
  1756. ' Select Case FadingLevel(nr)
  1757. ' Case 2:b.state = 0:FadingLevel(nr) = 0
  1758. ' Case 3:b.state = 1:FadingLevel(nr) = 2
  1759. ' Case 4:a.state = 0:FadingLevel(nr) = 3
  1760. ' Case 5:a.state = 1:FadingLevel(nr) = 1
  1761. ' End Select
  1762. 'End Sub
  1763. '
  1764. Sub NFadeL(nr, a)
  1765. Select Case FadingLevel(nr)
  1766. Case 4:a.state = 0:FadingLevel(nr) = 0
  1767. Case 5:a.State = 1:FadingLevel(nr) = 1
  1768. End Select
  1769. End Sub
  1770.  
  1771. Sub NFadeLm(nr, a)
  1772. Select Case FadingLevel(nr)
  1773. Case 4:a.state = 0
  1774. Case 5:a.State = 1
  1775. End Select
  1776. End Sub
  1777. '
  1778. '' Flasher objects
  1779. '' Uses own faster timer
  1780. '
  1781. Sub Flash(nr, object)
  1782. Select Case FlashState(nr)
  1783. Case 0 'off
  1784. FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown
  1785. If FlashLevel(nr) < 0 Then
  1786. FlashLevel(nr) = 0
  1787. FlashState(nr) = -1 'completely off
  1788. End if
  1789. Object.opacity = FlashLevel(nr)
  1790. Case 1 ' on
  1791. FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp
  1792. If FlashLevel(nr) > 1000 Then
  1793. FlashLevel(nr) = 1000
  1794. FlashState(nr) = -2 'completely on
  1795. End if
  1796. Object.opacity = FlashLevel(nr)
  1797. End Select
  1798. End Sub
  1799.  
  1800. Sub Flashm(nr, object) 'multiple flashers, it doesn't change the flashstate
  1801. Select Case FlashState(nr)
  1802. Case 0 'off
  1803. Object.opacity = FlashLevel(nr)
  1804. Case 1 ' on
  1805. Object.opacity = FlashLevel(nr)
  1806. End Select
  1807. End Sub
  1808.  
  1809. 'Sub AllLampsOff()On Error Resume Next:Dim x:For x = 0 to 360:LampState(x) = 0:FadingLevel(x) = 4:Next:UpdateLamps:UpdateLamps:Updatelamps:End Sub
  1810.  
  1811.  
  1812. Sub SetLamp(nr, value)
  1813. If value = 0 AND LampState(nr) = 0 Then Exit Sub
  1814. If value = 1 AND LampState(nr) = 1 Then Exit Sub
  1815. LampState(nr) = abs(value) + 4
  1816. FadingLevel(nr ) = abs(value) + 4: FadingState(nr ) = abs(value) + 4
  1817. End Sub
  1818.  
  1819. Sub SetFlash(nr, stat)
  1820. FlashState(nr) = ABS(stat)
  1821. End Sub
  1822. '
  1823. Sub FlasherTimer_Timer()
  1824. Flash 3, fire
  1825. '
  1826. Flash 277, f80
  1827. Flash 119, f119
  1828. Flash 120, f120 'right ramp flash
  1829. 'Flash 129, f29 'left loop / spinner flash
  1830. Flashm 331, f31 'vengeance flash
  1831.  
  1832. Flashm 50, FPhaseLE
  1833. Flash 50, FPhaseRE
  1834. Flashm 51, FPhaseL1
  1835. Flash 51, FPhaseR1
  1836. Flashm 52, FPhaseL2
  1837. Flash 52, FPhaseR2
  1838. Flashm 53, FPhaseL3
  1839. Flash 53, FPhaseR3
  1840. Flashm 54, FPhaseL4
  1841. Flash 54, FPhaseR4
  1842. Flashm 55, FPhaseL5
  1843. Flash 55, FPhaseR5
  1844. Flashm 56, FPhaseL6
  1845. Flash 56, FPhaseR6
  1846. Flashm 57, FPhaseL7
  1847. Flash 57, FPhaseR7
  1848. Flashm 58, FPhaseL8
  1849. Flash 58, FPhaseR8
  1850. Flashm 59, FPhaseL9
  1851. Flash 59, FPhaseR9
  1852. Flashm 60, FPhaseL10
  1853. Flash 60, FPhaseR10
  1854. Flashm 61, FPhaseL11
  1855. Flash 61, FPhaseR11
  1856. Flashm 62, FPhaseL12
  1857. Flash 62, FPhaseR12
  1858. Flashm 63, FPhaseL13
  1859. Flash 63, FPhaseR13
  1860. Flashm 64, FPhaseL14
  1861. Flash 64, FPhaseR14
  1862. Flashm 65, FPhaseL15
  1863. Flash 65, FPhaseR15
  1864. Flashm 66, FPhaseL16
  1865. Flash 66, FPhaseR16
  1866. Flashm 67, FPhaseL17
  1867. Flash 67, FPhaseR17
  1868. Flashm 68, FPhaseL18
  1869. Flash 68, FPhaseR18
  1870. Flashm 69, FPhaseL19
  1871. Flash 69, FPhaseR19
  1872. Flashm 70, FPhaseL20
  1873. Flash 70, FPhaseR20
  1874. Flashm 71, FPhaseL21
  1875. Flash 71, FPhaseR21
  1876. Flashm 72, FPhaseL22
  1877. Flash 72, FPhaseR22
  1878. 'Flash 276, l50f
  1879. Flash 332, f32f
  1880. Flash 341, f41f
  1881. Flash 325, f25f
  1882. 'Flash 277, f80
  1883. Flash 331, vengeancespotf
  1884. End Sub
  1885.  
  1886. Dim leftdrop:leftdrop = 0
  1887. Sub leftdrop1_Hit:leftdrop = 1:End Sub
  1888. Sub leftdrop2_Hit:
  1889. If leftdrop = 1 then
  1890. PlaySound "drop_left"
  1891. End If
  1892. 'StopSound "fx_metalrolling"
  1893. leftdrop = 0
  1894. End Sub
  1895.  
  1896. Dim rightdrop:rightdrop = 0
  1897. Sub rightdrop1_Hit:rightdrop = 1:End Sub
  1898. Sub rightdrop2_Hit
  1899. If rightdrop = 1 then
  1900. PlaySound "drop_Right"
  1901. End If
  1902. 'StopSound "fx_metalrolling"
  1903. rightdrop = 0
  1904. End Sub
  1905.  
  1906.  
  1907. Sub PrimT_Timer
  1908. If sw11.isdropped = true then sw11f.rotatetoend
  1909. if sw11.isdropped = false then sw11f.rotatetostart
  1910. sw11p.transy = sw11f.currentangle
  1911. End Sub
  1912.  
  1913.  
  1914. Sub Table_exit()
  1915. If B2SOnALT Then Controller.Stop
  1916. End Sub
  1917.  
  1918. 'VENGENANCE ANIMATION
  1919. dim vengeanceBall,xx
  1920. set vengeanceBall = kicker1.createball
  1921. kicker1.kick 0,0
  1922. Dim Mag1
  1923. Set mag1= New cvpmMagnet
  1924. With mag1
  1925. .InitMagnet vengeanceTrigger, 5
  1926. .GrabCenter = False
  1927. .CreateEvents "mag1"
  1928. .magnetOn = True
  1929. End With
  1930.  
  1931. Sub VengeanceHit (Vmove)
  1932. dim yy
  1933. 'debug.print vengeanceBall.x & ":" & vengeanceBall.y & ":" & vengeanceBall.z & ":"
  1934. vengeanceBall.vely = Vmove
  1935. yy = (rnd(1) - 0.5) * Vmove
  1936. vengeanceBall.velx = yy
  1937. VengeanceTimer.Enabled = 1:xx=0
  1938. Playsound "solenoidon"
  1939. End Sub
  1940.  
  1941.  
  1942. Sub VengeanceTimer_Timer
  1943. VengeancePrim.objrotX = (vengeanceBall.x - vengeanceTrigger.x) * 50
  1944. VengeancePrim.transY = (vengeanceBall.y - vengeanceTrigger.y) * 2
  1945. f31.RotX = VengeancePrim.objrotx
  1946. vengEL.objrotx = VengeancePrim.objrotx
  1947. xx = xx + 1
  1948. 'debug.print xx & "," & vengeanceball.y
  1949. if xx = 400 then VengeanceTimer.Enabled = 0
  1950. 'if f31.opacity > 1 then gate1.collidable = 0 and gate2.collidable = 0
  1951. 'if f31.opacity < 1 then gate1.collidable = 1 and gate2.collidable = 1
  1952.  
  1953. End Sub
  1954.  
  1955. Sub ShipTimer_Timer 'Test movement
  1956. VengeanceHit .5
  1957. End Sub
  1958.  
  1959.  
  1960. ''***** GI routines
  1961. '
  1962. Dim ballsavelight
  1963.  
  1964. Dim MultiballFlag
  1965.  
  1966.  
  1967. Sub GI_AllOff (time) 'Turn GI Off
  1968.  
  1969. PlayfieldGIOff
  1970. If time > 0 Then
  1971. GI_AllOnT.Interval = time
  1972. GI_AllOnT.Enabled = 0
  1973. GI_AllOnT.Enabled = 1
  1974. End If
  1975. Table.ColorGradeImage = "ColorGradeLUT256x16_1to1OFF"
  1976. End Sub
  1977.  
  1978. Sub GI_AllOn 'Turn GI On
  1979.  
  1980. PlayfieldGIOn
  1981.  
  1982. Table.ColorGradeImage = "ColorGradeLUT256x16_1to1usat"
  1983. End Sub
  1984.  
  1985. Sub GI_AllOnT_Timer 'Turn GI On timer
  1986.  
  1987. PlayfieldGIOn
  1988. GI_AllOnT.Enabled = 0
  1989. Table.ColorGradeImage = "ColorGradeLUT256x16_1to1usat"
  1990. End Sub
  1991.  
  1992. Function GI_TroughCheck
  1993. Dim Ballcount: Ballcount = 0
  1994. If Controller.Switch(18) = TRUE then Ballcount = Ballcount + 1
  1995. If Controller.Switch(19) = TRUE then Ballcount = Ballcount + 1
  1996. If Controller.Switch(20) = TRUE then Ballcount = Ballcount + 1
  1997. If Controller.Switch(21) = TRUE then Ballcount = Ballcount + 1
  1998. If Ballcount < 3 Then 'Keep track of multiball mode
  1999. MultiballFlag = 1
  2000. Else
  2001. MultiballFlag = 0
  2002. End If
  2003.  
  2004. GI_TroughCheck = Ballcount
  2005.  
  2006. 'debug.print "Troughcheck " & ballcount & " Multiball " & MultiballFlag
  2007.  
  2008. If ballcount = 4 then
  2009. GameOverTimerCheck.Enabled = 1 'no ball in play
  2010. 'debug.print timer & "Game Over?"
  2011. Else
  2012. GameOverTimerCheck.Enabled = 0 'ball in play
  2013. 'debug.print timer & "Game Not Over"
  2014. End If
  2015.  
  2016. End Function
  2017.  
  2018. GameOverTimerCheck.Interval = 30000
  2019.  
  2020. Sub GameOverTimerCheck_Timer
  2021. 'debug.print timer & "Game Over!"
  2022. If GIOnDuringAttractMode = 1 Then GI_AllOn
  2023. GameOverTimerCheck.Enabled = 0
  2024. End Sub
  2025.  
  2026. Sub PlayfieldGIOn
  2027. pframp.image = "stpf_on"
  2028. vengeanceprim.image = "vengeancefren"
  2029. GI_Light.State = 1
  2030. GI_LightOff.State = 0
  2031.  
  2032. sw48p.image = "black-hole-t1"
  2033. sw45p.image = "small-t1-on"
  2034. sw46p.image = "small-t1-on"
  2035. sw47p.image = "small-t1-on"
  2036. sw49p.image = "small-t1-on"
  2037. sw50p.image = "small-t1-on"
  2038. sw11p.image = "droptarget-on"
  2039. sw39p.image = "tri-t1-on"
  2040. sw40p.image = "ship-t1-on"
  2041. sw41p.image = "tri-t1-on"
  2042. sw7p.image = "phaser-t1-on"
  2043. sw8p.image = "biohazard-t1-on"
  2044. sw9p.image = "thing-t1-on"
  2045. sw42p.image = "enterprise-t1-on"
  2046. sw43p.image = "enterprise-t1-on"
  2047.  
  2048. dim bulb
  2049. for each bulb in GILighting
  2050. bulb.State = 1
  2051. next
  2052. End Sub
  2053.  
  2054. Dim red:red = 0
  2055. Dim green:green = 0
  2056. Dim blue:blue = 255
  2057.  
  2058. Sub ColorCheck_Timer 'Light.color=RGB(r,g,b)
  2059.  
  2060. dim bulb
  2061. for each bulb in GILighting
  2062. bulb.color=RGB(red,green,blue)
  2063. next
  2064.  
  2065. GI_Light.state = newlighttest76.state
  2066. f31.opacity = f31.opacity / 2
  2067. End Sub
  2068.  
  2069. Sub PlayfieldGIOff
  2070. pframp.image = "stpf"
  2071. vengeanceprim.image = "vengeancefrenoff"
  2072. GI_Light.State = 0
  2073. GI_LightOff.State = 1
  2074. 'If GIColorMode = 1 then ColorCheck.Enabled = 0
  2075. sw48p.image = "black-hole-t1off"
  2076. sw45p.image = "small-t1"
  2077. sw46p.image = "small-t1"
  2078. sw47p.image = "small-t1"
  2079. sw49p.image = "small-t1"
  2080. sw50p.image = "small-t1"
  2081. sw11p.image = "droptarget-off"
  2082. sw39p.image = "tri-t1-off"
  2083. sw40p.image = "ship-t1-off"
  2084. sw41p.image = "tri-t1-off"
  2085. sw7p.image = "phaser-t1-off"
  2086. sw8p.image = "biohazard-t1-off"
  2087. sw9p.image = "thing-t1-off"
  2088. sw42p.image = "enterprise-t1-off"
  2089. sw43p.image = "enterprise-t1-off"
  2090. dim bulb
  2091. for each bulb in GILighting
  2092. bulb.State = 0
  2093. next
  2094. End Sub
  2095.  
  2096.  
  2097. Sub OptoOnT_Timer
  2098. If BallInPlay >= 1 then
  2099. OptoOn
  2100. End If
  2101. If BallInPlay = 0 then
  2102. OptoOff
  2103. End If
  2104. End Sub
  2105.  
  2106. Sub OptoOn
  2107. opto1.opacity = 1000
  2108. opto2.opacity = 1000
  2109. opto3.opacity = 1000
  2110. opto4.opacity = 1000
  2111. opto5.opacity = 1000
  2112. opto6.opacity = 1000
  2113. opto7.opacity = 1000
  2114. opto8.opacity = 1000
  2115. opto9.opacity = 1000
  2116. opto10.opacity = 1000
  2117. opto11.opacity = 1000
  2118. opto12.opacity = 1000
  2119. End Sub
  2120.  
  2121. Sub OptoOff
  2122. opto1.opacity = 0
  2123. opto2.opacity = 0
  2124. opto3.opacity = 0
  2125. opto4.opacity = 0
  2126. opto5.opacity = 0
  2127. opto6.opacity = 0
  2128. opto7.opacity = 0
  2129. opto8.opacity = 0
  2130. opto9.opacity = 0
  2131. opto10.opacity = 0
  2132. opto11.opacity = 0
  2133. opto12.opacity = 0
  2134. End Sub
  2135.  
  2136. ' *********************************************************************
  2137. ' Supporting Ball & Sound Functions
  2138. ' *********************************************************************
  2139.  
  2140. Sub Pins_Hit (idx)
  2141. PlaySound "pinhit_low", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  2142. End Sub
  2143.  
  2144. Sub Targets_Hit (idx)
  2145. PlaySound "target", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
  2146. End Sub
  2147.  
  2148. Sub Metals_Thin_Hit (idx)
  2149. PlaySound "metalhit_thin", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  2150. End Sub
  2151.  
  2152. Sub Metals_Medium_Hit (idx)
  2153. PlaySound "metalhit_medium", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  2154. End Sub
  2155.  
  2156. Sub Metals2_Hit (idx)
  2157. PlaySound "metalhit2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  2158. End Sub
  2159.  
  2160. Sub Gates_Hit (idx)
  2161. PlaySound "gate4", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  2162. End Sub
  2163.  
  2164. Sub Spinner_Spin
  2165. PlaySound "fx_spinner",0,.25,0,0.25
  2166. End Sub
  2167.  
  2168. Sub Rubbers_Hit(idx)
  2169. dim finalspeed
  2170. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  2171. If finalspeed > 20 then
  2172. PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  2173. End if
  2174. If finalspeed >= 6 AND finalspeed <= 20 then
  2175. RandomSoundRubber()
  2176. End If
  2177. End Sub
  2178.  
  2179. Sub Posts_Hit(idx)
  2180. dim finalspeed
  2181. finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
  2182. If finalspeed > 16 then
  2183. PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  2184. End if
  2185. If finalspeed >= 6 AND finalspeed <= 16 then
  2186. RandomSoundRubber()
  2187. End If
  2188. End Sub
  2189.  
  2190. Sub RandomSoundRubber()
  2191. Select Case Int(Rnd*3)+1
  2192. Case 1 : PlaySound "rubber_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  2193. Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  2194. Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  2195. End Select
  2196. End Sub
  2197.  
  2198. Sub LeftFlipper_Collide(parm)
  2199. RandomSoundFlipper()
  2200. End Sub
  2201.  
  2202. Sub RightFlipper_Collide(parm)
  2203. RandomSoundFlipper()
  2204. End Sub
  2205.  
  2206. Sub RandomSoundFlipper()
  2207. Select Case Int(Rnd*3)+1
  2208. Case 1 : PlaySound "flip_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  2209. Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  2210. Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
  2211. End Select
  2212. End Sub
  2213.  
  2214.  
  2215.  
  2216. Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
  2217. Vol = Csng(BallVel(ball) ^2 / 100)
  2218. End Function
  2219.  
  2220. Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
  2221. Dim tmp
  2222. tmp = ball.x * 2 / table.width-1
  2223. If tmp > 0 Then
  2224. Pan = Csng(tmp ^10)
  2225. Else
  2226. Pan = Csng(-((- tmp) ^10) )
  2227. End If
  2228. End Function
  2229.  
  2230. Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
  2231. Pitch = BallVel(ball) * 20
  2232. End Function
  2233.  
  2234. Function BallVel(ball) 'Calculates the ball speed
  2235. BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
  2236. End Function
  2237.  
  2238. '*****************************************
  2239. ' JP's VP10 Rolling Sounds
  2240. '*****************************************
  2241.  
  2242. Const tnob = 10 ' total number of balls
  2243. ReDim rolling(tnob)
  2244. InitRolling
  2245.  
  2246. Sub InitRolling
  2247. Dim i
  2248. For i = 0 to tnob
  2249. rolling(i) = False
  2250. Next
  2251. End Sub
  2252.  
  2253. Sub RollingTimer_Timer()
  2254. Dim BOT, b
  2255. BOT = GetBalls
  2256.  
  2257. ' stop the sound of deleted balls
  2258. For b = UBound(BOT) + 1 to tnob
  2259. rolling(b) = False
  2260. StopSound("fx_ballrolling" & b)
  2261. Next
  2262.  
  2263. ' exit the sub if no balls on the table
  2264. If UBound(BOT) = -1 Then Exit Sub
  2265.  
  2266. ' play the rolling sound for each ball
  2267. For b = 0 to UBound(BOT)
  2268. If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 AND BOT(b).z > 0 Then
  2269. rolling(b) = True
  2270. PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
  2271. Else
  2272. If rolling(b) = True Then
  2273. StopSound("fx_ballrolling" & b)
  2274. rolling(b) = False
  2275. End If
  2276. End If
  2277. Next
  2278. End Sub
  2279.  
  2280. '**********************
  2281. ' Ball Collision Sound
  2282. '**********************
  2283.  
  2284. Sub OnBallBallCollision(ball1, ball2, velocity)
  2285. PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
  2286. End Sub
  2287.  
  2288.  
  2289. 'LETS MOVE SOME FUCKIN LIGHTS LIKE A DISCO YEEEEEA!
  2290. 'stolen from gtxjoe, with credit
  2291.  
  2292. ' ***** EXAMPLE 1 *****
  2293. 'Const length1offset = 350 'from pivot point
  2294. 'Const height1offset = 25 'from pivot point
  2295. 'Const length2offset = 305 'from pivot point
  2296. 'Const height2offset = 25 'from pivot point
  2297. Const angleXYStart = 0
  2298. Const angleXYStop = 50
  2299. Const angleZ = 45
  2300. Const stepSize = .5
  2301.  
  2302. 'dim angle, dir, angleXYoffset
  2303. 'angleXYoffset = atn(height1offset/length1offset) * 180/3.14159265359
  2304. 'angle = angleXYStart
  2305. 'dir = stepSize
  2306. 'timer1.interval = 30
  2307. 'Sub timer1_timer
  2308. ' 'Set new angle
  2309. ' angle = angle + 1 * dir
  2310. '
  2311. ' 'Set direction
  2312. ' if angle => angleXYStop then
  2313. ' dir = -1 * dir
  2314. ' elseif Angle =< angleXYStart then
  2315. ' dir = -1 * dir
  2316. ' end if
  2317. '
  2318. ' 'Move primitive
  2319. ' 'Primitive1.Roty = angle
  2320. ' 'Primitive1.ObjRotz = angleZ + 180
  2321. '
  2322. '' 'Move ball
  2323. ' 'calcXYZ light1, light1Pos, length1offset, angle + angleXYOffset, angleZ
  2324. ' 'calcXYZ ball2, ball2Pos, length2offset, angle + angleXYOffset, angleZ
  2325. 'End sub
  2326.  
  2327.  
  2328. ' ***** EXAMPLE 2 *****
  2329. Const length1offset = 250
  2330. Const length2offset = 120
  2331. Const length3offset = 190
  2332. Const length4offset = 160
  2333. Const length5offset = 100
  2334. Const length6offset = 250
  2335. Const length7offset = 120
  2336. Const length8offset = 165
  2337. Const length9offset = 180
  2338. Const length10offset = 111
  2339. Const length11offset = 146
  2340. Const length12offset = 216
  2341. Const length13offset = 129
  2342. Const length14offset = 172
  2343. Const length15offset = 215
  2344. Const length16offset = 236
  2345. Const length17offset = 200
  2346. Const length18offset = 167
  2347. Const length19offset = 203
  2348. Const length20offset = 240
  2349. Const length21offset = 250
  2350. Const length22offset = 120
  2351. Const length23offset = 190
  2352. Const length24offset = 160
  2353. Const length25offset = 100
  2354. Const length26offset = 250
  2355. Const length27offset = 120
  2356. Const length28offset = 165
  2357. Const length29offset = 180
  2358. Const length30offset = 111
  2359. Const length31offset = 146
  2360. Const length32offset = 216
  2361. Const length33offset = 129
  2362. Const length34offset = 172
  2363. Const length35offset = 215
  2364. Const length36offset = 236
  2365. Const length37offset = 200
  2366. Const length38offset = 167
  2367. Const length39offset = 203
  2368. Const length40offset = 240
  2369. Const length41offset = 146
  2370. Const length42offset = 180
  2371. Const length43offset = 173
  2372. Const length44offset = 133
  2373. Const length45offset = 134
  2374. Const length46offset = 199
  2375. Const length47offset = 184
  2376. Const length48offset = 201
  2377. Const length49offset = 217
  2378. Const length50offset = 175
  2379. Const length51offset = 175
  2380. Const length52offset = 197
  2381. Const length53offset = 201
  2382. Const length54offset = 130
  2383. Const length55offset = 209
  2384. Const length56offset = 123
  2385. Const length57offset = 215
  2386. Const length58offset = 149
  2387. Const length59offset = 129
  2388. Const length60offset = 201
  2389. Const length61offset = 160
  2390. Const length62offset = 219
  2391. Const length63offset = 145
  2392. Const length64offset = 159
  2393. Const length65offset = 121
  2394. Const length66offset = 179
  2395. Const length67offset = 118
  2396. Const length68offset = 149
  2397. Const length69offset = 113
  2398. Const length70offset = 208
  2399. Const length71offset = 204
  2400. Const length72offset = 200
  2401. Const length73offset = 214
  2402. Const length74offset = 136
  2403. Const length75offset = 153
  2404. Const length76offset = 119
  2405. Const length77offset = 151
  2406. Const length78offset = 116
  2407. Const length79offset = 187
  2408. Const length80offset = 118
  2409. Const length81offset = 174
  2410. Const length82offset = 145
  2411. Const length83offset = 102
  2412. Const length84offset = 217
  2413. Const length85offset = 169
  2414. Const length86offset = 136
  2415. Const length87offset = 220
  2416. Const length88offset = 181
  2417. Const length89offset = 153
  2418. Const length90offset = 138
  2419. Const length91offset = 124
  2420. Const length92offset = 134
  2421. Const length93offset = 131
  2422. Const length94offset = 156
  2423. Const length95offset = 189
  2424. Const length96offset = 144
  2425. Const length97offset = 179
  2426. Const length98offset = 178
  2427. Const length99offset = 212
  2428. Const length100offset = 124
  2429. Const length101offset = 118
  2430. Const length102offset = 198
  2431. Const length103offset = 119
  2432. Const length104offset = 122
  2433. Const length105offset = 118
  2434. Const length106offset = 175
  2435. Const length107offset = 128
  2436. Const length108offset = 206
  2437. Const length109offset = 152
  2438. Const length110offset = 174
  2439. Const length111offset = 145
  2440. Const length112offset = 179
  2441. Const length113offset = 202
  2442. Const length114offset = 177
  2443. Const length115offset = 104
  2444. Const length116offset = 189
  2445. Const length117offset = 151
  2446. Const length118offset = 106
  2447. Const length119offset = 138
  2448. Const length120offset = 116
  2449.  
  2450. Const angleXYStart3 = 0
  2451. Const angleXYStop3 = 0
  2452. Const stepSize3 = .5
  2453.  
  2454. dim angle3, dir3, anglez3, dirz3, angleXYoffset3
  2455. 'angleXYoffset3 = atn(height1offset/length1offset) * 180/3.14159265359
  2456. angle3 = angleXYStart3
  2457. dir3 = stepSize3
  2458. dirz3 = 1
  2459. timer3.interval = 30
  2460. Sub timer3_timer
  2461.  
  2462. 'Set angle
  2463. angle3 = angle3 + 1 * dir3
  2464.  
  2465. 'Set direction
  2466. ' if angle3 => angleXYStop3 then
  2467. ' dir3 = -1 * dir3
  2468. ' elseif Angle3 =< angleXYStart3 then
  2469. ' dir3 = -1 * dir3
  2470. ' end if
  2471. dir3 = -1 * dir3
  2472.  
  2473. 'Set zdirection
  2474. anglez3 = anglez3 + 1 * dirz3
  2475. if anglez3 => 360 then
  2476. anglez3 = 0
  2477. end if
  2478.  
  2479. 'Move primitive
  2480. 'Primitive2.Roty = angle3
  2481. 'Primitive2.ObjRotz = angleZ3 + 180
  2482.  
  2483. 'Move light
  2484. calcXYZ laser1, light1Pos, length1offset, angle3, angleZ3
  2485. calcXYZ Laser2, light2Pos, length2offset, angle3, angleZ3
  2486. calcXYZ Laser3, light3Pos, length3offset, angle3, angleZ3
  2487. calcXYZ Laser4, light4Pos, length4offset, angle3, angleZ3
  2488. calcXYZ Laser5, light5Pos, length5offset, angle3, angleZ3
  2489. calcXYZ Laser6, light6Pos, length6offset, angle3, angleZ3
  2490. calcXYZ Laser7, light7Pos, length7offset, angle3, angleZ3
  2491. calcXYZ Laser8, light8Pos, length8offset, angle3, angleZ3
  2492. calcXYZ Laser9, light9Pos, length9offset, angle3, angleZ3
  2493. calcXYZ Laser10, light10Pos, length10offset, angle3, angleZ3
  2494. calcXYZ Laser11, light11Pos, length11offset, angle3, angleZ3
  2495. calcXYZ Laser12, light12Pos, length12offset, angle3, angleZ3
  2496. calcXYZ Laser13, light13Pos, length13offset, angle3, angleZ3
  2497. calcXYZ Laser14, light14Pos, length14offset, angle3, angleZ3
  2498. calcXYZ Laser15, light15Pos, length15offset, angle3, angleZ3
  2499. calcXYZ Laser16, light16Pos, length16offset, angle3, angleZ3
  2500. calcXYZ Laser17, light17Pos, length17offset, angle3, angleZ3
  2501. calcXYZ Laser18, light18Pos, length18offset, angle3, angleZ3
  2502. calcXYZ Laser19, light19Pos, length19offset, angle3, angleZ3
  2503. calcXYZ Laser20, light20Pos, length20offset, angle3, angleZ3
  2504. calcXYZ laser21, light21Pos, length21offset, angle3, angleZ3
  2505. calcXYZ Laser22, light22Pos, length22offset, angle3, angleZ3
  2506. calcXYZ Laser23, light23Pos, length23offset, angle3, angleZ3
  2507. calcXYZ Laser24, light24Pos, length24offset, angle3, angleZ3
  2508. calcXYZ Laser25, light25Pos, length25offset, angle3, angleZ3
  2509. calcXYZ Laser26, light26Pos, length26offset, angle3, angleZ3
  2510. calcXYZ Laser27, light27Pos, length27offset, angle3, angleZ3
  2511. calcXYZ Laser28, light28Pos, length28offset, angle3, angleZ3
  2512. calcXYZ Laser29, light29Pos, length29offset, angle3, angleZ3
  2513. calcXYZ Laser30, light30Pos, length30offset, angle3, angleZ3
  2514. calcXYZ Laser31, light31Pos, length31offset, angle3, angleZ3
  2515. calcXYZ Laser32, light32Pos, length32offset, angle3, angleZ3
  2516. calcXYZ Laser33, light33Pos, length33offset, angle3, angleZ3
  2517. calcXYZ Laser34, light34Pos, length34offset, angle3, angleZ3
  2518. calcXYZ Laser35, light35Pos, length35offset, angle3, angleZ3
  2519. calcXYZ Laser36, light36Pos, length36offset, angle3, angleZ3
  2520. calcXYZ Laser37, light37Pos, length37offset, angle3, angleZ3
  2521. calcXYZ Laser38, light38Pos, length38offset, angle3, angleZ3
  2522. calcXYZ Laser39, light39Pos, length39offset, angle3, angleZ3
  2523. calcXYZ Laser40, light40Pos, length40offset, angle3, angleZ3
  2524. calcXYZ2 Laser41, light41Pos, length41offset, angle3, angleZ3
  2525. calcXYZ2 Laser42, light42Pos, length42offset, angle3, angleZ3
  2526. calcXYZ2 Laser43, light43Pos, length43offset, angle3, angleZ3
  2527. calcXYZ2 Laser44, light44Pos, length44offset, angle3, angleZ3
  2528. calcXYZ2 Laser45, light45Pos, length45offset, angle3, angleZ3
  2529. calcXYZ2 Laser46, light46Pos, length46offset, angle3, angleZ3
  2530. calcXYZ2 Laser47, light47Pos, length47offset, angle3, angleZ3
  2531. calcXYZ2 Laser48, light48Pos, length48offset, angle3, angleZ3
  2532. calcXYZ2 Laser49, light49Pos, length49offset, angle3, angleZ3
  2533. calcXYZ2 Laser50, light50Pos, length50offset, angle3, angleZ3
  2534. calcXYZ2 Laser51, light51Pos, length51offset, angle3, angleZ3
  2535. calcXYZ2 Laser52, light52Pos, length52offset, angle3, angleZ3
  2536. calcXYZ2 Laser53, light53Pos, length53offset, angle3, angleZ3
  2537. calcXYZ2 Laser54, light54Pos, length54offset, angle3, angleZ3
  2538. calcXYZ2 Laser55, light55Pos, length55offset, angle3, angleZ3
  2539. calcXYZ2 Laser56, light56Pos, length56offset, angle3, angleZ3
  2540. calcXYZ2 Laser57, light57Pos, length57offset, angle3, angleZ3
  2541. calcXYZ2 Laser58, light58Pos, length58offset, angle3, angleZ3
  2542. calcXYZ2 Laser59, light59Pos, length59offset, angle3, angleZ3
  2543. calcXYZ2 Laser60, light60Pos, length60offset, angle3, angleZ3
  2544. calcXYZ2 Laser61, light61Pos, length61offset, angle3, angleZ3
  2545. calcXYZ2 Laser62, light62Pos, length62offset, angle3, angleZ3
  2546. calcXYZ2 Laser63, light63Pos, length63offset, angle3, angleZ3
  2547. calcXYZ2 Laser64, light64Pos, length64offset, angle3, angleZ3
  2548. calcXYZ2 Laser65, light65Pos, length65offset, angle3, angleZ3
  2549. calcXYZ2 Laser66, light66Pos, length66offset, angle3, angleZ3
  2550. calcXYZ2 Laser67, light67Pos, length67offset, angle3, angleZ3
  2551. calcXYZ2 Laser68, light68Pos, length68offset, angle3, angleZ3
  2552. calcXYZ2 Laser69, light69Pos, length69offset, angle3, angleZ3
  2553. calcXYZ2 Laser70, light70Pos, length70offset, angle3, angleZ3
  2554. calcXYZ2 Laser71, light71Pos, length71offset, angle3, angleZ3
  2555. calcXYZ2 Laser72, light72Pos, length72offset, angle3, angleZ3
  2556. calcXYZ2 Laser73, light73Pos, length73offset, angle3, angleZ3
  2557. calcXYZ2 Laser74, light74Pos, length74offset, angle3, angleZ3
  2558. calcXYZ2 Laser75, light75Pos, length75offset, angle3, angleZ3
  2559. calcXYZ2 Laser76, light76Pos, length76offset, angle3, angleZ3
  2560. calcXYZ2 Laser77, light77Pos, length77offset, angle3, angleZ3
  2561. calcXYZ2 Laser78, light78Pos, length78offset, angle3, angleZ3
  2562. calcXYZ2 Laser79, light79Pos, length79offset, angle3, angleZ3
  2563. calcXYZ2 Laser80, light80Pos, length80offset, angle3, angleZ3
  2564. calcXYZ3 Laser81, light81Pos, length81offset, angle3, angleZ3
  2565. calcXYZ3 Laser82, light82Pos, length82offset, angle3, angleZ3
  2566. calcXYZ3 Laser83, light83Pos, length83offset, angle3, angleZ3
  2567. calcXYZ3 Laser84, light84Pos, length84offset, angle3, angleZ3
  2568. calcXYZ3 Laser85, light85Pos, length85offset, angle3, angleZ3
  2569. calcXYZ3 Laser86, light86Pos, length86offset, angle3, angleZ3
  2570. calcXYZ3 Laser87, light87Pos, length87offset, angle3, angleZ3
  2571. calcXYZ3 Laser88, light88Pos, length88offset, angle3, angleZ3
  2572. calcXYZ3 Laser89, light89Pos, length89offset, angle3, angleZ3
  2573. calcXYZ3 Laser90, light90Pos, length90offset, angle3, angleZ3
  2574. calcXYZ3 Laser91, light91Pos, length91offset, angle3, angleZ3
  2575. calcXYZ3 Laser92, light92Pos, length92offset, angle3, angleZ3
  2576. calcXYZ3 Laser93, light93Pos, length93offset, angle3, angleZ3
  2577. calcXYZ3 Laser94, light94Pos, length94offset, angle3, angleZ3
  2578. calcXYZ3 Laser95, light95Pos, length95offset, angle3, angleZ3
  2579. calcXYZ3 Laser96, light96Pos, length96offset, angle3, angleZ3
  2580. calcXYZ3 Laser97, light97Pos, length97offset, angle3, angleZ3
  2581. calcXYZ3 Laser98, light98Pos, length98offset, angle3, angleZ3
  2582. calcXYZ3 Laser99, light99Pos, length99offset, angle3, angleZ3
  2583. calcXYZ3 Laser100, light100Pos, length100offset, angle3, angleZ3
  2584. calcXYZ3 Laser101, light101Pos, length101offset, angle3, angleZ3
  2585. calcXYZ3 Laser102, light102Pos, length102offset, angle3, angleZ3
  2586. calcXYZ3 Laser103, light103Pos, length103offset, angle3, angleZ3
  2587. calcXYZ3 Laser104, light104Pos, length104offset, angle3, angleZ3
  2588. calcXYZ3 Laser105, light105Pos, length105offset, angle3, angleZ3
  2589. calcXYZ3 Laser106, light106Pos, length106offset, angle3, angleZ3
  2590. calcXYZ3 Laser107, light107Pos, length107offset, angle3, angleZ3
  2591. calcXYZ3 Laser108, light108Pos, length108offset, angle3, angleZ3
  2592. calcXYZ3 Laser109, light109Pos, length109offset, angle3, angleZ3
  2593. calcXYZ3 Laser110, light110Pos, length110offset, angle3, angleZ3
  2594. calcXYZ3 Laser111, light111Pos, length111offset, angle3, angleZ3
  2595. calcXYZ3 Laser112, light112Pos, length112offset, angle3, angleZ3
  2596. calcXYZ3 Laser113, light113Pos, length113offset, angle3, angleZ3
  2597. calcXYZ3 Laser114, light114Pos, length114offset, angle3, angleZ3
  2598. calcXYZ3 Laser115, light115Pos, length115offset, angle3, angleZ3
  2599. calcXYZ3 Laser116, light116Pos, length116offset, angle3, angleZ3
  2600. calcXYZ3 Laser117, light117Pos, length117offset, angle3, angleZ3
  2601. calcXYZ3 Laser118, light118Pos, length118offset, angle3, angleZ3
  2602. calcXYZ3 Laser119, light119Pos, length119offset, angle3, angleZ3
  2603. calcXYZ3 Laser120, light120Pos, length120offset, angle3, angleZ3
  2604. 'calcXYZ ball4, ball4Pos, length4offset, angle3 + angleXYOffset3, angleZ3
  2605. End sub
  2606.  
  2607.  
  2608. ' *********************************************************
  2609. ' Calculate X, Y and Z from latitude, longitude and radius
  2610. ' *********************************************************
  2611. Sub CalcXYZ (ballname, ballpos, length, angXY, angZ)
  2612. Dim lat, lon
  2613.  
  2614. lat = angXY * 3.14159265359/180
  2615. lon = angZ * 3.14159265359/180
  2616.  
  2617. ballname.x = ballpos(0) + length * cos(lat) * cos(lon)
  2618. ballname.y = ballpos(1) + (length * 2.5) * cos(lat) * sin(lon)
  2619. 'ballname.z = ballpos(2) + length *sin(lat)
  2620. 'debug.print angXY & ":" & angZ & ":" & ballname.x & ":" & ballname.y' & ":" & ballname.z
  2621. End Sub
  2622.  
  2623. Sub CalcXYZ2 (ballname, ballpos, length, angXY, angZ)
  2624. Dim lat, lon
  2625.  
  2626. lat = angXY * 3.14159265359/180
  2627. lon = angZ * 3.14159265359/180
  2628.  
  2629. ballname.x = ballpos(0) + length * (cos(lat) * 2) * cos(lon)
  2630. ballname.y = ballpos(1) + length * cos(lat) * sin(lon)
  2631. 'ballname.z = ballpos(2) + length *sin(lat)
  2632. debug.print angXY & ":" & angZ & ":" & ballname.x & ":" & ballname.y' & ":" & ballname.z
  2633. End Sub
  2634.  
  2635. Sub CalcXYZ3 (ballname, ballpos, length, angXY, angZ)
  2636. Dim lat, lon
  2637.  
  2638. lat = angXY * 3.14159265359/90
  2639. lon = angZ * 3.14159265359/90
  2640.  
  2641. ballname.x = ballpos(0) + (length * 1.5) * cos(lat) * cos(lon)
  2642. ballname.y = ballpos(1) + (length / 2) * cos(lat) * sin(lon)
  2643. 'ballname.z = ballpos(2) + length *sin(lat)
  2644. 'debug.print angXY & ":" & angZ & ":" & ballname.x & ":" & ballname.y' & ":" & ballname.z
  2645. End Sub
  2646. star trek neo.txt
  2647. Ouvrir avec Google Docs
  2648. Affichage de star trek neo.txt
Advertisement
Add Comment
Please, Sign In to add comment