Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' Cactus Canyon - IPDB No. 4445
- ' © Bally/Midway 1998
- ' © Eric Priepke 2012 (P-ROC Project)
- ' VPX recreation by ninuzzu/Tom Tower
- ' Credits/Thanks
- ' Clark Kent for the pics
- ' Shoopity for scripting bart,train,mine,beer mug primitives
- ' Dozer for adapting the mine and train mechs to work with P-ROC and the lights code
- ' Flupper for retexturing the plastic ramps and the train
- ' Zany for the domes, flippers and bumpers
- ' VPDev Team for the freaking amazing VPX
- ' Arngrim for the DOF
- ' The table is ready to play the Cactus Canyon Continued using P-ROC.
- ' If you don't know what it is, just look here:
- ' http://soldmy.org/pin/ccc/index.php?title=Main_Page
- ' You need to install PROC and enable the option in the script.
- ' Read the tutorial and download the necessary files here:
- ' https://mega.nz/#F!CMoxCL6I!m1-IeL8PfWakfU5dAKTrFA
- Option Explicit
- Randomize
- Dim RollingVol, FlipperType, ScoopLight, ColorMod, AttractModeRGB, BadGuysMod, PROC
- '************************************************************************
- '* TABLE OPTIONS ********************************************************
- '************************************************************************
- '*********** Ball Rolling Sound Volume *****************************
- RollingVol = 2000 '(increase to lower the volume)
- '*********** Set the Flippers Type *********************************
- FlipperType = 2 '0 = white , 1 = yellow , 2 = random
- '*********** Red Light under the scoop *****************************
- ScoopLight = 1 '0 = no , 1 = yes
- '*********** Enable RGB G.I Mod ********************************
- ColorMod = 1 '0 = no , 1 = yes
- '*********** Bad Guys Flashing lights *****************************
- BadGuysMod = 1 '0 = no , 1 = yes
- '*********** Enable Cactus Canyon Continued *************************
- PROC = 0 '0 = no , 1 = yes
- '*************************************************************************
- '* END OF TABLE OPTIONS **************************************************
- '*************************************************************************
- Dim Ballsize,BallMass
- BallSize = 50
- BallMass = (Ballsize^3)/125000
- 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 DesktopMode:DesktopMode = Table1.ShowDT
- Dim UseVPMDMD:UseVPMDMD = DesktopMode
- Const cGameName = "cc_13"
- Const B2ScGameName = "Proc_CC"
- Const UseVPMModSol = 1
- If PROC = 1 Then
- LoadProc "02000000", "WPC.VBS", 3.50
- Else
- LoadVPM "02000000", "WPC.VBS", 3.50
- End If
- '********************
- 'Standard definitions
- '********************
- Const UseSolenoids = 1
- Const UseLamps = 1
- Const UseSync = 0
- Const HandleMech = 0
- Const UseGI = 0
- Const SSolenoidOn = "fx_solon"
- Const SSolenoidOff = ""
- Const SFlipperOn = ""
- Const SFlipperOff = ""
- Const SCoin = "fx_coin"
- If PROC = 1 Then
- Set GiCallback = GetRef("UpdateGI")
- Else
- Set GiCallback2 = GetRef("UpdateGI2")
- End If
- Set MotorCallback = GetRef("GameTimer")
- Dim TrainMech, MineMech
- '**************************************************************
- '************ Table Init **********************************
- '**************************************************************
- Sub Table1_Init
- vpmInit Me
- KiHat.CreateBall.ID = 999
- BartOrigX = Bart.X
- BartOrigY = Bart.Y
- Mine.RotX = (MineSign.Z * 0.375) - 10
- On Error Resume Next
- With Controller
- .GameName = cGameName
- If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description : Exit Sub
- .SplashInfoLine = "Cactus Canyon - Midway/Williams 1998"
- .HandleMechanics = 0
- .ShowDMDOnly = 1
- .ShowFrame = 0
- .ShowTitle = 0
- If PROC = 0 Then .Hidden = Desktopmode
- .Run
- If Err Then MsgBox Err.Description
- End With
- On Error Goto 0
- '************ Main Timer init ********************
- PinMAMETimer.Interval = PinMAMEInterval
- PinMAMETimer.Enabled = 1
- '************ Nudging **************************
- vpmNudge.TiltSwitch = 14
- vpmNudge.Sensitivity = 5
- vpmNudge.TiltObj = Array(Bumper1, Bumper2, sw51, sw52, sw55)
- '************** Mine Mech ********************
- If PROC = 0 Then
- Set MineMech = New cvpmMech
- With MineMech
- .Sol1 = 17
- .Length = 100
- .Steps = 49
- .MType = vpmMechOneSol + vpmMechReverse + vpmMechLinear
- .AddSw 77, 0, 1 'Home 'Shoopity - Changed the last variable from 48 to 0, it helps with moving the primitive
- .AddPulseSw 78, 8, 2
- .Start
- End With
- End If
- '************** Train Mech ********************
- If PROC = 0 Then
- Set TrainMech = New cvpmMech
- With TrainMech
- .Sol1 = 38 'Forward
- .Sol2 = 37 'Reverse
- .Length = 570
- .Steps = 613
- .MType = vpmMechTwoDirSol + vpmMechStopEnd + vpmMechLinear
- .AddSw 72, 0, 0 ' Home
- .AddPulseSw 71, 14, 3
- .Start
- End With
- End If
- ' '**************** Trough ******************
- sw32.CreateSizedBallWithMass Ballsize/2, BallMass
- sw33.CreateSizedBallWithMass Ballsize/2, BallMass
- sw34.CreateSizedBallWithMass Ballsize/2, BallMass
- sw35.CreateSizedBallWithMass Ballsize/2, BallMass
- '************ Misc Stuff init ********************
- block.isdropped=1
- Sw61.IsDropped = 1: Sw62.IsDropped = 1 :Sw63.IsDropped = 1 :Sw64.IsDropped = 1
- Sw61a.IsDropped = 1: Sw62a.IsDropped = 1 :Sw63a.IsDropped = 1 :Sw64a.IsDropped = 1
- LPin.IsDropped = 1: RPin.IsDropped = 1
- Controller.Switch(22) = 1 ' Coin Door Closed
- Controller.Switch(24) = 1 ' Always Closed
- UpdateGI2 0,1: UpdateGI2 1,1: UpdateGI2 2,1
- HatInit.enabled = 1
- InitFlashers
- '************ P-ROC Stuff init ********************
- If PROC = 1 then
- Enc_Stop.enabled = 1
- GI_Left 1
- GI_Right 1
- GI_Top 1
- Card1.image = "card1_CCC"
- Card2.image = "card2_CCC"
- Guns.material = "Guns"
- End If
- End Sub
- '********************************************
- '********** Keys ************************
- '********************************************
- Sub Table1_KeyDown(ByVal keycode)
- If keycode = LeftTiltKey Then Nudge 90, 3:PlaySound SoundFX("fx_nudge", 0), 0, 1, -0.1, 0.25
- If keycode = RightTiltKey Then Nudge 270, 3:PlaySound SoundFX("fx_nudge", 0), 0, 1, 0.1, 0.25
- If keycode = CenterTiltKey Then Nudge 0, 4:PlaySound SoundFX("fx_nudge", 0), 0, 1, 0, 0.25
- If KeyCode = PlungerKey Then Plunger1.Pullback:Playsound "fx_plungerpull"
- If vpmKeyDown(KeyCode) Then Exit Sub
- End Sub
- Sub Table1_KeyUp(ByVal KeyCode)
- If KeyCode = PlungerKey Then Plunger1.Fire : Playsound "fx_plunger"
- If vpmKeyUp(KeyCode) Then Exit Sub
- End Sub
- Sub Table1_Paused:Controller.Pause = 1:End Sub
- Sub Table1_unPaused:Controller.Pause = 0:End Sub
- Sub Table1_exit()
- Controller.Stop
- If B2SOn = True and PROC = 1 Then B2SController.Stop
- End sub
- '******************
- ' Solenoids
- '******************
- SolCallback(1) = "AutoPlunger" ' Autoplunger
- SolCallback(2) = "Drop1" ' Left Drop Target
- SolCallback(3) = "Drop2" ' Left Center Drop Target
- SolCallback(4) = "Drop3" ' Right Center Drop Target
- SolCallback(5) = "Drop4" ' Right Drop Target
- SolCallback(6) = "SolMinePopper" ' Mine Popper
- SolCallback(7) = "Knocker" ' Knocker
- SolCallback(8) = "SolSaloonPopper" ' Saloon Popper
- SolCallback(9) = "ReleaseBall" ' Ball Release
- 'SolCallback(10) = "SolSlingL" ' Left Slingshot
- 'SolCallback(11) = "SolSlingR" ' Right Slingshot
- 'SolCallback(12) = "SolBumperL" ' Left Jet Bumper
- 'SolCallback(13) = "SolBumperR" ' Right Jet Bumper
- SolCallback(14) = "GunPostLeft" ' Left Gunfight Post
- SolCallback(15) = "GunPostRight" ' Right Gunfight Post
- 'SolCallback(16) = "SolBumperB" ' Bottom Jet Bumper
- SolCallback(21) = "LGate" ' Left Loop Gate
- SolCallback(22) = "RGate" ' Right Loop Gate
- SolCallback(sLRFlipper) = "SolRFlipper" ' Left Flipper
- SolCallback(sLLFlipper) = "SolLFlipper" ' Right Flipper
- SolCallback(33) = "MoveBart" ' Move Bart Toy
- SolCallback(36) = "MoveHat" ' Bart Toy Hat
- If PROC = 1 then
- SolCallBack(17) = "MoveMine_PROC" ' Mine Motor-PROC
- SolCallback(18) = "Sol18" ' Mine Flasher-PROC
- SolCallBack(19) = "Sol19" ' Front Left Flasher-PROC
- SolCallBack(20) = "Sol20" ' Front Right Flasher-PROC
- SolCallback(24) = "Sol24" ' Beacon Flasher-PROC
- SolCallBack(25) = "Sol25" ' Middle Right Flasher-PROC
- SolCallBack(26) = "Sol26" ' Saloon Flasher-PROC
- SolCallback(27) = "Sol27" ' Back Right Flasher-PROC
- SolCallback(28) = "Sol28" ' Back Left Flasher-PROC
- SolCallback(37) = "TrainB_PROC" ' Train Reverse-PROC
- SolCallback(38) = "TrainF_PROC" ' Train forward-PROC
- Else
- SolCallBack(17) = "MoveMine" ' Mine Motor-VPM
- SolModCallback(18) = "Sol18Mod" ' Mine Flasher-VPM
- SolModCallBack(19) = "Sol19Mod" ' Front Left Flasher-VPM
- SolModCallBack(20) = "Sol20Mod" ' Front Right Flasher-VPM
- SolModCallback(24) = "Sol24Mod" ' Beacon Flasher-VPM
- SolModCallBack(25) = "Sol25Mod" ' Middle Right Flasher-VPM
- SolModCallBack(26) = "Sol26Mod" ' Saloon Flasher-VPM
- SolModCallback(27) = "Sol27Mod" ' Back Right Flasher-VPM
- SolModCallback(28) = "Sol28Mod" ' Back Left Flasher-VPM
- SolCallback(37) = "TrainB" ' Train Reverse-VPM
- SolCallback(38) = "TrainF" ' Train forward-VPM
- End If
- '**************************************************
- '*************** Autoplunger *********************
- '**************************************************
- Dim plungerIM
- Const IMPowerSetting = 65
- Const IMTime = 0.25
- Set plungerIM = New cvpmImpulseP
- With plungerIM
- .InitImpulseP swPlunger, IMPowerSetting, IMTime
- .InitExitSnd SoundFX("fx_Autoplunger",DOFContactors), SoundFX("fx_solon",DOFContactors)
- .CreateEvents "plungerIM"
- End With
- Sub AutoPlunger(Enabled)
- If Enabled Then
- PlungerIM.AutoFire
- DOFALT 120, DOFPulse
- End If
- End Sub
- '**************************************************
- '*************** Targets Bad Guys ***********
- '**************************************************
- Dim sw61Dir, sw62Dir, sw63Dir, sw64Dir
- ' Left Drop Target
- Sub Drop1(enabled)
- If enabled Then
- DOFALT 125, DOFPulse
- Sw61.IsDropped = 0 : Sw61a.IsDropped = 0 : Controller.Switch(61) = 0 : PlaySound SoundFX("fx_DropTargetUp",DOFDropTargets): sw61Dir = 1: sw61.TimerEnabled = 1 : light42.state=2 : light43.state = 2
- Else
- DOFALT 125, DOFPulse
- Sw61.IsDropped = 1 : Sw61a.IsDropped = 1 : Controller.Switch(61) = 1 : PlaySound SoundFX("fx_DropTargetDown",DOFDropTargets): sw61Dir = -1: sw61.TimerEnabled = 1: light42.state=0 : light43.state = 0
- End If
- End Sub
- ' Left Center Drop Target
- Sub Drop2(enabled)
- If enabled Then
- DOFALT 126, DOFPulse
- Sw62.IsDropped = 0 : Sw62a.IsDropped = 0 : Controller.Switch(62) = 0 : PlaySound SoundFX("fx_DropTargetUp",DOFDropTargets): sw62Dir = 1: sw62.TimerEnabled = 1: light25.state=2 : light26.state = 2
- Else
- DOFALT 126, DOFPulse
- Sw62.IsDropped = 1 : Sw62a.IsDropped = 1 : Controller.Switch(62) = 1 : PlaySound SoundFX("fx_DropTargetDown",DOFDropTargets): sw62Dir = -1: sw62.TimerEnabled = 1: light25.state=0 : light26.state = 0
- End If
- End Sub
- ' Right Center Drop Target
- Sub Drop3(enabled)
- If enabled Then
- DOFALT 127, DOFPulse
- Sw63.IsDropped = 0 : Sw63a.IsDropped = 0 : Controller.Switch(63) = 0 : PlaySound SoundFX("fx_DropTargetUp",DOFDropTargets): sw63Dir = 1: sw63.TimerEnabled = 1: light44.state=2 : light45.state = 2
- Else
- DOFALT 127, DOFPulse
- Sw63.IsDropped = 1 : Sw63a.IsDropped = 1 : Controller.Switch(63) = 1 : PlaySound SoundFX("fx_DropTargetDown",DOFDropTargets): sw63Dir = -1: sw63.TimerEnabled = 1: light44.state=0 : light45.state = 0
- End If
- End Sub
- ' Right Drop Target
- Sub Drop4(enabled)
- If enabled Then
- DOFALT 128, DOFPulse
- Sw64.IsDropped = 0 : Sw64a.IsDropped = 0 : Controller.Switch(64) = 0 : PlaySound SoundFX("fx_DropTargetUp",DOFDropTargets): sw64Dir = 1: sw64.TimerEnabled = 1: light50.state=2 : light51.state = 2
- Else
- DOFALT 128, DOFPulse
- Sw64.IsDropped = 1 : Sw64a.IsDropped = 1 : Controller.Switch(64) = 1 : PlaySound SoundFX("fx_DropTargetDown",DOFDropTargets): sw64Dir = -1: sw64.TimerEnabled = 1: light50.state=0 : light51.state = 0
- End If
- End Sub
- Sub sw61_timer()
- sw61p.Z = sw61p.Z + (2 * sw61Dir)
- If sw61p.Z <= -39 Then Me.TimerEnabled = 0 : sw61p.Z = -39
- If sw61p.Z >= 39 Then Me.TimerEnabled = 0 : sw61p.Z = 39
- End Sub
- Sub sw62_timer()
- sw62p.Z = sw62p.Z + (2 * sw62Dir)
- If sw62p.Z <= -39 Then Me.TimerEnabled = 0 : sw62p.Z = -39
- If sw62p.Z >= 39 Then Me.TimerEnabled = 0 : sw62p.Z = 39
- End Sub
- Sub sw63_timer()
- sw63p.Z = sw63p.Z + (2 * sw63Dir)
- If sw63p.Z <= -39 Then Me.TimerEnabled = 0 : sw63p.Z = -39
- If sw63p.Z >= 39 Then Me.TimerEnabled = 0 : sw63p.Z = 39
- End Sub
- Sub sw64_timer()
- sw64p.Z = sw64p.Z + (2 * sw64Dir)
- If sw64p.Z <= -39 Then Me.TimerEnabled = 0 : sw64p.Z = -39
- If sw64p.Z >= 39 Then Me.TimerEnabled = 0 : sw64p.Z = 39
- End Sub
- '**************************************************
- '*************** Mine Popper ******************
- '**************************************************
- Sub SolMinePopper(enabled)
- If enabled Then
- DOFALT 132, DOFPulse
- MinePopper.kick 0, 45, 1.56
- If BIK = 0 Then
- Playsound SoundFX(SSolenoidOn,DOFContactors)
- Else
- Playsound SoundFX("fx_mine_popper",DOFContactors)
- End If
- End If
- End Sub
- '**************************************************
- '*************** Knocker ******************
- '**************************************************
- Sub Knocker(enabled)
- If enabled Then
- PlaySound SoundFX("fx_knocker",DOFKnocker)
- DOFALT 151,DOFPulse
- End If
- End Sub
- '************************************************
- '*************** Saloon Popper ****************
- '************************************************
- Sub SolSaloonPopper(enabled)
- If enabled Then
- DOFALT 133, DOFPulse
- BartPopper.kick 0, 45, 1.56
- SecretEntrance.enabled = 0
- vpmtimer.addtimer 1000 ,"SecretEntrance.enabled = 1'"
- If BIK = 0 Then
- Playsound SoundFX(SSolenoidOn,DOFContactors)
- Else
- Playsound SoundFX("fx_saloon_popper",DOFContactors)
- End If
- End If
- End Sub
- '******************************************************************
- '******* Trough based on nFozzy's ***************************
- '******************************************************************
- 'Load The Trough on Game Launch (order 35, 34, 33, 32)
- Sub BootTrough_Timer()
- If PROC = 0 then
- Controller.Switch(35) = 1
- Else
- Controller.Switch(35) = 0
- End If
- Controller.Switch(34) = 1
- Controller.Switch(33) = 1
- Controller.Switch(32) = 1
- Me.Enabled = 0
- UpdateTrough
- End Sub
- Sub sw35_Hit():UpdateTrough: If PROC = 0 then Controller.Switch(35) = 1: End If: End Sub
- Sub sw35_UnHit():Controller.Switch(35) = 0:UpdateTrough:End Sub
- Sub sw34_Hit():Controller.Switch(34) = 1:End Sub
- Sub sw34_UnHit():Controller.Switch(34) = 0:UpdateTrough:End Sub
- Sub sw33_Hit():Controller.Switch(33) = 1:End Sub
- Sub sw33_UnHit():Controller.Switch(33) = 0:UpdateTrough:End Sub
- Sub sw32_Hit():Controller.Switch(32) = 1:End Sub
- Sub sw32_UnHit():Controller.Switch(32) = 0:UpdateTrough:End Sub ':PlaySound SoundFX("fx_ballrel",DOFContactors)
- Sub sw31_Hit():vpmTimer.PulseSw 31 : End Sub
- Sub UpdateTrough()
- UpdateTroughTimer.Interval = 300
- UpdateTroughTimer.Enabled = 1
- End Sub
- Sub UpdateTroughTimer_Timer()
- If sw32.BallCntOver = 0 Then sw33.kick 58, 8
- If sw33.BallCntOver = 0 Then sw34.kick 58, 8
- If sw34.BallCntOver = 0 Then sw35.Kick 58, 8
- If sw35.BallCntOver = 0 Then OutHole.kick 58,8
- Me.Enabled = 0
- End Sub
- '************************************************
- '*************** Drain and Release *************
- '************************************************
- Dim BIP : BIP = 0
- Sub OutHole_Hit()
- PlaySound "fx_drain"
- UpdateTrough
- BIP = BIP - 1
- If PROC = 1 Then Controller.Switch(35) = 1 : block.isdropped=0 : sw35.TimerEnabled = 1 : sw35.TimerInterval = 2000
- End Sub
- Sub sw35_Timer() 'let's enable trough switch 35 for 2 seconds and add a dropping wall to prevent bugs
- Controller.Switch(35)=0
- block.isdropped=1
- Me.TimerEnabled = 0
- End Sub
- Sub ReleaseBall(enabled)
- DOFALT 121, DOFPulse
- If sw35.BallCntOver = 0 Then PlaySound SoundFX(SSolenoidOn,DOFContactors)
- If enabled Then
- PlaySound SoundFX("fx_ballrel",DOFContactors)
- sw32.kick 58, 10
- UpdateTrough
- BIP = BIP + 1
- End If
- End Sub
- '************************************************
- '************** Slingshots *****************
- '************************************************
- Dim LStep, RStep, TStep
- Sub sw51_Slingshot
- PlaySound SoundFX("fx_slingshotL",DOFContactors)
- DOFALT 122, 2
- DOFALT 124, 2
- vpmTimer.PulseSw 51
- LSling.Visible = 0
- LSling1.Visible = 1
- sling2.TransZ = -20
- LStep = 0
- Me.TimerEnabled = 1
- End Sub
- Sub sw51_Timer
- Select Case LStep
- Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -10
- Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.TransZ = 0:Me.TimerEnabled = 0
- End Select
- LStep = LStep + 1
- End Sub
- Sub sw52_Slingshot
- PlaySound SoundFX("fx_slingshotR",DOFContactors)
- DOFALT 123, 2
- DOFALT 126, DOFPulse
- vpmTimer.PulseSw 52
- RSling.Visible = 0
- RSling1.Visible = 1
- sling1.TransZ = -20
- RStep = 0
- Me.TimerEnabled = 1
- End Sub
- Sub sw52_Timer
- Select Case RStep
- Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -10
- Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.TransZ = 0:Me.TimerEnabled = 0
- End Select
- RStep = RStep + 1
- End Sub
- Sub sw55_Slingshot
- PlaySound SoundFX("fx_slingshotT",DOFContactors)
- DOFALT 134, DOFPulse
- vpmTimer.PulseSw 55
- TSling.Visible = 0
- TSling1.Visible = 1
- sling3.TransZ = -20
- TStep = 0
- Me.TimerEnabled = 1
- End Sub
- Sub sw55_Timer
- Select Case TStep
- Case 3:TSLing1.Visible = 0:TSLing2.Visible = 1:sling3.TransZ = -10
- Case 4:TSLing2.Visible = 0:TSLing.Visible = 1:sling3.TransZ = 0:Me.TimerEnabled = 0
- End Select
- TStep = TStep + 1
- End Sub
- '************************************************
- '************** Bumpers *****************
- '************************************************
- Dim dirRing1 : dirRing1 = -1
- Dim dirRing2 : dirRing2 = -1
- Sub Bumper1_Hit
- vpmTimer.PulseSw 53
- PlaySound SoundFX("fx_BumperLeft",DOFContactors) : Me.TimerEnabled = 1
- DOFALT 130, DOFPulse
- DOFALT 135, DOFPulse
- End Sub
- Sub Bumper2_Hit
- vpmTimer.PulseSw 54
- PlaySound SoundFX("fx_BumperRight",DOFContactors) : Me.TimerEnabled = 1
- DOFALT 131, DOFPulse
- DOFALT 136, DOFPulse
- End Sub
- Sub Bumper1_timer()
- BR1.Z = BR1.Z + (5 * dirRing1)
- If BR1.Z <= 0 Then dirRing1 = 1
- If BR1.Z >= 30 Then
- dirRing1 = -1
- BR1.Z = 30
- Me.TimerEnabled = 0
- End If
- End Sub
- Sub Bumper2_timer()
- BR2.Z = BR2.Z + (5 * dirRing2)
- If BR2.Z <= 0 Then dirRing2 = 1
- If BR2.Z >= 30 Then
- dirRing2 = -1
- BR2.Z = 30
- Me.TimerEnabled = 0
- End If
- End Sub
- '************************************************
- '************** Gun Posts *****************
- '************************************************
- Sub GunPostLeft(enabled)
- DOFALT 145, DOFPUlse
- If Enabled Then
- LPin.IsDropped = 0
- PlaySound SoundFX("fx_PostUp",DOFContactors)
- DOFALT 152, DOFOn
- Else
- LPin.IsDropped = 1
- PlaySound SoundFX("fx_PostDown",0)
- DOFALT 152, DOFOff
- End If
- End Sub
- Sub GunPostRight(enabled)
- DOFALT 146, DOFPulse
- If Enabled Then
- RPin.IsDropped = 0
- PlaySound SoundFX("fx_PostUp",DOFContactors)
- DOFALT 152, DOFOn
- Else
- RPin.IsDropped = 1
- PlaySound SoundFX("fx_PostDown",0)
- DOFALT 152, DOFOff
- End If
- End Sub
- '************************************************
- '*************** Loop Gates ****************
- '************************************************
- Sub LGate(enabled)
- If enabled Then
- PlaySound "fx_gate"
- LLoopGate.Open = 1
- DOFALT 147,DOFPulse
- Else
- DOFALT 147,DOFPulse
- LLoopGate.Open = 0
- End If
- End Sub
- Sub RGate(enabled)
- If enabled Then
- PlaySound "fx_gate"
- RLoopGate.Open = 1
- DOFALT 148,DOFPulse
- Else
- DOFALT 148,DOFPulse
- RLoopGate.Open = 0
- End If
- End Sub
- '*************************************************
- '****** Shoopity's Train Animation ******
- '*************************************************
- Dim TrainOn,TrainDir, TrainSpeed
- TrainSpeed = 1
- Sub TrainF(enabled)
- Train.TransX = -TrainMech.Position
- Train1.TransX = -TrainMech.Position
- TrainTimer.Enabled = 1
- TrainOn = enabled
- End Sub
- Sub TrainB(enabled)
- Train.TransX = -TrainMech.Position
- Train1.TransX = -TrainMech.Position
- TrainTimer.Enabled = 1
- TrainOn = enabled
- End Sub
- Sub TrainTimer_Timer()
- 'PlaySound(string, int loopcount, float volume, float pan, float randompitch, int pitch, bool usesame, bool restart)
- PlaySound SoundFX("fx_train_motor", DOFGear), -1, 1, 0.05, 0, 0, 1, 0
- If Train.TransX >= -TrainMech.Position Then
- TrainDir = -1
- Pgear1.RotY = Pgear1.RotY + 1
- Pgear2.RotY = Pgear2.RotY - 1
- Pgear3.RotY = Pgear3.RotY - 1
- Else
- TrainDir = 1
- Pgear1.RotY = Pgear1.RotY - 1
- Pgear2.RotY = Pgear2.RotY + 1
- Pgear3.RotY = Pgear3.RotY + 1
- End If
- Train.TransX = Train.TransX + TrainSpeed * TrainDir
- Train1.TransX = Train.TransX
- If ((Train.TransX >= -TrainMech.Position AND TrainDir = 1) OR (Train.TransX <= -TrainMech.Position AND TrainDir = -1)) Then Train.TransX = -TrainMech.Position
- If ((Train.TransX >= -TrainMech.Position AND TrainDir = 1) OR (Train.TransX <= -TrainMech.Position AND TrainDir = -1)) AND TrainOn = 0 Then
- Me.Enabled = 0
- StopSound "fx_train_motor"
- End If
- If Train.TransX = -611 Then StopSound "fx_train_motor"
- End Sub
- '***********************************************
- '** New Train Mech to work with P-ROC (Dozer) **
- '***********************************************
- Dim TrainDirPROC
- Sub TrainF_PROC(Enabled)
- If Enabled Then
- PlaySound SoundFX("fx_train_motor", DOFGear), -1, 1, 0.05, 0, 0, 1, 0
- DOFALT 140, DOFOn
- Polly.Enabled = 1
- sw71.enabled = 1
- TrainDirPROC = 1
- Else
- StopSound "fx_train_motor"
- DOFALT 140, DOFOff
- Polly.enabled = 0
- sw71.enabled = 0
- End If
- End Sub
- Sub TrainB_PROC(Enabled)
- If Enabled Then
- PlaySound SoundFX("fx_train_motor", DOFGear), -1, 1, 0.05, 0, 0, 1, 0
- DOFALT 140, DOFOn
- Polly.Enabled = 1
- sw71.enabled = 1
- TrainDirPROC = 2
- Else
- StopSound "fx_train_motor"
- DOFALT 140, DOFOff
- Polly.enabled = 0
- sw71.enabled = 0
- End If
- End Sub
- Sub Polly_Timer()
- Select Case TrainDirPROC
- Case 1: Train.TransX = Train.TransX - 2
- Train1.TransX = Train.TransX
- Pgear1.RotY = Pgear1.RotY + 1
- Pgear2.RotY = Pgear2.RotY - 1
- Pgear3.RotY = Pgear3.RotY - 1
- If Train.TransX <= -5 Then Controller.Switch(72) = 0
- If Train.TransX <= -611 Then Controller.Switch(71) = 1
- Case 2: Train.TransX = Train.TransX + 4
- Train1.TransX = Train.TransX
- Pgear1.RotY = Pgear1.RotY - 1
- Pgear2.RotY = Pgear2.RotY + 1
- Pgear3.RotY = Pgear3.RotY + 1
- If Train.TransX => 0 Then Controller.Switch(72) = 1 : Controller.Switch(71) = 1
- End Select
- End Sub
- Sub sw71_Timer() 'Dozer - Encoder Pulse which runs with Train Mech.
- vpmTimer.PulseSw 71
- End Sub
- Sub Enc_Stop_Timer() 'Dozer - will disable the pulse the first 5 seconds the table is run
- sw71.enabled = 0
- me.enabled = 0
- End Sub
- '*********************************************
- '****** Shoopity's Mine Animation ******
- '*********************************************
- Dim MineOn, Minespeed, MineDir
- MineSpeed = 0.25
- Sub MoveMine(enabled)
- MineTimer.enabled = 1
- MineOn = enabled
- End Sub
- Sub MineTimer_Timer()
- If MineSign.Z > MineMech.Position Then
- MineDir = -1
- Else
- MineDir = 1
- End If
- PlaySound SoundFX("fx_mine_motor", DOFGear), -1, 1, -0.1, 0, 0, 1, 0
- MineSign.Z = MineSign.Z + Minespeed * MineDir
- If ((MineSign.Z >= MineMech.Position AND MineDir = 1) OR (MineSign.Z <= MineMech.Position AND MineDir = -1)) AND Not(MineOn) Then 'Shoopity- If the primitive catches the mech AND the solenoid is off, then turn off the timer
- Me.Enabled = 0
- StopSound "fx_mine_motor"
- End If
- Mine.RotX = (MineSign.Z * 0.375) - 10
- If MineSign.Z < 24 Then 'Shoopity- I will drop the wall in the function that moves the sign
- sw15.IsDropped = 0
- else
- sw15.IsDropped = 1
- End If
- End sub
- '**********************************************
- '** New Mine Mech to work with P-ROC (Dozer) **
- '**********************************************
- Dim MineDirPROC:MineDirPROC = 1
- Sub MoveMine_PROC(Enabled)
- If Enabled then
- PlaySound SoundFX("fx_mine_motor", DOFGear), -1, 1, -0.1, 0, 0, 1, 0
- DOFALT 141, DOFOn
- MineDirPROC=MineDirPROC
- sw15.Timerenabled = 1
- sw15b.Timerenabled = 1
- Else
- sw15.Timerenabled = 0
- sw15b.Timerenabled = 0
- StopSound "fx_mine_motor"
- DOFALT 141, DOFOff
- End If
- End Sub
- Sub Sw15_Timer()
- Select Case MineDirPROC
- Case 1: MineSign.Z = MineSign.Z + Minespeed
- Mine.RotX = (MineSign.Z * 0.375) - 10
- If MineSign.Z => 0 Then Controller.Switch(77) = 0
- If MineSign.Z => 24 Then sw15.IsDropped = 1
- If MineSign.Z => 45 Then MineDirPROC = 2
- Case 2: MineSign.Z = MineSign.Z - Minespeed
- Mine.RotX = (MineSign.Z * 0.375) - 10
- If MineSign.Z <= 0 Then Controller.Switch(77) = 1
- If MineSign.Z <= 24 Then sw15.IsDropped = 0
- If MineSign.Z <= 0 Then MineDirPROC = 1
- End Select
- End sub
- Sub sw15b_Timer() 'Dozer - Encoder Pulse which runs with Mine Mech.
- vpmTimer.PulseSw 78
- End Sub
- '*********************************************
- '****** Shoopity 's Bart Animation ******
- '*********************************************
- Dim bsmash : bsmash = 1
- Dim blrnh:blrnh = 1
- Dim blrnhud:blrnhud = 1
- Dim BartSpeed:Bartspeed = 6
- Dim BallHat
- Sub HatInit_Timer()
- Dim X
- For Each X in GetBalls
- If X.ID = 999 Then Set BallHat = X
- Next
- KiHat.Kick 0, 0, 0
- Me.Enabled = 0
- End Sub
- Sub MoveBart(Enabled)
- If Enabled Then
- DOFALT 149, DOFPulse
- blrnh = -1 'Start him moving left
- BartSwitched = 0 'Reset every time this kicks
- Bart1.Enabled = 1 'Shoopity- turn on the animation any time the bart toy is moving
- PlaySound SoundFX("fx_bart_hit", DOFContactors)
- BallHat.VelX = RndNum (-10,10)
- end If
- End Sub
- Sub MoveHat(Enabled)
- If Enabled Then
- DOFALT 150, DOFPulse
- PlaySound SoundFX("fx_bart_move", DOFContactors)
- Bart2.Enabled = 1 'Shoopity- Here, the hat obviously returns to the head, and we'll turn it off in the timer, like it was done prior to me coming here
- End If
- End Sub
- Sub BHit_Timer()
- Select Case bsmash
- Case 1:
- If Bart.TransY => 20 Then
- bsmash = 2
- End If
- Bart.TransY = Bart.TransY + 2
- Bart_Hat.TransY = Bart_Hat.TransY + 2
- Case 2:
- If Bart.TransY <= 0 Then
- me.enabled = 0
- Bart.TransZ= 0
- Bart_Hat.TransY = 70
- End If
- Bart.TransY = Bart.TransY - 2
- Bart_Hat.TransY = Bart_Hat.TransY - 2
- End Select
- End Sub
- Dim BartOrigX, BartOrigY, BartSwitched
- Sub Bart1_Timer() ' - Left then right with no hat lift. 'Shoopity- I've changed it to just move back and forth as long as the solenoid is on
- Bart.X = Bart.X + BartSpeed * blrnh 'Shoopity- so we move it, but you can change the speed by changing BartSpeed if you want, and blrnh will be used as a direction
- Bart_Hat.X = Bart_Hat.X + BartSpeed * blrnh 'Shoopity- had to change it back since they're not longer in the same location
- Bart_Hat.RotZ = KiHat.X - BallHat.X
- If Bart.X <= 592 Then blrnh = 1:BartSwitched = BartSwitched + 1
- If Bart.X >= 660 Then blrnh = -1:BartSwitched = BartSwitched + 1
- If Bart.X <= BartOrigX AND BartSwitched >=2 Then
- Bart.X = BartOrigX
- Me.Enabled = 0
- End If
- End Sub
- Dim HatHeight, HatHi, HatAdjuster
- HatAdjuster = 100
- HatHeight = Bart_Hat.Z 'Shoopity- So if you ever change the height of the hat, it'll get remembered here properly
- HatHi = HatHeight + 75 'Shoopity- The heighest point the hat will go, so if you want to change how hi the hat goes, change that here
- Sub Bart2_Timer() ' - Left then right with no hat lift. 'Shoopity- I'm pretty sure this is supposed to say "Hat hit" or something like that
- Bart_Hat.Z = (dSin(blrnhud) * HatAdjuster) + HatHeight 'Shoopity- This is how I use physics, although it's not going to be variable height like the beer mug is
- blrnhud = blrnhud + SlowMo + 5
- If blrnhud > 180 Then
- blrnhud =1
- Me.Enabled = 0
- End If
- End Sub
- '********************************************************
- ' Shoopity's Beer Mug Animation
- '********************************************************
- Dim MugHit 'Shoopity- Variable to capture the Y velocity of the ball to know how high to kick it
- Sub Sw46_Hit()
- DOFALT 153, DOFPulse
- RandomSoundMetal()
- vpmTimer.PulseSwitch 46,0,0
- MugHit = ActiveBall.VelY
- Beer.Enabled = 1
- End Sub
- Dim mmmbeer, BeerMaxHeight, SlowMo, BeerAdjuster, mmmswitch
- SlowMo = 3 'Shoopity- Just a fun variable if you want to see stuff move in slow motion
- mmmbeer = 1
- BeerAdjuster = 10 'Shoopity- Adjuster to translate the ball velocity into how high the mug goes
- BeerMaxHeight = 150 'Shoopity- if you want to change how high the mug goes, just change this number
- Sub Beer_Timer()
- BeerMug.Z = (dSin(mmmBeer) * (ABS(MugHit)*BeerAdjuster)) + 52
- sw46p.RotX = -(dSin(mmmBeer) * MugHit/30)
- mmmBeer = mmmBeer + SlowMo
- If BeerMug.Z > BeerMaxHeight Then 'Shoopity- If you hight the max height then...
- BeerMug.Z = BeerMaxHeight ' Hold it there for a bit
- sw46p.RotX = -BeerMaxHeight/3 ' Hold it there for a bit
- End If
- If mmmBeer > 180 Then 'Shoopity- If it's traveled all the way up and down then...
- mmmBeer = 1 'Reset so next time it starts over
- Me.Enabled = 0 'Stop the animation
- End If
- End Sub
- '*********************************************
- '************** Flippers ***************
- '*********************************************
- Sub SolLFlipper(Enabled)
- If Enabled Then
- PlaySound SoundFX("fx_flipperup",DOFFlippers), 0, 1, -0.1, 0.25
- DOFALT 101, DOFOn
- LeftFlipper.RotateToEnd
- Else
- PlaySound SoundFX("fx_flipperdown",DOFFlippers), 0, 1, -0.1, 0.25
- DOFALT 101, DOFOff
- LeftFlipper.RotateToStart
- End If
- End Sub
- Sub SolRFlipper(Enabled)
- If Enabled Then
- PlaySound SoundFX("fx_flipperup",DOFFlippers), 0, 1, 0.1, 0.25
- DOFALT 102, DOFOn
- RightFlipper.RotateToEnd
- Else
- PlaySound SoundFX("fx_flipperdown",DOFFlippers), 0, 1, 0.1, 0.25
- DOFALT 102, DOFOff
- RightFlipper.RotateToStart
- End If
- End Sub
- '**************************************************************
- '*********************** Switches ************************
- '**************************************************************
- '*************** Gold Mine & Sign *************
- Sub sw15_Hit() : PlaySound "fx_mine_hit" : vpmTimer.PulseSwitch 15,0,0 : DOFALT 149, DOFPulse : End Sub
- Sub sw15b_Hit() : RandomSoundMetal() : vpmTimer.PulseSwitch 15,0,0 : End Sub
- '*************** Bart Toy *********************
- Sub sw75_Hit() : RandomSoundMetal() : vpmTimer.PulseSwitch 75,0,0 : bsmash = 1 : Bhit.enabled = 1 : End Sub
- '*************** Saloon *********************
- Sub sw73_Hit() : PlaySound "fx_gate4" : vpmTimer.PulseSwitch 73,0,0 : End Sub
- '*************** Opto Switches *********************
- Sub sw36_Hit() : vpmTimer.PulseSwitch 36,0,0 : End Sub
- Sub sw37_Hit() : vpmTimer.PulseSwitch 37,0,0 : End Sub
- Sub sw56_Hit() : vpmTimer.PulseSwitch 56,0,0 : End Sub
- Sub sw66_Hit() : vpmTimer.PulseSwitch 66,0,0 : End Sub
- Sub sw67_Hit() : vpmTimer.PulseSwitch 67,0,0 : End Sub
- '*************** Rollover Switches *************************
- Sub sw16_Hit : Controller.Switch(16) = 1 : PlaySound "fx_sensor" : End Sub
- Sub sw16_UnHit : Controller.Switch(16) = 0 : End Sub
- Sub sw17_Hit : Controller.Switch(17) = 1 : PlaySound "fx_sensor" : End Sub
- Sub sw17_UnHit : Controller.Switch(17) = 0 : End Sub
- Sub sw18_Hit : Controller.Switch(18) = 1 : PlaySound "fx_sensor" : End Sub
- Sub sw18_UnHit : Controller.Switch(18) = 0 : End Sub
- Sub sw26_Hit : Controller.Switch(26) = 1 : PlaySound "fx_sensor" : End Sub
- Sub sw26_UnHit : Controller.Switch(26) = 0 : End Sub
- Sub sw27_Hit : Controller.Switch(27) = 1 : PlaySound "fx_sensor" : End Sub
- Sub sw27_UnHit : Controller.Switch(27) = 0 : End Sub
- Sub sw47_Hit : Controller.Switch(47) = 1 : PlaySound "fx_sensor" : End Sub
- Sub sw47_UnHit : Controller.Switch(47) = 0 : End Sub
- Sub sw48_Hit : Controller.Switch(48) = 1 : PlaySound "fx_sensor" : End Sub
- Sub sw48_UnHit : Controller.Switch(48) = 0 : End Sub
- Sub sw57_Hit : Controller.Switch(57) = 1 : PlaySound "fx_sensor" : End Sub
- Sub sw57_UnHit : Controller.Switch(57) = 0 : End Sub
- Sub sw58_Hit : Controller.Switch(58) = 1 : PlaySound "fx_sensor" : End Sub
- Sub sw58_UnHit : Controller.Switch(58) = 0 : End Sub
- '*************** Ramps Switches **********************
- Sub sw82_Hit() : vpmTimer.PulseSwitch 82,0,0 : If ActiveBall.VelY < 0 Then PlaySound "fx_center_ramp_enter": End If : End Sub
- Sub sw82_UnHit(): If ActiveBall.VelY > 0 Then StopSound "fx_center_ramp_enter": End If : End Sub
- Sub Sw65_Hit():Controller.Switch(65) = 1:sw65flip.rotatetoend: Playsound "fx_gate4": DOFALT 107, DOFPulse : End Sub
- Sub Sw65_UnHit():Controller.Switch(65) = 0:sw65flip.rotatetostart: End Sub
- Sub sw68_Hit():Controller.Switch(68) = 1:sw68flip.rotatetoend: Playsound "fx_gate4":End Sub
- Sub Sw68_UnHit():Controller.Switch(68) = 0:sw68flip.rotatetostart: End Sub
- Sub Sw83_Hit():Controller.Switch(83) = 1:sw83flip.rotatetoend: Playsound "fx_gate4": DOFALT 107, DOFPulse : End Sub
- Sub Sw83_UnHit():controller.Switch(83) = 0:sw83flip.rotatetostart:End Sub
- Sub sw84_Hit():Controller.Switch(84) = 1:sw84flip.rotatetoend: Playsound "fx_gate4": DOFALT 107, DOFPulse : End Sub
- Sub Sw84_UnHit():controller.Switch(84) = 0:sw84flip.rotatetostart:End Sub
- Sub sw85_Hit():Controller.Switch(85) = 1:sw85flip.rotatetoend: Playsound "fx_gate4":End Sub
- Sub Sw85_UnHit():controller.Switch(85) = 0:sw85flip.rotatetostart:End Sub
- '*************** Hit Targets **********************
- Sub sw28_Hit() : PlaySound SoundFX("fx_target",DOFTargets) : vpmTimer.PulseSwitch 28,0,0 : DOFALT 104, DOFPulse : End Sub
- Sub sw44_Hit() : PlaySound SoundFX("fx_target",DOFTargets) : vpmTimer.PulseSwitch 44,0,0 : DOFALT 104, DOFPulse : End Sub
- Sub sw86_Hit() : PlaySound SoundFX("fx_target",DOFTargets) : vpmTimer.PulseSwitch 86,0,0 : DOFALT 103, DOFPulse : End Sub
- Sub sw87_Hit() : PlaySound SoundFX("fx_target",DOFTargets) : vpmTimer.PulseSwitch 87,0,0 : DOFALT 103, DOFPulse : End Sub
- '*************** Drop Targets **********************
- Sub Sw61_Hit() : PlaySound SoundFX("fx_target_drop",DOFDropTargets) : Controller.Switch(61) = 1 : sw61p.transY = -5 : DOFALT 125, DOFPulse : End Sub
- Sub Sw61_UnHit() : sw61p.transY = 0 :End Sub
- Sub Sw62_Hit() : PlaySound SoundFX("fx_target_drop",DOFDropTargets) : Controller.Switch(62) = 1 : sw62p.transY = -5 : DOFALT 126, DOFPulse : End Sub
- Sub Sw62_UnHit() : sw62p.transY = 0 :End Sub
- Sub Sw63_Hit() : PlaySound SoundFX("fx_target_drop",DOFDropTargets) : Controller.Switch(63) = 1 : sw63p.transY = -5 : DOFALT 127, DOFPulse : End Sub
- Sub Sw63_UnHit() : sw63p.transY = 0 :End Sub
- Sub Sw64_Hit() : PlaySound SoundFX("fx_target_drop",DOFDropTargets) : Controller.Switch(64) = 1 : sw64p.transY = -5 : DOFALT 128, DOFPulse : End Sub
- Sub Sw64_UnHit() : sw64p.transY = 0 :End Sub
- '************************************************************
- '************** Saloon & Gold Mine Subway *********
- '************************************************************
- Dim BIK:BIK=0
- Sub BartPopper_Hit
- PlaySound "fx_kicker_catch"
- Controller.Switch (42) = 1
- BIK = BIK + 1
- End Sub
- Sub BartPopper_UnHit()
- Controller.Switch (42) = 0
- BIK = BIK - 1
- End Sub
- Sub SecretEntrance_Hit() : PlaySound "fx_hole" : End Sub
- Sub BartHole_Hit() : Playsound "fx_saloon_enter" : End Sub
- Sub MineHole_Hit() : PlaySound "fx_mine_enter" : End Sub
- Sub MinePopper_Hit
- PlaySound "fx_kicker_catch"
- Controller.Switch (41) = 1
- BIK = BIK + 1
- End Sub
- Sub MinePopper_UnHit()
- Controller.Switch (41) = 0
- BIK = BIK - 1
- End Sub
- '************************************************
- '************** Lights *****************
- '************************************************
- Sub InitFlashers()
- L17R.IntensityScale = 0
- L18R.IntensityScale = 0
- F25R.IntensityScale = 0
- F26R.IntensityScale = 0
- F27R.IntensityScale = 0
- F27R1.IntensityScale = 0
- F27R2.IntensityScale = 0
- F28R.IntensityScale = 0
- F28R1.IntensityScale = 0
- F28R2.IntensityScale = 0
- End Sub
- '************** Inserts *****************
- On Error Resume Next
- Dim i
- For i=0 To 127
- Execute "Set Lights(" & i & ") = L" & i
- Next
- '************** Flashers *****************
- Dim ff18,ff19, ff20, ff24, ff25, ff26, ff27, ff28
- Sub Sol18(enabled)
- If enabled Then
- DOFALT 18, DOFOn
- for each ff18 in F18:ff18.State = 1
- next
- Mine.Image = "mine rock text on"
- else
- DOFALT 18, DOFOff
- for each ff18 in F18:ff18.State = 0
- Mine.Image = "mine rock text off"
- next
- End If
- End Sub
- Sub Sol19(enabled)
- If enabled Then
- DOFALT 19, DOFOn
- for each ff19 in F19:ff19.State = 1
- next
- else
- DOFALT 19, DOFOff
- for each ff19 in F19:ff19.State = 0
- next
- End If
- End Sub
- Sub Sol20(enabled)
- If enabled Then
- DOFALT 20, DOFOn
- for each ff20 in F20:ff20.State = 1
- next
- else
- DOFALT 20, DOFOff
- for each ff20 in F20:ff20.State = 0
- next
- End If
- End Sub
- Sub Sol24(enabled)
- If enabled Then
- DOFALT 24, DOFOn
- for each ff24 in F24:ff24.State = 1
- next
- else
- DOFALT 24, DOFOff
- for each ff24 in F24:ff24.State = 0
- next
- End If
- End Sub
- Sub Sol25(enabled)
- If enabled Then
- DOFALT 25, DOFOn
- for each ff25 in F25:ff25.State = 1
- F25R.IntensityScale = 1
- next
- else
- DOFALT 25, DOFOff
- for each ff25 in F25:ff25.State = 0
- F25R.IntensityScale = 0
- next
- End If
- End Sub
- Sub Sol26(enabled)
- If enabled Then
- DOFALT 26, DOFOn
- for each ff26 in F26:ff26.State = 1
- F26R.IntensityScale = 1
- next
- else
- DOFALT 26, DOFOff
- for each ff26 in F26:ff26.State = 0
- F26R.IntensityScale = 0
- next
- End If
- End Sub
- Sub Sol27(enabled)
- If enabled Then
- DOFALT 27, DOFOn
- for each ff27 in F27:ff27.State = 1
- F27R.IntensityScale = 1
- F27R1.IntensityScale = 1
- F27R2.IntensityScale = 1
- next
- else
- DOFALT 27, DOFOff
- for each ff27 in F27:ff27.State = 0
- F27R.IntensityScale = 0
- F27R1.IntensityScale = 0
- F27R2.IntensityScale = 0
- next
- End If
- End Sub
- Sub Sol28(enabled)
- If enabled Then
- DOFALT 28, DOFOn
- for each ff28 in F28:ff28.State = 1
- F28R.IntensityScale = 1
- F28R1.IntensityScale = 1
- F28R2.IntensityScale = 1
- next
- else
- DOFALT 28, DOFOff
- for each ff28 in F28:ff28.State = 0
- F28R.IntensityScale = 0
- F28R1.IntensityScale = 0
- F28R2.IntensityScale = 0
- next
- End If
- End Sub
- '********* VPM MODULATED FLASHERS ****************
- Sub Sol18Mod(value)
- for each ff18 in F18:ff18.IntensityScale = value/128:next
- If value > 0 Then
- DOFALT 18, DOFOn
- for each ff18 in F18:ff18.State = 1:next
- End If
- If value = 0 Then
- DOFALT 18, DOFOff
- for each ff18 in F18:ff18.State = 0:next
- End If
- If value > 110 Then
- Mine.Image = "mine rock text on"
- Else
- Mine.Image = "mine rock text off"
- End If
- End Sub
- Sub Sol19Mod(value)
- for each ff19 in F19:ff19.IntensityScale = value/128:next
- If value > 0 Then
- DOFALT 19, DOFOn
- for each ff19 in F19:ff19.State = 1:next
- End If
- If value = 0 Then
- DOFALT 19, DOFOff
- for each ff19 in F19:ff19.State = 0:next
- End If
- End Sub
- Sub Sol20Mod(value)
- for each ff20 in F20:ff20.IntensityScale = value/128:next
- If value > 0 Then
- DOFALT 20, DOFOn
- for each ff20 in F20:ff20.State = 1:next
- End If
- If value = 0 Then
- DOFALT 20, DOFOff
- for each ff20 in F20:ff20.State = 0:next
- End If
- End Sub
- Sub Sol24Mod(value)
- for each ff24 in F24:ff24.IntensityScale = value/128:next
- If value > 0 Then
- DOFALT 24, DOFOn
- for each ff24 in F24:ff24.State = 1:next
- End If
- If value = 0 Then
- DOFALT 24, DOFOff
- for each ff24 in F24:ff24.State = 0:next
- End If
- End Sub
- Sub Sol25Mod(value)
- for each ff25 in F25:ff25.IntensityScale = value/128:next
- F25R.IntensityScale = value/128
- If value > 0 Then
- DOFALT 25, DOFOn
- for each ff25 in F25:ff25.State = 1:next
- End If
- If value = 0 Then
- DOFALT 25, DOFOff
- for each ff25 in F25:ff25.State = 0:next
- End If
- End Sub
- Sub Sol26Mod(value)
- for each ff26 in F26:ff26.IntensityScale = value/128:next
- F26R.IntensityScale = value/128
- If value > 0 Then
- DOFALT 26, DOFOn
- for each ff26 in F26:ff26.State = 1:next
- End If
- If value = 0 Then
- DOFALT 26, DOFOff
- for each ff26 in F26:ff26.State = 0:next
- End If
- End Sub
- Sub Sol27Mod(value)
- for each ff27 in F27:ff27.IntensityScale = value/128:next
- F27R.IntensityScale = value/128
- F27R1.IntensityScale = value/128
- F27R2.IntensityScale = value/128
- If value > 0 Then
- DOFALT 27, DOFOn
- for each ff27 in F27:ff27.State = 1:next
- End If
- If value = 0 Then
- DOFALT 27, DOFOff
- for each ff27 in F27:ff27.State = 0:next
- End If
- End Sub
- Sub Sol28Mod(value)
- for each ff28 in F28:ff28.IntensityScale = value/128:next
- F28R.IntensityScale = value/128
- F28R1.IntensityScale = value/128
- F28R2.IntensityScale = value/128
- If value > 0 Then
- DOFALT 28, DOFOn
- for each ff28 in F28:ff28.State = 1:next
- End If
- If value = 0 Then
- DOFALT 28, DOFOff
- for each ff28 in F28:ff28.State = 0:next
- End If
- End Sub
- '************** GI *****************
- Dim gistep,xxx,iii,gil,gir
- Sub UpdateGI2(no, step)
- If PROC=0 Then
- If step = 0 then exit sub
- gistep = (step-1) / 7
- Select Case no
- Case 0
- For each xxx in LeftGI:xxx.IntensityScale = gistep:next
- Case 1
- For each xxx in RightGI:xxx.IntensityScale = gistep:next
- Case 2
- For each xxx in TopGI:xxx.IntensityScale = gistep:next
- For each xxx in BWGI:xxx.IntensityScale = gistep:next
- End Select
- Table1.ColorGradeImage = "ColorGrade_" & step
- End If
- End Sub
- Sub UpdateGI(giNo, stat)
- If PROC= 1 Then
- Select Case giNo
- Case 0 GI_Left(abs(stat))
- Case 1 GI_Right(abs(stat))
- Case 2 GI_Top(abs(stat))
- End Select
- If gil=0 AND gir=0 Then
- Table1.ColorGradeImage="ColorGrade_1"
- Else
- Table1.ColorGradeImage="ColorGrade_8"
- End If
- End If
- End Sub
- Sub Gi_Left(enabled)
- For each iii in LeftGI:iii.state= enabled:Next
- gil=enabled
- End Sub
- Sub Gi_Right(enabled)
- For each iii in RightGI:iii.state = enabled:Next
- gir=enabled
- End Sub
- Sub Gi_Top(enabled)
- For each iii in TopGI:iii.state = enabled:Next
- For each iii in BWGI:iii.IntensityScale = enabled:next
- End Sub
- ' *********************************************************************
- ' RealTime Updates
- ' *********************************************************************
- Sub GameTimer
- L17R.IntensityScale = L17.state
- L18R.IntensityScale = L18.state
- sw65p.rotx = sw65flip.currentangle
- sw68p.rotx = sw68flip.currentangle
- sw83p.rotx = sw83flip.currentangle
- sw84p.rotx = sw84flip.currentangle
- sw85p.rotx = sw85flip.currentangle
- FlipperL.rotz=LeftFlipper.currentangle
- FlipperR.rotz=RightFlipper.currentangle
- sw82p.rotx = BartRampG.currentangle
- sw73p.rotx = SaloonG.currentangle
- LLoopGateSw.roty = LLoopGate.currentangle
- RLoopGateSw.roty = RLoopGate.currentangle
- RollingSoundUpdate
- BallShadowUpdate
- End Sub
- ' *********************************************************************
- ' Supporting Ball & Sound Functions
- ' *********************************************************************
- Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
- Vol = Csng(BallVel(ball) ^2/RollingVol)
- 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
- '*****************
- '* Maths
- '*****************
- 'Shoopity- For the hat and beer mug, I'm gonna do some physical stuff, so we need some math functions
- Dim Pi
- Pi = Round(4 * Atn(1), 6)
- Function dSin(degrees)
- 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 dCos(degrees)
- 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 RndNum(min, max)
- RndNum = Int(Rnd() * (max-min + 1) ) + min ' Sets a random number between min and max
- End Function
- '*****************************************
- ' JP's VP10 Rolling Sounds
- '*****************************************
- Const tnob = 5 ' total number of balls
- ReDim rolling(tnob)
- InitRolling
- Sub InitRolling
- Dim i
- For i = 0 to tnob
- rolling(i) = False
- Next
- End Sub
- Sub RollingSoundUpdate()
- 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 Shadow
- '*****************************************
- Dim BallShadow
- BallShadow = Array (BallShadow1, BallShadow2, BallShadow3, BallShadow4, BallShadow5)
- Sub BallShadowUpdate()
- Dim BOT, b
- BOT = GetBalls
- ' render the shadow for each ball
- For b = 0 to UBound(BOT)
- If BOT(b).X < Table1.Width/2 Then
- BallShadow(b).X = ((BOT(b).X) - (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/7)) + 10
- Else
- BallShadow(b).X = ((BOT(b).X) + (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/7)) - 10
- End If
- BallShadow(b).Y = BOT(b).Y + 20
- BallShadow(b).Z = 1
- If BOT(b).Z > 20 Then
- BallShadow(b).visible = 1
- Else
- BallShadow(b).visible = 0
- End If
- Next
- End Sub
- '*****************************************
- ' JP's VP10 Ball Collision Sound
- '*****************************************
- Sub OnBallBallCollision(ball1, ball2, velocity)
- PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 500, Pan(ball1), 0, Pitch(ball1), 0, 0
- End Sub
- '**********************
- ' Balldrop & Ramp Sound
- '**********************
- Sub BallDropSound(dummy)
- PlaySound "fx_balldrop"
- End Sub
- Sub BallDropSound1(dummy)
- PlaySound "fx_balldrop_station"
- End Sub
- Sub Balldrop1_Hit()
- vpmtimer.addtimer 200, "BallDropSound"
- StopSound "fx_leftramp_exit"
- End Sub
- Sub Balldrop2_Hit()
- vpmtimer.addtimer 150, "BallDropSound"
- StopSound "fx_leftramp_exit"
- End Sub
- Sub LREnter_Hit()
- If ActiveBall.VelY < 0 Then PlaySound "fx_leftramp_enter"
- End Sub
- Sub RREnter_Hit()
- If ActiveBall.VelY < 0 Then PlaySound "fx_leftramp_enter"
- End Sub
- Sub LREnter_UnHit()
- If ActiveBall.VelY > 0 Then StopSound "fx_leftramp_enter"
- End Sub
- Sub RREnter_UnHit()
- If ActiveBall.VelY > 0 Then StopSound "fx_leftramp_enter"
- End Sub
- Sub LREnter1_Hit() : PlaySound "fx_leftramp_exit" : End Sub
- Sub RPin_Hit() : RandomSoundMetal() : End Sub
- Sub LPin_Hit() : RandomSoundMetal() : End Sub
- Sub Trigger1_Hit() : StopSound "fx_launch" : PlaySound "fx_turn_SSRamp" :End Sub
- Sub Trigger2_Hit() : StopSound "fx_launch" : PlaySound "fx_balldrop_SSRamp" : End Sub
- Sub Trigger3_Hit() : PlaySound "fx_wireramp" : End Sub
- Sub Trigger4_Hit() : StopSound "fx_wireramp" : End Sub
- Sub Trigger5_Hit() : PlaySound "fx_wireramp" : End Sub
- Sub Trigger6_Hit() : StopSound "fx_wireramp" : vpmtimer.addtimer 200, "BallDropSound1" : End Sub
- Sub Trigger7_Hit() : If BIP > 0 And ActiveBall.VelY < 0 Then Playsound "fx_launch" : Else StopSound "fx_launch" : End If : End Sub
- '*****************************************
- ' JF's Sound Routines
- '*****************************************
- Sub Rubbers_Hit(idx)
- dim finalspeed
- finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
- If finalspeed > 20 then
- PlaySound "fx_rubber", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End if
- If finalspeed >= 6 AND finalspeed <= 20 then
- RandomSoundRubber()
- End If
- End Sub
- Sub Posts_Hit(idx)
- dim finalspeed
- finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
- If finalspeed > 16 then
- PlaySound "fx_rubber", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End if
- If finalspeed >= 6 AND finalspeed <= 16 then
- RandomSoundRubber()
- End If
- End Sub
- Sub RandomSoundRubber()
- Select Case Int(Rnd*3)+1
- Case 1 : PlaySound "fx_rubber_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- Case 2 : PlaySound "fx_rubber_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- Case 3 : PlaySound "fx_rubber_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End Select
- End Sub
- 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_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- Case 2 : PlaySound "fx_flip_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- Case 3 : PlaySound "fx_flip_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End Select
- End Sub
- Sub LLoopGate_Hit() : RandomSoundMetal() : End Sub
- Sub RLoopGate_Hit() : RandomSoundMetal() :End Sub
- Sub RandomSoundMetal()
- Select Case Int(Rnd*3)+1
- Case 1 : PlaySound "fx_metal_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- Case 2 : PlaySound "fx_metal_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- Case 3 : PlaySound "fx_metal_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End Select
- End Sub
- '******************************************************************************************
- '* TABLE OPTIONS **************************************************************************
- '******************************************************************************************
- Dim xx,bulb
- ScoopL.visible = ScoopLight
- RailL.visible = DesktopMode
- RailR.visible = DesktopMode
- LeftCab.visible = DesktopMode
- RightCab.visible = DesktopMode
- light58.visible = DesktopMode
- light59.visible = NOT DesktopMode
- If FlipperType = 2 then FlipperType = RndNum(0, 1)
- Select Case FlipperType
- Case 0: FlipperL.image = "flippers white"
- FlipperR.image = "flippers white"
- Case 1: FlipperL.image = "flippers"
- FlipperR.image = "flippers"
- End Select
- For Each xx in BadGuysLights : xx.visible = BadGuysMod : Next
- If ColorMod Then
- For Each bulb in RedGI : bulb.color = RGB (255, 0, 0) : bulb.intensity = 65 : Next
- For Each bulb in GreenGI : bulb.color = RGB (0, 255, 0) : Next
- For Each bulb in BlueGI : bulb.color = RGB (0, 0, 255) : bulb.intensity = 65: Next
- End If
Advertisement
Add Comment
Please, Sign In to add comment