Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' Original VP9 Table by JPSalas
- ' VP10 conversion by nFozzy
- ' Spotlight primitive by Dark
- ' flasher images by LoadedWeapon
- 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
- 'Options------
- const HardFlips = 1 'more rigid flippers
- const SingleScreenFS = 0 'Single Screen FS support
- Const FastFlips = 1 'Skip solenoid callbacks for flippers (def: 1)
- '------------
- 'Dim DesktopMode:DesktopMode = Table1.ShowDT
- Dim DesktopMode:DesktopMode = Table1.ShowDT
- Dim UseVPMColoredDMD
- Const UseVPMModSol = 1
- const cSingleLFlip = False 'disable UL flipper button
- if SingleScreenFS = 1 then UseVPMColoredDMD = True else UseVPMColoredDMD = DesktopMode
- if FastFlips = 0 then Clockstep = 20
- LoadVPM "01560000", "WPC.VBS", 3.5
- '********************
- 'Standard definitions
- '********************
- Const UseSolenoids = 1
- Const UseLamps = 0
- Const UseSync = 0
- Const HandleMech = 0
- 'Const UseGI = 0
- ' Standard Sounds
- Const SSolenoidOn = "fx_solenoid"
- Const SSolenoidOff = ""
- Const SCoin = "fx_Coin"
- Const cGameName = "congo_21"
- Dim bsTrough, bsAmyVuk, bsVolcano, bsMap, bsMystery, LowerPlayfieldBall
- Dim x
- Set GICallback = GetRef("UpdateGIon")
- Set GICallback2 = GetRef("UpdateGI")
- Set MotorCallback = GetRef("RollingUpdate") 'realtime updates - rolling sound
- '************
- ' 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 = "Congo (Williams 1995)"
- .Games(cGameName).Settings.Value("rol") = 0 'set it to 1 to rotate the DMD to the left
- .HandleKeyboard = 0
- .ShowTitle = 0
- .ShowDMDOnly = 1
- .ShowFrame = 0
- .HandleMechanics = 0
- ' .Hidden = DesktopMode
- ' .Hidden = 0
- If DesktopMode then
- .Hidden = 1
- else
- If SingleScreenFS = 1 then
- .Hidden = 1
- else
- .Hidden = 0
- End If
- End If
- 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
- End With
- ' Nudging
- vpmNudge.TiltSwitch = 14
- vpmNudge.Sensitivity = 1
- vpmNudge.TiltObj = Array(bumper1, bumper2, bumper3, LeftSlingshot, RightSlingshot)
- ' Trough
- Set bsTrough = New cvpmTrough
- With bsTrough
- .size = 4
- .initSwitches Array(32, 33, 34, 35)
- .Initexit BallRelease, 90, 4
- .InitEntrySounds "fx_drain", "fx_Solenoid", "fx_Solenoid"
- .InitExitSounds "fx_Solenoid", SoundFX("fx_ballrel",DOFContactors)
- .Balls = 4
- End With
- 'SoundFX("DTDrop",DOFContactors)
- ' Volcano
- Set bsVolcano = New cvpmTrough
- With bsVolcano
- .size = 4
- .initSwitches Array(41, 42, 43)
- .Initexit sw36a, 260, 10
- .InitExitVariance 10, 1 'direction, force
- .InitExitSounds SoundFX("popper",DOFContactors), SoundFX("popper",DOFContactors)
- .InitExitVariance 2, 2
- ' .MaxBallsPerKick = 2
- End With
- '2-way Popper
- Set bsAmyVuk = New cvpmSaucer
- With bsAmyVuk
- .InitKicker sw53, 53, 330, 30, 65 'up 'switch, direction, force, Zforce
- .InitAltKick 145, 30, 60 'down
- .InitSounds "kicker_enter_center", "fx_Solenoid", SoundFX("fx_kicker2",DOFContactors)
- ' .CreateEvents "bsAmyVuk", sw53
- End With
- Set BsMystery = New cvpmSaucer
- With bsMystery
- .InitKicker sw37, 37, 185, 20, 45
- .InitExitVariance 2, 1
- .InitSounds "kicker_enter_center", "fx_Solenoid", SoundFX("fx_kicker2",DOFContactors)
- ' .createevents "bsMystery", sw37
- End With
- Set bsMap = New cvpmSaucer
- With bsMap
- .InitKicker sw38, 38, 210, 20, 45
- .InitExitVariance 2, 1
- .InitSounds "kicker_enter_center", "fx_Solenoid", SoundFX("fx_kicker2",DOFContactors)
- ' .createevents "bsMap", sw38
- End With
- ' Main Timer init
- PinMAMETimer.Interval = PinMAMEInterval
- PinMAMETimer.Enabled = 1
- ' Init Kickback
- KickBack.Pullback
- AutoPlunger.Pullback
- ' Init other dropwalls - animations
- LeftPost.IsDropped = 1:SolTopPost 0
- TopPost.IsDropped = 0
- leftpost_invis.IsDropped = 1
- 'Lower Playfield Ball
- CreateLPFball
- ' DisconnectFlippers
- UpdateGIon 0, 0:UpdateGIon 1, 0: UpdateGIon 2, 0
- UpdateGI 0, 9:UpdateGI 1, 7:UpdateGI 2, 7
- 'Sidewall tops
- borderL.visible = cInt(desktopmode)
- borderR.visible = cInt(desktopmode)
- borderL2.visible = cInt(desktopmode)
- borderR2.visible = cInt(desktopmode)
- 'DMD Adjust
- if DesktopMode Then
- flasherDMD.X = -58: flasherDMD.Y = 1580: flasherDMD.rotX = -40: flasherDMD.rotY = 2.5:flasherDMD.height = 830
- elseif SingleScreenFS then
- '/
- ' msgbox("SSFS")
- Else
- flasherdmd.visible = 0
- end if
- 'if VPBuildVersion < 10100 then 'Legacy support, since VP10.0 does not support changing flipper angles
- ' GoFlipperLeft.strength = 1600
- ' GoFlipperRight.strength = 1600
- ' playsound "target"
- '' flipper1.rotatetoend
- ' controller.hidden = 0
- 'end if
- End Sub
- Sub CreateLPFball
- Set LowerPlayfieldBall = kickerLPF.Createball
- with LowerPlayfieldBall
- .image = "ball_HDR"
- .color = RGB(148,148,148)
- end with
- kickerLPF.Kick 180, 1
- End Sub
- Sub LPFcatcherTrigger_hit() 'in case the ball bugs
- me.destroyball
- CreateLPFball
- end sub
- Sub table1_Paused:Controller.Pause = 1:End Sub
- Sub table1_unPaused:Controller.Pause = 0:End Sub
- '***********
- ' Update GI
- '***********
- Dim gistep, Giswitch, xx
- Giswitch = 0
- Sub UpdateGIOn(no, Enabled)
- Select Case no
- Case 0 'Gorilla
- If Enabled Then
- For each xx in GIGorilla:xx.State = 1: Next
- Else
- For each xx in GIGorilla:xx.state = 0: Next
- End If
- Case 1
- If Enabled Then
- For Each xx in GiTop:xx.state = 1: Next
- Gi_flasher.visible = 1 'spotlight
- else
- For Each xx in GiTop:xx.state = 0: Next
- Gi_flasher.visible = 0
- End If
- Case 2
- If Enabled Then
- For Each xx in GiBottom:xx.state = 1: Next
- Else
- For Each xx in GiBottom:xx.state = 0: Next
- End If
- End Select
- End Sub
- 'cutting down the intensity a bit
- 'min 50% intensityscale
- 'x = intensityscale y = gistep
- 'x1= 0.5 y1= 1
- 'x2= 1 y2= 7
- 'solve for slope
- ''m = (y2 - y1) / (x2 - x1)
- ' (7 - 1) / (1 - 0.5)
- ' 6 / 0.5
- 'm = 12
- 'point slope formula
- 'y - y1 = m(x-x1)
- ' y - 1 = 12(x-0.5)
- 'y = 12x -5
- 'x = (y+5)/12
- Sub UpdateGI(no, step)
- Dim ii, x
- If step = 0 then exit sub 'only values from 1 to 8 are visible and reliable. 0 is not reliable and 7 & 8 are the same so...
- gistep = (step-1)' / 7
- Select Case no
- Case 0
- ' textbox1.text = step
- ' If step > 0 and step < 8 Then
- ' For each xx in GIGorilla:xx.State = 1: Next
- ' Else
- ' For each xx in GIGorilla:xx.state = 0: Next
- ' End If
- ' GorillaGI
- For each ii in GiGorilla
- ii.IntensityScale = (gistep+5)/12
- Next
- Case 1
- For each ii in GiTop
- ii.IntensityScale = (gistep+5)/12
- ' back.Image="backwall"&step
- Next
- Gi_flasher.IntensityScale = (gistep+5)/12
- Case 2 ' also the bumpers er GI
- For each ii in GiBottom
- ii.IntensityScale = (gistep+5)/12
- Next
- End Select
- ' change the intensity of the flasher depending on the gi to compensate for the gi lights being off
- ' For ii = 0 to 200
- ' FlashMax(ii) = 6 - gistep * 3 ' the maximum value of the flashers
- ' Next
- '
- for each x in LInserts
- dim s, i
- s = mid(x.name, 2, 2) 'take L off the lamp's name
- i = cInt(s) 'convert string to integer to get the lampnumber
- x.intensityscale = 4-(3*GI31.intensityscale)
- x.fadespeedup = insertfading(i, 1) * x.intensityscale
- x.fadespeeddown = insertfading(i, 2) * x.intensityscale
- Next
- textbox1.text = 4-(3*GI31.intensityscale)
- ' textbox1.text = GI31.intensityscale
- End Sub
- dim insertfading(100, 2): 'columns : 0 = name 1 = fadeup 2 = fadedown
- 'for x = 0 to ubound(insertfading)
- ' insertfading(x, 0) = 0
- ' insertfading(x, 1) = 0
- 'next
- initlampsforfading
- Sub initlampsforfading
- dim x, s, i
- i = 0
- for each x in Linserts 'setup array
- s = mid(x.name, 2, 2) 'take L off the lamp
- i = cInt(s) 'convert string to integer to get the lampnumber
- insertfading(i, 0) = i
- insertfading(i, 1) = x.fadespeedup
- insertfading(i, 2) = x.fadespeeddown
- next
- for x = 0 to UBOUND(insertfading)
- if insertfading(x, 0) <> 0 then
- ' textbox1.text = insertfading(x, 0)
- exit for
- Else
- ' textbox1.text = "comin up zeros"
- end If
- next
- textbox1.text = insertfading(58, 2)
- end sub
- 'x = intensityscale y = gistep
- 'x1= 2.5 y1= 0.5
- 'x2= 1 y2= 1
- 'solve for slope
- ''m = (y2 - y1) / (x2 - x1)
- ' (1 - 0.5) / (1 - 2.5)
- 'm = -1/3
- 'point slope formula
- 'y - y1 = m(x-x1)
- 'y - 0.5 = (-1/3)(x-2.5)
- Sub GorillaGI
- If Giswitch = 1 then
- Giswitch = 0
- Gion
- Else
- Giswitch = 1
- Gioff
- End If
- End Sub
- Sub GIon
- For each xx in GIGorilla:xx.State = 1: Next
- end sub
- Sub GIoff
- For each xx in GIGorilla:xx.state = 0: Next
- end sub
- '--Experimental simple light tweaking UI
- dim teststatement: teststatement = "buddy! Press enter to start!" '============CLICK ME TO COLLAPSE============
- ltbody.text = " "
- ltTop.text = "Top bar"
- ltSide.text = "0" & vbnewline & "1" & vbnewline & "2" & vbnewline & "3"' & vbnewline & "4" & vbnewline & "5"
- dim testarray(6)
- testarray(0) = "Hi there " & teststatement
- ltbody.text = testarray(0)
- dim LTtypeselect:LTtypeselect = 0
- dim LTpropertyselect: LTpropertyselect = 0
- 'InitLT
- 'Sub InitLT
- ' LtTypeSelect = 0
- 'End Sub
- sub ltdebug2_timer()
- me.text = "Ltpropertyselect var: " & LTpropertyselect & vbnewline & "Lttypeselect var: " & LTTypeselect
- end sub
- sub LTcontUpDown(updown)
- dim x
- if Updown = 1 Then
- if LtPropertySelect = 0 then
- LtPropertyselect = 8
- else LtpropertySelect = Ltpropertyselect -1
- end if
- elseif Updown = 0 Then
- if LtPropertySelect = 8 then
- LtPropertyselect = 0
- else LtpropertySelect = Ltpropertyselect +1
- end if
- Else
- Ltdebug.text = "Bad argument"
- end if
- dim a, aa
- aa = array("0 ", "1 ", "2 ", "3 ", "4 ", "5 ", "6 ", "7 ", "8")
- a = array("0>", "1>", "2>", "3>", "4>", "5>", "6>", "7>", "8>")
- aa(LtPropertySelect) = a(LTpropertyselect) 'heh
- ltside.text = aa(0) & vbnewline & aa(1) & vbnewline & aa(2) & vbnewline & aa(3) & vbnewline & aa(4) & vbnewline & aa(5) & vbnewline & aa(6) & vbnewline & aa(7) & vbnewline & aa(8)
- End Sub
- Sub LtcontLeftRight(LeftRight) '1 or -1
- dim a
- a = array(Linserts)
- dim x
- if mid(Lcatalogn(LTtypeselect), 1, 1) = "L" then
- select case LTpropertyselect
- case 0 'name
- LtTypeSelect = LtTypeSelect + 1 * leftright
- if LtTypeSelect < 0 then LtTypeSelect = lrarraycount
- if LtTypeSelect > lrarraycount then LtTypeSelect = 0
- case 1 'falloff
- for each x in Lcatalog(LTtypeselect)
- x.falloff = x.falloff + 10 *leftright
- next
- case 2 'fallofpower
- for each x in Lcatalog(LTtypeselect)
- x.falloffpower = x.falloffpower + 0.5 *leftright
- next
- case 3 'intensity
- for each x in Lcatalog(LTtypeselect)
- x.intensity = x.intensity + 1 *leftright
- next
- case 4 'empty
- end select
- Elseif mid(Lcatalogn(LTtypeselect), 1, 1) = "F" then
- '1 object '2 opacity '3 modulate
- select case LTpropertyselect
- case 0 'name
- LtTypeSelect = LtTypeSelect + 1 * leftright
- if LtTypeSelect < 0 then LtTypeSelect = lrarraycount
- if LtTypeSelect > lrarraycount then LtTypeSelect = 0
- case 1 'opacity
- for each x in Lcatalog(LTtypeselect)
- x.opacity = x.opacity + 50 *leftright
- next
- case 2 'modulatevsadd
- for each x in Lcatalog(LTtypeselect)
- x.modulatevsadd = x.modulatevsadd + 0.01 *leftright
- next
- case 3 'modulatevsadd gross
- for each x in Lcatalog(LTtypeselect)
- x.modulatevsadd = x.modulatevsadd + 0.1 *leftright
- next
- end select
- Elseif mid(Lcatalogn(LTtypeselect), 1, 1) = "B" then
- select case LTpropertyselect
- case 0 'name
- LtTypeSelect = LtTypeSelect + 1 * leftright
- if LtTypeSelect < 0 then LtTypeSelect = lrarraycount
- if LtTypeSelect > lrarraycount then LtTypeSelect = 0
- case 1 'falloff
- for each x in Lcatalog(LTtypeselect)
- x.falloff = x.falloff + 10 *leftright
- next
- case 2 'fallofpower
- for each x in Lcatalog(LTtypeselect)
- x.falloffpower = x.falloffpower + 0.5 *leftright
- next
- case 3 'intensity
- for each x in Lcatalog(LTtypeselect)
- x.intensity = x.intensity + 0.5 *leftright
- next
- case 4 'transmit
- for each x in Lcatalog(LTtypeselect)
- x.TransmissionScale = x.TransmissionScale + 0.1 *LeftRight
- next
- case 5 'lightscale for everything else
- for each x in a(0)
- x.intensityscale = x.intensityscale + 0.1 *leftright
- next
- end select
- Elseif mid(Lcatalogn(LTtypeselect), 1, 1) = "G" then
- select case LTpropertyselect
- case 0 'name
- LtTypeSelect = LtTypeSelect + 1 * leftright
- if LtTypeSelect < 0 then LtTypeSelect = lrarraycount
- if LtTypeSelect > lrarraycount then LtTypeSelect = 0
- case 1 'falloff '1 falloff '2 falloff power '3 intensity '4 transmit '5 GI level '6 GI on/off '7 all lights scale
- for each x in Lcatalog(LTtypeselect)
- x.falloff = x.falloff + 10 *leftright
- next
- case 2 'fallofpower
- for each x in Lcatalog(LTtypeselect)
- x.falloffpower = x.falloffpower + 0.5 *leftright
- next
- case 3 'intensity
- for each x in Lcatalog(LTtypeselect)
- x.intensity = x.intensity + 0.5 *leftright
- next
- case 4 'transmit
- for each x in Lcatalog(LTtypeselect)
- x.TransmissionScale = x.TransmissionScale + 0.1 *LeftRight
- next
- case 5 'GI level
- for each x in Lcatalog(LTtypeselect)
- x.intensityscale = x.intensityscale + 0.1 *leftright
- next
- case 6 'GI state
- for each x in Lcatalog(LTtypeselect)
- if x.state = 0 then x.state = 1 else x.state = 0
- next
- case 7 'lightscale for everything else
- for each x in a(0)
- x.intensityscale = x.intensityscale + 0.1 *leftright
- next
- case 8 'modulate
- for each x in Lcatalog(LTtypeselect)
- x.BulbModulateVsAdd = x.BulbModulateVsAdd + 0.01 *leftright
- next
- end select
- end if
- updateLT
- ltdebug.text = "lr:" & ltpropertyselect
- end sub
- sub updateLT
- dim x, s, xx
- ' for each x in Lcatalog(LTtypeselect)
- for each x in Lcatalog(LTtypeselect)
- if mid(Lcatalogn(LTtypeselect), 1, 1) = "L" Then 'if array starts with "L"
- xx = mid(Lcatalogn(LTtypeselect), 1, 1)
- LTdebug.text = "lamp col."
- LTdisplayLampCats
- elseif mid(Lcatalogn(LTtypeselect), 1, 1) = "F" Then
- ltDebug.text = "flash col."
- LTdisplayFlashCats
- elseif mid(Lcatalogn(LTtypeselect), 1, 1) = "B" Then
- ltDebug.text = "bulb col."
- LTdisplayBulbLampCats
- elseif mid(Lcatalogn(LTtypeselect), 1, 1) = "G" Then
- ltDebug.text = "bulb col."
- LTdisplayGICats
- Else
- LTdebug.text = "error: unknown col." 'for Flashers collections later
- end if
- ' x.intensity = 555
- exit for
- next
- s = " "
- ltTop.text = s
- ' xx = cStr(Lcatalog(LTtypeselect) ) 'convert to string for the TextBox 'can't figure this out :(
- ' xx = Lcatalog(0) 'convert to string for the TextBox
- '' xx = cstr(xx)
- ' xx = (Lcatalog(0).tostring())
- s = LcatalogN(LTtypeselect) 'fuck it
- ltTop.text = s
- end sub
- 'categories
- sub LTdisplayLampCats
- dim xxx, LTfalloff1, LTfalloff2, LTintens, LTname 'Loptions0, Loptions1, Loptions2 (falloff, falloffpower, intensity)
- for each xxx in Lcatalog(LTtypeselect)
- LTname = xxx.name
- LTfalloff1 = xxx.falloff
- LTfalloff2 = xxx.falloffpower
- LTintens = xxx.intensity
- exit for 'only need one
- next
- Ltbody.text = "obj: " & LTname & vbnewline & " Falloff: " & LTfalloff1 & vbnewline & " Falloff Power: " & LTfalloff2 & vbnewline & " Intensity: " & LTintens
- end sub
- sub LTdisplayBulbLampCats
- dim xxx, LTfalloff1, LTfalloff2, LTintens, LTname, LTtransmit, LTintscale 'Loptions0, Loptions1, Loptions2 (falloff, falloffpower, intensity)
- for each xxx in Lcatalog(LTtypeselect)
- LTname = xxx.name
- LTfalloff1 = xxx.falloff
- LTfalloff2 = xxx.falloffpower
- LTintens = xxx.intensity
- LTtransmit = xxx.TransmissionScale
- exit for 'only need one
- next
- for each xxx in Collection1
- LTintscale = xxx.intensityscale
- exit for
- next
- Ltbody.text = "obj: " & LTname & vbnewline & " Falloff: " & LTfalloff1 & vbnewline & " Falloff Power: " & LTfalloff2 & vbnewline & " Intensity: " & LTintens & vbnewline & " Transmit: " & LTtransmit & vbnewline & " insertscale: " & LTintscale
- end sub
- 'name, Opacity, 'ModulateVsAdd
- sub LTdisplayFlashCats '1 object '2 opacity '3 modulate
- dim xxx, ltOpacity, LtModulate, LTname 'ModulateVsAdd
- for each xxx in Lcatalog(LTtypeselect)
- LTname = xxx.name
- LtModulate = xxx.ModulateVsAdd
- LtOpacity = xxx.Opacity
- ' LTintens = xxx.intensity
- exit for 'only need one
- next
- Ltbody.text = "an object: " & LTname & vbnewline & " Opacity: " & LtOpacity & vbnewline & " Modulate: " & LtModulate
- end sub
- sub LTdisplayGICats '1 falloff '2 falloff power '3 intensity '4 transmit '5 GI level '6 GI on/off '7 all lights scale
- dim xxx, LTfalloff1, LTfalloff2, LTintens, LTname, LTtransmit, LTintscale, LTgi, LTgibool, LtBulbModulateVsAdd 'Loptions0, Loptions1, Loptions2 (falloff, falloffpower, intensity)
- for each xxx in Lcatalog(LTtypeselect)
- LTname = xxx.name
- LTfalloff1 = xxx.falloff
- LTfalloff2 = xxx.falloffpower
- LTintens = xxx.intensity
- LTtransmit = xxx.TransmissionScale
- Ltgi = xxx.intensityscale
- LtGIbool = xxx.state
- LtBulbModulateVsAdd = xxx.BulbModulateVsAdd
- exit for 'only need one
- next
- for each xxx in Linserts
- LTintscale = xxx.intensityscale
- exit for
- next
- Ltbody.text = "obj: " & LTname & vbnewline & " Falloff: " & LTfalloff1 & vbnewline & " Falloff Power: " & LTfalloff2 & _
- vbnewline & " Intensity: " & LTintens & vbnewline & " Transmit: " & LTtransmit & vbnewline & "Gi lvl:" & LTgi & vbnewline & "Gi on:" & LTGibool & vbnewline & "insertscale: " & LTintscale & vbnewline & "Modulate:" & LtBulbModulateVsAdd
- end sub
- 'categories end
- dim Lcatalog, LcatalogN
- Lcatalog = array(Linserts, Gibottom2, GiTop, Gigorilla) '9
- 'aka fuck it
- LcatalogN = array("Linserts", "Gibottom2", "GiTop", "Gigorilla")
- dim LRarraycount : lrarraycount = 3
- '#end region
- sub TestUpperFlipper
- KickerUFTEST.createball
- KickerUFTEST.kick 0, 0
- bip = bip + 1
- ' T1.enabled = 1
- ' ULeftFlipper.rotatetostart
- End Sub
- ' polltimer.enabled = 0
- tb1.text = "interval: " & t1.interval
- sub t1_timer()
- uleftflipper.rotatetoend
- me.enabled = 0
- end sub
- sub textbox3_timer()
- me.text = GoFlipperLeft.strength
- end sub
- '**********
- ' Keys
- '**********
- sub textbox2_timer()
- me.text = FlasherDMD1.x & vbnewline & Flasherdmd1.y & vbnewline & FlasherDMD1.height
- end sub
- dim LeftFlipperOn, RightFlipperOn
- Sub table1_KeyDown(ByVal Keycode)
- ' If keycode = LeftTiltKey Then Nudge 90, 5:PlaySound "fx_nudge", 0, 1, -0.1, 0.25
- ' If keycode = RightTiltKey Then Nudge 270, 5:PlaySound "fx_nudge", 0, 1, 0.1, 0.25
- ' If keycode = CenterTiltKey Then Nudge 0, 6:PlaySound "fx_nudge", 0, 1, 0, 0.25
- If keycode = LeftFlipperKey Then
- flipnf 0, 1
- if FlippersEnabled then LeftFlipperOn = 1 else LeftFlipperOn = 0 'testing
- end if
- If keycode = RightFlipperKey Then
- flipnf 1, 1
- if FlippersEnabled then RightFlipperOn = 1 else RightFlipperOn = 0 'testing
- end if
- ' if keycode = 28 then updateLT
- ' if keycode = 200 then LTcontUpDown 1
- ' if keycode = 208 then LTcontUpDown 0
- '
- ' if keycode = 203 then LtcontLeftRight -1
- ' if keycode = 205 then LtcontLeftRight 1
- ' if keycode = 200 then FlasherDMD1.y = Flasherdmd1.y + 10
- ' if keycode = 208 then FlasherDMD1.y = Flasherdmd1.y - 10
- ' if keycode = 203 then FlasherDMD1.x = Flasherdmd1.x - 10
- ' if keycode = 205 then FlasherDMD1.x = Flasherdmd1.x + 10
- ' if keycode = 38 then FlasherDMD1.height = Flasherdmd1.height - 10 'L
- ' if keycode = 37 then FlasherDMD1.height = Flasherdmd1.height + 10 'K
- ' if keycode = 38 then FlasherDMD.ROTY = Flasherdmd.ROTY - 2.5 'L
- ' if keycode = 37 then FlasherDMD.ROTY = Flasherdmd.ROTY + 2.5 'K
- '
- ' if keycode = 200 then t1.interval = t1.interval - 10 : tb1.text = "interval: " & t1.interval
- ' if keycode = 208 then t1.interval = t1.interval + 10 : tb1.text = "interval: " & t1.interval
- If vpmKeyDown(keycode) Then Exit Sub
- If keycode = PlungerKey Then PlaySound SoundFx("PlungerPull",0), 0, 0.05, 0.1, 0.25:Plunger.Pullback:end if
- If keycode=31 then ' test Right Kicker debug
- ' initlampsforfading
- ' textbox1.text = insertfading(55, 0)
- ' TestUpperFlipper
- ' Kicker1.createball
- ' kicker1.kick 22, 1
- ' bip = bip + 1
- ' vpmTimer.PulseSw 71
- ' vpmtimer.pulsesw 11 'Grey test
- ' If keycode=32 then ' test Left Kicker
- ' Kicker2.createball
- ' kicker2.kick 1,1
- ' End If
- End If
- If keycode=33 then ' test Right Kicker debug
- ' initlampsforfading
- ' textbox1.text = insertfading(55, 0)
- ' Kicker1.createball
- ' kicker1.kick 22, 35
- ' bip = bip + 1
- ' vpmTimer.PulseSw 71
- ' vpmtimer.pulsesw 11 'Grey test
- ' If keycode=32 then ' test Left Kicker
- ' Kicker2.createball
- ' kicker2.kick 1,1
- ' End If
- End If
- End Sub
- Sub table1_KeyUp(ByVal Keycode)
- If keycode = LeftFlipperKey Then
- flipnf 0, 0
- LeftFlipperOn = 0
- end if
- If keycode = RightFlipperKey Then
- flipnf 1, 0
- RightFlipperOn = 0
- end if
- If vpmKeyUp(keycode) Then Exit Sub
- If keycode = PlungerKey Then PlaySound SoundFx("plunger",0), 0, 0.1, 0.1, 0.25:Plunger.Fire:end if
- End Sub
- '*********
- ' Switches
- '*********
- ' Drain hole
- Sub Drain_Hit
- bsTrough.AddBall Me
- bip = bip - 1
- if bip < 0 then
- bip = 0
- elseif bip = 0 then
- polltimer.enabled = 1
- end if
- End Sub
- 'sub drain_hit:drain.destroyball:end sub 'debug, infinite balls
- sub destroyer_hit
- bip = bip - 1
- if bip < 0 then
- bip = 0
- elseif bip = 0 then
- polltimer.enabled = 1
- end if
- me.destroyball
- end sub
- Sub Sw36_Hit:vpmTimer.PulseSw(36):bsVolcano.AddBall me:bip = bip - 1:playsound "fx_drain", 1, 0.1, 0.005:End Sub 'name,loopcount,volume,pan,randompitch
- Sub Sw37_Hit:controller.Switch(37) = 1:bsMystery.addball me:bip = bip - 1:End Sub
- Sub Sw38_Hit:controller.Switch(38) = 1:bsMap.addball me:bip = bip - 1:End Sub
- 'sw53 (2 way popper)
- sub sw53_hit:controller.Switch(53) = 1:bsAmyVuk.addball me:bip = bip - 1:End Sub
- ' Slings & div switches
- Dim Lstep, Rstep
- Sub LeftSlingShot_Slingshot
- vpmTimer.PulseSw 61
- PlaySound SoundFx("fx_slingshot1",DOFContactors),0,0.7,-0.01,0.05
- LSling.Visible = 0
- LSling1.Visible = 1
- sling2.TransZ = -28
- LStep = 0
- LeftSlingShot.TimerEnabled = 1
- End Sub
- Sub LeftSlingShot_Timer
- Select Case LStep
- Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -16
- Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.TransZ = 0:LeftSlingShot.TimerEnabled = 0
- End Select
- LStep = LStep + 1
- End Sub
- Sub RightSlingShot_Slingshot
- vpmTimer.PulseSw 62
- PlaySound SoundFx("fx_slingshot2",DOFContactors), 0, 0.7, 0.01, 0.05
- RSling.Visible = 0
- RSling1.Visible = 1
- sling1.TransZ = -28
- RStep = 0
- RightSlingShot.TimerEnabled = 1
- End Sub
- Sub RightSlingShot_Timer
- Select Case RStep
- Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -17
- Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.TransZ = 0:RightSlingShot.TimerEnabled = 0
- End Select
- RStep = RStep + 1
- End Sub
- ' Bumpers
- Sub Bumper1_Hit:vpmTimer.PulseSw 63:PlaySound SoundFx("fx_bumper3",DOFContactors), 0, 1, 0.01, 0.20:End Sub
- Sub Bumper2_Hit:vpmTimer.PulseSw 64:PlaySound SoundFx("fx_bumper3",DOFContactors), 0, 1, 0.02, 0.20:End Sub
- Sub Bumper3_Hit:vpmTimer.PulseSw 65:PlaySound SoundFx("fx_bumper3",DOFContactors), 0, 1, 0.01, 0.20:End Sub
- ' Right Eject Rubber
- Sub sw25_Hit:vpmTimer.PulseSw 25:End Sub 'Right Eject Rubber
- 'Shooter Lane
- Sub sw18_Hit:Controller.Switch(18) = 1:End Sub
- Sub sw18_UnHit:Controller.Switch(18) = 0:End Sub
- 'Inlane/Outlanes
- Sub sw16_Hit:Controller.Switch(16) = 1:End Sub 'Kickback
- Sub sw16_UnHit:Controller.Switch(16) = 0:End Sub'kickback
- Sub sw26_Hit:Controller.Switch(26) = 1:End Sub
- Sub sw26_UnHit:Controller.Switch(26) = 0:End Sub
- Sub sw17_Hit:Controller.Switch(17) = 1:End Sub
- Sub sw17_UnHit:Controller.Switch(17) = 0:End Sub
- Sub sw27_Hit:Controller.Switch(27) = 1:End Sub
- Sub sw27_UnHit:Controller.Switch(27) = 0:End Sub
- 'Playfield Switches & Rollovers
- Sub sw15_Hit:Controller.Switch(15) = 1:End Sub
- Sub sw15_UnHit:Controller.Switch(15) = 0:End Sub
- Sub sw45_Hit:Controller.Switch(45) = 1:End Sub
- Sub sw45_UnHit:Controller.Switch(45) = 0:End Sub
- Sub sw11_Hit:Controller.Switch(11) = 1:End Sub
- Sub sw11_UnHit:Controller.Switch(11) = 0:End Sub
- Sub sw44_Hit:Controller.Switch(44) = 1:End Sub
- Sub sw44_UnHit:Controller.Switch(44) = 0:End Sub
- Sub sw12_Hit:Controller.Switch(12) = 1:End Sub
- 'Volcano Switch
- Sub sw12_UnHit:Controller.Switch(12) = 0:End Sub
- 'Additional diverter Sub
- Sub VolcanoTop_Hit()
- bip = bip + 1
- End Sub
- Sub sw71_Hit:Controller.Switch(71) = 1:End Sub 'AMY Rollovers
- Sub sw71_UnHit:Controller.Switch(71) = 0:End Sub
- Sub sw72_Hit:Controller.Switch(72) = 1:End Sub
- Sub sw72_UnHit:Controller.Switch(72) = 0:End Sub
- Sub sw73_Hit:Controller.Switch(73) = 1:End Sub
- Sub sw73_UnHit:Controller.Switch(73) = 0:End Sub
- 'Targets
- Sub sw46_Hit:vpmTimer.PulseSw 46:End Sub
- Sub sw47_Hit:vpmTimer.PulseSw 47:End Sub
- Sub sw48_Hit:vpmTimer.PulseSw 48:End Sub
- Sub sw56_Hit:vpmTimer.PulseSw 56:End Sub':PlaySound "target", 0, 0.2:End Sub 'Laser Perimeter
- Sub sw51_Hit:vpmTimer.PulseSw 51:End Sub
- Sub sw52_Hit:vpmTimer.PulseSw 52:End Sub
- Sub sw54_Hit:vpmTimer.PulseSw 54:End Sub 'We Are
- Sub sw55_Hit:vpmTimer.PulseSw 55:End Sub 'Watching
- Sub sw28_Hit:vpmTimer.PulseSw 28:End Sub 'You
- Sub sw74_Hit:vpmTimer.PulseSw 74:End Sub
- Sub sw75_Hit:vpmTimer.PulseSw 75:End Sub
- Sub sw76_Hit:vpmTimer.PulseSw 76:End Sub
- Sub sw77_Hit:vpmTimer.PulseSw 77:End Sub
- Sub sw78_Hit:vpmTimer.PulseSw 78:End Sub
- 'Ramp Switches
- Sub sw57_Hit:Controller.Switch(57) = 1:End Sub
- Sub sw57_UnHit:Controller.Switch(57) = 0:End Sub
- Sub sw58_Hit:Controller.Switch(58) = 1:End Sub
- Sub sw58_UnHit:Controller.Switch(58) = 0:End Sub
- Sub sw67_Hit:Controller.Switch(67) = 1:End Sub
- Sub sw67_UnHit:Controller.Switch(67) = 0:End Sub
- Sub sw68_Hit:Controller.Switch(68) = 1:End Sub
- Sub sw68_UnHit:Controller.Switch(68) = 0:End Sub
- '***************************
- ' Solenoids & Flashers
- 'some soleoid subs are from
- 'Aurian/Guitar/Jive's table
- '***************************
- SolCallBack(1) = "Auto_Plunger"
- SolCallBack(2) = "Kick_back"
- SolCallBack(3) = "SolPopUp"
- SolCallBack(4) = "SolPopDown"
- 'SolCallBack(5) = "vpmSolDiverter Diverter,true,"
- SolCallback(5) = "RampDiverter"
- SolCallBack(6) = "bsVolcano.SolOut"
- 'SolCallBack(6) = "VolcanoKick"
- SolCallBack(7) = "vpmSolSound SoundFX(""Knocker"",DOFKnocker),"
- SolCallBack(8) = "SolTopPost"
- 'SolCallBack(9) = "bsTrough.SolOut"
- SolCallBack(9) = "SolRelease"
- 'SolCallBack(10) ' Left SLingshot
- 'SolCallBack(11) ' Right Slingshot
- 'SolCallBack(12) ' Left bumper
- 'SolCallBack(13) ' Right bumper
- 'SolCallBack(14) ' Bottom bumper
- SolCallBack(15) = "GorillaRight"
- SolCallBack(16) = "GorillaLeft"
- 'SolCallBack(17) = "SetLamp 117," 'Amy Flasher
- 'SolCallBack(18) = "SetLamp 118," 'Left Ramp Flasher
- 'SolCallBack(19) = "SetLamp 119," '2-Way Popper Flasher
- 'SolCallBack(20) = "SetLamp 120," 'SkillShot Flasher
- 'SolCallBack(21) = "SetLamp 121," 'Gray Gorilla Flasher
- 'SolCallback(22) = "bsMap.SolOut"
- SolCallback(22) = "MapKick"
- SolCallBack(23) = "LeftGateOn"
- SolCallBack(24) = "RightGateOn"
- 'SolCallBack(23) = "vpmSolGate Gate4,true,"
- 'SolCallBack(24) = "vpmSolGate Gate2,true," 'dese are reversed
- 'SolCallBack(25) = "SetLamp 125," 'Lower Right Flasher
- 'SolCallBack(26) = "SetLamp 126," 'Right Ramp Flasher
- 'SolCallBack(27) = "SetLamp 127," 'Volcano Flasher
- 'SolCallBack(28) = "SetLamp 128," 'Perimeter Defense Flasher
- SolCallBack(33) = "SolLeftPost"
- 'SolCallback(34) = "bsMystery.SolOut"
- SolCallback(34) = "MysteryKick"
- '
- 'SolCallback(17) = "AdvFlashBool 17," 'Amy Flasher
- 'SolCallback(18) = "AdvFlashBool 18," 'Left Ramp Flasher
- 'SolCallback(19) = "AdvFlashBool 19," '2-Way Popper Flasher
- 'SolCallback(20) = "AdvFlashBool 20," 'SkillShot Flasher
- 'SolCallback(21) = "AdvFlashBool 21," 'Gray Gorilla Flasher
- 'SolCallback(25) = "AdvFlashBool 25," 'Lower Right Flasher
- 'SolCallback(26) = "AdvFlashBool 26," 'Right Ramp Flasher
- 'SolCallback(27) = "AdvFlashBool 27," 'Volcano Flasher
- 'SolCallback(28) = "AdvFlashBool 28," 'Perimeter Defense Flasher
- DiverterSwoop.isdropped = 1
- Sub RampDiverter(enabled)
- if Enabled Then
- Diverter.rotatetoend
- DiverterSwoop.isdropped = 0
- else
- Diverter.rotatetostart
- DiverterSwoop.isdropped = 1
- End If
- End Sub
- SolModCallback(17) = "AdvFlash 17," 'Amy Flasher
- SolModCallback(18) = "AdvFlash 18," 'Left Ramp Flasher
- SolModCallback(19) = "AdvFlash 19," '2-Way Popper Flasher
- SolModCallback(20) = "AdvFlash 20," 'SkillShot Flasher
- SolModCallback(21) = "AdvFlash 21," 'Gray Gorilla Flasher
- SolModCallback(25) = "AdvFlash 25," 'Lower Right Flasher
- SolModCallback(26) = "AdvFlash 26," 'Right Ramp Flasher
- SolModCallback(27) = "AdvFlash 27," 'Volcano Flasher
- SolModCallback(28) = "AdvFlash 28," 'Perimeter Defense Flasher
- sub TBtestfading_timer()
- ' me.text = f4l.fadespeedup & vbnewline & f4l.fadespeeddown & vbnewline & f4l.intensity & vbnewline & f4l.state & vbnewline & f4l.intensityscale
- me.text = f8l1.fadespeedup & vbnewline & f8l1.fadespeeddown & vbnewline & f8l1.intensity & vbnewline & f8l1.state & vbnewline & f8l1.intensityscale
- end sub
- 'array of fading levels
- dim fFadeSpeedUp(50, 3)
- dim fFadeSpeedDown(50, 3)
- dim fIntensity(50, 3)
- Dim LastMod(50)
- InitFlasherFadeSpeeds
- sub InitFlasherFadeSpeeds 'don't copy this it's dumb. Just use intensityscale and state
- dim x
- for each x in Fflashers
- x.intensityscale = 1.25 'meh
- next
- for x = 0 to UBOUND(lastMod) : lastmod(x) = 0 : next
- Fcategorize 0, 17, F1L 'amy
- Fcategorize 1, 17, F1L2 'Amy
- Fcategorize 0, 18, F2L 'left ramp Flasher
- Fcategorize 0, 19, F3L '2-way popper
- Fcategorize 0, 20, F4L 'Skillshot flasher
- '
- Fcategorize 0, 21, F5L 'Gorilla
- Fcategorize 1, 21, F5L2 'Gorilla
- '
- Fcategorize 0, 25, F6L 'lower right Flasher
- Fcategorize 1, 26, F7L 'right ramp flasher
- '
- Fcategorize 0, 27, F8L 'Volcano
- Fcategorize 1, 27, F8L1
- Fcategorize 2, 27, F8L2
- Fcategorize 3, 27, F8L3
- '
- Fcategorize 0, 28, F9L 'Perimeter Defense Flasher
- Fcategorize 1, 28, F9L2
- end sub
- Sub Fcategorize(col, sol, Object) 'column, sol number, object
- fFadeSpeedUp(sol, col) = object.fadespeedup
- fFadeSpeedDown(sol, col) = object.Fadespeeddown
- fIntensity(sol, col) = object.intensity
- ' object.intensityscale = 0
- object.state = 0
- ' object.fadespeeddown = object.fadespeeddown*1.45 'quick adjustments in here
- ' object.fadespeedup = object.fadespeedup*0.3375 'quick adjustments in here
- object.fadespeeddown = object.fadespeeddown*1.45 'quick adjustments in here
- ' object.fadespeedup = object.fadespeedup*0.3375 'quick adjustments in here
- end sub
- '287.32394366197183098591549295775
- 'x = intensityscale y = gistep
- 'x1= 0.1125 y1= 0
- 'x2= 1 y2= 255
- 'solve for slope
- ''m = (y2 - y1) / (x2 - x1)
- ' (255 - 0) / (1 - 0.15)
- 'm = 300
- 'point slope formula
- 'y - y1 = m(x-x1)
- 'y - (0) = 300(x-0.15)
- ' y - 0 = 329.03225806451612903225806451613(x-0.225)
- ' 0.15 --- x = (y+45)/300
- 'x = (31 y)/10200+9/40
- 'x = y / 300
- 'y = 510 x-254.
- 'x = (y + 254) / 510
- Sub AdvFlashBool(nr, Enabled) 'this sucks a lot. Will remake later using arrays.
- x = ABS(cInt(Enabled) )
- select case nr
- case 17
- F1L.state = x
- f1l2.state = x
- Case 18
- if Enabled and not FlippersEnabled then polltimer.enabled = 1
- F2L.state = x
- Case 19
- F3L.state = x
- case 20
- F4L.state = x
- case 21
- F5L.state = x
- F5L2.state = x
- Case 25
- F6l.state = x
- case 26
- f7l.state = x
- case 27
- f8l.state = x
- f8l1.state = x
- f8l2.state = x
- f8l3.state = x
- case 28
- f9l.state = x
- f9l2.state = x
- end select
- end sub
- Sub AdvFlash(nr, value) 'this sucks a lot. Will remake later using arrays.
- ' if value > lastmod(nr) then 'dynamic Fading 'meh
- ' advFlashBool nr, True
- ' elseif value < lastmod(nr) Then
- ' advFlashBool nr, False
- ' end if
- ' LastMod(nr) = value
- dim i
- ' i = value * 0.00392 'convert integer to percent
- i = (value * 0.00392) +0.1125 'convert integer to percent then + 11%
- ' i = (value + 254) / 510 'different formula (0.5 intensity min, 1 max)
- ' i = ((value /300) + 0.15)
- ' i = value
- if value = 0 then advFlashBool nr, False else advFlashBool nr, True
- select case nr
- case 17
- f1l.intensity = fIntensity(nr, 0) * i
- ' f1l.intensityscale = 1
- f1l2.intensity = fIntensity(nr, 1) * i
- ' f1l2.intensityscale = 1
- ' f1l.intensityscale = i
- ' f1l.fadespeedup = fFadeSpeedUp(17, 0)*i
- ' f1l.fadespeeddown = fFadeSpeedDown(17, 0)*i
- '' f1l2.intensityscale = i
- ' f1l2.fadespeedup = fFadeSpeedUp(17, 1)*i
- ' f1l2.fadespeeddown = fFadeSpeedDown(17, 1)*i
- case 18
- ' f2l.intensityscale = i
- f2l.intensity = fIntensity(nr, 0) * i
- f2l.intensityscale = 1
- ' f2l.fadespeedup = fFadeSpeedUp(18, 0)*i
- ' f2l.fadespeeddown = fFadeSpeedDown(18, 0)*i
- case 19
- ' f3l.intensityscale = i
- f3l.intensity = fIntensity(nr, 0) * i
- ' f3l.intensityscale = 1
- ' f3l.fadespeedup = fFadeSpeedUp(19, 0)*i
- ' f3l.fadespeeddown = fFadeSpeedDown(19, 0)*i
- case 20
- ' if value < 5 then
- ' F4L.state = 0
- ' else
- ' F4L.state = 1
- ' end if
- f4l.intensity = fIntensity(nr, 0) * i
- ' f4l.intensityscale = 1
- ' f4l.intensityscale = i
- ' f4l.fadespeedup = fFadeSpeedUp(20, 0)*i
- ' f4l.fadespeeddown = fFadeSpeedDown(20, 0)*i
- case 21
- f5l.intensity = fIntensity(nr, 0) * i
- ' f5l.intensityscale = 1
- ' f5l.intensityscale = i
- ' f5l.fadespeedup = fFadeSpeedUp(21, 0)*i
- ' f5l.fadespeeddown = fFadeSpeedDown(21, 0)*i
- f5l2.intensity = fIntensity(nr, 0) * i
- ' f5l2.intensityscale = 1
- ' f5l2.intensityscale = i
- ' f5l2.fadespeedup = fFadeSpeedUp(21, 1)*i
- ' f5l2.fadespeeddown = fFadeSpeedDown(21, 1)*i
- case 25
- f6l.intensity = fIntensity(nr, 0) * i
- ' f6l.intensityscale = 1
- ' f6l.intensityscale = i
- ' f6l.fadespeedup = fFadeSpeedUp(25, 0)*i
- ' f6l.fadespeeddown = fFadeSpeedDown(25, 0)*i
- case 26
- f7l.intensity = fIntensity(nr, 0) * i
- ' f7l.intensityscale = 1
- ' f7l.intensityscale = i
- '
- ' f7l.fadespeedup = fFadeSpeedUp(26, 0)*i
- ' f7l.fadespeeddown = fFadeSpeedDown(26, 0)*i
- case 27
- f8l.intensity = fIntensity(nr, 0) * i
- ' f8l.intensityscale = 1
- f8l1.intensity = fIntensity(nr, 1) * i
- ' f8l1.intensityscale = 1
- F8L2.intensity = fIntensity(nr, 2) * i
- ' F8L2.intensityscale = 1
- F8L3.intensity = fIntensity(nr, 3) * i
- ' F8L3.intensityscale = 1
- '' f8l.intensityscale = i
- ' f8l.fadespeedup = fFadeSpeedUp(27, 0)*i
- ' f8l.fadespeeddown = fFadeSpeedDown(27, 0)*i
- '' f8l1.intensityscale = i
- ' f8l1.fadespeedup = fFadeSpeedUp(27, 1)*i
- ' f8l1.fadespeeddown = fFadeSpeedDown(27, 1)*i
- '' F8L2.intensityscale = i
- ' F8L2.fadespeedup = fFadeSpeedUp(27, 2)*i
- ' F8L2.fadespeeddown = fFadeSpeedDown(27, 2)*i
- '' f8l3.intensityscale = i
- ' f8l3.fadespeedup = fFadeSpeedUp(27, 3)*i
- ' f8l3.fadespeeddown = fFadeSpeedDown(27, 3)*i
- Case 28
- f9l.intensity = fIntensity(nr, 0) * i
- ' f9l.intensityscale = 1
- f9l2.intensity = fIntensity(nr, 1) * i
- ' f9l2.intensityscale = 1
- '
- '' f9l.intensityscale = i
- ' f9l.fadespeedup = fFadeSpeedUp(28, 0)*i
- ' f9l.fadespeeddown = fFadeSpeedDown(28, 0)*i
- '' f9l2.intensityscale = i
- ' f9l2.fadespeedup = fFadeSpeedUp(28, 1)*i
- ' f9l2.fadespeeddown = fFadeSpeedDown(28, 1)*i
- end select
- End Sub
- 'ball tracking
- Sub MysteryKick(enabled): if bsMystery.hasball then bip = bip + 1 end if: bsmystery.ExitSol_On : end sub
- Sub MapKick(enabled): if bsMap.hasball then bip = bip + 1 end if : bsmap.ExitSol_On : end sub
- 'Sub VolcanoKick(enabled): bsVolcano.SolOut True : if bsVolcano.balls > 0 then bip = bip + 1 end if : end sub
- sub tBIP_timer()
- me.text = BIP
- end sub
- Sub RightGateOn(Enabled)
- If Enabled Then
- gate4.open = True
- Else
- gate4.open = False
- End If
- End Sub
- Sub LeftGateOn(Enabled)
- If Enabled Then
- gate2.open = True
- Else
- gate2.open = False
- End If
- End Sub
- Sub Auto_Plunger(Enabled)
- If Enabled Then
- AutoPlunger.Fire
- PlaySound SoundFX("fx_solenoid",DOFContactors)
- else
- AutoPlunger.Pullback
- End If
- End Sub
- Sub Kick_Back(Enabled)
- If Enabled Then
- KickBack.Fire
- PlaySound SoundFX("fx_solenoid",DOFContactors)
- else
- KickBack.Pullback
- End If
- End Sub
- Sub SolRelease(Enabled) 'ball tracking
- If Enabled And bsTrough.Balls > 0 Then
- vpmTimer.PulseSw 31
- bsTrough.ExitSol_On
- bip = bip + 1
- End If
- End Sub
- 'Pop up
- Sub SolPopUp(Enabled)
- if bsAmyVuk.hasball then bip = bip + 1
- If Enabled Then
- bsAmyVuk.SolOutAlt 0
- ' bsAmyVuk.SolOut 'Up
- bsAmyVuk.ExitSol_On
- Else
- bsAmyVuk.SolOutAlt 1 'Down
- End If
- End Sub
- ' (Public) .solOut - Fire the primary exit kicker. Ejects ball if one is present.
- ' (Public) .solOutAlt - Fire the secondary exit kicker. Ejects ball with alternate forces if present.
- 'Pop down
- Sub SolPopDown(Enabled)
- if bsAmyVuk.hasball then bip = bip + 1
- If Enabled Then
- bsAmyVuk.SolOutAlt 1'down
- bsAmyVuk.ExitSol_On
- 'bsAmyVuk.ExitSol_On
- Else
- bsAmyVuk.ExitSol_On 'Up
- End If
- End Sub
- ' Left Post
- Sub SolLeftpost(Enabled)
- If Enabled Then
- LeftPost.IsDropped = 0
- LeftPost_invis.IsDropped = 0
- Else
- LeftPost.IsDropped = 1
- LeftPost_invis.IsDropped = 1
- End If
- End Sub
- Sub AmyRampTrigger_Hit()
- activeball.vely = activeball.vely * 0.5
- activeball.velx = activeball.velx * 0.5
- playsound "drop_mono", 0, 0.2, -0.1
- End Sub
- ' Top Post - Lock
- Sub SolTopPost(Enabled)
- If Enabled Then
- TopPost.IsDropped = 1
- Else
- TopPost.IsDropped = 0
- End If
- End Sub
- 'Grey Gorilla Scripting
- '-===================
- 'go5 is -10
- 'g02 is 0
- 'go3 is 10
- Dim Gordest
- dim GorAngle
- Gordest = 0
- gorangle = 0 'starting angle
- Sub GorillaTimer_Timer()
- If Gordest = 0 and GorAngle > 0 Then 'If 0
- GorAngle = GorAngle - 4 'formerly 2
- ElseIf Gordest = 0 and GorAngle < 0 Then
- GorAngle = GorAngle + 4
- ElseIf Gordest = 10 and GorAngle < 10 Then 'if 10
- GorAngle = GorAngle + 4
- Elseif Gordest = -10 and GorAngle > -10 Then 'if -10
- GorAngle = GorAngle - 4
- Else
- ' me.Enabled = 0
- End If
- ' textbox1.text = gorangle
- Gorilla.objRotZ = GorAngle
- End Sub
- sub GorillaTimerShutoff_Timer()
- GorillaTimer.enabled = 0
- me.enabled = 0
- end sub
- ' Gorilla Right
- Sub GorillaRight(Enabled) '...left '-76 start -105 end
- If Enabled Then
- GorillaTimer.enabled = 1
- GorillaTimerShutoff.interval = 10000
- GorillaTimerShutoff.enabled = 1
- ' GiON 'is this necessary?
- PlaySound SoundFx("Solenoid",DOFContactors)
- ' GorillaTimer.Enabled = 1
- GoFlipperRight.Startangle = 76
- GoFlipperLeft.RotateToEnd
- GoFlipperRight.RotateToStart
- GoFlipperLeft.startangle = -100
- Gordest = 0
- ' Textbox2.text = "ENABLED"
- Else
- ' giOFF
- PlaySound SoundFx("Solenoidoff",0)
- GoFlipperLeft.RotateToStart
- GorDest = -10
- ' Textbox2.text = "0"
- End If
- End Sub
- ' Gorilla Left
- Sub GorillaLeft(Enabled) '...right '76 start 105 end
- If Enabled Then
- GorillaTimer.enabled = 1
- GorillaTimerShutoff.interval = 10000
- GorillaTimerShutoff.enabled = 1
- PlaySound SoundFx("Solenoid",DOFContactors)
- GoFlipperRight.RotateToEnd
- GoFlipperLeft.Startangle = -76
- GoFlipperLeft.RotateToStart
- GoFlipperRight.startangle = 100
- Gordest = 0
- ' Textbox3.text = "ENABLED"
- Else
- PlaySound SoundFx("Solenoidoff",0)
- GoFlipperRight.RotateToStart
- Gordest = 10
- ' Textbox3.text = "0"
- End If
- End Sub
- '=-======================
- '------
- '0999999999999
- '36444444444444
- '===================
- 'Disconnected Flippers
- dim bip:bip = 0 'Click here to collapse this section
- dim discoflips:discoflips = 0
- '1- Special Flipper Behaviors
- sub DisconnectFlippers 'engages special flipper polling behavior, call after flippers kick out / ball leaves shooter lane
- LightSol_L.color = RGB(0, 255, 0)
- LightSol_L1.color = RGB(0, 255, 0)
- LightSol_R.color = RGB(0, 255, 0)
- LightSol_L.colorfull = RGB(55, 255, 55)
- LightSol_L1.colorfull = RGB(55, 255, 55)
- LightSol_R.colorfull = RGB(55, 255, 55)
- DiscoFlips = 1
- ' controller.switch(swLLFlip) = True
- ' pollstep = 0
- Clockstep = 0
- if FastFlips = 0 then clockstep = 20
- ' pollflippers.interval = 128 'idk
- if leftflipperon = 1 Then 'When going from green to red, sometimes flipper gets stuck on 'todo fix this nonsense
- ' leftflipper.rotatetoend
- Else
- leftflipper.rotatetostart
- ULeftFlipper.rotatetostart
- leftflipper.eostorque = defaultEOS
- end if
- if rightflipperon = 1 Then 'When going from green to red
- ' rightflipper.rotatetoend
- Else
- rightflipper.rotatetostart
- rightflipper.eostorque = defaultEOS
- end if
- end sub
- sub DisconnectFlippers2 'Called from flipper up, no adjustments
- LightSol_L.color = RGB(0, 255, 0)
- LightSol_L1.color = RGB(0, 255, 0)
- LightSol_R.color = RGB(0, 255, 0)
- LightSol_L.colorfull = RGB(55, 255, 55)
- LightSol_L1.colorfull = RGB(55, 255, 55)
- LightSol_R.colorfull = RGB(55, 255, 55)
- DiscoFlips = 1
- ' controller.switch(swLLFlip) = True
- ' pollstep = 0
- Clockstep = 0
- end sub
- sub DefaultFlipperControl 'returns everything back to default
- if leftflipperon = 1 Then 'When going from green to red, sometimes flipper gets stuck on
- controller.switch(swLLFlip) = True
- Else
- controller.switch(swLLFlip) = False
- end if
- if rightflipperon = 1 Then 'When going from green to red
- controller.switch(swLRFlip) = True
- Else
- controller.switch(swLRFlip) = False
- end if
- LightSol_L.color = RGB(255, 0, 0)
- LightSol_L1.color = RGB(255, 0, 0)
- LightSol_R.color = RGB(255, 0, 0)
- LightSol_L.colorfull = RGB(255, 55, 55)
- LightSol_L1.colorfull = RGB(255, 55, 55)
- LightSol_R.colorfull = RGB(255, 55, 55)
- DiscoFlips = 0
- if FastFlips = 0 then clockstep = 20
- ' discolamps = 1 'changelane thing ignore me
- ' pollstep = 0
- end sub
- sub tbnf_timer()
- me.text = "DiscoFlips:" & discoflips & vbnewline & "polltimer: " & polltimer.enabled & vbnewline & "clockstep:" & clockstep & vbnewline & " DiscoVar:" & DisconnectFlippersV & vbnewline & " tiltsol:" & FlippersEnabled
- end sub
- '2 - The timer itself
- 'dim SolLon, SolRon, SolULon
- DefaultFlipperControl
- dim Clockstep:clockstep = 0
- dim BallSearchStep:BallSearchStep = 0
- Sub PollTimer_Timer()
- Select Case Clockstep
- case 0 'send L
- controller.switch(118) = True
- ' if discoflips = 1 then discoflips = 2 'lag compensation to prevent stickiness
- clockstep = 1
- ' light1.state = 1
- ' ballsearchstep = ballsearchstep + 1
- case 1 'receive L and poll
- controller.switch(118) = False
- if bip = 0 Then 'if no balls are in play, disable this sub
- Clockstep = 9
- elseif SolULon Then
- TiltSol(True) 'returns clockstep to 0
- elseif not SolULon Then 'if no solenoid callback,
- if FlippersEnabled = True Then TiltSol(False) 'tilt 'returns clockstep to 0
- End if
- ' if ballsearchstep > 10 then ballsearchstep = 0: ballsearch : end if
- Case 9 'disabled, red
- if bip = 0 then
- DefaultFlipperControl
- Else
- ' DisconnectFlippers 'this will return clockstep back to 0
- DisconnectFlippersV = 1
- ' clockstep = 0'this will return clockstep back to 0
- PollTimer.interval = 200
- end if
- Case 15 ' ballsearch case
- DefaultFlipperControl
- if BIP = 0 then clockstep = 0
- Case 20 ' Disabled
- end Select
- end sub
- Sub Ballsearch 'uses getballs to detect stuck balls and returns flipper controls so fliptronics can clear them (Hopefully seamlessly)
- ' exit sub
- if BIP = 0 then exit Sub 'this whole sub is unused on this table
- dim BOT, x, d, xx, yy
- BOT = GetBalls
- If UBound(BOT) = 0 Then tBallstuck.text = "ubound = " & Ubound(bot) & "exitsub" : Exit Sub : End If
- for x = 0 to Ubound(BOT)
- On Error Resume Next
- xx = BOT(x).velx
- yy = BOT(x).vely
- d = cInt(xx * yy)
- if d > 2 then
- exit for 'can you do this in a for loop?
- Else
- ' Clockstep = 15
- end if
- next
- tBallstuck.text = "balls: " & Ubound(BOT) & " vel:" & d
- tBallstuck.timerenabled = 1
- End Sub
- sub tBallstuck_Timer : me.timerenabled = 0 : me.text = " " : end sub 'reset textbox
- Sub RollingUpdateXX()
- 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
- '2 - Tilt Sub
- dim FlippersEnabled
- Sub TiltSol(Enabled) 'designed to work off a solenoid that stays on, so FALSE = tilted
- FlippersEnabled = Enabled 'handles flippers
- DisconnectFlippers
- PollTimer.interval = 200
- if Enabled Then
- ' textboxTILT.text = " "
- vpmnudge.solgameon true
- Elseif not Enabled Then
- ' textboxTILT.text = "TILT"
- DefaultFlipperControl 'necessary for fliptronics
- polltimer.enabled = 0 'renabled by: drain when BIP = 0, LPF lamps, left ramp flasher?
- PollTimer.interval = 64 'fast polling when tilted
- vpmnudge.solgameon false
- if leftflipper.startangle > leftflipper.endangle Then
- if leftflipper.currentangle < leftflipper.startangle then leftflipper.rotatetostart : leftflippersound 0 : end if
- elseif leftflipper.startangle < leftflipper.endangle Then
- if leftflipper.currentangle > leftflipper.startangle then leftflipper.rotatetostart : leftflippersound 0 : end If
- end If
- if rightflipper.startangle > rightflipper.endangle Then
- if rightflipper.currentangle < rightflipper.startangle then rightflipper.rotatetostart : rightflippersound 0 : end if
- elseif rightflipper.startangle < rightflipper.endangle Then
- if rightflipper.currentangle > rightflipper.startangle then rightflipper.rotatetostart : rightflippersound 0 : end If
- end If
- ULeftFlipper.rotatetostart
- end if
- clockstep = 0
- if FastFlips = 0 then clockstep = 20
- end sub
- '#end region
- '-----end disconnect flippers
- dim DisconnectFlippersV: DisconnectFlippersV = 0
- 'flippersenabled = from the old tilt routine (reliant on sol callbacks so not hugely relevant here)
- sub flipnf(LR, DU) 'object, left-right, downup 'using object lags this script to hell, don't do it
- ' if DU = 1 then if DisconnectFlippersV = 1 then DisconnectFlippersV = 0 :DisconnectFlippers2 'called from flipper up only
- if DisconnectFlippersV = 1 then DisconnectFlippersV = 0 :DisconnectFlippers2 'called from flipper up and flipper down
- if discoflips = 1 then
- if LR = 0 Then 'left flipper
- if DU = 1 then
- If FlippersEnabled = True then
- leftflipper.rotatetoend
- ULeftFlipper.rotatetoend
- LeftFlipperSound 1
- end if
- controller.Switch(swLLFlip) = True
- Elseif DU = 0 then
- If FlippersEnabled = True then
- leftflipper.rotatetoStart
- ULeftFlipper.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
- RightFlipper.rotatetoend
- RightFlipperSound 1
- end if
- controller.Switch(swLRFlip) = True
- Elseif DU = 0 then
- If FlippersEnabled = True then
- RightFlipper.rotatetoStart
- RightFlipperSound 0
- end if
- controller.Switch(swLRFlip) = False
- end if
- end if
- end if
- end sub
- sub flipnfSOL(LR, DU) 'flipnf without the switches, no tilt cutoff
- if discoflips = 0 then 'whole sub conditional on discoflips, not flippersenabled
- if LR = 0 Then 'left flipper
- if DU = 1 then
- leftflipper.rotatetoend
- LeftFlipperSound 1
- Elseif DU = 0 then
- leftflipper.rotatetoStart
- ULeftFlipper.rotatetostart
- LeftFlipperSound 0
- end if
- elseif LR = 1 then ''right flipper
- if DU = 1 then
- RightFlipper.rotatetoend
- RightFlipperSound 1
- Elseif DU = 0 then
- RightFlipper.rotatetoStart
- RightFlipperSound 0
- end if
- elseif LR = 2 then ''ULeftFlipper
- if DU = 1 then
- ULeftFlipper.rotatetoend
- Elseif DU = 0 then
- ULeftFlipper.rotatetoStart
- end if
- 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("fx_Flipperup",DOFContactors), 1, 0.5, -0.02 'flip 'name,loopcount,volume,pan,randompitch
- Else
- if LeftFlipper.CurrentAngle = LeftFlipper.StartAngle then
- LeftFlipper.eostorque = defaultEOS
- Else
- playsound SoundFX("fx_Flipperdown",DOFContactors), 1, 0.8, -0.01 'return
- LeftFlipper.eostorque = defaultEOS
- end if
- end if
- end sub
- sub RightFlipperSound(updown)
- if updown = 1 Then
- playsound SoundFX("fx_Flipperup",DOFContactors), 1, 0.5, 0.02 'flip
- Else
- if RightFlipper.CurrentAngle = RightFlipper.StartAngle then
- RightFlipper.eostorque = defaultEOS
- Else
- playsound SoundFX("fx_Flipperdown",DOFContactors), 1, 0.8, 0.01 'return
- RightFlipper.eostorque = defaultEOS
- end if
- end if
- end sub
- '====================
- ' -NEW HARD
- ' FLIPS
- '====================
- 'just switches EOStorque when hit
- 'const HardFlips = 1 'move me!
- dim defaultEOS, hardEOS
- defaultEOS = LeftFlipper.eostorque
- hardEOS = 2200 / LeftFlipper.strength 'eos equivalent to 2200 strength
- if HardFlips = 0 then TriggerLF.enabled = 0 : TriggerRF.enabled = 0 end if
- Sub TriggerLF_Hit()
- dim finalspeed
- finalspeed = SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
- If finalspeed > 3 then
- LeftFlipper.eostorque = hardEOS
- End if
- end sub
- Sub TriggerRF_Hit()
- dim finalspeed
- finalspeed = SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
- If finalspeed > 3 then
- RightFlipper.eostorque = hardEOS
- End if
- end sub
- '********************
- ' Special JP Flippers
- '********************
- SolCallback(sLRFlipper) = "SolRFlipper"
- SolCallback(sLLFlipper) = "SolLFlipper"
- SolCallback(sULFlipper) = "SolULFlipper"
- dim SolLon, SolRon, SolULon
- Sub SolLFlipper(Enabled)
- If Enabled Then
- ' PlaySound SoundFX("fx_flipperup",DOFContactors), 0, 0.4, -0.05, 0.11
- ' LeftFlipper.RotateToEnd
- flipnfSOL 0, 1
- LightSol_L.state = 1
- Else
- ' PlaySound SoundFX("fx_flipperdown",DOFContactors), 0, 0.4, -0.05, 0.11
- ' LeftFlipper.RotateToStart
- LightSol_L.state = 0
- flipnfSOL 0, 0
- End If
- SolLon = Enabled
- End Sub
- 'SoundFX("fx_flipperup",DOFContactors)
- Sub SolRFlipper(Enabled)
- If Enabled Then
- ' PlaySound SoundFX("fx_flipperup",DOFContactors), 0, 0.4, 0.05, 0.15
- ' RightFlipper.RotateToEnd
- LightSol_R.state = 1
- flipnfSOL 1, 1
- Else
- ' PlaySound SoundFX("fx_flipperdown",DOFContactors), 0, 0.4, 0.05, 0.15
- ' RightFlipper.RotateToStart
- LightSol_R.state = 0
- flipnfSOL 1, 0
- End If
- SolRon = Enabled
- End Sub
- 'flipnf
- Sub SolULFlipper(Enabled)
- If Enabled Then
- ' PlaySound "fx_flipperup", 0, 0.5, -0.06, 0.15
- ' ULeftFlipper.RotateToEnd
- LightSol_L1.state = 1
- flipnfSOL 2, 1
- Else
- ' PlaySound "fx_flipperdown", 0, 0.5, -0.06, 0.15
- ' ULeftFlipper.RotateToStart
- LightSol_L1.state = 0
- flipnfSOL 2, 0
- End If
- SolUlon = Enabled
- End Sub
- '================VP10 Fading Lamps Script
- Dim LampState(200), FadingLevel(200)
- Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
- InitLamps()
- LampTimer.Interval = 16
- 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 UpdateLamps
- ' NFadeL 11, L11
- NFadeLwf 11, L11, l11f
- ' NFadeL 12, L12
- NFadeLwf 12, L12, l12f
- NFadeL 13, L13
- ' NFadeL 14, L14
- NFadeLwf 14, L14, l14f
- ' NFadeL 15, L15
- NFadeLwf 15, L15, l15f
- ' NFadeL 16, L16 'A
- ' NFadeL 17, L17 'M
- ' NFadeL 18, L18 'Y
- NFadeLwF 16, L16, L16F 'A
- NFadeLwF 17, L17, L17F 'M
- NFadeLwF 18, L18, L18F 'Y
- NFadeL 21, L21
- NFadeL 22, L22
- ' NFadeL 23, L23
- NFadeLwF 23, l23, l23f
- NFadeL 24, L24
- NFadeL 25, L25
- NFadeL 26, L26
- NFadeL 27, L27
- NFadeLwF 28, L28, l28f
- NFadeLwf 31, L31, l31f
- NFadeL 32, L32
- NFadeL 33, L33
- ' NFadeLm 32, L32L
- NFadeLm 33, L33L
- NFadeL 34, L34
- NFadeL 35, L35
- NFadeL 36, L36
- NFadeL 37, L37
- NFadeLm 38, L38
- NFadeLm 38, L38L
- NFadeL 41, L41
- NFadeL 42, L42
- NFadeLwF 43, L43, L43f
- NFadeLwF 44, L44, L44f
- NFadeLwF 45, L45, l45f
- NFadeL 46, L46
- NFadeLwF 47, L47, l47f
- NFadeLwF 48, L48, l48f
- NFadeL 51, L51
- NFadeL 52, L52
- NFadeL 53, L53
- NFadeL 54, L54
- NFadeL 55, L55
- ' NFadeL 56, L56
- NFadeLwF 56, L56, L56F
- NFadeL 57, L57
- ' NFadeLm 58, L58
- ' Flashb 58, L58
- NFadeLwF 58, L58, L58F
- ' l58f.intensityscale = 0
- NFadeLwf 61, L61, l61f
- NFadeLA 62, L62
- NFadeL 63, L63
- NFadeL 64, L64
- NFadeL 65, L65
- NFadeL 66, L66
- NFadeL 67, L67
- NFadeLwF 68, L68, l68f
- NFadeLwF 71, L71, l71f
- NFadeLwf 72, L72, l72f
- NFadeLwf 73, L73, l73f
- ' NFadeLA 74, L74 'right lock
- NFadeLwFa 74, L74, l74f
- NFadeL 75, L75
- NFadeL 76, L76
- NFadeL 77, L77
- NFadeL 78, L78
- NFadeLm 81, L81
- NFadeLm 81, L81l 'H
- NFadeL 82, L82
- ' NFadeL 83, L83
- ' NFadeL 84, L84
- ' NFadeL 85, L85
- NFadeLwF 83, L83, L83f
- NFadeLwF 84, L84, L84f
- NFadeLwF 85, L85, L85f
- NFadeL 86, L86 'Shoot Again
- ' NFadeL 87, L87 'Not used
- ' NFadeL 88, L88 'Start Button
- 'Flashers
- '117," 'Amy Flasher
- '118," 'Left Ramp Flasher
- '119," '2-Way Popper Flasher
- '120," 'SkillShot Flasher
- '121," 'Gray Gorilla Flasher f5L
- '125," 'Lower Right Flasher f6L
- '126," 'Right Ramp Flasher F7L
- '127," 'Volcano Flasher F8L
- '128," 'Perimeter Defense Flasher
- '
- ' NFadeLMB 117, F1L
- ' NFadeLMB 117, F1L2 'Amy
- ' NFadeLBB 118, F2L
- ' NFadeLBB 119, F3L
- '' NFadeL 120, F4L
- '
- ' NFadeLm 121, F5L 'Gorilla
- ' NFadeLm 121, F5L2 'Gorilla
- '
- '' NFadeL 125, F6L
- ' NFadeL 126, F7L
- '
- '' NFadeObj 127, VolcanoPrim, "volcano_lavaoff", "volcano_lavaon"
- ' NFadeLMB 127, F8L 'Volcano
- ' NFadeLMB 127, F8L1
- ' NFadeLMB 127, F8L2
- ' NFadeLMB 127, F8L3
- '
- '
- ' NFadeLMb 128, F9L 'Perimeter Defense Flasher
- ' NFadeLMb 128, F9L2
- '
- ' NFadeL 120, F4L
- '
- ' NFadeLbb 125, F6L
- 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.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
- 'Walls
- ' 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
- 'Light with flasher
- Sub NFadeLwF(nr, object1, object2)
- Select Case FadingLevel(nr)
- Case 0:object2.intensityscale = 0
- Case 1:object2.intensityscale = 1
- Case 4:object1.state = 0:FadingLevel(nr) = 16
- Case 5:object1.state = 1:FadingLevel(nr) = 6':TextBox4.text = object1.fadespeedup 'to 6
- '0.125 up, 0.125 down
- Case 6, 7, 8, 9, 10, 11, 12:If object2.intensityscale < 1 then Object2.intensityscale = object2.intensityscale + 0.125 else object2.intensityscale = 0.875 end if:FadingLevel(nr) = FadingLevel(nr) + 1
- Case 13:If object2.intensityscale < 1 then Object2.intensityscale = object2.intensityscale + 0.125 end if:FadingLevel(nr) = 1':TextBox4.text = "Case 11"
- Case 16, 17, 18, 19, 20, 21, 22:If object2.intensityscale > 0 then Object2.intensityscale = object2.intensityscale + -0.125 else object2.intensityscale = 0.125 end if:FadingLevel(nr) = FadingLevel(nr) + 1
- Case 23:If object2.intensityscale > 0 then Object2.intensityscale = object2.intensityscale + -0.125 end if:FadingLevel(nr) = 0':TextBox4.text = "Case 26"
- End Select
- End Sub
- Sub NFadeLwFa(nr, object1, object2)
- Select Case FadingLevel(nr)
- Case 0:object2.intensityscale = 0
- Case 1:object2.intensityscale = 1
- Case 4:object1.state = 0:FadingLevel(nr) = 16
- Case 5:object1.state = 1:FadingLevel(nr) = 6
- '0.125 up, 0.125 down
- Case 6, 7, 8, 9, 10, 11, 12:If object2.intensityscale < 1 then Object2.intensityscale = object2.intensityscale + 0.125 else object2.intensityscale = 0.875 end if:FadingLevel(nr) = FadingLevel(nr) + 1
- Case 13:If object2.intensityscale < 1 then Object2.intensityscale = object2.intensityscale + 0.125 end if:FadingLevel(nr) = 1':TextBox4.text = "Case 11"
- Case 16, 17, 18, 19, 20, 21, 22:If object2.intensityscale > 0 then Object2.intensityscale = object2.intensityscale + -0.125 else object2.intensityscale = 0.125 end if:FadingLevel(nr) = FadingLevel(nr) + 1
- Case 23:If object2.intensityscale > 0 then Object2.intensityscale = object2.intensityscale + -0.125 end if:FadingLevel(nr) = 0':TextBox4.text = "Case 26"
- End Select
- End Sub
- Sub NFadeLB(nr, object) 'blinks
- Select Case FadingLevel(nr)
- Case 4:object.state = 0:FadingLevel(nr) = 0
- Case 5:object.state = 2:FadingLevel(nr) = 6
- case 6:object.state = 1::FadingLevel(nr) = 1':TextBox4.text = "AmyFade" 'lil extra before fading
- End Select
- End Sub
- Sub NFadeLBB(nr, object) 'blinks
- Select Case FadingLevel(nr)
- Case 4:object.state = 0:FadingLevel(nr) = 0
- Case 5:object.state = 2:FadingLevel(nr) = 1
- End Select
- End Sub
- Sub NFadeLA(nr, object) 'Light with extra diverter scripts 'reused for polltimer
- Select Case FadingLevel(nr)
- Case 4:object.state = 0:FadingLevel(nr) = 0
- Case 5:object.state = 1:FadingLevel(nr) = 1:if polltimer.enabled = 0 then polltimer.enabled = 1':LockIsLit = 1:AmyShot=0
- 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, Blinks
- Select Case FadingLevel(nr)
- Case 4:object.state = 0
- Case 5:object.state = 2
- case 6:object.state = 1 'lil extra before fading
- End Select
- End Sub
- Sub NFadeLmf(nr, object) ' used for multiple lights working off FadeObj or FadePrim
- Select Case FadingLevel(nr)
- Case 1:object.state = 1
- Case 7:object.state = 0
- End Select
- End Sub
- Sub NFadeLF(nr, object) ' used for multiple lights working off FadeObj or FadePrim
- Select Case FadingLevel(nr)
- Case 1:object.state = 1
- Case 7:object.state = 0
- End Select
- End Sub
- Sub FadeLm(nr, a, b) 'Old
- Select Case LampState(nr)
- Case 2:b.state = 0
- Case 3:b.state = 1
- Case 4:a.state = 0
- Case 5:b.state = 1
- Case 6:a.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) 'a = on b = fade a little c = fade a lot d = nothin'
- 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 'fading to off...
- Case 5:object.image = a 'ON
- Case 9:object.image = c 'fading...
- Case 13:object.image = d 'Off
- End Select
- End Sub
- ' primmy.size_x = 125
- ' primmy.size_y = 125
- 'Unused, but a cool thing for primitive flashers in the vein of Ramp flashers (scaling primitives instead of swapping to smaller flasher images)
- Sub FadePrim(nr, object, a) 'a is Size 'a = on b = fade a little c = fade a lot d = nothin'
- Select Case FadingLevel(nr)
- Case 1:object.size_x = a +5: object.size_y = a +5: FadingLevel(nr) = FadingLevel(nr) + 1':TextBox4.text = "CASE1" 'Jitter while on (experimental)
- Case 2:object.size_x = a -5: object.size_y = a -5: FadingLevel(nr) = 1':TextBox4.text = "CASE2"
- Case 4:object.size_x = a * 0.9: object.size_y = a * 0.9:FadingLevel(nr) = 6 'fading to off... GOTO 6
- Case 5:object.visible = 1:object.size_x = a: object.size_y = a: FadingLevel(nr) = 1': TextBox4.text = "ON" 'ON
- Case 6, 7, 8, 9, 10, 11, 12:object.size_x = a * 0.95: object.size_y = a * 0.95: FadingLevel(nr) = FadingLevel(nr) + 1 'Fading
- ' Case 9:object.image = c:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
- ' Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
- Case 13:object.visible = 0:FadingLevel(nr) = 0': TextBox4.TEXT = " " 'Off
- ' Case 14:object.size_x = a +1: object.size_y = a +1: FadingLevel(nr) = FadingLevel(nr) + 1 'Jitter while on (experimental)
- ' Case 15:object.size_x = a -1: object.size_y = a -1: FadingLevel(nr) = 14
- 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
- ' Object.IntensityScale = 1
- End Sub
- Sub FlashB(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
- FadingLevel(nr) = FadingLevel(nr) + 1
- Case 6
- 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
- ' Object.IntensityScale = 1
- End Sub
- Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
- Object.IntensityScale = FlashLevel(nr)
- ' Object.IntensityScale = 1
- End Sub
- ' Desktop Objects: Reels & texts (you may also use lights on the desktop)
- ' Reels
- Sub FadeR(nr, object)
- Select Case FadingLevel(nr)
- Case 4:object.SetValue 1:FadingLevel(nr) = 6 'fading to off...
- Case 5:object.SetValue 0:FadingLevel(nr) = 1 'ON
- Case 6, 7, 8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
- Case 9:object.SetValue 2:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
- Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
- Case 13:object.SetValue 3:FadingLevel(nr) = 0 'Off
- End Select
- End Sub
- Sub FadeRm(nr, object)
- Select Case FadingLevel(nr)
- Case 4:object.SetValue 1
- Case 5:object.SetValue 0
- Case 9:object.SetValue 2
- Case 3:object.SetValue 3
- End Select
- End Sub
- 'Texts
- Sub NFadeT(nr, object, message)
- Select Case FadingLevel(nr)
- Case 4:object.Text = "":FadingLevel(nr) = 0
- Case 5:object.Text = message:FadingLevel(nr) = 1
- End Select
- End Sub
- Sub NFadeTm(nr, object, b)
- Select Case FadingLevel(nr)
- Case 4:object.Text = ""
- Case 5:object.Text = message
- End Select
- 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 = INT(SQR((ball.VelX ^2) + (ball.VelY ^2) ) )
- End Function
- '*****************************************
- ' JP's VP10 Rolling Sounds
- '*****************************************
- Const tnob = 10 ' total number of 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
- 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
- Sub AmyDownRampdrop_Hit():playsound "drop_mono", 0, 0.4, 0.1:End Sub 'name,loopcount,volume,pan,randompitch
- 'Sub VukRampEnd_Hit():playsound "Ramp_Hit1", 0, 0.2, 0.1:End Sub 'handled by collection instead
- Sub WireRampTrigger1_Hit():playsound "wireramp1", 0, 0.2, Pan(ActiveBall):end sub
- Sub WireRampTrigger2_Hit():playsound "wireramp1", 0, 0.2, Pan(ActiveBall):end sub
- Sub WireRampTrigger3_Hit():playsound "wireramp1", 0, 0.4, Pan(ActiveBall):end sub
- Sub AmyDownRampTrigger_Hit()
- AmyDownRampDrop.Enabled=0
- me.timerenabled=1
- End Sub
- Sub AmyDownRampTrigger_Timer()
- AmyDownRampDrop.Enabled=1
- me.Timerenabled=0
- End Sub
- Sub RightRampdrop_Hit():playsound "drop_mono", 0, 0.5, 0.05:End Sub
- 'Sub RightRampEnd_Hit():playsound "Ramp_Hit1", 0, 0.3, 0.05:End Sub 'handled by collection instead
- Sub RightRampTrigger_Hit()
- RightRampDrop.Enabled=0
- me.timerenabled=1
- End Sub
- Sub RightRampTrigger_Timer()
- RightRampDrop.Enabled=1
- me.Timerenabled=0
- End Sub
- Sub LeftRampdrop_Hit():playsound "drop_mono", 0, 0.3, -0.03:End Sub
- 'Collection Sounds
- Sub Pins_Hit (idx)
- PlaySound "pinhit_low", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
- End Sub
- Sub Targets_Hit (idx)
- PlaySound SoundFx("plastichit",DOFContactors), 0, Vol(ActiveBall) * 0.2, Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
- End Sub
- Sub Metals_Thin_Hit (idx)
- PlaySound "metalhit_thin", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End Sub
- Sub Metals_Medium_Hit (idx)
- PlaySound "metalhit_medium", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End Sub
- Sub MetalWalls_Hit (idx)
- PlaySound "metalhit2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End Sub
- Sub Gates_Hit (idx)
- PlaySound "gate4", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End Sub
- Sub Rubbers_O_Hit (idx)
- PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End Sub
- Sub Rubbers_U_Hit (idx)
- PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- 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), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End if
- If finalspeed >= 6 AND finalspeed <= 20 then
- RandomSoundRubber()
- End If
- End Sub
- Sub Posts_Hit(idx)
- dim finalspeed
- finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
- If finalspeed > 16 then
- PlaySound "fx_rubber2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End if
- If finalspeed >= 6 AND finalspeed <= 16 then
- RandomSoundRubber()
- End If
- End Sub
- Sub RandomSoundRubber()
- Select Case Int(Rnd*3)+1
- Case 1 : PlaySound "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
- 'Flipper Sounds
- Sub ULeftFlipper_Collide(parm)
- RandomSoundFlipper()
- 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), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- Case 2 : PlaySound "flip_hit_2", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- Case 3 : PlaySound "flip_hit_3", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0
- End Select
- End Sub
- '*DOF method for rom controller tables by Arngrim********************
- '*******Use DOF 1**, 1 to activate a ledwiz output*******************
- '*******Use DOF 1**, 0 to deactivate a ledwiz output*****************
- '*******Use DOF 1**, 2 to pulse a ledwiz output**********************
- Sub DOF(dofevent, dofstate)
- If cController>2 Then
- If dofstate = 2 Then
- Controller.B2SSetData dofevent, 1:Controller.B2SSetData dofevent, 0
- Else
- Controller.B2SSetData dofevent, dofstate
- End If
- End If
- End Sub
- '********************************************************************
- Sub Table1_exit()
- Controller.Pause = False
- Controller.Stop
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement