-
Notifications
You must be signed in to change notification settings - Fork 31
/
Congo (Williams 1995)_VPW_V1.0.vbs
executable file
·4381 lines (3691 loc) · 153 KB
/
Congo (Williams 1995)_VPW_V1.0.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
'############################################################################################
'############################################################################################
'####### ########
'####### Congo ########
'####### (Williams 1988) ########
'####### ########
'############################################################################################
'############################################################################################
'VPW Table Tuneup Mod v1.0
'Based on nFozzys VPX version with some assets from Dark and LoadedWeapon, which was based on JPSalas VP9 version.
'
''** VPW Mod V1.0 - CHANGE LOG **
'*****************************************
' VPin Workshop Revisions
'*****************************************
'Started from Skitso mod
'004 - Rastan350 - new physics and sounds
'005 - Skitso - reworked all GI and flashers, improved insert lighting, new LUT
'006 - iaakki - debugged some flip physics issues and now live catch and nudge works, flip angles changed, removed some lights, flip physics parameters updated
'007 - Skitso - temporary fix for broken flashers. Replaced SHOOT AGAIN and KICKBACK insert textures to a more visually pleasing ones.
'008 - iaakki - merged flashers. Solflash17 created for "modulated" Amy flasher
'009 - Skitso - fixed flashers, fixed ball shadow depth bias issue, added one missing GI light under left ramp, made upper lane guide lamps to show through AMY's hand, new volcano ramp textures, improved Grey playfield texture and shadows, new dark texture for yellow hit targets on Grey playfield, added tiny bit of DL to Grey when GI is lit, fixed right sligshot plastics material and repositioned light beneath
'010 - Skitso - improved rule card texture, backwall texture and left ramp decal. Added backfacing transparent triangles rendering to ramps, improved bumber lighting.
'011 - iaakki - ball drop sounds fixed. It is still bugged occasionally but not sure why..
'012 - Skitso - better upper PF laneguide prim, improved lights for upper lane guides, tweaked flashers.
'015 - iaakki - fixed ramp exits so that ball drop sounds can work properly
'016 - Sixtoe - Re-organised whole table, added VR room and assets, replaced rails and sideblades (switchable for art ones, which I redid a bit), raised some lights and dropped others (to stop it cutting prims in half), fixed z fighting for several walls, removed numerous unused assets, redid sling rubbers and area (including physics objects), cut holes in playfield and made drop holes, turned off backfacing rendering for ramps as it breaks VR, will try and find a workaround, raised DL meanwhile, removed redundant drop code, removed wall that stopped ball dropping off wire ramp, probably some other stuff I forgot
'017 - Benji - New ramps based on flupper's new tutorial
'018 - Flupper - New ramp models, new ramp textures. "plsatic_ramps" texture in image manager is better for VR
'019 - tomate - LowPoly left ramp added.
'020 - tomate - flipperTimer added, flippers prims and shadows, slightly corrected left flipper location, New wireRamps prims, plastic ramps slightly modified to fit wire ramps, DC-3 model added
'021 - tomate - WireRamps textures added, split wire ramps (up and down), down wireRamp reflection disabled, plastic plane recovered from previous version
'022 - iaakki - Gorilla flips physics change, LUT changer added with failsafe improvements, Cabinet mode improved, RampLook option added
'023 - Sixtoe - Complete fixtures and fittings pass, changed most things, tons of small tweaks and adjustments to positions of things, drilled a hole in the plastic ramp, added seperate VR graphics setup for ramps and wire runs, unified timers, probably something else I forgot.
'024 - Sixtoe - Tinkered with the metals and lighting to get the fixings more natural and suited to table.
'026 - tomate - new 3d apron and apron texture added, apron rails and POV fixed
'027 - Sixtoe - Added playfield mesh from Bord, more tinkering and adjusting including apron area for VR and finally punting it out the door
'RC2 - Skitso - Fixed playfield mesh location, made ball shinier, altered few materials, made apron a tad more in shadow.
'RC3 - iaakki - Fixed GI control, added TargetBouncerEnabled and RubberizerEnabled script options to make table feel more real
'RC4 - Skitso - Improved GI, small insert tweaks
'RC4.1 - Skitso - Grouped a few missing GI lights
'RC4.2 - tomate - post-draw textures added, new primitives and textures for VUK exits added
'RC5 - Sixtoe - Sling kickers adjusted, changed back wall layout, adjusted vuk prims and added material, fixed leftrampdrop height and visibility, tweaked metal pole on left orbit, changed env image, altered materials and textures for metals and volcano, cropped new GI lamps.
'RC6 - iaakki - FlipperNudge tuned. Sw55 target had incorrect phys parameters. gi_bulb022/23 adjust
'RC7 - Skitso - tuned satellite inserts and made all purple inserts more natural color, tuned Gi_Bulb014, tuned perimeter defence flasher
'RC8 - iaakki - l82f fixed. ramp tied to gi. RubberBand material adjusted, ramp41 decal adjusted
'RC9 - Sixtoe - Fixed VR script, altered desktop backdrop
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-----///////////////////////
'///////////////////////-----VR Room-----///////////////////////
Const VRRoom = 0 '0 - VR Room off, 1 - 360 Room, 2 - Minimal Room, 3 - Ultra Minimal
'/////////////////////-----Cabinet Mode-----/////////////////////
Const CabinetMode = 0 '0 - Off, 1 - Hides rails & scales side panels, 2 - Hides rails and side panels
'///////////////////-----Plastic Ramp Look-----//////////////////
Const RampLook = 0 '0 - Default (For Desktop and VR), 1 - Flupper version for cabinet mode
'////////////////-----Cabinet Art Side Panels-----///////////////
Const ArtSides = 0 '0 - Off (black wood), 1 - Mountain sides
'///////////////////////-----Inlane Type-----////////////////////
InlaneType 0 '0 = smooth feed to the left flipper, 1 = old sticky inlane
'///////////////////////-----Target Bouncer-----////////////////////
Const TargetBouncerEnabled = 1 '0 = normal standup targets, 1 = bouncy targets
'///////////////////////-----Rubberizer-----////////////////////
const RubberizerEnabled = 1 '0 = normal flip rubber, 1 = more lively rubber for flips
'const HardFlips = 1 'more rigid flippers
const SingleScreenFS = 0 'Single Screen FS support
''ramps texture brightness
'Prim_Ramp1.blenddisablelighting = .035
'Prim_Ramp2.blenddisablelighting = .015
'Prim_Ramp3.blenddisablelighting = .045
'Prim_Ramp1.blenddisablelighting = .135
'Prim_Ramp2.blenddisablelighting = .115
'Prim_Ramp3.blenddisablelighting = .145
'Prim_Ramp1.blenddisablelighting = .7
'Prim_Ramp2.blenddisablelighting = .7
'Prim_Ramp3.blenddisablelighting = 2
'------------
Dim luts, lutpos
luts = array("ColorGradeLUT256x16_1to1", "ColorGradeLUT256x16_ConSat", "lut_colorful2_contrastup", "lut_fs56_darker2", "lut_inverse", "LUT1_1" )
LoadLUT
Table1.ColorGradeImage = luts(lutpos)
Dim DesktopMode: DesktopMode = Table1.ShowDT
Dim UseVPMDMD
If VRRoom <> 0 Then UseVPMDMD = True Else UseVPMDMD = DesktopMode
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
'///////////////////////-----General Sound Options-----///////////////////////
'// VolumeDial:
'// VolumeDial is the actual global volume multiplier for the mechanical sounds.
'// Values smaller than 1 will decrease mechanical sounds volume.
'// Recommended values should be no greater than 1.
Const VolumeDial = 0.8
Const VolumeDialRamps = 0.5
'********************
'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
GI28.visible = 1
GI29.visible = 1
Gi30.visible = 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_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
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
' debug.print "UpdateGIOn: " & no
' 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
' Else
'' For Each xx in GiBottom:xx.state = 0: Next
'' SetLamp 192, 0
'' UpdateLightScaling 0, 2
' setmodlamp 2, 0
'' FadingLevel(2) = 4
'
' 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)
'debug.print "UpdateGI: " & no &" step: "& 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 = step / 8
'gistepm = ScaleGI(step, 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
'debug.print "UpdateGI 0: "& gistepm
setmodlampf 0, gistepm
Case 1
'UpdateLightScaling 1, 1
For each ii in GiTop
ii.IntensityScale = gistepm
' back.Image="backwall"&step
Next
Gi_flasher.Opacity = Gi_flasher.UserValue * gistepm 'spotlight
GIflare1.opacity = GIflare1.uservalue * gistepm
GIflare2.opacity = GIflare2.uservalue * gistepm
'debug.print "UpdateGI 1: "& gistepm
setmodlampf 1, gistepm
Case 2
'UpdateLightScaling 1, 2
For each ii in GiBottom
ii.IntensityScale = gistepm
Next
Prim_Ramp3.blenddisablelighting = 1.1 * gistepm + 0.9
'0.8 - 2
' 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
'debug.print "UpdateGI 2: "& 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
Sub FadeDisableLightingM(nr, a, alvl)
Select Case FadingLevel(nr)
Case 4
a.UserValue = a.UserValue - 0.335
If a.UserValue < 0 Then
a.UserValue = 0
end If
a.BlendDisableLighting = alvl * a.UserValue 'brightness
Case 5
a.UserValue = a.UserValue + 0.335
If a.UserValue > 1 Then
a.UserValue = 1
end If
a.BlendDisableLighting = alvl * a.UserValue 'brightness
End Select
End Sub
dim GiElements
GiElements = Array(Gi_Flasher, 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 = LeftMagnaSave then
lutpos = lutpos - 1 : If lutpos < 0 Then lutpos = 0 : end if
Table1.ColorGradeImage = luts(lutpos)
End if
If keycode = RightMagnaSave then
lutpos = lutpos + 1 : If lutpos > 5 Then lutpos = 5: end if
Table1.ColorGradeImage = luts(lutpos)
End if
If keycode = LeftTiltKey Then Nudge 90, 5:SoundNudgeLeft()
If keycode = RightTiltKey Then Nudge 270, 5:SoundNudgeRight()
If keycode = CenterTiltKey Then Nudge 0, 3:SoundNudgeCenter()
If KeyCode = PlungerKey Then Plunger.Pullback:SoundPlungerPull()
'If keycode = PlungerKey Then PlaySoundAt SoundFX("plunger3",0), ActiveBall:Plunger.Pullback:end if
If keycode = LeftFlipperKey Then FlipperActivate LeftFlipper,LFPress
If keycode = RightFlipperKey Then FlipperActivate RightFlipper, RFPress
If keycode = keyInsertCoin1 or keycode = keyInsertCoin2 or keycode = keyInsertCoin3 or keycode = keyInsertCoin4 Then
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 keycode=StartGameKey then soundStartButton()
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
SoundPlungerReleaseBall() 'Plunger release sound when there is a ball in shooter lane
Else
SoundPlungerReleaseNoBall() 'Plunger release sound when there is no ball in shooter lane
End If
End If
If keycode = LeftFlipperKey Then FlipperDeActivate LeftFlipper, LFPress
If keycode = RightFlipperKey Then FlipperDeActivate RightFlipper, RFPress
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
RandomSoundSlingshotLeft sling2
LSling.Visible = 0
LSling1.Visible = 1
sling2.TransZ = -25
LStep = 0
LeftSlingShot.TimerEnabled = 1
End Sub
Sub LeftSlingShot_Timer
Select Case LStep
Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -15
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
RandomSoundSlingshotRight sling1
RSling.Visible = 0
RSling1.Visible = 1
sling1.TransZ = -25
RStep = 0
RightSlingShot.TimerEnabled = 1
End Sub
Sub RightSlingShot_Timer
Select Case RStep
Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -15
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
RandomSoundBumperTop Bumper1
End Sub 'clark
Sub Bumper2_Hit
vpmTimer.PulseSw 64
'PlaySoundAt SoundFX("topbumper_hit",DOFContactors), ActiveBall
RandomSoundBumperMiddle Bumper2
End Sub
Sub Bumper3_Hit
vpmTimer.PulseSw 65
'PlaySoundAt SoundFX("leftbumper_hit",DOFContactors), ActiveBall
RandomSoundBumperBottom Bumper3
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:TargetBouncer(activeball):End Sub
Sub sw47_Hit:vpmTimer.PulseSw 47:TargetBouncer(activeball):End Sub
Sub sw48_Hit:vpmTimer.PulseSw 48:TargetBouncer(activeball):End Sub
Sub sw56_Hit:vpmTimer.PulseSw 56:TargetBouncer(activeball):End Sub 'Laser Perimeter
Sub sw51_Hit:vpmTimer.PulseSw 51:TargetBouncer(activeball):End Sub
Sub sw52_Hit:vpmTimer.PulseSw 52:TargetBouncer(activeball):End Sub
Sub sw54_Hit:vpmTimer.PulseSw 54:TargetBouncer(activeball):End Sub 'We Are
Sub sw55_Hit:vpmTimer.PulseSw 55:TargetBouncer(activeball):End Sub 'Watching
Sub sw28_Hit:vpmTimer.PulseSw 28:TargetBouncer(activeball):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
Dim zMultiplier
'iaakki - TargetBouncer for standup targets
sub TargetBouncer(aBall)
if TargetBouncerEnabled <> 0 then
'debug.print "velz: " & activeball.velz
Select Case Int(Rnd * 4) + 1
Case 1: zMultiplier = 1.55
Case 2: zMultiplier = 1.2
Case 3: zMultiplier = 2
Case 4: zMultiplier = 1
End Select
aBall.velz = aBall.velz * zMultiplier
'debug.print "----> velz: " & activeball.velz
end if
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"
SolCallback(5) = "RampDiverter"
SolCallBack(6) = "VolcanoKickOut"
SolCallBack(7) = "vpmSolSound SoundFX(""Knocker"",DOFKnocker),"
SolCallBack(8) = "SolTopPost"
SolCallBack(9) = "SolRelease"
SolCallBack(15) = "GorillaRight"
SolCallBack(16) = "GorillaLeft"
SolCallback(22) = "MapKick"
SolCallBack(23) = "LeftGateOn"
SolModCallback(17) = "SolFlash17" '"SetModLamp 117," 'Amy Flasher
'SolCallBack(17) = "SolFlash17_2"
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
SolCallBack(24) = "RightGateOn"
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) = "Sol28" 'Perimeter Defense Flasher 'old style
SolCallBack(33) = "SolLeftPost"
SolCallback(34) = "MysteryKick"
'********************
' Special JP Flippers
'********************
SolCallback(sLRFlipper) = "SolRFlipper"
SolCallback(sLLFlipper) = "SolLFlipper"
SolCallback(sULFlipper) = "SolULFlipper"
dim FlashLevel17, Flash17Last, Flash17Dir
Flash17Last = 0
Flash17Dir = 0
f17.IntensityScale = 0
f17b.IntensityScale = 0
sub SolFlash17(aLvl)
'debug.print "Sol17 output level: " & alvl
if alvl <> 0 then
If aLvl > Flash17Last Then
Flash17Dir = 2 'flasher goes up
FlashLevel17 = aLvl/255 * 3 'highest value in game was 81.
Else
Flash17Dir = aLvl/255*3 'flasher goes down, set new target level
end if
Else
Flash17Dir = 0 'Let flasher go off
end if
Flash17Last = alvl
Flasher17_timer
end sub
sub Flasher17_timer()
If not Flasher17.TimerEnabled Then Flasher17.TimerEnabled = True
'Flasher17.opacity = 110 * FlashLevel17^5
f17.IntensityScale = 1 * FlashLevel17^3
f17b.IntensityScale = 1 * FlashLevel17^3
amy_priv.blenddisablelighting = 0.2 * FlashLevel17^2
if Flash17Dir <> 2 then 'flasher should fade
FlashLevel17 = FlashLevel17 * 0.95 - 0.01
end If
If FlashLevel17 <= Flash17Dir Then 'flashed has turned off or flasher has reached the new level
Flasher17.TimerEnabled = False
End If
'debug.print FlashLevel17
end Sub
'nModLightm 117, f17b, 1, 25
'FadeDisableLightingM 117, amy_priv, 0.3
'nModLight 117, f17 , 0, 25, 1 'amy
'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
SoundSaucerKick 1, KickerUFTEST
'playsoundAt SoundFX("fx_kicker2",DOFContactors), KickerUFTEST
Else
SoundSaucerKick 0, KickerUFTEST
'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
SoundSaucerKick 1, KickerUFTEST
'playsoundAt SoundFX("fx_kicker2",DOFContactors), KickerUFTEST
Else
SoundSaucerKick 0, KickerUFTEST
'playsoundAt SoundFX("fx_solenoidOn",DOFContactors), KickerUFTEST
end If
Else
SoundSaucerKick 0, KickerUFTEST
'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
SoundSaucerLock