Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '*********************************************************************************************************************************************************************
- '*********************************************************************************************************************************************************************
- '*********************************************************************************************************************************************************************
- '*********************************************************************************************************************************************************************
- ' #####, #######, ,##### ####### ;#####, ####### ######' ##, ###
- ' ###### :####### ###### ####### ###### ,######, ###### ,## ###
- ' ### .## ### ;## ##` ##' ,## ### ##'###
- ' ###: ### ;; ## ##+;### ;; ##;;##' ## #####
- ' #### ## ## `## .###### +## ####### '###### #####.
- ' ##, ### ##. ### ##+,### ##. ##,,##, ######. ##`##
- ' ##. ##` ;#; ##. ## ##+ :## '## ## .## '## ##`
- ' ,####### :## .####### ### ## ##: ##. '## ######' ##. ##+
- ' #######` ##, ######## ##` ### .## ,## ##. ###### ,## ,##
- ' `#####: .## ########,;## ##` ### ##; ,## ####### ##; ##
- '
- ' ###### :## .## ######' '######: ######' `## ###; #######, ####### :###### ####### ###### `######` ,##### #######, ##. ####### '######:
- ' `###### ##: ##+ ###### #######, ###### ## #### :####### ######## ######,`####### +###### ####### ###### :####### :## :####### #######,
- ' .## ## ### .## ### #####: .## .## ### ### ##. ## ### ### .## ##: ##; ##'.## .##
- ' :;; ###;;### ## ;;: ### ## '###: ### :;; ;;;; ### ## ##`,## ###;'## ;; ## ### .## `## ## ##' ###
- ' ##, #######`'###### ## ## '###### ###: ## ##. ###. ###### +## ;## ######: ######; ## `## ## ### ### ### ## ##
- ' .## ###,,+## ######. ### ### ######. #### ### ,## .### ####### ##. ##,`###### :##,:## ##. ### ### ## ## ## ### ###
- ' ##+ ##. ##,.## ## ##`.## #####: ##` ##; ##; ##` :## .## ### ##: :## ;#; ##. ##` ### ### '## ## ##`
- ' ## :## .## ######' '## :## ######' ####.'## :## `####### :###### ##; ##' ###### `## ##: .####### :## ##` #######.+## :##
- ' ### ##: ##' ###### ##. ##: ###### ;###. ## ##, ######## ######,.## ## +###### ### `## ######## ##, ;## ,####### ##. ##:
- ' ##` .## ## ####### ,## .## ####### ### ## .## '#####' .###### ### ### ######` ## ### ########, .## ##: ###### ,## .##
- '*********************************************************************************************************************************************************************
- '*********************************************************************************************************************************************************************
- '*********************************************************************************************************************************************************************
- '*********************************************************************************************************************************************************************
- '*********************************************************************
- '*********************************************************************
- '1993 Star Trek - The Next Generation by Williams Pinball
- '*********************************************************************
- '*********************************************************************
- 'Concept by: Steve Ritchie
- 'Design by: Steve Ritchie, Dwight Sullivan, Greg Freres
- 'Art by: Greg Freres
- 'Dots/Animation by: Scott Slomiany, Eugene Geer
- 'Mechanics by: Carl Biagi
- 'Music by: Dan Forden
- 'Sound by: Dan Forden
- 'Software by: Dwight Sullivan, Matt Coriale
- '*********************************************************************
- '*********************************************************************
- 'recreated for Visual Pinball by Knorr and Clark Kent
- '*********************************************************************
- '*********************************************************************
- Option Explicit
- Randomize
- On Error Resume Next
- ExecuteGlobal GetTextFile("controller.vbs")
- If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
- On Error Goto 0
- Dim DesktopMode
- DesktopMode = Table1.ShowDT
- Dim UseVPMDMD
- UseVPMDMD = DesktopMode
- 'UseVPMDMD = 1
- Const UseVPMModSol = 1
- '**********
- '***Mods***
- '**********
- '1 for ON, 0 for OFF
- InlanesMod = 0 'with this mod the inlanes are about 1cm/0,39inch longer
- BorgMod = 0 'changes the Original Model to a Custom Model
- RGBMod = 0 'RGB
- RGBBumpers = 1
- RGBArrows = 1
- LaserMod = 0 'Activate Lasers on the Cannons
- LaserColor = 1 '1 = RED, 2 = GREEN, 3 = BLUE
- LaserType = 1 '1 = Fast, turns off after the ball is shoot, 2 = Slow, turns off after the cannon is back initial_pos
- '********************
- 'Standard definitions
- '********************
- LoadVPM "01560000", "wpc.VBS", 3.36
- '***ROM***ROM***ROM***ROM***
- Const cGameName = "sttng_s7"
- '***************************
- Const UseSolenoids = 1
- Const UseLamps = 0
- Const HandleMech = 0
- Const SSolenoidOn = "SolOn"
- Const SSolenoidOff = "SolOff"
- Const SFlipperOn = "FlipperUp"
- Const SFlipperOff = "FlipperDown"
- Const SCoin = "Coin4"
- Dim bsTrough,TopDrop, LeftCannonMech, RightCannonMech, BorgLock
- Dim KB, CP, UnderDiverterTop1, UnderDiverterBottom1
- Dim InlanesMod, BorgMod, FlipperMod, LaserMod, LaserColor, LaserType, RGBMod, RGBBumpers, RGBArrows
- 'Set LampCallback = GetRef("UpdateMultipleLamps")
- Set MotorCallback = GetRef("RealTimeUpdates")
- Set GiCallback2 = GetRef("UpdateGI")
- BSize = 25.5
- BMass = 1
- '************
- ' Table Init
- '************
- Sub table1_Init
- vpmInit Me
- With Controller
- .GameName = cGameName
- If Err Then MsgBox "Can't start Game " & cGameName & vbNewLine & Err.Description:Exit Sub
- .Games(cGameName).Settings.Value("rol") = 1
- .HandleKeyboard = 0
- .ShowTitle = 0
- .ShowDMDOnly = 1
- .ShowFrame = 0
- .HandleMechanics = 0
- .Hidden = DesktopMode
- '.SetDisplayPosition 0, 0, GetPlayerHWnd 'uncomment this line if you don't see the DMD
- On Error Resume Next
- .Run GetPlayerHWnd
- If Err Then MsgBox Err.Description
- On Error Goto 0
- .Switch(22) = 1 'close coin door
- .Switch(24) = 1 'and keep it close
- PinMAMETimer.Interval = PinMAMEInterval
- PinMAMETimer.Enabled = true
- vpmNudge.TiltSwitch = 14
- vpmNudge.Sensitivity = 2
- End With
- Set bsTrough = New cvpmBallStack
- With bsTrough
- .InitSw 0, 66, 65, 64, 63, 62, 61, 0
- .InitKick BallRelease, 80, 10
- .InitExitSnd SoundFX("BallRelease", DOFContactors), SoundFX("fx_Solenoid", DOFContactors)
- .Balls = 6
- End With
- Set TopDrop = New cvpmDropTarget
- With TopDrop
- .InitDrop sw57, 57
- .InitSnd SoundFX("Dropdown",DOFDropTargets), SoundFX("DropUp",DOFDropTargets)
- End With
- Set BorgLock = New cvpmBallStack
- With BorgLock
- .InitSw 0, 31, 0, 0, 0, 0, 0, 0
- .InitKick BorgKicker, 180, 24
- .InitExitSnd SoundFX("popper",DOFContactors), SoundFX("Solenoid",DOFContactors)
- ' .Balls = 0
- End With
- '**********************
- '***DesktopMode Init***
- '**********************
- If table1.ShowDt = False then
- Korpus.visible = 0
- Korpus1.visible = 1
- LeftSideRail.visible = 0
- RightSideRail.visible = 0
- Else
- Korpus.visible = 1
- Korpus1.visible = 0
- LeftSideRail.visible = 1
- RightSideRail.visible = 1
- End if
- '****************************
- '***Switches/Diverter Init***
- '****************************
- Controller.Switch(127) = 1
- Controller.Switch(122) = 1
- Controller.Switch(125) = 1
- Controller.Switch(126) = 1
- DiverterFRG.isDropped = 1
- DiverterFLG.isDropped = 0
- sw57.isDropped = 1
- sw41dr.isDropped = 1
- sw35dr.isDropped = 1
- sw36dr.isDropped = 1
- sw37dr.isDropped = 1
- sw37dr1.isDropped = 0
- sw42dr.isDropped = 1
- sw43dr.isDropped = 1
- sw47dr.isDropped = 1
- '**************
- '***Mods Init***
- '**************
- If InlanesMod = 1 then
- leftinlanewall.collidable = 0
- rightinlanewall.collidable = 0
- inlanemetal.visible = 0
- leftinlanewallmod.collidable = 1
- rightinlanewallmod.collidable = 1
- inlanemetalmod.visible = 1
- Else
- leftinlanewall.collidable = 1
- rightinlanewall.collidable = 1
- inlanemetal.visible = 1
- leftinlanewallmod.collidable = 0
- rightinlanewallmod.collidable = 0
- inlanemetalmod.visible = 0
- End if
- If BorgMod = 1 then
- borgshipcustom.visible = 1
- borgshipcustomledoff.visible = 1
- borgshipcustomwiresplines.visible = 1
- deltarampendborgcustom.visible = 1
- l78a.Intensity = 30
- l78b.Intensity = 30
- l78c.Intensity = 6
- l78d.Intensity = 30
- l78e.Intensity = 10
- l78a1.State = 1
- l78b1.State = 1
- l78c1.State = 1
- l78d1.State = 1
- l78e1.State = 1
- borgshiporiginal.visible = 0
- borgledoriginal.visible = 0
- deltarampendborg.visible = 0
- l78borga.Intensity = 0
- l78borgb.Intensity = 0
- l78borgc.Intensity = 0
- l78borgd.Intensity = 0
- l78borge.Intensity = 0
- l78borga1.State = 0
- l78borgb1.State = 0
- l78borgc1.State = 0
- l78borgd1.State = 0
- l78borge1.State = 0
- Else
- borgshipcustom.visible = 0
- borgshipcustomledoff.visible = 0
- borgshipcustomwiresplines.visible = 0
- deltarampendborgcustom.visible = 0
- l78a.Intensity = 0
- l78b.Intensity = 0
- l78c.Intensity = 0
- l78d.Intensity = 0
- l78e.Intensity = 0
- l78a1.State = 0
- l78b1.State = 0
- l78c1.State = 0
- l78d1.State = 0
- l78e1.State = 0
- borgshiporiginal.visible = 1
- borgledoriginal.visible = 1
- deltarampendborg.visible = 1
- l78borga.Intensity = 15
- l78borgb.Intensity = 50
- l78borgc.Intensity = 60
- l78borgd.Intensity = 30
- l78borge.Intensity = 50
- l78borga1.State = 1
- l78borgb1.State = 1
- l78borgc1.State = 1
- l78borgd1.State = 1
- l78borge1.State = 1
- End if
- If RGBMod = 1 then RGBTimer.Enabled = 1
- If RGBBumpers = 1 And RGBMod = 1 then
- BumperCap1.Image = "bumpero_weis"
- BumperCap2.Image = "bumpero_weis"
- BumperCap3.Image = "bumpero_weis_half"
- End if
- If LaserColor = 1 then LaserL.Material = "LaserRed"
- If LaserColor = 1 then LaserL1.Material = "LaserRed1"
- If LaserColor = 1 then LaserR.Material = "LaserRed"
- If LaserColor = 1 then LaserR1.Material = "LaserRed1"
- If LaserColor = 2 then LaserL.Material = "LaserGreen"
- If LaserColor = 2 then LaserL1.Material = "LaserGreen1"
- If LaserColor = 2 then LaserR.Material = "LaserGreen"
- If LaserColor = 2 then LaserR1.Material = "LaserGreen1"
- If LaserColor = 3 then LaserL.Material = "LaserBlue"
- If LaserColor = 3 then LaserL1.Material = "LaserBlue1"
- If LaserColor = 3 then LaserR.Material = "LaserBlue"
- If LaserColor = 3 then LaserR1.Material = "LaserBlue1"
- End Sub
- '*********
- 'Solenoids
- '*********
- SolCallback(1) = "LeftCannonKicker"
- SolCallback(2) = "RightCannonKicker"
- SolCallback(3) = "UnderLeftGun"
- SolCallback(4) = "UnderRightGun"
- SolCallback(5) = "LeftLock"
- SolCallback(6) = "AutoPlunge"
- SolCallback(7) = "vpmSolSound SoundFX(""Knocker"",DOFKnocker),"
- SolCallBack(8) = "Kickback"
- SolCallBack(11) = "SolRelease"
- SolCallBack(15) = "TopDiverter"
- SolCallBack(16) = "BorgLock.SolOut"
- SolCallback(17) = "LeftCannonMotor"
- SolCallback(18) = "RightCannonMotor"
- SolCallBack(51) = "UnderDiverterTop"
- SolCallBack(52) = "UnderDiverterBottom"
- SolCallBack(53) = "TopDrop.SolDropUp"
- SolCallBack(54) = "TopDrop.SolDropDown"
- '***Flasher***
- SolModCallBack(20) = "Flash120" 'JetsFlasher
- SolModCallBack(21) = "Flash121" 'RightPopperFlasher
- SolModCallBack(22) = "Flash122" 'MiddleRampFlasher
- SolModCallBack(23) = "Flash123" 'ShieldsFlasher
- SolCallBack(24) = "SetLamp 124," 'AutofireFlasher
- SolModCallBack(25) = "Flash125" 'ExitUnGndFlasher
- SolModCallBack(26) = "Flash126" 'RightBorgFlasher
- SolModCallBack(27) = "Flash127" 'LeftBorgFlasher
- SolModCallBack(28) = "Flash128" 'CenterBorgFlasher
- SolModCallBack(55) = "Flash141" 'RomulanFlasher
- SolModCallBack(56) = "Flash142" 'RightRampFlasher
- Sub SolRelease(Enabled)
- If Enabled And bsTrough.Balls> 0 Then
- vpmTimer.PulseSw 67
- bsTrough.ExitSol_On
- End If
- End Sub
- Sub Drain_Hit
- PlaySound "Drain", 0, 0.4, 0
- bsTrough.AddBall Me
- End Sub
- Sub AutoPlunge(Enabled)
- if enabled then
- AutoPlunger.Kick 0, 145
- PlaySound SoundFX("PlungerCatapult",DOFContactors)
- ' Catapult.RotX = Catapult.RotX +17
- CP = True
- Else
- Controller.Switch(68) = 0
- CP = False
- ' Catapult.RotX = Catapult.RotX -17
- End if
- End Sub
- Sub AutoPlunger_Hit:Controller.Switch(68) = 1:End Sub
- Sub TopDiverter(enabled)
- If Enabled Then
- diverter.rotatetoend
- topdiverterwall.isdropped = 0
- PlaySound SoundFX("TopdiverterOn",DOFContactors)
- Else
- diverter.rotatetostart
- topdiverterwall.isdropped = 1
- PlaySound SoundFX("TopdiverterOff",DOFContactors)
- End If
- End Sub
- Sub UnderDiverterTop(enabled)
- If enabled Then
- DiverterFRG.isDropped = 0
- sw37dr1.isDropped = 1
- Else
- DiverterFRG.isDropped = 1
- sw37dr1.isDropped = 0
- End If
- End Sub
- Sub UnderDiverterBottom(enabled)
- If enabled Then
- DiverterFLG.isDropped = 1
- Else
- ' vpmtimer.addtimer 1250, "DiverterFLG.isDropped = 0'"
- DiverterFLG.isDropped = 0
- End If
- End Sub
- Sub BorgKicker1_Hit()
- borglock.Addball Me
- End Sub
- Sub KickBack(Enabled)
- If enabled Then
- KickbackPlunger.Fire
- KB = True
- KickBackTimer.Enabled = 1
- Playsound SoundFX("Kickback", DOFContactors)
- Else
- End if
- End Sub
- Sub LeftCannonMotor(enabled)
- If enabled Then
- CML = True
- CannonLTimer.Enabled = 1
- PlaySound SoundFX("LGunMotor",DOFGear)
- Else
- CannonLTimer.Enabled = 0
- StopSound "LGunMotor"
- End If
- End Sub
- Sub RightCannonMotor(enabled)
- If enabled Then
- CMR = True
- CannonRTimer.Enabled = 1
- PlaySound SoundFX("RGunMotor",DOFGear)
- Else
- CannonRTimer.Enabled = 0
- StopSound "RGunMotor"
- End If
- End Sub
- Sub UnderLeftGun(Enabled)
- If enabled then
- sw36.kick 161, 50, 1.4
- PlaySound SoundFX("LGunPopper",DOFContactors)
- Else
- Controller.Switch(36) = 0
- vpmtimer.addtimer 1000, "sw36dr.isDropped = 1'"
- End if
- End Sub
- Sub UnderRightGun(Enabled)
- If enabled then
- sw37.kick 199, 50, 1.4
- PlaySound SoundFX("RGunPopper",DOFContactors)
- Else
- Controller.Switch(37) = 0
- vpmtimer.addtimer 1000, "sw37dr.isDropped = 1'"
- End if
- End Sub
- Sub LeftLock(Enabled)
- If enabled then
- sw41.kick 255, 50, 1.4
- PlaySound SoundFX("LeftPopper",DOFContactors)
- Else
- Controller.Switch(41) = 0
- ' vpmtimer.addtimer 1000, "sw41dr.isDropped = 1'"
- sw41dr.isDropped = 1
- End if
- End Sub
- '*********
- ' Bumper
- '*********
- Sub LeftJetBumper_hit:vpmTimer.pulseSw 71:Playsound SoundFX("BumperLeft", DOFContactors):Me.TimerEnabled = 1:End Sub
- Sub LeftJetBumper_Timer:Me.Timerenabled = 0:End Sub
- Sub RightJetBumper_hit:vpmTimer.pulseSw 72:Playsound SoundFX("BumperRight", DOFContactors):Me.TimerEnabled = 1:End Sub
- Sub RightJetBumper_Timer:Me.Timerenabled = 0:End Sub
- Sub BottomJetBumper_hit:vpmTimer.pulseSw 73:Playsound SoundFX("BumperMiddle", DOFContactors):Me.TimerEnabled = 1:End Sub
- Sub BottomJetBumper_Timer:Me.Timerenabled = 0:End Sub
- '*********
- ' Switches
- '*********
- Sub sw15_Hit:Controller.Switch(15) = 1:PlaySound "metalhit_thin":End Sub
- Sub sw15_UnHit:Controller.Switch(15) = 0:End Sub
- Sub sw16_Hit:Controller.Switch(16) = 1:End Sub
- Sub sw16_UnHit:Controller.Switch(16) = 0:End Sub
- Sub sw17_Hit:Controller.Switch(17) = 1:End Sub
- Sub sw17_UnHit:Controller.Switch(17) = 0:End Sub
- Sub sw18_Hit:Controller.Switch(18) = 1:PlaySound "metalhit_thin":End Sub
- Sub sw18_UnHit:Controller.Switch(18) = 0:End Sub
- Sub sw117spinner_Spin():vpmTimer.PulseSw 117:PlaySound "fx_spinner":End Sub
- Sub sw44_Hit:Controller.Switch(44) = 1:End Sub
- Sub sw44_UnHit:Controller.Switch(44) = 0:End Sub
- Sub sw48_Hit:Controller.Switch(48) = 1:End Sub
- Sub sw48_UnHit:Controller.Switch(48) = 0:End Sub
- Sub sw57_Hit:TopDrop.hit 1:End Sub
- Sub sw58_Hit:Controller.Switch(58) = 1:PlaySound "metalhit_thin":End Sub
- Sub sw58_UnHit:Controller.Switch(58) = 0:End Sub
- Sub sw76_Hit:Controller.Switch(76) = 1:PlaySound "metalhit_thin":End Sub
- Sub sw76_UnHit:Controller.Switch(76) = 0:End Sub
- Sub sw77_Hit:Controller.Switch(77) = 1:PlaySound "metalhit_thin":End Sub
- Sub sw77_UnHit:Controller.Switch(77) = 0:End Sub
- Sub sw78_Hit:Controller.Switch(78) = 1:PlaySound "metalhit_thin":End Sub
- Sub sw78_UnHit:Controller.Switch(78) = 0:End Sub
- Sub sw25_Hit:vpmTimer.PulseSw 25: End Sub 'right Ramp
- Sub sw87_Hit:vpmTimer.PulseSw 87: End Sub
- Sub sw88_Hit:vpmTimer.PulseSw 88: End Sub 'left Ramp
- Sub sw83_Hit:vpmTimer.PulseSw 83: sw83wire.RotX = 110:Me.TimerEnabled = 1:End Sub
- Sub sw83_Timer: sw83wire.RotX = 90: Me.TimerEnabled = 0: End Sub
- Sub sw23_Hit:vpmTimer.PulseSw 23: sw23wire.RotX = 110:Me.TimerEnabled = 1:End Sub 'middle Ramp
- Sub sw23_Timer: sw23wire.RotX = 90: Me.TimerEnabled = 0: End Sub
- Sub BallCatcher1_Hit:If ActiveBall.VelY <= -20 then ActiveBall.VelY = -20:End if:End Sub
- 'GunSwitches
- Sub sw32_Hit:Controller.Switch(32) = 1:End Sub
- Sub sw32_UnHit:Controller.Switch(32) = 0:End Sub
- Sub sw36_Hit:Controller.Switch(36) = 1:sw36dr.isDropped = 0:End Sub
- Sub sw33_Hit:Controller.Switch(33) = 1:End Sub
- Sub sw33_UnHit:Controller.Switch(33) = 0:End Sub
- Sub sw37_Hit:Controller.Switch(37) = 1:sw37dr.isDropped = 0:End Sub
- 'LeftLock
- Sub sw41_Hit:Controller.Switch(41) = 1:sw41dr.isDropped = 0:End Sub
- Sub sw35_Hit:Controller.Switch(35) = 1:sw35dr.isDropped = 0:End Sub
- Sub sw35_UnHit:Controller.Switch(35) = 0:sw35dr.isDropped = 1:End Sub
- Sub sw42_Hit:Controller.Switch(42) = 1:sw42dr.isDropped = 0:End Sub
- Sub sw42_UnHit:Controller.Switch(42) = 0:sw42dr.isDropped = 1:End Sub
- Sub sw43_Hit:Controller.Switch(43) = 1:sw43dr.isDropped = 0:End Sub
- Sub sw43_UnHit:Controller.Switch(43) = 0:sw43dr.isDropped = 1:End Sub
- '***Holes***
- Sub sw27_Hit: vpmTimer.PulseSw 27:T27P.RotX = 100:T27P2.RotX = 100:PlaySound SoundFX("target",DOFTargets):T27.TimerEnabled = 1:SoundNeutralZone:End Sub
- Sub sw45_Hit: SoundNeutralZone:End Sub
- Sub sw45t_Hit: Controller.Switch(45) = 1:End Sub
- Sub sw45t_UnHit: Controller.Switch(45) = 0:End Sub
- Sub sw46t_Hit: Controller.Switch(46) = 1:PlaySound "CommandD":End Sub
- Sub sw46t_UnHit: Controller.Switch(46) = 0:End Sub
- Sub sw47t_Hit: Controller.Switch(47) = 1:sw47dr.isDropped = 0:End Sub
- Sub sw47_Hit:PlaySound "StartMission1":End Sub
- Sub sw47t_UnHit: Controller.Switch(47) = 0:sw47dr.isDropped = 1:End Sub
- '***Targets***
- 'T27 only pulse with sw27(Hole) to prevent double hits
- Sub T26_Hit:vpmTimer.PulseSw 26:PlaySound SoundFX("target",DOFTargets):End Sub
- 'Sub T27_Hit:T27P.RotX = 100:T27P2.RotX = 100:PlaySound "target":T27.TimerEnabled = 1:End Sub
- Sub T27_Timer:T27P.RotX = 90:T27P2.RotX = 90:End Sub
- Sub T28_Hit:vpmTimer.PulseSw 28:PlaySound SoundFX("target",DOFTargets):End Sub
- Sub T51_Hit:vpmTimer.PulseSw 51:PlaySound SoundFX("target",DOFTargets):End Sub
- Sub T52_Hit:vpmTimer.PulseSw 52:PlaySound SoundFX("target",DOFTargets):End Sub
- Sub T53_Hit:vpmTimer.PulseSw 53:PlaySound SoundFX("target",DOFTargets):End Sub
- Sub T54_Hit:vpmTimer.PulseSw 54:PlaySound SoundFX("target",DOFTargets):End Sub
- Sub T55_Hit:vpmTimer.PulseSw 55:PlaySound SoundFX("target",DOFTargets):End Sub
- Sub T56_Hit:vpmTimer.PulseSw 56:PlaySound SoundFX("target",DOFTargets):End Sub
- Sub T81_Hit:vpmTimer.PulseSw 81:PlaySound SoundFX("target",DOFTargets):End Sub
- Sub T82_Hit:vpmTimer.PulseSw 82:PlaySound SoundFX("target",DOFTargets):End Sub
- Sub T84_Hit:vpmTimer.PulseSw 84:PlaySound SoundFX("target",DOFTargets):End Sub
- Sub T85_Hit:vpmTimer.PulseSw 85:PlaySound SoundFX("target",DOFTargets):End Sub
- Sub T86_Hit:vpmTimer.PulseSw 86:PlaySound SoundFX("target",DOFTargets):End Sub
- 'KickerAnimation
- '***************
- ' ToysAnimation
- '***************
- '***Cannons***
- Dim CannonSpeed, CannonSteps, CannonAnimationSteps, CannonLBall, CannonRBall, RadiusL, RadiusR, CannonAngleL, CannonAngleR
- Dim RadiusRL, RadiusLL, CML, CMR, CPL, CPR
- Dim ForceL, ForceR, LaserLON, LaserRON
- CannonSpeed = 600 'Timer with 1 = 1000/Second
- CannonSteps = 82
- Const Pi = 3.14159265358979
- RadiusL = CannonBaseL.Y - kicker1.Y
- RadiusR = CannonBaseR.Y - kicker2.Y
- RadiusLL = CannonBaseL.Y - l52.Y
- RadiusRL = CannonBaseR.Y - l82.Y
- Sub Kicker1_Hit()
- me.destroyball
- Set CannonLBall = kicker1.createball
- Controller.Switch(38) = 1
- me.Enabled = False
- If LaserMod = 1 then
- LaserL.visible = 1
- LaserL1.visible = 1
- LaserZTimer.Enabled = 1
- LaserLON = 1
- End if
- End Sub
- Sub Kicker2_Hit()
- me.destroyball
- Set CannonRBall = kicker2.createball
- Controller.Switch(34) = 1
- me.Enabled = False
- If LaserMod = 1 then
- LaserR.visible = 1
- LaserR1.visible = 1
- LaserZTimer1.Enabled = 1
- LaserRON = 1
- End if
- End Sub
- Sub CannonLTimer_Timer()
- If CML = True and CannonBaseL.ObjRotZ < 64 Then
- CannonBaseL.ObjRotZ = CannonBaseL.ObjRotZ +(CannonSteps*2)/CannonSpeed
- End if
- If CML = False and CannonBaseL.ObjRotZ > -19 then
- CannonBaseL.ObjRotZ = CannonBaseL.ObjRotZ -(CannonSteps*2)/CannonSpeed
- End if
- If CannonBaseL.ObjRotZ >= 64 then CML = False
- If CannonBaseL.ObjRotZ >= -20 And CannonBaseL.ObjRotZ <= -17 then Controller.Switch(127) = 1: Else Controller.Switch(127) = 0
- If CannonBaseL.ObjRotZ >= -20 And CannonBaseL.ObjRotZ <= 9 then Controller.Switch(122) = 1:ForceL = 25: Else Controller.Switch(122) = 0: ForceL = 50
- If Not IsEmpty(CannonLBall) Then
- CannonLBall.X= CannonBaseL.X - RadiusL*sin(-CannonBaseL.ObjRotZ*(Pi/180))
- CannonLBall.Y= CannonBaseL.Y - RadiusL*cos(-CannonBaseL.ObjRotZ*(Pi/180))
- CannonLBall.Z=105 + BSize
- CannonAngleL = CannonBaseL.ObjRotZ
- End If
- CannonL.ObjRotZ = CannonBaseL.ObjRotZ
- CannonDomeL.ObjRotZ = CannonBaseL.ObjRotZ
- CannonPinL.ObjRotZ = CannonBaseL.ObjRotZ
- l52.X = CannonBaseL.X - RadiusRL*sin(-CannonBaseL.ObjRotZ*(Pi/180))
- l52.Y = CannonBaseL.Y - RadiusRL*cos(-CannonBaseL.ObjRotZ*(Pi/180))
- LaserL.ObjRotZ = CannonBaseL.ObjRotZ
- LaserL1.ObjRotZ = CannonBaseL.ObjRotZ
- End Sub
- Sub CannonRTimer_Timer()
- If CMR = True and CannonBaseR.ObjRotZ < 64 Then
- CannonBaseR.ObjRotZ = CannonBaseR.ObjRotZ +(CannonSteps*2)/CannonSpeed
- End if
- If CMR = False and CannonBaseR.ObjRotZ > -19 then
- CannonBaseR.ObjRotZ = CannonBaseR.ObjRotZ -(CannonSteps*2)/CannonSpeed
- End if
- If CannonBaseR.ObjRotZ >= 64 then CMR = False
- If CannonBaseR.ObjRotZ >= -20 And CannonBaseR.ObjRotZ <= -17 then Controller.Switch(125) = 1: Else Controller.Switch(125) = 0
- If CannonBaseR.ObjRotZ >= -20 And CannonBaseR.ObjRotZ <= 9 then Controller.Switch(126) = 1:ForceR = 25: Else Controller.Switch(126) = 0: ForceR = 50
- If Not IsEmpty(CannonRBall) Then
- CannonRBall.X= CannonBaseR.X - RadiusR*sin(+CannonBaseR.ObjRotZ*(Pi/180))
- CannonRBall.Y= CannonBaseR.Y - RadiusR*cos(+CannonBaseR.ObjRotZ*(Pi/180))
- CannonRBall.Z=105 + BSize
- CannonAngleR = CannonBaseR.ObjRotZ- (CannonBaseR.ObjRotZ*2)
- End If
- CannonR.ObjRotZ = CannonBaseR.ObjRotZ
- CannonDomeR.ObjRotZ = CannonBaseR.ObjRotZ
- CannonPinR.ObjRotZ = CannonBaseR.ObjRotZ
- l82.X = CannonBaseR.X - RadiusRL*sin(+CannonBaseR.ObjRotZ*(Pi/180))
- l82.Y = CannonBaseR.Y - RadiusRL*cos(+CannonBaseR.ObjRotZ*(Pi/180))
- LaserR.ObjRotZ = CannonBaseR.ObjRotZ
- LaserR1.ObjRotZ = CannonBaseR.ObjRotZ
- End Sub
- '***CannonShoot***
- Sub LeftCannonKicker(Enabled)
- If Enabled then
- CPL = True
- If Not IsEmpty(CannonLBall) Then
- Kicker1.kick CannonAngleL, ForceL
- Playsound SoundFX("LGunKicker", DOFContactors)
- Controller.Switch(38) = 0
- CannonLBall = Empty
- Kicker1.Enabled = True
- LaserLON = 0
- If LaserType = 1 then
- LaserL.Visible = 0
- LaserL1.Visible = 0
- LaserZTimer.Enabled = 0
- End if
- End if
- End if
- End Sub
- Sub RightCannonKicker(Enabled)
- If Enabled then
- CPR = True
- If Not IsEmpty(CannonRBall) Then
- Kicker2.kick CannonAngleR, ForceR
- Playsound SoundFX("RGunKicker", DOFContactors)
- Controller.Switch(34) = 0
- CannonRBall = Empty
- Kicker2.Enabled = True
- LaserRON = 0
- If LaserType = 1 then
- LaserR.Visible = 0
- LaserR1.Visible = 0
- LaserZTimer1.Enabled = 0
- End if
- End if
- End if
- End Sub
- '***LaserZTimer***
- Sub LaserZTimer_Timer()
- If CannonBaseL.ObjRotZ >= -20 And CannonBaseL.ObjRotZ <= -17 then LaserL.Size_Z = 0.3: LaserL1.Size_Z = 0.3
- If CannonBaseL.ObjRotZ >= -16.99 And CannonBaseL.ObjRotZ <= -8 then LaserL.Size_Z = 0.3: LaserL1.Size_Z = 0.25
- If CannonBaseL.ObjRotZ >= -7.99 And CannonBaseL.ObjRotZ <= -5 then LaserL.Size_Z = 0.3: LaserL1.Size_Z = 0.3
- If CannonBaseL.ObjRotZ >= -4.99 And CannonBaseL.ObjRotZ <= -1 then LaserL.Size_Z = 0.67: LaserL1.Size_Z = 0.67
- If CannonBaseL.ObjRotZ >= 0.99 And CannonBaseL.ObjRotZ <= 5.99 then LaserL.Size_Z = 1: LaserL1.Size_Z = 1
- If BorgMod = 0 then
- If CannonBaseL.ObjRotZ >= 6 And CannonBaseL.ObjRotZ <= 21.99 then LaserL.Size_Z = 0.75: LaserL1.Size_Z = 0.75
- End if
- If BorgMod = 1 then
- If CannonBaseL.ObjRotZ >= 6 And CannonBaseL.ObjRotZ <= 21.99 then LaserL.Size_Z = 1: LaserL1.Size_Z = 1
- End if
- If CannonBaseL.ObjRotZ >= 22 And CannonBaseL.ObjRotZ <= 56.99 then LaserL.Size_Z = 1: LaserL1.Size_Z = 1
- If CannonBaseL.ObjRotZ >= 57 And CannonBaseL.ObjRotZ <= 62.99 then LaserL.Size_Z = 0.48: LaserL1.Size_Z = 0.48
- If CannonBaseL.ObjRotZ >= 63 then LaserL.Size_Z = 1:LaserL1.Size_Z = 1
- If CannonBaseL.ObjRotZ <= -18 And LaserLON = 0 Then
- LaserL.Visible = 0
- LaserL1.Visible = 0
- LaserZTimer.Enabled = 0
- End if
- End Sub
- Sub LaserZTimer1_Timer()
- If CannonBaseR.ObjRotZ >= -20 And CannonBaseR.ObjRotZ <= -18 then LaserR.Size_Z = 1: LaserR1.Size_Z = 1
- If CannonBaseR.ObjRotZ >= -17.99 And CannonBaseR.ObjRotZ <= -8 then LaserR.Size_Z = 0.235: LaserR1.Size_Z = 0.235
- If CannonBaseR.ObjRotZ >= -7.99 And CannonBaseR.ObjRotZ <= 8.99 then LaserR.Size_Z = 1: LaserR1.Size_Z = 1
- If BorgMod = 0 then
- If CannonBaseR.ObjRotZ >= 9 And CannonBaseR.ObjRotZ <= 22.99 then LaserR.Size_Z = 0.76: LaserR1.Size_Z = 0.76
- End if
- If BorgMod = 1 then
- If CannonBaseR.ObjRotZ >= 9 And CannonBaseR.ObjRotZ <= 22.99 then LaserR.Size_Z = 1: LaserR1.Size_Z = 1
- End if
- If CannonBaseR.ObjRotZ >= 23 And CannonBaseR.ObjRotZ <= 28.99 then LaserR.Size_Z = 1: LaserR1.Size_Z = 1
- If CannonBaseR.ObjRotZ >= 29 And CannonBaseR.ObjRotZ <= 32.99 then LaserR.Size_Z = 0.785: LaserR1.Size_Z = 0.785
- If CannonBaseR.ObjRotZ >= 33 And CannonBaseR.ObjRotZ <= 50.99 then LaserR.Size_Z = 1: LaserR1.Size_Z = 1
- If CannonBaseR.ObjRotZ >= 51 And CannonBaseR.ObjRotZ <= 57.99 then LaserR.Size_Z = 0.51: LaserR1.Size_Z = 0.51
- If CannonBaseR.ObjRotZ >= 58 And CannonBaseR.ObjRotZ <= 62.99 then LaserR.Size_Z = 0.49: LaserR1.Size_Z = 0.49
- If CannonBaseR.ObjRotZ >= 63 then LaserR.Size_Z = 1: LaserR1.Size_Z = 1
- If CannonBaseR.ObjRotZ <= -18 And LaserRON = 0 Then
- LaserR.Visible = 0
- LaserR1.Visible = 0
- LaserZTimer1.Enabled = 0
- End if
- End Sub
- '***CannonPin Animation***
- Sub CannonPinLTimer_Timer()
- If CPL = True and CannonPinL.TransZ < 35 then CannonPinL.TransZ = CannonPinL.TransZ + 10
- If CPL = False and CannonPinL.TransZ > 0 then CannonPinL.TransZ = CannonPinL.TransZ -10
- If CannonPinL.TransZ >= 35 then CPL = False
- End Sub
- Sub CannonPinRTimer_Timer()
- If CPR = True and CannonPinR.TransZ < 35 then CannonPinR.TransZ = CannonPinR.TransZ + 10
- If CPR = False and CannonPinR.TransZ > 0 then CannonPinR.TransZ = CannonPinR.TransZ -10
- If CannonPinR.TransZ >= 35 then CPR = False
- End Sub
- '***Kickback Animation***
- Sub KickBackTimer_Timer()
- if KB = True and KickBackP.TransZ < 60 then KickBackP.TransZ = KickBackP.TransZ +10
- if KB = False and KickBackP.TransZ > 0 then KickBackP.TransZ = KickBackP.TransZ -10
- if KickBackP.TransZ >= 60 then KB = False
- End Sub
- '***Catapult Animation***
- Sub CatapultTimer_Timer()
- if CP = True and Catapult.RotX < 110 then Catapult.RotX = Catapult.RotX +10
- if CP = False and Catapult.RotX > 90 then Catapult.RotX = Catapult.RotX -10
- ' if Catapult.RotX >= 107 then CP = False
- End Sub
- '************
- ' SlingShots
- '************
- Dim RStep, Lstep
- Sub SlingShotRight_Slingshot
- PlaySound SoundFX("SlingshotRight", DOFContactors), 0, 1, 0.05, 0.05
- RSling.Visible = 0
- RSling1.Visible = 1
- sling1.TransZ = -20
- RStep = 0
- SlingShotRight.TimerEnabled = 1
- vpmTimer.PulseSw 74
- End Sub
- Sub SlingShotRight_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:SlingShotRight.TimerEnabled = 0
- End Select
- RStep = RStep + 1
- End Sub
- Sub SlingShotLeft_Slingshot
- PlaySound SoundFX("SlingshotLeft", DOFContactors), 0, 1, -0.05, 0.05
- LSling.Visible = 0
- LSling1.Visible = 1
- sling2.TransZ = -20
- LStep = 0
- SlingShotLeft.TimerEnabled = 1
- vpmTimer.PulseSw 75
- End Sub
- Sub SlingShotLeft_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:SlingShotLeft.TimerEnabled = 0
- End Select
- LStep = LStep + 1
- End Sub
- '**********
- ' Keys
- '**********
- Sub table1_KeyDown(ByVal Keycode)
- If KeyCode = MechanicalTilt Then
- vpmTimer.PulseSw vpmNudge.TiltSwitch
- Exit Sub
- End if
- If keycode = PlungerKey Then Controller.Switch(12) = 1
- If keycode = keyFront Then Controller.Switch(11) = 1
- If vpmKeyDown(keycode) Then Exit Sub
- ' If keycode = LeftFlipperKey Then
- ' flipnf 0, 1
- ' end if
- ' If keycode = RightFlipperKey Then
- ' flipnf 1, 1
- ' end if
- End Sub
- Sub table1_KeyUp(ByVal Keycode)
- If keycode = PlungerKey Then Controller.Switch(12) = 0
- If keycode = keyFront Then Controller.Switch(11) = 0
- If vpmKeyUp(keycode) Then Exit Sub
- ' If keycode = LeftFlipperKey Then
- ' flipnf 0, 0
- ' end if
- ' If keycode = RightFlipperKey Then
- ' flipnf 1, 0
- ' end if
- End Sub
- Sub table1_Paused:Controller.Pause = True:End Sub
- Sub table1_unPaused:Controller.Pause = False:End Sub
- Sub table1_exit():Controller.Pause = False:Controller.Stop:End Sub
- '******************
- ' Special Flippers
- '******************
- dim FlippersEnabled
- SolCallback(31) = "TiltSol"
- Sub TiltSol(Enabled)
- FlippersEnabled = Enabled
- if Enabled Then
- ' vpmnudge.solgameon true
- Elseif not Enabled Then
- ' vpmnudge.solgameon false
- if FlipperL.startangle > FlipperL.endangle Then
- if FlipperL.currentangle < FlipperL.startangle then FlipperL.rotatetostart : leftflippersound 0 : end if
- elseif FlipperL.startangle < FlipperL.endangle Then
- if FlipperL.currentangle > FlipperL.startangle then FlipperL.rotatetostart : leftflippersound 0 : end If
- end If
- if FlipperR.startangle > FlipperR.endangle Then
- if FlipperR.currentangle < FlipperR.startangle then FlipperR.rotatetostart : rightflippersound 0 : end if
- elseif FlipperR.startangle < FlipperR.endangle Then
- if FlipperR.currentangle > FlipperR.startangle then FlipperR.rotatetostart : rightflippersound 0 : end If
- end If
- end if
- end sub
- sub flipnf(LR, DU)
- if LR = 0 Then 'left flipper
- if DU = 1 then
- If FlippersEnabled = True then
- FlipperL.rotatetoend
- LeftFlipperSound 1
- end if
- controller.Switch(swLLFlip) = True
- Elseif DU = 0 then
- If FlippersEnabled = True then
- FlipperL.rotatetoStart
- LeftFlipperSound 0
- end if
- controller.Switch(swLLFlip) = False
- end if
- elseif LR = 1 then ''right flipper
- if DU = 1 then
- If FlippersEnabled = True then
- FlipperR.rotatetoend
- FlipperR1.rotatetoend
- RightFlipperSound 1
- end if
- controller.Switch(swLRFlip) = True
- Elseif DU = 0 then
- If FlippersEnabled = True then
- FlipperR.rotatetoStart
- FlipperR1.rotatetoStart
- RightFlipperSound 0
- end if
- controller.Switch(swLRFlip) = False
- end if
- end if
- end sub
- sub LeftFlipperSound(updown)'called along with the flipper, so feel free to add stuff, EOStorque tweaks, animation updates, upper flippers, whatever.
- if updown = 1 Then
- playsound SoundFX("Flipperupleft",DOFFlippers) 'flip
- Else
- playsound SoundFX("Flipperdown",DOFFlippers)'return
- end if
- end sub
- sub RightFlipperSound(updown)
- if updown = 1 Then
- playsound SoundFX("Flipperuprightboth",DOFFlippers) 'flip
- Else
- playsound SoundFX("Flipperdown",DOFFlippers)'return
- end if
- end sub
- '**************
- ' Flipper Subs
- '**************
- SolCallback(sLRFlipper) = "SolRFlipper"
- SolCallback(sLLFlipper) = "SolLFlipper"
- Sub SolLFlipper(Enabled)
- If Enabled Then
- PlaySound SoundFX("FlipperUpLeft", DOFFlippers):FlipperL.RotateToEnd
- Else
- PlaySound SoundFX("FlipperDown", DOFFlippers):FlipperL.RotateToStart
- End If
- End Sub
- Sub SolRFlipper(Enabled)
- If Enabled Then
- PlaySound SoundFX("FlipperUpRightBoth", DOFFlippers):FlipperR.RotateToEnd:FlipperR1.RotateToEnd
- Else
- PlaySound SoundFX("FlipperDown", DOFFlippers):FlipperR.RotateToStart:FlipperR1.RotateToStart
- End If
- End Sub
- '***************************************************
- ' JP's VP10 Fading Lamps & Flashers
- ' Based on PD's Fading Light System
- ' SetLamp 0 is Off
- ' SetLamp 1 is On
- ' fading for non opacity objects is 4 steps
- '***************************************************
- Dim LampState(200), FadingLevel(200)
- Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
- Dim ccount
- InitLamps() ' turn off the lights and flashers and reset them to the default parameters
- LampTimer.Interval = 10 'lamp fading speed
- 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) 'keep the real state in an array
- FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
- Next
- End If
- UpdateLamps
- End Sub
- Sub InitLamps()
- Dim x
- For x = 0 to 200
- LampState(x) = 0 ' current light state, independent of the fading level. 0 is off and 1 is on
- FadingLevel(x) = 4 ' used to track the fading state
- FlashSpeedUp(x) = 0.5 ' faster speed when turning on the flasher
- FlashSpeedDown(x) = 0.1 ' slower speed when turning off the flasher
- FlashMax(x) = 1 ' the maximum value when on, usually 1
- FlashMin(x) = 0 ' the minimum value when off, usually 0
- FlashLevel(x) = 0 ' the intensity of the flashers, usually from 0 to 1
- Next
- End Sub
- Sub UpdateLamps
- 'Inserts
- NFadeLm 11, l11
- NFadeLm 11, l11b
- NFadeLm 12, l12
- NFadeLm 12, l12b
- NFadeLm 13, l13
- NFadeLm 13, l13b
- NFadeLm 14, l14
- NFadeLm 14, l14b
- NFadeLm 15, l15
- NFadeLm 15, l15b
- NFadeLm 16, l16
- NFadeLm 16, l16b
- NFadeLm 17, l17
- NFadeLm 17, l17b
- NFadeLm 18, l18
- NFadeLm 18, l18b
- NFadeLm 21, l21
- NFadeLm 21, l21b
- NFadeLm 22, l22
- NFadeLm 22, l22b
- NFadeLm 23, l23
- NFadeLm 23, l23b
- NFadeLm 24, l24
- NFadeLm 24, l24b
- NFadeLm 25, l25
- NFadeLm 25, l25b
- Flash 26, f26
- NFadeObjm 26, l26blue, "bulbcover_blueOn", "bulbcover_blue"
- NFadeLm 26, l26
- NFadeLm 26, l26b
- NFadeLm 27, l27
- NFadeLm 27, l27b
- NFadeLm 28, l28
- NFadeLm 28, l28b
- NFadeLm 31, l31
- NFadeLm 31, l31b
- NFadeLm 32, l32
- NFadeLm 32, l32b
- NFadeLm 33, l33
- NFadeLm 33, l33b
- NFadeLm 34, l34
- NFadeLm 34, l34b
- NFadeLm 35, l35
- NFadeLm 35, l35b
- NFadeLm 36, l36
- NFadeLm 36, l36b
- NFadeLm 37, l37
- NFadeLm 37, l37b
- NFadeLm 38, l38
- NFadeLm 38, l38b
- NFadeLm 41, l41
- NFadeLm 41, l41b
- NFadeLm 42, l42
- NFadeLm 42, l42b
- NFadeLm 43, l43
- NFadeLm 43, l43b
- NFadeLm 44, l44
- NFadeLm 44, l44b
- NFadeLm 45, l45
- NFadeLm 45, l45b
- NFadeLm 46, l46
- NFadeLm 46, l46b
- NFadeLm 47, l47
- NFadeLm 47, l47b
- NFadeLm 48, l48
- NFadeLm 48, l48b
- NFadeLm 51, l51
- NFadeLm 51, l51b
- Flash 52, f52
- NFadeLm 52, l52
- Flash 53, f53
- NFadeObjm 53, l53yellow, "bulbcover_yellowOn", "bulbcover_yellow"
- NFadeLm 54, l54
- NFadeLm 54, l54b
- NFadeLm 55, l55
- NFadeLm 55, l55b
- NFadeLm 56, l56
- NFadeLm 56, l56b
- NFadeLm 57, l57
- NFadeLm 57, l57b
- NFadeLm 58, l58
- NFadeLm 58, l58b
- NFadeLm 61, l61
- NFadeLm 61, l61b
- NFadeLm 62, l62
- NFadeLm 62, l62b
- NFadeLm 63, l63
- NFadeLm 63, l63b
- NFadeLm 64, l64
- NFadeLm 64, l64b
- NFadeLm 65, l65
- NFadeLm 65, l65b
- NFadeLm 66, l66
- NFadeLm 66, l66b
- NFadeLm 67, l67
- NFadeLm 67, l67b
- NFadeLm 68, l68
- NFadeLm 68, l68b
- NFadeLm 71, l71
- NFadeLm 71, l71b
- NFadeLm 72, l72
- NFadeLm 72, l72b
- NFadeLm 73, l73
- NFadeLm 73, l73b
- NFadeLm 74, l74
- NFadeLm 74, l74b
- NFadeLm 75, l75
- NFadeLm 75, l75b
- NFadeLm 76, l76
- NFadeLm 76, l76b
- NFadeLm 77, l77
- NFadeLm 77, l77b
- NFadeLm 78, l78a
- NFadeLm 78, l78b
- NFadeLm 78, l78c
- NFadeLm 78, l78d
- NFadeLm 78, l78e
- NFadeLm 78, l78borga
- NFadeLm 78, l78borgb
- NFadeLm 78, l78borgc
- NFadeLm 78, l78borgd
- NFadeLm 78, l78borge
- NFadeLm 81, l81
- NFadeLm 81, l81b
- Flash 82, f82
- NFadeLm 82, l82
- NFadeLm 84, l84
- NFadeLm 84, l84b
- Flash 85, f85
- NFadeObjm 85, l85green, "bulbcover_greenOn", "bulbcover_green"
- Flash 86, f86
- NFadeObjm 86, l86red, "bulbcover_redOn", "bulbcover_red"
- NFadeLm 124, l124
- NFadeLm 124, l124b
- End Sub
- Sub SetLamp(nr, value)
- If value <> LampState(nr) Then
- LampState(nr) = abs(value)
- FadingLevel(nr) = abs(value) + 4
- End If
- End Sub
- ' Lights: used for VP10 standard lights, the fading is handled by VP itself
- Sub NFadeL(nr, object)
- Select Case FadingLevel(nr)
- Case 4:object.state = 0:FadingLevel(nr) = 0
- Case 5:object.state = 1:FadingLevel(nr) = 1
- End Select
- End Sub
- Sub NFadeLm(nr, object) ' used for multiple lights
- Select Case FadingLevel(nr)
- Case 4:object.state = 0
- Case 5:object.state = 1
- End Select
- End Sub
- Sub NFadeLmb(nr, object) ' used for multiple lights with blinking
- Select Case FadingLevel(nr)
- Case 4:object.state = 0
- Case 5:object.state = 2
- End Select
- End Sub
- 'Lights, Ramps & Primitives used as 4 step fading lights
- 'a,b,c,d are the images used from on to off
- Sub FadeObj(nr, object, a, b, c, d)
- Select Case FadingLevel(nr)
- Case 2:object.image = d:FadingLevel(nr) = 0 'Off
- Case 3:object.image = c:FadingLevel(nr) = 2 'fading...
- Case 4:object.image = b:FadingLevel(nr) = 3 'fading...
- Case 5:object.image = a:FadingLevel(nr) = 1 'ON
- End Select
- End Sub
- Sub FadeObjm(nr, object, a, b, c, d)
- Select Case FadingLevel(nr)
- Case 2:object.image = d
- Case 3:object.image = c
- Case 4:object.image = b
- Case 5:object.image = d
- End Select
- End Sub
- Sub NFadeObj(nr, object, a, b)
- Select Case FadingLevel(nr)
- Case 4:object.image = b:FadingLevel(nr) = 0 'off
- Case 5:object.image = a:FadingLevel(nr) = 1 'on
- End Select
- End Sub
- Sub NFadeObjm(nr, object, a, b)
- Select Case FadingLevel(nr)
- Case 4:object.image = b
- Case 5:object.image = a
- End Select
- End Sub
- ' Flasher objects
- Sub Flash(nr, object)
- Select Case FadingLevel(nr)
- Case 4 'off
- FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
- If FlashLevel(nr) < FlashMin(nr) Then
- FlashLevel(nr) = FlashMin(nr)
- FadingLevel(nr) = 0 'completely off
- End if
- Object.IntensityScale = FlashLevel(nr)
- Case 5 ' on
- FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
- If FlashLevel(nr) > FlashMax(nr) Then
- FlashLevel(nr) = FlashMax(nr)
- FadingLevel(nr) = 1 'completely on
- End if
- Object.IntensityScale = FlashLevel(nr)
- End Select
- End Sub
- Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
- Object.IntensityScale = FlashLevel(nr)
- End Sub
- '***SolModFlasher***
- Sub Flash120(Enabled) 'JetsFlasher
- l120.Intensity = enabled / 10
- If enabled then
- l83.State = 1
- l83.Intensity = enabled / 10
- Else
- l83.Intensity = 20
- l83.State = 0
- End If
- End Sub
- Sub Flash121(Enabled) 'RightPopper
- l121.Intensity = enabled / 10
- End Sub
- Sub Flash122(Enabled) 'MiddleRamp
- f122.Opacity = enabled * 10
- f122b.Opacity = enabled
- End Sub
- Sub Flash123(Enabled) 'ShieldFlasher
- f123.Opacity = enabled * 10
- f123a.Opacity = enabled * 3
- End Sub
- Sub Flash125(Enabled) 'LeftPopper
- l125.Intensity = enabled / 10
- End Sub
- Sub Flash126(Enabled) 'RightBorgFlasher
- f126.Opacity = enabled *12
- f126s.Opacity = enabled /2
- l78d1.Intensity = enabled
- l78e1.Intensity = enabled
- l78borgb1.Intensity = enabled
- l78borga1.Intensity = enabled
- End Sub
- Sub Flash127(Enabled) 'LeftBorgFlasher
- f127.Opacity = enabled * 8
- f127s.Opacity = enabled /2
- l78b1.Intensity = enabled
- l78c1.Intensity = enabled
- l78borgd1.Intensity = enabled
- l78borge1.Intensity = enabled
- End Sub
- Sub Flash128(Enabled) 'CenterBorgFlasher
- f128.Opacity = enabled * 8
- f128s.Opacity = enabled
- GiBigGreen.Opacity = enabled *2
- l78a1.Intensity = enabled *2
- l78borgc1.Intensity = enabled *2
- End Sub
- Sub Flash141(Enabled) 'RomulanFlasher
- f141.Opacity = enabled *50
- f141s.Opacity = enabled
- f141s1.Opacity = enabled
- l141.Intensity = enabled / 5
- l141a.Intensity = enabled / 10
- GiBigGreen.Opacity = enabled *2
- End Sub
- Sub Flash142(Enabled) 'RightRampFlasher
- If Enabled Then
- FlasherCapRed.Image = "dome4redOn"
- Else
- FlasherCapRed.Image = "dome4red"
- End if
- GiBigRed.Opacity = enabled *2
- GiBigRed1.Opacity = enabled *2
- f142.Opacity = enabled *12
- l142.Intensity = enabled
- f142s.Opacity = enabled
- f142s1.Opacity = enabled
- End Sub
- 'BorgLampTimer - turns OFF the blue lamps while the green flasher are ON
- Sub BorgLampTimer_Timer()
- If BorgMod = 1 then
- If l78a1.Intensity >= 10 Then l78a.Intensity = 0:Else:l78a.Intensity = 30:End if
- If l78b1.Intensity >= 10 Then l78b.Intensity = 0:Else:l78b.Intensity = 30:End if
- If l78c1.Intensity >= 10 Then l78c.Intensity = 0:Else:l78c.Intensity = 6:End if
- If l78d1.Intensity >= 10 Then l78d.Intensity = 0:Else:l78d.Intensity = 30:End if
- If l78e1.Intensity >= 10 Then l78e.Intensity = 0:Else:l78e.Intensity = 10:End if
- End if
- If BorgMod = 0 then
- If l78borga1.Intensity >= 10 Then l78borga.Intensity = 0:Else:l78borga.Intensity = 15:End if
- If l78borgb1.Intensity >= 10 Then l78borgb.Intensity = 0:Else:l78borgb.Intensity = 50:End if
- If l78borgc1.Intensity >= 10 Then l78borgc.Intensity = 0:Else:l78borgc.Intensity = 60:End if
- If l78borgd1.Intensity >= 10 Then l78borgd.Intensity = 0:Else:l78borgd.Intensity = 30:End if
- If l78borge1.Intensity >= 10 Then l78borge.Intensity = 0:Else:l78borge.Intensity = 50:End if
- End if
- End Sub
- '**************
- '***RGB Mode***
- '**************
- Dim RGBStep, RGBFactor, Red, Green, Blue
- RGBStep = 0
- RGBFactor = 1
- Red = 255
- Green = 0
- Blue = 0
- Sub RGBTimer_timer 'rainbow light color changing
- Select Case RGBStep
- Case 0 'Green
- Green = Green + RGBFactor
- If Green > 255 then
- Green = 255
- RGBStep = 1
- End If
- Case 1 'Red
- Red = Red - RGBFactor
- If Red < 0 then
- Red = 0
- RGBStep = 2
- End If
- Case 2 'Blue
- Blue = Blue + RGBFactor
- If Blue > 255 then
- Blue = 255
- RGBStep = 3
- End If
- Case 3 'Green
- Green = Green - RGBFactor
- If Green < 0 then
- Green = 0
- RGBStep = 4
- End If
- Case 4 'Red
- Red = Red + RGBFactor
- If Red > 255 then
- Red = 255
- RGBStep = 5
- End If
- Case 5 'Blue
- Blue = Blue - RGBFactor
- If Blue < 0 then
- Blue = 0
- RGBStep = 0
- End If
- End Select
- 'Light1.color = RGB(Red\10, Green\10, Blue\10)
- ' light1.colorfull = RGB(Red, Green, Blue)
- If RGBBumpers = 1 then
- lbumperr.colorfull = RGB(Red, Green, Blue)
- lbumperr1.colorfull = RGB(Red, Green, Blue)
- lbumperr2.colorfull = RGB(Red, Green, Blue)
- lbumperr3.colorfull = RGB(Red, Green, Blue)
- lbumperr4.colorfull = RGB(Red, Green, Blue)
- lbumperr5.colorfull = RGB(Red, Green, Blue)
- End if
- If RGBArrows = 1 then
- l42.colorfull = RGB(Red, Green, Blue)
- l42b.colorfull = RGB(Red, Green, Blue)
- l46.colorfull = RGB(Red, Green, Blue)
- l46b.colorfull = RGB(Red, Green, Blue)
- l54.colorfull = RGB(Red, Green, Blue)
- l54b.colorfull = RGB(Red, Green, Blue)
- l61.colorfull = RGB(Red, Green, Blue)
- l61b.colorfull = RGB(Red, Green, Blue)
- l64.colorfull = RGB(Red, Green, Blue)
- l64b.colorfull = RGB(Red, Green, Blue)
- l71.colorfull = RGB(Red, Green, Blue)
- l71b.colorfull = RGB(Red, Green, Blue)
- l76.colorfull = RGB(Red, Green, Blue)
- l76b.colorfull = RGB(Red, Green, Blue)
- End if
- 'Gi
- ' gi4.colorfull = RGB(Red, Green, Blue)
- ' gis7.colorfull = RGB(Red, Green, Blue)
- ' gi8.colorfull = RGB(Red, Green, Blue)
- ' gis8.colorfull = RGB(Red, Green, Blue)
- End Sub
- '***********
- ' Update GI
- '***********
- Dim gistep, xx, obj
- gistep = 1 / 8
- Sub UpdateGI(no, step)
- If step > 1 Then
- DOF 200, DOFOn
- Else
- DOF 200, DOFOff
- End If
- ' If step = 0 or step = 7 then Table1.ColorGradeImage = "grade_1": exit sub
- Select Case no
- Case 0
- For each xx in St1Shields:xx.IntensityScale = gistep*step:next
- ' Case 1
- ' For each xx in St2Gi1:xx.IntensityScale = gistep*step:next
- ' Table1.ColorGradeImage = "grade_" & step
- ' Case 2
- ' For each xx in St3Gi2:xx.IntensityScale = gistep*step:next
- ' Table1.ColorGradeImage = "grade_" & step
- Case 3
- For each xx in St4PFGI:xx.IntensityScale = gistep*step:next
- Table1.ColorGradeImage = "grade_" & step
- For each xx in St4PFGI: if xx.IntensityScale = 0 then Table1.ColorGradeImage = "grade_1":End if:next
- Case 4
- For each xx in St5ReLa:xx.IntensityScale = gistep*step:next
- Table1.ColorGradeImage = "grade_" & step
- For each xx in St5ReLa: if xx.IntensityScale = 0 then Table1.ColorGradeImage = "grade_1":End if:next
- End Select
- End Sub
- '****************************
- ' Realtime Updates
- ' called by the MotorCallBack
- '****************************
- Sub RealTimeUpdates
- 'flippers,gates
- FlipperLP.RotY = FlipperL.CurrentAngle
- FlipperRP.RotY = FlipperR.CurrentAngle
- FlipperRP1.RotY = FlipperR1.CurrentAngle
- diverterp.RotY = diverter.CurrentAngle
- sw25spinnerp.RotX = sw25spinner.CurrentAngle +90
- sw87spinnerp.RotX = sw87spinner.CurrentAngle +90
- sw88spinnerp.RotX = sw88spinner.CurrentAngle +90
- ' rolling sound
- RollingSoundUpdate
- End Sub
- '*******************
- ' WireRampDropSounds
- '*******************
- Dim SoundBall
- Sub LeftPopperTriggerStart_Hit()
- Set SoundBall = ActiveBall
- vpmTimer.AddTimer 100, "WireHit'"
- PlaySound "WireRamp", -1, 0.1, Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End Sub
- Sub LeftWireTriggerStart_Hit()
- Set SoundBall = ActiveBall
- PlaySound "WireRamp", -1, 0.1, Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End Sub
- Sub LeftWireTriggerEnd_Hit()
- StopSound "WireRamp"
- PlaySound "wireramp_stop", 0, 0.1, -0.2
- vpmTimer.AddTimer 200, "BallDropSoundLeft'"
- End Sub
- Sub RightWireTriggerStart_Hit()
- Set SoundBall = ActiveBall
- PlaySound "WireRamp", -1, 0.1, Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End Sub
- Sub RightWireTriggerEnd_Hit()
- StopSound "WireRamp"
- PlaySound "wireramp_stop", 0, 0.1, 0.2
- vpmTimer.AddTimer 200, "BallDropSoundRight'"
- End Sub
- Sub MiddleWireTriggerStart_Hit()
- Set SoundBall = ActiveBall
- PlaySound "WireRamp", -1, 0.1, Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End Sub
- Sub MiddleWireTriggerEnd_Hit()
- ' StopSound "WireRamp"
- PlaySound "wireramp_hit", 0, 0.1, 0.2
- End Sub
- Sub PlungerWireTriggerStart_Hit()
- Set SoundBall = ActiveBall
- PlaySound "WireRamp", -1, 0.3, Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End Sub
- Sub PlungerWireTriggerEnd_Hit()
- StopSound "WireRamp"
- vpmTimer.AddTimer 100, "BallDropSoundRight'"
- End Sub
- Sub BorgTrigger_Hit()
- vpmTimer.AddTimer 100, "BallDropSoundCenter'"
- End Sub
- Sub BallDropSoundCenter()
- PlaySound "BallDrop"
- End Sub
- Sub BallDropSoundLeft()
- PlaySound "BallDrop", 0, 0.6, -0.2
- End Sub
- Sub BallDropSoundRight()
- PlaySound "BallDrop", 0, 0.6, 0.2
- End Sub
- Sub WireHit()
- PlaySound "WireRamp_Hit", 0, 0.6, -0.2
- 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 / 1800)
- End Function
- Function Vol2(ball1, ball2) ' Calculates the Volume of the sound based on the speed of two balls
- Vol2 = (Vol(ball1) + Vol(ball2) ) / 2
- End Function
- Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table
- Dim tmp
- tmp = ball.x * 2 / table1.width-1
- If tmp > 0 Then
- Pan = Csng(tmp ^10)
- Else
- Pan = Csng(-((- tmp) ^10) )
- End If
- End Function
- Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
- Pitch = BallVel(ball) * 20
- End Function
- Function BallVel(ball) 'Calculates the ball speed
- BallVel = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
- End Function
- '*****************************************
- ' JP's VP10 Rolling Sounds
- '*****************************************
- Const tnob = 6 ' 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 Collision Sound
- '**********************
- Sub OnBallBallCollision(ball1, ball2, velocity)
- PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0
- End Sub
- '
- ''******************************
- '' Diverse Collection Hit Sounds
- ''******************************
- '
- '
- 'Sub Metals_Medium_Hit(idx)
- ' PlaySound "metalhit_medium", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- 'End Sub
- 'Sub MetalBallGuide_Hit(idx)
- ' PlaySound "metalhit_medium", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- 'End Sub
- 'Sub Gates_Hit(idx)
- ' PlaySound "gate", 0, 0.9, Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- 'End Sub
- 'Sub Spinner_Hit(idx)
- ' PlaySound "gate4", 0, 0.7, 0, 0.25
- 'End Sub
- 'Sub Rubbers_Hit(idx)
- ' dim finalspeed
- ' finalspeed = SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
- ' If finalspeed > 20 then
- ' PlaySound "rubber_hit_4", 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 RandomSoundRubber()
- ' Select Case Int(Rnd * 3) + 1
- ' Case 1:PlaySound "rubber_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- ' Case 2:PlaySound "rubber_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- ' Case 3:PlaySound "rubber_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- ' End Select
- 'End Sub
- 'Sub Wall38_Hit()
- ' PlaySound "rubber_hit_1", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- 'End Sub
- Sub FlipperL_Collide(parm)
- RandomSoundFlipper()
- End Sub
- Sub FlipperR_Collide(parm)
- RandomSoundFlipper()
- End Sub
- Sub FlipperR1_Collide(parm)
- RandomSoundFlipper()
- End Sub
- Sub RandomSoundFlipper()
- Select Case Int(Rnd * 3) + 1
- Case 1:PlaySound "flip_hit_1", 0, 1, Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- Case 2:PlaySound "flip_hit_2", 0, 1, Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- Case 3:PlaySound "flip_hit_3", 0, 1, Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End Select
- End Sub
- Sub SoundNeutralZone()
- Select Case Int(Rnd * 3) + 1
- Case 1:PlaySound "NeutralZone1"
- Case 2:PlaySound "NeutralZone2"
- Case 3:PlaySound "Lock"
- End Select
- End Sub
- '*****************************************
- ' Ball Shadow
- '*****************************************
- Dim BallShadow
- BallShadow = Array (BallShadow1, BallShadow2, BallShadow3, BallShadow4, BallShadow5, BallShadow6)
- Sub BallShadowUpdate_Timer()
- 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) - (50/6) + ((BOT(b).X - (Table1.Width/2))/7)) + 10
- Else
- BallShadow(b).X = ((BOT(b).X) + (50/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
Advertisement
Add Comment
Please, Sign In to add comment