forked from LegendsUnchained/vpx-standalone-alp4k
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAC-DC LUCI Premium (Stern 2013).vbs
5403 lines (4505 loc) · 206 KB
/
AC-DC LUCI Premium (Stern 2013).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
'
' **************************************************************************
' * *
' * STERN PINBALL, INC. *
' * (C) COPYRIGHT 2011 - 2012 STERN PINBALL, INC. *
' * *
' **************************************************************************
' * *
' * AC/DC LUCI *
' * *
' **************************************************************************
'
' * * ********* *
' *** *** *********** ***
' ***** ***** ************* *****
' ******* ******* *************** *******
' ********* ********* ***************** *********
' *********** *********** ******************* ***********
' ************* ************* ******************** *************
' *************** *************** ******************** ***************
' ***************** ***************** ******** *********** *****************
' ****** ************ ******* *********** ******** ******** ********** ******* ***********
' ******* *********** ******* ********** ******** ******** ********* ******* **********
' ******* ********** ******* ******** ******** ******** ******** ******* ********
' ******* ********* ******* ****** ******** ******** ******* ******* ******
' ******* ******** ******* **** ********* ******** ******* ******* ****
' ******* ******* ******* ** ******** ******** ******* ******* **
' ******* ******* ******* ********* ******** ******* *******
' ******* ******* ******* ********* ******** ******* *******
' ******* ******* ******* ******** ******** ******* *******
' ******* ******* ******* ********* ******** ******* *******
' ******* ******* ******* ******** ******** ******* *******
' ******* ******* ******* ********* ******** ******* *******
' ******* ******* ******* *************** ******** ******* *******
' ******************** ******* *************** ******** ******* *******
' ******************** ******* ************** ******** ******* *******
' ******************** ******* ************** ******** ******* *******
' ******************** ******* ************** ******** ******* *******
' ******************** ******* ************* ******** ******* *******
' ******************** ******* ************* ******** ******* *******
' ******************** ******* ******* ******** ******* *******
' ******************** ******* * ****** ******** ******* ******* **
' ******* ******* ******* *** ****** ******** ******* ******* ****
' ******* ******* ******* ***** ****** ******** ******* ******* ******
' ******* ******* ******* ******* ***** ******** ******* ******* ********
' ******* ******* ******** ********* ***** ******** ******** ******* **********
' ******* ******* ******************* **** ******** ********* *******************
' ******** ******** ****************** **** ******** ********** ******************
' ********** ********** **************** **** ******************** ****************
'************ ************ ************** *** ******************** **************
' *********** ************ ************ *** ******************** ************
' ********* ********** ********** *** ******************* **********
' ******* ******** ******** ** ***************** ********
' ***** ****** ****** * *************** ******
' *** **** **** ** ************* ****
' * ** ** * *********** **
'
'
'
'
'This mod started out as a simple collaboration between Hauntfreaks and Fluffhead35 to add new physics and VR room ended up as so much more.
'This table has had the bell code completely reworked by Apophis to work more like the real table. The playfield has been tweaked by none other than
'nFozzy himself to be more in line with the blueprint. He also fixed the right and left ramps to be true to the real table.
'nFozzy has graced this table with his experience to make it table amazing to play.
'
'This table was a mod of Sixto's AC/DC VR Room, where we made it a hybrid table.
'
'Fluffhead35 - Fleep, nFozzy physics, dynamic shadows, drop target code and new drop targets, 3d inserts, added new flipper bats, lighting tweaks,
' added Lampz code, adjusted nudge
'Hauntfreak - Added new VR Room, Lighting Adjustments, Playfield Shadows
'Sixtoe - Original VR, Lighting, Separated out horns on the train, many more he could not remember. Fixed right ramp, fixed bumper flashers.
' Realignment and prettying up rubbers and stuff.
'Apophis - New Bell Physics, scripting, guidance
'nFozzy - new collidable ramps to fix the shapes of them, moved top hole variance, bell metal/orbit metal tweaks, playfield reshape to correct dimensions.
' Implemented ramp protectors, blank sidewalls, ramp stickers, adjusted bell position.
'Tomate - New visual ramps
'Retro27 - VR Room / Cabinet Reworked, New DMD Decals, Start button,tournament mode lights added. Adjustment to Instructions cards, added new render mode for VR
'Schlabber34 - reworked droptargets and other objects in blender for use in table.
'
' *
'VPX recreation by ninuzzu
'thanks to javier for let me continue this table, wich is based on his PRO version
'Big thanks to DJRobX: without him, this table wouldn't exist.
'I also would like to thank:
'dark for the bell base model;
'tom tower for the LE apron;
'knorr for the laser mod
'rysr, Peter J and javier (again :D ) for the help with the pics.
'the VPDevTeam for the freaking amazing VPX
'Surround Sound MOD by RustyCardores
' This mod includeds a shaker pulse and if ned be it can easily be reomoved in the SOLENOIDS section of this script.
' New Stuff Fixed
' * Premium Cab and Backglass added for VR
' * Fixed plastic wall heights
' * Adjusted GI lights on Lower Playfied
' * Adjusted Bell Physics and copletely redone
' * Changed gates control on ramps form spinners to Gates
' * Adjusted gates so that they don't swing in the wind
' * Cannon speed and visual animation fixed
' * Cannon Shot Strength Increased
' * Slings Rubber animation adjusted
' * Missing Band member restored on Playfield
' * Fix for diverter so ball is not thrown off ramp
'
'1.0 Release
'1.0.2 Release
'1.0.3 - Fixed the custom flipper decals, added 2nd option for mini flippers custom decal, adjusted the hight of the Div1P primitive. VR back glass has been updated when nude mode option enabled.
'1.0.5 - Has updaes for vr cabinet and premium edition, updated newton ball code, db issues on lower playfield, corrected walls, added code to make cannon move at 1.8
'1.0.6 - Added animation class. Smoother, more accurate cannon rotation. Blendshape slingshots
'1.0.7 - Moved Bellk to 300h and moved invisible bell ramp up to 400z
'1.0.8 - New Brell physics by nfozzy
'1.0.9 - Added Gates on Ramp to correct collections for ssf
'1.0.10 - Added in new nFozzy Ramp Object. Updated Height of switchs on ramps.
'1.0.11 - Bell bugfixes, fixed some collideable objects, shortened flippers to ~3.15", dirty hue shift on blue bulbs, added narnia checker, optipng'd some images
'1.0.12 - Updated animation script, cleaned up post-pass geometry, hacked blue bulbs a bit more, added pinmame reset switch search
'1.0.13 - Updated animation script, adjusted position of inlane screws.
'1.1 Release
Option explicit
Randomize
'************************************************************************
' TABLE OPTIONS
'************************************************************************
Const VaultEdition = 0 'Show new lower pf plate, LED flashers, apron stickers and DMD decal, these were added in the Vault Edition models produced in 2017
Const NudeMod = 0 'Enable Nude Mod, with new artwork (0= no, 1= yes)
Const InstrCardType = 1 'Instruction Cards Type (0= white, 1= yellow, 2 = custom)
Const TrainHornsLit = 0 'Light the Train Horns (0= no, 1= yes)
Const LaserMod = 0 'Shows a laser beam when Cannon is moving (0= no, 1= yes)
Const BellMod = 0 'Shows a Wooden Bell Log instead of the Metallic one (0= no, 1= yes)
Const RampsDecals = 0 'Shows Custom Ramps Decals (0= no, 1= yes)
Const FlippersDecals = 0 'Shows Custom Flippers Decals (0= no, 1= yes)
Const MFlippersDecals = 0 'Shows Custom Mini Flippers Decals (0= no, 1= yes)
Const SideCabDecals = 0 '0 - Standard Black Wooden Sideblades, 1 - Custom Fire Sideblades, 2 - Custom Decal Sideblades
Const FIREButtonLight = 0 'Light the apron decal when FIRE button is on, useful for pincabs (0= no, 1= yes)
Const OutLaneDifficulty = 1 '0 - Easy, 1 - Normal, 2 - Hard
'************************************************************************
' CABINET MODE
'************************************************************************
CabinetMode = 1 '0 - Show SideRails, Lockdown Bar and Fire Button, 1 - Hide SideRails, Lockdown Bar and Fire Button
'************************************************************************
' VR OPTIONS
'************************************************************************
Dim VRRoomChoice : VRRoomChoice = 1 '1 - Minimal Room, 2 - Blacklight Room (only applies when using VR headset)
Const VRTopper = 0 '0 - Topper off, 1 - ACDC Topper, 2 - Tournament Mode Topper
Const VRDMDDecal = 0 '0 - Standard DMD Speaker Decal, 1 - Amplifier DMD Decal, 2 - Custom DMD Decal
'************************************************************************
' OTHER OPTIONS
'************************************************************************
'----- Shadow Options -----
Const DynamicBallShadowsOn = 1 '0 = no dynamic ball shadow ("triangles" near slings and such), 1 = enable dynamic ball shadow
Const AmbientBallShadowOn = 1 '0 = Static shadow under ball ("flasher" image, like JP's)
'1 = Moving ball shadow ("primitive" object, like ninuzzu's) - This is the only one that shows up on the pf when in ramps and fades when close to lights!
'2 = flasher image shadow, but it moves like ninuzzu's
'----- General Sound Options -----
Const VolumeDial = 0.8 'Overall Mechanical sound effect volume. Recommended values should be no greater than 1.
Const BallRollVolume = 0.5 'Level of ball rolling volume. Value between 0 and 1
Const RampRollVolume = 0.5 'Level of ramp rolling volume. Value between 0 and 1
'************************************************************************
' END OF TABLE OPTIONS
'************************************************************************
On Error Resume Next
ExecuteGlobal GetTextFile("controller.vbs")
If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
On Error Goto 0
Const Ballsize = 50
Const BallMass = 1
Const cGameName = "acd_170h"
'Const cGameName = "acd_170hc" 'Color Rom
Dim tablewidth: tablewidth = ACDC.width
Dim tableheight: tableheight = ACDC.height
Const UseVPMModSol = True
Dim UseVPMDMD,CustomDMD,DesktopMode,CabinetMode
DesktopMode = ACDC.ShowDT : CustomDMD = False
If Right(cGamename,1)="c" Then CustomDMD= False
If CustomDMD OR (NOT DesktopMode AND NOT CustomDMD) Then UseVPMDMD = False 'hides the internal VPMDMD when using the color ROM or when table is in Full Screen and color ROM is not in use
If DesktopMode AND NOT CustomDMD Then UseVPMDMD = True 'shows the internal VPMDMD when in desktop mode and color ROM is not in use
Scoretext.visible = NOT CustomDMD 'hides the textbox when using the color ROM
LoadVPM "02800000", "Sam.VBS", 3.54
'********************
'Standard definitions
'********************
Const UseSolenoids = 1
Const UseLamps = 0
Const UseGI = 0
Const UseSync = 0
Const HandleMech = 0
'Standard Sounds
Const SSolenoidOn = "fx_Solon"
Const SSolenoidOff = ""
'Const SCoin = "fx_coin"
'************************************************************************
' INIT TABLE
'************************************************************************
Dim bsTrough, bsTEject, bsBellEject, bsLowEject, PlungerIM, ACDCBank, TNTBank
Sub ACDC_Init
vpmInit Me
With Controller
.GameName = cGameName
'.Games(cGameName).Settings.Value("rol") = 1
'.Games(cGameName).Settings.Value("dmd_width")=128
'.Games(cGameName).Settings.Value("dmd_height")=512
.SplashInfoLine = "AC/DC LUCI (Stern 2013)"
.HandleKeyboard = 0
.ShowTitle = 0
.ShowDMDOnly = 1
.ShowFrame = 0
If NOT CustomDMD Then .Hidden = DesktopMode 'hides the external DMD when in desktop mode and color ROM is not in use
.HandleMechanics = 0
On Error Resume Next
.Run GetPlayerHWnd
If Err Then MsgBox Err.Description
On Error Goto 0
End With
'Main Timer init
PinMAMETimer.Interval = PinMAMEInterval
PinMAMETimer.Enabled = 1
'Nudging
vpmNudge.TiltSwitch = -7
vpmNudge.Sensitivity = 5
vpmNudge.TiltObj = Array(Bumper1, Bumper2, Bumper3, LeftSlingshot, RightSlingshot)
'Trough
Set bsTrough = New cvpmTrough
With bsTrough
.Size = 4
.InitSwitches Array(21, 20, 19, 18)
.InitExit BallRelease, 70, 15
.InitEntrySounds "", SoundFX(SSolenoidOn,DOFContactors), SoundFX(SSolenoidOn,DOFContactors)
.InitExitSounds SoundFX(SSolenoidOn,DOFContactors), SoundFX("BallRelease1",DOFContactors)
.Balls = 4
'.CreateEvents "bsTrough", Drain
End With
'Top Eject
Set bsTEject = new cvpmSaucer
With bsTEject
.InitKicker Sw37, 37, 89, 14, 0 'was Sw37, 37, 90, 9, 0
.InitExitVariance 2,2
.InitAltKick 90, 26, 0 'InitAltKick(aDir, aForce, aZForce)
' .InitExitVariance 5, 1 ' too much Variance may break super skillshot. see Sub SolTopEject
.InitSounds "fx_kicker_enter", SoundFX(SSolenoidOn,DOFContactors), SoundFX("ExitSandman",DOFContactors)
.CreateEvents "bsTEject", Sw37
End With
'Bell Eject
Set bsBellEject = new cvpmSaucer
With bsBellEject
.InitKicker Sw36, 36, 170, 8, 0 ' NF eject vel 10 -> 8
.InitExitVariance 0, 2
.InitSounds "Saucer_Enter_1", SoundFX(SSolenoidOn,DOFContactors), SoundFX("Saucer_Kick",DOFContactors)
.CreateEvents "bsBellEject", Sw36
End With
'Lower PF Eject
Set bsLowEject = new cvpmTrough
With bsLowEject
.Size = 1
.InitSwitches Array(49)
.InitExit Sw49, 32, 35
.InitExitVariance 0, 2
.InitEntrySounds "fx_kin", "", ""
.InitExitSounds SoundFX(SSolenoidOn,DOFContactors), SoundFX("Popper",DOFContactors)
.Balls = 1
.CreateEvents "bsLowEject", Sw49
End With
'Impulse Plunger
Set plungerIM = New cvpmImpulseP
With plungerIM
'.InitImpulseP sw23, 65, 0.5
.InitImpulseP sw23, 55, 0.5 ' nf rescale
.Switch 23
.Random 1.5
.InitExitSnd SoundFX("fx_AutoPlunger",DOFContactors), SoundFX(SSolenoidOn,DOFContactors)
.CreateEvents "plungerIM"
End With
'Other Suff
InitOptions:InitBell:InitCannon:InitDiverters: InitDropTargets
'Fast Flips
On Error Resume Next
InitVpmFFlipsSAM
If Err Then MsgBox "You need the latest sam.vbs in order to run this table, available with vp10.5 rev3434"
On Error Goto 0
Backwall_Tracks_Bubble.z=50 ' NF - overlapping transparent object workaround (consider removing transparency from lvl1 plastics)
End Sub
Sub Drain_Hit()
if bsTrough.balls >= 4 then Me.destroyball : Exit Sub ' If the trough is full, destroy excess balls
bsTrough.AddBall Me
End Sub
sub BallSearch() ' check for down drop targets on start (pinmame reset)
dim i : for i = 0 to uBound(DTArray)
if DTArray(i).prim.transz <> 0 then ' this seems like not an ideal way to do this
Controller.switch(DTArray(i).sw ) = 1
end if
Next
bstrough.Update
end Sub
'*******************************************
' VR Room
'*******************************************
Dim VRRoom
If RenderingMode = 2 Then VRRoom = VRRoomChoice Else VRRoom = 0
DIM VRThings
If VRRoom > 0 Then
ScoreText.visible = 0
If VRRoom = 1 Then
for each VRThings in VR_Room:VRThings.visible = 1:Next
for each VRThings in VR_Room2:VRThings.visible = 0:Next
for each VRThings in VR_Cab:VRThings.visible = 1:Next
for each VRThings in VR_topper:VRThings.visible = 1:Next
End If
If VRRoom = 2 Then
for each VRThings in VR_Room:VRThings.visible = 0:Next
for each VRThings in VR_Room2:VRThings.visible = 1:Next
for each VRThings in VR_Cab:VRThings.visible = 1:Next
for each VRThings in VR_topper:VRThings.visible = 1:Next
End If
Else
for each VRThings in VR_Cab:VRThings.visible = 0:Next
End if
'*******************************************
'VR Cabinet Mode
'*******************************************
If CabinetMode and VRRoom=0 Then
PinCab_Rails.visible=0
PinCab_FirePlate.visible=0
PushButton_0.visible=0
PushButton_002.visible=0
PushButton_001.visible=0
PushButton_003.visible=0
Else
PinCab_Rails.visible=1
PinCab_FirePlate.visible=1
PushButton_0.visible=1
PushButton_002.visible=1
PushButton_001.visible=1
PushButton_003.visible=1
End If
'************************************************************************
' KEYS
'************************************************************************
Sub ACDC_KeyDown(ByVal Keycode)
If keycode = LeftFlipperKey Then FlipperActivate LeftFlipper, LFPress : Controller.Switch(88) = 1 :PinCab_Flipper_Button_Left.X = PinCab_Flipper_Button_Left.X +6 'Mini PF flipper switch
If keycode = RightFlipperKey Then FlipperActivate RightFlipper, RFPress : Controller.Switch(86) = 1 :PinCab_Flipper_Button_Right.X = PinCab_Flipper_Button_Right.X -6 'Mini PF flipper switch
If keycode = LeftTiltKey Then Nudge 90, 1:SoundNudgeLeft()
If keycode = RightTiltKey Then Nudge 270, 1:SoundNudgeRight()
If keycode = CenterTiltKey Then Nudge 0, 1:SoundNudgeCenter()
If KeyCode = PlungerKey Then Plunger.Pullback: SoundPlungerPull()
If KeyCode = RightMagnaSave OR KeyCode = LockbarKey Then Controller.Switch(64)=1 :PushButton_002.Z =PushButton_002.Z -6 :PushButton_001.Z =PushButton_001.Z -6 'FIRE Button, mapped to the right magna save
If keycode = keyFront Then Controller.Switch(15) = 1 :PinCab_Tournament_Button.Y =PinCab_Tournament_Button.Y -2 'tournament
If keycode = StartGameKey Then BallSearch : Controller.Switch(16) = 1 :PinCab_Start_Button.Y = PinCab_Start_Button.Y -2 :PinCab_Start_Button_Inner_Ring.Y = PinCab_Start_Button_Inner_Ring.Y -2
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 = 30 then testball 'key=A. debug
If vpmKeyDown(keycode) Then Exit Sub
End Sub
Sub ACDC_KeyUp(ByVal Keycode)
If keycode = keyFront Then Controller.Switch(15) = 0
If keycode = LeftFlipperKey Then FlipperDeActivate LeftFlipper, LFPress : Controller.Switch(88) = 0 :PinCab_Flipper_Button_Left.X = PinCab_Flipper_Button_Left.X -6 'Mini PF flipper switch
If keycode = RightFlipperKey Then FlipperDeActivate RightFlipper, RFPress : Controller.Switch(86) = 0 :PinCab_Flipper_Button_Right.X = PinCab_Flipper_Button_Right.X +6 'Mini PF flipper switch
If KeyCode = PlungerKey Then Plunger.Fire: StopSound "fx_PlungerPull":PlaySoundAt "fx_Plunger",Plunger
If KeyCode = RightMagnaSave OR KeyCode = LockbarKey Then Controller.Switch(64)=0 :PushButton_002.Z =PushButton_002.Z +6 'FIRE Button, mapped to the right magna save
If keycode = StartGameKey Then Controller.Switch(16) = 1 :PinCab_Start_Button.Y = PinCab_Start_Button.Y +2 :PinCab_Start_Button_Inner_Ring.Y = PinCab_Start_Button_Inner_Ring.Y +2
If keycode = keyFront Then Controller.Switch(15) = 1 :PinCab_Tournament_Button.Y =PinCab_Tournament_Button.Y +2 'tournament
If vpmKeyUp(keycode) Then Exit Sub
End Sub
'Sub TimerPlunger_Timer
'VR_Primary_plunger.Y = -26.5 + (5* Plunger.Position) -20
'End Sub
'**********************************************************************************************************
'Plunger code
'**********************************************************************************************************
TimerVRPlunger2.enabled = true ' This sits outside of a sub, and tells the timer2 to be enabled at table load
Sub TimerVRPlunger_Timer
if PinCab_plunger.Y < 1530 then PinCab_plunger.Y = PinCab_plunger.y +5 'If the plunger is not fully extend it, then extend it by 5 coordinates in the Y,
End Sub
Sub TimerVRPlunger2_Timer
PinCab_plunger.Y = 2330 + (5* Plunger.Position) -20 ' This follows our dummy plunger position for analog plunger hardware users.
end sub
Sub ACDC_Paused:Controller.Pause = 1:End Sub
Sub ACDC_UnPaused:Controller.Pause = 0:End Sub
Sub ACDC_Exit:Controller.Stop:End Sub
'************************************************************************
' SOLENOIDS
'************************************************************************
SolCallBack(1) = "SolTrough" 'Trough-Up Kicker
SolCallBack(2) = "SolAutoPlungerIM" 'AutoLaunch
SolCallback(3) = "bsLowEject.SolOut" 'Lower PF Eject
SolCallback(4) = "SolLFlipperMini" 'Lower PF Left Flipper
SolCallback(5) = "SolRFlipperMini" 'Lower PF Right Flipper
SolCallback(6) = "SolDTBank5" '5-bank Drop Target
SolCallback(7) = "SolDTBank3" '3-bank Drop Target
SolCallback(8) = "vpmSolSound SoundFX(""ShakerPulse"",DOFShaker)," 'Shaker Motor
'SolCallback(9) = "" 'Left Bumper
'SolCallback(10)= "" 'Right Bumper
'SolCallback(11)= "" 'Top Bumper
SolCallback(12)= "SolTopEject" 'Top Eject
SolModCallback(12)= "SolTopEject_catch" 'Top Eject NF - catch pwm value
'SolCallback(13)= "" 'Left Sling
'SolCallback(14)= "" 'Right Sling
SolCallback(15)= "SolLFlipper" 'Left Flipper
SolCallback(16)= "SolRFlipper" 'Right Flipper
SolModCallBack(17)= "SetLampMod 177," 'Flasher: Train
SolCallback(18)= "SolDetonator" 'Detonator
SolModCallBack(19)= "SetLampMod 179," 'Flasher:Bottom Arch (x2)
SolModCallBack(20)= "SetLampMod 180," 'Flasher: Left Ramp
'SolModCallBack(21)= "SetLampMod 181," 'Flasher:Left Side
SolModCallback(21) = "FlashSol121" 'Flasher:Dome Left Side
SolModCallBack(22)= "SetLampMod 182," 'Flasher:BackPanel
SolModCallBack(23)= "SetLampMod 183," 'Flasher: Top Eject
SolCallBack(24)= "vpmSolSound SoundFX(""fx_knocker"",DOFKnocker)," 'Knocker
SolModCallBack(25)= "SetLampMod 185," 'Flasher:Pop Bumpers (x3)
SolModCallBack(26)= "SetLampMod 186," 'Flasher: Bell Arrow
SolModCallBack(27)= "SetLampMod 187," 'Flasher:Left Ramp Left
SolModCallBack(28)= "SetLampMod 188," 'Flasher:Left Ramp Right
SolModCallBack(29)= "SetLampMod 189," 'Flasher:Right Ramp Right
SolModCallBack(30)= "SetLampMod 190," 'Flasher:Right Ramp
'SolModCallBack(31)= "SetLampMod 191," 'Flasher:Right Side
SolModCallback(31) = "FlashSol131" 'Flasher:Dome Right Side
SolCallback(32)= "SolCannonMotor" 'Cannon Motor
'aux coils 41-48
SolCallBack(51) = "SolBandMembers" 'Band Members Mech
SolCallBack(52) = "bsBellEject.SolOut" 'Bell Eject
SolCallBack(53) = "SolCannon" 'Cannon Eject
SolCallBack(54) = "SolBellMove" 'Bell Magnet
SolCallBack(55) = "SolCannonDiv" 'Cannon Diverter
SolCallBack(56) = "vpmSolGate Gate, SoundFX(SSolenoidOn,DOFContactors)," 'Right Control Gate
SolCallBack(57) = "SolRampDiv" 'Left Ramp Diverter
'SolCallBack(58) = "" 'Cabinet Topper (???)
'************************************************************************
' FLIPPERS
'************************************************************************
Const ReflipAngle = 20
Sub SolLFlipper(Enabled)
If Enabled Then
LF.Fire 'leftflipper.rotatetoend
If leftflipper.currentangle < leftflipper.endangle + ReflipAngle Then
RandomSoundReflipUpLeft LeftFlipper
Else
SoundFlipperUpAttackLeft LeftFlipper
RandomSoundFlipperUpLeft LeftFlipper
End If
Else
LeftFlipper.RotateToStart
If LeftFlipper.currentangle < LeftFlipper.startAngle - 5 Then
RandomSoundFlipperDownLeft LeftFlipper
End If
FlipperLeftHitParm = FlipperUpSoundLevel
End If
End Sub
Sub SolRFlipper(Enabled)
If Enabled Then
RF.Fire 'rightflipper.rotatetoend
If rightflipper.currentangle > rightflipper.endangle - ReflipAngle Then
RandomSoundReflipUpRight RightFlipper
Else
SoundFlipperUpAttackRight RightFlipper
RandomSoundFlipperUpRight RightFlipper
End If
Else
RightFlipper.RotateToStart
If RightFlipper.currentangle > RightFlipper.startAngle + 5 Then
RandomSoundFlipperDownRight RightFlipper
End If
FlipperRightHitParm = FlipperUpSoundLevel
End If
End Sub
Sub SolLFlipperMini(Enabled)
If Enabled Then
LeftFlipperMini.RotateToEnd
If LeftFlipperMini.currentangle > LeftFlipperMini.endangle - ReflipAngle Then
RandomSoundReflipUpRight LeftFlipperMini
Else
SoundFlipperUpAttackRight LeftFlipperMini
RandomSoundFlipperUpRight LeftFlipperMini
End If
Else
LeftFlipperMini.RotateToStart
If LeftFlipperMini.currentangle > LeftFlipperMini.startAngle + 5 Then
RandomSoundFlipperDownRight LeftFlipperMini
End If
FlipperRightHitParm = FlipperUpSoundLevel
End If
End Sub
Sub SolRFlipperMini(Enabled)
If Enabled Then
RightFlipperMini.RotateToEnd
If RightFlipperMini.currentangle > RightFlipperMini.endangle - ReflipAngle Then
RandomSoundReflipUpRight RightFlipperMini
Else
SoundFlipperUpAttackRight RightFlipperMini
RandomSoundFlipperUpRight RightFlipperMini
End If
Else
RightFlipperMini.RotateToStart
If RightFlipperMini.currentangle > RightFlipperMini.startAngle + 5 Then
RandomSoundFlipperDownRight RightFlipperMini
End If
FlipperRightHitParm = FlipperUpSoundLevel
End If
End Sub
'************************************************************************
' BALL TROUGH
'************************************************************************
Sub SolTrough(Enabled)
If Enabled Then
bsTrough.ExitSol_On
If BsTrough.Balls Then vpmTimer.PulseSw 22
End If
End Sub
'************************************************************************
' AUTOPLUNGER
'************************************************************************
Sub SolAutoPlungerIM(Enabled)
If Enabled Then
PlungerIM.AutoFire
aAutoPlunger.Play ' animation
End If
End Sub
'************************************************************************
' EXIT JUKEBOX
'************************************************************************
' NF note: This hole utilizes pulse width modulation for two kickouts
' If both flippers are held after plunging, targets light for super skillshot
' SolModCallback(12) will pulse to 255 if this is the case (usually within 10ms)
Sub SolTopEject(enabled) ' SolCallBack
If Enabled Then
' vpmtimer is not precise enough - at 40ms, it will fire too quickly. at 80, it will be noticeably delayed.
' So we will borrow the kicker's timer instead
sw37.timerinterval=30 : sw37.timerenabled=1
end if
End Sub
dim TopEjectMaxValue : TopEjectMaxValue=0
sub SolTopEject_catch(b) 'SolModCallBack: catch PWM value (assigned to variable TopEjectMaxValue)
if b > TopEjectMaxValue then TopEjectMaxValue = b ' all
end Sub
sub sw37_timer() ' Kickout. kicker object timer
if TopEjectMaxValue < 255 Then
bsTEject.ExitSol_On
' debug.print "regular kickout " & TopEjectMaxValue & vbnewline & "---"
else
bsTEject.ExitAltSol_On
' debug.print "super kickout " & TopEjectMaxValue & vbnewline & "---"
end if
TopEjectMaxValue=0
me.timerenabled=0
end Sub
'************************************************************************
' DRAIN SOUND
'************************************************************************
Sub DrainSw_Hit
RandomSoundDrain DrainSw
End Sub
'************************************************************************
' RAMP DIVERTERS
'************************************************************************
Dim Div1Hit,Div3Hit
Sub InitDiverters
DiverterL.Isdropped = 1:DiverterR.Isdropped = 1
Div1Hit=0: Div3Hit=0
End Sub
Sub InitDropTargets
DTRaise 1
DTRaise 2
DTRaise 3
DTRaise 4
DTRaise 5
DTRaise 10
DTRaise 11
DTRaise 12
End Sub
Sub SolCannonDiv(Enabled)
If Enabled Then
DiverterR.Isdropped = 0
'DivP.Z = 142
aDiverterR.PlayFromTo 0, 100
PlaySoundAt SoundFX("DiverterOn", DOFContactors),light41
Else
DiverterR.Isdropped = 1
'DivP.Z = 172.5
' aDiverterR.PlayFrom 1000
aDiverterR.PlayFrom 150
PlaySoundAt SoundFX("DiverterOff", DOFContactors),light41
End If
End Sub
Sub SolRampDiv(Enabled)
If Enabled Then
DiverterL.Isdropped = 0
'Div1P.Z = 185
aDiverterL.PlayFromTo 0, 100
PlaySoundAt SoundFX("DiverterOn", DOFContactors),light5
Else
DiverterL.Isdropped = 1
'Div1P.Z = 230.5
aDiverterL.PlayFrom 150
PlaySoundAt SoundFX("DiverterOff", DOFContactors),light5
End If
End Sub
' **************** animations init ******************
dim aLeftSlingArm : Set aLeftSlingArm = New cAnimation2
dim aRightSlingArm : Set aRightSlingArm = New cAnimation2
dim aLeftSling : Set aLeftSling = New cAnimation2
dim aRightSling : Set aRightSling = New cAnimation2
dim aAutoPlunger : Set aAutoPlunger = New cAnimation2
LeftSlingBand.ShowFrame 0
RightSlingBand.ShowFrame 0
dim aCannon : set aCannon = New cAnimation2
dim aDiverterL, aDiverterR : set aDiverterL = new cAnimation2 : set aDiverterR = new cAnimation2
InitAnimations
Sub InitAnimations() ' animations plot can be printed in debugger with obj.TEST() method
dim x,a
a = array(aLeftSlingArm, aRightSlingArm)
for each x in a
x.AddPoint 0, 0, -4.25
x.AddPoint 1, 10, 0 ' hit sling
x.AddPoint 2, 31, 17 ' 5 frames down (240fps)
x.AddPoint 3, 77, 17 ' 11 frames hold
x.AddPoint 4, 110, -4.25 ' 8 frames Up
next
aLeftSlingArm.Callback = "animLeftSlingArm"
aRightSlingArm.Callback = "animRightSlingArm"
a = Array(aLeftSling, aRightSling)
for each x in a
x.AddPoint 0, 0, 0
x.AddPoint 1, 10, 0 ' wait for kicker
x.AddPoint 2, 31, 1 ' 5 frames down
x.AddPoint 3, 77, 1 ' 11 frames hold
x.AddPoint 4, 110, 0 ' 8 frames Up
next
aLeftSling.Callback = "animLeftSling"
aRightSling.Callback = "animRightSling"
With aAutoPlunger
.InterpolationType=2 ' Catmull-Rom Spline Interpolation
.AddPoint2 0, 0, 0 ' addpoint2 specifies x=duration of current frame, rather than the raw MS of the animation
.AddPoint2 1, 25, 23
.AddPoint2 2, 57, 23
.AddPoint2 3, 27, 23
.AddPoint2 4, 0, 23 ' Coil returns here. duration of 0 will break the spline gradient which can be useful
.AddPoint2 5, 50, 0
.AddPoint2 6, 50, 0
.Callback= "animAutoPlunger"
End With
with aDiverterL
.InterpolationType=2 ' Catmull-Rom Spline Interpolation
.AddPoint 0, 0, 230.5
.AddPoint 1, 31, 185
.AddPoint 2, 100, 185
.AddPoint 3, 150, 185 ' hold here
.AddPoint 4, 200, 185
.AddPoint2 5, 33, 230.5
.AddPoint2 6, 25, 230.5
.Callback= "animDiverterL"
end with
with aDiverterR
.InterpolationType=2 ' Catmull-Rom Spline Interpolation
.AddPoint 0, 0, 172.5
.AddPoint 1, 31, 142
.AddPoint 2, 100, 142
.AddPoint 3, 150, 142 ' hold here
.AddPoint 4, 200, 142
.AddPoint2 5, 33, 172.5
.AddPoint2 6, 25, 172.5
.Callback= "animDiverterR"
end with
with aCannon ' This animation is special. Could be converted to a spline interpolation
.AddPoint 0, 0, 0 ' home loitering 266? 133? 150?
.AddPoint 1, 150, 0 ' home 2600ms travel
.AddPoint 2, 2750, 1 ' full rotation
.AddPoint 3, 2916, 1 ' full rotation waiting 166ms
.AddPoint 4, 5548, 2 ' returned home 2632ms
End With
aCannon.Callback = "animCannon"
aCannon.InterpolationType=0 ' Linear interpolation for special cannon animation (don't touch this)
End Sub
'Animation Callbacks
Sub animLeftSlingArm(Value) : SlingKicker1.RotX = Value : End Sub
Sub animRightSlingArm(Value) : SlingKicker2.RotX = Value : End Sub
Sub animLeftSling(Value) : LeftSlingBand.ShowFrame Value : End Sub
Sub animRightSling(Value) : RightSlingBand.ShowFrame Value : End Sub
Sub animAutoPlunger(Value) : AutoPlungerMesh.RotX = Value : End Sub
sub animDiverterL(Value) : Div1P.z = value : end Sub
sub animDiverterR(Value) : DivP.z = value : end Sub
'************************************************************************
' CANNON ENTER
'************************************************************************
Dim GPos, GDir, BallInGun, BallInGunRadius, LaserON, GDirStep
BallInGunRadius = SQR((Cannon_assyM.X - Sw45.X)^2 + (Cannon_assyM.Y - Sw45.Y)^2)
GPos = 110: GDir = -1.8 : GDirStep = 0.8
Sub Sw45_hit()
RandomSoundMetal
Controller.switch(45) = 1
Set BallInGun = ActiveBall
End Sub
'************************************************************************
' CANNON MOTOR
'************************************************************************
Sub InitCannon
Controller.switch(61) = 1
Controller.switch(62) = 0
End Sub
Sub SolCannonMotor(Enabled)
If Enabled Then
aCannon.PlayLoop
' GDir = -1.8
' GDirStep = 0.8
PlaySoundAt SoundFX("CannonMotor", DOFGear),light41
If LaserMod = 1 then
LaserR.Size_Z = 0.5
LaserR1.Size_Z = 0.5
LaserR.visible = 1
LaserR1.visible = 1
LaserZTimer.Enabled = 1
LaserON = 1
End if
Else
aCannon.Pause
StopSound "CannonMotor"
LaserON = 0
End If
End Sub
Function InterpolateCannon(input) 'gives the cannon 'acceleration' characteristics, by using a polynomial
dim x, xholdover : xholdover = 0
x = input
if x > 1 then
xholdover = cint(x+0.5)-1
x = x - cint(x+0.5)+1
end if
'InterpolateGun = -1.94137*x^3 + 2.91206*x^2 + 0.0293147*x + 0 'Balanced but heavy '1.02
InterpolateCannon = -1.97035*x^3 + 2.95552*x^2 + 0.0148269*x - 2.22045*(1E-16) 'Balanced heavier
InterpolateCannon = InterpolateCannon + xholdover
if InterpolateCannon < 0 then InterpolateCannon = 0
End Function
sub animCannon(value)
dim GPosStep : GPosStep = InterpolateCannon(Value+1) ' value between 1 and 3 (2 is furthest extent)
GPos = LinearEnvelope(GPosStep, array(1,2,3),array(110,20,110)) ' map value to rotation value - 110 degrees is home position
if GPosStep = 3 then GPosStep = 1
If GPos < 110 and value >= 1 Then Controller.switch(61) = 0
If GPos <= 89 Then Controller.switch(62) = 1 ' 80
If GPos > 89 and GPos < 110 and value < 1 Then Controller.switch(61) = 0: Controller.switch(62) = 0
If GPos >= 110 Then GPos=110: Controller.switch(61) = 1: Controller.switch(62) = 0
Cannon_assyM.RotZ = GPos
Cannon_decalM.RotZ = GPos
Cannon_assyP.RotZ = GPos
Cannon_decalP.RotZ = GPos
Cannon_Plunger.RotZ = GPos
Cannon_shadow.RotZ = GPos
LaserR.objRotZ = -(GPos-90)
LaserR1.objRotZ = -(GPos -90)
If Not IsEmpty(BallInGun) Then
BallInGun.X = Cannon_assyM.X - BallInGunRadius * Cos(GPos*Pi/180)
BallInGun.Y = Cannon_assyM.Y - BallInGunRadius * Sin(GPos*Pi/180)
BallInGun.Z = CannonRamp.HeightTop + Ballsize
End If
End Sub
'***LaserZTimer***
Sub LaserZTimer_Timer()
If GPos >= 102 And GPos <= 110 then LaserR.Size_Z = 0.5: LaserR1.Size_Z = 0.5
If GPos <= -101.99 And GPos >= 97 then LaserR.Size_Z = 1: LaserR1.Size_Z = 1
If GPos <= -96.99 And GPos >= 89.01 then LaserR.Size_Z = 0.55: LaserR1.Size_Z = 0.55
If GPos <= 89 And GPos >= 81.01 then LaserR.Size_Z = 0.48: LaserR1.Size_Z = 0.48
If GPos <= 81 And GPos >= 73.01 then LaserR.Size_Z = 0.78: LaserR1.Size_Z = 0.78
If GPos <= 73 And GPos >= 65.01 then LaserR.Size_Z = 0.7: LaserR1.Size_Z = 0.7
If GPos <= 65 And GPos >= 45.01 then LaserR.Size_Z = 0.6: LaserR1.Size_Z = 0.6
If GPos <= 45 And GPos >= 42.01 then LaserR.Size_Z = 0.43: LaserR1.Size_Z = 0.43
If GPos <= 42 And GPos >= 40.01 then LaserR.Size_Z = 0.425: LaserR1.Size_Z = 0.425
If GPos <= 40 And GPos >= 37.01 then LaserR.Size_Z = 0.41: LaserR1.Size_Z = 0.41
If GPos <= 37 And GPos >= 30.01 then LaserR.Size_Z = 0.39: LaserR1.Size_Z = 0.39
If GPos <= 30 And GPos >= 22.01 then LaserR.Size_Z = 0.385: LaserR1.Size_Z = 0.385
If GPos <= 22 then LaserR.Size_Z = 0.385: LaserR1.Size_Z = 0.375
If GPos >= 110 And LaserON = 0 Then
LaserR.Visible = 0
LaserR1.Visible = 0
LaserZTimer.Enabled = 0
End if
End Sub
'************************************************************************
' CANNON KICKOUT
'************************************************************************
Sub SolCannon(Enabled)
If Enabled Then
PlaySoundAt SoundFX("CannoShot", DOFContactors),light41
Cannon_Plunger.PlayAnim 0, 1
If NOT IsEmpty(BallInGun) AND Gpos < 100 Then
Sw45.kick GPos-90, 45
Controller.switch(45) = 0
BallInGun = Empty
End If
End If
End Sub
'************************************************************************
' BAND MEMBERS MECH
'************************************************************************
Dim LegRotRadius,LegCase,LegShake
LegRotRadius = SQR((Figure_AngusLeg.X - Supp_Angus.X)^2 + (Figure_AngusLeg.Z - Supp_Angus.Z)^2)
LegShake = 0
Sub SolBandMembers(enabled)
If Enabled Then
Flipper1.TimerInterval = 10
Flipper1.TimerEnabled = 1
Flipper1.RotateToEnd
Flipper2.RotateToEnd
LegShake = 0: PlaySoundAtVol SoundFX("fx_solon", DOFContactors),light31,2
End If
End Sub
Sub Flipper1_timer
SolPlung.TransX = Flipper2.currentangle
Supp_Angus.RotY = Flipper1.currentangle
Supp_Malcolm.RotY = Flipper1.currentangle
Supp_Brian.RotY = Flipper1.currentangle
Supp_Cliff.RotY = Flipper1.currentangle
Figure_Angus.RotY = Flipper1.currentangle
Figure_AngusLeg.X = Supp_Angus.X + LegRotRadius * Sin((Supp_Angus.RotY)*Pi/180)
Figure_AngusLeg.Z = Supp_Angus.Z + LegRotRadius * Cos((Supp_Angus.RotY)*Pi/180)
Figure_Malcolm.RotY = Flipper1.currentangle
Figure_Brian.RotY = Flipper1.currentangle
Figure_Cliff.RotY = Flipper1.currentangle
Figure_DrumL.RotY = Flipper2.currentangle
Figure_DrumR.RotY = -Flipper2.currentangle
If Supp_Angus.RotY > 10 Then LegCase = 1: Flipper2.TimerInterval= 10: Flipper2.TimerEnabled= 1
If Supp_Angus.RotY = 35 Then Flipper1.RotateToStart: Flipper2.RotateToStart
If Supp_Angus.RotY = 0 Then Me.TimerEnabled = 0
End Sub
Sub Flipper2_timer
Select Case LegCase
Case 1
Figure_AngusLeg.RotY = Figure_AngusLeg.RotY - 10
If Figure_AngusLeg.RotY < -50 Then LegCase = 2
Case 2
LegShake = LegShake + 0.05
Figure_AngusLeg.RotY = Figure_AngusLeg.RotY + 3 * Sin(LegShake)
If LegShake > 1.25 Then Me.TimerEnabled = 0: Figure_AngusLeg.RotY = 0: LegShake = 0
End Select
End Sub
'************************************************************************
' T.N.T. DETONATOR
'************************************************************************
Dim detDir
Sub SolDetonator(enabled)
If Enabled Then
PlaySoundAt SoundFX(SSolenoidOn,DOFContactors),light7
DetonatorTimer.Enabled=1
detDir=1
End If
End Sub
Sub DetonatorTimer_Timer
Detonator.Z= Detonator.Z - 2 * detDir
' If Detonator.Z <= 120 AND detDir=1 Then detDir=-1
' If Detonator.Z >= 150 AND detDir=-1 Then Me.Enabled= 0
If Detonator.Z <= 12 AND detDir=1 Then detDir=-1 'z=55 all the way up z=12 all the way down
If Detonator.Z >= 55 AND detDir=-1 Then Me.Enabled= 0
End Sub
'************************************************************************
' BELL SWINGING ANIMATION
'************************************************************************
' Bell scripting includes two fake balls : One in a circular cage (CageBall), one on the playfield for collision (ColBall)
dim CageBall, BellTheta, BellY
dim ColBall : dim ColBallExists : ColBallExists = False
dim CageHeight : CageHeight = BellCage_610h.z ' To adjust height of cage, change height of this primitive and the wall "BellCageHeight"
dim BellRadius: BellRadius = 224.2836762
dim Bell_DebugOn : Bell_DebugOn = False ' If true, keeps ColBall visible and in position all the time
dim Bell_Mass : Bell_Mass = 1.6
Sub SetMass(mass) 'DEBUG COMMAND: tweak mass of bell in debugger
Bell_Mass = mass