Jump to content



Photo
- - - - -

Can table (rom) light states be used to trigger events?


  • Please log in to reply
23 replies to this topic

#1 TerryRed

TerryRed

    Pinball Fan

  • Silver Supporter
  • 1,976 posts

  • Flag: Canada

  • Favorite Pinball: Too many to choose...

Contributor

Posted 09 November 2017 - 10:56 PM

I'm trying to figure out if it is possible to have "lights" on a table (rom based) used to trigger events. I basically want to have it so that when a table light goes on, then that will trigger a video to play on the backglass (using PinUp Player).  I can do this when a switch is "hit", but what about playfield "Lights".

 

What I use now for switches:

 

 

Sub sw01_Hit
     DTBank4.Hit 4
     if HasPuP Then 
     PuPlayer2.playlistplay("DiscWars")
     End if
End Sub
 
 
 
What I want is something like:
 
 
Sub LampState(104)_On
     DTBank4.Hit 4
     if HasPuP Then 
     PuPlayer2.playlistplay("DiscWars")
     End if
End Sub

 

 

 

Can VPX rom lights be used like this at all in the table script? If so, could someone give an example...



#2 nFozzy

nFozzy

    Pinball Fan

  • Members
  • PipPipPipPip
  • 553 posts

  • Flag: ---------

  • Favorite Pinball: Pinbot

Posted 09 November 2017 - 11:58 PM

Lamp information is held in controller.ChangedLamps. Controller.ChangedLamps(x, 0) is a lamp number, (x, 1) is that lamp's state. This is a 2d array that isn't properly indexed, 'x' just fills up with whatever lamps are in the update queue.

 

This array is then polled by a timer, and wiped once it's read (I think?). So you can only use one lamp scripting solution at a time, whether that be core.vbs's lamp solution (uselamps=1) or your own table-specific one (such as JP's lamp routine).

 

BTW If anyone could hook me up with a link to the full controller object documentation that'd be great. I lost my saved copy in a harddrive crash and can't find it online anywhere.

 

Crosspost, for my workaround solution for UseLamps:

 

If you're talking about UseLamps in core.vbs, you could make a dummy object that spoofs a light object. I made this script for Bord's Pink Panther to get the GI working on the system 80 without having to overhaul all the lamp scripting.

 

'GI uselamps workaround
dim GIlamps : set GIlamps = New GIcatcherobject
Class GIcatcherObject    'object that disguises itself as a light. (UseLamps workaround for System80 GI circuit)
    Public Property Let State(input)
        dim x
        if input = 1 then 'If GI switch is engaged, turn off GI.
            for each x in gi : x.state = 0 : next
        elseif input = 0 then
            for each x in gi : x.state = 1 : next
        end if
        'tb.text = "gitcatcher.state = " & input    'debug
    End Property
End Class

'-------------------------------------
' Map lights into array
' Set unmapped lamps to Nothing
'-------------------------------------

Set Lights(0)  = l0 'ball in play
'Set Lights(1)  = l1 'tilt    
set Lights(1) = GIlamps    'GI circuit

 

UseLamps can also support arrays so you could use

 

Lights(1) = Array(L1, GIlamps)

 

to operate both the normal lamp and the spoof object at the same time.



#3 gtxjoe

gtxjoe

    VPF Veteran

  • VIP
  • 5,152 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness, AbraCadabra



Contributor

Posted 09 November 2017 - 11:59 PM

If the script uses Lamptimer scripting it can be added there.

What table are you working with as each script may be slightly different

#4 nFozzy

nFozzy

    Pinball Fan

  • Members
  • PipPipPipPip
  • 553 posts

  • Flag: ---------

  • Favorite Pinball: Pinbot

Posted 10 November 2017 - 12:12 AM

If the script uses Lamptimer scripting it can be added there.

What table are you working with as each script may be slightly different

Yeah basically this. The answer is to your question is 'yes' but it depends on how the table handles lamp scripting.



#5 TerryRed

TerryRed

    Pinball Fan

  • Silver Supporter
  • 1,976 posts

  • Flag: Canada

  • Favorite Pinball: Too many to choose...

Contributor

Posted 10 November 2017 - 12:13 AM

The table I am currently testing with is Tron Legacy ( rhymes with Fern)   :)

 

 

Man, I was hoping I could use an event based type of sub routine, like we have with switches...

 

 

The intent here guys, is so that with a rom table...maybe I could have some more control over certain that would trigger DOF lighting as well as play video clips only during certain table events....as opposed to just switches or triggers causing them to play.  Like having a Topper picture or video play when Light Cycle multiball is ready. This is more for Rom based tables than it is for VP originals.

 

I'm more familiar with FP code, but I'm sure VP and FP are still very similar in terms of event based scripting.

 

 

Here is the code as it is right now with my added bits for playing video clips with PinUp Player.  If you guys could help me with an example for Light 39 (Quorra multiball Light)  which is L39  in the editor.

 

Any help with this would be great guys....any more methods of control would allow for more video and DOF coolness to be used with VP tables.

  Option Explicit
    Randomize

On Error Resume Next
ExecuteGlobal GetTextFile("controller.vbs")
If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
On Error Goto 0

LoadVPM "01560000", "sam.VBS", 3.10

Dim DesktopMode: DesktopMode = Table.ShowDT

If DesktopMode = True Then 'Show Desktop components
Ramp16.visible=1
Ramp15.visible=1
Primitive2.visible=1
Else
Ramp16.visible=0
Ramp15.visible=0
Primitive2.visible=0
End if

'********************
'Standard definitions
'********************

	Const cGameName = "trn_174h"

     Const UseSolenoids = 1
     Const UseLamps = 0
     Const UseSync = 1
     Const HandleMech = 0 

     'Standard Sounds
     Const SSolenoidOn = "Solenoid"
     Const SSolenoidOff = ""
     Const SCoin = "CoinIn"



'**************************
'   PinUp Player Config
'   Change HasPuP = True if using PinUp Player Videos
'**************************

Const HasPuP = True

Dim PuPlayer2
if HasPuP Then
Set PuPlayer2 = CreateObject("PinUpPlayer.PinDisplay") 
PuPlayer2.Init("Tron_Legacy")
PuPlayer2.SetScreen(2)
PuPlayer2.playlistadd "Clu", 1 , 5
PuPlayer2.playlistadd "BlueLCRamp", 1 , 5
PuPlayer2.playlistadd "Quorra", 1 , 5
PuPlayer2.playlistadd "Recognizer", 1 , 5
PuPlayer2.playlistadd "YellowLCRamp", 1 , 5
PuPlayer2.playlistadd "Arcade", 1 , 5
PuPlayer2.playlistadd "Sirens", 1 , 5
PuPlayer2.playlistadd "DiscWars", 1 , 5
End if


Dim PuPlayer
if HasPuP Then
Set PuPlayer = CreateObject("PinUpPlayer.PinDisplay") 
PuPlayer.Init("Tron_Legacy")
PuPlayer.SetScreen(0)
PuPlayer.playlistadd "TopperImages", 1 , 5
PuPlayer.playlistplayex "TopperImages","TronLegacyLogo.jpg",100,1
PuPlayer.SetBackground(1)
End if





 '************
' Table init.
'************

   'Variables
    Dim xx
    Dim Bump1, Bump2, Bump3, Mech3bank,bsTrough,bsRHole,DTBank4,turntable,ttDisc1
	Dim PlungerIM
    

  Sub Table_Init
	UpPost.Isdropped=true
	With Controller
		.GameName = cGameName
		If Err Then MsgBox "Can't start Game " & cGameName & vbNewLine & Err.Description:Exit Sub
		.SplashInfoLine = "Tron (Stern 2011)"
		.HandleKeyboard = 0
		.ShowTitle = 0
		.ShowDMDOnly = 1
		.ShowFrame = 0
		.HandleMechanics = 1
		.Hidden = 0
        .Games(cGameName).Settings.Value("sound") = 1
		On Error Resume Next
		.Run GetPlayerHWnd
		If Err Then MsgBox Err.Description
	End With

    On Error Goto 0


       '**Trough
    Set bsTrough = New cvpmBallStack
    bsTrough.InitSw 0, 21, 20, 19, 18, 0, 0, 0
    bsTrough.InitKick BallRelease, 90, 8
    bsTrough.InitExitSnd SoundFX("ballrelease",DOFContactors), SoundFX("Solenoid",DOFContactors)
    bsTrough.Balls = 4

	'***Right Hole bsRHole
     Set bsRHole = New cvpmBallStack
     With bsRHole
         .InitSw 0, 11, 0, 0, 0, 0, 0, 0
         .InitKick sw11, 200, 20
         .KickZ = 0.4
         .InitExitSnd SoundFX("popper_ball",DOFContactors), SoundFX("Solenoid",DOFContactors)
         .KickForceVar = 2
     End With


 	'DropTargets
   	Set DTBank4 = New cvpmDropTarget  
   	  With DTBank4
   		.InitDrop Array(sw04,sw03,sw02,sw01),Array(4,3,2,1)
        .Initsnd SoundFX("DTL",DOFContactors), SoundFX("DTResetL",DOFContactors)
       End With

      '**Main Timer init
	PinMAMETimer.Interval = PinMAMEInterval
	PinMAMETimer.Enabled = 1
 
	'Nudging
    	vpmNudge.TiltSwitch=-7
    	vpmNudge.Sensitivity=3    	
		vpmNudge.TiltObj=Array(Bumper1b,Bumper2b,Bumper3b,LeftSlingshot,RightSlingshot)

     ' Impulse Plunger
    Const IMPowerSetting = 52
    Const IMTime = 0.7
    Set plungerIM = New cvpmImpulseP
    With plungerIM
        .InitImpulseP swplunger, IMPowerSetting, IMTime
        .Random 0.3
        .InitExitSnd "plunger2", "plunger"
        .CreateEvents "plungerIM"
    End With

'SW49.isdropped=1:SW50.isdropped=1:SW51.isdropped=1

'DivPos=0

TBPos=28:TBTimer.Enabled=0:TBDown=1:Controller.Switch(52) = 1:Controller.Switch(53) = 0

 ' Drop Bank
    'Init3Bank
	'DropBank

   'Rollovers
	Targets_Down

'   Spinning Disk

     'Set turntable = New cvpmTurnTable
     'With turntable
         '.InitTurnTable spinningdisk,180
         '.CreateEvents "turntable"
         '.SpinCW = 1
         '.spinUp = 100
         '.SpinDown = 40

     'End With

' 	Init Recognizer
	recognizer.transx = -30
	recognizer.rotz=1

	vpmMapLights Collection1
    'sw7b.IsDropped = 1
    'sw8b.IsDropped = 1
    'sw48b.IsDropped = 1
    'sw13b.IsDropped = 1
	'Init3Bank


  End Sub

   Sub Table_Paused:Controller.Pause = 1:End Sub
   Sub Table_unPaused:Controller.Pause = 0:End Sub

 
'*****Keys


 Sub Table_KeyDown(ByVal keycode)


if keycode = 46 then ' C Key
     If contball = 1 Then
          contball = 0
     Else
          contball = 1
     End If
End If
if keycode = 48 then 'B Key
     If bcboost = 1 Then
          bcboost = bcboostmulti
     Else
          bcboost = 1
     End If
End If
if keycode = 203 then bcleft = 1 ' Left Arrow
if keycode = 200 then bcup = 1 ' Up Arrow
if keycode = 208 then bcdown = 1 ' Down Arrow
if keycode = 205 then bcright = 1 ' Right Arrow


 	If Keycode = LeftFlipperKey then 
		'SolLFlipper true
	End If
 	If Keycode = RightFlipperKey then 
'		SolRFlipper true
	End If
    If keycode = PlungerKey Then Plunger.Pullback

    If vpmKeyDown(keycode) Then Exit Sub 
    
End Sub

Sub Table_KeyUp(ByVal keycode)

if keycode = 203 then bcleft = 0 ' Left Arrow
if keycode = 200 then bcup = 0 ' Up Arrow
if keycode = 208 then bcdown = 0 ' Down Arrow
if keycode = 205 then bcright = 0 ' Right Arrow


	If vpmKeyUp(keycode) Then Exit Sub
 	If Keycode = LeftFlipperKey then 
		'SolLFlipper false
	End If
 	If Keycode = RightFlipperKey then 
		'SolRFlipper False
	End If
	If Keycode = StartGameKey Then Controller.Switch(16) = 0
    If keycode = PlungerKey Then Plunger.Fire

End Sub


Sub StartControl_Hit()
     Set ControlBall = ActiveBall
     contballinplay = true
End Sub

Sub StopControl_Hit()
     contballinplay = false
End Sub

Dim bcup, bcdown, bcleft, bcright, contball, contballinplay, ControlBall, bcboost
Dim bcvel, bcyveloffset, bcboostmulti

bcboost = 1 'Do Not Change - default setting
bcvel = 4 'Controls the speed of the ball movement
bcyveloffset = -0.01 'Offsets the force of gravity to keep the ball from drifting vertically on the table, should be negative
bcboostmulti = 3 'Boost multiplier to ball veloctiy (toggled with the B key)

Sub BallControl_Timer()
     If Contball and ContBallInPlay then
          If bcright = 1 Then
               ControlBall.velx = bcvel*bcboost
          ElseIf bcleft = 1 Then
               ControlBall.velx = - bcvel*bcboost
          Else
               ControlBall.velx=0
          End If

         If bcup = 1 Then
              ControlBall.vely = -bcvel*bcboost
         ElseIf bcdown = 1 Then
              ControlBall.vely = bcvel*bcboost
         Else
              ControlBall.vely= bcyveloffset
         End If
     End If
End Sub



   'Solenoids
SolCallback(1) = "solTrough"
SolCallback(2) = "solAutofire"
SolCallback(3) = "DTBank4.SolDropUp"
SolCallback(4) = "bsRHole.SolOut"
SolCallback(5)="SolDiscMotor"' spinning disk
SolCallback(6) = "TBMove"
SolCallback(7) = "orbitpost"
'SolCallback(8) = "shaker"
SolCallback(9) = "SetLamp 139,"
SolCallback(10) = "SetLamp 140,"
SolCallback(11) = "SetLamp 141,"
'SolCallback(12) = "upperleftflipper"
'SolCallback(13) = "leftslingshot"
'SolCallback(14) = "rightslingshot"

SolCallback(15) = "SolLFlipper"
SolCallback(16) = "SolRFlipper"

'Flashers
SolCallback(17) = "SetLamp 117,"    'flash zen
SolCallback(18) = "SetLamp 118,"'flash videogame
SolCallback(19) = "setlamp 119,"    'flash right domes x2
SolCallback(20) = "SetLamp 120,"  'LE apron left
SolCallback(21) = "SetLamp 121,"   'LE apron right
'SolCallback(22) = "discdirrelay"  'LE disc direction relay
SolCallback(23) = "recogrelay"    'LE recognizer

SolCallback(25) = "setlamp 125,"'flash left domes
SolCallback(26) = "SetLamp 126,"'flash disc left 
SolCallback(27) = "SetLamp 127,"'flash disc right
SolCallback(28) = "SetLamp 128,"'flash backpanel x2
SolCallback(29) = "SetLamp 129,"'flash recognizer
SolCallback(30) = "SetLamp 130,"'disc motor relay
SolCallback(31) = "SetLamp 131,"'flash red disc left x2
SolCallback(32) = "SetLamp 132,"'LE flash red disc x2


Dim XLocation,XDir,T(4),ZRot
XDir=1
XLocation=-30
ZRot=1


Sub Timer1_Timer
	If Controller.Switch(16) = 0 Then

		If XLocation>40 Then XDir=0
		If XLocation<-30 Then XDir=1
		'T(XLocation).IsDropped=1
		If XDir=1 Then XLocation=XLocation+5:ZRot=ZRot-1
		If XDir=0 Then XLocation=XLocation-5:ZRot=ZRot+1
'		T(XLocation).IsDropped=0
		recognizer.transx=XLocation
		recognizer.rotz=zrot
		'recognizer.TriggerSingleUpdate()

	End If
End Sub


Sub recogrelay(Enabled)
	If Enabled Then 
		Timer1.enabled=1
	Else
		Timer1.enabled=0
	End If
End Sub

Sub solTrough(Enabled)
	If Enabled Then
		bsTrough.ExitSol_On
		vpmTimer.PulseSw 22
	End If
 End Sub

Sub solAutofire(Enabled)
	If Enabled Then
		PlungerIM.AutoFire
	End If
 End Sub

Sub Sol3bankmotor(Enabled)
	 	If Enabled then
 		RiseBank
		DropBank
	end if
End Sub


'    Spinning Disk

Sub SolSpinningDisk(Enabled)
	If Enabled Then
		TTTimer_Timer
		TTTimer.Enabled=Enabled
	PlaySound "spindisc", -1
	Else
		TTTimer.Enabled=False
	turntable.MotorOn=0
	stopSound "spindisc"
	End If
	turntable.MotorOn=Enabled
End Sub

Sub orbitpost(Enabled)
	If Enabled Then
		UpPost.Isdropped=false
	Else
		UpPost.Isdropped=true
	End If
 End Sub

' spinning discs (New) Taken from Whirlwind written by Herweh
	Set ttDisc1 = New myTurnTable
		ttDisc1.InitTurnTable Disc1Trigger, 8
		ttDisc1.SpinCW = False
		ttDisc1.CreateEvents "ttDisc1"
	'Set ttDisc2 = New myTurnTable
		'ttDisc2.InitTurnTable Disc2Trigger, 8
		'ttDisc2.SpinCW = True
		'ttDisc2.CreateEvents "ttDisc2"
	'Set ttDisc3 = New myTurnTable
		'ttDisc3.InitTurnTable Disc3Trigger, 6
		'ttDisc3.SpinCW = False
		'ttDisc3.CreateEvents "ttDisc3"

'Switches

Sub sw01_Hit
	DTBank4.Hit 4
	if HasPuP Then 
	PuPlayer2.playlistplay("DiscWars")
	End if
End Sub
Sub sw02_Hit
	DTBank4.Hit 3
	if HasPuP Then 
	PuPlayer2.playlistplay("DiscWars")
	End if
End Sub
Sub sw03_Hit
	DTBank4.Hit 2
	if HasPuP Then 
	PuPlayer2.playlistplay("DiscWars")
	End if
End Sub
Sub sw04_Hit
	DTBank4.Hit 1
	if HasPuP Then 
	PuPlayer2.playlistplay("DiscWars")
	End if
End Sub
Sub sw7_Hit:Me.TimerEnabled = 1:sw7p.TransX = -2:vpmTimer.PulseSw 7:PlaySound SoundFX("fx_target",DOFContactors):End Sub
Sub sw7_Timer:Me.TimerEnabled = 0:sw7p.TransX = 0:End Sub
Sub sw8_Hit:Me.TimerEnabled = 1:sw8p.TransX = -2:vpmTimer.PulseSw 8:PlaySound SoundFX("fx_target",DOFContactors):End Sub
Sub sw8_Timer:Me.TimerEnabled = 0:sw8p.TransX = 0:End Sub
Sub sw12_Hit:Controller.Switch(12) = 1:PlaySound "rollover":End Sub
Sub sw12_UnHit:Controller.Switch(12) = 0:End Sub
Sub sw13_Hit:Me.TimerEnabled = 1:sw13p.TransX = -2:vpmTimer.PulseSw 13:PlaySound SoundFX("fx_target",DOFContactors):End Sub
Sub sw13_Timer:Me.TimerEnabled = 0:sw13p.TransX = 0:End Sub
Sub sw14_Hit:Controller.Switch(14) = 1:PlaySound "rollover":End Sub
Sub sw14_UnHit:Controller.Switch(14) = 0:End Sub
'Sub sw23:End Sub
Sub sw24_Hit
	Controller.Switch(24) = 1
	PlaySound "rollover"
	if HasPuP Then 
	PuPlayer2.playlistplay("Clu")
	End if
End Sub
Sub sw24_UnHit:Controller.Switch(24) = 0:End Sub
Sub sw25_Hit:Controller.Switch(25) = 1:PlaySound "rollover":End Sub
Sub sw25_UnHit:Controller.Switch(25) = 0:End Sub
Sub sw28_Hit:Controller.Switch(28) = 1:PlaySound "rollover":End Sub
Sub sw28_UnHit:Controller.Switch(28) = 0:End Sub
Sub sw29_Hit
	Controller.Switch(29) = 1
	PlaySound "rollover"
	if HasPuP Then 
	PuPlayer2.playlistplay("Clu")
	End if
End Sub
Sub sw29_UnHit:Controller.Switch(29) = 0:End Sub
Sub sw34_Hit
	Controller.Switch(34) = 1
	PlaySound "Gate"
	LeftCount = LeftCount + 1
	if HasPuP Then 
	PuPlayer2.playlistplay("YellowLCRamp")
	End if
End Sub
Sub sw34_UnHit:Controller.Switch(34) = 0:End Sub
Sub sw35_Hit:Controller.Switch(35) = 1:PlaySound "Gate":End Sub
Sub sw35_UnHit:Controller.Switch(35) = 0:End Sub
Sub sw36_Spin:vpmTimer.PulseSw 36::playsound"spinner":End Sub
Sub sw37_Hit 
	Controller.Switch(37) = 1
	PlaySound "Gate"
	RightCount = RightCount + 1
	if HasPuP Then 
	PuPlayer2.playlistplay("BlueLCRamp")
	End if
End Sub
Sub sw37_UnHit:Controller.Switch(37) = 0:End Sub
Sub sw38_Hit:Controller.Switch(38) = 1:PlaySound "Gate":End Sub
Sub sw38_UnHit:Controller.Switch(38) = 0:End Sub
Sub sw39_Hit
	Controller.Switch(39) = 1
	PlaySound "rollover"
	if HasPuP Then 
	PuPlayer2.playlistplay("Sirens")
	PuPlayer.playlistplayex "TopperImages","LCD_GemPrompt.JPG",100,1
	PuPlayer.SetLength(5)
	End if
End Sub
Sub sw39_UnHit:Controller.Switch(39) = 0:End Sub
Sub sw41_Hit
	Controller.Switch(41) = 1
	if HasPuP Then 
	PuPlayer2.playlistplay("Recognizer")
	End if
End Sub
Sub sw41_UnHit:Controller.Switch(41) = 0:End Sub
Sub sw43_Hit:Controller.Switch(43) = 1:PlaySound "rollover":End Sub
Sub sw43_UnHit:Controller.Switch(43) = 0:End Sub
Sub sw44_Spin
	vpmTimer.PulseSw 44
	playsound"spinner"
	if HasPuP Then 
	PuPlayer2.playlistplay("Quorra")
	PuPlayer.playlistplayex "TopperImages","LCD_QuorraPrompt.jpg",100,1
	PuPlayer.SetLength(5)
	End if
End Sub
Sub sw46_Hit
	Controller.Switch(46) = 1
	PlaySound "rollover"
	if HasPuP Then 
	PuPlayer2.playlistplay("Recognizer")
	End if
End Sub
Sub sw46_UnHit:Controller.Switch(46) = 0:End Sub
Sub sw48_Hit
	Me.TimerEnabled = 1
	sw48p.TransX = -2
	vpmTimer.PulseSw 48
	PlaySound SoundFX("fx_target",DOFContactors)
	If LampState(7) = 1 and LampState(8) = 1 and LampState(13) = 1 then
	PuPlayer.playlistplayex "TopperImages","LCD_ZusePrompt.jpg",100,1
	PuPlayer.SetLength(5)
	End If
End Sub
Sub sw48_Timer:Me.TimerEnabled = 0:sw48p.TransX = 0:End Sub
Sub sw49_Hit
	vpmTimer.PulseSw 49
	Me.TimerEnabled = 1
	PlaySound SoundFX("fx_target",DOFContactors)
	if HasPuP Then 
	PuPlayer2.playlistplay("Recognizer")
	End if
End Sub
Sub sw49_Timer:Me.TimerEnabled = 0:End Sub
Sub sw50_Hit
	vpmTimer.PulseSw 50
	Me.TimerEnabled = 1
	PlaySound SoundFX("fx_target",DOFContactors)
	if HasPuP Then 
	PuPlayer2.playlistplay("Recognizer")
	End if
End Sub
Sub sw50_Timer:Me.TimerEnabled = 0:End Sub
Sub sw51_Hit
	vpmTimer.PulseSw 51
	Me.TimerEnabled = 1
	PlaySound SoundFX("fx_target",DOFContactors)
	if HasPuP Then 
	PuPlayer2.playlistplay("Recognizer")
	End if
End Sub
Sub sw51_Timer:Me.TimerEnabled = 0:End Sub
 'Sub sw52:End Sub
 'Sub sw53:End Sub

'Arcade Scoop
 Dim aBall, aZpos
 Dim bBall, bZpos

 Sub sw11_Hit
     Set bBall = ActiveBall
     PlaySound "kicker_enter_center"
     bZpos = 35
	 'ClearBallID
     Me.TimerInterval = 2
     Me.TimerEnabled = 1
	if HasPuP Then 
	PuPlayer2.playlistplay("Arcade")
	End if
 End Sub
 
 Sub sw11_Timer
     bBall.Z = bZpos
     bZpos = bZpos-4
     If bZpos <-30 Then
         Me.TimerEnabled = 0
         Me.DestroyBall
         bsRHole.AddBall Me
     End If
 End Sub
 
' ===============================================================================================
' spinning discs (New) Taken from Whirlwind written by Herweh
' ===============================================================================================

Dim discAngle, stepAngle, stopDiscs, discsAreRunning

InitDiscs()

Sub InitDiscs()
	discAngle 			= 0
	discsAreRunning		= False
End Sub

Sub SolDiscMotor(Enabled)
	ttDisc1.MotorOn = Enabled
	'ttDisc2.MotorOn = Enabled
	'ttDisc3.MotorOn = Enabled
	If Enabled Then
		stepAngle			= 20.0
		discsAreRunning		= True
		stopDiscs			= False
		DiscsTimer.Interval = 10
		DiscsTimer.Enabled 	= True
	Else
		stopDiscs			= True
		discsAreRunning		= True
	End If
End Sub

Sub DiscsTimer_Timer()
	' calc angle
	discAngle = discAngle + stepAngle
	If discAngle >= 360 Then
		discAngle = discAngle - 360
	End If
	' rotate discs
	Disc1.RotAndTra2 = 360 - discAngle
	'Disc2.RotAndTra2 = discAngle
	'Disc3.RotAndTra2 = 360 - discAngle
	' maybe change rotation angle to stop the timer
	If stopDiscs Then
		stepAngle = stepAngle - 0.1
		If stepAngle <= 0 Then
			DiscsTimer.Enabled 	= False
		End If
	End If
End Sub


Class myTurnTable
	Private mX, mY, mSize, mMotorOn, mDir, mBalls, mTrigger
	Public MaxSpeed, SpinDown, Speed

	Private Sub Class_Initialize
		mMotorOn = False : Speed = 0 : mDir = 1 : SpinDown = 15
		Set mBalls = New cvpmDictionary
	End Sub

	Public Sub InitTurntable(aTrigger, aMaxSpeed)
		mX = aTrigger.X : mY = aTrigger.Y : mSize = aTrigger.Radius
		MaxSpeed = aMaxSpeed : Set mTrigger = aTrigger
	End Sub

	Public Sub CreateEvents(aName)
		If vpmCheckEvent(aName, Me) Then
			vpmBuildEvent mTrigger, "Hit", aName & ".AddBall ActiveBall"
			vpmBuildEvent mTrigger, "UnHit", aName & ".RemoveBall ActiveBall"
			vpmBuildEvent mTrigger, "Timer", aName & ".Update"
		End If
	End Sub

	Public Sub SolMotorState(aCW, aEnabled)
		mMotorOn = aEnabled
		If aEnabled Then If aCW Then mDir = 1 Else mDir = -1
		NeedUpdate = True
	End Sub

	Public Property Let MotorOn(aEnabled)
		mMotorOn = aEnabled
		NeedUpdate = (mBalls.Count > 0) Or (SpinDown > 0)
	End Property
	Public Property Get MotorOn
		MotorOn = mMotorOn
	End Property

	Public Sub AddBall(aBall)
		On Error Resume Next
		mBalls.Add aBall,0
		NeedUpdate = True
	End Sub
	Public Sub RemoveBall(aBall)
		On Error Resume Next
		mBalls.Remove aBall
		NeedUpdate = (mBalls.Count > 0) Or (SpinDown > 0)
	End Sub

	Public Property Let SpinCW(aCW)
		If aCW Then mDir = 1 Else mDir = -1
		NeedUpdate = True
	End Property
	Public Property Get SpinCW
		SpinCW = (mDir = 1)
	End Property

	Public Sub Update
		If mMotorOn Then
			Speed = MaxSpeed
			NeedUpdate = mBalls.Count
		Else
			Speed = Speed - SpinDown*MaxSpeed/3000 '100
			If Speed < 0 Then 
				Speed = 0
				'msgbox "off"
				NeedUpdate = mBalls.Count
			End If
		End If
		If Speed > 0 Then
			Dim obj
			On Error Resume Next
			For Each obj In mBalls.Keys
				If obj.X < 0 Or Err Then RemoveBall obj Else AffectBall obj
			Next
			On Error Goto 0
		End If
	End Sub

	Public Sub AffectBall(aBall)
		Dim dX, dY, dist
		dX = aBall.X - mX : dY = aBall.Y - mY : dist = Sqr(dX*dX + dY*dY)
		If dist > mSize Or dist < 1 Or Speed = 0 Then Exit Sub
		aBall.VelX = aBall.VelX - (dY * mDir * Speed / 1000)
		aBall.VelY = aBall.VelY + (dX * mDir * Speed / 1000)
	End Sub

	Private Property Let NeedUpdate(aEnabled)
		If mTrigger.TimerEnabled <> aEnabled Then
			mTrigger.TimerInterval = 10
			mTrigger.TimerEnabled = aEnabled
		End If
	End Property
End Class

'*****************************************************************************************
'*******************   Spinning disk animation        ************************************
'*****************************************************************************************

 'Dim Turn,I


    'I=0
'Turn=Array(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12)

     'Sub TTTimer_Timer
		 'If I=0 then I=1 'ensure I is always positive
		 'If I<0 then I=1 'ensure I is always positive
		 'If I>11 then I=0
	     'Turn(I).IsDropped=1
	     'I=I+1
	     'If I>11 Then I=0
	     'Turn(I).IsDropped=0

     'End Sub 


  'Flasher Subs

 Sub Targets_Down()
 'sw7b.isdropped=0:sw8b.isdropped=0:sw48b.isdropped=0:sw13b.isdropped=0
 End Sub

 


  
Sub SolLFlipper(Enabled)
     If Enabled Then
		 PlaySound SoundFX("FlipperUpLeft",DOFContactors)
		 LeftFlipper.RotateToEnd:LeftFlipper1.RotateToEnd
     Else
		 PlaySound SoundFX("FlipperDown",DOFContactors)
		 LeftFlipper.RotateToStart:LeftFlipper1.RotateToStart
     End If
 End Sub

Sub SolRFlipper(Enabled)
     If Enabled Then
		 PlaySound SoundFX("FlipperUpRight",DOFContactors)
		 RightFlipper.RotateToEnd
     Else
		 PlaySound SoundFX("FlipperDown",DOFContactors)
		 RightFlipper.RotateToStart
     End If
 End Sub   


 'Drains and Kickers
Dim BallCount:BallCount = 0
   Sub Drain_Hit():PlaySound "Drain"
	'ClearBallID
	BallCount = BallCount - 1
	bsTrough.AddBall Me
	If BallCount = 0 then GIOff
   End Sub
   Sub sw11_UnHit()
	'NewBallID
	End Sub
   Sub BallRelease_UnHit()
	'NewBallID
		BallCount = BallCount + 1
		GIOn
	End Sub


'***Slings and rubbers

 Dim LStep, RStep

Sub LeftSlingShot_Slingshot
PlaySound SoundFX("left_slingshot",DOFContactors), 0, 0.3, -0.1, 0.25
vpmTimer.PulseSw 26
	LSling.Visible = 0
    LSling1.Visible = 1
    sling2.TransZ = -20
    LStep = 0
    LeftSlingShot.TimerEnabled = 1
    LeftSlingShot.TimerInterval = 10
End Sub

Sub LeftSlingShot_Timer
    Select Case LStep
        Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -10
        Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.TransZ = 0:LeftSlingShot.TimerEnabled = 0
    End Select
    LStep = LStep + 1
End Sub

Sub RightSlingShot_Slingshot
PlaySound SoundFX("right_slingshot",DOFContactors), 0, 0.3, 0.1, 0.25
vpmTimer.PulseSw 27
	RSling.Visible = 0
    RSling1.Visible = 1
    sling1.TransZ = -20
    RStep = 0
    RightSlingShot.TimerEnabled = 1
    RightSlingShot.TimerInterval = 10
End Sub

Sub RightSlingShot_Timer
    Select Case RStep
        Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -10
        Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.TransZ = 0:RightSlingShot.TimerEnabled = 0
    End Select
    RStep = RStep + 1
End Sub

   'Bumpers
      Sub Bumper1b_Hit
      vpmTimer.PulseSw 31
      PlaySound SoundFX("fx_bumper1",DOFContactors)
    	End Sub
     
 
      Sub Bumper2b_Hit
      vpmTimer.PulseSw 30
      PlaySound SoundFX("fx_bumper1",DOFContactors)
       End Sub
 
      Sub Bumper3b_Hit
      vpmTimer.PulseSw 32
      PlaySound SoundFX("fx_bumper1",DOFContactors)
       End Sub
  

Dim LampState(200), FadingLevel(200), FadingState(200)
Dim FlashState(200), FlashLevel(200)
Dim FlashSpeedUp, FlashSpeedDown
Dim x

AllLampsOff()
LampTimer.Interval = 40 'lamp fading speed
LampTimer.Enabled = 1
'
FlashInit()
FlasherTimer.Interval = 10 'flash fading speed
FlasherTimer.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)
            FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4
			FlashState(chgLamp(ii, 0) ) = chgLamp(ii, 1)
        Next
    End If

    UpdateLamps
End Sub

Sub FlashInit
    Dim i
    For i = 0 to 200
        FlashState(i) = 0
        FlashLevel(i) = 0
    Next

    FlashSpeedUp = 50   ' fast speed when turning on the flasher
    FlashSpeedDown = 10 ' slow speed when turning off the flasher, gives a smooth fading
    AllFlashOff()
End Sub

Sub AllFlashOff
    Dim i
    For i = 0 to 200
        FlashState(i) = 0
    Next
End Sub

Sub Reflections_Timer()

End Sub

Sub UpdateLamps()
MaterialColor "EVRGBLeft", RGB(LampState(103), LampState(102), LampState(101))
MaterialColor "EVRGBRight", RGB(LampState(106), LampState(105), LampState(104))
'If LampState(103) and LampState(102) and LampState(101) = 0 then EVLeft.Material = "EVOff"
'If LampState(106) and LampState(105) and LampState(104) = 0 then EVRight.Material = "EVOff"
'If LampState(103) and LampState(102) and LampState(101) >= 1 then EVLeft.Material = "EVRGBLeft"
'If LampState(106) and LampState(105) and LampState(104) >= 1 then EVRight.Material = "EVRGBRight"

NFadeL 1, l1
NFadeL 2, l2
NFadeL 3, l3
NFadeL 4, l4
NFadeL 5, l5
NFadeL 6, l6
NFadeL 7, l7
NFadeL 8, l8
NFadeL 9, l9
NFadeL 10, l10
NFadeL 11, l11
NFadeL 12, l12
NFadeL 13, l13
NFadeL 14, l14
NFadeL 15, l15
NFadeL 16, l16
NFadeL 17, l17
NFadeL 18, l18
NFadeL 19, l19
NFadeL 20, l20
NFadeL 21, l21
NFadeL 22, l22
NFadeL 23, l23
NFadeL 24, l24
NFadeL 25, l25
NFadeL 26, l26
NFadeL 27, l27
NFadeL 28, l28
NFadeL 29, l29
NFadeL 30, l30
NFadeL 31, l31
NFadeL 32, l32
NFadeL 33, l33
NFadeL 34, l34
NFadeL 35, l35
NFadeL 36, l36
NFadeL 37, l37
NFadeL 38, l38
NFadeL 39, l39
NFadeL 40, l40
NFadeL 42, l42
NFadeL 43, l43
NFadeL 45, l45
NFadeL 49, l49
NFadeL 50, l50
NFadeL 51, l51
NFadeL 52, l52
NFadeL 53, l53
NFadeL 54, l54
NFadeL 55, l55
NFadeL 56, l56
NFadeL 57, l57
NFadeL 58, l58
NFadeL 59, l59
NFadeL 60, l60
NFadeL 61, l61
NFadeL 62, l62
NFadeL 63, l63
NFadeL 64, l64


'Flashers

NFadeL 117, F117

NFadeL 118, f118

NFadeLm 119, f119a
NFadeLm 119, f119b
NFadeLm 119, f119c
NFadeLm 119, f119d
NFadeLm 119, f119e
NFadeLm 119, f119f

'NFadeL 120, f120

'NFadeL 121, f121

NFadeLm 125, f125a
NFadeLm 125, f125b
NFadeLm 125, f125c
NFadeLm 125, f125d
NFadeLm 125, f125e
NFadeLm 125, f125f

NFadeL 126, F126

NFadeL 127,F127 

NFadeLm 128, f128a
NFadeLm 128, f128b
NFadeLm 128, f128c
NFadeLm 128, f128d
NFadeLm 128, f128e
NFadeLm 128, f128f

NFadeL 129, f129
NFadeLm 129, f129a

NFadeLm 131, f131a
NFadeLm 131, f131b

NFadeLm 132, f132a
NFadeLm 132, f132b

NFadeL 139, f9
NFadeL 140, f10
NFadeL 141, f11

End Sub

Sub FadePrim(nr, pri, a, b, c, d)
    Select Case FadingLevel(nr)
        Case 2:pri.image = d:FadingLevel(nr) = 0
        Case 3:pri.image = c:FadingLevel(nr) = 1
        Case 4:pri.image = b:FadingLevel(nr) = 2
        Case 5:pri.image = a:FadingLevel(nr) = 3
    End Select
End Sub

''Lights

Sub NFadeL(nr, a)
    Select Case FadingLevel(nr)
        Case 4:a.state = 0:FadingLevel(nr) = 0
        Case 5:a.State = 1:FadingLevel(nr) = 1
    End Select
End Sub

Sub NFadeLm(nr, a)
    Select Case FadingLevel(nr)
        Case 4:a.state = 0
        Case 5:a.State = 1
    End Select
End Sub

' Flasher objects
' Uses own faster timer

Sub Flash(nr, object)
    Select Case FlashState(nr)
        Case 0 'off
            FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown
            If FlashLevel(nr) < 0 Then
                FlashLevel(nr) = 0
                FlashState(nr) = -1 'completely off
            End if
            Object.opacity = FlashLevel(nr)
        Case 1 ' on
            FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp
            If FlashLevel(nr) > 1000 Then
                FlashLevel(nr) = 1000
                FlashState(nr) = -2 'completely on
            End if
            Object.opacity = FlashLevel(nr)
    End Select
End Sub

 Sub AllLampsOff():For x = 1 to 200:LampState(x) = 4:FadingLevel(x) = 4:Next:UpdateLamps:UpdateLamps:Updatelamps:End Sub
 
Sub SetRGBLamp(Lamp, R, G, B)   
     'dim IntensityValue 
	 'IntensityValue = .2126 * R + .7152 * G + .0722 * B
	 Lamp.Color = RGB(R, G, B)
	 Lamp.ColorFull = RGB(R, G, B)
	 'Lamp.Intensity = IntensityValue *100 / 255
	 Lamp.State = 1
End Sub

Sub SetLamp(nr, value)
    If value = 0 AND LampState(nr) = 0 Then Exit Sub
    If value = 1 AND LampState(nr) = 1 Then Exit Sub
    LampState(nr) = abs(value) + 4
FadingLevel(nr ) = abs(value) + 4: FadingState(nr ) = abs(value) + 4
End Sub

Sub SetFlash(nr, stat)
    FlashState(nr) = ABS(stat)
End Sub

Sub FlasherTimer_Timer()
'Flash 3, fire
'
'Flash 80, f80
'Flash 119, f119
'Flash 120, f120 'right ramp flash
'Flash 129, f29 'left loop / spinner flash
'Flash 131, f31 'vengeance flash
 End Sub

'*********************************************************************
'* TARGETBANK TARGETS Taken from AFM written by Groni ****************
'*********************************************************************

Sub SW49_Hit
vpmTimer.PulseSw 49
SW49P.X=442.9411
SW49P.Y=449.8546
Me.TimerEnabled = 1
PlaySound SoundFX("fx_target",DOFContactors)
'If Ballresting = True Then
 'DPBall.VelY = ActiveBall.VelY * 3
'End If
End Sub

Sub SW49_Timer:SW49P.X=442.6875:SW49P.Y=453.3662:Me.TimerEnabled = 0:End Sub

Sub SW50_Hit
vpmTimer.PulseSw 50
SW50P.X=448.6911
SW50P.Y=449.8546
Me.TimerEnabled = 1
PlaySound SoundFX("fx_target",DOFContactors)
'If Ballresting = True Then
 'DPBall.VelY = ActiveBall.VelY * 3
'End If
End Sub

Sub SW50_Timer:SW50P.X=448.4375:SW50P.Y=453.3662:Me.TimerEnabled = 0:End Sub

Sub SW51_Hit
vpmTimer.PulseSw 51
SW51P.X=454.0661
SW51P.Y=449.8546
Me.TimerEnabled = 1
PlaySound SoundFX("fx_target",DOFContactors)
'If Ballresting = True Then
 'DPBall.VelY = ActiveBall.VelY * 3
'End If
End Sub

Sub SW51_Timer:SW51P.X=453.8125:SW51P.Y=453.3662:Me.TimerEnabled = 0:End Sub


'*********************************************************************
'* TARGETBANK MOVEMENT Taken from AFM written by Groni ***************
'*********************************************************************

Dim TBPos, TBDown

Sub TBMove (enabled)
if enabled then
TBTimer.Enabled=1
PlaySound SoundFX("TargetBank",DOFContactors)
End If
End Sub

Sub TBTimer_Timer()	
Select Case TBPos
Case 0: MotorBank.Z=-20:SW49P.Z=-20:SW50P.Z=-20:SW51P.Z=-20:TBPos=0:TBDown=0:TBTimer.Enabled=0:Controller.Switch(52) = 0:Controller.Switch(53) = 1::SW49.isdropped=0:SW50.isdropped=0:SW51.isdropped=0:DPWall.isdropped=0:DPWall1.isdropped=1
Case 1: MotorBank.Z=-22:SW49P.Z=-22:SW50P.Z=-22:SW51P.Z=-22
Case 2: MotorBank.Z=-24:SW49P.Z=-24:SW50P.Z=-24:SW51P.Z=-24
Case 3: MotorBank.Z=-26:SW49P.Z=-26:SW50P.Z=-26:SW51P.Z=-26
Case 4: MotorBank.Z=-28:SW49P.Z=-28:SW50P.Z=-28:SW51P.Z=-28
Case 5: MotorBank.Z=-30:SW49P.Z=-30:SW50P.Z=-30:SW51P.Z=-30
Case 6: MotorBank.Z=-32:SW49P.Z=-32:SW50P.Z=-32:SW51P.Z=-32
Case 7: MotorBank.Z=-34:SW49P.Z=-34:SW50P.Z=-34:SW51P.Z=-34
Case 8: MotorBank.Z=-36:SW49P.Z=-36:SW50P.Z=-36:SW51P.Z=-36
Case 9: MotorBank.Z=-38:SW49P.Z=-38:SW50P.Z=-38:SW51P.Z=-38
Case 10: MotorBank.Z=-40:SW49P.Z=-40:SW50P.Z=-40:SW51P.Z=-40
Case 11: MotorBank.Z=-42:SW49P.Z=-42:SW50P.Z=-42:SW51P.Z=-42
Case 12: MotorBank.Z=-44:SW49P.Z=-44:SW50P.Z=-44:SW51P.Z=-44:
Case 13: MotorBank.Z=-46:SW49P.Z=-46:SW50P.Z=-46:SW51P.Z=-46:
Case 14: MotorBank.Z=-48:SW49P.Z=-48:SW50P.Z=-48:SW51P.Z=-48
Case 15: MotorBank.Z=-50:SW49P.Z=-50:SW50P.Z=-50:SW51P.Z=-50
Case 16: MotorBank.Z=-52:SW49P.Z=-52:SW50P.Z=-52:SW51P.Z=-52
Case 17: MotorBank.Z=-54:SW49P.Z=-54:SW50P.Z=-54:SW51P.Z=-54
Case 18: MotorBank.Z=-56:SW49P.Z=-56:SW50P.Z=-56:SW51P.Z=-56
Case 19: MotorBank.Z=-58:SW49P.Z=-58:SW50P.Z=-58:SW51P.Z=-58
Case 20: MotorBank.Z=-60:SW49P.Z=-60:SW50P.Z=-60:SW51P.Z=-60
Case 21: MotorBank.Z=-62:SW49P.Z=-62:SW50P.Z=-62:SW51P.Z=-62
Case 22: MotorBank.Z=-64:SW49P.Z=-64:SW50P.Z=-64:SW51P.Z=-64
Case 23: MotorBank.Z=-66:SW49P.Z=-66:SW50P.Z=-66:SW51P.Z=-66
Case 24: MotorBank.Z=-68:SW49P.Z=-68:SW50P.Z=-68:SW51P.Z=-68
Case 25: MotorBank.Z=-70:SW49P.Z=-70:SW50P.Z=-70:SW51P.Z=-70
Case 26: MotorBank.Z=-72:SW49P.Z=-72:SW50P.Z=-72:SW51P.Z=-72
Case 27: MotorBank.Z=-74:SW49P.Z=-74:SW50P.Z=-74:SW51P.Z=-74
Case 28: MotorBank.Z=-76:SW49P.Z=-76:SW50P.Z=-76:SW51P.Z=-76:SW49.isdropped=1:SW50.isdropped=1:SW51.isdropped=1:DPWALL.isdropped=1
Case 29: TBTimer.Enabled=0:TBDown=1:Controller.Switch(52) = 1:Controller.Switch(53) = 0
End Select

If TBDown=0 then TBPos=TBPos+1 
If TBDown=1 then TBPos=TBPos-1
End Sub

 '******************
 'Motor Bank Up Down
 '******************
  'dim DropADir 
  'dim DropAPos 
 
  'DropADir = 1 

'Sub Init3Bank()
	'DropAPos = 0
 	'Controller.Switch(53) = 1
'End Sub

'Sub RiseBank 
    'If DropAPos <= 0 Then Exit Sub
	'DropADir = 1
	'DropAPos = 36
	'DropAa.TimerEnabled = 1
    'PlaySound SoundFX("motor2")
'End Sub

'Sub DropBank
    'If DropAPos >= 36 Then Exit Sub
	'DropADir = -1
	'DropAPos = 0
	'DropAa.TimerEnabled = 1
    'PlaySound SoundFX("motor2")
'End Sub

'Animations
  'Sub DropAa_Timer()	
  'Select Case DropAPos
        'Case 0: backbank.z=36:swp49.z=36:swp50.z=36:swp51.z=36:Controller.Switch(52) = 0:Controller.Switch(53) = 1:sw49.IsDropped = 0:sw50.IsDropped = 0:sw51.IsDropped = 0:banklsidehelp.IsDropped = 0:banklsidehelp1.IsDropped = 0
				 'If DropADir = 1 then
					'DropAa.TimerEnabled = 0
				 'else
			     'end if        
        'Case 1: backbank.z=23:swp49.z=23:swp50.z=23:swp51.z=23:Controller.Switch(52) = 0:Controller.Switch(53) = 0:banklsidehelp1.IsDropped = 1
        'Case 2: backbank.z=21:swp49.z=21:swp50.z=21:swp51.z=21:Controller.Switch(52) = 0:Controller.Switch(53) = 0
        'Case 3: backbank.z=19:swp49.z=19:swp50.z=19:swp51.z=19:Controller.Switch(52) = 0:Controller.Switch(53) = 0
        'Case 4: backbank.z=17:swp49.z=17:swp50.z=17:swp51.z=17:Controller.Switch(52) = 0:Controller.Switch(53) = 0
        'Case 5: backbank.z=15:swp49.z=15:swp50.z=15:swp51.z=15:Controller.Switch(52) = 0:Controller.Switch(53) = 0
        'Case 6: backbank.z=13:swp49.z=13:swp50.z=13:swp51.z=13:Controller.Switch(52) = 0:Controller.Switch(53) = 0
        'Case 7: backbank.z=11:swp49.z=11:swp50.z=11:swp51.z=11:Controller.Switch(52) = 0:Controller.Switch(53) = 0
        'Case 8: backbank.z=9:swp49.z=9:swp50.z=9:swp51.z=9:Controller.Switch(52) = 0:Controller.Switch(53) = 0
        'Case 9: backbank.z=7:swp49.z=7:swp50.z=7:swp51.z=7:Controller.Switch(52) = 0:Controller.Switch(53) = 0
        'Case 10: backbank.z=5:swp49.z=5:swp50.z=5:swp51.z=5:Controller.Switch(52) = 0:Controller.Switch(53) = 0
        'Case 11: backbank.z=3:swp49.z=3:swp50.z=3:swp51.z=3:Controller.Switch(52) = 0:Controller.Switch(53) = 0
        'Case 12: backbank.z=1:swp49.z=1:swp50.z=1:swp51.z=1:Controller.Switch(52) = 0:Controller.Switch(53) = 0
        'Case 13: backbank.z=-1:swp49.z=-1:swp50.z=-1:swp51.z=-1:Controller.Switch(52) = 0:Controller.Switch(53) = 0
        'Case 14: backbank.z=-3:swp49.z=-3:swp50.z=-3:swp51.z=-3:Controller.Switch(52) = 0:Controller.Switch(53) = 0        
        'Case 15: backbank.z=-5:swp49.z=-5:swp50.z=-5:swp51.z=-5:Controller.Switch(52) = 0:Controller.Switch(53) = 0
        'Case 16: backbank.z=-7:swp49.z=-7:swp50.z=-7:swp51.z=-7:Controller.Switch(52) = 0:Controller.Switch(53) = 0
        'Case 17: backbank.z=-9:swp49.z=-9:swp50.z=-9:swp51.z=-9:Controller.Switch(52) = 0:Controller.Switch(53) = 0
        'Case 18: backbank.z=-11:swp49.z=-11:swp50.z=-11:swp51.z=-11:Controller.Switch(52) = 0:Controller.Switch(53) = 0
        'Case 19: backbank.z=-13:swp49.z=-13:swp50.z=-13:swp51.z=-13:Controller.Switch(52) = 0:Controller.Switch(53) = 0
        'Case 20: backbank.z=-15:swp49.z=-15:swp50.z=-15:swp51.z=-15:Controller.Switch(52) = 0:Controller.Switch(53) = 0
        'Case 21: backbank.z=-17:swp49.z=-17:swp50.z=-17:swp51.z=-17:Controller.Switch(52) = 0:Controller.Switch(53) = 0
        'Case 22: backbank.z=-19:swp49.z=-19:swp50.z=-19:swp51.z=-19:Controller.Switch(52) = 0:Controller.Switch(53) = 0
        'Case 23: backbank.z=-21:swp49.z=-21:swp50.z=-21:swp51.z=-21:Controller.Switch(52) = 0:Controller.Switch(53) = 0
        'Case 24: backbank.z=-23:swp49.z=-23:swp50.z=-23:swp51.z=-23:Controller.Switch(52) = 0:Controller.Switch(53) = 0
		'Case 25: backbank.z=-25:swp49.z=-25:swp50.z=-25:swp51.z=-25:Controller.Switch(52) = 0:Controller.Switch(53) = 0
		'Case 26: backbank.z=-27:swp49.z=-27:swp50.z=-27:swp51.z=-27:Controller.Switch(52) = 0:Controller.Switch(53) = 0
		'Case 27: backbank.z=-29:swp49.z=-29:swp50.z=-29:swp51.z=-29:Controller.Switch(52) = 0:Controller.Switch(53) = 0
		'Case 28: backbank.z=-31:swp49.z=-31:swp50.z=-31:swp51.z=-31:Controller.Switch(52) = 0:Controller.Switch(53) = 0
		'Case 29: backbank.z=-33:swp49.z=-33:swp50.z=-33:swp51.z=-33:Controller.Switch(52) = 0:Controller.Switch(53) = 0
		'Case 30: backbank.z=-36:swp49.z=-36:swp50.z=-36:swp51.z=-36:Controller.Switch(52) = 1:Controller.Switch(53) = 0:sw49.IsDropped = 1:sw50.IsDropped = 1:sw51.IsDropped = 1:banklsidehelp.IsDropped = 1
				 'If DropADir = 1 then
				 'else
					'DropAa.TimerEnabled = 0
			     'end if
'End Select
	'If DropADir = 1 then
		'If DropApos>0 then DropApos=DropApos-1
	'else
		'If DropApos<36 then DropApos=DropApos+1
	'end if

  'End Sub

Sub ShooterLane_Hit()
	Controller.Switch(23)=1
End Sub

Sub ShooterLane_Unhit()
	Controller.Switch(23)=0
End Sub

Dim frame, FinalFrame  'ArcadeTimer
FinalFrame = 126 'number of frames - 1
frame = 0

 Sub ArcadeTimer_Timer()       
	Arcade(frame).isdropped = True
	frame = frame + 1
	If frame = FinalFrame Then frame=0
	Arcade(frame).isdropped = False
 End Sub

Sub Trigger1_hit
	PlaySound "DROP_LEFT"
 End Sub

 Sub Trigger2_hit
	PlaySound "DROP_RIGHT"
 End Sub 


Sub Table_exit()
	Controller.Pause = False
	Controller.Stop
End Sub


Sub RLS_Timer()
              RampGate1.RotZ = -(Spinner4.currentangle)
              RampGate2.RotZ = -(Spinner1.currentangle)
              RampGate3.RotZ = -(Spinner3.currentangle)
              RampGate4.RotZ = -(Spinner2.currentangle)
              SpinnerT4.RotZ = -(sw44.currentangle)
              SpinnerT1.RotZ = -(sw36.currentangle)
End Sub
  
'primitive flippers!
dim MotorCallback
Set MotorCallback = GetRef("GameTimer")
Sub GameTimer
    UpdateFlipperLogos
End Sub

Sub UpdateFlipperLogo_Timer
    LFLogo.RotY = LeftFlipper.CurrentAngle
    RFlogo.RotY = RightFlipper.CurrentAngle
	LFLogoUP.RotY = LeftFlipper1.CurrentAngle
End Sub

'******DROP TARGET PRIMITIVES******
Dim sw1up, sw2up, sw3up, sw4up
Dim PrimT

Sub PrimT_Timer
	if sw01.IsDropped = True then sw1up = False else sw1up = True
	if sw02.IsDropped = True then sw2up = False else sw2up = True
	if sw03.IsDropped = True then sw3up = False else sw3up = True
	if sw04.IsDropped = True then sw4up = False else sw4up = True


'If LampState(75) = 0 and LampState(76) = 0 and LampState(77) = 0 then evleft.Material = "EVOff"
'If LampState(75) = 0 and LampState(76) = 0 and LampState(77) = 1 then evleft.Material = "EVBlue"
'If LampState(75) = 0 and LampState(76) = 1 and LampState(77) = 0 then evleft.Material = "EVGreen"
'If LampState(75) = 0 and LampState(76) = 1 and LampState(77) = 1 then evleft.Material = "EVLightBlue"
'If LampState(75) = 1 and LampState(76) = 0 and LampState(77) = 0 then evleft.Material = "EVRed"
'If LampState(75) = 1 and LampState(76) = 1 and LampState(77) = 1 then evleft.Material = "EVPurple"
'If LampState(75) = 1 and LampState(76) = 0 and LampState(77) = 0 then evleft.Material = "EVYellow"
'If LampState(75) = 1 and LampState(76) = 1 and LampState(77) = 1 then evleft.Material = "EVWhite"
'
'If LampState(83) = 0 and LampState(84) = 0 and LampState(85) = 0 then evright.Material = "EVOff"
'If LampState(83) = 0 and LampState(84) = 0 and LampState(85) = 1 then evright.Material = "EVBlue"
'If LampState(83) = 0 and LampState(84) = 1 and LampState(85) = 0 then evright.Material = "EVGreen"
'If LampState(83) = 0 and LampState(84) = 1 and LampState(85) = 1 then evright.Material = "EVLightBlue"
'If LampState(83) = 1 and LampState(84) = 0 and LampState(85) = 0 then evright.Material = "EVRed"
'If LampState(83) = 1 and LampState(84) = 1 and LampState(85) = 1 then evright.Material = "EVPurple"
'If LampState(83) = 1 and LampState(84) = 0 and LampState(85) = 0 then evright.Material = "EVYellow"
'If LampState(83) = 1 and LampState(84) = 1 and LampState(85) = 1 then evright.Material = "EVWhite"


if l28a.State = 1 then f28a.visible = 1 else f28a.visible = 0
if l28a.State = 1 then f28b.visible = 1 else f28b.visible = 0
if l28a.State = 1 then f28c.visible = 1 else f28c.visible = 0
if l29a.State = 1 then f29a.visible = 1 else f29a.visible = 0
if l29a.State = 1 then f29b.visible = 1 else f29b.visible = 0
if l29a.State = 1 then f29c.visible = 1 else f29c.visible = 0

End Sub


Sub sw1T_Timer()
	If sw1up = True and sw1p.z < 0 then sw1p.z = sw1p.z + 3
	If sw1up = False and sw1p.z > -45 then sw1p.z = sw1p.z - 3
	If sw1p.z >= -45 then sw1up = False
End Sub

Sub sw2T_Timer()
	If sw2up = True and sw2p.z < 0 then sw2p.z = sw2p.z + 3
	If sw2up = False and sw2p.z > -45 then sw2p.z = sw2p.z - 3
	If sw2p.z >= -45 then sw2up = False
End Sub

Sub sw3T_Timer()
	If sw3up = True and sw3p.z < 0 then sw3p.z = sw3p.z + 3
	If sw3up = False and sw3p.z > -45 then sw3p.z = sw3p.z - 3
	If sw3p.z >= -45 then sw3up = False
End Sub

Sub sw4T_Timer()
	If sw4up = True and sw4p.z < 0 then sw4p.z = sw4p.z + 3
	If sw4up = False and sw4p.z > -45 then sw4p.z = sw4p.z - 3
	If sw4p.z >= -45 then sw4up = False
End Sub

Sub GIOn
	dim bulb
	for each bulb in Collection1
	bulb.state = 1
	next
End Sub

Sub GIOff
	dim bulb
	for each bulb in Collection1
	bulb.state = 0
	next
End Sub

 'Sub RightSlingShot_Timer:Me.TimerEnabled = 0:End Sub
 
' *********************************************************************
'                      Supporting Ball & Sound Functions
' *********************************************************************

Sub Pins_Hit (idx)
	PlaySound "pinhit_low", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
End Sub

Sub Targets_Hit (idx)
	PlaySound "target", 0, Vol(ActiveBall), Pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0
End Sub

Sub TargetBankWalls_Hit (idx)
	PlaySound "target", 0, Vol(ActiveBall), 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 Metals2_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 Spinner_Spin
	PlaySound "fx_spinner",0,.25,0,0.25
End Sub

Sub Rubbers_Hit(idx)
 	dim finalspeed
  	finalspeed=SQR(activeball.velx * activeball.velx + activeball.vely * activeball.vely)
 	If finalspeed > 20 then 
		PlaySound "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

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


'Sub LRRail_Hit:PlaySound "fx_metalrolling", 0, 150, Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0:End Sub
'
'Sub RLRail_Hit:PlaySound "fx_metalrolling", 0, 150, Pan(ActiveBall), 0, Pitch(ActiveBall), 1, 0:End Sub

Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
    Vol = Csng(BallVel(ball) ^2 / 1)
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 / table.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 = 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)
    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 AND BOT(b).z > 0 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

Dim LeftCount:LeftCount = 0
Sub leftdrop_hit
	If LeftCount = 1 then
		playsound "BallDrop"
	End If
	LeftCount = 0
End Sub

Dim RightCount:RightCount = 0
Sub rightdrop_hit
	If RightCount = 1 then
		playsound "BallDrop"
	End If
	RightCount = 0
End Sub











#6 nFozzy

nFozzy

    Pinball Fan

  • Members
  • PipPipPipPip
  • 553 posts

  • Flag: ---------

  • Favorite Pinball: Pinbot

Posted 10 November 2017 - 12:44 AM

With JP's light routine you could try a fading sub like this (replace nFadeL procedures only on the lamps you need)

 

Sub NFadeLCallback(nr, object)
    Select Case FadingLevel(nr)
        Case 4
            object.state = 0
            FadingLevel(nr) = 0
            Execute    "LampState" & nr & "_off"
        Case 5
            object.State = 1
            FadingLevel(nr) = 1
            Execute    "LampState" & nr & "_on"
    End Select
End Sub

 

'example...
Sub LampState106_On()
    tb.text = "LampState106 On"
End Sub

Sub LampState106_Off()
    tb.text = "LampState106 Off"
End Sub
 


Edited by nFozzy, 10 November 2017 - 12:44 AM.


#7 gtxjoe

gtxjoe

    VPF Veteran

  • VIP
  • 5,152 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness, AbraCadabra



Contributor

Posted 10 November 2017 - 01:27 AM

The problem with triggering stuff off of light inserts it that light get used a lot for a lot of other things, like the attract mode sequence, or when you start multiball, all the lights flash or hit a ramp and all the lights flash, so then you have to get fancy like check if a ball is on the table or de-bounce it so brief flashes or blinking are ignored, but constant on for at least 500 msec triggers the PUP call



#8 TerryRed

TerryRed

    Pinball Fan

  • Silver Supporter
  • 1,976 posts

  • Flag: Canada

  • Favorite Pinball: Too many to choose...

Contributor

Posted 10 November 2017 - 01:42 AM

The problem with triggering stuff off of light inserts it that light get used a lot for a lot of other things, like the attract mode sequence, or when you start multiball, all the lights flash or hit a ramp and all the lights flash, so then you have to get fancy like check if a ball is on the table or de-bounce it so brief flashes or blinking are ignored, but constant on for at least 500 msec triggers the PUP call

 

That's the idea...was trying to combine a specific light coming on AND a switch / spinner for the light was triggered, gameinplay, etc...  to then do a one-shot trigger for a specific video (which won't allow for another instance for a specified time)

 

Like if the Quorra spinner / trigger was hit, AND Quorra MB light state is Lit / Blinking...then trigger PuPlayer to display Quorra MB is ready image.

 

I'm not trying to tie a video played everytime a light is lit, as like you said, attract modes cause an issue,etc....   

 

I was also trying to find a solution to this for Getaway II as well for the SHIFT being used only while the gameisinplay as opposed to everytime its lit.



#9 gtxjoe

gtxjoe

    VPF Veteran

  • VIP
  • 5,152 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness, AbraCadabra



Contributor

Posted 10 November 2017 - 01:55 AM

Ah, we thought you wanted to call a subroutine when a light insert changes state.  If you are really asking is "How do I check if a light is on or off?" That can be easy.  To check l25 llight insert,  it is 

    If l25.state = 1 Then ...            'Light is on

 

or

 

  If l25.state = 0 Then  ...               'Light is off



#10 xenonph

xenonph

    I have Pinball Fever!

  • VIP
  • 4,130 posts
  • Location:Castle Rock, WA.

  • Flag: United States of America

  • Favorite Pinball: TRON Classic-Congo-Xenon-PINBOT-BOP-LOTR-A Real American Hero OPERATION PINBALL-Millionaire-Whirlwind-Krull-NFL-BlackKnight-FishTales

Contributor

Posted 10 November 2017 - 02:04 AM

If you look at the script in the recent Buck Rogers sound mod,

I was having trouble tying a sound effect to TILT light. Specifically the sound effect was playing on table startup also, which I didn't want to happen.

Scottacus helped make the script work so the sound effect would only come on if the ball was in play.

 

Here is what he wrote...

 

 You should be able to use this method on most other tables if you can find the tilt light number.  What I did is:

 

-Dim BallinPlay -variable to let us know if a ball is on the table

-Under the BallHome_Hit subroutine I set BallinPlay = 1

-Under the Drain_Hit subroutine I set BallinPlay = 0

-Under the tilt light section 1048 or so I set 

       If BallinPlay = 1 then play the tilt sounds and stop all other sounds

 

This prevents the table from playing the tilt sound on start up but will play it if a ball is in play.  Since all tables have a drain and most have a ball home trigger you should be able to use this on most all of your table mods.

 

Hope this helps you my friend.


Edited by xenonph, 10 November 2017 - 02:07 AM.

CHECK OUT THIS TUTORIAL http://www.vpforums....howtopic=32515
TO USE DB2S BACKGLASS PROGRAM WITH DESKTOP TABLES ON 1 MONITOR
 

#11 32assassin

32assassin

    Pinball Fan

  • VIP
  • 853 posts

  • Flag: United States of America

  • Favorite Pinball: terminator 2

Posted 10 November 2017 - 02:43 AM

take a look at Icjuggalos Raven table

 

using Jps lights

he is triggering multiple objects with lights

 

Drop Targets

Enabling a Timer that moves a ramp

'***************************************************
'       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

			'Special Handling
			If chgLamp(ii,0) = 2 Then MotorChooper chgLamp(ii,1)
			If chgLamp(ii,0) = 4 Then PFGI chgLamp(ii,1)
			If (chgLamp(ii,0) = 12 And chgLamp(ii,1) = 1) Then TLB.Hit 1
			If (chgLamp(ii,0) = 13 And chgLamp(ii,1) = 1) Then TRB.Hit 1
			If (chgLamp(ii,0) = 14 And chgLamp(ii,1) = 1) Then BLB.Hit 1
			If (chgLamp(ii,0) = 15 And chgLamp(ii,1) = 1) Then BRB.Hit 1
			If chgLamp(ii,0) = 16 Then Ramp_Move chgLamp(ii,1)

        Next
    End If
    UpdateLamps
End Sub

with this

If chgLamp(ii,0) = 16 Then Ramp_Move chgLamp(ii,1)

Light ID is set up to trigger an event similar to a Solenoid Enabled Call

Sub Ramp_Move (Enabled)


End Sub

LIght 2 is triggering the spinning chopper blades similar to a solenoid call

			If chgLamp(ii,0) = 2 Then MotorChooper chgLamp(ii,1)
Sub MotorChooper(Enabled)
	If Enabled Then 'Blade On when Light 2 is on
		bladeTimer.Enabled = 1
	Else
		bladeTimer.Enabled = 0
	End if
End Sub

My Files
http://www.vpforums....4de64a621eccd40
My Table List
www.youtube.com/watch?v=DlaxLrXlPOU
See a table you like, help me complete it by finding the missing resources
https://www.dropbox....xTzKtGHTHa?dl=0

#12 TerryRed

TerryRed

    Pinball Fan

  • Silver Supporter
  • 1,976 posts

  • Flag: Canada

  • Favorite Pinball: Too many to choose...

Contributor

Posted 10 November 2017 - 02:53 AM

Ah, we thought you wanted to call a subroutine when a light insert changes state.  If you are really asking is "How do I check if a light is on or off?" That can be easy.  To check l25 llight insert,  it is 

    If l25.state = 1 Then ...            'Light is on

 

or

 

  If l25.state = 0 Then  ...               'Light is off

 

 

Hell yah...that works!  I was trying what worked for me with FP...but I probably messed it up.

 

 

 

Not that this will work perfectly for all situations...but it gives more options!

 

Still wish there was a built in:

 

Sub LAMPxxx_ON

 

Sub LAMPxxx_OFF

 

Sub LAMPxxx_BLINKING

 

 

 

Is there an equivalent :

 

 If l25.state = 2 Then ...            'Light is blinking

 

type of command?

 

I have it working with =1, but timing may not always work well in all situations...so to get around that would be to trigger a Timer when a switch is hit, and then have the Timer';s sub routine repeatedly check for the Light status (for a small amount of time), and if it is "1", then play the video one time,etc...

 

 

This may seem a bit much for what I'm doing, but its simple compared to what SLAMT1LT does with his tables to get videos and LCD displays and different sound working all together.   I know because I had to reverse engineer all his tables to figure out how this stuff works in order to add DOFLinx to those tables...as well as how I needed to mod rom's MOTU to add videos and overlay scores,etc to that table.



#13 DJRobX

DJRobX

    Pinball Fan

  • VP Dev Team
  • PipPipPipPip
  • 941 posts
  • Location:Valencia, CA

  • Flag: United States of America

  • Favorite Pinball: F14 Tomcat

Posted 10 November 2017 - 03:46 AM

 

Still wish there was a built in:

 

Sub LAMPxxx_ON

 

Sub LAMPxxx_OFF

 

Sub LAMPxxx_BLINKING

 

 

 

 

Get out of FP thinking.   :)   "Binking" is nonsense from a VPM perspective.   VPM is going to send you on, off, on, off, on, off.    Even VPM has no idea that the light is blinking.   It is just receiving signals from the program running on the ROM.    

 

I think what you're missing is that there isn't a standard implementation for receiving light change events from VPM.   There is code that's commonly copied and pasted, though.  This is why we're all asking you what table you're working on.   The code nFozzy gave you does almost exactly what you're asking for.    I myself would probably do it more like 32Assassin's code (I think that's the most efficient place to put it in terms of only calling the change event when it's really needed).     

 

The reality is that our modern machines can chew through this stuff super fast for the most part, so there's probably going to be almost no consequene to simply checking for the state combinations that you're looking for in every frame.    To keep it clean maybe make a new sub "CheckVideoEvents" and stick it at the end of UpdateLamps.   You'll also probably need to do something to ensure the video doesn't try to play if it's already playing.. maybe something like:

 

Dim IsPlayingVideo:IsPlayingVideo = 0

 

Sub CheckVideoEvents

    if L21.State = 1 AND Controller.Switch(40) = 1 AND IsPlayingVideo<>1 then

          IsPlayingVidep=1

          PinupPlayer.Play "Video1..." ' or whatever the syntax of that is.... :)

    elseif L20.State = 1 AND Controller.Switch(32) = 1 AND IsPlayingVideo<>2 then

        IsPlayingVideo=2

        PinUpPlayer.Play "Video2.."

   end if 

End Sub

 

Anyway you're getting a lot of great input from everyone.   You'll figure it out with a little patience. :)


Edited by DJRobX, 10 November 2017 - 03:59 AM.


#14 TerryRed

TerryRed

    Pinball Fan

  • Silver Supporter
  • 1,976 posts

  • Flag: Canada

  • Favorite Pinball: Too many to choose...

Contributor

Posted 10 November 2017 - 03:59 AM

 

 

Still wish there was a built in:

 

Sub LAMPxxx_ON

 

Sub LAMPxxx_OFF

 

Sub LAMPxxx_BLINKING

 

 

 

 

Get out of FP thinking.   :)   "Binking" is nonsense from a VPM perspective.   VPM is going to send you on, off, on, off, on, off.    Even VPM has no idea that the light is blinking.   It is just receiving signals from the program running on the ROM.    

 

I think what you're missing is that there isn't a standard implementation for receiving light change events from VPM.   There is code that's commonly copied and pasted, though.  This is why we're all asking you what table you're working on.   The code nFozzy gave you does almost exactly what you're asking for.    I myself would probably do it more like 32Assassin's code (I think that's the most efficient place to put it in terms of only calling the change event when it's really needed).     You're getting super great input from everyone. 

 

The reality is that our modern machines can chew through this stuff super fast for the most part, so there's probably going to be almost no consequene to simply checking for the state combinations that you're looking for in every frame.    To keep it clean maybe make a new sub "CheckVideoEvents" and stick it at the end of UpdateLamps.   Then you can do

 

Sub CheckVideoEvents

    if L21.State = 1 AND Controller.Switch(40) = 1 then PlayVideo...

 

End Sub

 

 

 

Beautiful stuff. Thank you everyone.

 

All this info is great and I love it.... I hope it doesn't come across that I don't appreciate it.

 

Like you said...I'm kind of used to seeing things done the FP way (for better or worse), so that's why I'm asking these kind of questions. I keep thinking in terms of the VP editor itself, and comparing that to FP event scripting....and forget that roms tables need to have their data interpreted. I also didn't know there isn't a standard implementation for receiving light change events from VPM.  Like you said....I need to translate FP to VP way of thinking.

 

I takes alot for me to translate DOFLinx way of thinking to DOF as well.

 

Hell, I never even touched VB until 1 year go...and before that the only programming I did was with Q Basic back in 94!

 

 

I like the idea of a main subroutine that does check for different states,etc..... makes for a better "standard" to work with.  I eventually started to do things that way with DOFLinx...and it makes updating a new table much easier.



#15 mfuegemann

mfuegemann

    Pinball Fan

  • VIP
  • 1,222 posts
  • Location:Cologne

  • Flag: Germany

  • Favorite Pinball: Medieval Madness, Fast Draw



Contributor

Posted 10 November 2017 - 07:05 AM

Hi TerryRed,

 

the commands are in already. controller.lamp(xx) for light state, controller.solenoid(xx) for solenoids and some more. See the pinmame interface description.

The calls are returning the current state, though. So for LightstateBlinking You will receive alternating True/False values.

 

Regards

Attached Files



#16 TerryRed

TerryRed

    Pinball Fan

  • Silver Supporter
  • 1,976 posts

  • Flag: Canada

  • Favorite Pinball: Too many to choose...

Contributor

Posted 12 November 2017 - 04:56 PM

With this Tron test table I'm using...its rom based....

 

Is there a standard "flag" or VP standardized Sub-routine that is used for "Start of New Game" that I can use?

 

I'm basically trying to have a Multi-Ball check when going into the Arcade.

 

I'm using "PUP_Quorra_MB_Light" and "PUP_LC_MB_Light" variables that are monitored in real-time, and if those MB lights are on or flashing then the variable value increases by 1.  When I enter the arcade kicker, I will check to see if those Light variables are something like >50, and if they are then I will display a video and picture for that MB mode,etc...   When the balls in play are drained and (balls=1), I reset these PUP_MB_Light values to 0.

 

However, I need a way to "reset those values" to 0 if we are starting a new game to start fresh, because when in attract mode they may also increase.

 

Any ideas...or better ways to do this?


Edited by TerryRed, 12 November 2017 - 04:56 PM.


#17 TerryRed

TerryRed

    Pinball Fan

  • Silver Supporter
  • 1,976 posts

  • Flag: Canada

  • Favorite Pinball: Too many to choose...

Contributor

Posted 12 November 2017 - 06:00 PM

Hmmm...well I'll be damned...this seems to be working:

 

 

This is what I added to the UpdateLamps   as per DJRobX's suggestion.

 

 

if l37.State=1 then PUP_ExtraBall_Light = PUP_ExtraBall_Light + 10
if l38.State=1 then PUP_LC_MB_Light = PUP_LC_MB_Light + 10
if l39.State=1 then PUP_Quorra_MB_Light = PUP_Quorra_MB_Light + 10
if l28.State=1 then PUP_CLU_Light = PUP_CLU_Light + 10
 
if l37.State=0 then PUP_ExtraBall_Light = PUP_ExtraBall_Light - 1
if l38.State=0 then PUP_LC_MB_Light = PUP_LC_MB_Light - 1
if l39.State=0 then PUP_Quorra_MB_Light = PUP_Quorra_MB_Light - 1
if l28.State=0 then PUP_CLU_Light= PUP_CLU_Light - 1
 
if PUP_ExtraBall_Light > 100 then PUP_ExtraBall_Light = 100
if PUP_LC_MB_Light > 100 then PUP_LC_MB_Light = 100
if PUP_Quorra_MB_Light > 100 then PUP_Quorra_MB_Light = 100
if PUP_CLU_Light > 100 then PUP_CLU_Light = 100
 
if PUP_ExtraBall_Light < 0 then PUP_ExtraBall_Light = 0
if PUP_LC_MB_Light < 0 then PUP_LC_MB_Light = 0
if PUP_Quorra_MB_Light < 0 then PUP_Quorra_MB_Light = 0
if PUP_CLU_Light < 0 then PUP_CLU_Light = 0
 
 
Then  I added this to the Arcade Kicker Sub routine using my own PUP_Arcade Sub:
 
Sub PUP_Arcade
 
'l37=extra ball, l38=LCMB, l39=QuorraMB, l40=Portal, l28=Clu
 
If HasPuP Then 
PuPlayer2.playlistplay("Arcade")
 
If PUP_ExtraBall_Light > 50 Then
PuPlayer.playlistplayex "TopperImages","LCD_ExtraBall.jpg",100,1
PuPlayer.SetLength(30)
End if
 
If PUP_LC_MB_Light > 50 Then
PuPlayer.playlistplayex "TopperImages","LCD_LCPrompt.jpg",100,1
PuPlayer.SetLength(30)
End if
 
If PUP_Quorra_MB_Light > 50 Then
PuPlayer.playlistplayex "TopperImages","LCD_QuorraPrompt.jpg",100,1
PuPlayer.SetLength(30)
End if
 
If PUP_CLU_Light > 50 Then
PuPlayer.playlistplayex "TopperImages","LCD_CLUPrompt.jpg",100,1
PuPlayer.SetLength(30)
End if
 
End if
End Sub
 
 
 
It needs fine tuining, and since that Arcade kicker can enable multiple modes at the same time, I have to sort out priories,etc as to what gets displayed...but it's working!
 

Edited by TerryRed, 12 November 2017 - 06:31 PM.


#18 TerryRed

TerryRed

    Pinball Fan

  • Silver Supporter
  • 1,976 posts

  • Flag: Canada

  • Favorite Pinball: Too many to choose...

Contributor

Posted 14 November 2017 - 02:55 AM

I was having a hell of a time trying to use table lights to trigger things with good timing... then I finally realised...the one thing that is always consistent during certain events are the neon ramp colours!

 

I basically have all the needed variables for “lights” and “Ramp colours”  set so that if they are blinking they will keep adding up to a MAX amount. If they are continuously not blinking or on at all, they are off.  (man this part is so much easier with FP)

 

When you go into the Arcade Kicker, it will first check to see what status each of the MB lights are...and tag them as Lit. Then when the game changes colours of the ramps to indicate the different MB modes that are active... it will check for both the ramps colour and the MB_Light_Lit status for each one in turn and then play a video or pic as it progresses through each, before starting the MB modes. Sometimes it happens so quickly that one mode won’t display anything...but it works!

 

So, now when I hit the Quorra spinner....it will only show a Quorra video when it supposed to (neon ramps are green) as opposed to every time you go through the spinner (which can also give off other colours).  I also have it letting you know when Quorra MB is ready with a picture (temp pic)...and it won’t keep showing you again after that, until the Quorra MB is unlit. (It needs both green neon ramps and Quorra MB lit).

 

Lots more to do...and I know I won’t be able to do everything I want..but now that I’m getting this part figured out...I can do more.  Not as much as SLAMT1LT’s FP version....but still pretty damn good, with better looking videos.  :)



#19 TerryRed

TerryRed

    Pinball Fan

  • Silver Supporter
  • 1,976 posts

  • Flag: Canada

  • Favorite Pinball: Too many to choose...

Contributor

Posted 15 November 2017 - 06:55 AM

OK...so had some time to play with PUP B2S Config Program.

 

VERY NICE!  I kid you not...it took me very little time to do a very nice Tron Legacy PUP setup with the PUP b2s config. I already have a nice spreadsheet from when I did the DOF MX Led update for this table for VPX....so it didn’t take me long at all to get this baby PUP’d.

 

B2S working without any big issues. Very impressed!

 

Because of NB's approach to doing this with the B2S support....sharing a PUP B2S mod for a table is as simple as copying a single folder with all the videos and config files. Nothing else to do as long as B2S is working, and PinUp Player is already installed and configured.

 

Keep in mind this won’t be as good as a modded version of a table that has better control for playing video and LCD graphics for Toppers,etc.. but still...   Simply awesome!!!


Edited by TerryRed, 15 November 2017 - 06:58 AM.


#20 TerryRed

TerryRed

    Pinball Fan

  • Silver Supporter
  • 1,976 posts

  • Flag: Canada

  • Favorite Pinball: Too many to choose...

Contributor

Posted 29 November 2017 - 04:44 AM

Needless to say.... alot of progression has come from this original post:  :)

 

 

 

 

 

 

 

To give you guys an idea of what it took to make this work using the playfield lights and ramp light for control and triggering.... here is just the light checks i had to create:

'********* Realtime Light Checks for PinUp Player **********************

if HasPuP Then 

	if l37.State=1 then PUP_ExtraBall_Light = PUP_ExtraBall_Light + 10
	if l38.State=1 then PUP_LC_MB_Light = PUP_LC_MB_Light + 50
	if l39.State=1 then PUP_Quorra_MB_Light = PUP_Quorra_MB_Light + 50
	if l28.State=1 then PUP_CLU_Light = PUP_CLU_Light + 50
	if l9.state=1 then PUP_C = PUP_C + 40
	if l30.state=1 then PUP_L = PUP_L + 40
	if l31.state=1 then PUP_U = PUP_U + 40
	if f131a.state=1 then PUP_DiscBattle = PUP_DiscBattle + 10
	if l45.state=1 then PUP_ArcadeLight = PUP_ArcadeLight + 100
	if l40.state=1 then PUP_PortalLight = PUP_PortalLight + 100
	if l12.state=1 then PUP_ZuseZ = PUP_ZuseZ + 10
	if l10.state=1 then PUP_ZuseU = PUP_ZuseU + 10
	if l43.state=1 then PUP_ZuseS = PUP_ZuseS + 10
	if l29.state=1 then PUP_ZuseE = PUP_ZuseE + 10
	if l26.state=1 then PUP_ShootAgain = PUP_ShootAgain + 100
	if l14.state=1 then PUP_LeftOrbit_LC = PUP_LeftOrbit_LC + 50
	if l11.state=1 then PUP_BlueLCRamp_LC = PUP_BlueLCRamp_LC + 50
	if l62.state=1 then PUP_Quorra_LC = PUP_Quorra_LC + 50
	if l42.state=1 then PUP_YellowLCRamp_LC = PUP_YellowLCRamp_LC + 50
	if l59.state=1 then PUP_Gem_LC = PUP_Gem_LC + 50
	if l35.state=1 then PUP_RightOrbit_LC = PUP_RightOrbit_LC + 50
	if l15.state=1 then PUP_LeftOrbit_Disc = PUP_LeftOrbit_Disc + 50
	if l50.state=1 then PUP_BlueLCRamp_Disc = PUP_BlueLCRamp_Disc + 50
	if l63.state=1 then PUP_Quorra_Disc = PUP_Quorra_Disc + 50
	if l58.state=1 then PUP_Gem_Disc = PUP_Gem_Disc + 50
	if l55.state=1 then PUP_YellowLCRamp_Disc = PUP_YellowLCRamp_Disc + 50
	if l34.state=1 then PUP_RightOrbit_Disc = PUP_RightOrbit_Disc + 50
	if l13.state=1 then PUP_LeftOrbit_Clu = PUP_LeftOrbit_Clu + 50
	if l61.state=1 then PUP_Quorra_Clu = PUP_Quorra_Clu + 50
	if l36.state=1 then PUP_RightOrbit_Clu = PUP_RightOrbit_Clu + 50

	if l37.State=0 then PUP_ExtraBall_Light = PUP_ExtraBall_Light - 2
	if l38.State=0 then PUP_LC_MB_Light = PUP_LC_MB_Light - 2
	if l39.State=0 then PUP_Quorra_MB_Light = PUP_Quorra_MB_Light - 2	
	if l28.State=0 then PUP_CLU_Light= PUP_CLU_Light - 2
	if l9.state=0 then PUP_C = PUP_C - 2
	if l30.state=0 then PUP_L = PUP_L - 2
	if l31.state=0 then PUP_U = PUP_U - 2
	if f131a.state=0 then PUP_DiscBattle = PUP_DiscBattle - 2
	if l45.state=0 then PUP_ArcadeLight = PUP_ArcadeLight - 2
	if l40.state=0 then PUP_PortalLight = PUP_PortalLight - 2
	if l12.state=0 then PUP_ZuseZ = PUP_ZuseZ - 10
	if l10.state=0 then PUP_ZuseU = PUP_ZuseU - 10
	if l43.state=0 then PUP_ZuseS = PUP_ZuseS - 10
	if l29.state=0 then PUP_ZuseE = PUP_ZuseE - 10
	if l26.state=0 then PUP_ShootAgain = PUP_ShootAgain - 5
	if l14.state=0 then PUP_LeftOrbit_LC = PUP_LeftOrbit_LC -2
	if l11.state=0 then PUP_BlueLCRamp_LC = PUP_BlueLCRamp_LC - 2
	if l62.state=0 then PUP_Quorra_LC = PUP_Quorra_LC - 2
	if l42.state=0 then PUP_YellowLCRamp_LC = PUP_YellowLCRamp_LC - 2
	if l59.state=0 then PUP_Gem_LC = PUP_Gem_LC - 2
	if l35.state=0 then PUP_RightOrbit_LC = PUP_RightOrbit_LC - 2
	if l15.state=0 then PUP_LeftOrbit_Disc = PUP_LeftOrbit_Disc - 2
	if l50.state=0 then PUP_BlueLCRamp_Disc = PUP_BlueLCRamp_Disc - 2
	if l63.state=0 then PUP_Quorra_Disc = PUP_Quorra_Disc - 2
	if l58.state=0 then PUP_Gem_Disc = PUP_Gem_Disc - 2
	if l55.state=0 then PUP_YellowLCRamp_Disc = PUP_YellowLCRamp_Disc - 2
	if l34.state=0 then PUP_RightOrbit_Disc = PUP_RightOrbit_Disc - 2
	if l13.state=0 then PUP_LeftOrbit_Clu = PUP_LeftOrbit_Clu -2
	if l61.state=0 then PUP_Quorra_Clu = PUP_Quorra_Clu -2
	if l36.state=0 then PUP_RightOrbit_Clu = PUP_RightOrbit_Clu -2

	if PUP_ExtraBall_Light > 300 then PUP_ExtraBall_Light = 300
	if PUP_LC_MB_Light > 300 then PUP_LC_MB_Light = 300
	if PUP_Quorra_MB_Light > 300 then PUP_Quorra_MB_Light = 300
	if PUP_CLU_Light > 300 then PUP_CLU_Light = 300
	if PUP_C > 200 then PUP_C = 200
	if PUP_L > 200 then PUP_L = 200
	if PUP_U > 200 then PUP_U = 200
	if PUP_DiscBattle >200 then PUP_DiscBattle = 200
	if PUP_ArcadeLight >200 then PUP_ArcadeLight = 200
	if PUP_PortalLight >200 then PUP_PortalLight = 200
	if PUP_ZuseZ >=200 then PUP_ZuseZ =200
	if PUP_ZuseU >=200 then PUP_ZuseU =200
	if PUP_ZuseS >=200 then PUP_ZuseS =200
	if PUP_ZuseE >=200 then PUP_ZuseE =200
	if PUP_ShootAgain >=600 then PUP_ShootAgain =600
	if PUP_LeftOrbit_LC >=200 then PUP_LeftOrbit_LC =200
	if PUP_YellowLCRamp_LC >=200 then PUP_YellowLCRamp_LC =200
	if PUP_Quorra_LC >=200 then PUP_Quorra_LC =200
	if PUP_BlueLCRamp_LC >=200 then PUP_BlueLCRamp_LC =200
	if PUP_Gem_LC >=200 then PUP_Gem_LC =200
	if PUP_RightOrbit_LC >=200 then PUP_RightOrbit_LC =200
	if PUP_LeftOrbit_Disc >=200 then PUP_LeftOrbit_Disc =200
	if PUP_BlueLCRamp_Disc >=200 then PUP_BlueLCRamp_Disc =200
	if PUP_Quorra_Disc >=200 then PUP_Quorra_Disc =200
	if PUP_Gem_Disc >=200 then PUP_Gem_Disc =200
	if PUP_YellowLCRamp_Disc >=200 then PUP_YellowLCRamp_Disc =200
	if PUP_RightOrbit_Disc >=200 then PUP_RightOrbit_Disc =200
	if PUP_LeftOrbit_Clu >200 then PUP_LeftOrbit_Clu =200
	if PUP_Quorra_Clu >200 then PUP_Quorra_Clu =200
	if PUP_RightOrbit_Clu >200 then PUP_RightOrbit_Clu =200


	if PUP_ExtraBall_Light < 0 then PUP_ExtraBall_Light = 0
	if PUP_LC_MB_Light < 0 then PUP_LC_MB_Light = 0
	if PUP_Quorra_MB_Light < 0 then PUP_Quorra_MB_Light = 0
	if PUP_CLU_Light < 0 then PUP_CLU_Light = 0
	if PUP_C < 0 then PUP_C = 0
	if PUP_L < 0 then PUP_L = 0
	if PUP_U < 0 then PUP_U = 0
	if PUP_DiscBattle < 0 then PUP_DiscBattle = 0
	if PUP_ArcadeLight <0 then PUP_ArcadeLight = 0
	if PUP_PortalLight < 0 then PUP_PortalLight = 0
	if PUP_ZuseZ <=0 then PUP_ZuseZ =0
	if PUP_ZuseU <=0 then PUP_ZuseU =0
	if PUP_ZuseS <=0 then PUP_ZuseS =0
	if PUP_ZuseE <=0 then PUP_ZuseE =0
	if PUP_ShootAgain <=0 then PUP_ShootAgain =0
	if PUP_LeftOrbit_LC <=0 then PUP_LeftOrbit_LC =0
	if PUP_YellowLCRamp_LC <=0 then PUP_YellowLCRamp_LC =0
	if PUP_Quorra_LC <=0 then PUP_Quorra_LC =0
	if PUP_BlueLCRamp_LC <=0 then PUP_BlueLCRamp_LC =0
	if PUP_Gem_LC <=0 then PUP_Gem_LC =0
	if PUP_RightOrbit_LC <=0 then PUP_RightOrbit_LC =0
	if PUP_LeftOrbit_Disc <=0 then PUP_LeftOrbit_Disc =0
	if PUP_BlueLCRamp_Disc <=0 then PUP_BlueLCRamp_Disc =0
	if PUP_Quorra_Disc <=0 then PUP_Quorra_Disc =0
	if PUP_Gem_Disc <=0 then PUP_Gem_Disc =0
	if PUP_YellowLCRamp_Disc <=0 then PUP_YellowLCRamp_Disc =0
	if PUP_RightOrbit_Disc <=0 then PUP_RightOrbit_Disc =0
	if PUP_LeftOrbit_Clu >200 then PUP_LeftOrbit_Clu =0
	if PUP_Quorra_Clu <=0 then PUP_Quorra_Clu =0
	if PUP_RightOrbit_Clu <=0 then PUP_RightOrbit_Clu =0
	
	'***** Neon Ramp Light Colour Checks ******
	
	If LampState(75) = 0 and LampState(76) = 1 and LampState(77) = 0 then
		PUP_Ramp_Green = PUP_Ramp_Green +50
		Else 
		PUP_Ramp_Green = PUP_Ramp_Green - 2
	End if
	If PUP_Ramp_Green > 200 then PUP_Ramp_Green = 200
	If PUP_Ramp_Green < 0 then PUP_Ramp_Green = 0

	If LampState(75) = 0 and LampState(76) = 0 and LampState(77) = 1 then
		PUP_Ramp_Blue = PUP_Ramp_Blue +10
		Else 
		PUP_Ramp_Blue = PUP_Ramp_Blue - 2
	End if
	If PUP_Ramp_Blue > 200 then PUP_Ramp_Blue = 200
	If PUP_Ramp_Blue < 0 then PUP_Ramp_Blue = 0

	If LampState(75) = 0 and LampState(76) = 1 and LampState(77) = 1 then
		PUP_Ramp_LightBlue = PUP_Ramp_LightBlue +10
		Else 
		PUP_Ramp_LightBlue = PUP_Ramp_LightBlue - 2
	End if
	If PUP_Ramp_LightBlue > 400 then PUP_Ramp_LightBlue = 400
	If PUP_Ramp_LightBlue < 0 then PUP_Ramp_LightBlue = 0

	If LampState(75) = 1 and LampState(76) = 1 and LampState(77) = 1 then
		PUP_Ramp_White = PUP_Ramp_White +10
		Else 
		PUP_Ramp_White = PUP_Ramp_White - 2
	End if
	If PUP_Ramp_White > 200 then PUP_Ramp_White = 200
	If PUP_Ramp_White < 0 then PUP_Ramp_White = 0

	If LampState(75) = 1 and LampState(76) = 1 and LampState(77) = 0 then
		PUP_Ramp_Yellow = PUP_Ramp_Yellow +50
		Else 
		PUP_Ramp_Yellow = PUP_Ramp_Yellow - 2
	End if
	If PUP_Ramp_Yellow > 200 then PUP_Ramp_Yellow = 200
	If PUP_Ramp_Yellow < 0 then PUP_Ramp_Yellow = 0

End If

'******* PinUp Player Light checks end here *******************

.... and this is the first init of PinUp Player at the top of the table:

'*************************************************************

'          ****** PinUp Player: by NailBuster ******

'PinUp Player mod and media for this table created by TerryRed

'This table is a standalone PinUp Player mod, and is NOT to be
'used with a PinUPB2S! This means you CANNOT have anything in 
'the "PUPVideos\trn_174h" folder! It must be empty!If there 
'isn't a trn_174h folder, PinUp Player will create one. This 
'is normal, as its part of the PinUPB2S function.

'The Video Playlist folders for this table should be in the 
' "PUPVideos\Tron_Legacy" folder.

'Note: I only created new code for PinUp Player and have not 
'changed anything to do with gameplay or function. My PinUp 
'Player related code all begins with "PUP_". Most of it can
'be found at the bottom of the script.

'PinUp Player commands begin with "PuPlayer".
'
'Change HasPuP = True if using PinUp Player Videos

Const HasPuP = True

Dim PuPlayer

if HasPuP Then
Set PuPlayer = CreateObject("PinUpPlayer.PinDisplay") 

'This Initiates PinUp Player for each screen.
'It will use the "Tron_Legacy" folder in "PUPVideos"
PuPlayer.Init 0,"Tron_Legacy"
PuPlayer.Init 2,"Tron_Legacy"

'Backglass Screen (2) playlist videos
PuPlayer.playlistadd 2,"Clu", 1 , 2
PuPlayer.playlistadd 2,"CluMode", 1 , 2
PuPlayer.playlistadd 2,"Quorra", 0 , 2
PuPlayer.playlistadd 2,"Recognizer", 0 , 4
PuPlayer.playlistadd 2,"Arcade", 0 , 2
PuPlayer.playlistadd 2,"Gem", 0 , 1
PuPlayer.playlistadd 2,"GemMode", 0 , 3
PuPlayer.playlistadd 2,"ZuseMode", 0 , 3
PuPlayer.playlistadd 2,"QuorraMB", 0 , 3
PuPlayer.playlistadd 2,"QuorraMBLit", 0 , 3
PuPlayer.playlistadd 2,"ExtraBall", 0 , 3
PuPlayer.playlistadd 2,"LightCycle", 0 , 3
PuPlayer.playlistadd 2,"LightCycleMB", 0 , 3
PuPlayer.playlistadd 2,"LightCycleMBLit", 0 , 3
PuPlayer.playlistadd 2,"DiscBattleReady", 0 , 3
PuPlayer.playlistadd 2,"DiscBattleMB", 0 , 3
PuPlayer.playlistadd 2,"DiscBattleJackpot", 0 , 3
PuPlayer.playlistadd 2,"DiscBattle", 0 , 3
PuPlayer.playlistadd 2,"DaftPunk", 0 , 3
PuPlayer.playlistadd 2,"Drain", 1 , 3
PuPlayer.playlistadd 2,"LightCycleJackpot", 1 , 2
PuPlayer.playlistadd 2,"QuorraJackpot", 1 , 2

'Topper Screen (0) playlist videos
PuPlayer.playlistadd 0,"ZuseZ", 1 , 1
PuPlayer.playlistadd 0,"ZuseU", 1 , 1
PuPlayer.playlistadd 0,"ZuseS", 1 , 1
PuPlayer.playlistadd 0,"ZuseE", 1 , 1
PuPlayer.playlistadd 0,"TronT", 1 , 1
PuPlayer.playlistadd 0,"TronR", 1 , 1
PuPlayer.playlistadd 0,"TronO", 1 , 1
PuPlayer.playlistadd 0,"TronN", 1 , 1
PuPlayer.playlistadd 0,"LightCycleMBInfo", 0 , 3
PuPlayer.playlistadd 0,"QuorraMBInfo", 0 , 3
PuPlayer.playlistadd 0,"CluModeInfo", 1 , 3
PuPlayer.playlistadd 0,"ZuseModeInfo", 0 , 3
PuPlayer.playlistadd 0,"GemModeInfo", 0 , 3
PuPlayer.playlistadd 0,"DiscWarsMBInfo", 0 , 3
PuPlayer.playlistadd 0,"EndOfLine", 0 , 3
PuPlayer.playlistadd 0,"ShootAgain", 1 , 1
PuPlayer.playlistadd 0,"MultiballEnd", 1 , 1

End if

'**********************************************************

....and this is the Monster of the Main PinUp Player code I had to create:



'****************************************************
' PinUp Player mod Main Section - created by TeryRed

' PinUp Player by: NailBuster

' All related code throughout the rest of the script 
' begins with "PUP_"
'****************************************************

Dim PUP_ExtraBall_Light
Dim PUP_LC_MB_Light
Dim PUP_Quorra_MB_Light
Dim PUP_Quorra_Advance
Dim PUP_CLU_Light
Dim PUP_LC_Advance
Dim PUP_C
Dim PUP_L
Dim PUP_U
Dim PUP_Quorra_LC
Dim PUP_DiscBattle
Dim PUP_ArcadeLight
Dim PUP_PortalLight
Dim PUP_ZuseZ
Dim PUP_ZuseU
Dim PUP_ZuseS
Dim PUP_ZuseE
Dim PUP_ShootAgain
Dim PUP_QuorraMB_Active
Dim PUP_LightCycleMB_Active
Dim PUP_DiscWarsMB_Active
Dim PUP_LeftOrbit_LC
Dim PUP_YellowLCRamp_LC
Dim PUP_BlueLCRamp_LC
Dim PUP_Gem_LC
Dim PUP_RightOrbit_LC
Dim PUP_LeftOrbit_Disc
Dim PUP_BlueLCRamp_Disc
Dim PUP_Quorra_Disc
Dim PUP_Gem_Disc
Dim PUP_YellowLCRamp_Disc
Dim PUP_RightOrbit_Disc
Dim PUP_LeftOrbit_Clu
Dim PUP_Quorra_Clu
Dim PUP_RightOrbit_Clu

Dim PUP_ExtraBall_Lit
Dim PUP_LC_MB_Lit
Dim PUP_Quorra_MB_Lit
Dim PUP_Clu_Lit
Dim PUP_Portal_Lit

Dim PUP_Ramp_Green
Dim PUP_Ramp_Blue
Dim PUP_Ramp_LightBlue
Dim PUP_Ramp_Yellow
Dim PUP_Ramp_White

Dim PUP_RecognizerHit
Dim PUP_RecognizerBankGoDown

PUP_ExtraBall_Light=0
PUP_LC_MB_Light=0
PUP_Quorra_MB_Light=0
PUP_CLU_Light=0
PUP_Quorra_Advance=0
PUP_LC_Advance=0
PUP_C=0
PUP_L=0
PUP_U=0
PUP_Quorra_LC=0
PUP_DiscBattle=0
PUP_ArcadeLight=0
PUP_PortalLight=0
PUP_ZuseZ=0
PUP_ZuseU=0
PUP_ZuseS=0
PUP_ZuseE=0
PUP_ShootAgain=0
PUP_LeftOrbit_LC=0
PUP_YellowLCRamp_LC=0
PUP_BlueLCRamp_LC=0
PUP_Gem_LC=0
PUP_RightOrbit_LC=0
PUP_LeftOrbit_Disc=0
PUP_BlueLCRamp_Disc=0
PUP_Quorra_Disc=0
PUP_Gem_Disc=0
PUP_YellowLCRamp_Disc=0
PUP_RightOrbit_Disc=0
PUP_LeftOrbit_Clu=0
PUP_Quorra_Clu=0
PUP_RightOrbit_Clu=0

PUP_Ramp_Green=0
PUP_Ramp_Blue = 0
PUP_Ramp_LightBlue = 0
PUP_Ramp_Yellow = 0
PUP_Ramp_White = 0

PUP_ExtraBall_Lit=False
PUP_LC_MB_Lit=False
PUP_Quorra_MB_Lit=False
PUP_Clu_Lit=False
PUP_Portal_Lit=False
PUP_RecognizerHit=False
PUP_RecognizerBankGoDown=False

PUP_QuorraMB_Active=False
PUP_LightCycleMB_Active=False
PUP_DiscWarsMB_Active=False

Sub PUP_Arcade
	'l37=extra ball, l38=LCMB, l39=QuorraMB, l40=Portal, l28=Clu
	If HasPuP Then 
		PUP_ExtraBall_Lit=False
		PUP_LC_MB_Lit=False
		PUP_Quorra_MB_Lit=False
		PUP_Clu_Lit=False
		PUP_Portal_Lit=False
		If PUP_ExtraBall_Light >= 10 Then PUP_ExtraBall_Lit=True
		If PUP_CLU_Light >= 10 Then PUP_Clu_Lit=True
		If PUP_LC_MB_Light >= 10 Then PUP_LC_MB_Lit=True
		If PUP_Quorra_MB_Light >= 10 Then PUP_Quorra_MB_Lit=True
		If PUP_PortalLight >= 10 Then PUP_Portal_Lit=True
		If PUP_PortalLight <=0 Then PUP_Portal_Lit=False
		If PUP_ArcadeLight >=10 then
			PuPlayer.playlistplay 2,("Arcade")
		End If
		PUP_Arcade_Check.enabled=True
	End if
End Sub

Sub PUP_Arcade_Check_Timer()
	If HasPuP Then 
		'if PUP_Ramp_White >=10 Then
		'	PuPlayer.playlistplayex 2,"ZuseMode","",100,0
		'	PuPlayer.playlistplayex 0,"ZuseModeInfo","",100,0
		'	PuPlayer.SetLength 0,3
		'End if
		If PUP_Ramp_LightBlue >=10 and PUP_QuorraMB_Active=False and PUP_LightCycleMB_Active=False and PUP_DiscWarsMB_Active=False Then
			PuPlayer.playlistplayex 2,"GemMode","",100,0
			PuPlayer.playlistplayex 0,"GemModeInfo","",100,0
			PuPlayer.SetLength 0,10
		End if
		If PUP_ExtraBall_Lit = True Then
			PuPlayer.playlistplayex 2,"ExtraBall","",100,2
			PUP_ExtraBall_Lit = False
		End if
		if PUP_Ramp_Yellow >=10 and PUP_Clu_Lit=True and PUP_QuorraMB_Active=False and PUP_LightCycleMB_Active=False and PUP_DiscWarsMB_Active=False Then
			PuPlayer.playlistplayex 2,"CluMode","",100,3
			PuPlayer.playlistplayex 0,"CluModeInfo","",100,3
			PuPlayer.SetLength 0,6
			PUP_Clu_Lit=False
		End if
		if PUP_Ramp_Yellow >=10 and PUP_LC_MB_Lit=True and PUP_Clu_Lit=False Then
			PuPlayer.playlistplayex 2,"LightCycleMB","",100,4
			PuPlayer.playlistplayex 0,"LightCycleMBInfo","",100,4
			PuPlayer.SetLength 0,8
			PuPlayer.SetLoop 0,1
			PUP_LC_MB_Lit=False
			PUP_LightCycleMB_Active=True
		End if
		if PUP_Ramp_Green >=10 and PUP_Quorra_MB_Lit=True Then
			PuPlayer.playlistplayex 0,"QuorraMBInfo","",100,5
			PuPlayer.SetLength 0,8
			PuPlayer.SetLoop 0,1
			PuPlayer.playlistplayex 2,"QuorraMB","",100,5
			PuPlayer.SetLength 2,8
			PUP_Quorra_MB_Lit=False
			PUP_QuorraMB_Active=True
		End if
		'If PUP_RecognizerBankGoDown = True and PUP_ArcadeLight >=10 Then
		'	PuPlayer.playlistplayex 2,"DiscBattleReady","",100,9
		'End if
	End if
End Sub

Sub PUP_YellowLCRamp
	if HasPuP Then 
		If PUP_LightCycleMB_Active=False and PUP_YellowLCRamp_LC >= 10 Then
			PUP_LC_MB_Check.enabled=True
		End IF
		if PUP_LightCycleMB_Active=False and PUP_YellowLCRamp_LC <= 0 and PUP_Ramp_Blue <=0 then
			PuPlayer.playlistplayex 2,"DaftPunk","",100,1   
		End If
		If PUP_LightCycleMB_Active=True and PUP_YellowLCRamp_LC >=10 Then
			PuPlayer.playlistplay 2,("LightCycleJackpot")
		End If
		If PUP_Ramp_Blue >=10 and PUP_YellowLCRamp_Disc >=10 Then 
			PuPlayer.playlistplay 2,("DiscBattleJackpot")
		End If
	End if
End Sub

Sub PUP_BlueLCRamp
	if HasPuP Then 
		If PUP_LightCycleMB_Active=False and PUP_BlueLCRamp_LC >= 10 Then
			PUP_LC_MB_Check.enabled=True
		End IF
		If PUP_LightCycleMB_Active=False and PUP_BlueLCRamp_LC <= 0 and PUP_Ramp_Blue <=0 then
			PuPlayer.playlistplayex 2,"DaftPunk","",100,1   
		End If
		If PUP_LightCycleMB_Active=True and PUP_BlueLCRamp_LC >= 10 Then
			PuPlayer.playlistplay 2,("LightCycleJackpot")
		End If
		If PUP_Ramp_Blue >=10 and PUP_BlueLCRamp_Disc >=10 Then 
			PuPlayer.playlistplay 2,("DiscBattleJackpot")
		End If
	End if
End Sub

Sub PUP_LC_Ramp_Check_Timer()
	if HasPuP Then 
		if PUP_Ramp_Yellow >=10 then 		
			if PUP_LC_MB_Light >= 10 then 
				PuPlayer.playlistplayex 2,"LightCycleMBLit","",100,10
			Else
				PuPlayer.playlistplay 2,("LightCycle")
			End If
		End IF
		if PUP_Ramp_Yellow <=0 and PUP_Ramp_Blue <=0 then
			PuPlayer.playlistplayex 2,"DaftPunk","",100,1   'Note - Lowest Priorty for playback
		End If
	End If
	PUP_LC_Ramp_Check.enabled=False
End Sub

Sub PUP_OrbitLeft
	if HasPuP Then 
		If PUP_LightCycleMB_Active=False and PUP_LeftOrbit_LC >= 10 Then
			PUP_LC_MB_Check.enabled=True
		End If
		If PUP_LightCycleMB_Active=True and PUP_LeftOrbit_LC >= 10 Then
			PuPlayer.playlistplay 2,("LightCycleJackpot")
		End If
		If PUP_Ramp_Blue >=10 and PUP_LeftOrbit_Disc >=10 Then 
			PuPlayer.playlistplay 2,("DiscBattleJackpot")
		End If
		If PUP_LeftOrbit_Clu >=10 and PUP_LeftOrbit_LC <= 0 Then
			PuPlayer.playlistplay 2,("Clu")
		End If
	End if
End Sub

Sub PUP_OrbitRight
	if HasPuP Then 
		If PUP_LightCycleMB_Active=False and PUP_RightOrbit_LC >= 10 Then
			PUP_LC_MB_Check.enabled=True
		End If
		If PUP_LightCycleMB_Active=True and PUP_RightOrbit_LC >= 10 Then
			PuPlayer.playlistplay 2,("LightCycleJackpot")
		End If
		If PUP_Ramp_Blue >=10 and PUP_RightOrbit_Disc >=10 Then 
			PuPlayer.playlistplay 2,("DiscBattleJackpot")
		End If
		If PUP_RightOrbit_Clu >=10 and PUP_RightOrbit_LC <= 0 Then
			PuPlayer.playlistplay 2,("Clu")
		End If
	End if
End Sub

Sub PUP_LC_MB_Check_Timer()
	If HasPuP Then 
		'if PUP_Ramp_Yellow >=10 and PUP_LightCycleMB_Active=False then 		
			if PUP_LC_MB_Light >= 10 then 
				PuPlayer.playlistplayex 2,"LightCycleMBLit","",100,10
				Else
				PuPlayer.playlistplay 2,("LightCycle")
			End If
		'End If
	End If
	PUP_LC_MB_Check.Enabled=False
End Sub

Sub PUP_Quorra_Spinner_Trigger_Hit   'Created a NEW trigger by the Quorra Spinner. Works better than a spinner for PUP
	If HasPuP Then 
		PUP_QuorraMB_Check.Enabled = True
	End If
End Sub

Sub PUP_QuorraMB_Check_Timer()
	if HasPuP Then 
		if PUP_Ramp_Yellow >=10 and PUP_Quorra_LC >=10 and PUP_LightCycleMB_Active=False then 
		'if PUP_Quorra_LC >=10 and PUP_LightCycleMB_Active=False then 
			if PUP_LC_MB_Light >= 10 then 
				PuPlayer.playlistplayex 2,"LightCycleMBLit","",100,10
				Else
				PuPlayer.playlistplay 2,("LightCycle")
			End If
		End If
		if PUP_Ramp_Green >=10 and PUP_QuorraMB_Active=False then 
			if PUP_Quorra_MB_Light >= 10 then 
				PuPlayer.playlistplayex 2,"QuorraMBLit","",100,1
				Else
				PuPlayer.playlistplay 2,("Quorra")
			End If
		End If
		If PUP_QuorraMB_Active=True Then
			PuPlayer.playlistplay 2,("QuorraJackpot")
		End If
		If PUP_LightCycleMB_Active=True and PUP_Quorra_LC >=10 Then
			PuPlayer.playlistplay 2,("LightCycleJackpot")
		End If
		If PUP_Ramp_Blue >=10 and PUP_Quorra_Disc >=10 Then 
			PuPlayer.playlistplay 2,("DiscBattleJackpot")
		End If
		If PUP_Quorra_Clu >=10 and PUP_Quorra_LC <= 0 Then
			PuPlayer.playlistplay 2,("Clu")
		End If
	End If
	PUP_QuorraMB_Check.Enabled=False
End Sub

Sub PUP_QuorraSpinner   'not used because creating a NEW trigger works better for PUP than a spinner
	If HasPuP Then 
		'PUP_QuorraMB_Check.Enabled = True
	End If
End Sub

Sub PUP_Follow_Gem
	if HasPuP Then
		If PUP_LightCycleMB_Active=True and PUP_Gem_LC >= 10 Then
			PuPlayer.playlistplay 2,("LightCycleJackpot")
		End If
		If PUP_Ramp_Blue >=10 and PUP_Gem_Disc >=10 Then 
			PuPlayer.playlistplay 2,("DiscBattleJackpot")
		End If
		If PUP_QuorraMB_Active=True Then
			PuPlayer.playlistplay 2,("QuorraJackpot")
		End If
		If PUP_LightCycleMB_Active=False and PUP_QuorraMB_Active=False and PUP_DiscWarsMB_Active=False Then
			PuPlayer.playlistplay 2,("Gem")
			PUP_Gem_Check.enabled=True
		End If
	End if
End Sub

Sub PUP_Gem_Check_Timer()
	If HasPuP then
		if PUP_Ramp_LightBlue >=260 then 
			PuPlayer.playlistplayex 2,"GemMode","",100,1
			If PUP_QuorraMB_Active=False and PUP_LightCycleMB_Active=False and PUP_DiscWarsMB_Active=False Then
				PuPlayer.playlistplayex 0,"GemModeInfo","",100,1
				PuPlayer.SetLength 0,10
			End If
		End If
	End If
	PUP_Gem_Check.enabled=false
	PUP_Ramp_LightBlue = 0
End Sub

Sub PUP_Zuse_Z
	if HasPuP Then
		If PUP_ZuseU >=200 and PUP_ZuseS >=200 and PUP_ZuseE >=200 then
			PUP_Zuse_Check.enabled = True
		Else
			If PUP_QuorraMB_Active=False and PUP_LightCycleMB_Active=False and PUP_DiscWarsMB_Active=False Then
			PuPlayer.playlistplayex 0,"ZuseZ","",100,0
			PuPlayer.SetLength 0,2
			End If
		End If
	End If
End Sub

Sub PUP_Zuse_U
	if HasPuP Then
		If PUP_ZuseZ >=200 and PUP_ZuseS >=200 and PUP_ZuseE >=200 then
			PUP_Zuse_Check.enabled = True
		Else
			If PUP_QuorraMB_Active=False and PUP_LightCycleMB_Active=False and PUP_DiscWarsMB_Active=False Then
			PuPlayer.playlistplayex 0,"ZuseU","",100,0
			PuPlayer.SetLength 0,2
			End If
		End If
	End If
End Sub

Sub PUP_Zuse_S
	if HasPuP Then
		If PUP_ZuseZ >=200 and PUP_ZuseU >=200 and PUP_ZuseE >=200 then
			PUP_Zuse_Check.enabled = True
		Else
			If PUP_QuorraMB_Active=False and PUP_LightCycleMB_Active=False and PUP_DiscWarsMB_Active=False Then
			PuPlayer.playlistplayex 0,"ZuseS","",100,0
			PuPlayer.SetLength 0,2
			End If
		End If
	End If
End Sub

Sub PUP_Zuse_E
	if HasPuP Then
		If PUP_ZuseZ >=200 and PUP_ZuseU >=200 and PUP_ZuseS >=200 then
			PUP_Zuse_Check.enabled = True
		Else
			If PUP_QuorraMB_Active=False and PUP_LightCycleMB_Active=False and PUP_DiscWarsMB_Active=False Then
			PuPlayer.playlistplayex 0,"ZuseE","",100,0
			PuPlayer.SetLength 0,2
			End If
		End If
	End If
End Sub

Sub PUP_Zuse_Check_Timer()
	if HasPuP Then
		If PUP_Ramp_White >=100 Then
			PuPlayer.playlistplayex 2,"ZuseMode","",100,0
			If PUP_QuorraMB_Active=False and PUP_LightCycleMB_Active=False and PUP_DiscWarsMB_Active=False Then
				PuPlayer.playlistplayex 0,"ZuseModeInfo","",100,0
				PuPlayer.SetLength 0,13
			End If
		End If
	End If
	PUP_Zuse_Check.enabled = False
End Sub

Sub PUP_TronT
	if HasPuP Then 
		If PUP_QuorraMB_Active=False and PUP_LightCycleMB_Active=False and PUP_DiscWarsMB_Active=False Then
			PuPlayer.playlistplayex 0,"TronT","",100,1
			PuPlayer.SetLength 0,2
		End If
	End if
End Sub

Sub PUP_TronR
	if HasPuP Then
		If PUP_QuorraMB_Active=False and PUP_LightCycleMB_Active=False and PUP_DiscWarsMB_Active=False Then
			PuPlayer.playlistplayex 0,"TronR","",100,1
			PuPlayer.SetLength 0,2
		End If
	End if
End Sub

Sub PUP_TronO
	if HasPuP Then
		If PUP_QuorraMB_Active=False and PUP_LightCycleMB_Active=False and PUP_DiscWarsMB_Active=False Then
			PuPlayer.playlistplayex 0,"TronO","",100,1
			PuPlayer.SetLength 0,2
		End If
	End if
End Sub

Sub PUP_TronN
	if HasPuP Then
		If PUP_QuorraMB_Active=False and PUP_LightCycleMB_Active=False and PUP_DiscWarsMB_Active=False Then
			PuPlayer.playlistplayex 0,"TronN","",100,1
			PuPlayer.SetLength 0,2
		End If
	End if
End Sub


Sub PUP_Recognizer
	if HasPuP Then 
		PUP_RecognizerHit=True
		PUP_DiscBattle_Check.enabled=True
	End if
End Sub


Sub PUP_DiscWars
	if HasPuP Then 
		PUP_DiscBattleMB_Check.enabled=true
	End If
End Sub


Sub PUP_DiscBattleReady   'From Arcade Kicker  - Not Used Yet
	if HasPuP Then 
		PUP_DiscBattle_Check.enabled=True
		'PUP_RecognizerBankGoDown=True
	End if
End Sub

Sub PUP_DiscBattleMB_Check_Timer()
	if HasPuP Then 
		if PUP_Ramp_Blue >=10 then
				If PUP_DiscBattle <= 0 then 
					PuPlayer.playlistplay 2,("DiscBattleJackpot")
				End If
				If PUP_DiscBattle >= 10 then
					PUP_DiscWarsMB_Active=True
					PuPlayer.playlistplayex 0,"DiscWarsMBInfo","",100,15
					PuPlayer.SetLength 0,10
					PuPlayer.SetLoop 0,1
					PuPlayer.playlistplayex 2,"DiscBattleMB","",100,15
				End If
		Else
				PuPlayer.playlistplay 2,("DiscBattle")
		End If
	End If
	PUP_DiscBattleMB_Check.enabled=False
End Sub

Sub PUP_DiscBattle_Check_Timer()
	if HasPuP Then 
		'if PUP_DiscBattle >=10 then
		If PUP_RecognizerBankGoDown = True AND PUP_RecognizerHit = True Then
			PuPlayer.playlistplayex 2,"DiscBattleReady","",100,9
		End If
		If PUP_RecognizerBankGoDown = False AND PUP_RecognizerHit = True Then
			PuPlayer.playlistplay 2,("Recognizer")
		End If
	End if
	PUP_RecognizerHit = False
	PUP_DiscBattle_Check.enabled=False
End Sub


Sub PUP_OuterLanes   'Not Used
End Sub

Sub PUP_InnerLanes 			'Not used, hard to control and pops up too much
	If HasPuP Then
		'PUP_CLU_Check.enabled=True
	End If
End Sub

Sub PUP_CLU_Check_Timer()   'Not used, hard to control and pops up too much
	if HasPuP Then
		If PUP_CLU_Light >= 10 and PUP_C >=10 and PUP_L >=10 and PUP_U >=10 Then 
			'PuPlayer.playlistplayex 0,"Clu","",100,0
			'PuPlayer.SetLength 0,2
			PUP_C=0
			PUP_L=0
			PUP_U=0
		End If
	End If
	PUP_CLU_Check.enabled=False
End Sub


Sub PUP_MB_End_Check_Timer()    'Wait a few secs and then check to see if only 1 ball left to disable MB Active modes
	If HasPuP Then
		If BallCount = 1 and (PUP_QuorraMB_Active=True OR PUP_LightCycleMB_Active=True OR PUP_DiscWarsMB_Active=True) Then
			PuPlayer.SetLoop 0,0
			PuPlayer.SetLoop 2,0
			PUP_QuorraMB_Active=False
			PUP_LightCycleMB_Active=False
			PUP_DiscWarsMB_Active=False
			PuPlayer.playlistplayex 0,"MultiballEnd","",100,20
		End If
	End If
	PUP_MB_End_Check.enabled=False
End Sub

Sub PUP_Drain   'Check for Shoot Again Light, Balls Left is 0 = Drained, Are MB Modes Active?
	if HasPuP Then	
			PUP_Drain_Check.enabled=True
	End if
End Sub


Sub PUP_Drain_Check_Timer()
	if HasPuP Then
		if PUP_ShootAgain <=0 and BallCount <= 0 then
			PuPlayer.SetLoop 0,0
			PuPlayer.SetLoop 2,0
			PUP_QuorraMB_Active=False
			PUP_LightCycleMB_Active=False
			PUP_DiscWarsMB_Active=False
			PUP_Zuse_Check.enabled = False
			PUP_Gem_Check.enabled=false
			PuPlayer.playlistplayex 2,"Drain","",100,20
			PuPlayer.playlistplayex 0,"EndofLine","",100,20
		End if
		if PUP_ShootAgain >=40 and BallCount = 0 and PUP_QuorraMB_Active=False and PUP_LightCycleMB_Active=False and PUP_DiscWarsMB_Active=False then
			PuPlayer.playlistplayex 0,"ShootAgain","",100,0
		End if
		if (PUP_QuorraMB_Active=True OR PUP_LightCycleMB_Active=True OR PUP_DiscWarsMB_Active=True) and BallCount = 1 then
			PUP_MB_End_Check.enabled=True   'Wait a few secs and then check to see if only 1 ball left to disable MB Active modes
		End If
	End If
PUP_Drain_Check.enabled=False
End Sub

'******* PinUp Player mod Main Section ends here *******





Thanks for the help guys.  I am totally amazed I was able to pull this off with having all the main multiball modes, and jackpots, and all main table events,etc working correctly as they should for playing videos, instead of just "this triggers plays that video" everytime.

 

 

If you see anything that you think could have been done better....please let me know.