-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathDemolition Man (Knorr-Kiwi) 1.3.1.vbs
1739 lines (1387 loc) · 50.7 KB
/
Demolition Man (Knorr-Kiwi) 1.3.1.vbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
'*********************************************************************
'1994 Williams Demolition Man
'*********************************************************************
'*********************************************************************
'Pinball Machine designed by Dennis Nordman
'*********************************************************************
'*********************************************************************
'recreated for Visual Pinball by Knorr
'*********************************************************************
'*********************************************************************
'Playfield and Plastics Redraw by Kiwi
'*********************************************************************
'*********************************************************************
'I would like to give my sincere thanks to
'Mfuegemann, Freneticamnesic, Toxie and the VPdevs, Clark Kent and
'Gigalula for always being so friendly, helpful and motivating while
'building this table.
'*********************************************************************
'V1.3.1
'fix for ballsearching bug
'fix for insertmaterial
'V1.3
'reworked inserts lights and Playfield
'baked in shadows and ambient inc.
'reduced polycount
'reworked Flasher
'reworked Ramps
'fixed some bugs with the claw crane
'added nfozzy´s FastFlips
'changed and added some soundfx
'made for vpx 10.4
'V1.2
'new ramps made by flupper (thanks!!!)
'cleaned up script
'fewer timers for better performance
'small changes with the physics
'claw animation improved by shoopity (thanks for all the explaination!)
'bug fixes with pballs
'added missing sounds
'new enviroment, new lightning
'V1.1
'Added controller.vbs
'Bug Fixes
Option Explicit
Randomize
' Thalamus 2018-11-01 : Improved directional sounds
' !! NOTE : Table not verified yet !!
' Has it's own fast flip routine - consider disabling it and using the new from core.vbs ??
' 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 )
' The rest of the values are multipliers
'
' .5 = lower volume
' 1.5 = higher volume
Const VolBump = 2 ' Bumpers volume.
Const VolGates = 1 ' Gates volume.
Const VolMetal = 1 ' Metals volume.
Const VolRH = 1 ' Rubber hits volume.
Const VolPo = 1 ' Rubber posts volume.
Const VolPi = 1 ' Rubber pins volume.
Const VolTarg = 1 ' Targets volume.
Const VolKick = 1 ' Kicker volume.
Const VolSpin = 1.5 ' Spinners volume.
Const VolFlip = 1 ' Flipper volume.
On Error Resume Next
ExecuteGlobal GetTextFile("controller.vbs")
If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
On Error Goto 0
Const UseVPMModSol = 1
LoadVPM "01560000", "WPC.VBS", 3.36
'********************
'Standard definitions
'********************
'***ROM***ROM***ROM***ROM***
Const cGameName = "dm_lx4"
'***************************
Const UseSolenoids = 1
Const UseLamps = 0
Const SSolenoidOn = "SolOn"
Const SSolenoidOff = "SolOff"
Const SFlipperOn = "FlipperUp"
Const SFlipperOff = "FlipperDown"
Const SCoin = "Coin5"
Set GiCallback2 = GetRef("UpdateGI")
' Set LampCallback = GetRef("UpdateMultipleLamps")
Set MotorCallback = GetRef("RealTimeUpdates")
BSize = 26
BMass = 1.7
Dim bsTrough, retinascan, bsTopPopper, BottomPopper, bsEject, Oldsmobileball, RedCar, GMUltraliteball, WhiteCar, clawmech, elevatormech, BallinClaw
Dim ClawSpeed:ClawSpeed = 67
Dim FastFlips
'************
' 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
.Games(cGameName).Settings.Value("rol") = 0
.HandleKeyboard = 0
.ShowTitle = 0
.ShowDMDOnly = 1
.ShowFrame = 0
.HandleMechanics = 0
.Hidden = 0
'.SetDisplayPosition 0, 0, GetPlayerHWnd 'uncomment this line if you don't see the DMD
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
PinMAMETimer.Interval = PinMAMEInterval
PinMAMETimer.Enabled = true
vpmNudge.TiltSwitch = 14
vpmNudge.Sensitivity = 2
End With
'******
'Trough
'******
Set bsTrough = New cvpmBallStack
With bsTrough
.InitSw 0, 31, 32, 33, 34, 35, 0, 0
.InitKick BallRelease, 90, 10
.InitExitSnd SoundFX("BallRelease",DOFContactors), SoundFX("fx_Solenoid",DOFContactors)
.Balls = 5
' .IsTrough = 1
End With
'***********
'Retina Scan
'***********
Set retinascan = New cvpmCaptiveBall
With retinascan
.InitCaptive RetinaTrigger, RetinaWall, RetinaKicker, 345
.ForceTrans = .9
.MinForce = 2
.CreateEvents "retinascan"
.Start
End With
'***************
'Claw & Elevator
'***************
set clawmech = new cvpmmech
with clawmech
.mtype =vpmmechtwodirsol + vpmmechstopend + vpmmechlinear
.sol1 =19
.sol2 =20
.length=Clawspeed
.steps = 147
.addsw 25,0,2
.addsw 26,140,147
.callback= getRef("UpdateClaw")
.start
end with
Set elevatormech = new cvpmMech
with elevatormech
.mtype = vpmMechOneSol + vpmMechReverse + vpmMechLinear
.Sol1 = 18
.Length = 15
.steps = 70
.addsw 67,0,2
.addsw 74,65,70
.Callback = getRef("UpdateElevator")
.Start
End with
'***********
'Top Popper
'***********
Set bsTopPopper = New cvpmBallStack
with bsTopPopper
.InitSaucer sw73, 73, 182, 18
.InitExitSnd SoundFX("EjectKick",DOFContactors), SoundFX("fx_Solenoid",DOFContactors)
.KickForceVar = 1
.KickAngleVar = 0.5
End With
'*************
'Bottom Popper
'*************
Set BottomPopper = New cvpmBallStack
With BottomPopper
.InitSw 0, 76, 0, 0, 0, 0, 0, 0
.InitKick sw76, 58, 73
.KickZ = 60
.InitExitSnd SoundFX("BottomPopper",DOFContactors), SoundFX("fx_Solenoid",DOFContactors)
End With
'*****
'Eject
'*****
Set bsEject = New cvpmBallStack
With bsEject
.InitSaucer sw66, 66, 180, 2
.InitExitSnd SoundFX("EjectKick",DOFContactors), SoundFX("fx_Solenoid",DOFContactors)
.KickForceVar = 1
.KickAngleVar = 0.5
End With
'************
'CarCapative
'************
Set RedCar = New cvpmCaptiveBall
With RedCar
.InitCaptive OldsmobileTrigger, OldsmobileWall, OldsmobileKicker, 345
.ForceTrans = .9
.MinForce = 3.5
' .RestSwitch = 71
.CreateEvents "RedCar"
.Start
End With
DiverterOn.isdropped = 1
DiverterOff.isdropped = 0
Set FastFlips = new cFastFlips
with FastFlips
.CallBackL = "SolLflipper" 'Point these to flipper subs
.CallBackR = "SolRflipper" '...
' .CallBackUL = "SolULflipper"'...(upper flippers, if needed)
' .CallBackUR = "SolURflipper"'...
.TiltObjects = True 'Calls vpmnudge.solgameon automatically
' .InitDelay "FastFlips", 100
' .DebugOn = False 'Call FastFlips.DebugOn True or False in debugger to enable/disable.
End with
vpmNudge.TiltSwitch=1
vpmNudge.Sensitivity=3
vpmNudge.Sensitivity=3
vpmNudge.TiltObj=Array(Leftjetbumper,rightjetbumper,LeftSlingshot,RightSlingshot)
BallinClaw = False
'************
'FS Setting
'************
If table1.ShowDT = False then
LeftSideRail.WidthTop = 0
LeftSideRail.WidthBottom = 0
RightSideRail.WidthTop = 0
RightSideRail.WidthBottom = 0
Korpus.Size_Y = 1.7
' Korpus.visible = False
End if
End Sub
'******
'Cars Animation
'******
'Oldsmobile
Set Oldsmobileball = CapKicker1.CreateBall
Oldsmobileball.Visible = False
CapKicker1.Kick 0,0
CapKicker1.Enabled = false
Controller.Switch(71) = 1
Sub OldsmobileTimer_Timer()
Oldsmobile.x = Oldsmobileball.x:Oldsmobile.y = Oldsmobileball.y
End Sub
'GM Ultralite
Set GMUltraliteball = CapKicker2.CreateBall
GMUltraliteball.Visible = False
CapKicker2.Kick 0,0
CapKicker2.Enabled = false
Controller.Switch(72) = 1
Sub GMUltraliteTimer_Timer()
GMUltralite.x = GMUltraliteball.x:GMUltralite.y = GMUltraliteball.y
End Sub
Sub sw72_Hit:Controller.Switch(72) = 0:End Sub 'GMUltralite Restswitch
Sub sw72_UnHit:Controller.Switch(72) = 1: End Sub
Sub sw71_Hit:Controller.Switch(71) = 0:End Sub 'Oldsmobil Restswitch
Sub sw71_UnHit:Controller.Switch(71) = 1: End Sub
'*********
'Solenoids
'*********
SolCallback(1) = "SolRelease"
SolCallback(2) = "BottomPopper.SolOut"
SolCallback(3) = "AutoPlunge"
SolCallback(4) = "bsTopPopper.SolOut"
SolCallback(15) = "DiverterRight"
SolCallback(7) = "vpmSolSound SoundFX(""Knocker"",DOFKnocker),"
SolCallBack(14) = "bsEject.SolOut"
SolCallBack(19) = "SolClawMotorLeft"
SolCallback(33) = "ClawMagnetOn"
SolCallBack(31) = "FastFlips.TiltSol"
SolModCallback(17) = "Flash117" 'ClawFlasher
SolModCallback(21) = "Flash121" 'JetsFlasher
SolModCallback(22) = "Flash122" 'SideRampFlasher
SolModCallback(23) = "Flash123" 'LeftRampUpFlasher
SolModCallback(24) = "Flash124" 'LeftRampLwrFlasher
SolModCallback(25) = "Flash125" 'CarChaseCntrFlasher
SolModCallback(26) = "Flash126" 'CarChaseLwrFlasher
SolModCallback(27) = "Flash127" 'RightRampFlasher
SolModCallback(28) = "Flash128" 'EjectFlasher
SolModCallback(51) = "Flash137" 'CarChaseUprFlasher
SolModCallback(52) = "Flash138" 'LowerReboundFlasher
SolModCallback(53) = "Flash139" 'EyeballFlasher
SolModCallback(54) = "Flash140" 'CenterRampFlasher
SolModCallback(55) = "Flash141" 'Elevator 2 Flasher
SolModCallback(56) = "Flash142" 'Elevator 1 Flasher
SolModCallback(57) = "Flash143" 'DiverterFlasher
SolModCallback(58) = "Flash144" 'Rt.RampUpFlasher
'************
' BallRelease
'************
Sub SolRelease(Enabled)
If Enabled And bsTrough.Balls > 0 Then
vpmTimer.PulseSw 36
bsTrough.ExitSol_On
End If
End Sub
'*****************************************
' Claw and Elevator Animation + Ballupdate
'*****************************************
Sub UpdateClaw(aNewPos,aSpeed,aLastPos)
ClawTimer.Enabled = 1
End Sub
Sub SolClawMotorLeft(Enabled)
If enabled then
PlaySoundAtVol SoundFX("Motor",DofGear), Claw, 20
Else
StopSound SoundFX("Motor",DofGear)
End if
End Sub
Sub ClawTimer_Timer()
If clawmech.position-107 > Claw.Roty Then
Claw.RotY = Claw.RotY + (8/ClawSpeed)
If Claw.RotY > clawmech.position-107 Then me.enabled = 0
End If
If clawmech.position-107 < Claw.Roty Then
Claw.RotY = Claw.RotY - (8/ClawSpeed)
If Claw.RotY < clawmech.position-107 Then me.enabled = 0
End If
BallP1.RotY = Claw.RotY
End Sub
Sub UpdateElevator(aNewPos,aSpeed,aLastPos)
PlaySoundAtVol SoundFX("ElevatorMotor",DOFGear), BallP, 10
Elevator.TransY = elevatormech.Position
BallP.TransY = elevatormech.Position
End Sub
Sub ElevatorKicker_Hit()
me.DestroyBall
BallP.Visible = True
ClawKicker1.Enabled = True
ClawKicker2.Enabled = True
ClawKicker3.Enabled = True
ClawKicker4.Enabled = True
ClawKicker5.Enabled = True
controller.Switch(74) = True
BallinClaw = True
End Sub
Sub ClawMagnetOn(Enabled)
If Enabled And BallinClaw = True Then
vpmTimer.AddTimer 700, "BallP.Visible = False'"
vpmTimer.AddTImer 700, "BallP1.Visible = True'"
Else
ClawOff
End if
End Sub
Sub ClawOff()
BallP1.Visible = False
If BallinClaw = True then
if Claw.RotY >= 11 Then ClawKicker5.CreateSizedBall(25.5): ClawKicker5.Kick 185, 1:BallinClaw = False
if Claw.RotY <= 10.99 And Claw.RotY >= -9.99 Then ClawKicker4.CreateSizedBall(25.5): ClawKicker4.Kick 180, 1:BallinClaw = False
if Claw.RotY <= -10 And Claw.RotY >= -28.99 Then ClawKicker3.CreateSizedBall(25.5): ClawKicker3.Kick 161, 1:BallinClaw = False
if Claw.RotY <= -29 And Claw.RotY >= -52.99 Then ClawKicker2.CreateSizedBall(25.5): ClawKicker2.Kick 143, 1:BallinClaw = False
if Claw.Roty <= -53 And Claw.RotY >= -108.99 Then ClawKicker1.CreateSizedBall(25.5): ClawKicker1.Enabled = False: ClawKicker1.Kick 0, 1:BallinClaw = False
End if
End Sub
'*****************
' EyeBallPrimitive
'*****************
Dim EyeBallM
Sub EyeballTrigger_Hit()
Set EyeballM = ActiveBall
EyeballTimer.Enabled = True
End Sub
Sub EyeBallTimer_Timer()
EyeballP.x = Eyeballm.x: EyeballP.y = EyeballM.y
If EyeBallm.VelY <= -1 Then EyeballP.Roty = EyeballP.Roty +30
If EyeBallm.VelY >= 1 Then EyeballP.Roty = EyeballP.Roty +30
' If EyeBallm.VelY = 0 Then EyeballP.Roty = EyeballP.Roty 0
End Sub
'**********
' Vuks
'**********
Dim aBall
Sub sw73_Hit()
PlaySoundAtVol "HeadquarterHit2", sw73, 1
Set aBall = ActiveBall:Me.TimerEnabled = 1
bsTopPopper.AddBall Me
End Sub
Sub sw73_Timer
Do While aBall.Z > 0
aBall.Z = aBall.Z -5
Exit Sub
Loop
Me.TimerEnabled = 0
End Sub
Sub BottomPopperHole_Hit()
RandomSoundHole
BottomPopper.AddBall Me
End Sub
Sub BottomPopperHole1_Hit()
RandomSoundHole
BottomPopper.AddBall Me
End Sub
Sub ClawRampKicker_Hit()
RandomSoundHole
vpmTimer.PulseSw 81
BottomPopper.AddBall Me
End Sub
Sub sw66_Hit()
PlaySoundAtVol "EjectKick", sw66, 1
bsEject.AddBall Me
End Sub
Sub Drain_Hit
bsTrough.AddBall Me
PlaySoundAtVol "drain", drain, 1
End Sub
'**********
' Keys
'**********
Sub table1_KeyDown(ByVal Keycode)
If KeyCode=MechanicalTilt Then
vpmTimer.PulseSw vpmNudge.TiltSwitch
Exit Sub
End if
If KeyCode = LeftFlipperKey then FastFlips.FlipL True' : FastFlips.FlipUL True
If KeyCode = RightFlipperKey then FastFlips.FlipR True' : FastFlips.FlipUR True
If keycode = PlungerKey Then Controller.Switch(11) = 1: Controller.Switch(12) = 1
' If keycode = LeftMagnaSave Or RightMagnaSave Then Controller.Switch(12) = 1
If keycode = keyFront Then Controller.Switch(23) = 1
If vpmKeyDown(keycode) Then Exit Sub
End Sub
Sub table1_KeyUp(ByVal Keycode)
If KeyCode = LeftFlipperKey then FastFlips.FlipL False' : FastFlips.FlipUL False
If KeyCode = RightFlipperKey then FastFlips.FlipR False' : FastFlips.FlipUR False
If vpmKeyUp(keycode) Then Exit Sub
If keycode = PlungerKey Then Controller.Switch(11) = 0: Controller.Switch(12) = 0
' If keycode = LeftMagnaSave Or RightMagnaSave Then Controller.Switch(12) = 0
If keycode = keyFront Then Controller.Switch(23) = 0
End Sub
'**************
' Subs
'**************
' SolCallback(sLRFlipper) = "SolRFlipper"
' SolCallback(sLLFlipper) = "SolLFlipper"
Sub SolLFlipper(Enabled)
If Enabled Then
PlaySoundAtVol SoundFX("FlipperUpLeftBoth",DOFContactors), LeftFlipper, VolFlip:LeftFlipper.RotateToEnd:LeftFlipper1.RotateToEnd
PlaySoundAtVol "FlipperUpLeftBoth", LeftFlipper1, VolFlip
Else
PlaySoundAtVol SoundFX("FlipperDown",DOFContactors), LeftFlipper, VolFlip:LeftFlipper.RotateToStart:LeftFlipper1.RotateToStart
PlaySoundAtVol "FlipperDown",LeftFlipper1, VolFlip
End If
End Sub
Sub SolRFlipper(Enabled)
If Enabled Then
PlaySoundAtVol SoundFX("FlipperUpRight",DOFContactors), RightFlipper, VolFlip:RightFlipper.RotateToEnd
Else
PlaySoundAtVol SoundFX("FlipperDown",DOFContactors), RightFlipper, VolFlip:RightFlipper.RotateToStart
End If
End Sub
'******
'Plunger
'******
Dim AP
Sub AutoPlunge(Enabled)
if enabled then
AP = True
Kicker1.Kick 1,48
PlaySoundAtVol SoundFX("Plunger",DOFContactors), Kicker1, VolKick
End if
End Sub
Sub PlungerPTimer()
if AP = True and PlungerP.TransZ < 45 then PlungerP.TransZ = PlungerP.TransZ +10
if AP = False and PlungerP.TransZ > 0 then PlungerP.TransZ = PlungerP.TransZ -10
if PlungerP.TransZ >= 45 then AP = False
End Sub
'*********
' Switches
'*********
Sub sw27_Hit:Controller.Switch(27) = 1:sw27wire.RotX = 15:PlaySoundAtVol "metalhit_thin", ActiveBall, VolMetal:End Sub 'shooterlane
Sub sw27_UnHit:Controller.Switch(27) = 0:sw27wire.RotX = 0: End Sub
Sub sw15_Hit:Controller.Switch(15) = 1:sw15wire.RotX = 15:PlaySoundAtVol "metalhit_thin", ActiveBall, VolMetal:End Sub 'left outlane
Sub sw15_UnHit:Controller.Switch(15) = 0:sw15wire.RotX = 0:End Sub
Sub sw16_Hit:Controller.Switch(16) = 1:sw16wire.RotX = 15:PlaySoundAtVol "metalhit_thin", ActiveBall, VolMetal:End Sub 'left inlane
Sub sw16_UnHit:Controller.Switch(16) = 0:sw16wire.RotX = 0:End Sub
Sub sw17_Hit:Controller.Switch(17) = 1:sw17wire.RotX = 15:PlaySoundAtVol "metalhit_thin", ActiveBall, VolMetal:End Sub 'right inlane
Sub sw17_UnHit:Controller.Switch(17) = 0:sw17wire.RotX = 0:End Sub
Sub sw18_Hit:Controller.Switch(18) = 1:sw18wire.RotX = 15:PlaySoundAtVol "metalhit_thin", ActiveBall, VolMetal:End Sub 'right outlane
Sub sw18_UnHit:Controller.Switch(18) = 0:sw18wire.RotX = 0:End Sub
Sub sw63_Hit:Controller.Switch(63) = 1:sw63wire.RotX = 15:PlaySoundAtVol "metalhit_thin", ActiveBall, VolMetal:End Sub 'leftrollover
Sub sw63_UnHit:Controller.Switch(63) = 0:sw63wire.RotX = 0:End Sub
Sub sw64_Hit:Controller.Switch(64) = 1:sw64wire.RotX = 15:PlaySoundAtVol "metalhit_thin", ActiveBall, VolMetal:End Sub 'centerrollover
Sub sw64_UnHit:Controller.Switch(64) = 0:sw64wire.RotX = 0:End Sub
Sub sw65_Hit:Controller.Switch(65) = 1:sw65wire.RotX = 15:PlaySoundAtVol "metalhit_thin", ActiveBall, VolMetal:End Sub 'rightrollover
Sub sw65_UnHit:Controller.Switch(65) = 0:sw65wire.RotX = 0:End Sub
Sub sw48_Hit:Controller.Switch(48) = 1:sw48wire.RotX = 15:PlaySoundAtVol "metalhit_thin", ActiveBall, VolMetal:End Sub 'Right freeway
Sub sw48_UnHit:Controller.Switch(48) = 0:sw48wire.RotX = 0:End Sub
Sub sw55_Hit:Controller.Switch(55) = 1:sw55wire.RotX = 15:PlaySoundAtVol "metalhit_thin", ActiveBall, VolMetal:End Sub 'leftloop
Sub sw55_UnHit:Controller.Switch(55) = 0:sw55wire.RotX = 0:End Sub
Sub sw86_Hit:Controller.Switch(86) = 1:End Sub 'upperleftflippergate
Sub sw86_UnHit:Controller.Switch(86) = 0:End Sub
Sub sw46_Hit:Controller.Switch(46) = 1:End Sub 'rightrampenter
Sub sw46_UnHit:Controller.Switch(46) = 0:End Sub
Sub sw47_Hit:Controller.Switch(47) = 1:End Sub 'rightrampexit
Sub sw47_UnHit:Controller.Switch(47) = 0:End Sub
Sub sw75_Hit:Controller.Switch(75) = 1: End Sub 'elevatorramp
Sub sw75_UnHit:Controller.Switch(75) = 0:End Sub
Sub sw53_Hit:Controller.Switch(53) = 1:End Sub 'centerramp
Sub sw53_UnHit:Controller.Switch(53) = 0:End Sub
Sub sw51_Hit:Controller.Switch(51) = 1:End Sub 'leftrampenter
Sub sw51_UnHit:Controller.Switch(51) = 0:End Sub
Sub sw52_Hit:Controller.Switch(52) = 1:End Sub 'leftrampexit
Sub sw52_UnHit:Controller.Switch(52) = 0:End Sub
Sub sw61_Hit:Controller.Switch(61) = 1:End Sub 'siderampenter
Sub sw61_UnHit:Controller.Switch(61) = 0:End Sub
Sub sw62_Hit:Controller.Switch(62) = 1:End Sub 'siderampexit
Sub sw62_UnHit:Controller.Switch(62) = 0:End Sub
Sub sw82_Hit:Controller.Switch(82) = 1:sw82wire.RotX = 75:PlaySoundAtVol "metalhit_thin", ActiveBall, VolMetal:End Sub 'Claw SuperJets
Sub sw82_UnHit:Controller.Switch(82) = 0:sw82wire.RotX = 90: End Sub
Sub sw83_Hit:Controller.Switch(83) = 1:sw83wire.RotX = 70:PlaySoundAtVol "metalhit_thin", ActiveBall, VolMetal:End Sub 'Claw PrisonBreak
Sub sw83_UnHit:Controller.Switch(83) = 0:sw83wire.RotX = 90: End Sub
Sub sw84_Hit:Controller.Switch(84) = 1:sw84wire.RotX = 75:PlaySoundAtVol "metalhit_thin", ActiveBall, VolMetal:End Sub 'Claw Freeze
Sub sw84_UnHit:Controller.Switch(84) = 0:sw84wire.RotX = 90: End Sub
Sub sw85_Hit:Controller.Switch(85) = 1:sw85wire.RotX = 75:PlaySoundAtVol "metalhit_thin", ActiveBall, VolMetal:End Sub 'Claw ACMAG
Sub sw85_UnHit:Controller.Switch(85) = 0:sw85wire.RotX = 90: End Sub
'cFastFlips by nFozzy
'Bypasses pinmame callback for faster and more responsive flippers
'Version 1.0
'Flipper / game-on Solenoid # reference (incomplete):
'Williams System 11: Sol23 or 24
'Gottlieb System 3: Sol32
'Data East (pre-whitestar): Sol23 or 24
'WPC 90', 92', WPC Security: Sol31
'********************Setup*******************:
'....somewhere outside of any subs....
'dim FastFlips
'....table init....
'Set FastFlips = new cFastFlips
'with FastFlips
' .CallBackL = "SolLflipper" 'Point these to flipper subs
' .CallBackR = "SolRflipper" '...
'' .CallBackUL = "SolULflipper"'...(upper flippers, if needed)
'' .CallBackUR = "SolURflipper"'...
'' .TiltObjects = True 'Optional, if True calls vpmnudge.solgameon automatically. IF YOU GET A LINE 1 ERROR, DISABLE THIS! (or setup vpmNudge.TiltObj!)
'' .InitDelay "FastFlips", 100 'Optional, if > 0 adds some compensation for solenoid jitter (occasional problem on Bram Stoker's Dracula)
'' .DebugOn = False 'Debug, always-on flippers. Call FastFlips.DebugOn True or False in debugger to enable/disable.
'end with
'...keydown section... (comment out the upper flippers as needed)
'If KeyCode = LeftFlipperKey then FastFlips.FlipL True : FastFlips.FlipUL True
'If KeyCode = RightFlipperKey then FastFlips.FlipR True : FastFlips.FlipUR True
'(Do not use Exit Sub, this script does not handle switch handling at all!)
'...keyUp section...
'If KeyCode = LeftFlipperKey then FastFlips.FlipL False : FastFlips.FlipUL False
'If KeyCode = RightFlipperKey then FastFlips.FlipR False : FastFlips.FlipUR False
'...Flipper Callbacks....
'if pinmame flipper callbacks are in use, comment them out. For example 'SolCallback(sLRFlipper)
'But use these subs (they should be the same ones defined in CallBackL / CallBackR) to handle flipper rotation and sounds!
'...Solenoid...
'SolCallBack(31) = "FastFlips.TiltSol"
'//////for a reference of solenoid numbers, see top /////
'One last note - Because this script is super simple it will call flipper return a lot.
'It might be a good idea to add extra conditional logic to your flipper return sounds so they don't play every time the game on solenoid turns off
'Example:
'Instead of
'LeftFlipper.RotateToStart
'playsound SoundFX("FlipperDown",DOFFlippers), 0, 1, 0.01 'return
'Add Extra conditional logic:
'LeftFlipper.RotateToStart
'if LeftFlipper.CurrentAngle = LeftFlipper.StartAngle then
' playsound SoundFX("FlipperDown",DOFFlippers), 0, 1, 0.01 'return
'end if
'That's it]
'*************************************************
Class cFastFlips
Public TiltObjects, DebugOn
Private SubL, SubUL, SubR, SubUR, FlippersEnabled, Delay, LagCompensation, Name
Private Sub Class_Initialize()
Delay = 0 : FlippersEnabled = False : DebugOn = False : LagCompensation = False
End Sub
'set callbacks
Public Property Let CallBackL(aInput) : Set SubL = GetRef(aInput) : End Property
Public Property Let CallBackUL(aInput) : Set SubUL = GetRef(aInput) : End Property
Public Property Let CallBackR(aInput) : Set SubR = GetRef(aInput) : End Property
Public Property Let CallBackUR(aInput) : Set SubUR = GetRef(aInput) : End Property
Public Sub InitDelay(aName, aDelay) : Name = aName : delay = aDelay : End Sub 'Create Delay
'call callbacks
Public Sub FlipL(aEnabled)
if not FlippersEnabled and not DebugOn then Exit Sub
subL aEnabled
End Sub
Public Sub FlipR(aEnabled)
if not FlippersEnabled and not DebugOn then Exit Sub
subR aEnabled
End Sub
Public Sub FlipUL(aEnabled)
if not FlippersEnabled and not DebugOn then Exit Sub
subUL aEnabled
End Sub
Public Sub FlipUR(aEnabled)
if not FlippersEnabled and not DebugOn then Exit Sub
subUR aEnabled
End Sub
Public Sub TiltSol(aEnabled) 'Handle solenoid / Delay (if delayinit)
if delay > 0 and not aEnabled then 'handle delay
vpmtimer.addtimer Delay, Name & ".FireDelay" & "'"
LagCompensation = True
else
if Delay > 0 then LagCompensation = False
EnableFlippers(aEnabled)
end if
End Sub
Sub FireDelay() : if LagCompensation then EnableFlippers False End If : End Sub
Private Sub EnableFlippers(aEnabled)
FlippersEnabled = aEnabled
if TiltObjects then vpmnudge.solgameon aEnabled
If Not aEnabled then
subL False
subR False
if not IsEmpty(subUL) then subUL False
if not IsEmpty(subUR) then subUR False
End If
End Sub
End Class
'***************************************************
' JP's VP10 Fading Lamps & Flashers
' Based on PD's Fading Light System
' SetLamp 0 is Off
' SetLamp 1 is On
' fading for non opacity objects is 4 steps
'***************************************************
Dim LampState(200), FadingLevel(200)
Dim FlashSpeedUp(200), FlashSpeedDown(200), FlashMin(200), FlashMax(200), FlashLevel(200)
Dim ccount
InitLamps() ' turn off the lights and flashers and reset them to the default parameters
LampTimer.Interval = 10 'lamp fading speed
LampTimer.Enabled = 1
Sub LampTimer_Timer()
Dim chgLamp, num, chg, ii
chgLamp = Controller.ChangedLamps
If Not IsEmpty(chgLamp) Then
For ii = 0 To UBound(chgLamp)
LampState(chgLamp(ii, 0) ) = chgLamp(ii, 1) 'keep the real state in an array
FadingLevel(chgLamp(ii, 0) ) = chgLamp(ii, 1) + 4 'actual fading step
Next
End If
UpdateLamps
End Sub
Sub InitLamps()
Dim x
For x = 0 to 200
LampState(x) = 0 ' current light state, independent of the fading level. 0 is off and 1 is on
FadingLevel(x) = 4 ' used to track the fading state
FlashSpeedUp(x) = 0.5 ' faster speed when turning on the flasher
FlashSpeedDown(x) = 0.1 ' slower speed when turning off the flasher
FlashMax(x) = 1 ' the maximum value when on, usually 1
FlashMin(x) = 0 ' the minimum value when off, usually 0
FlashLevel(x) = 0 ' the intensity of the flashers, usually from 0 to 1
Next
End Sub
Sub UpdateLamps
'Inserts
NFadeLm 11, l11a
NFadeLm 11, l11b
NFadeLm 11, l11c
NFadeLm 11, l11d
NFadeLm 12, l12
NFadeLm 12, l12b
NFadeLm 13, l13
NFadeLm 13, l13b
NFadeLm 14, l14
NFadeLm 14, l14b
NFadeLm 15, l15
NFadeLm 15, l15b
NFadeLm 16, l16
NFadeLm 16, l16b
NFadeLm 17, l17
NFadeLm 17, l17b
NFadeLm 18, l18
NFadeLm 18, l18b
NFadeLm 21, l21
NFadeLm 21, l21b
NFadeLm 22, l22
NFadeLm 22, l22b
NFadeLm 23, l23
NFadeLm 23, l23b
NFadeLm 24, l24
NFadeLm 24, l24b
NFadeLm 25, l25
NFadeLm 25, l25b
NFadeLm 26, l26
NFadeLm 26, l26b
NFadeLm 27, l27
NFadeLm 27, l27b
NFadeLm 28, l28
NFadeLm 28, l28b
NFadeLm 31, l31
NFadeLm 31, l31b
NFadeLm 32, l32
' NFadeLm 32, l32b
NFadeLm 33, l33
NFadeLm 33, l33b
NFadeLm 34, l34
NFadeLm 34, l34b
NFadeLm 35, l35
NFadeLm 35, l35b
NFadeLm 36, l36
NFadeLm 36, l36b
NFadeObjm 36, targetcars, "target1On", "target1"
NFadeLm 37, l37
' NFadeLm 37, l37b
NFadeLm 38, l38
NFadeLm 38, l38b
NFadeLm 41, l41
NFadeLm 41, l41b
NFadeLm 42, l42
NFadeLm 42, l42b
NFadeLm 43, l43
NFadeLm 43, l43b
NFadeLm 44, l44
NFadeLm 44, l44b
NFadeLm 45, l45
NFadeLm 45, l45b
NFadeLm 46, l46
NFadeLm 46, l46b
NFadeLm 47, l47
NFadeLm 47, l47b
NFadeLm 48, l48
NFadeLm 48, l48b
NFadeLm 51, l51
NFadeLm 51, l51b
NFadeLm 52, l52
NFadeLm 52, l52b
NFadeLm 53, l53
' NFadeLm 53, l53b
NFadeLm 54, l54
NFadeLm 54, l54b
NFadeLm 55, l55
NFadeLm 55, l55b
NFadeLm 56, l56
NFadeLm 56, l56b
NFadeLm 57, l57
NFadeLm 57, l57b
NFadeLm 58, l58
NFadeLm 58, l58b
'61-65 cranelights
Flash 61, f61
NFadeLm 61, l61
Flash 62, f62
NFadeLm 62, l62
Flash 63, f63
NFadeLm 63, l63
Flash 64, f64
NFadeLm 64, l64
Flash 65, f65
NFadeLm 65, l65
NFadeLm 66, l66
NFadeLm 66, l66b
NFadeLm 67, l67
NFadeLm 67, l67b
NFadeLm 68, l68
NFadeLm 68, l68b
Flash 71, f71
' NFadeLm 71, l71b
Flash 72, f72
' NFadeLm 72, l72b
Flash 73, f73
' NFadeLm 73, l73b
' NFadeLm 74, l74
'' NFadeLm 74, l74b
' NFadeLm 75, l75
'' NFadeLm 75, l75b
NFadeLm 76, l76
' NFadeLm 76, l76b
NFadeLm 77, l77
' NFadeLm 77, l77b
NFadeLm 78, l78
NFadeLm 78, l78b
NFadeObjm 78, targetretina, "target2On", "target2"
NFadeLm 81, l81
NFadeLm 81, l81b
NFadeLm 82, l82
NFadeLm 82, l82a
NFadeLm 82, l82b
NFadeLm 82, l82c
NFadeLm 82, l83
NFadeLm 82, l83a
NFadeLm 82, l83b
NFadeLm 82, l83c
NFadeLm 84, l84
NFadeLm 84, l84b
NFadeLm 85, l85
NFadeLm 85, l85b
End Sub
Sub SetLamp(nr, value)
If value <> LampState(nr) Then
LampState(nr) = abs(value)
FadingLevel(nr) = abs(value) + 4
End If
End Sub
' Lights: used for VP10 standard lights, the fading is handled by VP itself
Sub NFadeL(nr, object)
Select Case FadingLevel(nr)
Case 4:object.state = 0:FadingLevel(nr) = 0
Case 5:object.state = 1:FadingLevel(nr) = 1
End Select
End Sub
Sub NFadeLm(nr, object) ' used for multiple lights
Select Case FadingLevel(nr)
Case 4:object.state = 0
Case 5:object.state = 1
End Select