Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' Cirqus Voltaire / IPD No. 4059 / October, 1997 / 4 Players
- ' VP913 1.2 by JPSalas 2012
- ' Thanks to all the authors (Pinball Ken, Scapino, Pacdude, Fuseball, Wpcmame) who made this table before me.
- ' Since I have never played or seen the real table, this table is based on their tables.
- ' Thanks to Strangeleo for asking this table and his help with some graphics and testing the table.
- ' Parts of the script from the older tables.
- Option Explicit
- Randomize
- Const Ballsize = 57
- '**** New Options Selection through F6 menu ***
- Dim cController, ROL, Hidden, DefaultOptions, Sound1, Sound2, Sound3
- DefaultOptions = 1*optController+2*optB2BEnable+1*optAnIm 'Sets default options to use VPM controller and AutoEnable B2B
- 'optReset = 1 'Uncomment to reset to default options in case of error OR keep all changes temporary
- '-------The Following is now controlled through the F6 Menu-------
- 'B2BOn = 2 '0=Off, 1=On, 2=AutoDetect
- 'Choose Controller: 1-VPM, 2-UVP, 3-B2S
- 'Const cController = 1
- '******************************
- ' SET alpha GI colors
- '******************************
- 'Dim GION_alphaGIColor, GIOFF_alphaGIColor
- 'GION_alphaGIcolor = 1 ' 0=OFF, 1=WHITE, 2=GREEN, 3 = RED, 4 = blue, 5 = orange
- 'GIOFF_alphaGIcolor = 4 ' 0=OFF, 1=WHITE, 2=GREEN, 3 = RED, 4 = blue, 5 = orange
- '********************************
- 'Const cGameName = "cv_20hc" 'home rom - with credits
- Const cGameName = "cv_14" 'arcade rom - with credits
- 'Const cGameName = "cv_20h" 'home rom
- Dim FeedbackSounds:FeedbackSounds = Array("fx_ballrel","fx_bumper1","fx_bumper2","fx_bumper3","fx_diverter","fx_droptarget","fx_flipperdown","fx_flipperup1","fx_flipperup2",_
- "fx_kicker","fx_popper","fx_resetdrop","fx_slingshot1","fx_slingshot2","fx_solenoid","fx_solenoidon","fx_solenoidoff","fx_target")
- '*** End Options ***
- LoadVPM "01560000", "WPC.VBS", 3.26
- Sub LoadVPM(VPMver, VBSfile, VBSver) 'Add new call to InitializeOptions to allow selection of controller through F6 menu
- On Error Resume Next
- If ScriptEngineMajorVersion < 5 Then MsgBox "VB Script Engine 5.0 or higher required"
- ExecuteGlobal GetTextFile(VBSfile)
- If Err Then MsgBox "Unable to open " & VBSfile & ". Ensure that it is in the same folder as this table. " & vbNewLine & Err.Description
- InitializeOptions 'Enables New Controller change through F6 menu, so it needs to be placed before Controller selection
- Select Case cController
- Case 1:
- Set Controller = CreateObject("VPinMAME.Controller")
- If Err Then MsgBox "Can't Load VPinMAME." & vbNewLine & Err.Description
- If VPMver>"" Then If Controller.Version < VPMver Or Err Then MsgBox "VPinMAME ver " & VPMver & " required."
- If VPinMAMEDriverVer < VBSver Or Err Then MsgBox VBSFile & " ver " & VBSver & " or higher required."
- Case 2:
- Set Controller = CreateObject("UltraVP.BackglassServ")
- Case 3:
- Set Controller = CreateObject("B2S.Server")
- End Select
- If Err then
- msgbox "Invalid controller selected, defaulting to VPinMame"
- Set controller = CreateObject("VPinMAME.Controller")
- End If
- On Error Goto 0
- End Sub
- ExecuteGlobal GetTextFile("b2s.vbs")
- ResetB2SData 0,49,0 'Initialise the b2s data area
- Dim Filename 'dynamic b2s launching based on file name
- ' If CheckB2S(filename) Then
- '********************************************************************************************
- ' LaunchBackGlass filename, cbool(TableOptions AND optBackGlass) 'True=Launch bg , False=Don't launch bg.
- ' If ShowLogo Then SetB2SData 5,1 'ENABLE BALLY LOGO ON DMD SCREEN FOR 3 SCREEN CABS
- '********************************************************************************************
- 'End If
- 'dim expGiState:expGIState = 0
- 'dim expGILightsL,expGILightsR,expGILightsM
- 'expGILightsL = Array(EGI1,EGI11,EGI10,EGI17,EGI3,EGI7,EGI8,EGI18,EGI16,EGI20)
- 'expGILightsR = Array(EGI2,EGI12,EGI9,EGI4,EGI5,EGI6,EGI5,EGI21,EGI15)
- 'expGILightsM = Array(EGI13,EGI14)
- '********************
- 'Standard definitions
- '********************
- Const UseSolenoids = 1
- Const UseLamps = 0
- Const UseSync = 0
- Const HandleMech = 1
- ' Standard Sounds
- Const SSolenoidOn = ""
- Const SSolenoidOff = ""
- Const SCoin = "fx_coin"
- 'Set GiCallback2 = GetRef("UpdateGI1")
- Set GiCallback2 = GetRef("UpdateGI")
- Dim bsTrough, bsPopper, bsLeftSaucer, bsRightSaucer, vlLock, mechRM, mRingmasterMagnet, mLockMagnet, mJugglerMagnet, x, bump1, bump2, bump3, plungerIM
- '************
- ' Table init.
- '************
- Sub Table1_Init
- vpmInit Me
- With Controller
- .GameName = cGameName
- .SplashInfoLine = "Cirqus Voltaire - based on the table by Bally 1997" & vbNewLine & "VP913 table by JPSalas v1.2"
- 'DMD example of position and size for 1400x1050
- '.Games(cGameName).Settings.Value("dmd_pos_x")=500
- '.Games(cGameName).Settings.Value("dmd_pos_y")=2
- '.Games(cGameName).Settings.Value("dmd_width")=400
- '.Games(cGameName).Settings.Value("dmd_height")=92
- .Games(cGameName).Settings.Value("rol") = 1
- .HandleKeyboard = 0
- .ShowTitle = 0
- .ShowDMDOnly = 1
- .ShowFrame = 0
- .HandleMechanics = 0
- .Hidden = 0
- .SolMask(0) = 0
- vpmTimer.AddTimer 2000, "Controller.SolMask(0)=&Hffffffff'" 'ignore all solenoids - then add the Timer to renable all the solenoids after 2 seconds
- On Error Resume Next
- .Run GetPlayerHWnd
- If Err Then
- MsgBox "Can't start Game " & cGameName & vbNewLine & Err.Description
- msgbox "After table loads, use F6 to choose a different Rom and reload the table."
- Exit Sub
- End If
- On Error Goto 0
- End With
- 'Init Flasher Alpha GI - Set all to 0.
- flasher_tglass.alpha = 0
- sling_gi_left.alpha = 0
- sling_gi_right.alpha = 0
- slt1.alpha = 0
- slt2.alpha = 0
- slt3.alpha = 0
- slt4.alpha = 0
- slt5.alpha = 0
- slt6.alpha = 0
- slt7.alpha = 0
- slt8.alpha = 0
- slt9.alpha = 0
- slt10.alpha = 0
- slt11.alpha = 0
- slt12.alpha = 0
- slt13.alpha = 0
- slt_a.alpha = 0
- slt_a1.alpha = 0
- slt14.alpha = 0
- slt15.alpha = 0
- slt16.alpha = 0
- slt17.alpha = 0
- slt18.alpha = 0
- slt19.alpha = 0
- slt20.alpha = 0
- mgi1.alpha = 0
- mgi2.alpha = 0
- mgi3.alpha = 0
- mgi4.alpha = 0
- mgi5.alpha = 0
- mgi6.alpha = 0
- mgi7.alpha = 0
- mgi8.alpha = 0
- mgi9.alpha = 0
- mgi10.alpha = 0
- mgi11.alpha = 0
- mgi12.alpha = 0
- mgi13.alpha = 0
- mgi14.alpha = 0
- mgi15.alpha = 0
- mgi16.alpha = 0
- mgi17.alpha = 0
- mgi18.alpha = 0
- mgi19.alpha = 0
- mgi20.alpha = 0
- rlt1.alpha = 0
- rlt2.alpha = 0
- rlt3.alpha = 0
- rlt4.alpha = 0
- rlt5.alpha = 0
- rlt6.alpha = 0
- rlt7.alpha = 0
- rlt8.alpha = 0
- rtl9.alpha = 0
- rtl10.alpha = 0
- rtl11.alpha = 0
- rtl12.alpha = 0
- rtl13.alpha = 0
- '**** BMPR Settings ****
- ' if useBMPR = 1 then
- ' MomentumTimer.enabled = True
- ' table1.slopemax = 5.9
- ' table1.slopemin = 5.9
- ' table1.HardFriction = 0.0032
- ' table1.MaxBallSpeed = 50
- ' FlipperDampener.enabled = true
- ' end if
- ' Nudging
- vpmNudge.TiltSwitch = 14
- vpmNudge.Sensitivity = 1
- vpmNudge.TiltObj = Array(Bumper1, Bumper2, Bumper3, LeftSlingshot, RightSlingshot)
- ' Trough
- Set bsTrough = New cvpmBallStack
- With bsTrough
- .InitSw 0, 32, 33, 34, 35, 0, 0, 0
- .InitKick BallRelease, 90, 4
- .InitExitSnd Sound1, Sound2
- .InitEntrySnd Sound2, Sound2
- .Balls = 4
- .IsTrough = 1
- End With 'Left saucer
- Set bsLeftSaucer = New cvpmBallStack
- With bsLeftSaucer
- .InitSaucer sw71, 71, 45, 10
- .InitExitSnd Sound3, Sound3
- .CreateEvents "bsLeftSaucer", 0
- End With
- 'Right saucer
- Set bsRightSaucer = New cvpmBallStack
- With bsRightSaucer
- .InitSaucer sw72, 72, 140, 6
- .InitExitSnd Sound3, Sound3
- .CreateEvents "bsRightSaucer", 0
- End With
- ' Ball popper
- Set bsPopper = New cvpmBallStack
- With bsPopper
- .InitSw 0, 36, 0, 0, 0, 0, 0, 0
- .InitKick sw36, 290, 20
- .InitExitSnd Sound3, Sound3
- .KickForceVar = 3
- .KickAngleVar = 10
- .KickBalls = 2
- End With
- ' Ring Master Motor
- Set mechRM = New cvpmMech
- With mechRM
- .MType = vpmMechLinear + vpmMechReverse + vpmMechOneDirSol + vpmMechLengthSw
- .Sol1 = 22
- .Sol2 = 39
- .Length = 148
- .Steps = 148
- .AddSw 44, 0, 2 '0
- .AddSw 43, 109, 111 '200
- .AddSw 42, 147, 148 '265.5
- 'Motor fix later down in the script
- End With
- ' Visible Lock
- Set vlLock = New cvpmVLock
- With vlLock
- .InitVLock Array(sw66, sw67, sw68), Array(sw66k, sw67k, sw68k), Array(66, 67, 68)
- .InitSnd Sound2, Sound2
- .CreateEvents "vlLock"
- End With
- ' Ring Master Magnet
- Set mRingmasterMagnet = New cvpmMagnet
- With mRingmasterMagnet
- .InitMagnet RingmasterMagnet, 35
- '.Solenoid = 35 'own solenoid sub
- .GrabCenter = 1
- .Size = 100
- .CreateEvents "mRingmasterMagnet"
- End With
- ' Lock Magnet
- Set mLockMagnet = New cvpmMagnet
- With mLockMagnet
- .InitMagnet LockMagnet, 50
- .Solenoid = 5
- .GrabCenter = 0.5
- .Size = 300
- .CreateEvents "mLockMagnet"
- End With
- ' Juggler Magnet
- Set mJugglerMagnet = New cvpmMagnet
- With mJugglerMagnet
- .InitMagnet JugglerMagnet, 70
- .Solenoid = 3
- .GrabCenter = 1
- .Size = 100
- .CreateEvents "mJugglerMagnet"
- End With
- ' Impulse Plunger
- 'Const IMPowerSetting = 41 ' Plunger Power
- 'Const IMTime = 0.6 ' Time in seconds for Full Plunge
- Set plungerIM = New cvpmImpulseP
- With plungerIM
- .InitImpulseP swplunger, IMPowerSetting, IMTime
- .Random IMScatter
- .switch 18
- .InitEntrySnd "PlungerPull"
- .InitExitSnd "fx_plunger2", "fx_plunger"
- .CreateEvents "plungerIM"
- End With
- ' Main Timer init
- PinMAMETimer.Interval = PinMAMEInterval
- PinMAMETimer.Enabled = 1
- 'StartShake
- ' Init Bumper Rings and targets
- Ring1a.IsDropped = 1:Ring2a.IsDropped = 1:Ring3a.IsDropped = 1
- Ring1b.IsDropped = 1:Ring2b.IsDropped = 1:Ring3b.IsDropped = 1
- Ring1c.IsDropped = 1:Ring2c.IsDropped = 1:Ring3c.IsDropped = 1
- sw41a.IsDropped = 1:sw58a.IsDropped = 1:sw61a.IsDropped = 1:sw62a.IsDropped = 1:sw56a.IsDropped = 1
- sw38a.IsDropped = 1:sw38c.IsDropped = 1
- ' Init other dropwalls - animations
- LeftSLing.IsDropped = 1:LeftSLing2.IsDropped = 1:LeftSLing3.IsDropped = 1
- RightSLing.IsDropped = 1:RightSLing2.IsDropped = 1:RightSLing3.IsDropped = 1
- Jackpot.IsDropped = 1
- 'CannonKicker.CreateBall.Image = "CannonBall"
- vpmDoSolCallback 34, 0
- BoomDown 1
- 'vpmSolWall cRMs, 0, 1
- 'vpmSolWall cRMsa, 0, 1
- 'vpmSolWall cRM, 0, 1
- 'vpmSolWall cRMa, 0, 1
- CreateWildBall
- ''For Each x in expGILightsR
- ''x.alpha = 0
- ''next
- ''For Each x in expGILightsL
- ''x.alpha = 0
- ''next
- ''For Each x in expGILightsM
- ''x.alpha = 0
- ''next
- ''EGI19.alpha = 0
- ' Fix Motor
- Controller.Switch(22) = 0
- vpmTimer.AddTimer 100, "StartMotor"
- vpmTimer.AddTimer 10, "GIUpdate"
- ''LBumper2.isdropped = 1
- End Sub
- Sub GIUpdate(dummy):updategi 5,0:End Sub
- Sub StartMotor(dummy)
- Controller.Switch(22) = 1 ' Coin door closed - fixes dead motor bug
- With mechRM
- .CallBack = GetRef("UpdateRM")
- .Start
- End With
- End Sub
- '**********
- ' Keys
- '**********
- Sub table1_KeyDown(ByVal Keycode)
- If keycode = PlungerKey Then
- If ImpulsePlunger Then
- Pcount = 0:PTime.Enabled = 1:Plunger.TimerEnabled=0:PlungerIM.Pullback
- Else
- Plunger2.Pullback:vpPlay "PlungerPull"
- End If
- End If
- If keycode = LeftTiltKey Then LeftNudge 90, 1.6, 20:vpPlay "fx_nudge_left"
- If keycode = RightTiltKey Then RightNudge 270, 1.6, 20:vpPlay "fx_nudge_right"
- If keycode = CenterTiltKey Then CenterNudge 180, 2.8, 30:vpPlay "fx_nudge_forward"
- If vpmKeyDown(keycode) Then Exit Sub
- If keycode = "3" then
- setflash 117,1
- setflash 118,1
- setflash 119,1
- setflash 120,1
- setflash 121,1
- setflash 124,1
- setflash 125,1
- setflash 126,1
- setflash 128,1
- setflash 137,1
- end if
- End Sub
- Sub table1_KeyUp(ByVal Keycode)
- If keycode = PlungerKey Then
- If ImpulsePlunger Then
- PlungerIM.Strength = (PCount/25)*Plunger.MechStrength
- PlungerIM.AutoFire
- PTime.Enabled = 0:Pcount = 0:PTime2.Enabled = 1
- Else
- PTime2.Enabled = 1:Plunger2.Fire
- StopSound "PlungerPull"
- If(BallinPlunger = 1) then 'the ball is in the plunger lane
- vpPlay "fx_Plunger2"
- else
- vpPlay "fx_Plunger"
- end if
- End If
- End If
- If vpmKeyUp(keycode) Then Exit Sub
- If keycode = "3" then
- setflash 117,0
- setflash 118,0
- setflash 119,0
- setflash 120,0
- setflash 121,0
- setflash 124,0
- setflash 125,0
- setflash 126,0
- setflash 128,0
- setflash 137,0
- end if
- End Sub
- ' Koadic's Alpha Ramp
- ' Impulse Plunger Scripting v6
- ' single ramp animated
- ' via image switching
- '------------------------------
- 'Modifications made to include 'Modern Plunger'
- Dim PDelay, PCount, PImages, PStart, IMTime, IMPowerSetting, PlFrame, IMScatter, ImpulsePlunger, ImpulseP, BallInPlunger
- IMPowerSetting = Plunger.MechStrength ' Plunger Power - Set via Plunger MechStrength
- IMTime = Round(Plunger.PullSpeed/10, 2)' Time in 1/10th seconds for Full Plunge - Set via Plunger Pull Speed...
- ' 1 = .1 second, 5 = .5 second, 10 = 1 second, etc.
- IMScatter = Plunger.ScatterVelocity ' Plunger Scatter Velocity - Percentage of variation in Plunger Power
- ' Setting Scatter Velocity to 10 = 10%, if Power is 50, max plunge will vary from 47.5 to 52.5 (+/- 5%)
- PStart = 0 ' Set number of first plunger image, use 1 for legacy "1-12" setup
- PImages = 25 ' Set number of animation frames not including the PStart position, use 11 for legacy "1-12" setup
- PTime.Interval = INT(IMTime*1000/PImages)
- PDelay = CINT(Plunger.FireSpeed/Plunger.TimerInterval)
- ReDim PlPos(PDelay)
- ResetPlungers
- Sub swPlunger1_Hit:BallinPlunger = 1:End Sub 'in this sub you may add a switch, for example Controller.Switch(14) = 1
- Sub swPlunger1_UnHit:BallinPlunger = 0:End Sub 'in this sub you may add a switch, for example Controller.Switch(14) = 0
- Sub ResetPlungers
- aPlunger.Image = "p" & PStart
- For x = 0 to ubound(PlPos):PlPos(x) = 0:Next
- Pcount = 0
- PRefresh.state = ABS(PRefresh.state - 1)
- End Sub
- Sub PTime_Timer
- If PCount < (PImages) Then
- PCount = PCount + 1
- aPlunger.Image = "p" & (PCount+PStart)
- PRefresh.state = ABS(PRefresh.state - 1)
- End If
- End Sub
- Sub PTime2_Timer
- Select Case PCount
- Case 0:aPlunger.Image = "p" & PStart : PRefresh.state = ABS(PRefresh.state - 1)
- Case 1:aPlunger.Image = "p" & INT(PImages/5) : PRefresh.state = ABS(PRefresh.state - 1)
- Case 2:ResetPlungers:Plunger.TimerEnabled = 1:Me.Enabled = 0
- End Select
- Pcount = Pcount + 1
- End Sub
- Sub Plunger_Timer()
- PlPos(PDelay) = Plunger.Position
- PlFrame = PlPos(PDelay)
- If PlPos(PDelay) <> PlPos(PDelay - 1) Then
- aPlunger.Image = "p" & PlFrame
- PRefresh.state = ABS(PRefresh.state - 1)
- If PlPos(PDelay) < 2 and PlPos(0) > 5 and ImpulseP Then
- PlungerIM.Strength = (PlPos(0)/25*Plunger.MechStrength)
- PlungerIM.AutoFire
- PlungerIM.Strength = Plunger.MechStrength
- Plunger.TimerEnabled = 0:PTime2.Enabled = 1
- End If
- End If
- For x = 0 to ubound(PlPos)-1:PlPos(x)=PlPos(x+1):Next
- End Sub
- '*************************************
- ' Nudge System
- ' based on Noah's nudgetest table
- '*************************************
- Dim LeftNudgeEffect, RightNudgeEffect, NudgeEffect
- Sub LeftNudge(angle, strength, delay)
- vpmNudge.DoNudge angle, (strength * (delay-LeftNudgeEffect) / delay) + RightNudgeEffect / delay
- LeftNudgeEffect = delay
- RightNudgeEffect = 0
- RightNudgeTimer.Enabled = 0
- LeftNudgeTimer.Interval = delay
- LeftNudgeTimer.Enabled = 1
- End Sub
- Sub RightNudge(angle, strength, delay)
- vpmNudge.DoNudge angle, (strength * (delay-RightNudgeEffect) / delay) + LeftNudgeEffect / delay
- RightNudgeEffect = delay
- LeftNudgeEffect = 0
- LeftNudgeTimer.Enabled = 0
- RightNudgeTimer.Interval = delay
- RightNudgeTimer.Enabled = 1
- End Sub
- Sub CenterNudge(angle, strength, delay)
- vpmNudge.DoNudge angle, strength * (delay-NudgeEffect) / delay
- NudgeEffect = delay
- NudgeTimer.Interval = delay
- NudgeTimer.Enabled = 1
- End Sub
- Sub LeftNudgeTimer_Timer()
- LeftNudgeEffect = LeftNudgeEffect-1
- If LeftNudgeEffect = 0 then LeftNudgeTimer.Enabled = 0
- End Sub
- Sub RightNudgeTimer_Timer()
- RightNudgeEffect = RightNudgeEffect-1
- If RightNudgeEffect = 0 then RightNudgeTimer.Enabled = 0
- End Sub
- Sub NudgeTimer_Timer()
- NudgeEffect = NudgeEffect-1
- If NudgeEffect = 0 then NudgeTimer.Enabled = 0
- End Sub
- '*********
- ' Switches
- '*********
- ' Slings & div switches
- Dim LStep, RStep
- Sub LeftSlingShot_Slingshot:LeftSling.IsDropped = 0:vpPlay "fx_slingshot1":vpmTimer.PulseSw 51:LStep = 0:Me.TimerEnabled = 1:End Sub
- Sub LeftSlingShot_Timer
- Select Case LStep
- Case 0:LeftSLing.IsDropped = 0
- Case 1: 'pause
- Case 2:LeftSLing.IsDropped = 1:LeftSLing2.IsDropped = 0
- Case 3:LeftSLing2.IsDropped = 1:LeftSLing3.IsDropped = 0
- Case 4:LeftSLing3.IsDropped = 1:Me.TimerEnabled = 0
- End Select
- LStep = LStep + 1
- End Sub
- Sub RightSlingShot_Slingshot:RightSling.IsDropped = 0:vpPlay "fx_slingshot2":vpmTimer.PulseSw 52:RStep = 0:Me.TimerEnabled = 1:End Sub
- Sub RightSlingShot_Timer
- Select Case RStep
- Case 0:RightSLing.IsDropped = 0
- Case 1: 'pause
- Case 2:RightSLing.IsDropped = 1:RightSLing2.IsDropped = 0
- Case 3:RightSLing2.IsDropped = 1:RightSLing3.IsDropped = 0
- Case 4:RightSLing3.IsDropped = 1:Me.TimerEnabled = 0
- End Select
- RStep = RStep + 1
- End Sub
- ' Bumpers
- Sub LBumper_Slingshot(x)
- LBumper(x).isdropped = 1
- LBumper(abs(x-1)).isdropped = 0
- vpmTimer.PulseSw 54
- vpPlay "fx_bumper1"
- bump1 = 1
- LBumper1.TimerEnabled = 1
- End Sub
- Sub LBumper1_Timer()
- Select Case bump1
- Case 1:Ring1a.IsDropped = 0:bump1 = 2
- Case 2:Ring1b.IsDropped = 0:Ring1a.IsDropped = 1:bump1 = 3
- Case 3:Ring1c.IsDropped = 0:Ring1b.IsDropped = 1:bump1 = 4
- Case 4:Ring1c.IsDropped = 1:Me.TimerEnabled = 0
- End Select
- End Sub
- Sub RBumper_Hit:vpmTimer.PulseSw 53:vpPlay "fx_bumper2":bump2 = 1:Me.TimerEnabled = 1:End Sub
- Sub RBumper_Timer()
- Select Case bump2
- Case 1:Ring2a.IsDropped = 0:bump2 = 2
- Case 2:Ring2b.IsDropped = 0:Ring2a.IsDropped = 1:bump2 = 3
- Case 3:Ring2c.IsDropped = 0:Ring2b.IsDropped = 1:bump2 = 4
- Case 4:Ring2c.IsDropped = 1:Me.TimerEnabled = 0
- End Select
- End Sub
- Sub BBumper_Hit:vpmTimer.PulseSw 55:vpPlay "fx_bumper3":bump3 = 1:Me.TimerEnabled = 1:End Sub
- Sub BBumper_Timer()
- Select Case bump3
- Case 1:Ring3a.IsDropped = 0:bump3 = 2
- Case 2:Ring3b.IsDropped = 0:Ring3a.IsDropped = 1:bump3 = 3
- Case 3:Ring3c.IsDropped = 0:Ring3b.IsDropped = 1:bump3 = 4
- Case 4:Ring3c.IsDropped = 1:Me.TimerEnabled = 0
- End Select
- End Sub
- ' Drain holes, vuks & saucers
- Sub Drain_Hit
- ClearBallID
- vpPlay "fx_drain"
- bsTrough.AddBall Me
- End Sub
- ' Trap Door Holes with animation
- Dim aBall, aZpos
- Sub TDHole1_Hit
- Set aBall = ActiveBall
- ClearballID
- vpPlay "fx_kicker_enter"
- aZpos = 35
- Me.TimerInterval = 2
- Me.TimerEnabled = 1
- End Sub
- Sub TDHole1_Timer
- aBall.Z = aZpos
- aZpos = aZpos-4
- If aZpos < -30 Then
- Me.TimerEnabled = 0
- Me.DestroyBall
- bsTrapDoor.AddBall Me
- End If
- End Sub
- 'Spinner
- Sub sw117_Spin():vpmTimer.PulseSw 117:vpPlay "fx_spinner":End Sub
- Sub sw115_Spin():vpmTimer.PulseSw 115:vpPlay "fx_spinner":End Sub
- ' Rollovers & Ramp Switches
- Sub sw27_Hit:la1.IsDropped = 1:Controller.Switch(27) = 1:vpPlay "fx_sensor":End Sub
- Sub sw27_UnHit:la1.IsDropped = 0:Controller.Switch(27) = 0:End Sub
- Sub sw57_Hit:la2.IsDropped = 1:Controller.Switch(57) = 1:vpPlay "fx_sensor":End Sub
- Sub sw57_UnHit:la2.IsDropped = 0:Controller.Switch(57) = 0:End Sub
- Sub sw48_Hit:la3.IsDropped = 1:Controller.Switch(48) = 1:vpPlay "fx_sensor":End Sub
- Sub sw48_UnHit:la3.IsDropped = 0:Controller.Switch(48) = 0:End Sub
- Sub sw28_Hit:la4.IsDropped = 1:Controller.Switch(28) = 1:vpPlay "fx_sensor":End Sub
- Sub sw28_UnHit:la4.IsDropped = 0:Controller.Switch(28) = 0:End Sub
- Sub sw25_Hit:la5.IsDropped = 1:Controller.Switch(25) = 1:vpPlay "fx_sensor":End Sub
- Sub sw25_UnHit:la5.IsDropped = 0:Controller.Switch(25) = 0:End Sub
- Sub sw15_Hit:Controller.Switch(15) = 1:vpPlay "fx_sensor":End Sub
- Sub sw15_Unhit:Controller.Switch(15) = 0:End Sub
- Sub sw23_Hit:Controller.Switch(23) = 1:vpPlay "fx_sensor":End Sub
- Sub sw23_Unhit:Controller.Switch(23) = 0:End Sub
- Sub sw26_Hit:Controller.Switch(26) = 1:vpPlay "fx_sensor":End Sub
- Sub sw26_Unhit:Controller.Switch(26) = 0:End Sub
- Sub sw17_Hit:Controller.Switch(17) = 1:vpPlay "fx_sensor":End Sub
- Sub sw17_Unhit:Controller.Switch(17) = 0:End Sub
- Sub sw75_Hit:Controller.Switch(75) = 1:vpPlay "fx_sensor":End Sub
- Sub sw75_Unhit:Controller.Switch(75) = 0:End Sub
- Sub sw76_Hit:Controller.Switch(76) = 1:vpPlay "fx_sensor":End Sub
- Sub sw76_Unhit:Controller.Switch(76) = 0:End Sub
- Sub sw45_Hit:Controller.Switch(45) = 1:vpPlay "fx_sensor":End Sub
- Sub sw45_Unhit:Controller.Switch(45) = 0:vpPlay "fx_metalrolling":End Sub
- Sub sw65_Hit:Controller.Switch(65) = 1:vpPlay "fx_sensor":End Sub
- Sub sw65_Unhit:Controller.Switch(65) = 0:vpPlay "fx_metalrolling":End Sub
- Sub sw64_Hit
- Controller.Switch(64) = 1
- If ActiveBall.VelX > 15 then ActiveBall.VelX = 15
- End Sub
- Sub sw64_Unhit:Controller.Switch(64) = 0:End Sub
- Sub sw12_Hit:Controller.Switch(12) = 1:End Sub
- Sub sw12_Unhit:Controller.Switch(12) = 0:End Sub
- Sub sw16_Hit:Controller.Switch(16) = 1:End Sub
- Sub sw16_Unhit:Controller.Switch(16) = 0:End Sub
- Sub sw63_Hit:Controller.Switch(63) = 1:End Sub
- Sub sw63_Unhit:Controller.Switch(63) = 0:End Sub
- ' Targets
- Sub sw41_Hit:vpmTimer.PulseSw 41:sw41.IsDropped = 1:sw41a.IsDropped = 0:Me.TimerEnabled = 1:vpPlay "fx_target":End Sub
- Sub sw41_Timer:sw41.IsDropped = 0:sw41a.IsDropped = 1:Me.TimerEnabled = 0:End Sub
- Sub sw58_Hit:vpmTimer.PulseSw 58:sw58.IsDropped = 1:sw58a.IsDropped = 0:Me.TimerEnabled = 1:vpPlay "fx_target":sw58p.rotx=5:End Sub
- Sub sw58_Timer:sw58.IsDropped = 0:sw58a.IsDropped = 1:sw58p.rotx=0:Me.TimerEnabled = 0:End Sub
- Sub sw61_Hit:vpmTimer.PulseSw 61:sw61.IsDropped = 1:sw61a.IsDropped = 0:Me.TimerEnabled = 1:vpPlay "fx_target":End Sub
- Sub sw61_Timer:sw61.IsDropped = 0:sw61a.IsDropped = 1:Me.TimerEnabled = 0:End Sub
- Sub sw62_Hit:vpmTimer.PulseSw 62:sw62.IsDropped = 1:sw62a.IsDropped = 0:Me.TimerEnabled = 1:vpPlay "fx_target":End Sub
- Sub sw62_Timer:sw62.IsDropped = 0:sw62a.IsDropped = 1:Me.TimerEnabled = 0:End Sub
- Sub sw56_Hit:vpmTimer.PulseSw 56:sw56.IsDropped = 1:sw56a.IsDropped = 0:Me.TimerEnabled = 1:vpPlay "fx_target":End Sub
- Sub sw56_Timer:sw56.IsDropped = 0:sw56a.IsDropped = 1:Me.TimerEnabled = 0:End Sub
- Sub sw38_Hit:vpmTimer.PulseSw 38:sw38.IsDropped = 1:sw38a.IsDropped = 0:Me.TimerEnabled = 1:vpPlay "fx_target":End Sub
- Sub sw38_Timer:sw38.IsDropped = 0:sw38a.IsDropped = 1:Me.TimerEnabled = 0:End Sub
- Sub sw38b_Hit:vpmTimer.PulseSw 38:sw38b.IsDropped = 1:sw38c.IsDropped = 0:Me.TimerEnabled = 1:vpPlay "fx_target":End Sub
- Sub sw38b_Timer:sw38b.IsDropped = 0:sw38c.IsDropped = 1:Me.TimerEnabled = 0:End Sub
- Sub sw37_Hit:vpmTimer.PulseSw 37:vpPlay "fx_target":End Sub
- Sub sw37b_Hit:vpmTimer.PulseSw 37:vpPlay "fx_target":End Sub
- Sub sw37d_Hit:vpmTimer.PulseSw 37:vpPlay "fx_target":End Sub
- Sub sw74_Hit:vpmTimer.PulseSw 74:vpPlay "fx_rubber":End Sub
- ' Ramps helpers
- Sub RHelp1_Hit()
- ActiveBall.VelZ = -2
- ActiveBall.VelY = 0
- ActiveBall.VelX = 0
- StopSound "fx_metalrolling"
- vpmTimer.AddTimer 100, "BallSound"
- End Sub
- Sub RHelp2_Hit()
- ActiveBall.VelZ = -2
- ActiveBall.VelY = 0
- ActiveBall.VelX = 0
- StopSound "fx_metalrolling"
- vpmTimer.AddTimer 100, "BallSound"
- End Sub
- Sub RHelp3_Hit:vpmTimer.AddTimer 150, "BallSound":End Sub
- Sub RHelp4_Hit:vpmTimer.AddTimer 150, "BallSound":End Sub
- Sub BallSound(dummy):vpPlay "fx_BallHit":End Sub
- '*********
- 'Solenoids
- '*********
- SolCallback(1) = "Auto_Plunger"
- SolCallBack(2) = "SolCannon"
- SolCallBack(7) = "BoomUp"
- SolCallBack(8) = "BoomDown"
- SolCallback(9) = "SolRelease"
- SolCallBack(14) = "bsLeftSaucer.SolOut"
- SolCallBack(15) = "bsRightSaucer.SolOut"
- SolCallback(16) = "vlLock.SolExit"
- SolCallBack(33) = "bsPopper.SolOut"
- SolCallback(34) = "vpmSolToggleWall LockDiverterOff,LockDiverterOn,""SolenoidOn"","
- SolCallBack(35) = "SolRingmasterMagnet"
- SolCallBack(36) = "UpperPost.IsDropped = Not "
- 'Flashers
- SolCallBack(17) = "Sol17"
- SolCallBack(18) = "Sol18"
- SolCallBack(19) = "Sol19"
- SolCallBack(20) = "Sol20"
- SolCallBack(21) = "Sol21"
- SolCallBack(23) = "SetLamp 123,"
- SolCallBack(24) = "Sol24"
- SolCallBack(25) = "Sol25"
- SolCallBack(26) = "Sol26"
- SolCallBack(27) = "RMFlasher"
- SolCallBack(28) = "Sol28"
- SolCallBack(37) = "Sol37"
- '********************
- ' Special JP Flippers
- '********************
- SolCallback(sLRFlipper) = "SolRFlipper"
- SolCallback(sLLFlipper) = "SolLFlipper"
- '******************************************
- 'Added by JF
- '******************************************
- Dim StartLeftFlipperStrength, StartRightFlipperStrength
- Dim StartLeftFlipperSpeed, StartRightFlipperSpeed
- Dim StartLeftFlipperReturn, StartRightFlipperReturn
- if useBMPR = 0 then
- StartLeftFlipperStrength=LeftFlipper.Strength
- StartRightFlipperStrength=RightFlipper.Strength
- StartLeftFlipperSpeed=LeftFlipper.Speed
- StartRightFlipperSpeed=RightFlipper.Speed
- StartLeftFlipperReturn=LeftFlipper.Return
- StartRightFlipperReturn=RightFlipper.Return
- else
- StartLeftFlipperStrength=LeftFlipper1.Strength
- StartRightFlipperStrength=RightFlipper1.Strength
- StartLeftFlipperSpeed=LeftFlipper1.Speed
- StartRightFlipperSpeed=RightFlipper1.Speed
- StartLeftFlipperReturn=LeftFlipper1.Return
- StartRightFlipperReturn=RightFlipper1.Return
- end if
- '******************************************
- ' Use FlipperTimers to call div subs
- '******************************************
- Dim LFTCount:LFTCount=1
- Sub LeftFlipperTimer_Timer()
- If LFTCount < 6 Then
- LFTCount = LFTCount + 1
- LeftFlipper.Strength = StartLeftFlipperStrength*(LFTCount/6)
- LeftFlipper1.Strength = StartLeftFlipperStrength*(LFTCount/6)
- LeftFlipper2.Strength = StartLeftFlipperStrength*(LFTCount/6)
- Else
- Me.Enabled=0
- End If
- End Sub
- Dim RFTCount:RFTCount=1
- Sub RightFlipperTimer_Timer()
- If RFTCount < 6 Then
- RFTCount = RFTCount + 1
- RightFlipper.Strength = StartRightFlipperStrength*(RFTCount/6)
- RightFlipper1.Strength = StartRightFlipperStrength*(RFTCount/6)
- RightFlipper2.Strength = StartRightFlipperStrength*(RFTCount/6)
- Else
- Me.Enabled=0
- End If
- End Sub
- Sub SolLFlipper(Enabled)
- If Enabled Then
- LeftFlipperTimer.Enabled=0
- vpPlay "fx_flipperup1"
- LeftFlipper.RotateToEnd
- LeftFlipper1.RotateToEnd
- LeftFlipper2.RotateToEnd
- Else
- LFTCount=1
- vpPlay "fx_flipperdown"
- LeftFlipper.Speed=.05 'Temporarily drop speed for slower back draw to help visuals on quick tap
- LeftFlipper.Return=.3 'Increase Return strength to compensate for speed drop on return to help against weak ball hit strength from underneath flipper (draining position)
- LeftFlipper.RotateToStart
- LeftFlipper.Strength = StartLeftFlipperStrength*(LFTCount/6)
- LeftFlipperTimer.Enabled=1
- LeftFlipper.Speed=StartLeftFlipperSpeed
- LeftFlipper.Return=StartLeftFlipperReturn
- LeftFlipper1.Speed=.05 'Temporarily drop speed for slower back draw to help visuals on quick tap
- LeftFlipper1.Return=.3 'Increase Return strength to compensate for speed drop on return to help against weak ball hit strength from underneath flipper (draining position)
- LeftFlipper1.RotateToStart
- LeftFlipper1.Strength = StartLeftFlipperStrength*(LFTCount/6)
- LeftFlipper1.Speed=StartLeftFlipperSpeed
- LeftFlipper1.Return=StartLeftFlipperReturn
- LeftFlipper2.Speed=.05 'Temporarily drop speed for slower back draw to help visuals on quick tap
- LeftFlipper2.Return=.3 'Increase Return strength to compensate for speed drop on return to help against weak ball hit strength from underneath flipper (draining position)
- LeftFlipper2.RotateToStart
- LeftFlipper2.Strength = StartLeftFlipperStrength*(LFTCount/6)
- LeftFlipper2.Speed=StartLeftFlipperSpeed
- LeftFlipper2.Return=StartLeftFlipperReturn
- End If
- End Sub
- Sub SolRFlipper(Enabled)
- If Enabled Then
- RightFlipperTimer.Enabled=0
- vpPlay "fx_flipperup2"
- RightFlipper.RotateToEnd
- RightFlipper1.RotateToEnd
- RightFlipper2.RotateToEnd
- Else
- RFTCount=1
- vpPlay "fx_flipperdown"
- RightFlipper.Speed=.05 'Temporarily drop speed for slower back draw to help visuals on quick tap
- RightFlipper.Return=.3 'Increase Return strength to compensate for speed drop on return to help against weak ball hit strength from underneath flipper (draining position)
- RightFlipper.RotateToStart
- RightFlipper.Strength = StartRightFlipperStrength*(RFTCount/6)
- RightFlipperTimer.Enabled=1
- RightFlipper.Speed=StartRightFlipperSpeed
- RightFlipper.Return=StartRightFlipperReturn
- RightFlipper1.Speed=.05 'Temporarily drop speed for slower back draw to help visuals on quick tap
- RightFlipper1.Return=.3 'Increase Return strength to compensate for speed drop on return to help against weak ball hit strength from underneath flipper (draining position)
- RightFlipper1.RotateToStart
- RightFlipper1.Strength = StartRightFlipperStrength*(RFTCount/6)
- RightFlipper1.Speed=StartRightFlipperSpeed
- RightFlipper1.Return=StartRightFlipperReturn
- RightFlipper2.Speed=.05 'Temporarily drop speed for slower back draw to help visuals on quick tap
- RightFlipper2.Return=.3 'Increase Return strength to compensate for speed drop on return to help against weak ball hit strength from underneath flipper (draining position)
- RightFlipper2.RotateToStart
- RightFlipper2.Strength = StartRightFlipperStrength*(RFTCount/6)
- RightFlipper2.Speed=StartRightFlipperSpeed
- RightFlipper2.Return=StartRightFlipperReturn
- End If
- End Sub
- Sub LeftFlipper_Collide(parm)
- vpPlay "fx_rubber_flipper"
- End Sub
- Sub RightFlipper_Collide(parm)
- vpPlay "fx_rubber_flipper"
- End Sub
- Sub LeftFlipper1_Collide(parm)
- vpPlay "fx_rubber_flipper"
- End Sub
- Sub RightFlipper1_Collide(parm)
- vpPlay "fx_rubber_flipper"
- End Sub
- Sub LeftFlipper2_Collide(parm)
- vpPlay "fx_rubber_flipper"
- End Sub
- Sub RightFlipper2_Collide(parm)
- vpPlay "fx_rubber_flipper"
- End Sub
- '***********************
- ' Flipper Logo
- '***********************
- Sub UpdateFlipperLogos
- LogoR.rotz = RightFlipper.CurrentAngle
- LogoL.rotz = LeftFlipper.CurrentAngle
- End Sub
- '**************
- ' Solenoid Subs
- '**************
- Sub SolRelease(Enabled)
- If Enabled And bsTrough.Balls > 0 Then
- vpmTimer.PulseSw 31
- bsTrough.ExitSol_On
- End If
- End Sub
- Sub Auto_Plunger(Enabled)
- If Enabled Then
- PlungerIM.Strength = 45 + (Rnd * 5)
- PlungerIM.AutoFire
- PlungerIM.Strength = Plunger.MechStrength
- vpPlay "fx_Solenoid"
- End If
- End Sub
- Dim FireCannon,CannonFlag
- CannonFlag=0
- Sub SolCannon(Enabled)
- If CannonFlag=0 Then
- If Enabled Then
- vpPlay "fx_Solenoid"
- FireCannon=FireCannon+1:If FireCannon>255 Then FireCannon=0
- SetB2SData 4,FireCannon
- Cannon.Enabled=1
- CannonFlag=1
- End If
- End If
- End Sub
- Sub Cannon_Timer()
- CannonFlag=CannonFlag+1
- Select Case CannonFlag
- Case 2
- vpmTimer.PulseSw 11
- vpPlay "fx_Bell10"
- Case 3
- Cannon.Enabled=0
- CannonFlag=0
- End Select
- End Sub
- Sub BoomUp(Enabled)
- Dim obj
- If Enabled Then
- For each obj in cBoomBumper:obj.IsDropped = 0:Next
- boomramp.alpha = 1
- vpPlay "fx_motor"
- BoomTrigger.enabled = 1
- End If
- End Sub
- Sub BoomDown(Enabled)
- Dim obj
- If Enabled Then
- For each obj in cBoomBumper2:obj.IsDropped = 1:Next
- boomramp.alpha = 0
- vpPlay "fx_motor"
- BoomTrigger.enabled = 0
- End If
- End Sub
- Sub BoomTrigger_Hit
- activeball.z = activeball.z + 80
- End Sub
- ' *********************
- ' Ring Master subs
- ' *********************
- Dim KickAngle
- Sub SolRingmasterMagnet(Enabled)
- mRingmasterMagnet.MagnetOn = Enabled
- RMMagnetkicker.Enabled = Enabled
- If Not Enabled And RMBallInMagnet Then
- mRingmasterMagnet.RemoveBall RMMagBall
- KickAngle = 135 + Rnd * 180
- cball.vely = cball.vely + dcos(KickAngle)*2
- cball.velx = cball.velx - dsin(KickAngle)*2
- vpmTimer.AddTimer 400, "RMKick"
- vpmTimer.AddTimer 200, "BallSound"
- End If
- End Sub
- Sub RMMagnetkicker_Hit
- Set RMMagBall = ActiveBall
- RMBallInMagnet = 1
- End Sub
- Sub RMKick(dummy)
- RMMagnetkicker.kick KickAngle, rnd * 7 + 7
- RMBallInMagnet = 0
- RMMagBall = Empty
- End Sub
- Dim RMBallInMagnet, RMMagBall, RMBall, RMFlashOn, RMCurrPos
- RMBallInMagnet = 0:RMFlashOn = 0:RMCurrPos = 0
- Sub sw38r_Hit
- Set RMBall = ActiveBall
- vpPlay "fx_woodhit"
- vpmTimer.PulseSw 38
- If RMCurrPos > 102 Then
- RMShake
- If cController = 3 Then
- Controller.B2SSetData 101,1:Controller.B2SSetData 101,0
- End If
- End If
- End Sub
- Sub UpdateRM(aCurrPos, aSpeed, aLastPos)
- RMCurrPos = aCurrPos
- Ringmaster_Down.alpha = NOT cbool(RMCurrPos>4)
- Ringmaster_Down2.alpha = NOT cbool(RMCurrPos>4)
- Ringmaster.z = (RMCurrPos-4) * 265.5/144 - 265.5
- RMHitWall.IsDropped = NOT RMCurrPos > 4
- sw38r.enabled = RMCurrPos > 4
- If (RMCurrPos >37 And RMCurrPos < 40) AND RMCurrPos > aLastPos Then cball.vely = cball.vely - 1.5
- If RMBallInMagnet Then RMMagBall.z = Ringmaster.z + 50 + 265.5
- If aCurrPos >= 140 Then
- vpmSolToggleObj cRMHoles, Nothing, 0, 1
- RMHitWall.IsDropped = 1
- sw38r.enabled = 0
- Jackpot.Isdropped = 0
- Else
- vpmSolToggleObj cRMHoles, Nothing, 0, 0
- Jackpot.Isdropped = 1
- End If
- End Sub
- Sub RMFlasher(Enabled)
- RMFlashOn = ABS(Enabled)
- SetLamp 127, RMFlashOn
- If RMFlashOn Then
- Ringmaster.image = RMImages(1)
- Else
- Ringmaster.image = RMImages(0)
- End If
- End Sub
- '************* RM Shake Scripting *************
- Dim mMagnet, cBall, pMod, rmmod
- Set mMagnet = new cvpmMagnet
- With mMagnet
- .InitMagnet WobbleMagnet, 1.5
- .Size = 100
- .CreateEvents mMagnet
- .MagnetOn = True
- End With
- WobbleInit
- Sub RMShake
- cball.velx = cball.velx + rmball.velx*pMod
- cball.vely = cball.vely + rmball.vely*pMod
- End Sub
- 'Includes stripped down version of my reverse slope scripting for a single ball
- Dim ngrav, ngravmod, pslope, nslope, slopemod
- Sub WobbleInit
- pslope = Table1.SlopeMin +((Table1.SlopeMax - Table1.SlopeMin) * Table1.GlobalDifficulty)
- nslope = pslope
- slopemod = pslope + nslope
- ngravmod = 60/aWobbleTimer.interval
- ngrav = slopemod * .0905 * Table1.Gravity / ngravmod
- pMod = .15 'percentage of hit power transfered to captive wobble ball
- Set cBall = ckicker.createball:cball.image = "blank":ckicker.Kick 0,0:mMagnet.addball cball
- aWobbleTimer.enabled = 1
- End Sub
- Sub aWobbleTimer_Timer
- BallShake.Enabled = RMBallInMagnet
- cBall.Vely = cBall.VelY-ngrav 'modifier for slope reversal/cancellation
- rmmod = (ringmaster.z+265.5)/265*.4 '.4 is a 40% modifier for ratio of ball movement to head movement
- ringmaster.rotx = (ckicker.y - cball.y)*rmmod
- ringmaster.roty = (cball.x - ckicker.x)*rmmod
- End Sub
- Sub BallShake_Timer
- If Not IsEmpty(RMMagBall) Then
- RMMagBall.y = RMMagnetkicker.y - dsin(ringmaster.rotx)*265.5
- RMMagBall.x = RMMagnetkicker.x + dsin(ringmaster.roty)*265.5
- End If
- End Sub
- '************* End Shake Scripting ****************
- ' **************
- ' Subway Handler
- ' **************
- ' Side Show holes
- Sub cSSHoles_Hit(idx):SubwayHandler Me(idx), 46:End Sub
- ' Ringmaster holes
- Sub cRMHoles_Hit(idx):SubwayHandler Me(idx), 47:End Sub
- Sub SubwayHandler(aKick, aSwNo)
- ClearballID
- aKick.Destroyball:vpPlay "fx_kicker_enter"
- vpmTimer.PulseSwitch aSwNo, 2000, "bsPopper.AddBall 0'"
- End Sub
- ' ********************************
- ' Menagerie Ball (Wild Ball)
- ' ********************************
- Dim WBall
- Sub CreateWildBall()
- Set WBall = kicker1.Createsizedball(50):WBall.Image = BigBallImage(BColor):kicker1.Kick 0, 0
- ' WBall.CollisionMass = 1
- End Sub
- 'Original GI Sub.
- dim gi9img:gi9img=array("plastics","plastics_on")
- UpdateGI 0, 0:UpdateGI 1, 0:UpdateGI 2, 0:UpdateGI 3, 0
- Sub UpdateGI1(no, Enabled)
- Select Case no
- Case 2 'left
- 'gi1.State = ABS(Enabled)
- 'gi2.State = ABS(Enabled)
- 'gi3.IsDropped = NOT Enabled
- 'gi4.IsDropped = NOT Enabled
- 'gi5.IsDropped = NOT Enabled
- 'gi6.IsDropped = NOT Enabled
- 'gi7.IsDropped = NOT Enabled
- 'gi8.IsDropped = NOT Enabled
- 'gi13.IsDropped = NOT Enabled
- bumper6.State = ABS(Enabled)
- bumper7.State = ABS(Enabled)
- bumper8.State = ABS(Enabled)
- bumper9.State = ABS(Enabled)
- 'bumper11.State = ABS(Enabled)
- 'bumper12.State = ABS(Enabled)
- 'bumper13.State = ABS(Enabled)
- 'bumper14.State = ABS(Enabled)
- 'bumper15.State = ABS(Enabled)
- refresh.state = ABS(refresh.state-1)
- Case 1 'middle
- 'gi10.State = ABS(Enabled)
- 'gi11.State = ABS(Enabled)
- 'gi12.IsDropped = NOT Enabled
- 'gi14.State = ABS(Enabled)
- 'gi15.State = ABS(Enabled)
- 'gi16.State = ABS(Enabled)
- 'gi17.State = ABS(Enabled)
- 'bumper16.State = ABS(Enabled)
- 'bumper17.State = ABS(Enabled)
- 'bumper18.State = ABS(Enabled)
- 'bumper19.State = ABS(Enabled)
- bumper20.State = ABS(Enabled)
- bumper21.State = ABS(Enabled)
- bumper22.State = ABS(Enabled)
- 'bumper23.State = ABS(Enabled)
- 'bumper24.State = ABS(Enabled)
- 'bumper25.State = ABS(Enabled)
- 'bumper26.State = ABS(Enabled)
- 'bumper27.State = ABS(Enabled)
- 'bumper31.State = ABS(Enabled)
- 'bumper32.State = ABS(Enabled)
- 'bumper33.State = ABS(Enabled)
- refresh.state = ABS(refresh.state-1)
- Case 0 'right
- 'gi18.State = ABS(Enabled)
- 'gi19.State = ABS(Enabled)
- 'gi20.IsDropped = NOT Enabled
- 'gi21.IsDropped = NOT Enabled
- 'gi22.IsDropped = NOT Enabled
- 'gi23.IsDropped = NOT Enabled
- 'bumper1.State = ABS(Enabled)
- bumper2.State = ABS(Enabled)
- bumper3.State = ABS(Enabled)
- bumper4.State = ABS(Enabled)
- bumper5.State = ABS(Enabled)
- 'bumper10.State = ABS(Enabled)
- 'bumper29.State = ABS(Enabled)
- 'bumper30.State = ABS(Enabled)
- refresh.state = ABS(refresh.state-1)
- End Select
- End Sub
- '***********
- ' Update GI
- '***********
- Dim gistep
- gistep = 255/8
- Sub UpdateGI(no, step)
- Controller.Switch(22) = 1 'fix motor
- If step = 0 OR step = 7 then exit sub
- Select Case no
- Case 0 'right
- flasher_tglass.alpha = gistep *step
- sling_gi_right.alpha = gistep *step
- rlt1.alpha = gistep *step
- rlt2.alpha = gistep *step
- rlt3.alpha = gistep *step
- rlt4.alpha = gistep *step
- rlt5.alpha = gistep *step
- rlt6.alpha = gistep *step
- rlt7.alpha = gistep *step
- rlt8.alpha = gistep *step
- rtl9.alpha = gistep *step
- rtl10.alpha = gistep *step
- rtl11.alpha = gistep *step
- rtl12.alpha = gistep *step
- rtl13.alpha = gistep *step
- Case 1 'middle
- mgi1.alpha = gistep *step
- mgi2.alpha = gistep *step
- mgi3.alpha = gistep *step
- mgi4.alpha = gistep *step
- mgi5.alpha = gistep *step
- mgi6.alpha = gistep *step
- mgi7.alpha = gistep *step
- mgi8.alpha = gistep *step
- mgi9.alpha = gistep *step
- mgi10.alpha = gistep *step
- mgi11.alpha = gistep *step
- mgi12.alpha = gistep *step
- mgi13.alpha = gistep *step
- mgi14.alpha = gistep *step
- mgi15.alpha = gistep *step
- mgi16.alpha = gistep *step
- mgi17.alpha = gistep *step
- mgi18.alpha = gistep *step
- mgi19.alpha = gistep *step
- mgi20.alpha = gistep *step
- Case 2 'left
- sling_gi_left.alpha = gistep *step
- slt1.alpha = gistep *step
- slt2.alpha = gistep *step
- slt3.alpha = gistep *step
- slt4.alpha = gistep *step
- slt5.alpha = gistep *step
- slt6.alpha = gistep *step
- slt7.alpha = gistep *step
- slt8.alpha = gistep *step
- slt9.alpha = gistep *step
- slt10.alpha = gistep *step
- slt11.alpha = gistep *step
- slt12.alpha = gistep *step
- slt13.alpha = gistep *step
- slt_a.alpha = gistep *step
- slt_a1.alpha = gistep *step
- slt14.alpha = gistep *step
- slt15.alpha = gistep *step
- slt16.alpha = gistep *step
- slt17.alpha = gistep *step
- slt18.alpha = gistep *step
- slt19.alpha = gistep *step
- slt20.alpha = gistep *step
- End Select
- End Sub
- '******************
- ' RealTime Updates
- '******************
- Set MotorCallback = GetRef("GameTimer")
- Sub GameTimer
- RollingSound
- UpdateFlipperLogos
- UpdateVisuals
- End Sub
- '****************************************
- ' Based on rascal's Ball Rolling Script
- '****************************************
- Dim VeloY(3), VeloX(3), rolling(3), b
- b = 0
- Sub RollingSound()
- b = b + 1
- If b > 3 Then b = 1
- If BallStatus(b) = 0 Then
- If rolling(b) = True Then
- StopSound "fx_ballrolling" &b
- rolling(b) = False
- Exit Sub
- Else
- Exit Sub
- End If
- End if
- VeloY(b) = Cint(CurrentBall(b).VelY)
- VeloX(b) = Cint(CurrentBall(b).VelX)
- If(ABS(VeloY(b) ) > 3 or ABS(VeloX(b) ) > 3) and CurrentBall(b).Z < 55 Then 'do not sound if the ball is on a ramp
- If rolling(b) = True then
- Exit Sub
- Else
- rolling(b) = True
- PlaySound "fx_ballrolling" &b
- End If
- Else
- If rolling(b) = True Then
- StopSound "fx_ballrolling" &b
- rolling(b) = False
- End If
- End If
- End Sub
- '****************************************
- ' B2B Collision by Steely & Pinball Ken
- '****************************************
- Dim tnopb, nosf, iball, cnt, errMessage, B2BOn
- CheckB2B
- XYdata.interval = 10 ' <<<<< ADD timer named XYData to table
- tnopb = 5 ' <<<<< SET to the "Total Number Of Possible Balls" in play at any one time
- nosf = 10 ' <<<<< SET to the "Number Of Sound Files" used / B2B collision volume levels
- ReDim CurrentBall(tnopb), BallStatus(tnopb)
- For cnt = 0 to ubound(BallStatus) : BallStatus(cnt) = 0 : Next
- '****************************************
- ' B2B AutoDisable for XP x64 Added by Koadic
- '****************************************
- Sub CheckB2B ' Added by Koadic for XP x64 handling
- Dim osver, cpuver, check
- On Error Resume Next
- For x = 0 to 1 : If B2BOn = x Then Exit Sub : End If : Next 'If B2BOn is set manually, then end routine
- Set check = CreateObject("WScript.Shell")
- osver = check.RegRead ("HKLM\Software\Microsoft\Windows NT\CurrentVersion\CurrentVersion")
- cpuver = check.RegRead ("HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment\Processor_Architecture")
- If osver < 6 and cpuver = "AMD64" Then B2BOn = 0 Else B2BOn = 1 'If OS is XP and 64bit, then disable B2B
- If Err Then B2BOn = 1 'If there is an error in detecting either OS or x32/x64, then default to On
- On Error Goto 0
- End Sub
- '======================================================
- ' <<<<<<<<<<<<<< Ball Identification >>>>>>>>>>>>>>
- '======================================================
- '******************************
- ' Destruk's alternative vpmCreateBall for use with B2B Enabled tables
- ' Core.vbs calls vpmCreateBall when a ball is created from a ball stack
- '******************************
- If IsEmpty(Eval("vpmCreateBall"))=false Then Set vpmCreateBall = GetRef("B2BvpmCreateBall") ' Override the core.vbs and redefine vpmCreateBall
- Function B2BvpmCreateBall(aKicker)
- Dim bsize2:If IsEmpty(Eval("ballsize"))=true Then bsize2 = 25 Else bsize2 = ballsize/2
- For cnt = 1 to ubound(ballStatus) ' Loop through all possible ball IDs
- If ballStatus(cnt) = 0 Then ' If ball ID is available...
- If Not IsEmpty(vpmBallImage) Then ' Set ball object with the first available ID
- Set CurrentBall(cnt) = aKicker.Createsizedball(bsize2).Image
- Else
- Set CurrentBall(cnt) = aKicker.Createsizedball(bsize2)
- End If
- Set B2BvpmCreateBall = aKicker
- CurrentBall(cnt).uservalue = cnt ' Assign the ball's uservalue to it's new ID
- ballStatus(cnt) = 1 ' Mark this ball status active
- ballStatus(0) = ballStatus(0)+1 ' Increment ballStatus(0), the number of active balls
- If B2BOn > 0 Then ' If B2BOn is 0, it overrides auto-turn on collision detection
- ' If more than one ball active, start collision detection process
- If ballStatus(0) > 1 and XYdata.enabled = False Then XYdata.enabled = True
- End If
- Exit For ' New ball ID assigned, exit loop
- End If
- Next
- End Function
- 'Call this sub from every kicker that destroys a ball, before the ball is destroyed.
- Sub ClearBallid
- On Error Resume Next ' Error handling for debugging purposes
- iball = ActiveBall.uservalue ' Get the ball ID to be cleared
- If Err Then Msgbox Err.description & vbCrLf & iball
- ballStatus(iBall) = 0 ' Clear the ball status
- ballStatus(0) = ballStatus(0)-1 ' Subtract 1 ball from the # of balls in play
- On Error Goto 0
- End Sub
- '=====================================================
- ' <<<<<<<<<<<<<<<<< XYdata_Timer >>>>>>>>>>>>>>>>>
- '=====================================================
- 'Ball data collection and B2B Collision detection.
- ReDim baX(tnopb,4), baY(tnopb,4), baZ(tnopb,4), bVx(tnopb,4), bVy(tnopb,4), TotalVel(tnopb,4)
- Dim cForce, bDistance, xyTime, cFactor, id, id2, id3, B1, B2
- Sub XYdata_Timer()
- xyTime = Timer+(XYdata.interval*.001) ' xyTime is the system timer plus the current interval time
- If id2 >= 4 Then id2 = 0 ' Loop four times and start over
- id2 = id2+1 ' Increment the ball sampler ID
- For id = 1 to ubound(ballStatus) ' Loop once for each possible ball
- If ballStatus(id) = 1 Then ' If ball is active...
- baX(id,id2) = round(CurrentBall(id).x,2) ' Sample x-coord
- baY(id,id2) = round(CurrentBall(id).y,2) ' Sample y-coord
- baZ(id,id2) = round(CurrentBall(id).z,2) ' Sample z-coord
- bVx(id,id2) = round(CurrentBall(id).velx,2) ' Sample x-velocity
- bVy(id,id2) = round(CurrentBall(id).vely,2) ' Sample y-velocity
- TotalVel(id,id2) = (bVx(id,id2)^2 + bVy(id,id2)^2) ' Calculate total velocity
- If TotalVel(id,id2) > TotalVel(0,0) Then TotalVel(0,0) = int(TotalVel(id,id2))
- End If
- Next
- id3 = id2 : B2 = 2 : B1 = 1 ' Set up the counters for looping
- Do
- If ballStatus(B1) = 1 and ballStatus(B2) = 1 Then ' If both balls are active...
- bDistance = int((TotalVel(B1,id3)+TotalVel(B2,id3))^(1.04 * (CurrentBall(B1).radius + CurrentBall(B2).radius)/50))
- If ((baX(B1,id3) - baX(B2,id3))^2 + (baY(B1,id3) - baY(B2,id3))^2) < (2800 * ((CurrentBall(B1).radius + CurrentBall(B2).radius)/50)^2) + bDistance Then
- If ABS(baZ(B1,id3) - baZ(B2,id3)) < (CurrentBall(B1).radius + CurrentBall(B2).radius) Then collide B1,B2 : Exit Sub 'added z axis collision detection here
- End If
- End If
- B1 = B1+1 ' Increment ball1
- If B1 = ubound(ballstatus) Then Exit Do ' Exit loop if all ball combinations checked
- If B1 >= B2 then B1 = 1:B2 = B2+1 ' If ball1 >= reset ball1 and increment ball2
- Loop
- If ballStatus(0) <= 1 Then XYdata.enabled = False ' Turn off timer if one ball or less
- If XYdata.interval >= 40 Then B2BOn = 0 : XYdata.enabled = False ' Auto-shut off
- If Timer > xyTime * 3 Then B2BOn = 0 : XYdata.enabled = False ' Auto-shut off
- If Timer > xyTime Then XYdata.interval = XYdata.interval+1 ' Increment interval if needed
- End Sub
- '=========================================================
- ' <<<<<<<<<<< Collide(ball id1, ball id2) >>>>>>>>>>>
- '=========================================================
- 'Calculate the collision force and play sound accordingly.
- Dim cTime, cb1,cb2, avgBallx, cAngle, bAngle1, bAngle2
- Sub Collide(cb1,cb2)
- If TotalVel(0,0) / 1.8 > cFactor Then cFactor = int(TotalVel(0,0) / 1.8)
- avgBallx = (bvX(cb2,1) + bvX(cb2,2) + bvX(cb2,3) + bvX(cb2,4)) / 4
- If avgBallx < bvX(cb2,id2) + .1 and avgBallx > bvX(cb2,id2) - .1 Then
- If ABS(TotalVel(cb1,id2) - TotalVel(cb2,id2)) < .000005 Then Exit Sub
- End If
- If Timer < cTime Then Exit Sub
- cTime = Timer+.1 ' Limits collisions to .1 seconds apart
- GetAngle baX(cb1,id3) - baX(cb2,id3), baY(cb1,id3) - baY(cb2,id3), cAngle ' Collision angle via x/y-coordinates
- id3 = id3 - 1 : If id3 = 0 Then id3 = 4 ' Step back one xyData sampling for a good velocity reading
- GetAngle bVx(cb1,id3), bVy(cb1,id3), bAngle1 ' ball 1 travel direction, via velocity
- GetAngle bVx(cb2,id3), bVy(cb2,id3), bAngle2 ' ball 2 travel direction, via velocity
- cForce = Cint((abs(TotalVel(cb1,id3)*Cos(cAngle-bAngle1))+abs(TotalVel(cb2,id3)*Cos(cAngle-bAngle2))))
- If cForce < 4 Then Exit Sub ' Another collision limiter
- cForce = Cint((cForce)/(cFactor/nosf)) ' Divides up cForce for the proper sound selection.
- If cForce > nosf-1 Then cForce = nosf-1 ' First sound file 0(zero) minus one from number of sound files
- PlaySound ("collide" & cForce) ' Combines "collide" with the calculated sound level and play sound
- End Sub
- '=================================================
- ' <<<<<<<< GetAngle(X, Y, Anglename) >>>>>>>>
- '=================================================
- Dim Xin,Yin,rAngle,Radit,wAngle,Pi
- Pi = csng(4*Atn(1)) '3.1415926535897932384626433832795
- Sub GetAngle(Xin, Yin, wAngle)
- If Sgn(Xin) = 0 Then
- If Sgn(Yin) = 1 Then rAngle = 3 * Pi/2 Else rAngle = Pi/2
- If Sgn(Yin) = 0 Then rAngle = 0
- Else
- rAngle = atn(-Yin/Xin)
- End If
- If sgn(Xin) = -1 Then Radit = Pi Else Radit = 0
- If sgn(Xin) = 1 and sgn(Yin) = 1 Then Radit = 2 * Pi
- wAngle = round((Radit + rAngle),4)
- End Sub
- '** Extra math to make my life easier **
- Function dCos(degrees)
- Dim Pi:Pi = CSng(4*Atn(1))
- dcos = cos(degrees * Pi/180)
- if ABS(dCos) < 0.000001 Then dCos = 0
- if ABS(dCos) > 0.999999 Then dCos = 1 * sgn(dCos)
- End Function
- Function dSin(degrees)
- Dim Pi:Pi = CSng(4*Atn(1))
- dsin = sin(degrees * Pi/180)
- if ABS(dSin) < 0.000001 Then dSin = 0
- if ABS(dSin) > 0.999999 Then dSin = 1 * sgn(dSin)
- End Function
- Function dAtn(x)
- Dim Pi:Pi = CSng(4*Atn(1))
- datn = atn(x) * 180 / Pi
- End Function
- Function dAtn2(X, Y)
- If X > 0 Then
- dAtn2 = dAtn(Y / X)
- ElseIf X < 0 Then
- dAtn2 = dAtn(Y / X) + 180 * Sgn(Y)
- If Y = 0 Then dAtn2 = dAtn2 + 180
- If Y < 0 Then dAtn2 = dAtn2 + 360
- Else
- dAtn2 = 90 * Sgn(Y)
- End If
- dAtn2 = dAtn2+90
- End Function
- '** End Extra math **
- '----Solenoid Setlamp/Setflash subs to workaround lamp and flash timers being seperate.----'
- Sub Sol37(Enabled)
- SetLamp 137, Enabled
- SetFlash 137, Enabled
- End Sub
- Sub Sol28(Enabled)
- SetLamp 128, Enabled
- SetFlash 128, Enabled
- End Sub
- Sub Sol20(Enabled)
- SetLamp 120, Enabled
- SetFlash 120, Enabled
- End Sub
- Sub Sol19(Enabled)
- SetLamp 119, Enabled
- SetFlash 119, Enabled
- End Sub
- Sub Sol18(Enabled)
- SetLamp 118, Enabled
- SetFlash 118, Enabled
- End Sub
- Sub Sol17(Enabled)
- SetLamp 117, Enabled
- SetFlash 117, Enabled
- End Sub
- Sub Sol21(Enabled)
- SetLamp 121, Enabled
- SetFlash 121, Enabled
- End Sub
- Sub Sol24(Enabled)
- SetLamp 124, Enabled
- SetFlash 124, Enabled
- End Sub
- Sub Sol25(Enabled)
- SetLamp 125, Enabled
- SetFlash 125, Enabled
- End Sub
- Sub Sol26(Enabled)
- SetLamp 126, Enabled
- SetFlash 126, Enabled
- End Sub
- '*********************
- ' Flasher fading sub
- ' vpm version 1
- '*********************
- Dim FlashState(200), FlashLevel(200)
- Dim FlashSpeedUp, FlashSpeedDown
- FlashInit()
- FlasherTimer.Interval = 10
- FlasherTimer.Enabled = 1
- Sub FlashInit
- Dim i
- For i = 0 to 200
- FlashState(i) = 0
- FlashLevel(i) = 0
- Next
- FlashSpeedUp = 50 ' fast speed when turning on the flasher
- FlashSpeedDown = 10 ' slow speed when turning off the flasher, gives a smooth fading
- ' you could also change the default images for each flasher or leave it as in the editor
- ' for example
- ' Flasher1.Image = "fr"
- AllFlashOff()
- End Sub
- Sub AllFlashOff
- Dim i
- For i = 0 to 200
- FlashState(i) = 0
- Next
- End Sub
- Sub FlasherTimer_Timer()
- Flashm 121, Flasher21
- Flashm 121, Flasher21a
- Flashm 121, Flasher_rr2
- Flashm 121, Flasher_rpanel
- Flash 121, Flasher21_glass
- Flashm 124, Flasher24
- Flashm 124, Flasher24a
- Flashm 124, Flasher24b
- Flashm 124, Flasher24c
- Flashm 124, Flasher_lr2
- Flashm 124, Flasher_lpanel
- Flashm 124, Flasher24d
- Flash 124, Flasher24_glass
- Flashm 125, Flasher25
- Flashm 125, Flasher25a
- Flashm 125, Flasher_lr1
- Flashm 125, Flasher_lpanel2
- Flashm 125, Flasher25b
- Flashm 125, Flasher25c
- Flashm 125, Flasher25d
- Flashm 125, Flasher25e
- Flash 125, Flasher25_glass
- Flashm 126, Flasher26
- Flashm 126, Flasher26a
- Flashm 126, Flasher_rr1
- Flashm 126, Flasher_rpanel2
- Flash 126, Flasher26_glass
- Flashm 82, Flasher_LB
- Flashm 82, Flasher_LBa
- Flashm 82, FlasherLB_Glass
- Flash 82, Flasher_LBR
- Flashm 84, Flasher_UB
- Flashm 84, Flasher_UBa
- Flashm 84, FlasherUB_Glass
- Flash 84, Flasher_UBR
- Flashm 117, Flasher17
- Flash 117, Flasher17_glass
- Flashm 118, Flasher18
- Flash 118, Flasher18_glass
- Flashm 119, Flasher19
- Flash 119, Flasher19_glass
- Flashm 120, Flasher20
- Flash 120, Flasher20_glass
- Flash 128, Flasher28
- Flashm 137, Flasher37
- Flashm 137, Flasher37a
- Flashm 137, Flasher37b
- Flashm 137, Flasher37c
- Flashm 137, Flasher37d
- Flashm 137, Flasher37e
- Flash 137, Flasher37_glass
- End Sub
- Sub SetFlash(nr, stat)
- FlashState(nr) = ABS(stat)
- End Sub
- Sub Flash(nr, object)
- Select Case FlashState(nr)
- Case 0 'off
- FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown
- If FlashLevel(nr) < 0 Then
- FlashLevel(nr) = 0
- FlashState(nr) = -1 'completely off
- End if
- Object.alpha = FlashLevel(nr)
- Case 1 ' on
- FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp
- If FlashLevel(nr) > 255 Then
- FlashLevel(nr) = 255
- FlashState(nr) = -2 'completely on
- End if
- Object.alpha = FlashLevel(nr)
- End Select
- End Sub
- Sub Flashm(nr, object) 'multiple flashers, it doesn't change the flashstate
- Select Case FlashState(nr)
- Case 0 'off
- Object.alpha = FlashLevel(nr)
- Case 1 ' on
- Object.alpha = FlashLevel(nr)
- End Select
- End Sub
- '**********************************
- ' JP's Fading Lamps v7.0 VP912
- ' Based on PD's Fading Lights
- ' SetLamp 0 is Off
- ' SetLamp 1 is On
- ' LampState(x) = current state
- '***********************************
- Dim FadingState(200), LampState(200)
- AllLampsOff()
- LampTimer.Interval = 60
- LampTimer.Enabled = 1
- Sub LampTimer_Timer()
- 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)
- If chgLamp(ii, 0) = 82 OR chgLamp(ii, 0) = 84 Then
- FlashState(chgLamp(ii, 0)) = chgLamp(ii, 1)
- LampState(chgLamp(ii, 0)) = chgLamp(ii, 1) + 4
- Else
- LampState(chgLamp(ii, 0)) = chgLamp(ii, 1) + 4
- End If
- Next
- End If
- UpdateLamps
- End Sub
- Sub UpdateLamps
- FadeL 11, l11, l11a
- FadeL 12, l12, l12a
- FadeL 13, l13, l13a
- FadeL 14, l14, l14a
- FadeL 15, l15, l15a
- FadeL 16, l16, l16a
- FadeL 17, l17, l17a
- FadeL 18, l18, l18a
- FadeL 21, l21, l21a
- FadeL 22, l22, l22a
- FadeL 23, l23, l23a
- FadeL 24, l24, l24a
- FadeL 25, l25, l25a
- FadeL 26, l26, l26a
- FadeL 27, l27, l27a
- FadeL 28, l28, l28a
- FadeL 31, l31, l31a
- FadeL 32, l32, l32a
- FadeL 33, l33, l33a
- FadeL 34, l34, l34a
- FadeL 35, l35, l35a
- FadeL 36, l36, l36a
- FadeL 37, l37, l37a
- FadeL 38, l38, l38a
- FadeL 41, l41, l41a
- FadeL 42, l42, l42a
- FadeL 43, l43, l43a
- FadeL 44, l44, l44a
- FadeL 45, l45, l45a
- FadeL 46, l46, l46a
- FadeL 47, l47, l47a
- FadeL 48, l48, l48a
- FadeL 51, l51, l51a
- FadeL 52, l52, l52a
- FadeL 53, l53, l53a
- FadeL 54, l54, l54a
- FadeL 55, l55, l55a
- FadeL 56, l56, l56a
- FadeL 57, l57, l57a
- FadeL 58, l58, l58a
- FadeL 61, l61, l61a
- FadeL 62, l62, l62a
- FadeL 63, l63, l63a
- FadeL 64, l64, l64a
- FadeL 65, l65, l65a
- FadeL 66, l66, l66a
- FadeL 67, l67, l67a
- FadeL 68, l68, l68a
- FadeL 71, l71, l71a
- FadeL 72, l72, l72a
- FadeL 73, l73, l73a
- FadeL 74, l74, l74a
- FadeL 75, l75, l75a
- FadeL 76, l76, l76a
- FadeL 77, l77, l77a
- FadeL 78, l78, l78a
- FadeL 81, l81, l81a
- NFadeL 82, RBumper
- NFadeBoom 83
- NFadeL 84, BBumper
- FadeL 85, l85, l85a
- FadeL 86, l86, l86a
- FadeL 87, l87, l87a
- 'NFadeL 88, l88
- 'flashers
- 'FlashARm 117, f17t, "wf_on", "wf_a", "wf_b", refresh
- FadeL 117, f17, f17a
- 'FlashARm 118, f18t, "bf_on", "bf_a", "bf_b", refresh
- FadeL 118, f18, f18a
- 'FlashARm 119, f19t, "bf_on", "bf_a", "bf_b", refresh
- FadeL 119, f19, f19a
- 'FlashARm 120, f20t, "bf_on", "bf_a", "bf_b", refresh
- FadeL 120, f20, f20a
- NFadeBoom 123
- FadeL 127, f27, f27a
- FadeL 128, f28, f28a
- FadeW 121, f21, f21a, f21b
- FadeW 124, f24, f24a, f24b
- FadeW 125, f25, f25a, f25b
- FadeW 126, f26, f26a, f26b
- FadeARm2 137, neonramp2,"neon_green_on","neon_green_a","neon_green_b","neon_green",refresh
- 'FadeARm2 137, neonglow,"alphaneon-60","alphaneon-45","alphaneon-25","",refresh
- FadeLCo 137, cNeon, cNeona 'light
- refresh.state = ABS(refresh.state-1)
- End Sub
- Sub AllLampsOff()
- Dim x
- For x = 0 to 200
- LampState(x) = 4
- Next
- UpdateLamps:UpdateLamps:Updatelamps
- End Sub
- Sub SetLamp(nr, value)
- If value = 0 AND LampState(nr) = 0 Then Exit Sub
- If value = 1 AND LampState(nr) = 1 Then Exit Sub
- LampState(nr) = abs(value) + 4
- End Sub
- 'Walls
- Sub FadeW(nr, a, b, c)
- Select Case LampState(nr)
- Case 2:c.IsDropped = 1:LampState(nr) = 0 'Off
- Case 3:b.IsDropped = 1:c.IsDropped = 0:LampState(nr) = 2 'fading...
- Case 4:a.IsDropped = 1:b.IsDropped = 0:LampState(nr) = 3 'fading...
- Case 5:a.IsDropped = 0:LampState(nr) = 1 'ON
- End Select
- End Sub
- Sub FadeWm(nr, a, b, c)
- Select Case LampState(nr)
- Case 2:c.IsDropped = 1
- Case 3:b.IsDropped = 1:c.IsDropped = 0
- Case 4:a.IsDropped = 1:b.IsDropped = 0
- Case 5:a.IsDropped = 0
- End Select
- End Sub
- Sub NFadeW(nr, a)
- Select Case LampState(nr)
- Case 4:a.IsDropped = 1:LampState(nr) = 0
- Case 5:a.IsDropped = 0:LampState(nr) = 1
- End Select
- End Sub
- Sub NFadeWm(nr, a)
- Select Case LampState(nr)
- Case 4:a.IsDropped = 1
- Case 5:a.IsDropped = 0
- End Select
- End Sub
- Sub NFadeWi(nr, a)
- Select Case LampState(nr)
- Case 4:a.IsDropped = 0:LampState(nr) = 0
- Case 5:a.IsDropped = 1:LampState(nr) = 1
- End Select
- End Sub
- Sub NFadeWim(nr, a)
- Select Case LampState(nr)
- Case 4:a.IsDropped = 0
- Case 5:a.IsDropped = 1
- End Select
- End Sub
- 'Lights
- Sub FadeL(nr, a, b)
- Select Case LampState(nr)
- Case 2:b.state = 0:LampState(nr) = 0
- Case 3:b.state = 1:LampState(nr) = 2
- Case 4:a.state = 0:LampState(nr) = 3
- Case 5:a.state = 1:LampState(nr) = 1
- End Select
- End Sub
- Sub FadeLm(nr, a, b)
- Select Case LampState(nr)
- Case 2:b.state = 0
- Case 3:b.state = 1
- Case 4:a.state = 0
- Case 5:a.state = 1
- End Select
- End Sub
- Sub NFadeL(nr, a)
- Select Case LampState(nr)
- Case 4:a.state = 0:LampState(nr) = 0
- Case 5:a.State = 1:LampState(nr) = 1
- End Select
- End Sub
- Sub NFadeLm(nr, a)
- Select Case LampState(nr)
- Case 4:a.state = 0
- Case 5:a.State = 1
- End Select
- End Sub
- Sub FadeOldL(nr, a, b, c)
- Select Case LampState(nr)
- Case 2:c.state = 0:LampState(nr) = 0
- Case 3:b.state = 0:c.state = 1:LampState(nr) = 2
- Case 4:a.state = 0:b.state = 1:LampState(nr) = 3
- Case 5:b.state = 0:c.state = 0:a.state = 1:LampState(nr) = 1
- End Select
- End Sub
- Sub FadeOldLm(nr, a, b, c)
- Select Case LampState(nr)
- Case 2:c.state = 0
- Case 3:b.state = 0:c.state = 1
- Case 4:a.state = 0:b.state = 1
- Case 5:b.state = 0:c.state = 0:a.state = 1
- End Select
- End Sub
- 'Reels
- Sub FadeR(nr, a)
- Select Case LampState(nr)
- Case 2:a.SetValue 3:LampState(nr) = 0
- Case 3:a.SetValue 2:LampState(nr) = 2
- Case 4:a.SetValue 1:LampState(nr) = 3
- Case 5:a.SetValue 1:LampState(nr) = 1
- End Select
- End Sub
- Sub FadeRm(nr, a)
- Select Case LampState(nr)
- Case 2:a.SetValue 3
- Case 3:a.SetValue 2
- Case 4:a.SetValue 1
- Case 5:a.SetValue 1
- End Select
- End Sub
- 'Texts
- Sub NFadeT(nr, a, b)
- Select Case LampState(nr)
- Case 4:a.Text = "":LampState(nr) = 0
- Case 5:a.Text = b:LampState(nr) = 1
- End Select
- End Sub
- Sub NFadeTm(nr, a, b)
- Select Case LampState(nr)
- Case 4:a.Text = ""
- Case 5:a.Text = b
- End Select
- End Sub
- ' Flash a light, not controlled by the rom
- Sub FlashL(nr, a, b)
- Select Case LampState(nr)
- Case 1:b.state = 0:LampState(nr) = 0
- Case 2:b.state = 1:LampState(nr) = 1
- Case 3:a.state = 0:LampState(nr) = 2
- Case 4:a.state = 1:LampState(nr) = 3
- Case 5:b.state = 1:LampState(nr) = 4
- End Select
- End Sub
- ' Light acting as a flash. C is the light number to be restored
- Sub MFadeL(nr, a, b, c)
- Select Case LampState(nr)
- Case 2:b.state = 0:LampState(nr) = 0:SetLamp c, LampState(c)
- Case 3:b.state = 1:LampState(nr) = 2
- Case 4:a.state = 0:LampState(nr) = 3
- Case 5:a.state = 1:LampState(nr) = 1
- End Select
- End Sub
- Sub MFadeLm(nr, a, b, c)
- Select Case LampState(nr)
- Case 2:b.state = 0:SetLamp c, LampState(c)
- Case 3:b.state = 1
- Case 4:a.state = 0
- Case 5:a.state = 1
- End Select
- End Sub
- 'Alpha Ramps used as fading lights
- 'ramp is the name of the ramp
- 'a,b,c,d are the images used for on...off
- 'r is the refresh light
- Sub FadeAR(nr, ramp, a, b, c, d, r)
- Select Case LampState(nr)
- Case 2:ramp.image = d:LampState(nr) = 0':r.State = ABS(r.state -1) 'Off
- Case 3:ramp.image = c:LampState(nr) = 2':r.State = ABS(r.state -1) 'fading...
- Case 4:ramp.image = b:LampState(nr) = 3':r.State = ABS(r.state -1) 'fading...
- Case 5:ramp.image = a:LampState(nr) = 1':r.State = ABS(r.state -1) 'ON
- End Select
- End Sub
- Sub FadeARm(nr, ramp, a, b, c, d, r)
- Select Case LampState(nr)
- Case 2:ramp.image = d':r.State = ABS(r.state -1)
- Case 3:ramp.image = c':r.State = ABS(r.state -1)
- Case 4:ramp.image = b':r.State = ABS(r.state -1)
- Case 5:ramp.image = a':r.State = ABS(r.state -1)
- End Select
- End Sub
- Sub FadeARm2(nr, ramp, a, b, c, d, r)
- Select Case LampState(nr)
- Case 2:ramp.alpha = 0':r.State = ABS(r.state -1)
- Case 3:ramp.image = c':r.State = ABS(r.state -1)
- Case 4:ramp.image = b':r.State = ABS(r.state -1)
- Case 5:ramp.alpha = 1:ramp.image = a':r.State = ABS(r.state -1)
- End Select
- End Sub
- Sub FlashAR(nr, ramp, a, b, c, r) 'used for reflections when there is no off ramp
- Select Case LampState(nr)
- Case 2:ramp.alpha = 0:LampState(nr) = 0':r.State = ABS(r.state -1) 'Off
- Case 3:ramp.image = c:LampState(nr) = 2':r.State = ABS(r.state -1) 'fading...
- Case 4:ramp.image = b:LampState(nr) = 3':r.State = ABS(r.state -1) 'fading...
- Case 5:ramp.image = a:ramp.alpha = 1:LampState(nr) = 1':r.State = ABS(r.state -1) 'ON
- End Select
- End Sub
- Sub FlashARm(nr, ramp, a, b, c, r)
- Select Case LampState(nr)
- Case 2:ramp.alpha = 0':r.State = ABS(r.state -1)
- Case 3:ramp.image = c':r.State = ABS(r.state -1)
- Case 4:ramp.image = b':r.State = ABS(r.state -1)
- Case 5:ramp.image = a:ramp.alpha = 1':r.State = ABS(r.state -1)
- End Select
- End Sub
- Sub NFadeAR(nr, ramp, a, b, r)
- Select Case LampState(nr)
- Case 4:ramp.image = b:LampState(nr) = 0':r.State = ABS(r.state -1) 'off
- Case 5:ramp.image = a:LampState(nr) = 1':r.State = ABS(r.state -1) 'on
- End Select
- End Sub
- Sub NFadeARm(nr, ramp, a, b, r)
- Select Case LampState(nr)
- Case 4:ramp.image = b':r.State = ABS(r.state -1)
- Case 5:ramp.image = a':r.State = ABS(r.state -1)
- End Select
- End Sub
- Sub MNFadeAR(nr, ramp, a, b, c, r)
- Select Case LampState(nr)
- Case 4:ramp.image = b:LampState(nr) = 0:SetLamp c, LampState(c)':r.State = ABS(r.state -1) 'off
- Case 5:ramp.image = a:LampState(nr) = 1':r.State = ABS(r.state -1) 'on
- End Select
- End Sub
- Sub MNFadeARm(nr, ramp, a, b, c, r)
- Select Case LampState(nr)
- Case 4:ramp.image = b:SetLamp c, LampState(c)':r.State = ABS(r.state -1) 'off
- Case 5:ramp.image = a':r.State = ABS(r.state -1) 'on
- End Select
- End Sub
- Sub FadeLCo(nr, a, b) 'fading collection of lights
- Dim obj
- Select Case LampState(nr)
- Case 2:vpmSolToggleObj b, Nothing, 0, 0:LampState(nr) = 0
- Case 3:vpmSolToggleObj b, Nothing, 0, 1:LampState(nr) = 2
- Case 4:vpmSolToggleObj a, Nothing, 0, 0:LampState(nr) = 3
- Case 5:vpmSolToggleObj a, Nothing, 0, 1:LampState(nr) = 1
- End Select
- End Sub
- ' Extra Fading Subs, only for this table
- Sub NFadeBoom(nr)
- Select Case LampState(nr)
- Case 4
- l83ba.IsDropped = 1
- l83ua.IsDropped = 1
- boomramp.image = "plastics"
- LampState(nr) = 0
- Case 5
- If l83u.IsDropped = 0 Then
- l83ua.IsDropped = 0
- boomramp.image = "plastics_on"
- Else
- l83ba.IsDropped = 0
- End If
- LampState(nr) = 1
- End Select
- End Sub
- 'REGISTRY LOCATIONS ***************************************************************************************************************************************
- Const optOpenAtStart = &H00000001
- Const optDMDRotation = &H00000002
- Const optDMDHidden = &H00000004
- Const optBMPR = &H00000008
- Const optController = &H00000010
- Const optB2BEnable = &H00000100
- Const optBackglass = &H00001000
- Const optLogo = &H00002000
- Const optModern = &H00004000
- Const optAnIm = 32768
- Const optRom = &H00010000
- Const optFBSounds = &H00100000
- Const optDayMod = &H00000001
- Const optBallColor = &H00000010
- 'Const optGIOn = &H00000100
- 'Const optGIOff = &H00001000
- 'OPTIONS MENU *********************************************************************************************************************************************
- Dim TableOptions, TableOptions2, TableName, optReset
- Private vpmShowDips1, vpmDips1, vpmDips2
- Sub InitializeOptions
- TableName="CirqusVoltaire_FOM" 'Replace with 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
- TableOptions2 = LoadValue(TableName,"Options2") 'Load saved table options
- Set Controller = CreateObject("VPinMAME.Controller") 'Load vpm controller temporarily so options menu can be loaded if needed
- If TableOptions2 = "" Then TableOptions2 = 0
- If TableOptions = "" Or optReset Then 'If no existing options, reset to default through optReset, then open Options menu
- TableOptions = DefaultOptions 'clear any existing settings and set table options to default options
- TableShowOptions
- ElseIf (TableOptions And optOpenAtStart) Then 'If Enable Next Start was selected then
- TableOptions = TableOptions - optOpenAtStart 'clear setting to avoid future executions
- TableShowOptions
- Else
- TableSetOptions
- End If
- TableSetOptions2
- 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
- 'TableShowOptions2 'Add more options menus...
- End Sub
- Private Sub TableShowOptions 'New options menu, additional menus can be added as well, just follow similar format and add call to TableShowDips
- Dim oldOptions : oldOptions = TableOptions
- If Not IsObject(vpmDips1) Then 'If creating an additional menus, need to declare additional vpmDips variables above (ex. vpmDips2 and TableOptions2, etc.)
- Set vpmDips1 = New cvpmDips
- With vpmDips1
- .AddForm 530, 250, "TABLE OPTIONS MENU"
- .AddFrameExtra 0,0,105,"Controller Selection*",3*optController, Array("Visual PinMame", 1*optController, "UVP", 2*optController,_
- "B2S Server", 3*optController)
- .AddFrameExtra 0,60,105,"Rom Selection*",3*optRom, Array("cv_20h", 0*optRom, "cv_20hc", 1*optRom, "cv_14", 2*optRom)
- .AddFrameExtra 0,120,105,"B2B Options",3*optB2BEnable, Array("Auto Detect", 2*optB2BEnable, "Force Disable", 0*optB2BEnable, "Force Enable", 1*optB2BEnable)
- .AddFrameExtra 120,0,130,"Options",0, Array("Launch B2S Backglass", optBackglass, "3rd Screen Logo", optLogo, "Rotate DMD", optDMDRotation,_
- "Hide DMD", optDMDHidden, "Enable BMPR Lite*", optBMPR)
- .AddFrameExtra 120,90,100,"Plunger",0,Array("Modern Plunger", optModern, "Analog Impulse", optAnIm)
- .AddLabel 0,185,100,15,"* Requires restart"
- .AddChkExtra 125,185,135, Array("Enable Menu Next Start", optOpenAtStart)
- ' .AddLabel 120,190,120,15,"(Loads before Controller)"
- .AddChkExtra 125,140,135, Array("Disable Mech Sounds*", optFBSounds)
- .AddLabel 145,155,120,15,"(For use with DOF)"
- End With
- End If
- TableOptions = vpmDips1.ViewDipsExtra(TableOptions)
- SaveValue TableName,"Options",TableOptions
- TableSetOptions
- TableShowOptions2
- End Sub
- Private Sub TableShowOptions2 'New options menu, additional menus can be added as well, just follow similar format and add call to TableShowDips
- Dim oldOptions : oldOptions = TableOptions2
- If Not IsObject(vpmDips2) Then 'If creating an additional menus, need to declare additional vpmDips variables above (ex. vpmDips2 and TableOptions2, etc.)
- Set vpmDips2 = New cvpmDips
- With vpmDips2
- .AddForm 530, 250, "LIGHTING AND COLOR OPTIONS MENU"
- .AddChkExtra 0,0,135, Array("Enable Day Mod", optDayMod)
- .AddFrameExtra 0,20,50,"Ball Color", 7*optBallColor, Array("Green", 0*optBallColor, "Red", 1*optBallColor, "Blue", 2*optBallColor,_
- "Yellow", 3*optBallColor, "Lilac", 4*optBallColor)
- '.AddFrameExtra 65,20,60,"GI On Color", 7*optGIOn, Array("Off", 0*optGIOn, "White", 1*optGIOn, "Green", 2*optGIOn, "Red", 3*optGIOn,_
- ' "Blue", 4*optGIOn, "Orange", 5*optGIOn)
- '.AddFrameExtra 140,20,60,"GI Off Color", 7*optGIOff, Array("Off", 0*optGIOff, "White", 1*optGIOff, "Green", 2*optGIOff, "Red", 3*optGIOff,_
- ' "Blue", 4*optGIOff, "Orange", 5*optGIOff)
- End With
- End If
- TableOptions2 = vpmDips2.ViewDipsExtra(TableOptions2)
- SaveValue TableName,"Options2",TableOptions2
- TableSetOptions2
- End Sub
- Dim BigBallImage, BColor,ShowLogo, useBMPR, DayMod, RMImages
- BigBallImage = Array("big_ball_green", "big_ball_red", "big_ball_blue", "big_ball_yellow", "big_ball_lila")
- 'RMImages = Array("rm_off","rm_on")
- Sub TableSetOptions 'defines required settings before table is run
- ROL = (TableOptions And optDMDRotation)\optDMDRotation
- HIDDEN = (TableOptions And optDMDHidden)\optDMDHidden
- cController = ((TableOptions And (3*optController))\optController)
- B2Bon = ((TableOptions And (3*optB2BEnable))\optB2BEnable)
- ShowLogo = (TableOptions And optLogo)\optLogo
- 'cGameName = Array("cv_20h","cv_20hc","cv_14")((TableOptions AND (3*optRom))\optRom)
- UseBMPR = (TableOptions AND optBMPR)\optBMPR
- If (TableOptions AND optFBSounds) Then
- FFBSounds = FeedbackSounds
- Sound1 = ""
- Sound2 = ""
- Sound3 = ""
- Else
- FFBSounds = Empty
- Sound1 = "fx_ballrel"
- Sound2 = "fx_Solenoid"
- Sound3 = "fx_popper"
- End If
- If (TableOptions AND optModern) Then
- aPlunger.alpha = 0
- PlungerHide.alpha = 0
- ImpulsePlunger=0
- Else
- aPlunger.alpha = 1
- PlungerHide.alpha = 1
- ImpulsePlunger=1
- End If
- If (TableOptions AND optAnIm) Then
- Plunger2.MechPlunger = 0
- ImpulseP = 1
- Else
- Plunger2.MechPlunger = 1
- ImpulseP = 0
- End If
- End Sub
- Sub TableSetOptions2 'defines lighting and color settings before table is run
- Dim obj
- BColor = ((TableOptions2 And 7*optBallColor)\optBallColor)
- 'GION_alphaGIColor = ((TableOptions2 AND 7*optGIOn)\optGIOn)
- 'GIOFF_alphaGIColor = ((TableOptions2 AND 7*optGIOff)\optGIOff)
- DayMod = (TableOptions2 And optDayMod)\optDayMod
- On Error Resume Next
- For each obj in Flippers
- obj.visible = 0
- obj.enabled = 0
- Next
- If UseBMPR then
- LeftFlipper1.visible = 1
- RightFlipper1.visible = 1
- LeftFlipper1.enabled = 1
- RightFlipper1.enabled = 1
- ElseIf DayMod Then
- LeftFlipper2.visible = 1
- RightFlipper2.visible = 1
- LeftFlipper2.enabled = 1
- RightFlipper2.enabled = 1
- Else
- LeftFlipper.visible = 1
- RightFlipper.visible = 1
- LeftFlipper.enabled = 1
- RightFlipper.enabled = 1
- End If
- On Error Goto 0
- If DayMod Then
- apronramp.alpha = 1
- pfDay.alpha = 1
- RingMaster.image = "rm_off-day"
- RMImages = Array("rm_off-day","rm_on-day")
- Else
- apronramp.alpha = 0
- pfDay.alpha = 0
- RingMaster.image = "rm_off"
- RMImages = Array("rm_off","rm_on")
- End If
- End Sub
- 'Dim GIEnabled, GIOn, GIOff : GIEnabled=0
- Sub UpdateVisuals
- If WBall.image <> BigBallImage(BColor) Then WBall.image = BigBallImage(BColor)
- 'If GIOn <> GION_alphaGIColor OR GIOff <> GIOFF_alphaGIColor Then
- 'GIon = GION_alphaGIColor
- 'GIOff = GIOFF_alphaGIColor
- 'UpdateGI 5, GIEnabled
- 'End If
- End Sub
- 'Function CheckB2S(name)
- ' CheckB2S=false
- ' Dim WshShell,filecheck,directory
- ' Set WshShell = CreateObject("WScript.Shell")
- ' name = WshShell.RegRead ("HKCU\Software\Visual Pinball\RecentDir\TableFileName0")
- ' directory = Left(name,InStrRev(name,"\"))
- ' name = Replace(Mid(name,InStrRev(name,"\")+1),".vpt","")
- ' Set filecheck = CreateObject("Scripting.FileSystemObject")
- ' If filecheck.FileExists(directory & name & ".exe") Then CheckB2S = True
- 'End Function
- Dim FFBSounds,DOF
- Sub vpPlay(aSound) 'updated for all 8 possible options
- Dim x,sound
- If IsArray(aSound) Then sound = asound(0) else sound = asound
- If Not IsEmpty(FFBSounds) Then 'If FFBSounds is assigned to the feedbacksounds array... aka FeedBack sounds turned OFF
- For x = 0 to Ubound(FFBSounds) 'Loop through all sounds in the array
- If lcase(FFBSounds(x)) = lcase(sound) Then 'Check to see if sound is present in array, and if so
- Exit Sub 'Exit the sub as no sound should then be played
- End If
- Next 'If sound isn't found, then play sound as normal...
- If IsArray(aSound) Then 'If sound is defined as an array for additional switch use, Then play sound with defined switches
- Select Case UBound(aSound)
- Case 0 : PlaySound aSound(0)
- Case 1 : PlaySound aSound(0),aSound(1)
- Case 2 : PlaySound aSound(0),aSound(1),aSound(2)
- Case 3 : PlaySound aSound(0),aSound(1),aSound(2),aSound(3)
- Case 4 : PlaySound aSound(0),aSound(1),aSound(2),aSound(3),aSound(4)
- Case 5 : PlaySound aSound(0),aSound(1),aSound(2),aSound(3),aSound(4),aSound(5)
- Case 6 : PlaySound aSound(0),aSound(1),aSound(2),aSound(3),aSound(4),aSound(5),aSound(6)
- Case 7 : PlaySound aSound(0),aSound(1),aSound(2),aSound(3),aSound(4),aSound(5),aSound(6),aSound(7)
- End Select
- Else
- PlaySound aSound 'Or just play the sound specified
- End If
- Else 'If Feedback sounds are left ON, play sounds as normal
- If IsArray(aSound) Then
- Select Case UBound(aSound)
- Case 0 : PlaySound aSound(0)
- Case 1 : PlaySound aSound(0),aSound(1)
- Case 2 : PlaySound aSound(0),aSound(1),aSound(2)
- Case 3 : PlaySound aSound(0),aSound(1),aSound(2),aSound(3)
- Case 4 : PlaySound aSound(0),aSound(1),aSound(2),aSound(3),aSound(4)
- Case 5 : PlaySound aSound(0),aSound(1),aSound(2),aSound(3),aSound(4),aSound(5)
- Case 6 : PlaySound aSound(0),aSound(1),aSound(2),aSound(3),aSound(4),aSound(5),aSound(6)
- Case 7 : PlaySound aSound(0),aSound(1),aSound(2),aSound(3),aSound(4),aSound(5),aSound(6),aSound(7)
- End Select
- Else
- PlaySound aSound
- End If
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement