-
Notifications
You must be signed in to change notification settings - Fork 37
/
Big Game (Stern 1980) w VR Room 1.5.1.vbs
3376 lines (2822 loc) · 109 KB
/
Big Game (Stern 1980) w VR Room 1.5.1.vbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
' Big Game - Stern 1980
' Due to missing pages and errors on the manual, the light and solenoid definitions taken from the script by Destruk and Skalar
' VPX version 4.1.1 jpsalas - 2022
' VPX v1.5.1 - Redbone / TastyWasps - December 2023
' Graphical Upscales, Lighting Tweaks, Object Placement and Correcting Dimensions - Redbone
' nFozzy Physics, Fleep Sound, Dynamic Ball Shadows, Lighting Tweaks, VR Room (thank you Rajo Joey) - TastyWasps
Option Explicit
'************************************************************************
' Table Options
'************************************************************************
'redbone options set the way I want them - not OEM - please set options accordingly to your taste
Const AmbientSounds = 0 ' 0=play Nothing 1=ambient jungle sounds 2=ambient jungle sounds with tiger growls
Const AmbientSoundVolume = .3
Const AccentLighting = 0 ' 0=none 1=claws and eyes 2=eyes only 3=all
Const PlasticStuds = 0 ' 0=white (original) 1=metal black (black shiny looks good and not as obtrusive)
Const ChooseBall = 0 ' *** Ball Settings **********
' *** 0 = Normal Ball no script action
' *** 1 = Black Shiny Ball
' *** 2 = Ivory ball (cue ball)
' *** 3 = Fireball
'----- Bouncer Options -----
Const TargetBouncerEnabled = 1 ' 0 = normal standup targets, 1 = bouncy targets
Const TargetBouncerFactor = 0.7 ' Level of bounces. Recommmended value of 0.7
'----- Volume Options -----
Const VolumeDial = 0.8 ' Overall Mechanical sound effect volume. Recommended values should be no greater than 1.
Const BallRollVolume = 0.5 ' Level of ball rolling volume. Value between 0 and 1
Const RampRollVolume = 0.5 ' Level of ramp rolling volume. Value between 0 and 1
'----- Shadow Options ----- ' If performance is suffering, turn off Dynamic Shadow options below as they are subtle.
Const DynamicBallShadowsOn = 1 ' 0 = no dynamic ball shadow ("triangles" near slings and such), 1 = enable dynamic ball shadow
Const AmbientBallShadowOn = 1 ' 0 = Static shadow under ball ("flasher" image, like JP's)
' 1 = Moving ball shadow ("primitive" object, like ninuzzu's) - This is the only one that shows up on the pf when in ramps and fades when close to lights!
' 2 = flasher image shadow, but it moves like ninuzzu's
'----- VR Options -----
Const VRRoomChoice = 1 ' 1 = Jungle Sphere Room 2 = Minimal Room
'************************************************************************
' ^ End of Table Options ^
'************************************************************************
On Error Resume Next
ExecuteGlobal GetTextFile("controller.vbs")
If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
On Error Goto 0
Const BallSize = 50
Const BallMass = 1
Const tnob = 5
LoadVPM "01120100", "stern.vbs", 3.02
Dim VarHidden, DesktopMode
DesktopMode = Table1.ShowDT
If DesktopMode = True Then
VarHidden = 1
Else
VarHidden = 0
For each x in aReels
x.Visible = 0
Next
lrail.Visible = 0
rrail.Visible = 0
End If
' VR Room Auto-Detect
Dim VR_Obj, VRMode
If RenderingMode = 2 Then
VRMode = True
flasher1.Visible = 0
flasher2.Visible = 0
lrail.Visible = 0
rrail.Visible = 0
For Each VR_Obj in VRCabinet : VR_Obj.Visible = 1 : Next
If VRRoomChoice = 1 Then
For Each VR_Obj in VRSphereRoom : VR_Obj.Visible = 1 : Next
Else
For Each VR_Obj in VRMinimalRoom : VR_Obj.Visible = 1 : Next
End If
Set LampCallback = GetRef("UpdateMultipleLamps") ' To call VR backglass flasher icons
Else
VRMode = False
For Each VR_Obj in VRCabinet : VR_Obj.Visible = 0 : Next
For Each VR_Obj in VRBackglass : VR_Obj.Visible = 0 : Next
For Each VR_Obj in VRMinimalRoom : VR_Obj.Visible = 0 : Next
For Each VR_Obj in VRSphereRoom : VR_Obj.Visible = 0 : Next
End If
Dim bsTrough, bsSaucer, dtT, dtR, dtR2
Dim x
Const cGameName = "biggame"
' Standard Sounds
Const SSolenoidOn = "fx_Solenoid" ' Solenoid activates
Const SSolenoidOff = "" ' Solenoid deactivates
Const SCoin = "" ' Coin inserted
Const UseSolenoids = 2
Const UseLamps = 0
Const UseGI = 0
Dim TableWidth, TableHeight
TableWidth = Table1.width
TableHeight = Table1.height
'redbone ambient jungle Sound
'Table1_MusicDone
Sub Table1_MusicDone()
If AmbientSounds = 1 Then
PlaySound "Big Game Ambient Jungle Sounds", -1, AmbientSoundVolume
End If
If AmbientSounds = 2 Then
PlaySound"Big Game Ambient Jungle Sounds with tiger", -1, AmbientSoundVolume
End If
End Sub
'redbone - nylon stud color
Dim StudColor
If PlasticStuds = 0 Then
For Each StudColor in Studs : StudColor.Material = "Plastic White" : Next
End If
If PlasticStuds = 1 Then
For Each StudColor in Studs : StudColor.Material = "Metal Lamp Black" : Next
End If
'redbone choose ball
If ChooseBall <> 0 Then
if ChooseBall = 1 Then
table1.BallImage = "black"
table1.DefaultBulbIntensityScale = .5
end If
if ChooseBall = 2 Then
table1.BallImage = "ball_cue"
end If
if ChooseBall = 3 Then
table1.BallImage = "black"
table1.BallDecalMode = False
table1.BallFrontDecal = "ball_fireball_decal"
'table1.DefaultBulbIntensityScale = .5
end If
end If
'*** change ball appearance ***
'*******************************
'redbone variables for accent lighting
'accent lighting options
'redimentary I know - forgive me I'm new. :P
'*******************************
'set default state
'tiger eyes
light006.visible = false
light007.visible = false
'claws blinking
light001.visible = false
light002.visible = false
light003.visible = false
light004.visible = false
light005.visible =false
'extra
accenttigerface.visible = False
accentupperleftlion.visible = False
Sub Table1_AccentLighting()
If AccentLighting <> 0 Then
If AccentLighting = 1 Then
'tiger eyes
light006.visible = true
light007.visible = true
'claws blinking
light001.visible = true
light002.visible = true
light003.visible = true
light004.visible = true
light005.visible = true
'extra
accenttigerface.visible = False
accentupperleftlion.visible = False
end If
if AccentLighting = 2 Then ' eyes only
'tiger eyes
light006.visible = true
light007.visible = true
'claws blinking
light001.visible = False
light002.visible = False
light003.visible = False
light004.visible = False
light005.visible = False
'extra
accenttigerface.visible = False
accentupperleftlion.visible = False
end If
if AccentLighting = 3 Then ' all
'tiger eyes
light006.visible = true
light007.visible = true
'claws blinking
light001.visible = true
light002.visible = true
light003.visible = true
light004.visible = true
light005.visible = true
'extra
accenttigerface.visible = True
accentupperleftlion.visible = True
end If
end If
End Sub
'*******************************
'end accent lighting variables
'*******************************
if B2SOn = true then VarHidden = 1
Sub Table1_Init
With Controller
.GameName = cGameName
If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description:Exit Sub
.SplashInfoLine = "Big Game (Stern 1980)" & vbNewLine & "VPX Table by jpsalas v.4.1.1"
.HandleKeyboard = 0
.ShowTitle = 0
.ShowDMDOnly = 1
.ShowFrame = 0
.HandleMechanics = 0
.Hidden = VarHidden
End With
On Error Goto 0
Controller.SolMask(0) = 0
vpmTimer.AddTimer 2000, "Controller.SolMask(0)=&Hffffffff'" 'ignore all solenoids - then add the timer to renable all the solenoids after 2 seconds
Controller.Run
' Thalamus : Was missing 'vpminit me'
vpminit me
' PinmameTimer.Interval = PinMameInterval
' PinmameTimer.Enabled = 1
' trough def
Set bsTrough = New cvpmBallstack
bsTrough.InitNoTrough BallRelease, 33, 115, 9
bsTrough.InitExitSnd "BallRelease1", "fx_Solenoid"
Set bsSaucer = New cvpmBallStack
bsSaucer.InitSaucer sw34, 34, 55, 20
bsSaucer.InitExitSnd SoundFX("Saucer_Kick", DOFContactors), SoundFX("fx_Solenoid", DOFContactors)
bsSaucer.KickForceVar = 4
' droptarget def
Set dtT = New cvpmDropTarget
dtT.InitDrop Array(sw16, sw15, sw14), Array(16, 15, 14)
dtT.InitSnd SoundFX("fx_droptarget", DOFDropTargets), SoundFX("fx_resetdrop", DOFContactors)
dtT.CreateEvents "dtT"
Set dtR = New cvpmDropTarget
dtR.InitDrop Array(sw24, sw23, sw22), Array(24, 23, 22)
dtR.InitSnd SoundFX("fx_droptarget", DOFDropTargets), SoundFX("fx_resetdrop", DOFContactors)
dtR.CreateEvents "dtR"
Set dtR2 = New cvpmDropTarget
dtR2.InitDrop Array(sw32, sw31, sw30), Array(32, 31, 30)
dtR2.InitSnd SoundFX("fx_droptarget", DOFDropTargets), SoundFX("fx_resetdrop", DOFContactors)
dtR2.CreateEvents "dtR2"
vpmNudge.TiltSwitch = 7
vpmNudge.Sensitivity = 1
vpmNudge.TiltObj = Array(Bumper1, Bumper2, Bumper3, LeftSlingshot, RightSlingshot)
If VRMode = True Then
setup_backglass
End If
RealTime.Enabled = 1
LoadLUT
End Sub
Sub table1_Paused:Controller.Pause = 1:End Sub
Sub Table1_unPaused:Controller.Pause = 0:End Sub
Sub Table1_Exit():Controller.Stop:End Sub
'******************
' RealTime Updates
'******************
Sub RealTime_Timer
GiUpdate
End Sub
'**********
' Keys
'**********
Sub table1_KeyDown(ByVal keycode)
If keycode = LeftFlipperKey Then
FlipperActivate LeftFlipper, LFPress
FlipperActivate LeftFlipper1, LFPress1
End If
If keycode = RightFlipperKey Then
FlipperActivate RightFlipper, RFPress
FlipperActivate RightFlipper1, RFPress1
End If
If keycode = LeftTiltKey Then Nudge 90, 5:SoundNudgeLeft()
If keycode = RightTiltKey Then Nudge 270, 5:SoundNudgeRight()
If keycode = CenterTiltKey Then Nudge 0, 6:SoundNudgeCenter()
If keycode = LeftMagnaSave Then bLutActive = True: Lutbox.text = "level of darkness " & LUTImage
If keycode = RightMagnaSave Then
If bLutActive Then NextLUT:End If
End If
If keycode = PlungerKey Then
Plunger.Pullback
SoundPlungerPull()
End If
If keycode = StartGameKey Then
soundStartButton()
Table1_MusicDone
Table1_AccentLighting()
end If
If keycode = keyInsertCoin1 or keycode = keyInsertCoin2 or keycode = keyInsertCoin3 or keycode = keyInsertCoin4 Then 'Use this for ROM based games
Select Case Int(rnd*3)
Case 0: PlaySound ("Coin_In_1"), 0, CoinSoundLevel, 0, 0.25
Case 1: PlaySound ("Coin_In_2"), 0, CoinSoundLevel, 0, 0.25
Case 2: PlaySound ("Coin_In_3"), 0, CoinSoundLevel, 0, 0.25
End Select
End If
If vpmKeyDown(keycode)Then Exit Sub
End Sub
Sub table1_KeyUp(ByVal keycode)
If keycode = LeftFlipperKey Then
FlipperDeactivate LeftFlipper, LFPress
FlipperDeactivate LeftFlipper1, LFPress1
End If
If keycode = RightFlipperKey Then
FlipperDeactivate RightFlipper, RFPress
FlipperDeactivate RightFlipper1, RFPress1
End If
If keycode = LeftMagnaSave Then bLutActive = False: LutBox.text = ""
If keycode = PlungerKey Then
Plunger.Fire
SoundPlungerReleaseBall()
End If
If vpmKeyUp(keycode)Then Exit Sub
End Sub
'***************************
' LUT - Darkness control
'***************************
Dim bLutActive, LUTImage
Sub LoadLUT
bLutActive = False
x = LoadValue(cGameName, "LUTImage")
If(x <> "")Then LUTImage = x Else LUTImage = 0
UpdateLUT
End Sub
Sub SaveLUT
SaveValue cGameName, "LUTImage", LUTImage
End Sub
Sub NextLUT:LUTImage = (LUTImage + 1)MOD 11:UpdateLUT:SaveLUT:Lutbox.text = "level of darkness " & LUTImage:End Sub
Sub UpdateLUT
Select Case LutImage
Case 0:table1.ColorGradeImage = "LUT0":GiIntensity = 1:ChangeGIIntensity 1
Case 1:table1.ColorGradeImage = "LUT1":GiIntensity = 1.05:ChangeGIIntensity 1
Case 2:table1.ColorGradeImage = "LUT2":GiIntensity = 1.1:ChangeGIIntensity 1
Case 3:table1.ColorGradeImage = "LUT3":GiIntensity = 1.15:ChangeGIIntensity 1
Case 4:table1.ColorGradeImage = "LUT4":GiIntensity = 1.2:ChangeGIIntensity 1
Case 5:table1.ColorGradeImage = "LUT5":GiIntensity = 1.25:ChangeGIIntensity 1
Case 6:table1.ColorGradeImage = "LUT6":GiIntensity = 1.3:ChangeGIIntensity 1
Case 7:table1.ColorGradeImage = "LUT7":GiIntensity = 1.35:ChangeGIIntensity 1
Case 8:table1.ColorGradeImage = "LUT8":GiIntensity = 1.4:ChangeGIIntensity 1
Case 9:table1.ColorGradeImage = "LUT9":GiIntensity = 1.45:ChangeGIIntensity 1
Case 10:table1.ColorGradeImage = "LUT10":GiIntensity = 1.5:ChangeGIIntensity 1
End Select
End Sub
Dim GiIntensity
GiIntensity = 1 'used by the LUT changing to increase the GI lights when the table is darker
Sub ChangeGiIntensity(factor) 'changes the intensity scale
Dim bulb
For each bulb in aGiLights
bulb.IntensityScale = GiIntensity * factor
Next
End Sub
'**********
'Solenoids
'**********
SolCallback(7) = "dtT.SolDropUp"
SolCallback(8) = "dtR.SolDropUp"
SolCallback(9) = "dtR2.SolDropUp"
SolCallback(6) = "vpmsolsound SoundFX(""fx_knocker"",DOFKnocker),"
SolCallback(11) = "bsTrough.SolOut"
SolCallback(10) = "bsSaucer.SolOut"
SolCallback(19) = "vpmNudge.SolGameOn"
'*******************
' Flipper Subs
'*******************
SolCallback(sLRFlipper) = "SolRFlipper"
SolCallback(sLLFlipper) = "SolLFlipper"
Const ReflipAngle = 20
Sub SolLFlipper(Enabled)
If Enabled Then
LF.Fire
LF1.Fire
If leftflipper.currentangle < leftflipper.endangle + ReflipAngle Then
RandomSoundReflipUpLeft LeftFlipper
Else
SoundFlipperUpAttackLeft LeftFlipper
RandomSoundFlipperUpLeft LeftFlipper
End If
Else
LeftFlipper.RotateToStart
LeftFlipper1.RotateToStart
If LeftFlipper.currentangle < LeftFlipper.startAngle - 5 Then
RandomSoundFlipperDownLeft LeftFlipper
End If
FlipperLeftHitParm = FlipperUpSoundLevel
End If
End Sub
Sub SolRFlipper(Enabled)
If Enabled Then
RF.Fire
RF1.Fire
If rightflipper.currentangle > rightflipper.endangle - ReflipAngle Then
RandomSoundReflipUpRight RightFlipper
Else
SoundFlipperUpAttackRight RightFlipper
RandomSoundFlipperUpRight RightFlipper
End If
Else
RightFlipper.RotateToStart
RightFlipper1.RotateToStart
If RightFlipper.currentangle > RightFlipper.startAngle + 5 Then
RandomSoundFlipperDownRight RightFlipper
End If
FlipperRightHitParm = FlipperUpSoundLevel
End If
End Sub
Sub LeftFlipper_Collide(parm)
CheckLiveCatch Activeball, LeftFlipper, LFCount, parm
LeftFlipperCollide parm
End Sub
Sub RightFlipper_Collide(parm)
CheckLiveCatch Activeball, RightFlipper, RFCount, parm
RightFlipperCollide parm
End Sub
Sub LeftFlipper1_Collide(parm)
CheckLiveCatch Activeball, LeftFlipper1, LFCount1, parm
LeftFlipperCollide parm
End Sub
Sub RightFlipper1_Collide(parm)
CheckLiveCatch Activeball, RightFlipper1, RFCount1, parm
RightFlipperCollide parm
End Sub
'**********
' Switches
'**********
Sub sw4_Spin:vpmTimer.PulseSw(4):SoundSpinner sw4:End Sub
Sub sw5_Spin:vpmTimer.PulseSw(5):SoundSpinner sw5:End Sub
' Bumpers
Sub Bumper1_Hit:vpmTimer.PulseSw 9:RandomSoundBumperTop Bumper1:End Sub
Sub Bumper2_Hit:vpmTimer.PulseSw 10:RandomSoundBumperBottom Bumper2:End Sub
Sub Bumper3_Hit:vpmTimer.PulseSw 11:RandomSoundBumperMiddle Bumper3:End Sub
Dim LStep, RStep
Sub LeftSlingShot_Slingshot
RandomSoundSlingshotLeft Lemk
LS.VelocityCorrect(ActiveBall)
LeftSling4.Visible = 1
Lemk.RotX = 26
LStep = 0
vpmTimer.PulseSw 12
LeftSlingShot.TimerEnabled = 1
End Sub
Sub LeftSlingShot_Timer
Select Case LStep
Case 1:LeftSLing4.Visible = 0:LeftSLing3.Visible = 1:Lemk.RotX = 14
Case 2:LeftSLing3.Visible = 0:LeftSLing2.Visible = 1:Lemk.RotX = 2
Case 3:LeftSLing2.Visible = 0:Lemk.RotX = -10:LeftSlingShot.TimerEnabled = 0
End Select
LStep = LStep + 1
End Sub
Sub RightSlingShot_Slingshot
RandomSoundSlingshotRight Remk
RS.VelocityCorrect(ActiveBall)
RightSling4.Visible = 1
Remk.RotX = 26
RStep = 0
vpmTimer.PulseSw 13
RightSlingShot.TimerEnabled = 1
End Sub
Sub RightSlingShot_Timer
Select Case RStep
Case 1:RightSLing4.Visible = 0:RightSLing3.Visible = 1:Remk.RotX = 14
Case 2:RightSLing3.Visible = 0:RightSLing2.Visible = 1:Remk.RotX = 2
Case 3:RightSLing2.Visible = 0:Remk.RotX = -10:RightSlingShot.TimerEnabled = 0
End Select
RStep = RStep + 1
End Sub
Sub sw37_Hit:vpmTimer.PulseSw(37):End Sub
Sub sw37a_Hit:vpmTimer.PulseSw(37):End Sub
' Rollovers
Sub sw17_Hit:Controller.Switch(17) = 1:End Sub
Sub sw17_UnHit:Controller.Switch(17) = 0:End Sub
Sub sw18_Hit:Controller.Switch(18) = 1:End Sub
Sub sw18_UnHit:Controller.Switch(18) = 0:End Sub
Sub sw19_Hit:Controller.Switch(19) = 1:End Sub
Sub sw19_UnHit:Controller.Switch(19) = 0:End Sub
Sub sw27_Hit:Controller.Switch(27) = 1:End Sub
Sub sw27_UnHit:Controller.Switch(27) = 0:End Sub
Sub RightInlane_Hit:Controller.Switch(28) = 1:End Sub
Sub RightInlane_UnHit:Controller.Switch(28) = 0:End Sub
Sub LeftInlane_Hit:Controller.Switch(29) = 1:End Sub
Sub LeftInlane_UnHit:Controller.Switch(29) = 0:End Sub
Sub RightOutlane_Hit:Controller.Switch(35) = 1:End Sub
Sub RightOutlane_UnHit:Controller.Switch(35) = 0:End Sub
Sub LeftOutlane_Hit:Controller.Switch(36) = 1:End Sub
Sub LeftOutlane_UnHit:Controller.Switch(36) = 0:End Sub
'targets
Sub sw20_Hit:vpmTimer.PulseSw(20):End Sub
Sub sw21_Hit:vpmTimer.PulseSw(21):End Sub
' Rollovers 2
Sub sw25_Hit:L16.State = 0:Controller.Switch(25) = 1:Me.TimerEnabled = 1:End Sub
Sub sw25_UnHit:Controller.Switch(25) = 0:End Sub
Sub sw25_Timer:Me.TimerEnabled = 0:L16.State = 1:End Sub
Sub sw26_Hit:L30.State = 0:Controller.Switch(26) = 1:Me.TimerEnabled = 1:End Sub
Sub sw26_UnHit:Controller.Switch(26) = 0:End Sub
Sub sw26_Timer:Me.TimerEnabled = 0:L30.State = 1:End Sub
Sub sw38_Hit:L31.State = 0:Controller.Switch(38) = 1:Me.TimerEnabled = 1:End Sub
Sub sw38_UnHit:Controller.Switch(38) = 0:End Sub
Sub sw38_Timer:Me.TimerEnabled = 0:L31.State = 1:End Sub
Sub sw39_Hit:L15.State = 0:Controller.Switch(39) = 1:Me.TimerEnabled = 1:End Sub
Sub sw39_UnHit:Controller.Switch(39) = 0:End Sub
Sub sw39_Timer:Me.TimerEnabled = 0:L15.State = 1:End Sub
Sub sw40_Hit:L14.State = 0:Controller.Switch(40) = 1:Me.TimerEnabled = 1:End Sub
Sub sw40_UnHit:Controller.Switch(40) = 0:End Sub
Sub sw40_Timer:Me.TimerEnabled = 0:L14.State = 1:End Sub
' Drain & saucers
Sub Drain_Hit:bsTrough.AddBall Me:RandomSoundDrain Drain:End Sub
'Sub Drain_Hit:Me.Destroyball:End Sub 'only for debug
Sub sw34_Hit:bsSaucer.AddBall 0:SoundSaucerLock:End Sub
' Timers
Sub FrameTimer_Timer
If DynamicBallShadowsOn Or AmbientBallShadowOn Then DynamicBSUpdate
If VRMode = True Then
VRDigitDisplay
End If
End Sub
'************************************
' LEDs Display
'Based on Scapino's 7 digit Reel LEDs
'************************************
Dim Digits(32)
Dim Patterns(11)
Dim Patterns2(11)
Patterns(0) = 0 'empty
Patterns(1) = 63 '0
Patterns(2) = 6 '1
Patterns(3) = 91 '2
Patterns(4) = 79 '3
Patterns(5) = 102 '4
Patterns(6) = 109 '5
Patterns(7) = 125 '6
Patterns(8) = 7 '7
Patterns(9) = 127 '8
Patterns(10) = 111 '9
Patterns2(0) = 128 'empty
Patterns2(1) = 191 '0
Patterns2(2) = 134 '1
Patterns2(3) = 219 '2
Patterns2(4) = 207 '3
Patterns2(5) = 230 '4
Patterns2(6) = 237 '5
Patterns2(7) = 253 '6
Patterns2(8) = 135 '7
Patterns2(9) = 255 '8
Patterns2(10) = 239 '9
Set Digits(0) = a0
Set Digits(1) = a1
Set Digits(2) = a2
Set Digits(3) = a3
Set Digits(4) = a4
Set Digits(5) = a5
Set Digits(6) = a6
Set Digits(7) = b0
Set Digits(8) = b1
Set Digits(9) = b2
Set Digits(10) = b3
Set Digits(11) = b4
Set Digits(12) = b5
Set Digits(13) = b6
Set Digits(14) = c0
Set Digits(15) = c1
Set Digits(16) = c2
Set Digits(17) = c3
Set Digits(18) = c4
Set Digits(19) = c5
Set Digits(20) = c6
Set Digits(21) = d0
Set Digits(22) = d1
Set Digits(23) = d2
Set Digits(24) = d3
Set Digits(25) = d4
Set Digits(26) = d5
Set Digits(27) = d6
Set Digits(28) = e0
Set Digits(29) = e1
Set Digits(30) = e2
Set Digits(31) = e3
Sub DesktopDigitDisplay
On Error Resume Next
Dim ChgLED, ii, jj, chg, stat
ChgLED = Controller.ChangedLEDs(&HFF, &HFFFF)
If Not IsEmpty(ChgLED)Then
For ii = 0 To UBound(ChgLED)
chg = chgLED(ii, 1):stat = chgLED(ii, 2)
For jj = 0 to 10
If stat = Patterns(jj)OR stat = Patterns2(jj)then Digits(chgLED(ii, 0)).SetValue jj
Next
Next
End IF
End Sub
'**************
' Gi update
'**************
Dim OldGiState
OldGiState = -1 'start witht he Gi off
Sub GiON
For each x in aGiLights
x.State = 1
Next
End Sub
Sub GiOFF
For each x in aGiLights
x.State = 0
Next
End Sub
Sub GiEffect
For each x in aGiLights
x.Duration 2, 3000, 1
Next
End Sub
Sub GIUpdate
Dim tmp, obj
tmp = Getballs
If UBound(tmp) <> OldGiState Then
OldGiState = Ubound(tmp)
If UBound(tmp) = -1 Then
GiOff
Else
GiOn
End If
End If
End Sub
'**********************************************************
' JP's Lamp Fading for VPX and Vpinmame v4.0
' FadingStep used for all kind of lamps
' FlashLevel used for modulated flashers
' LampState keep the real lamp state in a array
'**********************************************************
Dim LampState(200), FadingStep(200), FlashLevel(200)
InitLamps() ' turn off the lights and flashers and reset them to the default parameters
' vpinmame Lamp & Flasher Timers
Sub LampTimer_Timer()
Dim chgLamp, num, chg, ii
chgLamp = Controller.ChangedLamps
If Not IsEmpty(chgLamp)Then
For ii = 0 To UBound(chgLamp)
LampState(chgLamp(ii, 0)) = chgLamp(ii, 1) 'keep the real state in an array
FadingStep(chgLamp(ii, 0)) = chgLamp(ii, 1)
Next
End If
If VRMode = False and DesktopMode = True Then
DesktopDigitDisplay
End If
UpdateLamps
ExtraLights
End Sub
Sub UpdateLamps
Lamp 1, l1
Lamp 2, l2
Lamp 3, l3
Lamp 4, l4
Lamp 5, l5
Lampm 6, l48
Lamp 6, l6
Lamp 7, l7
Lamp 8, l8
Lampm 9, l71
Lamp 9, l9
Lampm 10, l67
Lamp 10, l10
Lamp 11, l11
Lamp 12, l12
Lamp 14, l14
Lamp 15, l15
Lamp 14, l14
Lamp 15, l15
Lamp 16, l16
Lamp 17, l17
Lamp 18, l18
Lamp 19, l19
Lamp 20, l20
Lamp 21, l21
Lamp 22, l22
Lamp 23, l23
Lamp 24, l24
Lampm 25, l70
Lamp 25, l25
Lampm 26, l66
Lamp 26, l26
Lamp 27, l27
Lamp 28, l28
Lamp 30, l30
Lamp 31, l31
Lamp 33, l33
Lampm 34, l64
Lamp 34, l34
Lamp 35, l35
Lamp 36, l36
Lamp 37, l37
Lamp 38, l38
Lamp 39, l39
Lamp 40, l40
Lampm 41, l69
Lamp 41, l41
Lampm 42, l65
Lamp 42, l42
Lamp 43, l43
Lamp 44, l44
Lamp 46, l46
Lamp 48, l48
Lamp 49, l49
Lamp 50, l50
Lamp 51, l51
Lamp 52, l52
Lampm 53, l32
Lamp 53, l53
Lamp 54, l54
Lamp 55, l55
Lamp 56, l56
Lampm 57, l68
Lamp 57, l57
Lamp 58, l58
Lamp 59, l59
Lamp 60, l60
Lamp 62, l62
Lamp 64, l64
Lamp 72, l72
' backdrop lights
Text 13, l13, "High Score to Date"
Textm 29, l29, "Same Player Shoots Again"
Lamp 29, l47 'table's shoot again light
Text 45, l45, "Game Over"
Text 61, l61, "TILT"
Text 63, l63, "Match"
End Sub
Sub ExtraLights()
If(LampState(10) = 1 AND LampState(26) = 1 AND LampState(42) = 1)Then
If LampState(72) = 0 Then SetLamp 72, 1
Else
If LampState(72) = 1 Then SetLamp 72, 0
End If
End Sub
' div lamp subs
' Normal Lamp & Flasher subs
Sub InitLamps()
Dim x
LampTimer.Interval = 10
LampTimer.Enabled = 1
For x = 0 to 200
FadingStep(x) = 0
FlashLevel(x) = 0
Next
End Sub
Sub SetLamp(nr, value) ' 0 is off, 1 is on
FadingStep(nr) = abs(value)
End Sub
' Lights: used for VPX standard lights, the fading is handled by VPX itself, they are here to be able to make them work together with the flashers
Sub Lamp(nr, object)
Select Case FadingStep(nr)
Case 1:object.state = 1:FadingStep(nr) = -1
Case 0:object.state = 0:FadingStep(nr) = -1
End Select
End Sub
Sub Lampm(nr, object) ' used for multiple lights, it doesn't change the fading state
Select Case FadingStep(nr)
Case 1:object.state = 1
Case 0:object.state = 0
End Select
End Sub
' Flashers: 0 starts the fading until it is off
Sub Flash(nr, object)
Dim tmp
Select Case FadingStep(nr)
Case 1:Object.IntensityScale = 1:FadingStep(nr) = -1
Case 0
tmp = Object.IntensityScale * 0.85 - 0.01
If tmp > 0 Then
Object.IntensityScale = tmp
Else
Object.IntensityScale = 0
FadingStep(nr) = -1
End If
End Select
End Sub
Sub Flashm(nr, object) 'multiple flashers, it doesn't change the fading state
Dim tmp
Select Case FadingStep(nr)
Case 1:Object.IntensityScale = 1
Case 0
tmp = Object.IntensityScale * 0.85 - 0.01
If tmp > 0 Then
Object.IntensityScale = tmp
Else
Object.IntensityScale = 0
End If
End Select
End Sub
' Desktop Objects: Reels & texts
' Reels - 4 steps fading
Sub Reel(nr, object)
Select Case FadingStep(nr)
Case 1:object.SetValue 1:FadingStep(nr) = -1
Case 0:object.SetValue 2:FadingStep(nr) = 2
Case 2:object.SetValue 3:FadingStep(nr) = 3
Case 3:object.SetValue 0:FadingStep(nr) = -1
End Select
End Sub
Sub Reelm(nr, object)
Select Case FadingStep(nr)
Case 1:object.SetValue 1
Case 0:object.SetValue 2
Case 2:object.SetValue 3
Case 3:object.SetValue 0
End Select
End Sub
' Reels non fading
Sub NfReel(nr, object)
Select Case FadingStep(nr)
Case 1:object.SetValue 1:FadingStep(nr) = -1
Case 0:object.SetValue 0:FadingStep(nr) = -1
End Select
End Sub
Sub NfReelm(nr, object)
Select Case FadingStep(nr)
Case 1:object.SetValue 1
Case 0:object.SetValue 0
End Select
End Sub
'Texts
Sub Text(nr, object, message)
Select Case FadingStep(nr)
Case 1:object.Text = message:FadingStep(nr) = -1
Case 0:object.Text = "":FadingStep(nr) = -1
End Select
End Sub
Sub Textm(nr, object, message)
Select Case FadingStep(nr)
Case 1:object.Text = message
Case 0:object.Text = ""
End Select
End Sub
' Modulated Subs for the WPC tables
Sub SetModLamp(nr, level)
FlashLevel(nr) = level / 150 'lights & flashers
End Sub
Sub LampMod(nr, object) ' modulated lights used as flashers
Object.IntensityScale = FlashLevel(nr)
Object.State = 1 'in case it was off
End Sub
Sub FlashMod(nr, object) 'sets the flashlevel from the SolModCallback
Object.IntensityScale = FlashLevel(nr)
End Sub
'Walls, flashers, ramps and Primitives used as 4 step fading images
'a,b,c,d are the images used from on to off
Sub FadeObj(nr, object, a, b, c, d)
Select Case FadingStep(nr)
Case 1:object.image = a:FadingStep(nr) = -1
Case 0:object.image = b:FadingStep(nr) = 2
Case 2:object.image = c:FadingStep(nr) = 3