-
Notifications
You must be signed in to change notification settings - Fork 37
/
Congo (Williams 1995) 1.2.vbs
2698 lines (2299 loc) · 81.3 KB
/
Congo (Williams 1995) 1.2.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
' Original VP9 Table by JPSalas
' VP10 conversion by nFozzy
'
' Spotlight primitive by Dark
' Flasher images by LoadedWeapon
' Some SFX by Knorr and Clark Kent
'Version 1.2
' Thalamus 2018-08-14
' Added/Updated "Positional Sound Playback Functions" and "Supporting Ball & Sound Functions"
' Changed UseSolenoids=1 to 2
' Improved directional sound locations
Option Explicit
Randomize
On Error Resume Next
ExecuteGlobal GetTextFile("controller.vbs")
If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
On Error Goto 0
'Options------
const HardFlips = 1 'more rigid flippers
const SingleScreenFS = 0 'Single Screen FS support
InlaneType 0 '0 = smooth feed to the left flipper, 1 = old sticky inlane
'------------
Dim DesktopMode:DesktopMode = Table1.ShowDT
Dim UseVPMColoredDMD
Const UseVPMModSol = 1
if SingleScreenFS = 1 then UseVPMColoredDMD = True else UseVPMColoredDMD = DesktopMode
LoadVPM "01560000", "WPC.VBS", 3.5
' Thal: because of useSolenoids=2
Const cSingleRFlip = 0
'********************
'Standard definitions
'********************
Const UseSolenoids = 2
Const UseLamps = 0
Const UseSync = 0
Const HandleMech = 0
'Const UseGI = 0
' Standard Sounds
'Const SSolenoidOn = "fx_solenoid"
'Const SSolenoidOff = ""
Const SCoin = "fx_Coin"
Const cGameName = "congo_21"
Dim bsTrough, bsAmyVuk, bsVolcano, bsMap, bsMystery, LowerPlayfieldBall
dim bip : bip = 0
Set GICallback = GetRef("UpdateGIon")
Set GICallback2 = GetRef("UpdateGI")
'Set MotorCallback = GetRef("RollingUpdate") 'realtime updates - rolling sound
Sub InLaneType(i)
if i = 1 Then
LeftInLane_Smooth.isdropped = 1
LeftInLane_Sticky.Isdropped = 0
Else
LeftInLane_Smooth.isdropped = 0
LeftInLane_Sticky.Isdropped = 1
End If
End Sub
'ignore this
sub ReflectionsModulate(value)
dim x
for each x in Co1
x.modulatevsadd = value
Next
End Sub
sub ReflectionsOpacity(value)
dim x
for each x in Co1
x.opacity = value
Next
End Sub
gi_bulb1.visible = 1
gi_bulb2.visible = 1
GI28.visible = 1
GI29.visible = 1
Gi30.visible = 1
f17fa.rotx = -3
f17fa.roty = 0 '0
f17fa.rotz = -25
f17fa.height =280 '237
f17fa.x =270 '259.69
f17fa.y =450 '266.398
f17fa.opacity = 5000
f17fa.modulatevsadd = 1
'lower gorilla GI
giflare4.height = -35
GIflare4.rotx = 5
GIflare4.roty = 60
GIflare4.rotz = -4.5
giflare4.x = 605
giflare4.y = 1340 '1281.39
giflare5.height = -15
giflare5.rotx = 12
giflare5.roty = -60
giflare5.rotz = -15
giflare5.x = 275
giflare5.y = 1345 '1281.39
gorillaleft 1
congoG.height = -142.4
congog.rotx = 12
congoG.opacity = 25000
congoG.modulatevsadd = 1
gi_ambientbottom.modulatevsadd = 1
gi_ambienttop.modulatevsadd = 1
gi_ambienttop.opacity = 4500
gi_ambientbottom.opacity = 4500
Gi_flasher.opacity = 5000
'************
' Table init.
'************
Sub Table1_Init
vpmInit Me
With Controller
.GameName = cGameName
If Err Then MsgBox "Can't start Game " & cGameName & vbNewLine & Err.Description:Exit Sub
.SplashInfoLine = "Congo (Williams 1995)"
.Games(cGameName).Settings.Value("rol") = 0 'set it to 1 to rotate the DMD to the left
' .HandleKeyboard = 0
.ShowTitle = 0
.ShowDMDOnly = 1
.ShowFrame = 0
.HandleMechanics = 0
' .Hidden = DesktopMode
' .Hidden = 0
If DesktopMode then
.Hidden = 1
else
If SingleScreenFS = 1 then
.Hidden = 1
else
.Hidden = 0
End If
End If
On Error Resume Next
.Run GetPlayerHWnd
If Err Then MsgBox Err.Description
On Error Goto 0
.Switch(22) = 1 'close coin door
.Switch(24) = 1 'and keep it close
End With
' Nudging
vpmNudge.TiltSwitch = 14
vpmNudge.Sensitivity = 0.25
vpmNudge.TiltObj = Array(bumper1, bumper2, bumper3, LeftSlingshot, RightSlingshot)
' Trough
Set bsTrough = New cvpmTrough
With bsTrough
.size = 4
.initSwitches Array(32, 33, 34, 35)
.Initexit BallRelease, 90, 4
.Balls = 4
End With
' Volcano
Set bsVolcano = New cvpmTrough
With bsVolcano
.size = 4
.initSwitches Array(41, 42, 43)
.Initexit sw36a, 260, 10
.InitExitVariance 10, 1 'direction, force
.InitExitVariance 2, 2
' .MaxBallsPerKick = 2
End With
'2-way Popper
Set bsAmyVuk = New cvpmSaucer
With bsAmyVuk
.InitKicker sw53, 53, 330, 30, 65 'up 'switch, direction, force, Zforce
.InitAltKick 145, 30, 60 'down
End With
Set BsMystery = New cvpmSaucer
With bsMystery
.InitKicker sw37, 37, 185, 20, 45
.InitExitVariance 2, 1
End With
Set bsMap = New cvpmSaucer
With bsMap
.InitKicker sw38, 38, 210, 20, 45
.InitExitVariance 2, 1
End With
' Main Timer init
PinMAMETimer.Interval = PinMAMEInterval
PinMAMETimer.Enabled = 1
' Init Kickback
KickBack.Pullback
AutoPlunger.Pullback
' Init other dropwalls - animations
LeftPost.IsDropped = 1:SolTopPost 0
TopPost.IsDropped = 0
leftpost_invis.IsDropped = 1
'Lower Playfield Ball
CreateLPFball
gorillaleft 0
'Sidewall tops
borderL.visible = cInt(desktopmode)
borderR.visible = cInt(desktopmode)
borderL2.visible = cInt(desktopmode)
borderR2.visible = cInt(desktopmode)
'DMD Adjust
if DesktopMode Then
flasherDMD.X = -58: flasherDMD.Y = 1580: flasherDMD.rotX = -40: flasherDMD.rotY = 2.5:flasherDMD.height = 830
elseif SingleScreenFS then
'/
' msgbox("SSFS")
Else
flasherdmd.visible = 0
end if
FlashLevel(0) = 1.1 : FlashLevel(1) = 0.98 : FlashLevel(2) = 0.98 'boot gi (needs help)
UpdateGI 0, 8:UpdateGI 1, 8:UpdateGI 2, 8
End Sub
Sub CreateLPFball
Set LowerPlayfieldBall = kickerLPF.Createball
with LowerPlayfieldBall
' .image = "ball_HDR"
.color = RGB(108,108,108) '148
.BulbIntensityScale = 0
end with
kickerLPF.Kick 180, 1
End Sub
Sub LPFcatcherTrigger_hit() 'in case the ball bugs
' tb.text = "hit!"
me.destroyball
CreateLPFball
end sub
Sub table1_Paused:Controller.Pause = 1:End Sub
Sub table1_unPaused:Controller.Pause = 0:End Sub
'***********
' Update GI
'***********
Dim gistep, Giswitch, xx
Giswitch = 0
Sub UpdateGIOn(no, Enabled)
' tbs.text = "on:" & no & " " & enabled
Select Case no
Case 0 'Gorilla
If Enabled Then
' SetLamp 190, 1
' For each xx in GIGorilla:xx.State = 1: Next
setmodlamp 0, gistepm
FadingLevel(0) = 5
Else
' For each xx in GIGorilla:xx.state = 0: Next
' SetLamp 190, 0
setmodlamp 0, 0
' FadingLevel(0) = 4
End If
Case 1
If Enabled Then
' For Each xx in GiTop:xx.state = 1: Next
'' Gi_flasher.visible = 1 'spotlight
' SetLamp 191, 1
setmodlamp 1, gistepm
FadingLevel(1) = 5
GI28.state = 1
GI29.state = 1
Gi30.state = 1
else
' For Each xx in GiTop:xx.state = 0: Next
'' Gi_flasher.visible = 0
' SetLamp 191, 0
' UpdateLightScaling 0, 1
setmodlamp 1, 0
' FadingLevel(1) = 4
GI28.state = 0
GI29.state = 0
Gi30.state = 0
End If
Case 2
If Enabled Then
' For Each xx in GiBottom:xx.state = 1: Next
' SetLamp 192, 1
setmodlamp 2, gistepm
FadingLevel(2) = 5
gi_bulb1.state = 1
gi_bulb2.state = 1
Else
' For Each xx in GiBottom:xx.state = 0: Next
' SetLamp 192, 0
' UpdateLightScaling 0, 2
setmodlamp 2, 0
' FadingLevel(2) = 4
gi_bulb1.state = 0
gi_bulb2.state = 0
End If
End Select
End Sub
'cutting down the intensity a bit
'min 50% intensityscale
'x = intensityscale y = gistep
'x1= 0.5 y1= 1
'x2= 1 y2= 7
'solve for slope
''m = (y2 - y1) / (x2 - x1)
' (7 - 1) / (1 - 0.5)
' 6 / 0.5
'm = 12
'point slope formula
'y - y1 = m(x-x1)
' y - 1 = 12(x-0.5)
'y = 12x -5
'x = (y+5)/12
dim gistepm
Sub UpdateGI(no, step)
Dim ii, x
If step = 0 then exit sub 'only values from 1 to 8 are visible and reliable. 0 is not reliable and 7 & 8 are the same so...
gistep = (step-1)' / 7
gistepm = ScaleGI(gistep, 25)
' tbs.text = "mod:" & no & " " & step
Select Case no
Case 0
' textbox1.text = step
' If step > 0 and step < 8 Then
' For each xx in GIGorilla:xx.State = 1: Next
' Else
' For each xx in GIGorilla:xx.state = 0: Next
' End If
' GorillaGI
' For each ii in GiGorilla
' ii.IntensityScale = gistepm
' Next
' GI_gorilla.opacity = GI_gorilla.uservalue * gistepm
' GIflare4.opacity = GIflare4.uservalue * gistepm
' GIflare5.opacity = GIflare5.uservalue * gistepm
setmodlampf 0, gistepm
Case 1
' UpdateLightScaling 1, 1
' For each ii in GiTop
' ii.IntensityScale = gistepm
' ' back.Image="backwall"&step
' Next
' GI_AmbientTop.Opacity = GI_AmbientTop.UserValue * gistepm
' GI_PlasticsTop.Opacity = GI_PlasticsTop.UserValue * gistepm
' Gi_flasher.Opacity = Gi_flasher.UserValue * gistepm 'spotlight
' GIflare1.opacity = GIflare1.uservalue * gistepm
' GIflare2.opacity = GIflare2.uservalue * gistepm
setmodlampf 1, gistepm
Case 2
' UpdateLightScaling 1, 2
' For each ii in GiBottom
' ii.IntensityScale = gistepm
' Next
' GI_AmbientBottom.Opacity = GI_AmbientBottom.UserValue * gistepm
' GI_PlasticsBottom.Opacity = GI_PlasticsBottom.UserValue * gistepm
' Gi_PlasticsBottomLvl2.opacity = GI_PlasticsBottomLvl2.UserValue * gistepm
' GIflare3.opacity = GIflare3.uservalue * gistepm
setmodlampf 2, gistepm
End Select
End Sub
'This sub scales lights / flashers to compensate for the GI
Sub UpdateLightScaling(onoff, gistring) 'onoff: send 0 for GI on/off callback 'gistring: 1 is top, 2 is bottom, 3 is Lpf
dim x, ii, GIi, temp1, temp2
dim s, i
if onoff = 0 then
' exit sub
ii = 0
GIi = (9/8) - ii/64
elseif onoff = 1 then
' exit sub 'debug
ii = gistep 'off behaves as if GIstep at 0, for the GI on/off callback
GIi = (9/8) - ii/64
' Else just for testing
' Giscale = onoff
end if
Select Case gistring
case 1 'Top
temp1 = giscale(120)
temp2 = giscale(125)
for x = 100 to 200
' if x = 120 then Continue For
' if x = 125 then Continue For
GIscale(x) = GIi
Next
GIscale(120) = temp1
GIscale(125) = temp2 'ug
' nModLightm 17, f17b, 0
' nModLight 17, f17
' nModLight 18, F18
' nModLight 19, F19
' nModLight 21, F21
' nModLight 26, f26
' nModLightm 27, F27A, 10 'big ambient '137
' nModLightm 27, F27B, 11 'smaller bulb '138
' nModLightm 27, F27C, 12 'wall absorb (TODO replace eventually with a flasher) '139
' nModLight 27, F27 'primary bulb
' nModLightm 28, F28B, 1 'ambient '129
' nModLight 28, F28B
for each x in LampsTOP
s = mid(x.name, 2, 2) 'take L off the lamp's name
i = cInt(s) 'convert string to integer to get the lampnumber
x.intensityscale = GIi
x.fadespeedup = insertfading(i, 1) * x.intensityscale
x.fadespeeddown = insertfading(i, 2) * x.intensityscale
Next
for each x in LampsMIDDLE
s = mid(x.name, 2, 2) 'take L off the lamp's name
i = cInt(s) 'convert string to integer to get the lampnumber
x.intensityscale = (GIi + 1) / 2 'half scaling for middle inserts
x.fadespeedup = insertfading(i, 1) * x.intensityscale
x.fadespeeddown = insertfading(i, 2) * x.intensityscale
Next
case 2 'bottom
GIscale(120) = GIi
GIscale(125) = GIi
' nModLight 20, F20
' nModLight 25, F25
for each x in LampsBOTTOM
s = mid(x.name, 2, 2) 'take L off the lamp's name
i = cInt(s) 'convert string to integer to get the lampnumber
x.intensityscale = GIi
x.fadespeedup = insertfading(i, 1) * x.intensityscale
x.fadespeeddown = insertfading(i, 2) * x.intensityscale
Next
for each x in LampsMIDDLE
s = mid(x.name, 2, 2) 'take L off the lamp's name
i = cInt(s) 'convert string to integer to get the lampnumber
x.intensityscale = (GIi + 1) / 2 'half scaling for middle inserts
x.fadespeedup = insertfading(i, 1) * x.intensityscale
x.fadespeeddown = insertfading(i, 2) * x.intensityscale
Next
End Select
End Sub
dim GiElements
GiElements = Array(GI_AmbientTop, GI_PlasticsTop, GI_AmbientBottom, GI_PlasticsBottom, Gi_Flasher, Gi_PlasticsBottomLvl2, _
GI_Gorilla, GIflare1, GIflare2, Giflare3, Giflare4, giflare5)
dim insertfading(150, 2): 'columns : 0 = name 1 = fadeup 2 = fadedown
'dim FlashersFading(10, 1) '0 = fadeup 1 = fadedown
'for x = 0 to ubound(insertfading)
' insertfading(x, 0) = 0
' insertfading(x, 1) = 0
'next
initlampsforfading
Sub initlampsforfading
dim x, s, i, a(1)
i = 0
for each x in Linserts 'setup array
s = mid(x.name, 2, 2) 'take L off the lamp
i = cInt(s) 'convert string to integer to get the lampnumber
insertfading(i, 0) = i
insertfading(i, 1) = x.fadespeedup
insertfading(i, 2) = x.fadespeeddown
next
for x = 0 to UBOUND(insertfading)
if insertfading(x, 0) <> 0 then
exit for
end If
next
'Gi InitAddSnd
for each x in GiElements
' x.visible = 0
x.Uservalue = x.opacity
Next
' textbox1.text = insertfading(58, 2)
' textbox1.text = F4L.UserValue' & vbnewline & F4L.UserValue(1)
end sub
'x = intensityscale y = gistep
'x1= 2.5 y1= 0.5
'x2= 1 y2= 1
'solve for slope
''m = (y2 - y1) / (x2 - x1)
' (1 - 0.5) / (1 - 2.5)
'm = -1/3
'point slope formula
'y - y1 = m(x-x1)
'y - 0.5 = (-1/3)(x-2.5)
Sub GorillaGI
If Giswitch = 1 then
Giswitch = 0
Gion 1
Else
Giswitch = 1
Gion 0
End If
End Sub
Sub GIon(i)
For each xx in GIGorilla:xx.State = i: Next
end sub
'**********
' Keys
'**********
dim LeftFlipperOn, RightFlipperOn
Sub table1_KeyDown(ByVal Keycode)
If keycode = LeftTiltKey Then vpmNudge.donudge 90, 3.5:PlaySound "fx_nudge", 0, 1, -0.1, 0.25 : exit sub
If keycode = RightTiltKey Then vpmNudge.donudge 270, 3.5:PlaySound "fx_nudge", 0, 1, 0.1, 0.25 : exit sub
If keycode = CenterTiltKey Then vpmNudge.doNudge 0, 4:PlaySound "fx_nudge", 0, 1, 0, 0.25 : exit sub
If keycode = PlungerKey Then PlaySoundAt SoundFX("plunger3",0), ActiveBall:Plunger.Pullback:end if
' If keycode = LeftFlipperKey Then
' SolLFlipper 1
' SolULFlipper 1
'' GorillaRight 1
'' GorillaLeft 0
'' flipnf 0, 1
'' if FlippersEnabled then LeftFlipperOn = 1 else LeftFlipperOn = 0 'testing
' end if
' If keycode = RightFlipperKey Then
' SolRFlipper 1
'' GorillaLeft 1
'' GorillaRight 0
'' flipnf 1, 1
'' if FlippersEnabled then RightFlipperOn = 1 else RightFlipperOn = 0 'testing
' end if
' if keycode = 28 then updateLT
' if keycode = 200 then LTcontUpDown 1
' if keycode = 208 then LTcontUpDown 0
'
' if keycode = 203 then LtcontLeftRight -1
' if keycode = 205 then LtcontLeftRight 1
' if keycode = 200 then FlasherDMD1.y = Flasherdmd1.y + 10
' if keycode = 208 then FlasherDMD1.y = Flasherdmd1.y - 10
' if keycode = 203 then FlasherDMD1.x = Flasherdmd1.x - 10
' if keycode = 205 then FlasherDMD1.x = Flasherdmd1.x + 10
' if keycode = 38 then FlasherDMD1.height = Flasherdmd1.height - 10 'L
' if keycode = 37 then FlasherDMD1.height = Flasherdmd1.height + 10 'K
' if keycode = 38 then FlasherDMD.ROTY = Flasherdmd.ROTY - 2.5 'L
' if keycode = 37 then FlasherDMD.ROTY = Flasherdmd.ROTY + 2.5 'K
''
' if keycode = 200 then t1.interval = t1.interval - 10 : tb1.text = "interval: " & t1.interval
' if keycode = 208 then t1.interval = t1.interval + 10 : tb1.text = "interval: " & t1.interval
' If keycode=33 then ' test Right Kicker debug
''' initlampsforfading
''' textbox1.text = insertfading(55, 0)
'' TestUpperFlipper
''' Kicker1.createball
''' kicker1.kick 22, 1
''' bip = bip + 1
''' vpmTimer.PulseSw 71
''' vpmtimer.pulsesw 11 'Grey test
''' If keycode=32 then ' test Left Kicker
''' Kicker2.createball
''' kicker2.kick d1,d2
''' End If
' LeftRampDrop1.createball
' LeftRampDrop1.kick 0, 0
' End If
' If keycode=33 then ' test Right Kicker debug
'' initlampsforfading
'' textbox1.text = insertfading(55, 0)
'' Kickerz.createball
'' kickerz.kick 180, 10
'' bip = bip + 1
'' vpmTimer.PulseSw 71
' vpmtimer.pulsesw 11 'Grey test
'' If keycode=32 then ' test Left Kicker
'' Kicker2.createball
'' kicker2.kick 1,1
'' End If
' End If
If vpmKeyDown(keycode) Then Exit Sub
End Sub
dim d1, d2
d1 = 15 : d2 = 20
Sub table1_KeyUp(ByVal Keycode)
If keycode = PlungerKey Then
Plunger.Fire
if BallInPlunger then
PlaySoundAt SoundFX("plunger3",0),Plunger
Else
PlaySoundAt SoundFX("plunger",0),Plunger
end if
End If
' If keycode = LeftFlipperKey Then
' SolLFlipper 0
' SolULFlipper 0
'' flipnf 0, 0
'' LeftFlipperOn = 0
'
'' GorillaRight 0
' end if
' If keycode = RightFlipperKey Then
' SolRFlipper 0
'' flipnf 1, 0
'' RightFlipperOn = 0
'
'' GorillaLeft 0
' end if
If vpmKeyUp(keycode) Then Exit Sub
End Sub
'*********
' Switches
'*********
'sub drain_hit:drain.destroyball:end sub 'debug, infinite balls
sub destroyer_hit
bip = bip - 1
if bip < 0 then bip = 0
me.destroyball
end sub
' Slings & div switches
Dim Lstep, Rstep
Sub LeftSlingShot_Slingshot
vpmTimer.PulseSw 61
PlaySoundAt SoundFX("LeftSlingshot",DOFContactors), sling2
LSling.Visible = 0
LSling1.Visible = 1
sling2.TransZ = -28
LStep = 0
LeftSlingShot.TimerEnabled = 1
End Sub
Sub LeftSlingShot_Timer
Select Case LStep
Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -16
Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.TransZ = 0:LeftSlingShot.TimerEnabled = 0
End Select
LStep = LStep + 1
End Sub
Sub RightSlingShot_Slingshot
vpmTimer.PulseSw 62
PlaySoundAt SoundFX("RightSlingshot",DOFContactors), sling1
RSling.Visible = 0
RSling1.Visible = 1
sling1.TransZ = -28
RStep = 0
RightSlingShot.TimerEnabled = 1
End Sub
Sub RightSlingShot_Timer
Select Case RStep
Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -17
Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.TransZ = 0:RightSlingShot.TimerEnabled = 0
End Select
RStep = RStep + 1
End Sub
' Bumpers
Sub Bumper1_Hit:vpmTimer.PulseSw 63:PlaySoundAt SoundFX("rightbumper_hit",DOFContactors), ActiveBall:End Sub 'clark
Sub Bumper2_Hit:vpmTimer.PulseSw 64:PlaySoundAt SoundFX("topbumper_hit",DOFContactors), ActiveBall:End Sub
Sub Bumper3_Hit:vpmTimer.PulseSw 65:PlaySoundAt SoundFX("leftbumper_hit",DOFContactors), ActiveBall:End Sub
' Right Eject Rubber
Sub sw25_Hit:vpmTimer.PulseSw 25:End Sub 'Right Eject Rubber
'Shooter Lane
Sub sw18_Hit:Controller.Switch(18) = 1:End Sub
Sub sw18_UnHit:Controller.Switch(18) = 0:End Sub
dim BallInPlunger :BallInPlunger = False
sub PlungerLane_hit():ballinplunger = True: End Sub
Sub PlungerLane_unhit():BallInPlunger = False: End Sub
'sub gate5_hit():stopsound "plunger3": end sub
'Inlane/Outlanes
Sub sw16_Hit:Controller.Switch(16) = 1:End Sub 'Kickback
Sub sw16_UnHit:Controller.Switch(16) = 0:End Sub'kickback
Sub sw26_Hit:Controller.Switch(26) = 1:End Sub
Sub sw26_UnHit:Controller.Switch(26) = 0:End Sub
Sub sw17_Hit:Controller.Switch(17) = 1:End Sub
Sub sw17_UnHit:Controller.Switch(17) = 0:End Sub
Sub sw27_Hit:Controller.Switch(27) = 1:End Sub
Sub sw27_UnHit:Controller.Switch(27) = 0:End Sub
'Playfield Switches & Rollovers
Sub sw15_Hit:Controller.Switch(15) = 1:End Sub
Sub sw15_UnHit:Controller.Switch(15) = 0:End Sub
Sub sw45_Hit:Controller.Switch(45) = 1:End Sub
Sub sw45_UnHit:Controller.Switch(45) = 0:End Sub
Sub sw11_Hit:Controller.Switch(11) = 1:End Sub
Sub sw11_UnHit:Controller.Switch(11) = 0:End Sub
Sub sw44_Hit:Controller.Switch(44) = 1:End Sub
Sub sw44_UnHit:Controller.Switch(44) = 0:End Sub
Sub sw12_Hit:Controller.Switch(12) = 1:End Sub
'Volcano Switch
Sub sw12_UnHit:Controller.Switch(12) = 0:End Sub
'Additional diverter Sub
Sub VolcanoTop_Hit()
bip = bip + 1
End Sub
Sub sw71_Hit:Controller.Switch(71) = 1:End Sub 'AMY Rollovers
Sub sw71_UnHit:Controller.Switch(71) = 0:End Sub
Sub sw72_Hit:Controller.Switch(72) = 1:End Sub
Sub sw72_UnHit:Controller.Switch(72) = 0:End Sub
Sub sw73_Hit:Controller.Switch(73) = 1:End Sub
Sub sw73_UnHit:Controller.Switch(73) = 0:End Sub
'Targets
Sub sw46_Hit:vpmTimer.PulseSw 46:End Sub
Sub sw47_Hit:vpmTimer.PulseSw 47:End Sub
Sub sw48_Hit:vpmTimer.PulseSw 48:End Sub
Sub sw56_Hit:vpmTimer.PulseSw 56:End Sub 'Laser Perimeter
Sub sw51_Hit:vpmTimer.PulseSw 51:End Sub
Sub sw52_Hit:vpmTimer.PulseSw 52:End Sub
Sub sw54_Hit:vpmTimer.PulseSw 54:End Sub 'We Are
Sub sw55_Hit:vpmTimer.PulseSw 55:End Sub 'Watching
Sub sw28_Hit:vpmTimer.PulseSw 28:End Sub 'You
Sub sw74_Hit:vpmTimer.PulseSw 74:End Sub
Sub sw75_Hit:vpmTimer.PulseSw 75:End Sub
Sub sw76_Hit:vpmTimer.PulseSw 76:End Sub
Sub sw77_Hit:vpmTimer.PulseSw 77:End Sub
Sub sw78_Hit:vpmTimer.PulseSw 78:End Sub
'Ramp Switches
Sub sw57_Hit:Controller.Switch(57) = 1:End Sub
Sub sw57_UnHit:Controller.Switch(57) = 0:End Sub
Sub sw58_Hit:Controller.Switch(58) = 1:End Sub
Sub sw58_UnHit:Controller.Switch(58) = 0:End Sub
Sub sw67_Hit:Controller.Switch(67) = 1:End Sub
Sub sw67_UnHit:Controller.Switch(67) = 0:End Sub
Sub sw68_Hit:Controller.Switch(68) = 1:End Sub
Sub sw68_UnHit:Controller.Switch(68) = 0:End Sub
'***************************
' Solenoids & Flashers
'some soleoid subs are from
'Aurian/Guitar/Jive's table
'***************************
SolCallBack(1) = "Auto_Plunger"
SolCallBack(2) = "Kick_back"
SolCallBack(3) = "SolPopUp"
SolCallBack(4) = "SolPopDown"
'Pop up
Sub SolPopUp(Enabled)
if bsAmyVuk.hasball then bip = bip + 1
If Enabled Then
if bsamyVuk.hasball then
bsAmyVuk.SolOutAlt 0
bsAmyVuk.ExitSol_On
playsoundAt SoundFX("fx_kicker2",DOFContactors), KickerUFTEST
Else
playsoundAt SoundFX("fx_solenoidOn",DOFContactors), KickerUFTEST
end If
Else
' bsAmyVuk.SolOutAlt 1 'Down
playsoundAt SoundFX("fx_solenoidOff",0), KickerUFTEST
End If
End Sub
' .InitSounds "scoop_enter", "fx_Solenoidon", SoundFX("fx_kicker2",DOFContactors)
' (Public) .solOut - Fire the primary exit kicker. Ejects ball if one is present.
' (Public) .solOutAlt - Fire the secondary exit kicker. Ejects ball with alternate forces if present.
'Pop down
Sub SolPopDown(Enabled)
if bsAmyVuk.hasball then bip = bip + 1
If Enabled Then
if bsamyVuk.hasball then
bsAmyVuk.SolOutAlt 1'down
bsAmyVuk.ExitSol_On
playsoundAt SoundFX("fx_kicker2",DOFContactors), KickerUFTEST
Else
playsoundAt SoundFX("fx_solenoidOn",DOFContactors), KickerUFTEST
end If
Else
playsoundAt SoundFX("fx_solenoidOff",0), KickerUFTEST
End If
End Sub
'sw53 (2 way popper)
sub sw53_hit:controller.Switch(53) = 1:bsAmyVuk.addball me:bip = bip - 1:PlaySoundAt "kicker_hit", ActiveBall:End Sub 'clark
'SolCallBack(5) = "vpmSolDiverter Diverter,true,"
SolCallback(5) = "RampDiverter"
'SolCallBack(6) = "bsVolcano.SolOut"
SolCallBack(6) = "VolcanoKickOut"
Sub VolcanoKickOut(enabled)
If Enabled Then
if bsVolcano.balls then
bsVolcano.ExitSol_On
playsoundat SoundFX("kicker_release",DOFcontactors), KickerUFTEST2
Else
playsoundat SoundFX("fx_solenoidOnVar",DOFContactors), KickerUFTEST2
end if
Else
playsoundat SoundFX("fx_solenoidOffVar",0), KickerUFTEST2
end if
End Sub
Sub Sw36_Hit:vpmTimer.PulseSw(36):bsVolcano.AddBall me:bip = bip - 1:PlaySoundAt "Scoop_Enter2", ActiveBall:End Sub 'Clark
SolCallBack(7) = "vpmSolSound SoundFX(""Knocker"",DOFKnocker),"
SolCallBack(8) = "SolTopPost"
'SolCallBack(9) = "bsTrough.SolOut"
SolCallBack(9) = "SolRelease"
Sub SolRelease(Enabled) 'ball tracking
If Enabled Then
if bsTrough.Balls > 0 then
Playsoundat SoundFX("BallRelease",DOFcontactors), BallRelease 'ClarkKent
vpmTimer.PulseSw 31
bsTrough.ExitSol_On
bip = bip + 1
Else
playsoundat SoundFX("fx_solenoidOnVar",DOFContactors), BallRelease
end if
Else
playsoundat SoundFX("fx_solenoidOffVar",0), BallRelease
End If
End Sub
' Drain hole
Sub Drain_Hit
playsoundAt "fx_drain", Drain
bsTrough.AddBall Me
bip = bip - 1
if bip < 0 then bip = 0
End Sub
'SolCallBack(10) ' Left SLingshot
'SolCallBack(11) ' Right Slingshot
'SolCallBack(12) ' Left bumper
'SolCallBack(13) ' Right bumper
'SolCallBack(14) ' Bottom bumper
SolCallBack(15) = "GorillaRight"
SolCallBack(16) = "GorillaLeft"
'SolCallBack(17) = "SetLamp 117," 'Amy Flasher
'SolCallBack(18) = "SetLamp 118," 'Left Ramp Flasher
'SolCallBack(19) = "SetLamp 119," '2-Way Popper Flasher
'SolCallBack(20) = "SetLamp 120," 'SkillShot Flasher
'SolCallBack(21) = "SetLamp 121," 'Gray Gorilla Flasher
'SolCallback(22) = "bsMap.SolOut"
SolCallback(22) = "MapKick"
Sub MapKick(enabled)
if bsMap.hasball then bip = bip + 1
If Enabled Then
if bsMap.hasball then
playsoundat SoundFX("fx_kicker2",DOFContactors), sw38
bsmap.ExitSol_On
Else
playsoundat SoundFX("fx_solenoidOn",DOFContactors), sw38
end If
Else
playsoundat SoundFX("fx_solenoidOff",0), sw38
End If
end sub
Sub Sw38_Hit:controller.Switch(38) = 1:bsMap.addball me:bip = bip - 1:PlaySoundAt "kicker_hit", ActiveBall:End Sub 'clark
SolCallBack(23) = "LeftGateOn"
SolCallBack(24) = "RightGateOn"
'SolCallBack(23) = "vpmSolGate Gate4,true,"
'SolCallBack(24) = "vpmSolGate Gate2,true," 'dese are reversed
'SolCallBack(25) = "SetLamp 125," 'Lower Right Flasher
'SolCallBack(26) = "SetLamp 126," 'Right Ramp Flasher
'SolCallBack(27) = "SetLamp 127," 'Volcano Flasher
'SolCallBack(28) = "SetLamp 128," 'Perimeter Defense Flasher
SolCallBack(33) = "SolLeftPost"
'SolCallback(34) = "bsMystery.SolOut"
SolCallback(34) = "MysteryKick"
Sub MysteryKick(enabled)
if bsMystery.hasball then bip = bip + 1 end if
If Enabled Then
if bsMystery.hasball then
playsoundat SoundFX("fx_kicker2",DOFContactors), sw37
bsmystery.ExitSol_On
Else
playsoundat SoundFX("fx_solenoidOn",DOFContactors), sw37
end If
Else
playsoundat SoundFX("fx_solenoidOff",0), sw37
End If
end sub
Sub Sw37_Hit:controller.Switch(37) = 1:bsMystery.addball me:bip = bip - 1:PlaySoundAt "kicker_hit", ActiveBall:End Sub 'clark
'
DiverterSwoop.isdropped = 1
Sub RampDiverter(enabled)
if Enabled Then
playsoundat SoundFX("fx_solenoidon",DOFcontactors), Rubber_Ob15
Diverter.rotatetoend
DiverterSwoop.isdropped = 0
else
playsoundat SoundFX("fx_solenoidoff",DOFcontactors), Rubber_Ob15
Diverter.rotatetostart
DiverterSwoop.isdropped = 1
End If
End Sub
SolModCallback(17) = "SetModLamp 117," 'Amy Flasher
SolModCallback(18) = "SetModLampm 118, 138," 'Left Ramp Flasher
SolModCallback(19) = "SetModLampm 119, 129," '2-Way Popper Flasher
SolModCallback(20) = "SetModLampm 120, 130," 'SkillShot Flasher
SolModCallback(21) = "SetModLamp 121," 'Gray Gorilla Flasher
SolModCallback(25) = "SetModLampm 125, 135," 'Lower Right Flasher
SolModCallback(26) = "SetModLampm 126, 136," 'Right Ramp Flasher
SolModCallback(27) = "SetModLampM 127, 137," 'Volcano Flasher
'SolModCallback(28) = "SetModLampm 128, 129," 'Perimeter Defense Flasher
SolModCallback(28) = "Sol28" 'Perimeter Defense Flasher 'old style
'Lampstate = 1 or 0, on or off
'flashlevel = fading step
'SolModValue = input 0-255
'flashmax, FlashMin
dim SolModValue(200)
dim LightFallOff(200, 4) '2d array to hold alt falloff values in different columns
dim FlashersOpacity(200)
dim FlashersFalloff(200) '??? (could use multiply? or some other kind of mixing?...)
dim GIscale(200)
Sub SetModLamp(nr, value)
If value <> SolModValue(nr) Then
SolModValue(nr) = value
if value > 0 then LampState(nr) = 1 else LampState(nr) = 0
' LampState(nr) = abs(cbool(SolModValue) )
FadingLevel(nr) = LampState(nr) + 4