0 Members and 1 Guest are viewing this topic.
I havent had a chance to look at this yet rosev as ive been working all weekends.Is it set up in subroutines like jps system so we can do custom light scripts and alpha flashers?Thanks again for this
Sorry for all the questions cause i havent had a chance to look at it yet.You think it could be adapted to work with pinmame as well?Im working on a demo table also for fading gi lighting
Here is a question, is it possible to have a lamp light up like one in a lighthouse?I want a flasher bulb to flash brilliance then fade out slowly like a capacitor does with electricitylike a strobe I guess
If its only a single light. I would just use a timer and a case select statement outside of the fading light script
Sub Table1_Init() FLFlash 1, FLMaxLight, 0, 1, 4, 0End SubSub Table1_KeyDown(ByVal keycode) FLFlash 1, 1, 10, 1, 32, 0 FLFlash 2, 2, 10, 1, 32, 4 FLFlash 3, 3, 10, 1, 32, 8 FLFlash 4, 4, 10, 1, 32, 12 FLFlash 5, 6, 10, 1, 32, 16 FLFlash 7, 8, 10, 1, 32, 20 FLFlash 9, 10, 10, 1, 32, 24 FLFlash 11, 12, 10, 1, 32, 28 FLFlash 13, 14, 10, 1, 32, 32 'Flasher FLFlash 15, 15, 2, 0, 1, 14End Sub'*********************************************************************************************'***************** FADING LIGHTS CODE ***************************'***************** ROSVE ***************************'*********************************************************************************************Dim FLData(100,8)Dim FLMaxLightFLMaxLight=15' 1=command --> 0=set off 1=set on 2=flash 99=no change' 2=state' 3=repeats 999=continous' 4=on duration' 5=off duration' 6=on dur mem' 7=off dur mem' 8=start delaySub FLSetOn(ByVal FLlight1, ByVal FLlight2, ByVal FLdelay) For i=FLlight1 to FLlight2 FLData(i,1)=1 FLData(i,2)=0 FLData(i,3)=0 FLData(i,4)=0 FLData(i,5)=0 FLData(i,8)=FLdelay NextEnd SubSub FLSetOff(ByVal FLlight1, ByVal FLlight2, ByVal FLdelay) For i=FLlight1 to FLlight2 FLData(i,1)=0 FLData(i,2)=4 FLData(i,3)=0 FLData(i,4)=0 FLData(i,5)=0 FLData(i,8)=FLdelay NextEnd SubSub FLFlash(ByVal FLlight1, ByVal FLlight2, ByVal FLrepeat, ByVal FLondur, ByVal FLoffdur, ByVal FLdelay) For i=FLlight1 to FLlight2 FLData(i,1)=2 FLData(i,2)=0 FLData(i,3)=FLrepeat FLData(i,4)=FLondur FLData(i,5)=FLoffdur FLData(i,6)=FLondur FLData(i,7)=FLoffdur FLData(i,8)=FLdelay NextEnd SubSub FLTimer_Timer()Dim i For i=1 To FLMaxLight If FLData(i,8)>0 Then FLData(i,8)=FLData(i,8)-1 Else Select Case FLData(i,1) Case 0 FLData(i,2)=FLData(i,2)+1 Select Case FLData(i,2) Case 5 FLflasher i,1 L2(i).State=0 Case 7 FLflasher i,0 L1(i).State=0 FLData(i,1)=99 End Select Case 1 FLData(i,2)=FLData(i,2)+1 Select Case FLData(i,2) Case 1 FLflasher i,1 L1(i).State=1 Case 3 FLflasher i,2 L2(i).State=1 FLData(i,1)=99 End Select Case 2 FLData(i,2)=FLData(i,2)+1 Select Case FLData(i,2) Case 1 FLflasher i,1 L1(i).State=1 Case 3 FLflasher i,2 L2(i).State=1 Case 4 'on Duration IF FLData(i,4)>0 Then FLData(i,4)=FLData(i,4)-1 FLData(i,2)=FLData(i,2)-1 Else FLData(i,4)=FLData(i,6) End If Case 5 FLflasher i,1 L2(i).State=0 Case 7 FLflasher i,0 L1(i).State=0 IF FLData(i,3)>0 Then IF FLData(i,5)>0 Then FLData(i,5)=FLData(i,5)-1 FLData(i,2)=FLData(i,2)-1 Else FLData(i,5)=FLData(i,7) FLData(i,3)=FLData(i,3)-1 If FLData(i,3)=998 Then FLData(i,3)=999 FLData(i,2)=0 End If Else FLData(i,1)=99 End If End Select End Select End If NextEnd SubSub FLflasher(ByVal li,ByVal st) Dim i Select Case li '**** LIGHT NUMBER ***** Case 15 'Light 15 is an Alpha Flasher Select Case st Case 0'OFF f32f1.alpha = 0 Case 1'INTERMIDIATE f32f1.image = "rf_b":f32f1.alpha = 1 Case 2 'ON f32f1.image = "rf_on" End Select f32r1.State=ABS(f32r1.state -1) End SelectEnd Sub'*********************************************************************************************'*********************************************************************************************'*********************************************************************************************
Dim NewState(200)Dim OldState(200)FLTimer.Interval = 21LampTimer.Interval = 10LampTimer.Enabled = 1Sub SetFlasher(nr, value) NewState(nr) = abs(value)End SubSub LampTimer_Timer() Dim chgLamp, num, chg, ii chgLamp = Controller.ChangedLamps If Not IsEmpty(chgLamp) Then For ii = 0 To UBound(chgLamp) ' **UPDATE LAMP STATES *** If chgLamp(ii, 1)=0 then FLSetOff chgLamp(ii, 0), chgLamp(ii, 0), 0 else FLSetOn chgLamp(ii, 0), chgLamp(ii, 0), 0 end if Next End If For ii=81 to 88 ' ******** FLASHER NUMBERS ************* If NewState(ii) <> OldState(ii) then OldState(ii)=NewState(ii) If NewState(ii)=0 then FLSetOff ii, ii. 0 else FLSetOn ii, ii, 0 end if end if NextEnd Sub[/php]
SolCallBack(25)="SetFlasher 81, " 'red x 4SolCallBack(26)="SetFlasher 82, " 'yellow x 4SolCallBack(27)="SetFlasher 83, " 'green x 4SolCallBack(28)="SetFlasher 84, " 'blue x 4SolCallBack(29)="SolWarrior" 'flash multiball x 4SolCallBack(30)="SetFlasher 86, " 'left ramp x 4SolCallBack(31)="SetFlasher 87, " 'right ramp x 4SolCallBack(32)="SetFlasher 88, " 'pops x 2