-
Notifications
You must be signed in to change notification settings - Fork 37
/
Bad Cats VPX 1.2.1a.GRHR.vbs
1149 lines (957 loc) · 35.7 KB
/
Bad Cats VPX 1.2.1a.GRHR.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
'**********************
' Bad Cats(1989)
' VPX table by unclewilly,Clark Kent, Dark
' version 1.0
'**********************
Option Explicit
Randomize
Dim FlipLag
FlipLag = 1 'Enable/Disable FlipperLag Fix 0 is disable 1 is enable
Dim xx, DNS
Dns = table1.NightDay
If DNS <= 5 or DNS >= 75 then
For each xx in aGiLights:xx.intensity = xx.intensity *(1-(DNS/100)):Next
For each xx in aAllFlashers:xx.opacity = xx.opacity *(1-(DNS/100)):Next
For each xx in AllLamps:xx.intensity = xx.intensity *(1-(DNS/100)):Next
For each xx in TargetDropGi:xx.intensity = xx.intensity *(1-(DNS/100)):Next
else
If DNS <= 40 or DNS >= 80 Then
For each xx in aGiLights:xx.intensity = xx.intensity *(.5-(DNS/100)):Next
For each xx in aAllFlashers:xx.opacity = xx.opacity *(.5-(DNS/100)):Next
For each xx in AllLamps:xx.intensity = xx.intensity *(.5-(DNS/100)):Next
For each xx in TargetDropGi:xx.intensity = xx.intensity *(.5-(DNS/100)):Next
else
For each xx in aGiLights:xx.intensity = xx.intensity *(.7-(DNS/100)):Next
For each xx in aAllFlashers:xx.opacity = xx.opacity *(.7-(DNS/100)):Next
For each xx in AllLamps:xx.intensity = xx.intensity *(.7-(DNS/100)):Next
For each xx in TargetDropGi:xx.intensity = xx.intensity *(.7-(DNS/100)):Next
end if
end if
solGI 0
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
' Thalamus 2020 June : Improved directional sounds
' !! NOTE : Table not verified yet !!
' Options
' Volume devided by - lower gets higher sound
Const VolDiv = 2000 ' Lower number, louder ballrolling/collition sound
Const VolCol = 10 ' Ball collition divider ( voldiv/volcol )
LoadVPM "01550000", "S11.vbs", 3.26
Dim bsTrough, bsDog, bsTrash, dtBird, dtMilk
Const cGameName = "bcats_l5"
Const UseSolenoids = 1
Const UseLamps = 0
Const UseGI = 0
Const UseSync = 1
Const HandleMech = 0
'Standard Sounds
Const SSolenoidOn = "fx_Solenoid"
Const SSolenoidOff = ""
Const SCoin = "fx_Coin"
BSize = 25.5
BMass = 1.7
'************
' Table init.
'************
dim HiddenVar
If Table1.ShowDT = False then
HiddenVar = 1
Else
HiddenVar = 0
end If
Sub Table1_Init
vpmInit me
With Controller
.GameName = cGameName
If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description:Exit Sub
.SplashInfoLine = "BadCats, Williams 1989" & vbNewLine & "VPX table by unclewilly v.1.0"
.Games(cGameName).Settings.Value("rol") = 0 '1= rotated display, 0= normal
.HandleMechanics = 0
.HandleKeyboard = 0
.ShowDMDOnly = 1
.ShowFrame = 0
.ShowTitle = 0
.Hidden = HiddenVar
If Err Then MsgBox Err.Description
End With
On Error Goto 0
Controller.Run
'Nudging
vpmNudge.TiltSwitch = swTilt
vpmNudge.Sensitivity = 2
'vpmNudge.TiltObj = Array(sw60, sw61, sw62, LeftSlingshot, RightSlingShot)
'Trough
Set bsTrough = New cvpmBallStack
With bsTrough
.InitSw 0, 10, 0, 0, 0, 0, 0, 0
.InitKick ballrelease, 90, 4
.InitEntrySnd "fx_Solenoid", "fx_Solenoid"
.InitExitSnd SoundFX("fx_ballrel", DOFContactors), SoundFX("fx_Solenoid", DOFContactors)
.IsTrough = True
.Balls = 1
End With
'Dog House hole
Set bsDog = New cvpmBallStack
With bsDog
.InitSw 0, 22, 0, 0, 0, 0, 0, 0
.InitKick Ralfie, 180, 25
.InitEntrySnd "fx_kicker_enter", "fx_Solenoid"
.InitExitSnd SoundFX("fx_kicker", DOFContactors), SoundFX("fx_Solenoid", DOFContactors)
.IsTrough = False
End With
'Trash hole
Set bsTrash = New cvpmBallStack
With bsTrash
.InitSaucer Bin, 24, 79, 22
.KickForceVar = 3
.KickAngleVar = 2
.InitExitSnd SoundFX("fx_kicker", DOFContactors), SoundFX("fx_kicker", DOFContactors)
.InitAddSnd SoundFX("fx_kicker_enter", DOFContactors)
.CreateEvents "bsTrash", Bin
End With
'Droptargets
set dtBird = new cvpmdroptarget
With dtBird
.InitDrop Array(sw25,sw26,sw27,sw28,sw29), Array(25, 26, 27, 28, 29)
.Initsnd SoundFX("fx_droptarget", DOFContactors), SoundFX("fx_resetdrop", DOFContactors)
End With
set dtMilk = new cvpmdroptarget
With dtMilk
.InitDrop Array(sw37,sw38,sw39), Array(37, 38, 39)
.Initsnd SoundFX("fx_droptarget", DOFContactors), SoundFX("fx_resetdrop", DOFContactors)
End With
' Seafood Wheel
Dim mSFWheelMech
Set mSFWheelMech = New cvpmMech
With mSFWheelMech
.MType = vpmMechStepSol + vpmMechCircle + vpmMechLinear + vpmMechFast
.Sol1 = 16
.Sol2 = 15
.Length = 200
.Steps = 200
.AddSw 44, 0, 99
.Callback = GetRef("UpdateWheel")
.Start
End With
'Init VariTarget
sw19w21.IsDropped = 1
sw19w31.IsDropped = 1
sw19w41.IsDropped = 1
'Main Timer init
PinMAMETimer.Interval = PinMAMEInterval
PinMAMETimer.Enabled = 1
If Table1.ShowDT = False then
For each xx in SideRails:xx.Visible = False:Next
End If
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
'**********
' Keys
'**********
Sub table1_KeyDown(ByVal Keycode)
If keycode = LeftFlipperKey Then
If FlipLag = 1 then flipnf 0, 1
end if
If keycode = RightFlipperKey Then
If FlipLag = 1 then flipnf 1, 1
end if
If keycode = LeftTiltKey Then Nudge 90, 5:PlaySound SoundFX("fx_nudge", 0), 0, 1, -0.1, 0.25
If keycode = RightTiltKey Then Nudge 270, 5:PlaySound SoundFX("fx_nudge", 0), 0, 1, 0.1, 0.25
If keycode = CenterTiltKey Then Nudge 0, 6:PlaySound SoundFX("fx_nudge", 0), 0, 1, 0, 0.25
If keycode = PlungerKey Then PlaySoundAtVol "fx_PlungerPull", Plunger, 1 :Plunger.Pullback
If vpmKeyDown(keycode) Then Exit Sub
End Sub
Sub table1_KeyUp(ByVal Keycode)
If keycode = LeftFlipperKey Then
If FlipLag = 1 then flipnf 0, 0
end if
If keycode = RightFlipperKey Then
If FlipLag = 1 then flipnf 1, 0
end if
If keycode = PlungerKey Then PlaySoundAtVol "fx_plunger", Plunger, 1 :Plunger.Fire
If vpmKeyUp(keycode) Then Exit Sub
End Sub
'*********
' Switches
'*********
'Slings & Rubbers
Dim LStep, RStep
Sub LeftSlingShot_Slingshot
PlaySoundAtVol SoundFX("fx_slingshot_left", DOFContactors), Lemk, 1
LeftSling4.Visible = 1
Lemk.RotX = 26
LStep = 0
vpmTimer.PulseSw 63
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
PlaySoundAtVol SoundFX("fx_slingshot_right", DOFContactors), Remk, 1
RightSling4.Visible = 1
Remk.RotX = 26
RStep = 0
vpmTimer.PulseSw 64
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
'Rubbers
Sub sw40_Hit():PlaySoundAtVol "fx_Rubber", ActiveBall, 1 ::vpmTimer.PulseSw 40:End Sub
Sub sw33_Hit():PlaySoundAtVol "fx_Rubber", ActiveBall, 1 ::vpmTimer.PulseSw 33:End Sub
Sub sw34_Hit():PlaySoundAtVol "fx_Rubber", ActiveBall, 1 ::vpmTimer.PulseSw 34:End Sub
' Bumpers
Sub sw60_Hit:vpmTimer.PulseSw 60:PlaySoundAtVol SoundFX("fx_bumper1", DOFContactors), ActiveBall, 1:End Sub
Sub sw61_Hit:vpmTimer.PulseSw 61:PlaySoundAtVol SoundFX("fx_bumper3", DOFContactors), ActiveBall, 1:End Sub
Sub sw62_Hit:vpmTimer.PulseSw 62:PlaySoundAtVol SoundFX("fx_bumper2", DOFContactors), ActiveBall, 1:End Sub
'Rollover & Ramp Switches
Sub sw11_Hit:Controller.Switch(11) = 1:PlaySoundAtVol "fx_sensor", ActiveBall, 1 :End Sub
Sub sw11_UnHit:Controller.Switch(11) = 0:End Sub
Sub sw12_Hit:Controller.Switch(12) = 1:PlaySoundAtVol "fx_sensor", ActiveBall, 1 :End Sub
Sub sw12_UnHit:Controller.Switch(12) = 0:End Sub
Sub sw13_Hit:Controller.Switch(13) = 1:PlaySoundAtVol "fx_sensor", ActiveBall, 1 :End Sub
Sub sw13_UnHit:Controller.Switch(13) = 0:End Sub
Sub sw14_Hit:Controller.Switch(14) = 1:PlaySoundAtVol "fx_sensor", ActiveBall, 1 :End Sub
Sub sw14_UnHit:Controller.Switch(14) = 0:End Sub
Sub sw36_Hit:Controller.Switch(36) = 1:PlaySoundAtVol "fx_sensor", ActiveBall, 1 :End Sub
Sub sw36_UnHit:Controller.Switch(36) = 0:End Sub
Sub sw30_Hit:Controller.Switch(30) = 1:PlaySoundAtVol "fx_sensor", ActiveBall, 1 :End Sub
Sub sw30_UnHit:Controller.Switch(30) = 0:End Sub
Sub sw31_Hit:Controller.Switch(31) = 1:PlaySoundAtVol "fx_sensor", ActiveBall, 1 :End Sub
Sub sw31_UnHit:Controller.Switch(31) = 0:End Sub
Sub sw35_Hit:Controller.Switch(35) = 1:PlaySoundAtVol "fx_sensor", ActiveBall, 1 :End Sub
Sub sw35_UnHit:Controller.Switch(35) = 0:End Sub
Sub sw41_Hit:Controller.Switch(41) = 1:sw41.Timerenabled = 1:PlaySoundAtVol "fx_sensor", ActiveBall, 1 :End Sub
Sub sw41_UnHit:Controller.Switch(41) = 0:End Sub
dim sw41Dir
sw41Dir = -1
Sub sw41_Timer()
If sw41P.ObjRotZ = 60 then sw41Dir = 5
If sw41P.ObjRotZ = 90 then sw41Dir = -5
sw41P.ObjRotZ = sw41P.ObjRotZ + sw41Dir
If sw41P.ObjRotZ = 90 then sw41.timerenabled = 0
End Sub
Sub sw43_Hit:Controller.Switch(43) = 1:sw43.Timerenabled = 1:PlaySoundAtVol "fx_sensor", ActiveBall, 1 :End Sub
Sub sw43_UnHit:Controller.Switch(43) = 0:End Sub
dim sw43Dir
sw43Dir = -1
Sub sw43_Timer()
If sw43P.ObjRotZ = 60 then sw43Dir = 5
If sw43P.ObjRotZ = 90 then sw43Dir = -5
sw43P.ObjRotZ = sw43P.ObjRotZ + sw43Dir
If sw43P.ObjRotZ = 90 then sw43.timerenabled = 0
End Sub
'Ramp Gates
Sub sw16_Hit:vpmTimer.PulseSw 16:End Sub
Sub sw23_Hit:vpmTimer.PulseSw 23:End Sub
' Linear Fish Target
Sub sw19_1_Hit:vpmTimer.PulseSw 19:PlaySoundAtVol SoundFX("fx_target", DOFContactors), ActiveBall, 1:Fisht.transY = -50:sw19w11.IsDropped = 1:sw19w21.IsDropped = 0:End Sub
Sub sw19_2_Hit:vpmTimer.PulseSw 19:PlaySoundAtVol SoundFX("fx_target", DOFContactors), ActiveBall, 1:Fisht.transY = -95:sw19w21.IsDropped = 1:sw19w31.IsDropped = 0:End Sub
Sub sw19_3_Hit:vpmTimer.PulseSw 19:PlaySoundAtVol SoundFX("fx_target", DOFContactors), ActiveBall, 1:Fisht.transY = -135:sw19w31.IsDropped = 1:sw19w41.IsDropped = 0:End Sub
Sub sw19_4_Hit:vpmTimer.PulseSw 19:PlaySoundAtVol SoundFX("fx_target", DOFContactors), ActiveBall, 1:End Sub
Sub sw19_1_UnHit
If ActiveBall.VelY > 0 Then
sw19w11.IsDropped = 0
sw19w21.IsDropped = 1
End If
End Sub
Sub sw19_2_UnHit
If ActiveBall.VelY > 0 Then
sw19w21.IsDropped = 0
sw19w31.IsDropped = 1
End If
End Sub
Sub sw19_3_UnHit
If ActiveBall.VelY > 0 Then
sw19w31.IsDropped = 0
sw19w41.IsDropped = 1
End If
End Sub
Sub sw19_4_UnHit
End Sub
Sub Fanimation_UnHit():FTTimer.Enabled = 1:End Sub
Sub FTTimer_Timer()
If FishT.TransY < 0 Then
FishT.TransY =FishT.TransY + 5
Else
FTTimer.enabled = 0
end If
End Sub
'Droptargets VPX
Sub sw25_Hit:PlaySoundAtVol SoundFX("fx_droptarget", DOFContactors), ActiveBall, 1:End Sub 'hit event only for the sound
Sub sw25_Dropped:dtBird.hit 1:If GIState=1 then:sw25l.State = 1:end if: sw25.Image = "BirdTD": End Sub
Sub sw26_Hit:PlaySoundAtVol SoundFX("fx_droptarget", DOFContactors), ActiveBall, 1:End Sub 'hit event only for the sound
Sub sw26_Dropped:dtBird.hit 2:If GIState=1 then:sw26l.State = 1:end if:sw26.Image = "BirdTD": End Sub
Sub sw27_Hit:PlaySoundAtVol SoundFX("fx_droptarget", DOFContactors), ActiveBall, 1:End Sub 'hit event only for the sound
Sub sw27_Dropped:dtBird.hit 3:If GIState=1 then:sw27l.State = 1:end if:sw27.Image = "BirdTD": End Sub
Sub sw28_Hit:PlaySoundAtVol SoundFX("fx_droptarget", DOFContactors), ActiveBall, 1:End Sub 'hit event only for the sound
Sub sw28_Dropped:dtBird.hit 4:If GIState=1 then:sw28l.State = 1:end if:sw28.Image = "BirdTD": End Sub
Sub sw29_Hit:PlaySoundAtVol SoundFX("fx_droptarget", DOFContactors), ActiveBall, 1:End Sub 'hit event only for the sound
Sub sw29_Dropped:dtBird.hit 5:sw29.Image = "BirdTD": End Sub
Sub sw37_Hit:PlaySoundAtVol SoundFX("fx_droptarget", DOFContactors), ActiveBall, 1:End Sub 'hit event only for the sound
Sub sw37_Dropped:dtMilk.hit 1:If GIState=1 then:sw37l.State = 1:end if:sw37.Image = "MilkD": End Sub
Sub sw38_Hit:PlaySoundAtVol SoundFX("fx_droptarget", DOFContactors), ActiveBall, 1:End Sub 'hit event only for the sound
Sub sw38_Dropped:dtMilk.hit 2:If GIState=1 then:sw38l.State = 1:end if:sw38.Image = "MilkD": End Sub
Sub sw39_Hit:PlaySoundAtVol SoundFX("fx_droptarget", DOFContactors), ActiveBall, 1:End Sub 'hit event only for the sound
Sub sw39_Dropped:dtMilk.hit 3:If GIState=1 then:sw39l.State = 1:end if:sw39.Image = "MilkD": End Sub
' Drain & holes
Sub Bin_Hit():BsTrash.AddBall 0:End Sub
Sub Drain_Hit:PlaysoundAtVol "fx_drain", ActiveBall, 1:bsTrough.AddBall Me:End Sub
Sub Ralfie_Hit:PlaysoundAtVol "fx_scoop", ActiveBall, 1 :bsDog.AddBall Me:End Sub
' Ramp Helpers
Sub LHelp_Hit():Playsound "fx_balldrop", 0, 1, -0.05, 0.05:end Sub
Sub RHelp_Hit():Playsound "fx_balldrop", 0, 1, 0.05, 0.05:end Sub
Sub WireRampSound_Hit():Playsound "WireRamp", 0, 1, 0, 0.35:end Sub
'***********
' Solenoids
'***********
' from pacdudes script
SolCallback(1) = "bsTrough.SolIn"
SolCallback(1) = "bsTrough.SolOut"
SolCallback(2) = "vpmsolsound SoundFX(""fx_knocker"",DOFKnocker),"
SolCallback(3) = "SolDogOut"
SolCallback(4) = "solMT" 'dtMilk.SolDropUp
SolCallback(5) = "bsTrash.SolOut"
SolCallback(6) = "SolBT" 'dtBird.SolDropUp
SolCallback(10)= "SolGIBlink"
SolCallBack(23)= "SolGION" 'check to see if 10 works
SolCallback(15) = "SolSFW1"
SolCallback(16) = "SolSFW"
'Flashers
SolCallback(25) = "flash125"
SolCallback(26) = "flash126"
SolCallback(27) = "flash127"
SolCallback(28) = "flash128"
SolCallback(29) = "flash129"
SolCallback(30) = "flash130"
SolCallback(31) = "flash131"
SolCallback(32) = "flash132"
'Solenoid Subs
Sub SolDogOut(enabled)
If Enabled Then
bsDog.ExitSol_On
SetLamp 190, 0
End If
End Sub
Sub SolSFW(enabled)
If enabled Then
SetLamp 190, 1
Else
SetLamp 190, 0
end If
end Sub
Sub SolSFW1(enabled)
If enabled Then
SetLamp 190, 1
Else
SetLamp 190, 0
end If
end Sub
Sub solMT(enabled)
If enabled Then
dtMilk.DropSol_On
For each xx in MTGi:xx.State = 0:next
For each xx in MT:xx.Image = "Milk":next
Else
end If
end Sub
Sub solBT(enabled)
If enabled Then
dtBird.DropSol_On
For each xx in BTGi:xx.State = 0:next
For each xx in BT:xx.Image = "BirdT":next
Else
end If
end Sub
Sub Flash127(enabled)
If enabled Then
Setlamp 127, 1
Else
SetLamp 127, 0
end If
end Sub
Sub Flash125(enabled)
If enabled Then
Setlamp 125, 1
Else
SetLamp 125, 0
end If
end Sub
Sub Flash126(enabled)
If enabled Then
Setlamp 126, 1
Else
SetLamp 126, 0
end If
end Sub
Sub Flash128(enabled)
If enabled Then
Setlamp 128, 1
Else
SetLamp 128, 0
end If
end Sub
Sub Flash129(enabled)
If enabled Then
Setlamp 129, 1
Else
SetLamp 129, 0
end If
end Sub
Sub Flash130(enabled)
If enabled Then
Setlamp 130, 1
Else
SetLamp 130, 0
end If
end Sub
Sub Flash131(enabled)
If enabled Then
Setlamp 131, 1
Else
SetLamp 131, 0
end If
end Sub
Sub Flash132(enabled)
If enabled Then
Setlamp 132, 1
Else
SetLamp 132, 0
end If
end Sub
Sub ACRelay(enabled)
vpmNudge.SolGameOn enabled
End Sub
'**************
' Flipper Subs
'**************
SolCallback(sLRFlipper) = "SolRFlipper"
SolCallback(sLLFlipper) = "SolLFlipper"
Sub SolLFlipper(Enabled)
If Enabled Then
If FlipLag = 0 then
PlaySound SoundFX("fx_flipperup", DOFContactors), 0, 1, -0.1, 0.25
LeftFlipper.RotateToEnd
end If
Else
If FlipLag = 0 then
PlaySound SoundFX("fx_flipperdown", DOFContactors), 0, 1, -0.1, 0.25
LeftFlipper.RotateToStart
end if
End If
End Sub
Sub SolRFlipper(Enabled)
If Enabled Then
If FlipLag = 0 then
PlaySound SoundFX("fx_flipperup", DOFContactors), 0, 1, 0.1, 0.25
RightFlipper.RotateToEnd
end if
Else
If FlipLag = 0 then
PlaySound SoundFX("fx_flipperdown", DOFContactors), 0, 1, 0.1, 0.25
RightFlipper.RotateToStart
end if
End If
End Sub
Sub LeftFlipper_Collide(parm)
PlaySoundAtBallVol "fx_rubber_flipper", parm / 10
End Sub
Sub RightFlipper_Collide(parm)
PlaySoundAtBallVol "fx_rubber_flipper", parm / 10
End Sub
'SeaFoodWheel Based on jp's script based on cyclone script
Dim SFWSpin
SFWSpin = 0
Sub UpdateWheel(aNewPos, aSpeed, aLastPos)
' 360/200= 1.8
If aNewPos <> aLastPos then
SFWheel.ObjRotZ = aNewPos * 1.8
End If
End Sub
'*********
' Special Flippers
'*********
dim FlippersEnabled
sub flipnf(LR, DU)
if LR = 0 Then 'left flipper
if DU = 1 then
If FlippersEnabled = True then
leftflipper.rotatetoend
LeftFlipperSound 1
end if
controller.Switch(swLLFlip) = True
Elseif DU = 0 then
If FlippersEnabled = True then
leftflipper.rotatetoStart
LeftFlipperSound 0
end if
controller.Switch(swLLFlip) = False
end if
elseif LR = 1 then ''right flipper
if DU = 1 then
If FlippersEnabled = True then
RightFlipper.rotatetoend
RightFlipperSound 1
end if
controller.Switch(swLRFlip) = True
Elseif DU = 0 then
If FlippersEnabled = True then
RightFlipper.rotatetoStart
RightFlipperSound 0
end if
controller.Switch(swLRFlip) = False
end if
end if
end sub
sub LeftFlipperSound(updown)'called along with the flipper, so feel free to add stuff, EOStorque tweaks, animation updates, upper flippers, whatever.
if updown = 1 Then
PlaySound SoundFX("fx_flipperup", DOFContactors), 0, 1, -0.1, 0.25 'flip
Else
PlaySound SoundFX("fx_flipperdown", DOFContactors), 0, 1, -0.1, 0.25'return
end if
end sub
sub RightFlipperSound(updown)
if updown = 1 Then
PlaySound SoundFX("fx_flipperup", DOFContactors), 0, 1, 0.1, 0.25 'flip
Else
PlaySound SoundFX("fx_flipperdown", DOFContactors), 0, 1, 0.1, 0.25'return
end if
end sub
'************GI Subs
Dim GIActive,GIState
GIActive=0:GIState=0
Sub SolGION(enabled)
FlippersEnabled = Enabled
If enabled then
GIActive=1:SolGI 1
else
GIActive=0:SolGI 0
if leftflipper.startangle > leftflipper.endangle Then
if leftflipper.currentangle < leftflipper.startangle then leftflipper.rotatetostart : leftflippersound 0 : end if
elseif leftflipper.startangle < leftflipper.endangle Then
if leftflipper.currentangle > leftflipper.startangle then leftflipper.rotatetostart : leftflippersound 0 : end If
end If
if rightflipper.startangle > rightflipper.endangle Then
if rightflipper.currentangle < rightflipper.startangle then rightflipper.rotatetostart : rightflippersound 0 : end if
elseif rightflipper.startangle < rightflipper.endangle Then
if rightflipper.currentangle > rightflipper.startangle then rightflipper.rotatetostart : rightflippersound 0 : end If
end If
end if
End Sub
Sub SolGIBlink(enabled)
If GIActive=1 then:SolGI Not enabled:end if
End Sub
'GI Lights
Sub SolGI(Enabled)
If enabled then
Playsound "fx_relay_on" 'ninuzzu - added relay click sound
Table1.ColorGradeImage = "ColorGrade_8" 'ninuzzu - added LUT color grade---->this will light the whole table when GI is on
For each xx in aGiLights:xx.State = 1:next
If Sw28.IsDropped = 1 then: sw28l.State = 1: End if
If Sw27.IsDropped = 1 then: sw27l.State = 1: End if
If Sw26.IsDropped = 1 then: sw26l.State = 1: End if
If Sw25.IsDropped = 1 then: sw25l.State = 1: End if
If Sw39.IsDropped = 1 then: sw39l.State = 1: End if
If Sw38.IsDropped = 1 then: sw38l.State = 1: End if
If Sw37.IsDropped = 1 then: sw37l.State = 1: End if
GIState=1
SetLamp 190, 0
else
Playsound "fx_relay_off" 'ninuzzu - added relay click sound
Table1.ColorGradeImage = "ColorGrade_1" 'ninuzzu - added LUT color grade---->this will darken the whole table when GI is off
For each xx in aGiLights:xx.State = 0:next
For each xx in TargetDropGi:xx.State = 0:next
GIState=0
end if
End Sub
'******************************************************
' JP's VP10 Fading Lamps & Flashers
' very reduced, mostly for rom activated flashers
' if you need to turn a light on or off then use:
' LightState(lightnumber) = 0 or 1
' Based on PD's Fading Light System
'******************************************************
Dim LightState(200), FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
InitFlashers() ' turn off the lights and flashers and reset them to the default parameters
LampTimer.Interval = 50 'lamp fading speed
LampTimer.Enabled = 1
Sub LampTimer_timer()
Dim chgLamp, x
chgLamp = Controller.ChangedLamps
If Not IsEmpty(chgLamp) Then
For x = 0 To UBound(chgLamp)
LightState(chgLamp(x, 0) ) = chgLamp(x, 1) 'light state as set by the rom
Next
End If
' Lights & Flashers
LightX 1, l1
LightX 2, l2
LightX 3, l3
LightX 4, l4
LightX 5, l5
LightX 6, l6
LightX 7, l7
LightX 8, l8
Flash 9, l9
Flash 10, l10
Flash 11, l11
Flash 12, l12
Flash 13, l13
LightX 14, l14
LightX 15, l15
LightX 16, l16
Flash 17, l17
Flash 18, l18
Flash 19, l19
LightX 21, l21
LightX 22, l22
LightX 23, l23
LightX 24, l24
LightX 25, l25
LightX 26, l26
LightX 27, l27
LightX 28, l28
LightX 29, l29
LightX 30, l30
LightX 31, l31
LightX 33, l33
LightX 34, l34
LightX 35, l35
LightX 36, l36
LightX 37, l37
LightX 38, l38
LightX 39, l39
LightX 40, l40
LightX 41, l41
LightX 42, l42
LightX 43, l43
LightX 44, l44
LightX 45, l45
LightX 46, l46
LightX 47, l47
LightX 48, l48
LightX 49, l49
LightX 50, l50
LightX 51, l51
LightX 52, l52
LightX 53, l53
' LightX 54, l54 'Lamp shed backglass
' LightX 55, l55 'bbq bg
' LightX 56, l56 'candle bg
' LightX 57, l57 '57-64 bg jackpot 1000000 - 8000000
' LightX 58, l58
' LightX 59, l59
' LightX 60, l60
' Flashm 61, Diode3
' Flash 62, Diode4
' LightX 63, l63
' LightXm 64, l69a
LightXm 125, f25a
LightX 125, f25
LightXm 126, f26a
LightXm 126, f26
Flash 126, f26b
LightXm 127, f27
lightXm 127, f27a
Flash 127, f27b
LightXm 128, f28a
LightXm 128, f28
Flash 128, f28b
LightXm 129, f29a
LightXm 129, f29
Flash 129, f29b
LightXm 130, f30
Flash 130, f30a
LightXm 131, f31a
LightXm 131, f31
Flash 131, f31b
LightXm 132, f32
Flash 132, f32a
Flash 190, SFWL
End Sub
Sub SetLamp(nr, value)
If value <> LightState(nr) Then
LightState(nr) = value
End If
End Sub
' div lamp subs
Sub InitFlashers()
Dim x
For x = 0 to 200
LightState(x) = 0 ' light state: 0=off, 1=on, -1=no change (on or off)
FlashSpeedUp(x) = 0.5 ' Fade Speed Up
FlashSpeedDown(x) = 0.25 ' Fade Speed Down
FlashMax(x) = 1 ' the maximum intensity when on, usually 1
FlashMin(x) = 0 ' the minimum intensity when off, usually 0
FlashLevel(x) = 0 ' the intensity/fading of the flashers
Next
End Sub
' VPX Lights, just turn them on or off
Sub LightX(nr, object)
Select Case LightState(nr)
Case 0, 1:object.state = LightState(nr):LightState(nr) = -1
End Select
End Sub
Sub LightXm(nr, object) 'multiple lights
Select Case LightState(nr)
Case 0, 1:object.state = LightState(nr)
End Select
End Sub
' VPX Flashers, changes the intensity
Sub Flash(nr, object)
Select Case LightState(nr)
Case 0 'off
FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
If FlashLevel(nr) < FlashMin(nr) Then
FlashLevel(nr) = FlashMin(nr)
LightState(nr) = -1 'completely off, so stop the fading loop
End if
Object.IntensityScale = FlashLevel(nr)
Case 1 ' on
FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
If FlashLevel(nr) > FlashMax(nr) Then
FlashLevel(nr) = FlashMax(nr)
LightState(nr) = -1 'completely on, so stop the fading loop
End if
Object.IntensityScale = FlashLevel(nr)
End Select
End Sub
Sub Flashm(nr, object) 'multiple flashers, it just sets the intensity
Object.IntensityScale = FlashLevel(nr)
End Sub
' *******************************************************************************************************
' Positional Sound Playback Functions by DJRobX, Rothbauerw, Thalamus and Herweh
' PlaySound sound, 0, Vol(ActiveBall), AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 1, AudioFade(ActiveBall)
' *******************************************************************************************************
' Play a sound, depending on the X,Y position of the table element (especially cool for surround speaker setups, otherwise stereo panning only)
' parameters (defaults): loopcount (1), volume (1), randompitch (0), pitch (0), useexisting (0), restart (1))
' Note that this will not work (currently) for walls/slingshots as these do not feature a simple, single X,Y position
Sub PlayXYSound(soundname, tableobj, loopcount, volume, randompitch, pitch, useexisting, restart)
PlaySound soundname, loopcount, volume, AudioPan(tableobj), randompitch, pitch, useexisting, restart, AudioFade(tableobj)
End Sub
' Set position as table object (Use object or light but NOT wall) and Vol to 1
Sub PlaySoundAt(soundname, tableobj)
PlaySound soundname, 1, 1, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
End Sub
' set position as table object and Vol + RndPitch manually
Sub PlaySoundAtVolPitch(sound, tableobj, Vol, RndPitch)
PlaySound sound, 1, Vol, AudioPan(tableobj), RndPitch, 0, 0, 1, AudioFade(tableobj)
End Sub
'Set all as per ball position & speed.
Sub PlaySoundAtBall(soundname)
PlaySoundAt soundname, ActiveBall
End Sub
'Set position as table object and Vol manually.
Sub PlaySoundAtVol(sound, tableobj, Volume)
PlaySound sound, 1, Volume, AudioPan(tableobj), 0,0,0, 1, AudioFade(tableobj)
End Sub
'Set all as per ball position & speed, but Vol Multiplier may be used eg; PlaySoundAtBallVol "sound",3
Sub PlaySoundAtBallVol(sound, VolMult)
PlaySound sound, 0, Vol(ActiveBall) * VolMult, AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 1, AudioFade(ActiveBall)
End Sub
Sub PlaySoundAtBallAbsVol(sound, VolMult)
PlaySound sound, 0, VolMult, AudioPan(ActiveBall), 0, Pitch(ActiveBall), 0, 1, AudioFade(ActiveBall)
End Sub
' requires rampbump1 to 7 in Sound Manager
Sub RandomBump(voladj, freq)
Dim BumpSnd:BumpSnd= "rampbump" & CStr(Int(Rnd*7)+1)
PlaySound BumpSnd, 0, Vol(ActiveBall)*voladj, AudioPan(ActiveBall), 0, freq, 0, 1, AudioFade(ActiveBall)
End Sub
' set position as bumperX and Vol manually. Allows rapid repetition/overlaying sound
Sub PlaySoundAtBumperVol(sound, tableobj, Vol)
PlaySound sound, 1, Vol, AudioPan(tableobj), 0,0,1, 1, AudioFade(tableobj)
End Sub
Sub PlaySoundAtBOTBallZ(sound, BOT)
PlaySound sound, 0, ABS(BOT.velz)/17, Pan(BOT), 0, Pitch(BOT), 1, 0, AudioFade(BOT)
End Sub
' play a looping sound at a location with volume
Sub PlayLoopSoundAtVol(sound, tableobj, Vol)
PlaySound sound, -1, Vol, AudioPan(tableobj), 0, 0, 1, 0, AudioFade(tableobj)
End Sub
'*********************************************************************
' Supporting Ball & Sound Functions
'*********************************************************************
Function RndNum(min, max)
RndNum = Int(Rnd() * (max-min + 1) ) + min ' Sets a random number between min and max
End Function
Function AudioFade(tableobj) ' Fades between front and back of the table (for surround systems or 2x2 speakers, etc), depending on the Y position on the table. "table1" is the name of the table
Dim tmp
On Error Resume Next
tmp = tableobj.y * 2 / table1.height-1
If tmp > 0 Then
AudioFade = Csng(tmp ^10)
Else
AudioFade = Csng(-((- tmp) ^10) )
End If
End Function
Function AudioPan(tableobj) ' Calculates the pan for a tableobj based on the X position on the table. "table1" is the name of the table
Dim tmp
On Error Resume Next
tmp = tableobj.x * 2 / table1.width-1
If tmp > 0 Then
AudioPan = Csng(tmp ^10)
Else
AudioPan = Csng(-((- tmp) ^10) )
End If
End Function
Function 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
On Error Resume Next
tmp = ball.x * 2 / table1.width-1
If tmp > 0 Then
Pan = Csng(tmp ^10)
Else
Pan = Csng(-((- tmp) ^10) )
End If
End Function
Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed
Vol = Csng(BallVel(ball) ^2 / VolDiv)
End Function
Function VolMulti(ball,Multiplier) ' Calculates the Volume of the sound based on the ball speed
VolMulti = Csng(BallVel(ball) ^2 / 150 ) * Multiplier
End Function
Function DVolMulti(ball,Multiplier) ' Calculates the Volume of the sound based on the ball speed
DVolMulti = Csng(BallVel(ball) ^2 / 150 ) * Multiplier
debug.print DVolMulti
End Function
Function BallRollVol(ball) ' Calculates the Volume of the sound based on the ball speed
BallRollVol = Csng(BallVel(ball) ^2 / (80000 - (79900 * Log(RollVol) / Log(100))))
End Function
Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed
Pitch = BallVel(ball) * 20
End Function