Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- Const cGameName="cyclopes",UseSolenoids=1,UseLamps=0,UseGI=0,UseSync=1,SCoin="coin"
- Const soundforbell = "bell"
- LoadVPM "01120100","GamePlan.vbs",3.1
- Dim DesktopMode: DesktopMode = Table1.ShowDT
- If DesktopMode = True Then 'Show Desktop components
- Ramp001.visible=1
- Ramp002.visible=1
- Primitive124.visible=1
- Else
- Ramp001.visible=0
- Ramp002.visible=0
- Primitive124.visible=0
- End if
- '*************************************************************
- 'Solenoid Call backs
- '*************************************************************
- SolCallback(1)="bsLock.SolOut" 'Sol 3
- SolCallback(2)="bsSaucer.SolOut" 'Sol 4
- SolCallback(3)="vpmSolSound SoundFX(""Knocker"",DOFKnocker)," 'Sol 11
- 'SolCallback(3)="vpmSolSound ""bell""," 'Sol 15
- 'SolCallback(4)="vpmSolSound ""bumper""," 'Sol 6
- 'SolCallback(5)="vpmSolSound ""bumper""," 'Sol 7
- 'SolCallback(6)="vpmSolSound ""bumper""," 'Sol 9
- 'SolCallback(7)="vpmSolSound ""sling""," 'Sol 10
- SolCallback(8)="dtL.SolDropUp" 'Sol 8
- SolCallback(9)="dtR.SolDropUp" 'Sol 5
- SolCallback(10)="bsTrough.SolOut" 'Sol 1
- SolCallback(11)="SetLamp 142," 'Left Drop Bank Flashers Sol 12
- SolCallback(12)="SetLamp 143," 'Right Drop Bank Flashers Sol 13
- SolCallback(13)="SetLamp 144,"'other flasher Sol 14
- SolCallback(15)="bsTrough.SolIn" 'Sol 2
- 'SolCallback(16)="vpmNudge.SolGameOn" 'Sol 16
- SolCallback(31)="bellsound" 'for startup bell sound (just a workaround)
- SolCallback(sLRFlipper) = "SolRFlipper"
- SolCallback(sLLFlipper) = "SolLFlipper"
- Sub SolLFlipper(Enabled)
- If Enabled Then
- PlaySound SoundFX("Flipperup",DOFFlippers):LeftFlipper.RotateToEnd:ULeftFlipper.RotateToEnd
- Else
- PlaySound SoundFX("Flipperdown",DOFFlippers):LeftFlipper.RotateToStart:ULeftFlipper.RotateToStart
- End If
- End Sub
- Sub SolRFlipper(Enabled)
- If Enabled Then
- PlaySound SoundFX("Flipperup",DOFFlippers):RightFlipper.RotateToEnd
- Else
- PlaySound SoundFX("Flipperdown",DOFFlippers):RightFlipper.RotateToStart
- End If
- End Sub
- '**********************************************************************************************************
- 'Solenoid Controlled toys
- '**********************************************************************************************************
- '*****GI Lights On
- dim xx
- For each xx in GI:xx.State = 1: Next
- '**********************************************************************************************************
- 'Initiate Table
- '**********************************************************************************************************
- Dim bsTrough,bsSaucer,dtR,dtL,bsLock,PlungerIm, locktimer
- Sub Table1_Init
- vpmInit Me
- On Error Resume Next
- With Controller
- .GameName = cGameName
- If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description : Exit Sub
- .SplashInfoLine = ""&chr(13)&"You Suck"
- .HandleMechanics=0
- .HandleKeyboard=0
- .ShowDMDOnly=1
- .ShowFrame=0
- .ShowTitle=0
- .hidden = 1
- .Games(cGameName).Settings.Value("sound")=1
- '.PuPHide = 1
- On Error Resume Next
- .Run GetPlayerHWnd
- If Err Then MsgBox Err.Description
- On Error Goto 0
- End With
- On Error Goto 0
- PinMAMETimer.Interval=PinMAMEInterval
- PinMAMETimer.Enabled=1
- vpmNudge.TiltSwitch=swTilt
- vpmNudge.Sensitivity=7.5
- vpmNudge.TiltObj=Array(Bumper1,Bumper2,Bumper3,RightSlingshot)
- captivekick.Enabled=0
- Set bsTrough=New cvpmBallStack
- bsTrough.InitSw 11,10,0,0,0,0,0,0
- bsTrough.InitKick BallRelease,90,4
- bsTrough.InitExitSnd SoundFX("ballrelease",DOFContactors), SoundFX("Solenoid",DOFContactors)
- bsTrough.Balls=1
- bsTrough.AddBall 0 'add ball to trough entry switch
- Set bsSaucer=New cvpmBallStack
- bsSaucer.InitSaucer TopHole,29,194,12
- bsSaucer.InitExitSnd SoundFX("popper",DOFContactors),SoundFX("solon",DOFContactors)
- bsSaucer.KickAngleVar=10
- bsSaucer.KickForceVar = 5
- Set bsLock=New cvpmBallStack
- bsLock.InitSaucer BallLock,9,273,9
- ' bsLock.KickAngleVar=1
- bsLock.InitExitSnd SoundFX("popper",DOFContactors),SoundFX("solon",DOFContactors)
- 'Set dtL = New cvpmDropTarget
- 'dtL.InitDrop Array(DropL1,DropL2,DropL3,DropL4),Array(17,18,19,20)
- 'dtL.InitSnd SoundFX("droptarget",DOFContactors),SoundFX("bankreset",DOFContactors)
- 'dtL.CreateEvents "dtL"
- Set dtL = New cvpmDropTarget
- dtL.InitDrop Array(Array(DropL1),Array(DropL2),Array(DropL3),Array(DropL4)),Array(17,18,19,20)
- dtL.InitSnd SoundFX("droptarget",DOFDropTargets),SoundFX("bankreset",DOFContactors)
- dtL.CreateEvents "dtL"
- Set dtR = New cvpmDropTarget
- dtR.InitDrop Array(Array(DropR1),Array(DropR2),Array(DropR3),Array(DropR4)),Array(21,22,23,24)
- dtR.InitSnd SoundFX("droptarget",DOFDropTargets),SoundFX("bankreset",DOFContactors)
- dtR.CreateEvents "dtR"
- 'Set dtR = New cvpmDropTarget
- 'dtR.InitDrop Array(DropR1,DropR2,DropR3,DropR4),Array(21,22,23,24)
- 'dtR.InitSnd SoundFX("droptarget",DOFContactors),SoundFX("bankreset",DOFContactors)
- 'dtR.CreateEvents "dtR"
- End Sub
- 'Captive Ball Init
- captivekick.CreateBall:captivekick.Kick 180, 2
- '**********************************************************************************************************
- 'Plunger code
- '**********************************************************************************************************
- Sub Table1_KeyDown(ByVal KeyCode)
- If keycode = LeftMagnaSave Then bLutActive = True
- If keycode = RightMagnaSave Then
- If bLutActive Then NextLUT: End If
- End If
- If keycode = PlungerKey Then Plunger.Pullback:playsound"plungerpull"
- If KeyDownHandler(keycode) Then Exit Sub
- End Sub
- Sub Table1_KeyUp(ByVal KeyCode)
- If keycode = LeftMagnaSave Then bLutActive = False
- If keycode = PlungerKey Then Plunger.Fire:PlaySound"plunger"
- If KeyUpHandler(keycode) Then Exit Sub
- End Sub
- '**********************************************************************************************************
- 'Switches
- '**********************************************************************************************************
- Sub bellsound(enabled)
- If ballinlock = 1 and locktimer=1 then playsound "longerbellsound"
- If ballinlock = 1 and locktimer=0 then playsound "bell"
- If ballinlock = 0 and locktimer=0 then playsound "bell"
- End Sub
- Dim ballinlock
- Sub BallLock_Hit:ballinlock=1:vpmTimer.AddTimer 400, "bsLock.AddBall":End Sub
- Sub BallLock_unHit:ballinlock=0:End Sub
- Sub Drain_Hit:bsTrough.AddBall Me:playsound "Drain" :End Sub 'Switch 10
- Sub TopHole_Hit:bsSaucer.AddBall 0:playsound "popper_ball" :End Sub 'Switch 29
- '*** Wire Triggers
- Sub LeftOutlane_Hit:Controller.Switch(25)=1:PlaySound "rollover":DOF 101, DOFOn:End Sub
- Sub LeftOutlane_unHit:Controller.Switch(25)=0:DOF 101, DOFOff:End Sub
- Sub RightOutlane_Hit:Controller.Switch(25)=1:PlaySound "rollover":DOF 102, DOFOn:End Sub
- Sub RightOutlane_unHit:Controller.Switch(25)=0:DOF 102, DOFOff:End Sub
- Sub TopLane1_Hit:Controller.Switch(27)=1:PlaySound "rollover":DOF 104, DOFOn:End Sub 'Switch 27
- Sub TopLane1_unHit:Controller.Switch(27)=0:DOF 104, DOFOn:End Sub
- Sub RightInlane_Hit:Controller.Switch(27)=1:PlaySound "rollover":DOF 105, DOFOn:End Sub
- Sub RightInlane_unHit:Controller.Switch(27)=0:DOF 105, DOFOff:End Sub
- Sub TopLane2_Hit:Controller.Switch(28)=1:PlaySound "rollover":End Sub 'Switch 28
- Sub TopLane2_unHit:Controller.Switch(28)=0:End Sub
- '*** Stand Up Targets
- Sub sw4_Hit:vpmTimer.PulseSw 4:PlaySound SoundFX("Tink",DOFTargets):End Sub
- Sub sw25_Hit:vpmTimer.PulseSw 25:PlaySound SoundFXDOF("Tink",103,DOFPulse,DOFTargets):End Sub
- Sub sw30_Hit:vpmTimer.PulseSw 30:PlaySound SoundFX("Tink",DOFTargets):End Sub
- Sub sw31_Hit:vpmTimer.PulseSw 31:PlaySound SoundFX("Tink",DOFTargets):End Sub
- Sub sw33_Hit:vpmTimer.PulseSw 33:PlaySound SoundFX("Tink",DOFTargets):End Sub
- Sub sw34_Hit:vpmTimer.PulseSw 34:PlaySound SoundFX("Tink",DOFTargets):End Sub
- Sub sw35_Hit:vpmTimer.PulseSw 35:PlaySound SoundFX("Tink",DOFTargets):End Sub
- Sub sw36_Hit:vpmTimer.PulseSw 36:PlaySound SoundFX("Tink",DOFTargets):End Sub
- Sub sw37_Hit:vpmTimer.PulseSw 37:PlaySound SoundFX("Tink",DOFTargets):End Sub
- Sub sw38_Hit:vpmTimer.PulseSw 38:PlaySound SoundFX("Tink",DOFTargets):End Sub
- Sub sw39_Hit:vpmTimer.PulseSw 39:PlaySound SoundFX("Tink",DOFTargets):End Sub
- Sub sw40_Hit:vpmTimer.PulseSw 40:PlaySound SoundFX("Tink",DOFTargets):End Sub
- '*** Spinners
- Sub sw16_Spin:vpmTimer.PulseSw 16:PlaySound "spinner":End Sub
- Sub sw32_Spin:vpmTimer.PulseSw 32:PlaySound "spinner":End Sub 'Switch 32
- '*** Gates
- Sub Gate2_hit():playsound "gate":end sub
- Sub Gate3_hit():playsound "gate":end sub
- Sub Gate4_hit():playsound "gate":end sub
- '------------------------------
- '------ Bumpers ------
- '------------------------------
- Sub Bumper1_Hit:vpmTimer.PulseSw 12 : PlayBumperSound : End Sub
- Sub Bumper2_Hit:vpmTimer.PulseSw 13 : PlayBumperSound : End Sub
- Sub Bumper3_Hit:vpmTimer.PulseSw 14 : PlayBumperSound : End Sub
- Sub PlayBumperSound()
- Select Case Int(Rnd*3)+1
- Case 1 : PlaySound SoundFX("fx_bumper1",DOFContactors)
- Case 2 : PlaySound SoundFX("fx_bumper2",DOFContactors)
- Case 3 : PlaySound SoundFX("fx_bumper3",DOFContactors)
- End Select
- End Sub
- '**********Sling Shot Animations
- ' Rstep and Lstep are the variables that increment the animation
- '****************
- Dim RStep
- Sub RightSlingShot_Slingshot
- vpmTimer.PulseSw 15
- PlaySound SoundFX("sling",DOFContactors), 0,1, 0.05,0.05 '0,1, AudioPan(RightSlingShot), 0.05,0,0,1,AudioFade(RightSlingShot)
- RSling.Visible = 0
- RSling1.Visible = 1
- sling1.rotx = 20
- RStep = 0
- RightSlingShot.TimerEnabled = 1
- End Sub
- Sub RightSlingShot_Timer
- Select Case RStep
- Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.rotx = 10
- Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.rotx = 0:RightSlingShot.TimerEnabled = 0:
- End Select
- RStep = RStep + 1
- End Sub
- Dim Digits(60)
- Digits(0)=Array(L1,L2,L3,L4,L5,L6,L7)
- Digits(1)=Array(L8,L9,L10,L11,L12,L13,L14)
- Digits(2)=Array(L15,L16,L17,L18,L19,L20,L21)
- Digits(3)=Array(L22,L23,L24,L25,L26,L27,L28)
- Digits(4)=Array(L29,L30,L31,L32,L33,L34,L35)
- Digits(5)=Array(L36,L37,L38,L39,L40,L41,L42)
- Digits(6)=Array(L43,L44,L45,L46,L47,L48,L49)
- Digits(7)=Array(L50,L51,L52,L53,L54,L55,L56)
- Digits(8)=Array(L57,L58,L59,L60,L61,L62,L63)
- Digits(9)=Array(L64,L65,L66,L67,L68,L69,L70)
- Digits(10)=Array(L71,L72,L73,L74,L75,L76,L77)
- Digits(11)=Array(L78,L79,L80,L81,L82,L83,L84)
- Digits(12)=Array(L85,L86,L87,L88,L89,L90,L91)
- Digits(13)=Array(L92,L93,L94,L95,L96,L97,L98)
- Digits(14)=Array(L99,L100,L101,L102,L103,L104,L105)
- Digits(15)=Array(L106,L107,L108,L109,L110,L111,L112)
- Digits(16)=Array(L113,L114,L115,L116,L117,L118,L119)
- Digits(17)=Array(L120,L121,L122,L123,L124,L125,L126)
- Digits(18)=Array(L127,L128,L129,L130,L131,L132,L133)
- Digits(19)=Array(L134,L135,L136,L137,L138,L139,L140)
- Digits(20)=Array(L141,L001,L002,L144,L145,L146,L147)
- Digits(21)=Array(L148,L149,L150,L151,L152,L153,L154)
- Digits(22)=Array(L155,L156,L157,L158,L159,L160,L161)
- Digits(23)=Array(L162,L163,L164,L165,L166,L167,L168)
- Digits(24)=Array(L169,L170,L171,L172,L173,L174,L175)
- Digits(25)=Array(L176,L177,L178,L179,L180,L181,L182)
- Digits(26)=Array(L183,L184,L185,L186,L187,L188,L189)
- Digits(27)=Array(L190,L191,L192,L193,L194,L195,L196)
- Digits(28)=Array(L197,L198,L199,L200,L201,L202,L203)
- Digits(29)=Array(L204,L205,L206,L207,L208,L209,L210)
- Digits(30)=Array(L211,L212,L213,L214,L215,L216,L217)
- Digits(31)=Array(L218,L219,L220,L221,L222,L223,L224)
- Sub DisplayTimer_Timer
- Dim ChgLED,ii,num,chg,stat,obj
- ChgLed = Controller.ChangedLEDs(&Hffffffff, &Hffffffff)
- If Not IsEmpty(ChgLED) Then
- If DesktopMode = True Then
- For ii = 0 To UBound(chgLED)
- num = chgLED(ii, 0) : chg = chgLED(ii, 1) : stat = chgLED(ii, 2)
- if (num < 60) then
- For Each obj In Digits(num)
- If chg And 1 Then obj.State = stat And 1
- chg = chg\2 : stat = stat\2
- Next
- else
- end if
- next
- end if
- end if
- End Sub
- '***************************************************
- ' 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)
- InitLamps() ' turn off the lights and flashers and reset them to the default parameters
- LampTimer.Interval = 5 'lamp fading speed
- LampTimer.Enabled = 1
- ' 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
- FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
- Next
- End If
- UpdateLamps
- End Sub
- Sub UpdateLamps()
- NFadeL 1, Light1 'Unused ?
- NFadeL 2, Light2
- NFadeL 3, Light3
- NFadeL 4, Light4
- NFadeL 5, Light5
- NFadeL 6, Light6
- NFadeL 7, Light7
- NFadeL 8, Light8
- NFadeL 9, Light9
- NFadeL 10, Light10
- NFadeL 11, Light11
- NFadeL 12, Light12
- NFadeL 13, Light13
- NFadeL 14, Light14
- NFadeL 15, Light15
- NFadeL 16, Light16
- NFadeL 17, Light17 'Bumper 3
- NFadeL 18, Light18 'Bumper 2
- NFadeL 19, Light19 'Bumper 1
- NFadeL 20, Light20
- NFadeL 21, Light21
- NFadeL 22, Light22
- NFadeL 23, Light23
- NFadeL 24, Light24
- NFadeL 25, Light25
- NFadeL 26, Light26
- NFadeL 27, Light27
- NFadeL 28, Light28
- NFadeL 29, Light29
- NFadeL 30, Light30
- NFadeL 31, Light31
- NFadeL 32, Light32
- NFadeL 33, Light33
- NFadeL 34, Light34
- NFadeL 35, Light35
- NFadeL 36, Light36
- NFadeL 37, Light37
- ' NFadeL 38, Light38 'MATCH
- NFadeL 39, Light39
- ' NFadeL 40, Light40 'TILT
- ' NFadeL 41, Light41 'HIGHSCORE
- NFadeL 42, Light42
- NFadeLm 43, Light43A
- NFadeL 43, Light43B
- ' NFadeL 44, Light44 'GAME OVER
- NFadeLm 45, Light45A 'Also BALL IN PLAY
- NFadeL 45, Light45B
- NFadeL 46, Light46
- NFadeL 47, Light47
- NFadeL 48, Light48
- NFadeLm 49, Light49
- NFadeL 49, Light49B
- NFadeL 50, Light50
- NFadeL 51, Light51
- NFadeL 52, Light52
- NFadeL 53, Light53
- NFadeL 54, Light54
- NFadeL 55, Light55
- NFadeL 56, Light56
- NFadeL 57, Light57
- NFadeL 58, Light58
- NFadeL 59, Light59
- NFadeL 60, Light60
- NFadeL 61, Light61
- NFadeL 62, Light62
- NFadeL 63, Light63
- NFadeL 64, Light64
- 'Solenid Controlled Lamps
- NFadeL 142, L142
- NFadeL 143, L143
- NFadeLm 144, L144A
- NFadeL 144, L144B
- End Sub
- ' div lamp subs
- 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.4 ' faster speed when turning on the flasher
- FlashSpeedDown(x) = 0.2 ' 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 AllLampsOff
- Dim x
- For x = 0 to 200
- SetLamp x, 0
- Next
- End Sub
- Sub SetLamp(nr, value)
- If value <> LampState(nr) Then
- LampState(nr) = abs(value)
- FadingLevel(nr) = abs(value) + 4
- End If
- End Sub
- ' Lights: used for VP10 standard lights, the fading is handled by VP itself
- Sub NFadeL(nr, object)
- Select Case FadingLevel(nr)
- Case 4:object.state = 0:FadingLevel(nr) = 0
- Case 5:object.state = 1:FadingLevel(nr) = 1
- End Select
- End Sub
- Sub NFadeLm(nr, object) ' used for multiple lights
- Select Case FadingLevel(nr)
- Case 4:object.state = 0
- Case 5:object.state = 1
- End Select
- End Sub
- 'Lights, Ramps & Primitives used as 4 step fading lights
- 'a,b,c,d are the images used from on to off
- Sub FadeObj(nr, object, a, b, c, d)
- Select Case FadingLevel(nr)
- Case 4:object.image = b:FadingLevel(nr) = 6 'fading to off...
- Case 5:object.image = a:FadingLevel(nr) = 1 'ON
- Case 6, 7, 8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
- Case 9:object.image = c:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
- Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
- Case 13:object.image = d:FadingLevel(nr) = 0 'Off
- End Select
- End Sub
- Sub FadeObjm(nr, object, a, b, c, d)
- Select Case FadingLevel(nr)
- Case 4:object.image = b
- Case 5:object.image = a
- Case 9:object.image = c
- Case 13:object.image = d
- End Select
- End Sub
- Sub NFadeObj(nr, object, a, b)
- Select Case FadingLevel(nr)
- Case 4:object.image = b:FadingLevel(nr) = 0 'off
- Case 5:object.image = a:FadingLevel(nr) = 1 'on
- End Select
- End Sub
- Sub NFadeObjm(nr, object, a, b)
- Select Case FadingLevel(nr)
- Case 4:object.image = b
- Case 5:object.image = a
- End Select
- End Sub
- ' Flasher objects
- Sub Flash(nr, object)
- Select Case FadingLevel(nr)
- Case 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
- 'Gameplan Cyclopes
- 'added by Inkochnito
- Sub editDips
- Dim vpmDips:Set vpmDips=New cvpmDips
- With vpmDips
- .AddForm 700,400,"Cyclopes - DIP switches"
- .AddFrame 2,0,190,"Credits per coin",&H0000001F,Array("1 credit - 2 coins",&H000000031,"1 credit - 1 coin",&H00000002,"2 credits - 1 coin",&H00000004,"5 credits - 1 coin",&H0000000A)'dip 1-5
- .AddFrame 2,75,190,"Maximum credits",&H06000000,Array("10 credits",0,"20 credits",&H02000000,"30 credits",&H04000000,"40 credits",&H06000000)'dip 26&27
- .AddFrame 2,150,190,"High game to date award",&HC0000000,Array("no award",0,"1 credit",&H40000000,"2 credits",&H80000000,"3 credits",&HC0000000)'dip 31&32
- .AddFrame 2,225,190,"Balls per game",&H00C00000,Array("1 ball",0,"2 balls",&H00400000,"3 balls",&H00800000,"5 balls",&H00C00000)'dip 23+24
- .AddFrame 2,300,190,"Replay or free ball award",&H18000000,Array("no award",0,"50,000 points",&H08000000,"extra ball",&H10000000,"replay",&H18000000)'dip 28+29
- .AddFrame 210,0,190,"Tilt warning option",&H01000000,Array("no warnings",0,"2 warnings before tilt",&H01000000)'dip 25
- .AddFrame 210,47,190,"Eyes target value",&H00000020,Array("starts at 10K",0,"starts at 25K",&H00000020)'dip 6
- .AddFrame 210,94,190,"Spinner values memory",&H00000040,Array("will be reset",0,"will be kept in memory",&H00000040)'dip 7
- .AddFrame 210,141,190,"Regular bonus option",&H00004000,Array("reset bonus after collected",0,"restore bonus after collected",&H00004000)'dip 15
- .AddFrame 210,188,190,"Lock will light when",32768,Array("2 target banks are completed",0,"1 target bank is completed",32768)'dip 16
- .AddFrame 210,235,190,"Eyes extra ball flashes",&H00200000,Array("at 100K",0,"at 75K",&H00200000)'dip 22
- .AddChk 210,285,150,Array("Attract mode",&H00001000)'dip 13
- .AddChk 210,305,150,Array("Enable extra ball",&H00002000)'dip 14
- .AddChk 210,325,150,Array("Match feature",&H20000000)'dip 30
- .AddChk 210,345,150,Array("Free play",&H00000080)'dip 8
- .AddLabel 30,380,300,20,"After hitting OK, press F3 to reset game with new settings."
- .ViewDips
- End With
- End Sub
- Set vpmShowDips=GetRef("editDips")
- '*************
- ' JP'S LUT
- '*************
- Dim bLutActive, LUTImage
- Sub LoadLUT
- Dim x
- x = LoadValue(cGameName, "LUTImage")
- If(x <> "") Then LUTImage = x Else LUTImage = 0
- UpdateLUT
- End Sub
- Sub SaveLUT
- SaveValue cGameName, "LUTImage", LUTImage
- End Sub
- Sub NextLUT: LUTImage = (LUTImage +1 ) MOD 10: UpdateLUT: SaveLUT: End Sub
- Sub UpdateLUT
- Select Case LutImage
- Case 0: table1.ColorGradeImage = "LUT0"
- Case 1: table1.ColorGradeImage = "LUT1"
- Case 2: table1.ColorGradeImage = "LUT2"
- Case 3: table1.ColorGradeImage = "LUT3"
- Case 4: table1.ColorGradeImage = "LUT4"
- Case 5: table1.ColorGradeImage = "LUT5"
- Case 6: table1.ColorGradeImage = "LUT6"
- Case 7: table1.ColorGradeImage = "LUT7"
- Case 8: table1.ColorGradeImage = "LUT8"
- Case 9: table1.ColorGradeImage = "LUT9"
- End Select
- End Sub
- '*********************************************************************
- ' Positional Sound Playback Functions
- '*********************************************************************
- ' Play a sound, depending on the X,Y position of the table element (especially cool for surround speaker setups, otherwise stereo panning only)
- ' parameters (defaults): loopcount (1), volume (1), randompitch (0), pitch (0), useexisting (0), restart (1))
- ' Note that this will not work (currently) for walls/slingshots as these do not feature a simple, single X,Y position
- Sub PlayXYSound(soundname, tableobj, loopcount, volume, randompitch, pitch, useexisting, restart)
- PlaySound soundname, loopcount, volume, AudioPan(tableobj), randompitch, pitch, useexisting, restart, AudioFade(tableobj)
- End Sub
- ' Similar subroutines that are less complicated to use (e.g. simply use standard parameters for the PlaySound call)
- Sub PlaySoundAt(soundname, tableobj)
- PlaySound soundname, 1, 1, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
- End Sub
- Sub PlaySoundAtBall(soundname)
- PlaySoundAt soundname, ActiveBall
- End Sub
- '*********************************************************************
- ' Supporting Ball & Sound Functions
- '*********************************************************************
- Function AudioFade(tableobj) ' Fades between front and back of the table (for surround systems or 2x2 speakers, etc), depending on the Y position on the table. "table1" is the name of the table
- Dim tmp
- tmp = tableobj.y * 2 / table1.height-1
- If tmp > 0 Then
- AudioFade = Csng(tmp ^10)
- Else
- AudioFade = Csng(-((- tmp) ^10) )
- End If
- End Function
- Function AudioPan(tableobj) ' Calculates the pan for a tableobj based on the X position on the table. "table1" is the name of the table
- Dim tmp
- tmp = tableobj.x * 2 / table1.width-1
- If tmp > 0 Then
- AudioPan = Csng(tmp ^10)
- Else
- AudioPan = Csng(-((- tmp) ^10) )
- End If
- End Function
- Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
- Vol = Csng(BallVel(ball) ^2 / 2000)
- 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 (+rothbauerw's Dropping 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 RollingTimer_Timer()
- 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
- StopSound "fx_plasticrolling" & b
- StopSound "fx_metalrolling" & 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 Then
- rolling(b) = True
- If BOT(b).Z > 30 Then
- ' ball on plastic ramp
- StopSound "fx_ballrolling" & b
- StopSound "fx_metalrolling" & b
- PlaySound "fx_plasticrolling" & b, -1, Vol(BOT(b)) / 2, AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
- Else
- ' ball on playfield
- StopSound "fx_plasticrolling" & b
- StopSound "fx_metalrolling" & b
- PlaySound "fx_ballrolling" & b, -1, Vol(BOT(b)) / 2, AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
- End If
- Else
- If rolling(b) Then
- StopSound "fx_ballrolling" & b
- StopSound "fx_plasticrolling" & b
- StopSound "fx_metalrolling" & b
- rolling(b) = False
- End If
- End If
- ' ball drop sounds matching the adjusted height params but not the way down the ramps
- If BOT(b).VelZ < -1 And BOT(b).Z < 55 And BOT(b).Z > 27 then 'And Not InRect(BOT(b).X, BOT(b).Y, 610,320, 740,320, 740,550, 610,550) And Not InRect(BOT(b).X, BOT(b).Y, 180,400, 230,400, 230, 550, 180,550) Then
- PlaySound "fx_ball_drop" & Int(Rnd()*3), 0, ABS(BOT(b).VelZ)/17*5, AudioPan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b))
- End If
- Next
- End Sub
- '**********************
- ' Ball Collision Sound
- '**********************
- Sub OnBallBallCollision(ball1, ball2, velocity)
- PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, AudioPan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1)
- End Sub
- '*****************************************
- ' ninuzzu's FLIPPER SHADOWS
- '*****************************************
- sub FlipperTimer_Timer()
- FlipperLSh.RotZ = LeftFlipper.currentangle
- FlipperRSh.RotZ = RightFlipper.currentangle
- End Sub
- '*****************************************
- ' ninuzzu's BALL SHADOW
- '*****************************************
- Dim BallShadow
- BallShadow = Array (BallShadow1,BallShadow2,BallShadow3,BallShadow4,BallShadow5)
- Sub BallShadowUpdate_timer()
- Dim BOT, b
- BOT = GetBalls
- ' hide shadow of deleted balls
- If UBound(BOT)<(tnob-1) Then
- For b = (UBound(BOT) + 1) to (tnob-1)
- BallShadow(b).visible = 0
- Next
- End If
- ' exit the Sub if no balls on the table
- If UBound(BOT) = -1 Then Exit Sub
- ' 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))/21)) + 6
- Else
- BallShadow(b).X = ((BOT(b).X) + (Ballsize/6) + ((BOT(b).X - (Table1.Width/2))/21)) - 6
- End If
- ballShadow(b).Y = BOT(b).Y + 4
- If BOT(b).Z > 20 Then
- BallShadow(b).visible = 1
- Else
- BallShadow(b).visible = 0
- End If
- Next
- End Sub
- '************************************
- ' What you need to add to your table
- '************************************
- ' a timer called RollingTimer. With a fast interval, like 10
- ' one collision sound, in this script is called fx_collide
- ' as many sound files as max number of balls, with names ending with 0, 1, 2, 3, etc
- ' for ex. as used in this script: fx_ballrolling0, fx_ballrolling1, fx_ballrolling2, fx_ballrolling3, etc
- '******************************************
- ' Explanation of the rolling sound routine
- '******************************************
- ' sounds are played based on the ball speed and position
- ' the routine checks first for deleted balls and stops the rolling sound.
- ' The For loop goes through all the balls on the table and checks for the ball speed and
- ' if the ball is on the table (height lower than 30) then then it plays the sound
- ' otherwise the sound is stopped, like when the ball has stopped or is on a ramp or flying.
- ' The sound is played using the VOL, AUDIOPAN, AUDIOFADE and PITCH functions, so the volume and pitch of the sound
- ' will change according to the ball speed, and the AUDIOPAN & AUDIOFADE functions will change the stereo position
- ' according to the position of the ball on the table.
- '**************************************
- ' Explanation of the collision routine
- '**************************************
- ' The collision is built in VP.
- ' You only need to add a Sub OnBallBallCollision(ball1, ball2, velocity) and when two balls collide they
- ' will call this routine. What you add in the sub is up to you. As an example is a simple Playsound with volume and paning
- ' depending of the speed of the collision.
- Sub Pins_Hit (idx)
- PlaySound "pinhit_low", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
- End Sub
- Sub Targets_Hit (idx)
- PlaySound "target", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall)
- End Sub
- Sub Metals_Thin_Hit (idx)
- PlaySound "metalhit_thin", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- End Sub
- Sub Metals_Medium_Hit (idx)
- PlaySound "metalhit_medium", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- End Sub
- Sub Metals2_Hit (idx)
- PlaySound "metalhit2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- End Sub
- Sub Gates_Hit (idx)
- PlaySound "Gate5", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- End Sub
- Sub Spinner_Spin
- PlaySound "fx_spinner", 0, .25, AudioPan(Spinner), 0.25, 0, 0, 1, AudioFade(Spinner)
- End Sub
- Sub Rubbers_Hit(idx)
- dim finalspeed
- finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
- If finalspeed > 20 then
- PlaySound "fx_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- 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_rubber2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- 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 "rubber_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- Case 2 : PlaySound "rubber_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- Case 3 : PlaySound "rubber_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- 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 "flip_hit_1", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 1, 0, AudioFade(ActiveBall)
- End Select
- End Sub
- Sub Table1_Exit()
- If B2SOn Then
- Controller.Pause = False
- Controller.Stop
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment