Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' 250 cc / IPD No. 4089 / Inder 1992 / 4 Players
- ' VPX table by JPSalas version 1.0.0
- 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
- LoadVPM "01550000", "inder.vbs", 3.26
- Dim bsTrough, dtBankL, dtBankR, dtBankT, TopBall, x
- Const cGameName = "ind250cc"
- Const UseSolenoids = 2
- Const UseLamps = 0
- Const UseGI = 0
- Const UseSync = 0 'set it to 1 if the table runs too fast
- Const HandleMech = 0
- Dim VarHidden
- If Table1.ShowDT = true then
- VarHidden = 1
- For each x in aReels
- x.Visible = 1
- Next
- lrail.Visible = 1
- rrail.Visible = 1
- else
- VarHidden = 0
- For each x in aReels
- x.Visible = 0
- Next
- lrail.Visible = 0
- rrail.Visible = 0
- end if
- if B2SOn = true then VarHidden = 1
- ' Standard Sounds
- Const SSolenoidOn = "fx_SolenoidOn"
- Const SSolenoidOff = "fx_SolenoidOff"
- Const SFlipperOn = ""
- Const SFlipperOff = ""
- Const SCoin = "fx_Coin"
- '************
- ' 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
- .SplashInfoLine = "250cc - Inder 1992" & vbNewLine & "VPX table by JPSalas 1.0.0"
- .HandleKeyboard = 0
- .ShowTitle = 0
- .ShowDMDOnly = 1
- .ShowFrame = 0
- .HandleMechanics = 0
- .Hidden = 1
- .Games(cGameName).Settings.Value("rol") = 0
- '.SetDisplayPosition 0,0,GetPlayerHWnd 'uncomment if you can't see the dmd
- On Error Resume Next
- Controller.SolMask(0) = 0
- vpmTimer.AddTimer 2000, "Controller.SolMask(0)=&Hffffffff'" 'ignore all solenoids - then add the Timer to renable all the solenoids after 2 seconds
- Controller.Run GetPlayerHWnd
- On Error Goto 0
- End With
- ' Nudging
- vpmNudge.TiltSwitch = 53
- vpmNudge.Sensitivity = 5
- vpmNudge.TiltObj = Array(Bumper1, Bumper2)
- ' Trough
- Set bsTrough = New cvpmBallStack
- With bsTrough
- .InitSw 0, 91, 0, 0, 0, 0, 0, 0
- .InitKick BallRelease, 80, 6
- .InitExitSnd SoundFX("fx_ballrel", DOFContactors), SoundFX("fx_Solenoid", DOFContactors)
- .Balls = 1
- End With
- ' Drop targets
- Set dtBankL = New cvpmDropTarget
- With dtBankL
- .InitDrop array(sw54, sw64, sw74), array(74, 84, 94)
- .InitSnd SoundFX("", DOFDropTargets), SoundFX("fx_resetdrop", DOFContactors)
- .CreateEvents "dtBankL"
- End With
- Set dtBankR = New cvpmDropTarget
- With dtBankR
- .InitDrop array(sw55, sw65, sw75), array(75, 85, 95)
- .InitSnd SoundFX("", DOFDropTargets), SoundFX("fx_resetdrop", DOFContactors)
- .CreateEvents "dtBankR"
- End With
- Set dtBankT = New cvpmDropTarget
- With dtBankT
- .InitDrop array(sw47, sw46, sw45), array(67, 66, 65)
- .InitSnd SoundFX("", DOFDropTargets), SoundFX("fx_resetdrop", DOFContactors)
- .CreateEvents "dtBankT"
- End With
- ' Main Timer init
- PinMAMETimer.Interval = PinMAMEInterval
- PinMAMETimer.Enabled = 1
- ' Turn on Gi
- vpmtimer.addtimer 1500, "GiOn '"
- Set TopBall = TopBallC.CreateBall:TopBallC.Kick 180, 1
- End Sub
- Sub table1_Paused:Controller.Pause = 1:End Sub
- Sub table1_unPaused:Controller.Pause = 0:End Sub
- Sub table1_exit:Controller.stop:End Sub
- '**********
- ' Keys
- '**********
- Sub table1_KeyDown(ByVal Keycode)
- If keycode = LeftTiltKey Then Nudge 90, 5:PlaySound SoundFX("fx_nudge", 0), 0, 1, -0.1, 0.25
- If keycode = RightTiltKey Then Nudge 270, 5:PlaySound SoundFX("fx_nudge", 0), 0, 1, 0.1, 0.25
- If keycode = CenterTiltKey Then Nudge 0, 6:PlaySound SoundFX("fx_nudge", 0), 0, 1, 0, 0.25
- If vpmKeyDown(keycode)Then Exit Sub
- If keycode = PlungerKey Then PlaySoundat "fx_PlungerPull", Plunger:Plunger.Pullback
- If keycode = KeyRules Then Rules
- End Sub
- Sub table1_KeyUp(ByVal Keycode)
- If vpmKeyUp(keycode)Then Exit Sub
- If keycode = PlungerKey Then PlaySoundAt "fx_plunger", Plunger:Plunger.Fire
- End Sub
- '*********
- ' Switches
- '*********
- ' Scoring rubbers
- Sub RubberBand9_Hit:vpmTimer.PulseSw 92:End Sub
- Sub RubberBand7_Hit:vpmTimer.PulseSw 92:End Sub
- Sub RubberBand6_Hit:vpmTimer.PulseSw 92:End Sub
- Sub RubberBand2_Hit:vpmTimer.PulseSw 92:End Sub
- Sub RubberBand3_Hit:vpmTimer.PulseSw 92:End Sub
- ' Bumpers
- Sub Bumper1_Hit:vpmTimer.PulseSw 96:PlaySoundAt SoundFX("fx_bumper", DOFContactors), Bumper1:End Sub
- Sub Bumper2_Hit:vpmTimer.PulseSw 86:PlaySoundAt SoundFX("fx_bumper", DOFContactors), Bumper2:End Sub
- ' Drain & holes
- Sub Drain_Hit:PlaysoundAt "fx_drain", Drain:bsTrough.AddBall Me:End Sub
- Sub sw43_Hit():vpmTimer.PulseSw 63:PlaySoundAt "fx_balldrop", sw43:End Sub
- Sub sw42_Hit():vpmTimer.PulseSw 62:PlaySoundAt "fx_balldrop", sw42:End Sub
- Sub sw41_Hit():vpmTimer.PulseSw 61:PlaySoundAt "fx_balldrop", sw41:End Sub
- Sub sw40_Hit():vpmTimer.PulseSw 60:PlaySoundAt "fx_balldrop", sw40:End Sub
- Sub Vuk1_Hit():x = ActiveBall.VelX:Vuk1.destroyball:Vuk2.CreateBall:Vuk2.Kick 90, x:End Sub
- ' Rollovers
- Sub sw44_Hit:Controller.Switch(64) = 1:PlaySoundAt "fx_sensor", sw44:End Sub
- Sub sw44_UnHit:Controller.Switch(64) = 0:End Sub
- Sub sw73a_Hit:Controller.Switch(93) = 1:PlaySoundAt "fx_sensor", sw73a:End Sub
- Sub sw73a_UnHit:Controller.Switch(93) = 0:End Sub
- Sub sw73b_Hit:Controller.Switch(93) = 1:PlaySoundAt "fx_sensor", sw73b:End Sub
- Sub sw73b_UnHit:Controller.Switch(93) = 0:End Sub
- Sub sw70a_Hit:Controller.Switch(90) = 1:PlaySoundAt "fx_sensor", sw70a:DOF 104, DOFOn:End Sub
- Sub sw70a_UnHit:Controller.Switch(90) = 0:DOF 104, DOFOff:End Sub
- Sub sw70b_Hit:Controller.Switch(90) = 1:PlaySoundAt "fx_sensor", sw70b:DOF 103, DOFOn:End Sub
- Sub sw70b_UnHit:Controller.Switch(90) = 0:DOF 103, DOFOff:End Sub
- Sub sw70c_Hit:Controller.Switch(90) = 1:PlaySoundAt "fx_sensor", sw70c:End Sub
- Sub sw70c_UnHit:Controller.Switch(90) = 0:End Sub
- Sub sw32_Hit:Controller.Switch(52) = 1:PlaySoundAt "fx_sensor", sw32:End Sub
- Sub sw32_UnHit:Controller.Switch(52) = 0:End Sub
- Sub sw50_Hit:Controller.Switch(70) = 1:PlaySoundAt "fx_sensor", sw50:End Sub
- Sub sw50_UnHit:Controller.Switch(70) = 0:End Sub
- Sub sw51_Hit:Controller.Switch(71) = 1:PlaySoundAt "fx_sensor", sw51:End Sub
- Sub sw51_UnHit:Controller.Switch(71) = 0:End Sub
- Sub sw52_Hit:Controller.Switch(72) = 1:PlaySoundAt "fx_sensor", sw52:End Sub
- Sub sw52_UnHit:Controller.Switch(72) = 0:End Sub
- Sub sw60_Hit:Controller.Switch(80) = 1:PlaySoundAt "fx_sensor", sw60:End Sub
- Sub sw60_UnHit:Controller.Switch(80) = 0:End Sub
- Sub sw61_Hit:Controller.Switch(81) = 1:PlaySoundAt "fx_sensor", sw61:End Sub
- Sub sw61_UnHit:Controller.Switch(81) = 0:End Sub
- Sub sw62_Hit:Controller.Switch(82) = 1:PlaySoundAt "fx_sensor", sw62:End Sub
- Sub sw62_UnHit:Controller.Switch(82) = 0:End Sub
- ' Droptargets hit sound
- Sub sw54_Hit:PlaySoundAt SoundFX("fx_droptarget", DOFDropTargets), sw54:End Sub
- Sub sw64_Hit:PlaySoundAt SoundFX("fx_droptarget", DOFDropTargets), sw64:End Sub
- Sub sw74_Hit:PlaySoundAt SoundFX("fx_droptarget", DOFDropTargets), sw74:End Sub
- Sub sw55_Hit:PlaySoundAt SoundFX("fx_droptarget", DOFDropTargets), sw55:End Sub
- Sub sw65_Hit:PlaySoundAt SoundFX("fx_droptarget", DOFDropTargets), sw65:End Sub
- Sub sw75_Hit:PlaySoundAt SoundFX("fx_droptarget", DOFDropTargets), sw75:End Sub
- Sub sw47_Hit:PlaySoundAt SoundFX("fx_droptarget", DOFDropTargets), sw47:End Sub
- Sub sw46_Hit:PlaySoundAt SoundFX("fx_droptarget", DOFDropTargets), sw46:End Sub
- Sub sw45_Hit:PlaySoundAt SoundFX("fx_droptarget", DOFDropTargets), sw45:End Sub
- 'Targets
- Sub sw53a_Hit:vpmTimer.PulseSw 73:PlaySoundAtBall SoundFXDOF("fx_target", 102, DOFPulse, DOFDropTargets):End Sub
- Sub sw53b_Hit:vpmTimer.PulseSw 73:PlaySoundAtBall SoundFXDOF("fx_target", 101, DOFPulse, DOFDropTargets):End Sub
- Sub sw63_Hit:vpmTimer.PulseSw 83:PlaySoundAtBall SoundFX("fx_target", DOFDropTargets):End Sub
- Sub sw63a_Hit:vpmTimer.PulseSw 83:PlaySoundAtBall SoundFX("fx_target", DOFDropTargets):End Sub
- Sub sw67_Hit:vpmTimer.PulseSw 87:PlaySoundAtBall SoundFX("fx_target", DOFDropTargets):End Sub
- Sub sw77_Hit:vpmTimer.PulseSw 97:PlaySoundAtBall SoundFX("fx_target", DOFDropTargets):End Sub
- Sub sw57_Hit:vpmTimer.PulseSw 77:PlaySoundAtBall SoundFX("fx_target", DOFDropTargets):End Sub
- Sub sw56_Hit:vpmTimer.PulseSw 76:PlaySoundAtBall SoundFX("fx_target", DOFDropTargets):End Sub
- 'Top Ball
- Dim TempBall
- Sub Post_Hit:Set TempBall = ActiveBall:TopBall.VelX = - TempBall.VelX:TopBall.VelY = TempBall.VelY * 5:End Sub
- '*********
- 'Solenoids
- '*********
- SolCallback(3) = "vpmSolSound SoundFX(""Knocker"",DOFKnocker),"
- SolCallback(4) = "bsTrough.SolOut"
- SolCallback(5) = "vpmNudge.SolGameOn"
- SolCallback(8) = "dtBankT.SolDropUp"
- '**************
- ' Flipper Subs
- '**************
- SolCallback(sLRFlipper) = "SolRFlipper"
- SolCallback(sLLFlipper) = "SolLFlipper"
- Sub SolLFlipper(Enabled)
- If Enabled Then
- PlaySoundAt SoundFX("fx_flipperup", DOFFlippers), LeftFlipper
- LeftFlipper.RotateToEnd
- Else
- PlaySoundAt SoundFX("fx_flipperdown", DOFFlippers), LeftFlipper
- LeftFlipper.RotateToStart
- End If
- End Sub
- Sub SolRFlipper(Enabled)
- If Enabled Then
- PlaySoundAt SoundFX("fx_flipperup", DOFFlippers), RightFlipper
- RightFlipper.RotateToEnd
- Else
- PlaySoundAt SoundFX("fx_flipperdown", DOFFlippers), RightFlipper
- RightFlipper.RotateToStart
- End If
- End Sub
- Sub LeftFlipper_Collide(parm)
- PlaySound "fx_rubber_flipper", 0, parm / 10, pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
- End Sub
- Sub RightFlipper_Collide(parm)
- PlaySound "fx_rubber_flipper", 0, parm / 10, pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
- End Sub
- '*****************
- ' Gi Effects
- '*****************
- Dim OldGiState
- OldGiState = -1 'start witht he Gi off
- Sub SolGi(enabled)
- If enabled Then
- GiOff
- Else
- GiOn
- End If
- End Sub
- Sub GiON
- For each x in aGiLights
- x.State = 1
- Next
- End Sub
- Sub GiOFF
- For each x in aGiLights
- x.State = 0
- Next
- End Sub
- Sub GiEffect(enabled)
- If enabled Then
- For each x in aGiLights
- x.Duration 2, 1000, 1
- Next
- End If
- End Sub
- Sub GIUpdate
- Dim tmp, obj
- tmp = Getballs
- If UBound(tmp) <> OldGiState Then
- OldGiState = Ubound(tmp)
- If UBound(tmp) = -1 Then
- GiOff
- Else
- GiOn
- End If
- End If
- End Sub
- '************************************
- ' Game timer for real time updates
- '(some tables may use it's own timer)
- '************************************
- Set MotorCallback = GetRef("RealTimeUpdates")
- Sub RealTimeUpdates
- RollingUpdate
- LeftFlipperP.RotZ = LeftFlipper.CurrentAngle
- RightFlipperP.RotZ = RightFlipper.CurrentAngle
- gatep.roty = gatef.CurrentAngle
- End Sub
- '**********************************************************
- ' JP's Flasher Fading for VPX and Vpinmame
- ' (Based on Pacdude's Fading Light System)
- ' This is a fast fading for the Flashers in vpinmame tables
- ' just 4 steps, like in Pacdude's original script.
- ' Included the new Modulated flashers & Lights for WPC
- '**********************************************************
- Dim LampState(200), FadingState(200), FlashLevel(200)
- InitLamps() ' turn off the lights and flashers and reset them to the default parameters
- ' vpinmame Lamp & Flasher Timers
- 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
- FadingState(chgLamp(ii, 0)) = chgLamp(ii, 1) + 3 'fading step
- Next
- End If
- UpdateLeds
- UpdateLamps
- End Sub
- Sub UpdateLamps()
- Lamp 1, li1
- Lamp 2, li2
- Lamp 3, li3
- Lamp 6, li6 ' "Match"
- Lamp 7, li7 ' "Game Over"
- Flash 9, li9
- Flash 10, li10
- Flash 11, li11
- Flash 12, li12
- Lamp 17, li17
- Lamp 18, li18
- Lamp 19, li19
- Lamp 20, li20
- Lamp 21, li21
- Lamp 25, li25
- Lamp 26, li26
- Lamp 27, li27
- Lamp 28, li28
- Lamp 31, li31 ' "Ball in Play"
- Lamp 32, li32 ' "Handicap"
- Lamp 33, li33
- Lamp 43, li43
- Lamp 44, li44
- Lamp 45, li45
- Lamp 46, li46
- Lamp 47, li47
- Lamp 48, li48
- Lamp 49, li49
- Lamp 50, li50
- Lamp 51, li51
- Lamp 52, li52
- Lamp 53, li53
- Lamp 54, li54
- Lamp 55, li55
- Lamp 56, li56
- ' 1 is on, 0 is off
- If LampState(14) = 1 Then
- GateF.RotateToStart
- Else
- GateF.RotateToEnd
- End If
- If LampState(15) = 0 Then dtBankL.DropSol_On: LampState(15) = 1
- If LampState(16) = 0 Then dtBankR.DropSol_On: LampState(16) = 1
- 'DisplayExtraBall
- If LampState(36) = 1 And LampState(37) = 1 Then Extra.SetValue 0
- If LampState(36) = 0 And LampState(37) = 1 Then Extra.SetValue 1
- If LampState(36) = 1 And LampState(37) = 0 Then Extra.SetValue 2
- If LampState(36) = 0 And LampState(37) = 0 Then Extra.SetValue 3
- End Sub
- ' div lamp subs
- ' Normal Lamp & Flasher subs
- Sub InitLamps()
- Dim x
- LampTimer.Interval = 25 ' flasher fading speed
- LampTimer.Enabled = 1
- For x = 0 to 200
- LampState(x) = 0
- FadingState(x) = 3 ' used to track the fading state
- FlashLevel(x) = 0
- Next
- End Sub
- Sub SetLamp(nr, value) ' 0 is off, 1 is on
- FadingState(nr) = abs(value) + 3
- End Sub
- ' Lights: used for VPX standard lights, the fading is handled by VPX itself, they are here to be able to make them work together with the flashers
- Sub Lamp(nr, object)
- Select Case FadingState(nr)
- Case 4:object.state = 1:FadingState(nr) = 0
- Case 3:object.state = 0:FadingState(nr) = 0
- End Select
- End Sub
- Sub Lampm(nr, object) ' used for multiple lights, it doesn't change the fading state
- Select Case FadingState(nr)
- Case 4:object.state = 1
- Case 3:object.state = 0
- End Select
- End Sub
- ' Flashers: 4 is on,3,2,1 fade steps. 0 is off
- Sub Flash(nr, object)
- Select Case FadingState(nr)
- Case 4:Object.IntensityScale = 1:FadingState(nr) = 0
- Case 3:Object.IntensityScale = 0.66:FadingState(nr) = 2
- Case 2:Object.IntensityScale = 0.33:FadingState(nr) = 1
- Case 1:Object.IntensityScale = 0:FadingState(nr) = 0
- End Select
- End Sub
- Sub Flashm(nr, object) 'multiple flashers, it doesn't change the fading state
- Select Case FadingState(nr)
- Case 4:Object.IntensityScale = 1
- Case 3:Object.IntensityScale = 0.66
- Case 2:Object.IntensityScale = 0.33
- Case 1:Object.IntensityScale = 0
- End Select
- End Sub
- ' Desktop Objects: Reels & texts (you may also use lights on the desktop)
- ' Reels
- Sub Reel(nr, object)
- Select Case FadingState(nr)
- Case 4:object.SetValue 1:FadingState(nr) = 0
- Case 3:object.SetValue 2:FadingState(nr) = 2
- Case 2:object.SetValue 3:FadingState(nr) = 1
- Case 1:object.SetValue 0:FadingState(nr) = 0
- End Select
- End Sub
- Sub Reelm(nr, object)
- Select Case FadingState(nr)
- Case 4:object.SetValue 1
- Case 3:object.SetValue 2
- Case 2:object.SetValue 3
- Case 1:object.SetValue 0
- End Select
- End Sub
- 'Texts
- Sub Text(nr, object, message)
- Select Case FadingState(nr)
- Case 4:object.Text = message:FadingState(nr) = 0
- Case 3:object.Text = "":FadingState(nr) = 0
- End Select
- End Sub
- Sub Textm(nr, object, message)
- Select Case FadingState(nr)
- Case 4:object.Text = message
- Case 3:object.Text = ""
- End Select
- End Sub
- ' Modulated Subs for the WPC tables
- Sub SetModLamp(nr, level)
- FlashLevel(nr) = level / 150 'lights & flashers
- End Sub
- Sub LampMod(nr, object) ' modulated lights used as flashers
- Object.IntensityScale = FlashLevel(nr)
- Object.State = 1 'in case it was off
- End Sub
- Sub FlashMod(nr, object) 'sets the flashlevel from the SolModCallback
- Object.IntensityScale = FlashLevel(nr)
- End Sub
- 'Walls and mostly 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 FadingState(nr)
- Case 4:object.image = a:FadingState(nr) = 0 'fading to off...
- Case 3:object.image = b:FadingState(nr) = 2
- Case 2:object.image = c:FadingState(nr) = 1
- Case 1:object.image = d:FadingState(nr) = 0
- End Select
- End Sub
- Sub FadeObjm(nr, object, a, b, c, d)
- Select Case FadingState(nr)
- Case 4:object.image = a
- Case 3:object.image = b
- Case 2:object.image = c
- Case 1:object.image = d
- End Select
- End Sub
- Sub NFadeObj(nr, object, a, b)
- Select Case FadingState(nr)
- Case 4:object.image = a:FadingState(nr) = 0 'off
- Case 3:object.image = b:FadingState(nr) = 0 'on
- End Select
- End Sub
- Sub NFadeObjm(nr, object, a, b)
- Select Case FadingState(nr)
- Case 4:object.image = a
- Case 3:object.image = b
- End Select
- End Sub
- 'Modulated lights & Flashers
- Sub SetModLamp(nr, level)
- FlashLevel(nr) = level / 150 'lights & flashers
- End Sub
- Sub LightMod(nr, object) ' modulated lights used as flashers
- Object.IntensityScale = FlashLevel(nr)
- Object.State = 1
- End Sub
- Sub FlashMod(nr, object) 'sets the flashlevel from the SolModCallback
- Object.IntensityScale = FlashLevel(nr)
- End Sub
- '*********************
- 'LED's based on Eala's
- '*********************
- Dim Digits(32)
- Digits(0) = Array(a00, a02, a05, a06, a04, a01, a03, a07)
- Digits(1) = Array(a10, a12, a15, a16, a14, a11, a13)
- Digits(2) = Array(a20, a22, a25, a26, a24, a21, a23)
- Digits(3) = Array(a30, a32, a35, a36, a34, a31, a33, a37)
- Digits(4) = Array(a40, a42, a45, a46, a44, a41, a43)
- Digits(5) = Array(a50, a52, a55, a56, a54, a51, a53)
- Digits(6) = Array(a60, a62, a65, a66, a64, a61, a63)
- Digits(7) = Array(e00, e02, e05, e06, e04, e01, e03, e07)
- Digits(8) = Array(e10, e12, e15, e16, e14, e11, e13)
- Digits(9) = Array(e20, e22, e25, e26, e24, e21, e23)
- Digits(10) = Array(e30, e32, e35, e36, e34, e31, e33, e37)
- Digits(11) = Array(e40, e42, e45, e46, e44, e41, e43)
- Digits(12) = Array(e50, e52, e55, e56, e54, e51, e53)
- Digits(13) = Array(e60, e62, e65, e66, e64, e61, e63)
- Digits(14) = Array(b00, b02, b05, b06, b04, b01, b03, b07)
- Digits(15) = Array(b10, b12, b15, b16, b14, b11, b13)
- Digits(16) = Array(b20, b22, b25, b26, b24, b21, b23)
- Digits(17) = Array(b30, b32, b35, b36, b34, b31, b33, b37)
- Digits(18) = Array(b40, b42, b45, b46, b44, b41, b43)
- Digits(19) = Array(b50, b52, b55, b56, b54, b51, b53)
- Digits(20) = Array(b60, b62, b65, b66, b64, b61, b63)
- Digits(21) = Array(f00, f02, f05, f06, f04, f01, f03, f07)
- Digits(22) = Array(f10, f12, f15, f16, f14, f11, f13)
- Digits(23) = Array(f20, f22, f25, f26, f24, f21, f23)
- Digits(24) = Array(f30, f32, f35, f36, f34, f31, f33, f37)
- Digits(25) = Array(f40, f42, f45, f46, f44, f41, f43)
- Digits(26) = Array(f50, f52, f55, f56, f54, f51, f53)
- Digits(27) = Array(f60, f62, f65, f66, f64, f61, f63)
- Digits(28) = Array(d00, d02, d05, d06, d04, d01, d03)
- Digits(29) = Array(d10, d12, d15, d16, d14, d11, d13)
- Digits(30) = Array(c00, c02, c05, c06, c04, c01, c03)
- Digits(31) = Array(c10, c12, c15, c16, c14, c11, c13)
- '********************
- 'Update LED's display
- '********************
- Sub UpdateLeds()
- Dim ChgLED, ii, num, chg, stat, obj
- ChgLED = Controller.ChangedLEDs(&Hffffffff, &Hffffffff)
- If Not IsEmpty(ChgLED)Then
- For ii = 0 To UBound(chgLED)
- num = chgLED(ii, 0):chg = chgLED(ii, 1):stat = chgLED(ii, 2)
- For Each obj In Digits(num)
- If chg And 1 Then obj.State = stat And 1
- chg = chg \ 2:stat = stat \ 2
- Next
- Next
- End If
- End Sub
- '******************************
- ' Diverse Collection Hit Sounds
- '******************************
- Sub aMetals_Hit(idx):PlaySoundAtBall "fx_MetalHit":End Sub
- Sub aRubber_Bands_Hit(idx):PlaySoundAtBall "fx_rubber_band":End Sub
- Sub aRubber_Posts_Hit(idx):PlaySoundAtBall "fx_rubber_post":End Sub
- Sub aRubber_Pins_Hit(idx):PlaySoundAtBall "fx_rubber_pin":End Sub
- Sub aPlastics_Hit(idx):PlaySoundAtBall "fx_PlasticHit":End Sub
- Sub aGates_Hit(idx):PlaySoundAtBall "fx_Gate":End Sub
- Sub aWoods_Hit(idx):PlaySoundAtBall "fx_Woodhit":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 / 2000)
- 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 = (SQR((ball.VelX ^2) + (ball.VelY ^2)))
- End Function
- Function AudioFade(ball) 'only on VPX 10.4 and newer
- Dim tmp
- tmp = ball.y * 2 / Table1.height-1
- If tmp > 0 Then
- AudioFade = Csng(tmp ^10)
- Else
- AudioFade = Csng(-((- tmp) ^10))
- End If
- End Function
- Sub PlaySoundAt(soundname, tableobj) 'play sound at X and Y position of an object, mostly bumpers, flippers and other fast objects
- PlaySound soundname, 0, 1, Pan(tableobj), 0, 0, 0, 0, AudioFade(tableobj)
- End Sub
- Sub PlaySoundAtBall(soundname) ' play a sound at the ball position, like rubbers, targets
- PlaySound soundname, 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
- End Sub
- '*****************************************
- ' JP's VP10 Rolling Sounds
- '*****************************************
- Const tnob = 8 ' total number of balls
- Const lob = 0 'number of locked balls
- ReDim rolling(tnob)
- InitRolling
- Sub InitRolling
- Dim i
- For i = 0 to tnob
- rolling(i) = False
- Next
- End Sub
- Sub RollingUpdate()
- Dim BOT, b, ballpitch, ballvol
- 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) = lob - 1 Then Exit Sub 'there no extra balls on this table
- ' play the rolling sound for each ball
- For b = lob to UBound(BOT)
- If BallVel(BOT(b)) > 1 Then
- If BOT(b).z < 30 Then
- ballpitch = Pitch(BOT(b))
- ballvol = Vol(BOT(b))
- Else
- ballpitch = Pitch(BOT(b)) + 20000 'increase the pitch on a ramp
- ballvol = Vol(BOT(b)) * 4
- End If
- rolling(b) = True
- PlaySound("fx_ballrolling" & b), -1, ballvol, Pan(BOT(b)), 0, ballpitch, 1, 0, AudioFade(BOT(b))
- 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, AudioFade(ball1)
- End Sub
- '***************
- ' Rules
- '***************
- Dim Msg(20)
- Sub Rules()
- Msg(0) = "250 cc - Inder 1992" &Chr(10)&Chr(10)
- Msg(1) = ""
- Msg(2) = "Side Droptargets: "
- Msg(3) = " Reds: Lites Extra Ball on the upper right floor"
- Msg(4) = " Yellows: Lites Extra Ball on captive ball"
- Msg(5) = " Greens: Lites Special on the upper right floor"
- Msg(6) = " Left side: Lites Extra Ball on the Outlane"
- Msg(7) = " Right side: Open right outlane gate"
- Msg(8) = " Both sides: Lites Special alternate on lower side targets"
- Msg(9) = ""
- Msg(10) = "Upper Droptargets"
- Msg(11) = " 1st target: Lites X5 on the left upper lane"
- Msg(12) = " 2nd target: Lites Extra ball on the left upper lane"
- Msg(13) = " 3rd target: Lites Special on the left upper lane"
- Msg(14) = ""
- Msg(15) = "Lanes 1-2-3"
- Msg(16) = " Turning off the three 1-2-3 lights lites 500.000 points"
- Msg(17) = " on the upper right floor and extra ball"
- Msg(18) = ""
- Msg(19) = ""
- Msg(20) = ""
- For X = 1 To 20
- Msg(0) = Msg(0) + Msg(X)&Chr(13)
- Next
- MsgBox Msg(0), , " Instructions and Rule Card"
- End Sub
- 'Inder 250CC
- 'added by Inkochnito
- Sub editDips
- Dim vpmDips:Set vpmDips = New cvpmDips
- With vpmDips
- .AddForm 700, 400, "250CC - DIP switches"
- .AddFrame 2, 0, 392, "Credits per coin", &H00000003, Array("1 coin - 1 credit && 1 coin - 4 credits", 0, "2 coins - 1 credit (4 coins - 3 credits) && 1 coin - 3 credits", &H00000003) 'SL1-3&4 (dip 1&2)
- .AddFrame 2, 92, 190, "Handicap value", &H00000300, Array("5,000,000 points", 0, "5,200,000 points", &H00000100, "5,400,000 points", &H00000200, "5,600,000 points", &H00000300) 'SL2-4&3(dip 9&10)
- .AddFrame 205, 46, 190, "Balls per game", &H00000008, Array("3 balls", 0, "5 balls", &H00000008) 'SL1-1 (dip 4)
- .AddFrame 205, 92, 190, "Replay threshold", &H000000C0, Array("3,000,000 points", 0, "3,300,000 points", &H00000080, "3,500,000 points", &H00000040, "3,800,000 points", &H000000C0) 'SL1-6&5 (dip 7&8)
- .AddFrame 2, 46, 190, "Allow extra ball", &H00400000, Array("yes", 0, "no", &H00400000) 'SL3-6 (dip 23)
- .AddLabel 50, 180, 300, 20, "After hitting OK, press F3 to reset game with new settings."
- .ViewDips
- End With
- End Sub
- Set vpmShowDips = GetRef("editDips")
Advertisement
Add Comment
Please, Sign In to add comment