Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '______ ______ _ _ _ _ _____ _ _ _ ______
- '| _ \ | _ \ | | ___ | | | (_) | ___| | | | | | | ___ \
- '| | | |_ __ | | | |_ _ __| | ___ ( _ ) | |_| |_ ___ | |____ _____ ___| | | ___ _ __ | |_ | |_/ /__ _ _ _
- '| | | | '__| | | | | | | |/ _` |/ _ \ / _ \/\ | _ | / __| | __\ \/ / __/ _ \ | |/ _ \ '_ \| __| | // _` | | | |
- '| |/ /| |_ | |/ /| |_| | (_| | __/ | (_> < | | | | \__ \ | |___> < (_| __/ | | __/ | | | |_ | |\ \ (_| | |_| |
- '|___/ |_(_) |___/ \__,_|\__,_|\___| \___/\/ \_| |_/_|___/ \____/_/\_\___\___|_|_|\___|_| |_|\__| \_| \_\__,_|\__, |
- ' __/ |Size
- ' |___/
- ' ______ _ _ __ _____ _____ _____
- ' | ___ \ | | | / | | _ || _ || _ |
- ' | |_/ / __ _| | |_ _ `| | | |_| || |_| || |/' |
- ' | ___ \/ _` | | | | | | | | \____ |\____ || /| |
- ' | |_/ / (_| | | | |_| | _| |_.___/ /.___/ /\ |_/ /
- ' \____/ \__,_|_|_|\__, | \___/\____/ \____/ \___/
- ' __/ |
- ' |___/ '
- 'Dr. Dude (Midway 1990) Version 1.5 for VP10
- 'Early development by "gtxJoe" and completed by "wrd1972"
- 'Thanks to gtxJoe for the assistance and allowing me to complete this table...which by the way, is my very first VP table...EVER!
- 'Extra thanks to "ninuzzu" for the plastics and ramp prims and PITA Mixmaster fixin. Also for the invaluable guidance he has provided me on this journey.
- 'Also extra thanks to Cyberpez for the many small 3D jobs and script tweaks.
- 'Flasher Domes and by "Dark"
- 'White flippers by "Zany"
- 'Playfield image rework by "ClarkKent"
- 'Desktop table scoring by "32Assassin"
- 'Lighting by "wrd1972"
- 'HMLF Physics by "wrd1972"
- 'Flipper physics by "Rothbauerw" and "wrd1972"
- 'DOF by "Arngrim"
- 'Mixmaster model and coiled wires 3D models by "nfozzy"
- 'Many thanks to countles others for in the VPF community for helping me learn the table creation process.
- 'Last but not least, a million Thanks to my wife for tolerating me spending countless hours in the basement bangin away on a fake pinball machine.
- Option Explicit
- Randomize
- On Error Resume Next
- ExecuteGlobal GetTextFile("controller.vbs")
- If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
- On Error Goto 0
- '*************************************************************************************************************************
- Dim OptReset
- 'OptReset = 1 'Uncomment to reset to default options in case of error OR keep all changes temporary. Re-comment after table is restarted.
- '*************************************************************************************************************************
- Dim DesktopMode: DesktopMode = Table1.ShowDT
- If DesktopMode = True Then 'Show Desktop components
- Railleft.visible = 1
- Railright.visible = 1
- Lockdownbar.visible = 1
- F17_DT.visible = 1
- F18_DT.visible = 1
- F19_DT.visible = 1
- F20_DT.visible = 1
- F21_DT.visible = 1
- F17_fs.visible = 0
- F18_fs.visible = 0
- F19_fs.visible = 0
- F20_fs.visible = 0
- F21_fs.visible = 0
- F36dt.visible = 1
- F36adt.visible = 1
- F36fs.visible = 0
- F36afs.visible = 0
- F37dt.visible = 1
- F37adt.visible = 1
- F37fs.visible = 0
- F37afs.visible = 0
- F38dt.visible = 1
- F38adt.visible = 1
- F38fs.visible = 0
- F38afs.visible = 0
- F57dt.visible = 1
- F57adt.visible = 1
- F57fs.visible = 0
- F57afs.visible = 0
- l17_DT.visible = 1
- l18_DT.visible = 1
- l19_DT.visible = 1
- l20_DT.visible = 1
- l21_DT.visible = 1
- l17_FS.visible = 0
- l18_FS.visible = 0
- l19_FS.visible = 0
- l20_FS.visible = 0
- l21_FS.visible = 0
- F133_DT.visible = 1
- F134_DT.visible = 1
- F135_DT.visible = 1
- F133_FS.visible = 0
- F134_FS.visible = 0
- F135_FS.visible = 0
- GI1_DT.visible =1
- GI2_DT.visible =1
- GI3_DT.visible =1
- GI1_FS.visible =0
- GI2_FS.visible =0
- GI3_FS.visible =0
- F132_DT.visible =1
- F132_FS.visible =0
- pSidewall_DTa.visible = 1
- pSidewall_FSa.visible = 0
- Else
- Railleft.visible = 0
- Railright.visible = 0
- Lockdownbar.visible = 0
- F36dt.visible = 0
- F36adt.visible = 0
- F36fs.visible = 1
- F36afs.visible = 1
- F37dt.visible = 0
- F37adt.visible = 0
- F37fs.visible = 1
- F37afs.visible = 1
- F38dt.visible = 0
- F38adt.visible = 0
- F38fs.visible = 1
- F38afs.visible = 1
- F57dt.visible = 0
- F57adt.visible = 0
- F57fs.visible = 1
- F57afs.visible = 1
- l17_DT.visible = 0
- l18_DT.visible = 0
- l19_DT.visible = 0
- l20_DT.visible = 0
- l21_DT.visible = 0
- l17_FS.visible = 1
- l18_FS.visible = 1
- l19_FS.visible = 1
- l20_FS.visible = 1
- l21_FS.visible = 1
- F17_DT.visible = 0
- F18_DT.visible = 0
- F19_DT.visible = 0
- F20_DT.visible = 0
- F21_DT.visible = 0
- F17_fs.visible = 1
- F18_fs.visible = 1
- F19_fs.visible = 1
- F20_fs.visible = 1
- F21_fs.visible = 1
- F133_DT.visible = 0
- F134_DT.visible = 0
- F135_DT.visible = 0
- F133_FS.visible = 1
- F134_FS.visible = 1
- F135_FS.visible = 1
- GI1_DT.visible =0
- GI2_DT.visible =0
- GI3_DT.visible =0
- GI1_FS.visible =1
- GI2_FS.visible =1
- GI3_FS.visible =1
- F132_DT.visible =0
- F132_FS.visible =1
- pSidewall_DTa.visible = 0
- pSidewall_FSa.visible = 1
- End if
- ' DMD Rotation
- Const cDMDRotation = -1 '-1 for No change, 0 - DMD rotation of 0?, 1 - DMD rotation of 90?
- Const cGameName = "dd_l2" 'ROM name
- dim aproncolor, flipperstyle, cheaterpost, raybeam, MMflashers
- Const ballsize = 50
- Const ballmass = 1.7
- LoadVPM "00990300", "s11.VBS",3.10
- '********************
- 'Standard definitions
- '********************
- Const UseSolenoids = 1
- Const UseLamps = 0
- Const UseSync = 1
- Const HandleMech = 0
- 'Standard Sounds
- Const SSolenoidOn = "fx_Solenoid"
- Const SSolenoidOff = ""
- Const SFlipperOn = ""
- Const SFlipperOff = ""
- Const SCoin = "fx_coin"
- '********************
- 'Table Init
- '********************
- Dim bsTrough, DTRBank1, ttcentre, mMagnet, FastFlips
- Sub Table1_Init
- vpmInit Me
- With Controller
- .GameName = cGameName
- .SplashInfoLine = "Dr. Dude (Bally 1990)"
- .HandleKeyboard = 0
- .ShowTitle = 0
- .ShowDMDOnly = 1
- .ShowFrame = 0
- .HandleMechanics = 1
- .Hidden = 1
- if cDMDRotation >= 0 Then .Games(cGameName).Settings.Value("rol") = cDMDRotation
- On Error Resume Next
- .Run GetPlayerHWnd
- If Err Then MsgBox Err.Description
- End With
- On Error Goto 0
- 'Nudging
- vpmNudge.TiltSwitch=1
- vpmNudge.Sensitivity=5
- vpmNudge.TiltObj=Array(Bumper1,Bumper2,Bumper3,LeftSlingshot,RightSlingshot)
- Set FastFlips = new cFastFlips
- with FastFlips
- .CallBackL = "SolLflipper" 'Point these to flipper subs
- .CallBackR = "SolRflipper" '...
- .TiltObjects = True 'if True calls vpmnudge.solgameon automatically (which in turn disables slings & bumpers)
- ' .DebugOn = False 'Debug, always-on flippers. Call FastFlips.DebugOn True or False in debugger to enable/disable.
- end with
- 'Trough
- Set bsTrough=New cvpmBallStack
- with bsTrough
- .InitSw 0,11,12,13,0,0,0,0
- .InitKick BallRelease,0,12
- .Balls=3
- .InitExitSnd SoundFX("fx_ballrel",DOFContactors) , SoundFX("fx_Solenoid",DOFContactors)
- End With
- 'DropTargets
- Set dtrbank1 = New cvpmDropTarget
- dtrbank1.InitDrop Array(sw21, sw22, sw23, sw24), Array(21,22,23,24)
- dtrbank1.InitSnd SoundFX("Droptarget",DOFContactors),SoundFX("Droptargetreset",DOFContactors)
- ' Disc
- Set ttcentre = new cvpmTurnTable
- ttcentre.InitTurnTable trMixMaster,240
- ttcentre.CreateEvents "ttcentre"
- ttcentre.SpinUp = 240
- ttcentre.SpinDown = 240
- ' Magnet
- Set mMagnet = New cvpmMagnet
- With mMagnet
- .InitMagnet magnetTrigger, 10
- .CreateEvents "mMagnet"
- .Solenoid = 13
- .GrabCenter = False
- End With
- Dim obj
- For Each obj In colLampPoles:obj.IsDropped = 1:Next
- colLampPoles(2).isdropped = 0
- '**Main Timer init
- PinMAMETimer.Enabled = 1
- SolGI 0
- End Sub
- Sub B2SCommand(nr, state)
- If B2SOn Then
- Controller.B2SSetData nr, state
- End If
- End Sub
- Sub Table_Paused:Controller.Pause = 1:End Sub
- Sub Table_unPaused:Controller.Pause = 0:End Sub
- Sub Table1_Exit():Controller.Stop:End Sub
- '********************
- ' KEYS
- '********************
- Sub Table1_KeyDown(ByVal keycode)
- If keycode = PlungerKey Then Plunger.PullBack:PlaySound "plungerpull"
- If keycode = LeftFlipperKey Then Controller.Switch(58) = 1 : FastFlips.FlipL True
- If keycode = RightFlipperKey Then Controller.Switch(57) = 1 : FastFlips.FlipR True
- If keycode = LeftTiltKey Then Nudge 90,2: Playsound SoundFX("fx_nudge",0)
- If keycode = RightTiltKey Then Nudge 270,2: Playsound SoundFX("fx_nudge",0)
- If keycode = CenterTiltKey Then Nudge 0,3: Playsound SoundFX("fx_nudge",0)
- '* Test Kicker
- ' If keycode = 37 Then TestKick ' K kick ball in test kicker
- ' If keycode = 19 Then return_to_test ' R return ball to kicker
- ' If keycode = 46 Then create_testball ' C create ball ball in test kicker
- ' If keycode = 205 Then TKickAngle = TKickAngle + 3:KickDirection.Visible=1:KickDirection.RotZ=TKickAngle+90 ' right arrow
- ' If keycode = 203 Then TKickAngle = TKickAngle - 3:KickDirection.Visible=1:KickDirection.RotZ=TKickAngle+90 'left arrow
- ' If keycode = 200 Then TKickPower = TKickPower + 2:debug.print "TKickPower: "&TKickPower ' up arrow
- ' If keycode = 208 Then TKickPower = TKickPower - 2:debug.print "TKickPower: "&TKickPower ' down arrow
- If vpmKeyDown(keycode) Then Exit Sub
- End Sub
- Sub Table1_KeyUp(ByVal keycode)
- If keycode = PlungerKey Then Plunger.Fire:PlaySound "plunger"
- If keycode = LeftFlipperKey Then Controller.Switch(58) = 0 : FastFlips.FlipL False
- If keycode = RightFlipperKey Then Controller.Switch(57) = 0 : FastFlips.FlipR False
- '* Test Kicker
- If keycode = 205 Then KickDirection.Visible=0 ' right arrow
- If keycode = 203 Then KickDirection.Visible=0 'left arrow
- If vpmKeyUp(keycode) Then Exit Sub
- End Sub
- '******************************************************
- ' Test Kicker
- '******************************************************
- 'Dim TKickAngle, TKickPower, TKickBall
- 'TKickAngle = 0
- 'TKickPower = 10
- 'Sub testkick()
- ' test.kick TKickAngle,TKickPower
- 'End Sub
- 'Sub create_testball():Set TKickBall = test.CreateBall:End Sub
- 'Sub test_hit():Set TKickBall=ActiveBall:End Sub
- 'Sub return_to_test():TKickBall.velx=0:TKickBall.vely=0:TKickBall.x=test.x:TKickBall.y=test.y-50:test.timerenabled=0:End Sub
- '*********** SOLENOIDS ************
- SolCallBack(1) = "bsTrough.SolIn"
- SolCallBack(2) = "bsTrough.SolOut"
- SolCallBack(3) = "solLeftKicker"
- SolCallBack(4) = "solRightKicker"
- SolCallBack(6) = "vpmSolSound SoundFX(""Knocker"",DOFKnocker),"
- SolCallBack(7) = "dtRBank1.SolDropUp"
- SolCallBack(10) = "solGI"
- SolCallBack(14) = "solBigGuy"
- SolCallBack(15) = "SetLamp 101," 'Big Guy Flasher
- SolCallBack(16) = "solMixer" 'Mixer Motor
- SolCallBack(25) = "SetLamp 125," 'Mixer Heart Flasher
- SolCallBack(26) = "SetLamp 126," 'Mixer Gab Flasher
- SolCallBack(27) = "SetLamp 127," 'Mixer Magnet Flasher
- SolCallBack(28) = "SetLamp 128," 'Magnet Flasher
- SolCallBack(29) = "SetLamp 129," 'Gab Flasher
- SolCallBack(30) = "SetLamp 130," 'Heart Flasher
- SolCallBack(31) = "SetLamp 131," 'Drop Targets Flasher
- SolCallBack(32) = "SetLamp 132," 'Raygun Flasher
- 'SolCallback(sLLFlipper) = "SolLFlipper"
- 'SolCallback(sLRFlipper) = "SolRFlipper"
- SolCallback(23) = "FastFlips.TiltSol"
- Sub SolLFlipper(Enabled)
- If Enabled Then
- LeftFlipper.RotateToEnd
- PlaySound SoundFX("fx_flipperup",DOFContactors), 0, .67, -0.05, 0.05
- Else
- LeftFlipper.RotateToStart
- PlaySound SoundFX("fx_flipperdown",DOFContactors), 0, 1, -0.05, 0.05
- End If
- End Sub
- Sub SolRFlipper(Enabled)
- If Enabled Then
- RightFlipper.RotateToEnd
- PlaySound SoundFX("fx_flipperup",DOFContactors), 0, .67, 0.05, 0.05
- Else
- RightFlipper.RotateToStart
- PlaySound SoundFX("fx_flipperdown",DOFContactors), 0, 1, 0.05, 0.05
- End If
- End Sub
- Sub solLeftKicker (enabled)
- If (enabled and Controller.Switch(51)) Then
- Playsound SoundFX("fx_vuk_exit2",DOFContactors)
- Controller.Switch(51) = 0
- sw51.timerenabled = 1
- sw51.kick 0,40, 3.14/2
- End If
- End Sub
- Dim sw51step
- Sub sw51_timer()
- Select Case sw51step
- Case 0:Leftupkicker.TransY = 10
- Case 1:Leftupkicker.TransY = 20
- Case 2:Leftupkicker.TransY = 30
- Case 3:'pUpKicker.TransY = 30
- Case 4:
- Case 5:Leftupkicker.TransY = 25
- Case 6:Leftupkicker.TransY = 20
- Case 7:Leftupkicker.TransY = 15
- Case 8:Leftupkicker.TransY = 10
- Case 9:Leftupkicker.TransY = 5
- Case 10:Leftupkicker.TransY = 0:sw51.timerEnabled = 0:sw51step = 0
- End Select
- sw51step = sw51step + 1
- End Sub
- Sub solRightKicker (enabled)
- If (enabled) Then
- Playsound SoundFX("fx_vuk_exit2",DOFContactors)
- Controller.Switch(32) = 0
- sw32.timerenabled = 1
- sw32.kick 0,70, 3.14/2
- End If
- End Sub
- Dim sw32step
- Sub sw32_timer()
- Select Case sw32step
- Case 0:Rightupkicker.TransY = 10
- Case 1:Rightupkicker.TransY = 20
- Case 2:Rightupkicker.TransY = 30
- Case 3:'pUpKicker.TransY = 30
- Case 4:
- Case 5:Rightupkicker.TransY = 25
- Case 6:Rightupkicker.TransY = 20
- Case 7:Rightupkicker.TransY = 15
- Case 8:Rightupkicker.TransY = 10
- Case 9:Rightupkicker.TransY = 5
- Case 10:Rightupkicker.TransY = 0:sw32.timerEnabled = 0:sw32step = 0
- End Select
- sw32step = sw32step + 1
- End Sub
- Sub solBigGuy (enabled)
- If Enabled Then
- PlaySound SoundFX("BigGuyShake",DOFShaker)
- PrimGuyHit
- End If
- End Sub
- Sub PrimGuyTimer_Timer: PrimGuyMove: End Sub
- Dim GuyCnt
- Const GuyMoveMax = 20
- Sub PrimGuyHit
- GuyCnt = 0 'Reset count
- PrimGuyTimer.Interval = 20 'Set timer interval
- PrimGuyTimer.Enabled = 1 'Enable timer
- End Sub
- Sub PrimGuyMove
- Select Case GuyCnt
- Case 0: primGuy.RotX = GuyMoveMax * .25
- Case 1: primGuy.RotX = GuyMoveMax * .50
- Case 2: primGuy.RotX = GuyMoveMax * .75
- Case 3: primGuy.RotX = GuyMoveMax
- Case 4: primGuy.RotX = GuyMoveMax * .25
- Case 5: primGuy.RotX = GuyMoveMax * .50
- Case 6: primGuy.RotX = GuyMoveMax * .75
- Case 7: primGuy.RotX = 0:PrimGuyShake
- Case else: PrimGuyTimer.Enabled = 0
- End Select
- GuyCnt = GuyCnt + 1
- End Sub
- '***Mixmaster motor***
- Sub SolMixer(enabled)
- if enabled then
- ttcentre.MotorOn = True
- ttTimer.Enabled = True
- Playsound SoundFX("fx_motor",DOFGear),-1,1,0.2
- else
- ttcentre.MotorOn = False
- ttTimer.Enabled = False
- StopSound "fx_motor"
- end if
- end sub
- '***Mixmaster drop posts***
- ttTimer.interval = 10
- Dim lampLastPos
- Sub ttTimer_Timer
- PostMM.RotZ=(PostMM.RotZ + 10) mod 360
- lampLastPos = Int(SpinningDisc.ObjRotz / 10 + .5)
- colLampPoles(lampLastPos).IsDropped = True
- SpinningDisc.ObjRotZ = (SpinningDisc.ObjRotz + 10) mod 360
- lampLastPos = Int(SpinningDisc.ObjRotz / 10 + .5)
- colLampPoles(lampLastPos).IsDropped = False
- End Sub
- Sub Wall100_Hit
- Wall100Cnt = Wall100Cnt + 1
- If Wall100Cnt >= Wall100Max Then Wall100.IsDropped = True
- debug.print Wall100Cnt & " , " & Wall100Max
- End Sub
- Sub Drain_Hit()
- vpmTimer.PulseSw 10
- bsTrough.AddBall Me
- PlaySound "drain"
- End Sub
- '****************
- ' POP BUMPERS
- '****************
- Dim Bumper1Cnt,Bumper2Cnt,Bumper3Cnt
- Const BumperMoveMax = 25
- Sub Bumper1_Hit
- vpmTimer.PulseSw 52
- Playsound SoundFX("fx_bumper1",DOFContactors)
- Bumper1Hit
- End Sub
- Sub Bumper1_Timer: Bumper1Move: End Sub
- Sub Bumper1Hit
- Bumper1Cnt = 0 'Reset count
- Bumper1.TimerInterval = 20 'Set timer interval
- Bumper1.TimerEnabled = 1 'Enable timer
- End Sub
- Sub Bumper1Move
- Select Case Bumper1Cnt
- Case 0: Bumper1Cap.TransY = -BumperMoveMax * .25 : Bumper1CapS.TransZ = BumperMoveMax * .25 : BR1.TransY = -BumperMoveMax * .25
- Case 1: Bumper1Cap.TransY = -BumperMoveMax * .50 : Bumper1CapS.TransZ = BumperMoveMax * .50 : BR1.TransY = -BumperMoveMax * .50
- Case 2: Bumper1Cap.TransY = -BumperMoveMax * .75 : Bumper1CapS.TransZ = BumperMoveMax * .75 : BR1.TransY = -BumperMoveMax * .75
- Case 3: Bumper1Cap.TransY = -BumperMoveMax : Bumper1CapS.TransZ = BumperMoveMax : br1.TransY = -BumperMoveMax
- Case 4: Bumper1Cap.TransY = -BumperMoveMax * .25 : Bumper1CapS.TransZ = BumperMoveMax * .25 : BR1.TransY = -BumperMoveMax * .25
- Case 5: Bumper1Cap.TransY = -BumperMoveMax * .50 : Bumper1CapS.TransZ = BumperMoveMax * .50 : BR1.TransY = -BumperMoveMax * .50
- Case 6: Bumper1Cap.TransY = -BumperMoveMax * .75 : Bumper1CapS.TransZ = BumperMoveMax * .75 : BR1.TransY = -BumperMoveMax * .75
- Case 7: Bumper1Cap.TransY = 0 : Bumper1CapS.TransZ = 0 : br1.TransY = 0
- Case else: Bumper1.TimerEnabled = 0
- End Select
- Bumper1Cnt = Bumper1Cnt + 1
- End Sub
- Sub Bumper2_Hit
- vpmTimer.PulseSw 53
- Playsound SoundFX("fx_bumper2",DOFContactors)
- Bumper2Hit
- End Sub
- Sub Bumper2_Timer: Bumper2Move: End Sub
- Sub Bumper2Hit
- Bumper2Cnt = 0 'Reset count
- Bumper2.TimerInterval = 20 'Set timer interval
- Bumper2.TimerEnabled = 1 'Enable timer
- End Sub
- Sub Bumper2Move
- Select Case Bumper2Cnt
- Case 0: Bumper2Cap.TransY = -BumperMoveMax * .25 : Bumper2CapS.TransZ = BumperMoveMax * .25 : BR2.TransY = -BumperMoveMax * .25
- Case 1: Bumper2Cap.TransY = -BumperMoveMax * .50 : Bumper2CapS.TransZ = BumperMoveMax * .50 : BR2.TransY = -BumperMoveMax * .50
- Case 2: Bumper2Cap.TransY = -BumperMoveMax * .75 : Bumper2CapS.TransZ = BumperMoveMax * .75 : BR2.TransY = -BumperMoveMax * .75
- Case 3: Bumper2Cap.TransY = -BumperMoveMax : Bumper2CapS.TransZ = BumperMoveMax : br2.TransY = -BumperMoveMax
- Case 4: Bumper2Cap.TransY = -BumperMoveMax * .25 : Bumper2CapS.TransZ = BumperMoveMax * .25 : BR2.TransY = -BumperMoveMax * .25
- Case 5: Bumper2Cap.TransY = -BumperMoveMax * .50 : Bumper2CapS.TransZ = BumperMoveMax * .50 : BR2.TransY = -BumperMoveMax * .50
- Case 6: Bumper2Cap.TransY = -BumperMoveMax * .75 : Bumper2CapS.TransZ = BumperMoveMax * .75 : BR2.TransY = -BumperMoveMax * .75
- Case 7: Bumper2Cap.TransY = 0 : Bumper2CapS.TransZ = 0 : br2.TransY = 0
- Case else: Bumper2.TimerEnabled = 0
- End Select
- Bumper2Cnt = Bumper2Cnt + 1
- End Sub
- Sub Bumper3_Hit
- vpmTimer.PulseSw 54
- Playsound SoundFX("fx_bumper3",DOFContactors)
- Bumper3Hit
- End Sub
- Sub Bumper3_Timer: Bumper3Move: End Sub
- Sub Bumper3Hit
- Bumper3Cnt = 0 'Reset count
- Bumper3.TimerInterval = 20 'Set timer interval
- Bumper3.TimerEnabled = 1 'Enable timer
- End Sub
- Sub Bumper3Move
- Select Case Bumper3Cnt
- Case 0: Bumper3Cap.TransY = -BumperMoveMax * .25 : Bumper3CapS.TransZ = BumperMoveMax * .25 : BR3.TransY = -BumperMoveMax * .25
- Case 1: Bumper3Cap.TransY = -BumperMoveMax * .50 : Bumper3CapS.TransZ = BumperMoveMax * .50 : BR3.TransY = -BumperMoveMax * .50
- Case 2: Bumper3Cap.TransY = -BumperMoveMax * .75 : Bumper3CapS.TransZ = BumperMoveMax * .75 : BR3.TransY = -BumperMoveMax * .75
- Case 3: Bumper3Cap.TransY = -BumperMoveMax : Bumper3CapS.TransZ = BumperMoveMax : br3.TransY = -BumperMoveMax
- Case 4: Bumper3Cap.TransY = -BumperMoveMax * .25 : Bumper3CapS.TransZ = BumperMoveMax * .25 : BR3.TransY = -BumperMoveMax * .25
- Case 5: Bumper3Cap.TransY = -BumperMoveMax * .50 : Bumper3CapS.TransZ = BumperMoveMax * .50 : BR3.TransY = -BumperMoveMax * .50
- Case 6: Bumper3Cap.TransY = -BumperMoveMax * .75 : Bumper3CapS.TransZ = BumperMoveMax * .75 : BR3.TransY = -BumperMoveMax * .75
- Case 7: Bumper3Cap.TransY = 0 : Bumper3CapS.TransZ = 0 : br3.TransY = 0
- Case else: Bumper3.TimerEnabled = 0
- End Select
- Bumper3Cnt = Bumper3Cnt + 1
- End Sub
- '**********Sling Shots and Animations
- ' Rstep and Lstep are the variables that increment the animation
- '****************
- Dim RStep, Lstep
- Sub LeftSlingShot_Slingshot
- PlaySound SoundFX("left_slingshot",DOFContactors),0,1,-0.05,0.05
- LSling.Visible = 0
- LSling1.Visible = 1
- sling2.TransZ = -20
- LStep = 0
- LeftSlingShot.TimerEnabled = 1
- vpmTimer.PulseSw 55
- 'gi1.State = 0:Gi2.State = 0
- End Sub
- Sub LeftSlingShot_Timer
- Select Case LStep
- Case 1:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -10
- Case 2:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.TransZ = 0:LeftSlingShot.TimerEnabled = 0:'gi1.State = 1:Gi2.State = 1
- End Select
- LStep = LStep + 1
- End Sub
- Sub RightSlingShot_Slingshot
- PlaySound SoundFX("right_slingshot",DOFContactors), 0, 1, 0.05, 0.05
- RSling.Visible = 0
- RSling1.Visible = 1
- sling1.TransZ = -20
- RStep = 0
- RightSlingShot.TimerEnabled = 1
- vpmTimer.PulseSw 56
- 'gi1.State = 0:Gi2.State = 0
- End Sub
- Sub RightSlingShot_Timer
- Select Case RStep
- Case 1:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -10
- Case 2:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.TransZ = 0:RightSlingShot.TimerEnabled = 0:'gi1.State = 1:Gi2.State = 1
- End Select
- RStep = RStep + 1
- End Sub
- Sub wall83_Hit:vpmTimer.PulseSw 100:rubberback1.visible = 0::rubberback1a.visible = 1:wall83.timerenabled = 1:End Sub
- Sub wall83_timer:rubberback1.visible = 1::rubberback1a.visible = 0: wall83.timerenabled= 0:End Sub
- Sub Wall2_Hit:vpmTimer.PulseSw 100:MMrubberl.visible = 0::MMrubberla.visible = 1:Wall2.timerenabled = 1:End Sub
- Sub Wall2_timer:MMrubberl.visible = 1::MMrubberla.visible = 0: Wall2.timerenabled= 0:End Sub
- Sub Wall3_Hit:vpmTimer.PulseSw 100:MMrubberR.visible = 0::MMrubberRa.visible = 1:Wall3.timerenabled = 1:End Sub
- Sub Wall3_timer:MMrubberR.visible = 1::MMrubberRa.visible = 0: Wall3.timerenabled= 0:End Sub
- Sub Wall233_Hit:vpmTimer.PulseSw 100:Rubber_white_1.visible = 0::Rubber_white_1a.visible = 1:Wall233.timerenabled = 1:End Sub
- Sub Wall233_timer:Rubber_white_1.visible = 1::Rubber_white_1a.visible = 0: Wall233.timerenabled= 0:End Sub
- Sub Wall101_Hit:vpmTimer.PulseSw 100:Rubber_white_3.visible = 0::Rubber_white_3a.visible = 1:Wall101.timerenabled = 1: vpmTimer.PulseSw 39: End Sub
- Sub Wall101_timer:Rubber_white_3.visible = 1::Rubber_white_3a.visible = 0: Wall101.timerenabled= 0:End Sub
- ' ************************
- ' GI
- ' ************************
- Sub solGI(enabled) ' 'SetLamp 100, abs(not enabled)
- If enabled Then
- GIoff '
- Playsound "fx_relay_off"
- Else
- GIon
- Playsound "fx_relay_on"
- End If
- End Sub
- Sub GIoff()
- dim xx : For each xx in GI:xx.State = 0: Next
- SetLamp 100, 0
- End Sub
- Sub GIon()
- dim xx : For each xx in GI:xx.State = 1: Next
- SetLamp 100, 1
- End Sub
- ' ************************
- ' RealTime Updates
- ' ************************
- 'Set MotorCallback = GetRef("GameTimer")
- Sub GameTimer_Timer
- UpdateMechs
- RollingSoundsUpdate
- End Sub
- dim defaultEOS,EOSAngle,EOSTorque
- defaulteos = leftflipper.eostorque
- EOSAngle = 3
- EOSTorque = .9
- Sub UpdateMechs
- flipperL.RotZ = LeftFlipper.CurrentAngle
- flipperR.RotZ = RightFlipper.CurrentAngle
- If LeftFlipper.CurrentAngle < LeftFlipper.EndAngle + EOSAngle Then
- LeftFlipper.eostorque = EOSTorque
- Else
- LeftFlipper.eostorque = defaultEOS
- End If
- If RightFlipper.CurrentAngle > RightFlipper.EndAngle - EOSAngle Then
- RightFlipper.eostorque = EOSTorque
- Else
- RightFlipper.eostorque = defaultEOS
- End If
- End Sub
- Dim primCnt(100), primDir(100), primBmprDir(6)
- '****************************************************************************
- '***** Primitive Standup Target Animation
- '****************************************************************************
- 'USAGE: Sub sw1_Hit: PrimStandupTgtHit 1, Sw1, PrimSw1: End Sub
- 'USAGE: Sub Sw1_Timer: PrimStandupTgtMove 1, Sw1, PrimSw1: End Sub
- Const StandupTgtMovementDir = "TransX"
- Const StandupTgtMovementMax = 6
- Sub PrimStandupTgtHit (swnum, wallName, primName)
- PlaySound SoundFx("target",DOFContactors)
- vpmTimer.PulseSw swnum
- primCnt(swnum) = 0 'Reset count
- wallName.TimerInterval = 20 'Set timer interval
- wallName.TimerEnabled = 1 'Enable timer
- Debug.print "Hit"
- End Sub
- Sub PrimStandupTgtMove (swnum, wallName, primName)
- Select Case StandupTgtMovementDir
- Case "TransX":
- Select Case primCnt(swnum)
- Case 0: primName.TransX = -StandupTgtMovementMax * .5
- Case 1: primName.TransX = -StandupTgtMovementMax
- Case 2: primName.TransX = -StandupTgtMovementMax * .5
- Case 3: primName.TransX = 0
- Case else: wallName.TimerEnabled = 0
- End Select
- Case "TransY":
- Select Case primCnt(swnum)
- Case 0: primName.TransY = -StandupTgtMovementMax * .5
- Case 1: primName.TransY = -StandupTgtMovementMax
- Case 2: primName.TransY = -StandupTgtMovementMax * .5
- Case 3: primName.TransY = 0
- Case else: wallName.TimerEnabled = 0
- End Select
- Case "TransZ":
- Select Case primCnt(swnum)
- Case 0: primName.TransZ = -StandupTgtMovementMax * .5
- Case 1: primName.TransZ = -StandupTgtMovementMax
- Case 2: primName.TransZ = -StandupTgtMovementMax * .5
- Case 3: primName.TransZ = 0
- Case else: wallName.TimerEnabled = 0
- End Select
- End Select
- primCnt(swnum) = primCnt(swnum) + 1
- End Sub
- ' ************************
- ' Gates
- ' ************************
- 'Sub Gate1_Hit():PlaySound "gate":End Sub
- Sub Gate2_Hit():PlaySound "gate":End Sub
- Sub Gate3_Hit():PlaySound "gate":End Sub
- Sub trigger1_Hit():PlaySound "gate":End Sub
- ' ************************
- ' Switches
- ' ************************
- sub sw9_hit: controller.switch(9)=1: playsound "rollover": end sub
- sub sw9_unhit: controller.switch(9)=0
- If ActiveBall.VelY < 0 Then 'on the way up
- End If
- End Sub
- Sub sw14_Hit:vpmTimer.PulseSw(14):Playsound SoundFX("fx_target",DOFTargets):Me.TimerEnabled = 1: End Sub
- 'Sub Standup27_Hit:vpmTimer.pulseSw 27:Playsound SoundFX("fx_target",DOFTargets):Me.TimerEnabled = 1: End Sub
- Sub sw15_Hit:Controller.Switch(15) = 1
- If ActiveBall.VelY < 0 Then 'on the way up
- PlaySound "fx_rrenter", 0, 1, pan(ActiveBall)
- End If
- End Sub
- Sub sw15_Unhit:Controller.Switch(15) = 0:End Sub
- sub sw16_hit: controller.switch(16)=1: playsound "rollover": end sub
- sub sw16_unhit: controller.switch(16)=0: end sub
- sub sw17_hit: controller.switch(17)=1: playsound "rollover": end sub
- sub sw17_unhit: controller.switch(17)=0: end sub
- sub sw18_hit: controller.switch(18)=1: playsound "rollover": end sub
- sub sw18_unhit: controller.switch(18)=0: end sub
- sub sw19_hit: controller.switch(19)=1: playsound "rollover": end sub
- sub sw19_unhit: controller.switch(19)=0: end sub
- sub sw20_hit: controller.switch(20)=1: playsound "rollover": end sub
- sub sw20_unhit: controller.switch(20)=0: end sub
- sub sw21_hit: dtrbank1.hit 1: Playsound "droptarget": end sub
- sub sw22_hit: dtrbank1.hit 2: Playsound "droptarget": end sub
- sub sw23_hit: dtrbank1.hit 3: Playsound "droptarget": end sub
- sub sw24_hit: dtrbank1.hit 4: Playsound "droptarget": end sub
- Sub sw25_Hit:vpmTimer.PulseSw(25):Playsound SoundFX("fx_target",DOFTargets):Me.TimerEnabled = 1: End Sub
- Sub sw26_Hit:vpmTimer.PulseSw(26):Playsound SoundFX("fx_target",DOFTargets):Me.TimerEnabled = 1: End Sub
- Sub sw27_Hit:vpmTimer.PulseSw(27):Playsound SoundFX("fx_target",DOFTargets):Me.TimerEnabled = 1: End Sub
- Sub sw28_Hit:vpmTimer.PulseSw(28):Playsound SoundFX("fx_target",DOFTargets):Me.TimerEnabled = 1: End Sub
- Sub sw29_Hit:vpmTimer.PulseSw(29):Playsound SoundFX("fx_target",DOFTargets):Me.TimerEnabled = 1: End Sub
- Sub sw30_Hit:vpmTimer.PulseSw(30):Playsound SoundFX("fx_target",DOFTargets):Me.TimerEnabled = 1: End Sub
- Sub sw31_Hit:vpmTimer.PulseSw(31):Playsound SoundFX("fx_target",DOFTargets):Me.TimerEnabled = 1: End Sub
- Sub sw32_Hit: Controller.Switch(32) = 1:Playsound "fx_saucer_enter": Sw32.Enabled = 0:End Sub
- Sub Sw32Trigger_Hit
- debug.print activeball.vely
- If activeball.vely > -10 Then
- Sw32.Enabled = 1
- Else
- Sw32.Enabled = 0
- End If
- End Sub
- Sub sw33_Hit:vpmTimer.PulseSw(33):Playsound SoundFX("fx_target",DOFTargets):Me.TimerEnabled = 1: End Sub
- Sub sw34_Hit:vpmTimer.PulseSw(34):Playsound SoundFX("fx_target",DOFTargets):Me.TimerEnabled = 1: End Sub
- Sub sw35_Hit:vpmTimer.PulseSw(35):Playsound SoundFX("fx_target",DOFTargets):Me.TimerEnabled = 1: End Sub
- Sub sw36_Hit:vpmTimer.PulseSw(36):Playsound SoundFX("fx_target",DOFTargets):Me.TimerEnabled = 1: End Sub
- Sub sw37_Hit:vpmTimer.PulseSw(37):Playsound SoundFX("fx_target",DOFTargets):Me.TimerEnabled = 1: End Sub
- Sub sw38_Hit:vpmTimer.PulseSw(38):Playsound SoundFX("fx_target",DOFTargets):Me.TimerEnabled = 1: End Sub
- 'sub sw39_hit: vpmTimer.PulseSw 39: debug.print "39":end sub
- Sub sw41_Hit:vpmTimer.PulseSw(41):Playsound SoundFX("fx_target",DOFTargets):Me.TimerEnabled = 1: End Sub
- Sub sw42_Hit:vpmTimer.PulseSw(42):Playsound SoundFX("fx_target",DOFTargets):Me.TimerEnabled = 1: End Sub
- Sub sw43_Hit:vpmTimer.PulseSw(43):Playsound SoundFX("fx_target",DOFTargets):Me.TimerEnabled = 1: End Sub
- sub sw46_hit: vpmTimer.PulseSw 46: debug.print "46":end sub
- sub sw47_hit: vpmTimer.PulseSw 47: debug.print "47":end sub
- sub sw48_hit: vpmTimer.PulseSw 48: debug.print "48":end sub
- Sub sw49_Hit:vpmTimer.PulseSw(49):Playsound SoundFX("fx_target",DOFTargets):Me.TimerEnabled = 1: End Sub
- Sub sw50_Hit:vpmTimer.PulseSw(50):Playsound SoundFX("fx_target",DOFTargets):Me.TimerEnabled = 1: End Sub
- Sub sw51_Hit: Controller.Switch(51) = 1:Playsound "fx_saucer_enter": Sw51.Enabled = 0:End Sub
- Sub Sw51Trigger_Hit
- 'debug.print activeball.vely
- If activeball.vely > -10 Then
- Sw51.Enabled = 1
- Else
- Sw51.Enabled = 0
- End If
- End Sub
- sub sw59_hit: controller.switch(59)=1: playsound "rollover": end sub
- sub sw59_unhit: controller.switch(59)=0: end sub
- '***************************************************
- 'GI collection Lamp/Flasher sorting and GiOFF scaling init
- '***************************************************
- 'redim GILamps(99) : redim GIFlashers(99) 'Splits GI collection into these two new arrays (not applicable here because no flashers)
- 'SortGI GILamps, GIFlashers, GI
- 'dim TestString 'debug strings
- 'Sub SortGI(ByRef aLight,aFlasher, GImixed) 'different method using Arrays instead of scripting dictionary objects
- ' dim x, CountMe: CountMe = 0
- ' for x = 0 to (GImixed.Count-1)
- ' if TypeName(GImixed(x) ) = "Light" Then
- ' Set aLight(CountMe) = GImixed(x)
- ' TestString = TestString & "assigned " & GImixed(x).Name & " to aLight(" & CountMe & ")" & vbnewline 'debug
- ' CountMe = CountMe+1
- ' redim Preserve aLight(CountMe)
- ' end if
- ' Next
- ' CountMe = 0
- ' for x = 0 to (GImixed.Count-1) '(note: this sub assumes there ARE flashers in the collection!)
- ' if TypeName(GImixed(x) ) = "Flasher" Then
- ' Set aFlasher(CountMe) = GImixed(x)
- ' TestString = TestString & "assigned " & GImixed(x).Name & " to aFlasher(" & CountMe & ")" & vbnewline 'debug
- ' CountMe = CountMe+1
- ' redim Preserve aFlasher(CountMe)
- ' end if
- ' Next
- ' redim Preserve aLight(uBound(aLight)-1) 'final trim of the arrays
- ' redim Preserve aFlasher(uBound(aFlasher)-1)
- ' 'TestSTR(0) = TestSTR(0) & "ubound aLight: " & uBound(aLight) & " uBound aFlashers:" & uBound(aFlasher) 'debug
- ' 'Debug.Print TestString
- 'End Sub
- 'These arrays contain the following info of all non-GI lights (collected from GetElements via SortLamps sub)
- Redim LightsA(999)' Object references
- Redim LightsB(999)' Opacity / Intensity
- Redim LightsC(999)' Fade Up (Light objects)
- Redim LightsD(999)' Fade Down(Light Objects)
- SortLamps GI
- dim TestStringAll
- Sub SortLamps(ByVal aGI) 'Sorts remaining light and flashers objects (EXCLUDES those in the GI collection)
- dim Counter,x,xx,skipme : skipme = False:Counter = 0 : TestStringAll = "Test String 2"
- for each x in GetElements 'toomuchcoffee.vbs
- 'if TypeName(x) = "IDecal" then Continue For 'Decals don't have names. Evil imo D:
- if TypeName(x) = "Light" or TypeName(x) = "Flasher" Then
- SkipMe = False
- for each xx in aGI 'Find duplicates and Skip them
- if x.Name = xx.Name then
- TestStringAll = TestStringAll & x.Name & "found in GI collection, Disregarding & Continuing..." & vbnewline 'debug
- SkipMe = True'Continue For
- End If
- next
- If Not SkipMe Then
- On Error Resume Next
- 'LightsA(Counter) = x.name 'name
- Set LightsA(Counter) = x 'ref
- LightsB(Counter) = x.Opacity
- LightsB(Counter) = x.Intensity
- LightsC(Counter) = x.FadeSpeedUp
- LightsD(Counter) = x.FadeSpeedDown
- On Error Goto 0
- Counter = Counter + 1
- redim Preserve LightsA(Counter)
- redim Preserve LightsB(Counter)
- redim Preserve LightsC(Counter)
- redim Preserve LightsD(Counter)
- End If
- End If
- next
- redim Preserve LightsA(uBound(LightsA)-1) 'final trim of the arrays
- redim Preserve LightsB(uBound(LightsB)-1)
- redim Preserve LightsC(uBound(LightsC)-1)
- redim Preserve LightsD(uBound(LightsD)-1)
- TestStringAll = TestStringAll & "Ubound LightsA = " & UBound(LightsA) 'Debug
- End Sub
- '***************************************************
- ' JP's VP10 Fading Lamps & Flashers
- ' Based on PD's Fading Light System
- ' SetLamp 0 is Off
- ' SetLamp 1 is On
- ' fading for non opacity objects is 4 steps
- '***************************************************
- Dim LampState(200), FadingLevel(200)
- Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
- Dim GIoffMult : GIoffMult = 1.55 'Multiplies all non-GI opacity when the GI is off
- const nrGI = 100 'Gi fade number - 100
- InitLamps() ' turn off the lights and flashers and reset them to the default parameters
- LampTimer.Interval = -1'40 'lamp fading speed
- LampTimer.Enabled = 1
- ' Lamp & Flasher Timers
- dim FrameTime, InitFrameTime : InitFrameTime = 0
- Sub LampTimer_Timer()
- FrameTime = gametime - InitFrameTime
- Dim chgLamp, num, chg, ii
- chgLamp = Controller.ChangedLamps
- If Not IsEmpty(chgLamp) Then
- For ii = 0 To UBound(chgLamp)
- LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1) 'keep the real state in an array
- FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
- Next
- End If
- UpdateLamps
- FadeEmpty 100
- FadeLUT 100, "ColorGradeBOP_", 7
- FadeGiOff 100
- InitFrameTime = gametime
- End Sub
- Sub InitLamps()
- Dim x
- For x = 0 to 200
- LampState(x) = 0 ' current light state, independent of the fading level. 0 is off and 1 is on
- FadingLevel(x) = 4 ' used to track the fading state
- 'FlashSpeedUp(x) = 0.5 ' faster speed when turning on the flasher
- 'FlashSpeedDown(x) = 0.35 ' slower speed when turning off the flasher
- FlashSpeedUp(x) = 60 '-1 Timer Fading Speeds (Measured in Total Milliseconds. Lower = Faster.)
- FlashSpeedDown(x) = 94
- FlashMax(x) = 1 ' the maximum value when on, usually 1
- FlashMin(x) = 0 ' the minimum value when off, usually 0
- FlashLevel(x) = 0 ' the intensity of the flashers, usually from 0 to 1
- Next
- FlashSpeedUp(100) = 100 : FlashSpeedDown(100) = 100 'GI Lut fading speeds
- End Sub
- '***Lamps***
- Sub UpdateLamps()
- Flash 1, F1 'back wall jackpot
- Flash 2, F2 'back wall jackpot
- Flash 3, F3 'back wall jackpot
- Flash 4, F4 'back wall jackpot
- Flash 5, F5 'back wall jackpot
- nFadeL 6, l6
- nFadeL 7, l7
- nFadeL 8, l8
- Flash 9, F9 'skill shot
- Flash 10, F10 'skill shot
- Flash 11, F11 'skill shot
- Flash 12, F12 'skill shot
- nFadeL 13, l13
- nFadeL 14, l14
- nFadeL 15, l15
- nFadeL 16, l16
- Flashm 17, F17_FS 'raygun
- Flash 17, F17_DT 'raygun
- Flashm 18, F18_FS 'raygun
- Flash 18, F18_DT 'raygun
- Flashm 19, F19_FS 'raygun
- Flash 19, F19_DT 'raygun
- Flashm 20, F20_DT 'raygun
- Flash 20, F20_FS 'raygun
- Flashm 21, F21_FS 'raygun
- Flash 21, F21_DT 'raygun
- nFadeLM 17, L17_FS 'raygun
- nFadeLM 17, L17_DT 'raygun
- nFadeLM 18, L18_FS 'raygun
- nFadeLM 18, L18_DT 'raygun
- nFadeLM 19, L19_FS 'raygun
- nFadeLM 19, L19_DT 'raygun
- nFadeLM 20, L20_FS 'raygun
- nFadeLM 20, L20_DT 'raygun
- nFadeLM 21, L21_FS 'raygun
- nFadeLM 21, L21_DT 'raygun
- nFadeL 22, l22
- nFadeL 23, l23
- nFadeL 24, l24
- nFadeL 25, l25
- nFadeL 26, l26
- nFadeL 27, l27
- nFadeL 28, l28
- nFadeL 29, l29
- nFadeL 30, l30
- nFadeL 31, l31
- nFadeL 32, l32
- Flashm 36, F36fs
- Flashm 36, F36afs
- Flashm 36, F36dt
- Flash 36, F36adt
- Flashm 37, F37dt
- Flashm 37, F37adt
- Flashm 37, F37fs
- Flash 37, F37afs
- Flashm 38, F38fs
- Flashm 38, F38DT
- Flashm 38, F38aDT
- Flash 38, F38afs
- nFadeL 39, l39
- nFadeLm 40, l40b
- nFadeL 40, l40
- nFadeL 41, l41
- nFadeL 42, l42
- nFadeL 43, l43
- nFadeL 44, l44
- nFadeL 45, l45
- nFadeL 46, l46
- nFadeL 47, l47
- nFadeL 48, l48
- nFadeL 49, l49
- nFadeL 50, l50
- nFadeL 51, l51
- nFadeL 52, l52
- nFadeL 53, l53
- nFadeL 54, l54
- nFadeL 55, l55
- nFadeL 56, l56
- Flashm 57, F57fs
- Flashm 57, F57afs
- Flashm 57, F57DT
- Flash 57, F57aDT
- nFadeL 58, l58
- nFadeL 59, l59
- nFadeL 60, l60
- nFadeL 61, l61
- nFadeL 62, l62
- nFadeL 63, l63
- nFadeL 64, l64
- '***Flashers
- Flashm 33, F133_FS
- Flashm 33, F133_DT
- Flash 33, F133
- Flashm 34, F134_FS
- Flashm 34, F134_DT
- Flash 34, F134
- Flashm 35, F135_FS
- Flashm 35, F135_DT
- Flash 35, F135
- 'NFadeLM 101, L101 'Bully plastic
- Flash 101, F101
- nFadeL 125, F33
- nFadeLm 126, F35
- nFadeLm 126, F35a
- nFadeL 126, F35b
- nFadeLm 127, F34a
- nFadeLm 127, F34b
- nFadeL 127, F34
- 'nFadeLM 128, L128 'Magnetic Personality plastic
- Flash 128, f128
- Flashm 129, F129
- Flash 129, F129a
- 'nFadeLm 130, L130 'Heart of Rock and Roll Plastic
- Flash 130, F130
- Flash 131, F131
- Flashm 132, F132_FS
- Flashm 132, F132_DT
- Flash 132, F200
- End Sub
- Sub SetLamp(nr, value)
- If value <> LampState(nr) Then
- LampState(nr) = abs(value)
- FadingLevel(nr) = abs(value) + 4
- End If
- End Sub
- ' Lights: used for VP10 standard lights, the fading is handled by VP itself
- Sub NFadeL(nr, object)
- Select Case FadingLevel(nr)
- Case 4:object.state = 0:FadingLevel(nr) = 0
- Case 5:object.state = 1:FadingLevel(nr) = 1
- End Select
- End Sub
- Sub NFadeLm(nr, object) ' used for multiple lights
- Select Case FadingLevel(nr)
- Case 4:object.state = 0
- Case 5:object.state = 1
- End Select
- End Sub
- 'Lights, Ramps & Primitives used as 4 step fading lights
- 'a,b,c,d are the images used from on to off
- Sub FadeObj(nr, object, a, b, c, d)
- Select Case FadingLevel(nr)
- Case 4:object.image = b:FadingLevel(nr) = 6 'fading to off...
- Case 5:object.image = a:FadingLevel(nr) = 1 'ON
- Case 6, 7, 8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
- Case 9:object.image = c:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
- Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
- Case 13:object.image = d:FadingLevel(nr) = 0 'Off
- End Select
- End Sub
- Sub FadeObjm(nr, object, a, b, c, d)
- Select Case FadingLevel(nr)
- Case 4:object.image = b
- Case 5:object.image = a
- Case 9:object.image = c
- Case 13:object.image = d
- End Select
- End Sub
- Sub NFadeObj(nr, object, a, b)
- Select Case FadingLevel(nr)
- Case 4:object.image = b:FadingLevel(nr) = 0 'off
- Case 5:object.image = a:FadingLevel(nr) = 1 'on
- End Select
- End Sub
- Sub NFadeObjm(nr, object, a, b)
- Select Case FadingLevel(nr)
- Case 4:object.image = b
- Case 5:object.image = a
- End Select
- End Sub
- ' Flasher objects
- Sub Flash(nr, object)
- Select Case FadingLevel(nr)
- Case 3
- FadingLevel(nr) = 0
- Case 4 'off
- FlashLevel(nr) = FlashLevel(nr) - (1/FlashSpeedDown(nr) * FrameTime)
- If FlashLevel(nr) < FlashMin(nr) Then
- FlashLevel(nr) = FlashMin(nr)
- FadingLevel(nr) = 3 'completely off
- End if
- Object.IntensityScale = FlashLevel(nr)
- Case 5 ' on
- FlashLevel(nr) = FlashLevel(nr) + (1/FlashSpeedUp(nr) * FrameTime)
- If FlashLevel(nr) > FlashMax(nr) Then
- FlashLevel(nr) = FlashMax(nr)
- FadingLevel(nr) = 6 'completely on
- End if
- Object.IntensityScale = FlashLevel(nr)
- Case 6
- FadingLevel(nr) = 1
- End Select
- End Sub
- Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
- select case FadingLevel(nr)
- case 3, 4, 5, 6
- Object.IntensityScale = FlashLevel(nr)
- end select
- End Sub
- Sub FadeEmpty(nr) 'Fade a lamp number, no object updates
- Select Case FadingLevel(nr)
- Case 3
- FadingLevel(nr) = 0
- Case 4 'off
- FlashLevel(nr) = FlashLevel(nr) - (1/FlashSpeedDown(nr) * FrameTime)
- If FlashLevel(nr) < FlashMin(nr) Then
- FlashLevel(nr) = FlashMin(nr)
- FadingLevel(nr) = 3 'completely off
- End if
- 'Object.IntensityScale = FlashLevel(nr)
- Case 5 ' on
- FlashLevel(nr) = FlashLevel(nr) + (1/FlashSpeedUp(nr) * FrameTime)
- If FlashLevel(nr) > FlashMax(nr) Then
- FlashLevel(nr) = FlashMax(nr)
- FadingLevel(nr) = 6 'completely on
- End if
- 'Object.IntensityScale = FlashLevel(nr)
- Case 6
- FadingLevel(nr) = 1
- End Select
- End Sub
- Sub FadeLUT(nr, LutName, LutCount) 'fade lookuptable
- If FadingLevel(nr) > 2 Then
- dim GoLut : GoLut = cInt(LutCount * FlashLevel(nr) )+1 '+1 because no 0 with these luts
- Table1.ColorGradeImage = LutName & GoLut
- 'tbgi2.text = Table1.ColorGradeImage & vbnewline & golut 'debug
- End If
- End Sub
- Sub FadeGiOff(nr)
- If FadingLevel(nr) > 2 Then
- dim GIscale : GiScale = (GIoffMult-1) * (ABS(FlashLevel(nr)-1 ) ) + 1 'invert
- dim x : for x = 0 to uBound(LightsA)
- On Error Resume Next
- LightsA(x).Opacity = LightsB(x) * GIscale
- LightsA(x).Intensity = LightsB(x) * GIscale
- LightsA(x).FadeSpeedUp = LightsC(x) * GIscale
- LightsA(x).FadeSpeedDown = LightsD(x) * GIscale
- On Error Goto 0
- Next
- 'Relevant Information
- 'GIoffMult
- 'GILamps, GIFlashers, GI_Lighting
- 'Redim LightsA(999)' Object references
- 'Redim LightsB(999)' Opacity / Intensity
- 'Redim LightsC(999)' Fade Up (Light objects)
- 'Redim LightsD(999)' Fade Down(Light Objects)
- 'Debug
- 'tbgi.text = "FlashLevel: " & FlashLevel(nr) & vbnewline & _
- ' "Giscale: "& Giscale & vbnewline & _
- ' "LightsA(7): "& LightsA(7).Intensity & vbnewline & _
- ' " "
- end if
- End Sub
- ' *********************************************************************
- ' Supporting Ball & Sound Functions
- ' *********************************************************************
- Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed, decrease the default 2000 to hear a louder rolling ball sound
- Vol = Csng(BallVel(ball) ^2 / 1000)
- End Function
- Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
- Dim tmp
- tmp = ball.x * 2 / table1.width-1
- If tmp> 0 Then
- Pan = Csng(tmp ^10)
- Else
- Pan = Csng(-((- tmp) ^10) )
- End If
- End Function
- Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
- Pitch = BallVel(ball) * 20
- End Function
- Function BallVel(ball) 'Calculates the ball speed
- BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
- End Function
- '*****************************************
- ' JP's VP10 Rolling Sounds
- '*****************************************
- Const tnob = 3 ' total number of balls
- ReDim rolling(tnob)
- InitRolling
- Sub InitRolling
- Dim i
- For i = 0 to tnob
- rolling(i) = False
- Next
- End Sub
- Sub RollingSoundsUpdate()
- Dim BOT, b
- BOT = GetBalls
- ' stop the sound of deleted balls
- For b = UBound(BOT) + 1 to tnob
- rolling(b) = False
- StopSound("fx_ballrolling" & b)
- Next
- ' exit the sub if no balls on the table
- If UBound(BOT) = -1 Then Exit Sub
- ' play the rolling sound for each ball
- For b = 0 to UBound(BOT)
- If BallVel(BOT(b) ) > 1 AND BOT(b).z < 30 Then
- rolling(b) = True
- PlaySound("fx_ballrolling" & b), -1, Vol(BOT(b) ), Pan(BOT(b) ), 0, Pitch(BOT(b) ), 1, 0
- Else
- If rolling(b) = True Then
- StopSound("fx_ballrolling" & b)
- rolling(b) = False
- End If
- End If
- Next
- End Sub
- '**********************
- ' Ball Collision Sound
- '**********************
- Sub OnBallBallCollision(ball1, ball2, velocity)
- PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
- End Sub
- '*****************************************
- ' JimmyFingers VP10 Sound Routines
- '*****************************************
- '***Metal ramp sounds
- Sub BallHitSound(dummy):PlaySound "fx_balldrop":End Sub
- Sub MetalSound(dummy):PlaySound "fx_metalrolling":End Sub
- Sub LWireStart_Hit():PlaySound "fx_metalrolling": End sub
- Sub RWireStart_Hit():PlaySound "fx_metalrolling":End Sub
- Sub Smallramp_start_Hit():PlaySound "fx_metalrolling":End Sub
- Sub Ramp_drop_Hit(): Playsound "fx_metalhit2" :End Sub
- Sub MMdrop_hit() : PlaySound "fx_balldrop":End Sub
- Sub LWireEnd_Hit()
- vpmTimer.AddTimer 150, "BallHitSound"
- StopSound "fx_metalrolling"
- End Sub
- Sub RWireEnd_Hit()
- vpmTimer.AddTimer 150, "BallHitSound"
- StopSound "fx_metalrolling"
- End Sub
- Sub Smallramp_end_Hit()
- vpmTimer.AddTimer 150, "BallHitSound"
- StopSound "fx_metalrolling"
- End Sub
- Sub RWireEnd1_Hit()
- vpmTimer.AddTimer 150, "MetalSound"
- StopSound "fx_vuk_exit2"
- End Sub
- Sub LRampEnd_Hit()
- vpmTimer.AddTimer 150, "BallHitSound"
- End Sub
- '***MISC global. sounds
- Sub RubbersBandsLargeRings_Hit(idx):PlaySound "fx_rubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
- Sub RubbersSmallRings_Hit(idx):PlaySound "fx_rubber", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
- Sub Metals_Hit(idx):PlaySound "fx_metalhit2", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
- Sub SpotTargets_Hit(idx):PlaySound "target", 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0:End Sub
- Sub LeftFlipper_Collide(parm) : PlaySound "fx_flip_hit1", 0, .9, 0.25 : End Sub
- Sub RightFlipper_Collide(parm) : PlaySound "fx_flip_hit1", 0, .9, 0.25 : End Sub
- '***Flipper hit sounds
- 'Sub LeftFlipper_Collide(parm)
- ' RandomSoundFlipper()
- 'End Sub
- '
- 'Sub RightFlipper_Collide(parm)
- ' RandomSoundFlipper()
- 'End Sub
- '
- 'Sub RandomSoundFlipper()
- ' Select Case Int(Rnd*3)+1
- ' Case 1 : PlaySound "fx_flip_hit1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- ' Case 2 : PlaySound "fx_flip_hit2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- ' Case 3 : PlaySound "fx_flip_hit3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- ' End Select
- 'End Sub
- '**********************************************************************************************************
- 'Digital Display
- '**********************************************************************************************************
- Dim Digits(32)
- Digits(0)=Array(a00, a05, a0c, a0d, a08, a01, a06, a0f, a02, a03, a04, a07, a0b, a0a, a09, a0e)
- Digits(1)=Array(a10, a15, a1c, a1d, a18, a11, a16, a1f, a12, a13, a14, a17, a1b, a1a, a19, a1e)
- Digits(2)=Array(a20, a25, a2c, a2d, a28, a21, a26, a2f, a22, a23, a24, a27, a2b, a2a, a29, a2e)
- Digits(3)=Array(a30, a35, a3c, a3d, a38, a31, a36, a3f, a32, a33, a34, a37, a3b, a3a, a39, a3e)
- Digits(4)=Array(a40, a45, a4c, a4d, a48, a41, a46, a4f, a42, a43, a44, a47, a4b, a4a, a49, a4e)
- Digits(5)=Array(a50, a55, a5c, a5d, a58, a51, a56, a5f, a52, a53, a54, a57, a5b, a5a, a59, a5e)
- Digits(6)=Array(a60, a65, a6c, a6d, a68, a61, a66, a6f, a62, a63, a64, a67, a6b, a6a, a69, a6e)
- Digits(7)=Array(a70, a75, a7c, a7d, a78, a71, a76, a7f, a72, a73, a74, a77, a7b, a7a, a79, a7e)
- Digits(8)=Array(a80, a85, a8c, a8d, a88, a81, a86, a8f, a82, a83, a84, a87, a8b, a8a, a89, a8e)
- Digits(9)=Array(a90, a95, a9c, a9d, a98, a91, a96, a9f, a92, a93, a94, a97, a9b, a9a, a99, a9e)
- Digits(10)=Array(aa0, aa5, aac, aad, aa8, aa1, aa6, aaf, aa2, aa3, aa4, aa7, aab, aaa, aa9, aae)
- Digits(11)=Array(ab0, ab5, abc, abd, ab8, ab1, ab6, abf, ab2, ab3, ab4, ab7, abb, aba, ab9, abe)
- Digits(12)=Array(ac0, ac5, acc, acd, ac8, ac1, ac6, acf, ac2, ac3, ac4, ac7, acb, aca, ac9, ace)
- Digits(13)=Array(ad0, ad5, adc, add, ad8, ad1, ad6, adf, ad2, ad3, ad4, ad7, adb, ada, ad9, ade)
- Digits(14)=Array(ae0, ae5, aec, aed, ae8, ae1, ae6, aef, ae2, ae3, ae4, ae7, aeb, aea, ae9, aee)
- Digits(15)=Array(af0, af5, afc, afd, af8, af1, af6, aff, af2, af3, af4, af7, afb, afa, af9, afe)
- Digits(16)=Array(b00, b05, b0c, b0d, b08, b01, b06, b0f, b02, b03, b04, b07, b0b, b0a, b09, b0e)
- Digits(17)=Array(b10, b15, b1c, b1d, b18, b11, b16, b1f, b12, b13, b14, b17, b1b, b1a, b19, b1e)
- Digits(18)=Array(b20, b25, b2c, b2d, b28, b21, b26, b2f, b22, b23, b24, b27, b2b, b2a, b29, b2e)
- Digits(19)=Array(b30, b35, b3c, b3d, b38, b31, b36, b3f, b32, b33, b34, b37, b3b, b3a, b39, b3e)
- Digits(20)=Array(b40, b45, b4c, b4d, b48, b41, b46, b4f, b42, b43, b44, b47, b4b, b4a, b49, b4e)
- Digits(21)=Array(b50, b55, b5c, b5d, b58, b51, b56, b5f, b52, b53, b54, b57, b5b, b5a, b59, b5e)
- Digits(22)=Array(b60, b65, b6c, b6d, b68, b61, b66, b6f, b62, b63, b64, b67, b6b, b6a, b69, b6e)
- Digits(23)=Array(b70, b75, b7c, b7d, b78, b71, b76, b7f, b72, b73, b74, b77, b7b, b7a, b79, b7e)
- Digits(24)=Array(b80, b85, b8c, b8d, b88, b81, b86, b8f, b82, b83, b84, b87, b8b, b8a, b89, b8e)
- Digits(25)=Array(b90, b95, b9c, b9d, b98, b91, b96, b9f, b92, b93, b94, b97, b9b, b9a, b99, b9e)
- Digits(26)=Array(ba0, ba5, bac, bad, ba8, ba1, ba6, baf, ba2, ba3, ba4, ba7, bab, baa, ba9, bae)
- Digits(27)=Array(bb0, bb5, bbc, bbd, bb8, bb1, bb6, bbf, bb2, bb3, bb4, bb7, bbb, bba, bb9, bbe)
- Digits(28)=Array(bc0, bc5, bcc, bcd, bc8, bc1, bc6, bcf, bc2, bc3, bc4, bc7, bcb, bca, bc9, bce)
- Digits(29)=Array(bd0, bd5, bdc, bdd, bd8, bd1, bd6, bdf, bd2, bd3, bd4, bd7, bdb, bda, bd9, bde)
- Digits(30)=Array(be0, be5, bec, bed, be8, be1, be6, bef, be2, be3, be4, be7, beb, bea, be9, bee)
- Digits(31)=Array(bf0, bf5, bfc, bfd, bf8, bf1, bf6, bff, bf2, bf3, bf4, bf7, bfb, bfa, bf9, bfe)
- Sub DisplayTimer_Timer
- Dim ChgLED, ii, jj, num, chg, stat, obj, b, x
- ChgLED=Controller.ChangedLEDs(&Hffffffff, &Hffffffff)
- If Not IsEmpty(ChgLED)Then
- If DesktopMode = True Then
- For ii=0 To UBound(chgLED)
- num=chgLED(ii, 0) : chg=chgLED(ii, 1) : stat=chgLED(ii, 2)
- if (num < 32) then
- For Each obj In Digits(num)
- If chg And 1 Then obj.State=stat And 1
- chg=chg\2 : stat=stat\2
- Next
- Else
- end if
- Next
- end if
- End If
- End Sub
- '****Prim Guy Shake
- Const PrimGuyShakeXMax=3
- Const PrimGuyShakeXStep=.3
- PrimGuyShakeTimer.Interval = 40
- Dim PrimGuyShakeDirection, PrimGuyShakeXOffset
- Sub PrimGuyShake
- PrimGuyShakeXOffset = PrimGuyShakeXMax
- PrimGuy.ObjRotX = PrimGuyShakeXOffset
- PrimGuyShakeDirection = 1
- PrimGuyShakeTimer.Enabled = 1
- End Sub
- sub PrimGuyShakeTimer_Timer
- PrimGuyShakeDirection = -1*PrimGuyShakeDirection 'Change Direction
- PrimGuyShakeXOffset = PrimGuyShakeXOffset - PrimGuyShakeXStep 'Calc New Offset
- If PrimGuyShakeXOffset > 0 Then 'Keep Shaking
- PrimGuy.ObjRotX = PrimGuyShakeDirection * PrimGuyShakeXOffset
- Else 'Time to stop shaking
- PrimGuy.ObjRotX = 0
- PrimGuyShakeTimer.Enabled = 0
- End If
- End Sub
- '**********************************************************************************************************
- '**********************************************************************************************************
- 'Generic ramp sounds
- Sub Wall78_Hit:Playsound "metalhit2":End Sub
- Sub Leftlane1_Hit:Playsound "metalhit2":End Sub
- Sub Leftlane2_Hit:Playsound "metalhit2":End Sub
- Sub Wall69_Hit:Playsound "metalhit2":End Sub
- '***Options***
- Dim TableOptions, TableName
- Private vpmShowDips1, vpmDips1
- Sub InitializeOptions
- TableName="DR_Dude_VPX" 'Your descriptive table name, it will be used to save settings in VPReg.stg file
- Set vpmShowDips1 = vpmShowDips 'Reassigns vpmShowDips to vpmShowDips1 to allow usage of default dips menu
- Set vpmShowDips = GetRef("TableShowDips") 'Assigns new sub to vmpShowDips
- TableOptions = LoadValue(TableName,"Options") 'Load saved table options
- Set Controller = CreateObject("VPinMAME.Controller") 'Load vpm controller temporarily so options menu can be loaded if needed
- If TableOptions = "" Or optReset Then 'If no existing options, reset to default through optReset, then open Options menu
- TableOptions = 1 'clear any existing settings and set table options to default options
- TableShowOptions
- ElseIf (TableOptions And 1) Then 'If Enable Next Start was selected then
- 'TableOptions = TableOptions - 1 'clear setting to avoid future executions
- TableShowOptions
- Else
- TableSetOptions
- End If
- Set Controller = Nothing 'Unload vpm controller so selected controller can be loaded
- End Sub
- Private Sub TableShowDips
- vpmShowDips1 'Show original Dips menu
- TableShowOptions 'Show new options menu
- End Sub
- Private Sub TableShowOptions 'New options menu
- Dim oldOptions : oldOptions = TableOptions
- If Not IsObject(vpmDips1) Then
- Set vpmDips1 = New cvpmDips
- With vpmDips1
- .AddForm 700, 500, "TABLE OPTIONS MENU"
- .AddFrameExtra 0,0,155,"Apron Color Mod",2^1+2^2+2^3+2^4, Array("White Apron", 0, "Blue Apron", 2^1, "Green Apron", 2^2, "Custom Apron & Side Walls", 2^3, "Random Apron", 2^4)
- .AddFrameExtra 0,105,155,"Flipper Style Mod",2^6+2^7, Array("Yellow Flippers", 0, "White Flippers", 2^6, "Random Flippers", 2^7)
- .AddFrameExtra 0,167,155,"Cheater Post Mod",2^8, Array("No Drain Post", 0, "Add Drain Post", 2^8)
- .AddFrameExtra 0,217,155,"Excellent Ray Laser Mod", 2^9, Array("Normal", 0, "Show Excellent Ray Laser", 2^9)
- .AddChkExtra 0,280,155, Array("Enable Menu Next Start", 1)
- End With
- End If
- TableOptions = vpmDips1.ViewDipsExtra(TableOptions)
- SaveValue TableName,"Options",TableOptions
- TableSetOptions
- SetOptions
- End Sub
- Sub TableSetOptions 'defines required settings before table is run
- Aproncolor = (TableOptions And 2^1+2^2+2^3+2^4)
- Select Case Aproncolor
- Case 0: Aproncolor = 0
- Case 2^1: Aproncolor = 1:
- Case 2^2: Aproncolor = 2:
- Case 2^3: Aproncolor = 3:
- Case 2^4: Aproncolor = 4:
- End Select
- Flipperstyle = (TableOptions And 2^6+2^7)
- Select case Flipperstyle
- Case 0: Flipperstyle = 0
- Case 2^6: Flipperstyle = 1
- Case 2^7: Flipperstyle = 2
- End select
- Cheaterpost = (TableOptions And 2^8):If Cheaterpost=2^8 Then:Cheaterpost=1
- Raybeam = (TableOptions And 2^9): If Raybeam=2^9 Then:Raybeam=1
- SaveValue TableName,"Options",TableOptions
- SetOptions
- End Sub
- Sub SetOptions()
- If Aproncolor = 4 then Aproncolor = Int(Rnd*4) End If
- Select Case Aproncolor
- Case 0 : pApron.image = "apron_texture_White":pApronOverlay.Visible = False:pSidewall_FS.visible = false:pSidewall_DT.visible = false
- Case 1 : pApron.image = "apron_texture_Blue":pApronOverlay.Visible = False:pSidewall_FS.visible = false:pSidewall_DT.visible = false
- Case 2 : pApron.image = "apron_texture_Green":pApronOverlay.Visible = False:pSidewall_FS.visible = false:pSidewall_DT.visible = false
- Case 3 : pApronOverlay.Visible = True:If DesktopMode = True Then pSidewall_DT.visible = True else pSidewall_FS.visible = true End If
- End Select
- if flipperstyle = 2 then flipperstyle = int(rnd*2) end if
- select case flipperstyle
- case 0: flipperl.visible=false: flipperr.visible=False: RightFlipper.visible=True: LeftFlipper.visible=true
- case 1: flipperl.visible=true: flipperr.visible=True: RightFlipper.visible=False: LeftFlipper.visible=false
- end select
- If cheaterpost = 1 then
- Wall41.IsDropped = 0
- wall41.visible = 1
- primitive6.visible = 1
- Else
- primitive6.Z = -120
- Wall41.IsDropped = 1
- wall41.visible = 0
- End If
- If Raybeam = 1 then
- f200.visible = 1
- Else
- f200.visible = 0
- End If
- End Sub
- '*****************************************************************************************************************************************************
- '*****************************************************************************************************************************************************
- 'cFastFlips by nFozzy
- 'Bypasses pinmame callback for faster and more responsive flippers
- 'Version 1.1 beta2 (More proper behaviour, extra safety against script errors)
- '*************************************************
- Function NullFunction(aEnabled):End Function '1 argument null function placeholder
- Class cFastFlips
- Public TiltObjects, DebugOn, hi
- Private SubL, SubUL, SubR, SubUR, FlippersEnabled, Delay, LagCompensation, Name, FlipState(3)
- Private Sub Class_Initialize()
- Delay = 0 : FlippersEnabled = False : DebugOn = False : LagCompensation = False
- Set SubL = GetRef("NullFunction"): Set SubR = GetRef("NullFunction") : Set SubUL = GetRef("NullFunction"): Set SubUR = GetRef("NullFunction")
- End Sub
- 'set callbacks
- Public Property Let CallBackL(aInput) : Set SubL = GetRef(aInput) : Decouple sLLFlipper, aInput: End Property
- Public Property Let CallBackUL(aInput) : Set SubUL = GetRef(aInput) : End Property
- Public Property Let CallBackR(aInput) : Set SubR = GetRef(aInput) : Decouple sLRFlipper, aInput: End Property
- Public Property Let CallBackUR(aInput) : Set SubUR = GetRef(aInput) : End Property
- Public Sub InitDelay(aName, aDelay) : Name = aName : delay = aDelay : End Sub 'Create Delay
- 'Automatically decouple flipper solcallback script lines (only if both are pointing to the same sub) thanks gtxjoe
- Private Sub Decouple(aSolType, aInput) : If StrComp(SolCallback(aSolType),aInput,1) = 0 then SolCallback(aSolType) = Empty End If : End Sub
- 'call callbacks
- Public Sub FlipL(aEnabled)
- FlipState(0) = aEnabled 'track flipper button states: the game-on sol flips immediately if the button is held down (1.1)
- If not FlippersEnabled and not DebugOn then Exit Sub
- subL aEnabled
- End Sub
- Public Sub FlipR(aEnabled)
- FlipState(1) = aEnabled
- If not FlippersEnabled and not DebugOn then Exit Sub
- subR aEnabled
- End Sub
- Public Sub FlipUL(aEnabled)
- FlipState(2) = aEnabled
- If not FlippersEnabled and not DebugOn then Exit Sub
- subUL aEnabled
- End Sub
- Public Sub FlipUR(aEnabled)
- FlipState(3) = aEnabled
- If not FlippersEnabled and not DebugOn then Exit Sub
- subUR aEnabled
- End Sub
- Public Sub TiltSol(aEnabled) 'Handle solenoid / Delay (if delayinit)
- If delay > 0 and not aEnabled then 'handle delay
- vpmtimer.addtimer Delay, Name & ".FireDelay" & "'"
- LagCompensation = True
- else
- If Delay > 0 then LagCompensation = False
- EnableFlippers(aEnabled)
- end If
- End Sub
- Sub FireDelay() : If LagCompensation then EnableFlippers False End If : End Sub
- Private Sub EnableFlippers(aEnabled)
- If aEnabled then SubL FlipState(0) : SubR FlipState(1) : subUL FlipState(2) : subUR FlipState(3)
- FlippersEnabled = aEnabled
- If TiltObjects then vpmnudge.solgameon aEnabled
- If Not aEnabled then
- subL False
- subR False
- If not IsEmpty(subUL) then subUL False
- If not IsEmpty(subUR) then subUR False
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement