forked from LegendsUnchained/vpx-standalone-alp4k
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSimpsons (Data East 1990)_drakkon(mod_1.1).vbs
3321 lines (2769 loc) · 122 KB
/
Simpsons (Data East 1990)_drakkon(mod_1.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
'******************************************
'
' Simpsons (Data East) 1990 - created by 32assassin
'
'******************************************
'
' drakkon 1.1 mod, built from Bigus(MOD) 2.0, original table created by 32assassin
'
' 1.0 Updates - Initial Release:
' -nFozzy physics
' -Fleep mechanical sounds
'
' 1.1 Updates:
' -Tweaked kickback, made stronger
' -Added LUT selection
' -Added Simpsons rule card to apron
' -Set Nuclear Power Plant bumper primitive to original height
'
'*******************************************
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
'----- General Sound Options -----
Const VolumeDial = 1 'Overall Mechanical sound effect volume. Recommended values should be no greater than 1, default 0.8.
Const BallRollVolume = 1 'Level of ball rolling volume. Value between 0 and 1, default 0.5
Const RampRollVolume = 1 'Level of ramp rolling volume. Value between 0 and 1, default 0.5
'----- Target Bouncer ------------
Const TargetBouncerEnabled = 1 '0 = normal standup targets, 1 = bouncy targets - *turn off if ball frequenctly jumps out of playfield
Const TargetBouncerFactor = 0.7 'Level of bounces. Recommmended value of 0.7
'----- 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
'*********** Set the default LUT set *********************************
'You can change LUT option within game with left and right CTRL keys
Dim LUTset, DisableLUTSelector, LutToggleSound
LoadLUT
'LUTset = 11 'override saved LUT for debug
SetLUT
DisableLUTSelector = 0 ' Disables the ability to change LUT option with magna saves in game when set to 1
LutToggleSound = 1 ' Enables sound when changing LUT lighting. Switch to 0 to disable.
'LUTset Types:
'-1 = Simpsons Original (Additional selection to this table)
'0 = Fleep Natural Dark 1
'1 = Fleep Natural Dark 2
'2 = Fleep Warm Dark
'3 = Fleep Warm Bright
'4 = Fleep Warm Vivid Soft
'5 = Fleep Warm Vivid Hard
'6 = Skitso Natural and Balanced
'7 = Skitso Natural High Contrast
'8 = 3rdaxis Referenced THX Standard
'9 = CalleV Punchy Brightness and Contrast
'10 = TT & Ninuzzu Original
'11 = VPW Orig
'12 = VPW LUT1on1
'13 = VPW LUTbassgeige1
'14 = VPW LUTblacklight
Const BallSize = 50 'Ball size must be 50
Const BallMass = 1 'Ball mass must be 1
Const tnob = 5 'Total number of balls
Const lob = 0 'Locked balls
Dim tablewidth: tablewidth = Table1.width
Dim tableheight: tableheight = Table1.height
Dim BIPL : BIPL = False 'Ball in plunger lane
Const cGameName="simp_a27"
Const UseSolenoids=2
Const UseLamps=0
Const UseGI=0
Const SSolenoidOn=""'SolOn"
Const SSolenoidOff=""'SolOff"
Const SCoin=""
LoadVPM "01000200", "DE.VBS", 3.36
Dim DesktopMode: DesktopMode = Table1.ShowDT
Dim ShowBlades: ShowBlades = True 'always show blades, cabinet and desktop
If DesktopMode = True or ShowBlades Then 'Show Desktop components
Ramp16.visible=1
Ramp15.visible=1
Primitive13.visible=1
Else
Ramp16.visible=0
Ramp15.visible=0
Primitive13.visible=0
End if
'*************************************************************
'Solenoid Call backs
'**********************************************************************************************************
Solcallback(1) = "SetLamp 101," '1A
Solcallback(2) = "SetLamp 102," '2A
Solcallback(3) = "SetLamp 103," '3A
Solcallback(4) = "SetLamp 104," '4A
Solcallback(5) = "SetLamp 105," '5A
Solcallback(6) = "SetLamp 106," '6A
SolCallback(7) = "SetLamp 107," '7A
'SolCallback(8) = "SetLamp 108," '8A Backglass only
Solcallback(9) = "SetLamp 109," '9A
solcallback(11) = "PFGI"
SolCallback(12) = "SetLamp 112,"
SolCallback(13) = "SetLamp 113,"
SolCallback(14) = "SetLamp 114,"
SolCallback(15) = "SetLamp 115,"
SolCallBack(16) = "kicksaver"
SolCallback(22) = "dtrDropSolDropUp" 'Drop Targets
SolCallback(25) = "bsTrough.SolIn"
SolCallback(26) = "bsTrough.SolOut"
Solcallback(27) = "bsSaucer.solout"
solcallback(28) = "sw29Pop"
Solcallback(30) = "sw37Pop"
SolCallback(31) = "dtcDropSolDropUp" 'Drop Targets
SolCallback(32) = "SolKnocker"
SolCallback(sLRFlipper) = "SolRFlipper"
SolCallback(sLLFlipper) = "SolLFlipper"
Sub SolKnocker(Enabled)
If Enabled Then KnockerSolenoid
End Sub
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
'**********************************************************************************************************
'Solenoid Controlled toys
'**********************************************************************************************************
Sub kicksaver(Enabled)
If Enabled Then
Plunger1.fire
PlaySoundAtLevelStatic ("KickBack"), PlungerReleaseSoundLevel, Plunger1
Else
Plunger1.pullback
End If
End Sub
dim gilvl:gilvl = 1 'General Illumination light state tracked for Dynamic Ball Shadows
'Playfield GI
Sub PFGI(Enabled)
If Enabled Then
dim xx
For each xx in GI:xx.State = 0: Next
PlaySoundAtLevelStatic "Relay_On", 1, RelayPosition
gilvl = 1
Else
For each xx in GI:xx.State = 1: Next
PlaySoundAtLevelStatic "Relay_Off", 1, RelayPosition
gilvl = 0
End If
End Sub
'**********************************************************************************************************
'Initiate Table
'**********************************************************************************************************
Dim bsTrough, bsSaucer, dtCDrop, dtRDrop
Sub Table1_Init
vpmInit Me
On Error Resume Next
With Controller
.GameName = cGameName
If Err Then MsgBox "Can't start Game" & cGameName & vbNewLine & Err.Description : Exit Sub
.SplashInfoLine = "The Simpsons (Data East 1990)"&chr(13)&"You Suck"
.HandleMechanics=0
.HandleKeyboard=0
.ShowDMDOnly=1
.ShowFrame=0
.ShowTitle=0
.hidden = 0
On Error Resume Next
.Run GetPlayerHWnd
If Err Then MsgBox Err.Description
On Error Goto 0
End With
On Error Goto 0
PinMAMETimer.Interval=PinMAMEInterval
PinMAMETimer.Enabled=1
vpmNudge.TiltSwitch=1
vpmNudge.Sensitivity=2
vpmNudge.TiltObj=Array(Bumper1,Bumper2,Bumper3,LeftSlingshot,RightSlingshot)
Set bsTrough = New cvpmBallStack
bsTrough.InitSw 10,11,12,13,0,0,0,0
bsTrough.InitKick BallRelease, 70, 10
bsTrough.Balls = 3
Set bsSaucer = new cvpmBallStack
'bsSaucer.KickForceVar = 4
bsSaucer.InitSaucer Sw28, 28, 140, 12
Set dtCDrop = new cvpmDropTarget
dtCDrop.Initdrop Array(Sw33,Sw34,Sw35), Array(33,34,35)
Set dtRDrop = new cvpmDropTarget
dtRDrop.Initdrop Array(Sw41,Sw42,Sw43,Sw44,Sw45), Array(41,42,43,44,45)
Plunger1.pullback
End sub
Sub Table1_Exit()
SaveLUT
Controller.Pause = False
Controller.Stop
End Sub
Sub GameTimer_Timer()
Cor.Update 'update ball tracking (this sometimes goes in the RDampen_Timer sub)
RollingUpdate 'update rolling sounds
'DoDTAnim 'handle drop target animations
'DoSTAnim 'handle stand up target animations
End Sub
Sub FrameTimer_Timer()
If DynamicBallShadowsOn Or AmbientBallShadowOn Then DynamicBSUpdate 'update ball shadows
End Sub
'**********************************************************************************************************
'Plunger code
'**********************************************************************************************************
Sub Table1_KeyDown(ByVal KeyCode)
If keycode = LeftFlipperKey Then Controller.Switch(15) = False End If
If keycode = RightFlipperKey Then Controller.Switch(16) = False End If
'** nFozzy - begin
If keycode = LeftFlipperKey Then FlipperActivate LeftFlipper, LFPress
If keycode = RightFlipperKey Then FlipperActivate RightFlipper, RFPress
'** nFozzy - end
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 = 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 = PlungerKey Then Plunger.PullBack:SoundPlungerPull
If keycode = StartGameKey Then SoundStartButton
LUTSelectionKeyDown(Keycode)
If KeyDownHandler(keycode) Then Exit Sub
End Sub
Sub Table1_KeyUp(ByVal KeyCode)
If keycode = LeftFlipperKey Then Controller.Switch(15) = True End If
If keycode = RightFlipperKey Then Controller.Switch(16) = True End If
'** nFozzy - begin
If keycode = LeftFlipperKey Then FlipperDeActivate LeftFlipper, LFPress
If keycode = RightFlipperKey Then FlipperDeActivate RightFlipper, RFPress
'** nFozzy - end
If keycode = PlungerKey Then
Plunger.Fire
If BIPL Then
SoundPlungerReleaseBall()
Else
SoundPlungerReleaseNoBall()
End If
End If
If KeyUpHandler(keycode) Then Exit Sub
End Sub
'**********************************************************************************************************
' Drain hole and kickers
Sub Drain_Hit:bsTrough.addball me : RandomSoundDrain Drain : End Sub
Sub Sw28_Hit: SoundSaucerLock : bsSaucer.AddBall 0 : End Sub
Sub Sw28_UnHit: SoundSaucerKick 1, Sw28 : End Sub
Sub BallRelease_Unhit : RandomSoundBallRelease BallRelease : End Sub
'***********************************
'sw29 Raising VUK
'***********************************
'Variables used for VUK
Dim raiseballsw, raiseball
Sub sw29_Hit()
sw29.Enabled=FALSE
Controller.switch (29) = True
SoundSaucerLock
End Sub
Sub sw29Pop(enabled)
if(enabled and Controller.switch (29)) then
SoundSaucerKick 1, Sw29
sw29.DestroyBall
Set raiseball = sw29.CreateBall
raiseballsw = True
sw29raiseballtimer.Enabled = True 'Added by Rascal
sw29.Enabled=TRUE
Controller.switch (29) = False
else
end if
End Sub
Sub sw29raiseballtimer_Timer()
If raiseballsw = True then
raiseball.z = raiseball.z + 10
If raiseball.z > 190 then
sw29.Kick 145, 10
Set raiseball = Nothing
sw29raiseballtimer.Enabled = False
raiseballsw = False
End If
End If
End Sub
'***********************************
'sw37 Raising VUK
'***********************************
'Variables used for VUK
Dim raise1ballsw, raise1ball
Sub sw37_Hit()
sw37.Enabled=FALSE
Controller.switch (37) = True
SoundSaucerLock
End Sub
Sub sw37Pop(enabled)
if(enabled and Controller.switch (37)) then
SoundSaucerKick 1, Sw37
sw37.DestroyBall
Set raise1ball = sw37.CreateBall
raise1ballsw = True
sw37raiseballtimer.Enabled = True 'Added by Rascal
sw37.Enabled=TRUE
Controller.switch (37) = False
end if
End Sub
Sub sw37raiseballtimer_Timer()
If raise1ballsw = True then
raise1ball.z = raise1ball.z + 10
If raise1ball.z > 210 then
sw37.Kick 90, 10
Set raise1ball = Nothing
sw37raiseballtimer.Enabled = False
raise1ballsw = False
End If
End If
End Sub
'***********************************
'***********************************
'Drop Targets
Sub Sw33_Dropped:dtcDropHit 1 :End Sub
Sub Sw34_Dropped:dtcDropHit 2 :End Sub
Sub Sw35_Dropped:dtcDropHit 3 :End Sub
Sub Sw41_Dropped:dtrDropHit 1 :End Sub
Sub Sw42_Dropped:dtrDropHit 2 :End Sub
Sub Sw43_Dropped:dtrDropHit 3 :End Sub
Sub Sw44_Dropped:dtrDropHit 4 :End Sub
Sub Sw45_Dropped:dtrDropHit 5 :End Sub
Sub DropTargets_Hit(idx): TargetBouncer ActiveBall, 1: End Sub
Sub dtcDropHit(Index)
dtcDrop.Hit Index
' use center switch as sound position
PlaySoundAtLevelStatic "DropTarget_Down", 1, Sw34
End Sub
Sub dtrDropHit(Index)
dtrDrop.Hit Index
' use center switch as sound position
PlaySoundAtLevelStatic "DropTarget_Down", 1, Sw43
End Sub
Sub dtCDropSolDropUp(Enabled)
If Enabled Then
' use center switch as sound position
PlaySoundAtLevelStatic "DropTarget_Up", 1, Sw34
End If
dtCDrop.SolDropUp(Enabled)
End Sub
Sub dtrDropSolDropUp(Enabled)
If Enabled Then
' use center switch as sound position
PlaySoundAtLevelStatic "DropTarget_Up", 1, Sw43
End If
dtrDrop.SolDropUp(Enabled)
End Sub
'Wire Triggers
' Plunger ball switch
Sub SW14_Hit:Controller.Switch(14)=1 : BIPL = True End Sub
Sub SW14_unHit:Controller.Switch(14)=0: BIPL = False End Sub
Sub SW17_Hit:Controller.Switch(17)=1 : End Sub
Sub SW17_unHit:Controller.Switch(17)=0:End Sub
Sub SW18_Hit:Controller.Switch(18)=1 : End Sub
Sub SW18_unHit:Controller.Switch(18)=0:End Sub
Sub SW19_Hit:Controller.Switch(19)=1 : End Sub
Sub SW19_unHit:Controller.Switch(19)=0:End Sub
Sub SW20_Hit:Controller.Switch(20)=1 : End Sub
Sub SW20_unHit:Controller.Switch(20)=0:End Sub
Sub SW30_Hit:Controller.Switch(30)=1 : End Sub
Sub SW30_unHit:Controller.Switch(30)=0:End Sub
Sub SW49_Hit:Controller.Switch(49)=1 : End Sub
Sub SW49_unHit:Controller.Switch(49)=0:End Sub
Sub SW50_Hit:Controller.Switch(50)=1 : End Sub
Sub SW50_unHit:Controller.Switch(50)=0:End Sub
Sub SW51_Hit:Controller.Switch(51)=1 : End Sub
Sub SW51_unHit:Controller.Switch(51)=0:End Sub
'Stand Up Targets
Sub sw25_hit:OnSTHit 25: End Sub
Sub sw26_hit:OnSTHit 26: End Sub
Sub sw27_hit:OnSTHit 27: End Sub
Sub OnSTHit(sw)
vpmTimer.pulseSw 25: TargetBouncer ActiveBall, 1
End Sub
'Spinners
Sub sw36_Spin:vpmTimer.PulseSw 36 : SoundSpinner Sw36 : End Sub
'Ramp Gate Triggers
Sub sw38_hit: vpmTimer.pulseSw 38 : End Sub
Sub sw39_hit: vpmTimer.pulseSw 39 : End Sub
'Bumpers
Sub Bumper1_Hit : vpmTimer.PulseSw 46 : Sw46p.transz = +10 : Me.TimerEnabled = 1 : RandomSoundBumperTop Bumper1: End Sub
Sub Bumper1_Timer : Sw46p.transz = 0 : Me.TimerEnabled = 0 : End Sub
Sub Bumper2_Hit : vpmTimer.PulseSw 47 : Sw47p.transz = +10 : Me.TimerEnabled = 1 : RandomSoundBumperMiddle Bumper2: End Sub
Sub Bumper2_Timer : Sw47p.transz = 0 : Me.TimerEnabled = 0 : End Sub
Sub Bumper3_Hit : vpmTimer.PulseSw 48 : Sw48p.transz = +10 : Me.TimerEnabled = 1 : RandomSoundBumperBottom Bumper3: End Sub
Sub Bumper3_Timer : Sw48p.transz = 0 : Me.TimerEnabled = 0 : End Sub
Sub Trigger5_Hit: WireRampOn False: End Sub
Sub Trigger1_Hit: WireRampOff: End Sub
Sub RampOnTrigger_Hit: WireRampOn True: End Sub
Sub Trigger3_Hit: WireRampOff: RandomSoundRubberWeak: End Sub
Sub Trigger4_Hit: WireRampOn False: End Sub
Sub Trigger2_Hit: WireRampOff: End Sub
Sub WireToRampDropTrigger_Hit: RandomSoundBallBouncePlayfieldSoft ActiveBall : WireRampOn True: End Sub
Sub LeftFlipper_Collide(parm)
CheckLiveCatch Activeball, LeftFlipper, LFCount, parm
LeftFlipperCollide parm
End Sub
Sub RightFlipper_Collide(parm)
CheckLiveCatch Activeball, RightFlipper, RFCount, parm
RightFlipperCollide parm
End Sub
'***************************************************
' 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)
InitLamps() ' turn off the lights and flashers and reset them to the default parameters
LampTimer.Interval = 5 'lamp fading speed
LampTimer.Enabled = 1
' Lamp & Flasher Timers
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
'Special Handling
'If chgLamp(ii,0) = 2 Then solTrough chgLamp(ii,1)
'If chgLamp(ii,0) = 4 Then PFGI chgLamp(ii,1)
Next
End If
UpdateLamps
End Sub
Sub UpdateLamps()
NFadeLm 1, L1 'Left Bumper
NFadeL 1, L1a
NFadeLm 2, L2 'Lower Bumper Tower
NFadeL 2, L2a
NFadeLm 3, L3 'Right Bumper Tower
NFadeL 3, L3a
NFadeL 4, L4
NFadeL 5, L5
NFadeL 6, L6
NFadeL 7, L7
NFadeL 8, L8
NFadeL 9, L9
NFadeL 10, L10
NFadeL 11, L11
' NFadeL 12, L12
NFadeL 13, L13
NFadeL 14, L14
NFadeL 15, L15
NFadeL 16, L16
Flash 17, F17 'BackWall Millions
Flash 18, F18 'BackWall Millions
Flash 19, F19 'BackWall Millions
Flash 20, F20 'BackWall Millions
Flash 21, F21 'BackWall Millions
Flash 22, F22 'BackWall Millions
Flash 23, F23 'BackWall Millions
Flash 24, F24 'BackWall Millions
NFadeL 25, L25
NFadeL 26, L26
NFadeL 27, L27
NFadeL 28, L28
NFadeL 29, L29
NFadeL 30, L30
NFadeL 31, L31
NFadeL 32, L32
NFadeL 33, L33
NFadeL 34, L34
NFadeL 35, L35
NFadeL 36, L36
NFadeL 37, L37
NFadeL 38, L38
NFadeL 39, L39
NFadeL 40, L40
NFadeL 41, L41
NFadeL 42, L42
NFadeL 43, L43
NFadeL 44, L44
NFadeObjm 49, P49, "bulbcover1_redON", "bulbcover1_red"
Flash 49, F49 ' Ramp LED
NFadeL 50, L50
NFadeObjm 51, P51, "bulbcover1_greenON", "bulbcover1_green"
Flash 51, F51 ' Ramp LED
NFadeL 52, L52
NFadeL 55, L55
NFadeL 56, L56
NFadeL 57, L57
NFadeL 58, L58
NFadeL 59, L59
NFadeL 60, L60
NFadeL 61, L61
NFadeL 62, L62
NFadeL 63, L63
NFadeL 64, L64
'Solenoid Controlled Lights
NFadeL 101, S101
NFadeL 102, S102
NFadeObjm 103, P103, "dome2_0_yellowON", "dome2_0_yellow"
NFadeLm 103, S103a
NFadeL 103, S103
NFadeObjm 104, P104, "dome2_0_yellowON", "dome2_0_yellow"
NFadeLm 104, S104a
NFadeL 104, S104
NFadeObjm 105, P105, "dome2_0_redON", "dome2_0_red"
NFadeLm 105, S105a
NFadeL 105, S105
NFadeObjm 106, P106, "dome2_0_yellowON", "dome2_0_yellow"
NFadeLm 106, S106a
NFadeL 106, S106
NFadeObjm 107, P107, "dome2_0_redON", "dome2_0_red"
NFadeLm 107, S107a
NFadeL 107, S107
NFadeL 108, S108
NFadeLm 109, S109
NFadeLm 109, S109a
NFadeL 109, S109b
NFadeLm 112, S112
NFadeLm 112, S112a
NFadeL 112, S112b
NFadeL 113, S113
NFadeLm 114, S114a
NFadeLm 114, S114b
Flash 114, S114c 'Backwall
NFadeLm 115, S115a
NFadeLm 115, S115b
NFadeLm 115, S115c
NFadeL 115, S115d
End Sub
' div lamp subs
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.4 ' faster speed when turning on the flasher
FlashSpeedDown(x) = 0.2 ' 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 AllLampsOff
Dim x
For x = 0 to 200
SetLamp x, 0
Next
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
End Sub
'Lights, Ramps & Primitives used as 4 step fading lights
'a,b,c,d are the images used from on to off
Sub FadeObj(nr, object, a, b, c, d)
Select Case FadingLevel(nr)
Case 4:object.image = b:FadingLevel(nr) = 6 'fading to off...
Case 5:object.image = a:FadingLevel(nr) = 1 'ON
Case 6, 7, 8:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
Case 9:object.image = c:FadingLevel(nr) = FadingLevel(nr) + 1 'fading...
Case 10, 11, 12:FadingLevel(nr) = FadingLevel(nr) + 1 'wait
Case 13:object.image = d:FadingLevel(nr) = 0 'Off
End Select
End Sub
Sub FadeObjm(nr, object, a, b, c, d)
Select Case FadingLevel(nr)
Case 4:object.image = b
Case 5:object.image = a
Case 9:object.image = c
Case 13:object.image = d
End Select
End Sub
Sub NFadeObj(nr, object, a, b)
Select Case FadingLevel(nr)
Case 4:object.image = b:FadingLevel(nr) = 0 'off
Case 5:object.image = a:FadingLevel(nr) = 1 'on
End Select
End Sub
Sub NFadeObjm(nr, object, a, b)
Select Case FadingLevel(nr)
Case 4:object.image = b
Case 5:object.image = a
End Select
End Sub
' Flasher objects
Sub Flash(nr, object)
Select Case FadingLevel(nr)
Case 4 'off
FlashLevel(nr) = FlashLevel(nr) - FlashSpeedDown(nr)
If FlashLevel(nr) < FlashMin(nr) Then
FlashLevel(nr) = FlashMin(nr)
FadingLevel(nr) = 0 'completely off
End if
Object.IntensityScale = FlashLevel(nr)
Case 5 ' on
FlashLevel(nr) = FlashLevel(nr) + FlashSpeedUp(nr)
If FlashLevel(nr) > FlashMax(nr) Then
FlashLevel(nr) = FlashMax(nr)
FadingLevel(nr) = 1 'completely on
End if
Object.IntensityScale = FlashLevel(nr)
End Select
End Sub
Sub Flashm(nr, object) 'multiple flashers, it just sets the flashlevel
Object.IntensityScale = FlashLevel(nr)
End Sub
'**********************************************************************************************************
'Digital Display
'**********************************************************************************************************
Dim Digits(32)
Digits(0)=Array(a00, a05, a0c, a0d, a08, a01, a06, a0f, a02, a03, a04, a07, a0b, a0a, a09, a0e)
Digits(1)=Array(a10, a15, a1c, a1d, a18, a11, a16, a1f, a12, a13, a14, a17, a1b, a1a, a19, a1e)
Digits(2)=Array(a20, a25, a2c, a2d, a28, a21, a26, a2f, a22, a23, a24, a27, a2b, a2a, a29, a2e)
Digits(3)=Array(a30, a35, a3c, a3d, a38, a31, a36, a3f, a32, a33, a34, a37, a3b, a3a, a39, a3e)
Digits(4)=Array(a40, a45, a4c, a4d, a48, a41, a46, a4f, a42, a43, a44, a47, a4b, a4a, a49, a4e)
Digits(5)=Array(a50, a55, a5c, a5d, a58, a51, a56, a5f, a52, a53, a54, a57, a5b, a5a, a59, a5e)
Digits(6)=Array(a60, a65, a6c, a6d, a68, a61, a66, a6f, a62, a63, a64, a67, a6b, a6a, a69, a6e)
Digits(7)=Array(a70, a75, a7c, a7d, a78, a71, a76, a7f, a72, a73, a74, a77, a7b, a7a, a79, a7e)
Digits(8)=Array(a80, a85, a8c, a8d, a88, a81, a86, a8f, a82, a83, a84, a87, a8b, a8a, a89, a8e)
Digits(9)=Array(a90, a95, a9c, a9d, a98, a91, a96, a9f, a92, a93, a94, a97, a9b, a9a, a99, a9e)
Digits(10)=Array(aa0, aa5, aac, aad, aa8, aa1, aa6, aaf, aa2, aa3, aa4, aa7, aab, aaa, aa9, aae)
Digits(11)=Array(ab0, ab5, abc, abd, ab8, ab1, ab6, abf, ab2, ab3, ab4, ab7, abb, aba, ab9, abe)
Digits(12)=Array(ac0, ac5, acc, acd, ac8, ac1, ac6, acf, ac2, ac3, ac4, ac7, acb, aca, ac9, ace)
Digits(13)=Array(ad0, ad5, adc, add, ad8, ad1, ad6, adf, ad2, ad3, ad4, ad7, adb, ada, ad9, ade)
Digits(14)=Array(ae0, ae5, aec, aed, ae8, ae1, ae6, aef, ae2, ae3, ae4, ae7, aeb, aea, ae9, aee)
Digits(15)=Array(af0, af5, afc, afd, af8, af1, af6, aff, af2, af3, af4, af7, afb, afa, af9, afe)
Digits(16)=Array(b00, b05, b0c, b0d, b08, b01, b06, b0f, b02, b03, b04, b07, b0b, b0a, b09, b0e)
Digits(17)=Array(b10, b15, b1c, b1d, b18, b11, b16, b1f, b12, b13, b14, b17, b1b, b1a, b19, b1e)
Digits(18)=Array(b20, b25, b2c, b2d, b28, b21, b26, b2f, b22, b23, b24, b27, b2b, b2a, b29, b2e)
Digits(19)=Array(b30, b35, b3c, b3d, b38, b31, b36, b3f, b32, b33, b34, b37, b3b, b3a, b39, b3e)
Digits(20)=Array(b40, b45, b4c, b4d, b48, b41, b46, b4f, b42, b43, b44, b47, b4b, b4a, b49, b4e)
Digits(21)=Array(b50, b55, b5c, b5d, b58, b51, b56, b5f, b52, b53, b54, b57, b5b, b5a, b59, b5e)
Digits(22)=Array(b60, b65, b6c, b6d, b68, b61, b66, b6f, b62, b63, b64, b67, b6b, b6a, b69, b6e)
Digits(23)=Array(b70, b75, b7c, b7d, b78, b71, b76, b7f, b72, b73, b74, b77, b7b, b7a, b79, b7e)
Digits(24)=Array(b80, b85, b8c, b8d, b88, b81, b86, b8f, b82, b83, b84, b87, b8b, b8a, b89, b8e)
Digits(25)=Array(b90, b95, b9c, b9d, b98, b91, b96, b9f, b92, b93, b94, b97, b9b, b9a, b99, b9e)
Digits(26)=Array(ba0, ba5, bac, bad, ba8, ba1, ba6, baf, ba2, ba3, ba4, ba7, bab, baa, ba9, bae)
Digits(27)=Array(bb0, bb5, bbc, bbd, bb8, bb1, bb6, bbf, bb2, bb3, bb4, bb7, bbb, bba, bb9, bbe)
Digits(28)=Array(bc0, bc5, bcc, bcd, bc8, bc1, bc6, bcf, bc2, bc3, bc4, bc7, bcb, bca, bc9, bce)
Digits(29)=Array(bd0, bd5, bdc, bdd, bd8, bd1, bd6, bdf, bd2, bd3, bd4, bd7, bdb, bda, bd9, bde)
Digits(30)=Array(be0, be5, bec, bed, be8, be1, be6, bef, be2, be3, be4, be7, beb, bea, be9, bee)
Digits(31)=Array(bf0, bf5, bfc, bfd, bf8, bf1, bf6, bff, bf2, bf3, bf4, bf7, bfb, bfa, bf9, bfe)
Sub DisplayTimer_Timer
Dim ChgLED, ii, jj, num, chg, stat, obj, b, x
ChgLED=Controller.ChangedLEDs(&Hffffffff, &Hffffffff)
If Not IsEmpty(ChgLED)Then
If DesktopMode = True Then
For ii=0 To UBound(chgLED)
num=chgLED(ii, 0) : chg=chgLED(ii, 1) : stat=chgLED(ii, 2)
if (num < 32) then
For Each obj In Digits(num)
If chg And 1 Then obj.State=stat And 1
chg=chg\2 : stat=stat\2
Next
Else
end if
Next
end if
End If
End Sub
'**********************************************************************************************************
'**********************************************************************************************************
'*********************************************************************
' Start of VPX Functions
'*********************************************************************\
'**********Sling Shot Animations
' Rstep and Lstep are the variables that increment the animation
'****************
Dim RStep, Lstep
Sub RightSlingShot_Slingshot
vpmTimer.PulseSw 22
RandomSoundSlingshotRight SLING1
RSling.Visible = 0
RSling1.Visible = 1
sling1.TransZ = -20
RStep = 0
RightSlingShot.TimerEnabled = 1
End Sub
Sub RightSlingShot_Timer
Select Case RStep
Case 3:RSLing1.Visible = 0:RSLing2.Visible = 1:sling1.TransZ = -10
Case 4:RSLing2.Visible = 0:RSLing.Visible = 1:sling1.TransZ = 0:RightSlingShot.TimerEnabled = 0
End Select
RStep = RStep + 1
End Sub
Sub LeftSlingShot_Slingshot
vpmTimer.PulseSw 21
RandomSoundSlingshotLeft SLING2
LSling.Visible = 0
LSling1.Visible = 1
sling2.TransZ = -20
LStep = 0
LeftSlingShot.TimerEnabled = 1
End Sub
Sub LeftSlingShot_Timer
Select Case LStep
Case 3:LSLing1.Visible = 0:LSLing2.Visible = 1:sling2.TransZ = -10
Case 4:LSLing2.Visible = 0:LSLing.Visible = 1:sling2.TransZ = 0:LeftSlingShot.TimerEnabled = 0
End Select
LStep = LStep + 1
End Sub
'*****************************************
' ninuzzu's FLIPPER SHADOWS
'*****************************************
sub FlipperTimer_Timer()
FlipperLSh.RotZ = LeftFlipper.currentangle
FlipperRSh.RotZ = RightFlipper.currentangle
LFLogo.RotY = LeftFlipper.CurrentAngle
RFlogo.RotY = RightFlipper.CurrentAngle
End Sub
'******************************************************
' LUT
'******************************************************
Sub SetLUT 'AXS
Table1.ColorGradeImage = "LUT" & LUTset
end sub
Sub LUTBox_Timer
LUTBox.TimerEnabled = 0
LUTBox.Visible = 0
End Sub
Sub ShowLUT
LUTBox.visible = 1
Select Case LUTSet
Case -1: LUTBox.text = "Simpsons Original"
Case 0: LUTBox.text = "Fleep Natural Dark 1"
Case 1: LUTBox.text = "Fleep Natural Dark 2"
Case 2: LUTBox.text = "Fleep Warm Dark"
Case 3: LUTBox.text = "Fleep Warm Bright"
Case 4: LUTBox.text = "Fleep Warm Vivid Soft"
Case 5: LUTBox.text = "Fleep Warm Vivid Hard"
Case 6: LUTBox.text = "Skitso Natural and Balanced"
Case 7: LUTBox.text = "Skitso Natural High Contrast"
Case 8: LUTBox.text = "3rdaxis Referenced THX Standard"
Case 9: LUTBox.text = "CalleV Punchy Brightness and Contrast"
Case 10: LUTBox.text = "TT & Ninuzzu Original"
Case 11: LUTBox.text = "*VPin Workshop Original"
Case 12: LUTBox.text = "1on1"
Case 13: LUTBox.text = "bassgeige"
Case 14: LUTBox.text = "blacklight"
End Select
LUTBox.TimerEnabled = 1
End Sub
Const LUTFileName = "SIMPDE.txt"
Const LUTMinOption = -1
Const LUTDefaultOption = -1
Sub SaveLUT
Dim FileObj
Dim ScoreFile
Set FileObj=CreateObject("Scripting.FileSystemObject")
If Not FileObj.FolderExists(UserDirectory) then
Exit Sub
End if
if LUTset = "" then LUTset = LUTMinOption 'failsafe
Set ScoreFile=FileObj.CreateTextFile(UserDirectory & LUTFileName,True)
ScoreFile.WriteLine LUTset
Set ScoreFile=Nothing
Set FileObj=Nothing
End Sub
Sub LoadLUT
Dim FileObj, ScoreFile, TextStr
dim rLine
Set FileObj=CreateObject("Scripting.FileSystemObject")
If Not FileObj.FolderExists(UserDirectory) then
LUTset=LUTDefaultOption
Exit Sub
End if
If Not FileObj.FileExists(UserDirectory & LUTFileName) then
LUTset=LUTDefaultOption
Exit Sub
End if
Set ScoreFile=FileObj.GetFile(UserDirectory & LUTFileName)
Set TextStr=ScoreFile.OpenAsTextStream(1,0)
If (TextStr.AtEndOfStream=True) then
Exit Sub
End if
rLine = TextStr.ReadLine
If rLine = "" then
LUTset=LUTDefaultOption
Exit Sub
End if
LUTset = int (rLine)
Set ScoreFile = Nothing
Set FileObj = Nothing
End Sub
Sub LUTSelectionKeyDown(ByVal Keycode)
If keycode = RightMagnaSave Then 'AXS 'Fleep
if DisableLUTSelector = 0 then
If LutToggleSound Then
Playsound "Click"
End If
LUTSet = LUTSet + 1
if LutSet > 14 then LUTSet = LUTMinOption