forked from LegendsUnchained/vpx-standalone-alp4k
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHook (Data East 1992) VPW.vbs
4128 lines (3463 loc) · 140 KB
/
Hook (Data East 1992) VPW.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
'Hook (Data East) 1992 by Javier - VPin Workshop MOD
'
'*****************************************
' VPin Workshop Revisions
'*****************************************
'011 - Benji - Added nfPX 1.6 (iaakki variable live catch stuff)
'014 - iaakki - Insert done.. New PF with cutouts not having AO baked in. AO flasher needed?
'015 - sixtoe - VR stuff put in, changed and aligned loads of primitives and lights, cut holes in playfield and dropped woodsides, added missing top right rubber, changed skull prim and ramp to come out it's mouth, unified timers, hooked up town to GI system and deleted some lights, lowered and reshaped some GI, changed VUK holes (cosmetic), modifided top right ramp texture to remove hole.
'016 - Sixtoe - Added new plastics for slingshots from Sheltemke, colour corrected some plastics and realigned screws and slingshot plastics in general, few other minor tweaks.
'017 - Added shadows to updatd playfield with cutouts
'018 - iaakki - PF alpha mask value changed, NF flips code update started
'019 - iaakki - nf code continued and did some testing. flip physics values changed to new nf values
'020 - iaakki - some fleep sounds done
'024 - iaakki - "fixed" left ramp. Flips at 3400 now.
'025 - iaakki - Skillshot plunger lane reworked with new decals. Some brackets needed.
'026 - iaakki - flip angles changed, diverter animated, realigning lights
'027 - iaakki - new laneguides and realigned flips and guides. Physics fixed --> plunger is too strong now
'028 - iaakki - gi lights fading code added, GI LUT change removed --> gi needs some work
'029 - iaakki - laneguides rework, Wall63 rework, Rubber1 realigned, Wall002 metal added on right, Wall17 reworked, inlane ramp objects removed, pf metals tied to gi
'030 - iaakki - skull flasher finally found and experimental dual primitive fading DL lighting implemented
'032 - iaakki - missing rubberbands, posts etc. Adjustments, Flupper dome added and adjusted, some bloom to skull added
'034 - iaakki - messing with lights and including primitives to fading GI and other lights. Top laneguides tuned, bumper top plastics tied to lights. Transmit values reduced a lot.
'035 - iaakki - ballinsub check added and sounds are now correct for sw48, ball drop sounds fixed, plungerlane sounds created, arch sounds connected, droptarget sounds, upper vuk saucer
'036 - iaakki - ledrope adjusted to be more VR friendly, pirate town reworked a bit, 3b and 4b flasher adjusted
'037 - iaakki - gi rework, normal inserts adjusted and fading speeds reduced a lot, minor tweaks to flashes
'038 - skitso - New LUT, fixed skull and lower PF GI, HDR ball, better scratches, fixed skull eyes...
'039 - iaakki - 3 missing plastics added, flupper inserts dimmed
'040 - iaakki - outlane and sling plastics redone
'041 - iaakki - adjusted lots of lights and plastics, changed some primitives and materials, fixed textures for VR
'042 - iaakki - Added right plastic neas plunger lane, fixed some insert fading speeds
'043 - iaakki - More plastics on the left side
'045 - skitso - Some inserts reworked
'045 - skitso - GI and material adjust for targets. PF hole red glow adjusted
'047 - iaakki - some wall sounds, plungerlane fix for lost ball, wind coaster plastic done and its bulb adjusted, 4B and 3B flashers redone
'048 - tomate - new 4k texture for apron and instruction cards, some tweaks on plunger cover texture
'049 - iaakki - baseball jackpot plastic added, Flip start angles changed, slope to 5.8, laneguide physics change, right scoop reworked, laserkicker adjusted along with the wall, some screws added. gi fading function change
'050 - sixtoe - redid all the above playfield bulbs and lighting, added flipper shadows, adjusted top right flasher
'051 - iaakki - gate added at the top, Flip parameters reverted and left ramp hacks removed, shot to right orb made slightly easier by moving rubber bands to right
'052 - sixtoe - fixed vr issues, fixed top right ramp issues, more lighting adjustments, stopped skull flasher clipping through targets,
'053 - iaakki - few screws and some plastics
'054 - iaakki - and more..
'056 - iaakki - left ramp entrance changed, skull repositioned and adjusted, skull texture fixed
'057 - tomate - new plastics prims added, new right wireRamp prim added, skull and ropeLight repositioned, lowPoly ramps added at Layer10
'058 - iaakki - realigned various lights and bulbs in plungerlane and led tube.Fixed skillshot 2.
'059 - iaakki - left ramp recreated with vpx ramps.Collidable plungerlane is now disabled. One needs to make full plunge to be able to get ball into game.
'060 - iaakki - led tube led heights adjusted. Plunger lane and right ramp LP's replaced.
'061 - iaakki - diverter primitive redone, Wall004 added for ball stuck, few ramps adjusted, pf friction 0.2 -> 0.23
'062 - tomate - new textures for plastic ramps added, toys over plunger lane scaled and repositioned, missing decals added, repositioned decals prims, some textures adjusments in PS, metal plates in plunger lane added, some tweaks to plastics DL in script, new playfield_mesh added, cleaning some unused textures.
'063 - iaakki - One ball stuck fixed, added 2 new plastics, ramp DL effect adjusted a bit
'064 - tomate - plastic bevels added to slings and outlanes prims. Script DL at 'plastics bevels
'065 - tomate - new prims and textures for plunguer lane bulbs and wiring.
'066 - tomate - diverter realigned and reduced, modified plunger ramp primitive, multiball decals perforated to allow cables to pass through, wiring realigned, shield decal realigned and reduced, lowPoly plunger prim modified
'067 - iaakki - merge, ramp rolling sounds created, swithes adjusted, sling and laneguide images fixed.
'068 - sixtoe - piratetown prim lights added, diverter fixed, wall78 adjusted, apron wall added, diverter rubber changed & metal guide added, shooter lane lights adjusted, depth bias adjusted on new flashers,tweaked shooter rod position, added sw49 inc. dead sling, added some metal brackets inside rubbers and adjusted several rubber positions, tweaked and added argument to change ramp DL for VR, modded vr backbox artwork
'069 - iaakki - Hook501 ROM in use, rolling sounds fixed, relay vol reduced, bump stop added to the end of skillshot ramp, subway sound improved, bumper3b adjusted, "metal" material set to non-active, "metals_wires" set to static and non-reflective
'069.1 - Skitso - fixed skull eye lights, fixed top left inserts (lock and 5 mil), fixed return to clock insert and tweaked other inserts, tweaked GI lighting, added few missing GI's and added correct trasmit to plunger lane GI, fixed tons of disable lighting and disalbe light from below values to add correct three dimensionality. Tweaked Apron texture to not have "self illuminating feel" to it.
'070 - iaakki - merge
'071 - Skitso - fixed sligshot plastics to show GI through, refined upper playfield GI and lane guides, removed unneeded pirate town lights, new plungerlane bulb textures and light/flasher values, tweaked other small details
'072 - Sixtoe - Added 7 missing flasher lights (8b, 9, 12 & 14)
'073 - iaakki - skillshot ramp exit improvement, flip angles, flipper triggers reworked, metal guide near the right sling, ramp sound rework, wire rolling is now played if ball drops from main ramp
'074 - iaakki - top right flashers scripted, ramp sounds tuned one more time, collision sounds tested and adjusted, F5B adjusted, wire gates damping and gravity adjusted, skull inner prim flashing adjusted
'075 - iaakki - shittonne of LUTs, magnas to change, moved cor.update to own 1ms timer
'076 - iaakki - PF and Inserttext image updated, PF AO added and tied to GI. Insert #14 improved.
'077 - iaakki - AO baked to PF, ramp primitive DL values tuned
'078 - Sixtoe - GI tweaks, ramps, walls and ball traps adjusted, depth bias tweaks, dl tweaks for VR
'RC1 - iaakki - slope to 5.9, insert reflection flashers realigned to outlanes, "metal" material set to active, sling rubber duplicates removed
'RC1.2 - Skitso - reshaped GI lights under the skull (didn't take the scoop in account earlier), added more illumination on top of the top lane guides and tweaked lane lighting to not be so hot and clip the ball, further tweaked plunger lane bulbs, tweaked main ramp planks decal to not be submerged in the ramp, reduced mid PF lighting, added lower PF lighting.
'RC1.3 - iaakki - Info text, timer fix, old plastics image clean, gieffect timer fix
'RC1.4 - Sixtoe - VR asset tweaks, redid pirate town flashers as it looked rubbish, cleaned up and adjusted some flasher timers, other minor tweaks.
'RC1.5 - Sixtoe - Train wreck, abandoned.
'RC1.6 - Sixtoe - Redid skull and eyes, fixed subway (probably), fixed shoot again light, fixed insert text, fixed light bumpers insert not working in newest vpvr,
'RC1.7 - Sixtoe - Changed top lane entrance to stop ball getting stuck, changed scoop base to feed better from subway, updated timer for diverter, fixed outlane flasher reflection
'RC1.71 - Skitso - Removed skull eye flashers (clipped through the skull), increased skull eye's disable lighting value and tweaked ligths to compensate flasher removal, also tweaked fade speeds to match. Tweaked lower PF insert light wall reflections
'v1.0 - iaakki - final script cleanup and release version. Pincab DL adjusted
'ROM volume adjustment
'- Clicking on the PinMAME window (DMD) with the mouse
'- Pressing the tilde key (~) on your keyboard to open a white box - this would be the key to the left of the 1 key on the keyboard
'- Using the up and down arrow keys, scroll through channels until you find a channel to adjust
'- Using the left and right arrow keys, adjust the channel - left arrow lowers the volume, right arrow raises the volume
'- Repeat previous 2 steps to adjust other channels
'- When done, press the tilde key to close the white box
'- Click anywhere on the table to return focus to the table
Option Explicit
Randomize
On Error Resume Next
ExecuteGlobal GetTextFile("controller.vbs")
If Err Then MsgBox "You need the controller.vbs in order to run this table, available in the vp10 package"
On Error Goto 0
' Options
'///////////////////////-----VR Room-----///////////////////////
Const VRRoom = 0 ' 0 - VR Room off, 1 - Minimal Room, 2 - Ultra Minimal
'Cabinet mode - Will hide the rails and scale the side panels higher
' Cabinet Mode Off = 0
' Cabinet Mode On = 1
Const CabinetMode = 0
'*********** Set the default LUT set *********************************
'LUTset Types:
'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
'You can change LUT option within game with left and right CTRL keys
Dim LUTset, DisableLUTSelector, LutToggleSound
LUTset = 8
DisableLUTSelector = 0 ' Disables the ability to change LUT option with magna saves in game when set to 1
'******************************************************
' OPTIONS
'******************************************************
'///////////////////////-----General Sound Options-----///////////////////////
'// VolumeDial:
'// VolumeDial is the actual global volume multiplier for the mechanical sounds.
'// Values smaller than 1 will decrease mechanical sounds volume.
'// Recommended values should be no greater than 1.
Const VolumeDial = 0.8
Const Ballsize = 52
Const BallMass = 1
Const MirrorsOn = 0 ' ***LEAVE OFF FOR VR*** Turn off/on mirrors 0 or 1
Dim DesktopMode:DesktopMode = Table1.ShowDT
Dim UseVPMDMD
If VRRoom <> 0 Then UseVPMDMD = True Else UseVPMDMD = DesktopMode
LoadVPM "01000200", "DE.VBS", 3.38
'********************
'Standard definitions
'********************
Const UseSolenoids = 2
Const UseLamps = 0
Const UseSync = 1
Const HandleMech = 0
' Standard Sounds
Const SSolenoidOn = "fx_Solenoidon"
Const SSolenoidOff = "fx_solenoidoff"
'Const SCoin = "fx_Coin"
' using table width and height in script slows down the performance
dim tablewidth: tablewidth = Table1.width
dim tableheight: tableheight = Table1.height
'Solenoid
SolCallback(sLRFlipper) = "SolRFlipper"
SolCallback(sLLFlipper) = "SolLFlipper"
SolCallback(1) = "bsTrough.SolIn"
SolCallback(2) = "bsTrough.SolOut"
SolCallback(3) = "SolVUKKick"
SolCallback(4) = "SolKickback"
SolCallback(5) = "dtLDrop.SolDropUp"
SolCallback(6) = "SolKickout"
'SolCallback(7) 'Ticket Dispenser (Unused)
SolCallback(8) = "Solknocker"
SolCallback(9) = "SolFlash9" '"SetLamp 109," 'Topright Ramp Flasher 9
'SolCallback(10) 'L/R Coil Select Relay
SolCallback(11) = "SolGI"
SolCallback(12) = "SolFlash12" '"SetLamp 112," 'Topright Ramp Flasher 12
SolCallback(13) = "SolFlashSkull"
SolCallback(14) = "SetLamp 114," 'RightVUK Flasher
SolCallBack(15) = "SolAutoPlunge"
'SolCallback(16) 'Unused
'SolCallback(17) = "Bumper TL"
'SolCallback(18) = "Bumper Centre"
'SolCallback(19) = "Bumper TR"
'SolCallback(20) = "Left Sling"
'SolCallback(21) = "Right Sling"
SolCallback(22) = "SolRdiv" 'Diverter
'SolCallback(23) 'Unknown
'SolCallback(24) 'Unknown
'Flashers
SolCallback(25) = "SolFlash1B" 'Flash 1B
SolCallback(26) = "SetLamp 92," 'Flash 2B
SolCallback(27) = "SolFlash3B" 'Flash 3B
SolCallback(28) = "SolFlash4B" 'Flash 4B
SolCallback(29) = "SetLamp 95," 'Flash 5B
SolCallback(30) = "SolFlash6B" 'Flash 6B
SolCallback(31) = "SolFlash7B" 'Flash 7B
SolCallback(32) = "SolFlash8" '"SetLamp 98," 'Flash 8B - Topright Ramp Flasher 8
Const cGameName = "Hook_501"
Dim bsTrough,bsUpperEject,bsCala,bsLVuk,SkillShotR,PlungerIM
DIM dtLDrop, x
Sub Table1_Init
vpmInit Me
With Controller
.GameName = cGameName
If Err Then MsgBox "Can't start Game " & cGameName & vbNewLine & Err.Description:Exit Sub
.SplashInfoLine = "Hook Data East 1992" & vbNewLine & "BANGARAAANG!!"
.HandleKeyboard = 0
.ShowTitle = 0
.ShowDMDOnly = 1
.ShowFrame = 0
.HandleMechanics = 0
.Hidden = 0
.Games(cGameName).Settings.Value("sound") = 1
On Error Resume Next
.Run GetPlayerHWnd
If Err Then MsgBox Err.Description
End With
On Error Goto 0
'Mirror
Dim MBall1, MBall2
if MirrorsOn = 1 then
if table1.showDT=true then
Set MBall1 = kicker1.Createsizedball(1800):MBall1.Image = "Mirror":
Set MBall2 = kicker2.Createsizedball(200):MBall2.Image = "Mirror":
Mball1.BulbIntensityScale = 1
Mball2.BulbIntensityScale = 80
Else
Set MBall1 = kicker3.Createsizedball(1000):MBall1.Image = "Mirror":
Set MBall2 = kicker4.Createsizedball(200):MBall2.Image = "Mirror":
Mball1.BulbIntensityScale = 3
Mball2.BulbIntensityScale = 40
end if
end if
' Nudging
vpmNudge.TiltSwitch = 1
vpmNudge.Sensitivity = 2
vpmNudge.tiltobj = Array(LeftSlingShot,RightSlingShot,Bumper1B,Bumper2B,Bumper3B)
PinMAMETimer.Interval = PinMAMEInterval
PinMAMETimer.Enabled = 1
' Trough
Set bsTrough = new cvpmTrough
With bsTrough
.Size = 3
.InitSwitches Array (13,12,11)
.EntrySw = 10
.InitExit BallRelease, 90, 6
.Balls = 3
.CreateEvents "bsTrough", Drain
End With
' Drop Targets
Set dtLDrop=New cvpmDropTarget
With dtLDrop
.InitDrop Array(Sw25,Sw26,Sw27,Sw28), Array(25,26,27,28)
.InitSnd SoundFX("DTDrop",DOFDropTargets),SoundFX("TOM_Diverter_UP_2",DOFContactors) 'sound was was dtreset
End With
Set SkillShotR = New cvpmBallStack
With SkillShotR
.InitSaucer Sw32,32, 0, 45
.KickForceVar = 2
End With
'Diverter
DivOpen.Isdropped = 1
DivClose.Isdropped = 0
' SubWall.isdropped = 1
End Sub
Dim BallsOnPlayfield: BallsOnPlayfield = 0
Sub Trigger1_Hit()
BallsOnPlayfield = BallsOnPlayfield - 1
RandomSoundDrain Drain
vpmtimer.addtimer 2000, "LEDStopTimer '"
End Sub
Sub LEDStopTimer
If BallsOnPlayfield <= 0 Then LEDStop
End Sub
Sub BallRelease_Unhit
BallsOnPlayfield = BallsOnPlayfield + 1
RandomSoundBallRelease BallRelease
LEDStart
End Sub
'******************************************************
' KNOCKER
'******************************************************
Sub SolKnocker(enabled)
If enabled Then
KnockerSolenoid 'Add knocker position object
End If
End Sub
' Kickback
Sub SolKickback(enabled)
If Enabled then
SkillShotR.ExitSol_On
end if
End Sub
' LaserKick
Sub SolAutoPlunge(Enabled)
If Enabled Then
'Playsound SoundFX("bumper_retro",DOFContactors)
PlaySoundAtLevelStatic ("Plunger_Release_Ball"), PlungerReleaseSoundLevel, LaserKickP1
LaserKick.Enabled=True
LaserKickP1.TransY = 90
Else
LaserKick.Enabled=False
vpmtimer.addtimer 500, "LaserKickRes '"
End If
End Sub
Sub LaserKick_Hit: Me.Kick 0,55 End Sub
Sub LaserKickRes()
LaserKickP1.TransY = 0
End Sub
' Ramp Diverter
Sub SolRdiv(Enabled)
If Enabled Then
DivOpen.TimerEnabled = True
vpmtimer.addtimer 1500, "DiverterTimer.enabled = 1' "
End If
End Sub
Sub DiverterTimer_Timer
DiverterTimer.enabled = 0
DivClose.TimerEnabled = True
End Sub
Sub DivOpen_Timer
DivP.RotY = DivP.RotY - 9
if DivP.RotY < -38 Then
DivP.RotY = -38
me.TimerEnabled = False
DivOpen.Isdropped = 0
DivClose.Isdropped = 1
PlaySoundAt "TOM_Diverter_UP_2",DivP
end if
end sub
Sub DivClose_Timer
DivP.RotY = DivP.RotY + 9
if DivP.RotY > 0 Then
DivP.RotY = 0
me.TimerEnabled = False
DivClose.Isdropped = 0
DivOpen.Isdropped = 1
PlaySoundAt "TOM_Diverter_DOWN_2",DivP
end if
end sub
'Flashers
dim FlashLevelSkull, FlashLevel1B, FlashLevel3B, FlashLevel4B, FlashLevel12, FlashLevel9, FlashLevel8
FlasherSkull.opacity = 0
FlasherSkulla.opacity = 0
FlasherSkullb.opacity = 0
Flasher25.IntensityScale = 0
Flasher25a.IntensityScale = 0
Flasher25b.IntensityScale = 0
Flasher25c1.IntensityScale = 0
Flasher25c2.IntensityScale = 0
Flasher25c3.IntensityScale = 0
Flasher25.state = 1
Flasher25a.state = 1
Flasher25b.state = 1
Flasher25c1.state = 1
Flasher25c2.state = 1
Flasher25c3.state = 1
PirateTownP.blenddisablelighting = 0.2
Flasherf3a.opacity = 0
Flasherf3b.opacity = 0
f3a.IntensityScale = 0
f3b.IntensityScale = 0
Flasherf4a.opacity = 0
Flasherf4b.opacity = 0
f4a.IntensityScale = 0
f4b.IntensityScale = 0
Flasherf12.opacity = 0
f12a1.IntensityScale = 0
f12a2.IntensityScale = 0
Flasherf9.opacity = 0
f9a1.IntensityScale = 0
f9a2.IntensityScale = 0
Flasherf8.opacity = 0
f8a1.IntensityScale = 0
f8a2.IntensityScale = 0
Sub SolFlashSkull(enabled)
if Enabled then
FlashLevelSkull = 1
FlasherSkull_Timer
end if
End Sub
sub FlasherSkull_Timer()
dim flashx3
If not FlasherSkull.TimerEnabled Then
FlasherSkull.TimerEnabled = True
End If
flashx3 = FlashLevelSkull*FlashLevelSkull*FlashLevelSkull
'L31C.IntensityScale = flashx3
FlasherSkull.opacity = 100 * flashx3
FlasherSkulla.opacity = 100 * flashx3
FlasherSkullb.opacity = 10 * flashx3
skullP001.blenddisablelighting = 90 * flashx3
skullP.blenddisablelighting = 10 * flashx3 + (0.2 * gilevel) + 0.3
skullPb.blenddisablelighting = 3 * flashx3 + (0.2 * gilevel) + 0.3
FlashLevelSkull = FlashLevelSkull * 0.95 - 0.01
If FlashLevelSkull < 0 Then
FlasherSkull.TimerEnabled = False
End If
end sub
Sub SolFlash1B(enabled)
if Enabled then
FlashLevel1B = 1
F25_Timer
end if
End Sub
sub F25_Timer()
dim flashx3
If not F25.TimerEnabled Then
F25.TimerEnabled = True
End If
flashx3 = FlashLevel1B*FlashLevel1B*FlashLevel1B
'L31C.IntensityScale = flashx3
F25.opacity = 40 * flashx3
Flasher25.IntensityScale = flashx3 * 0.5
Flasher25a.IntensityScale = flashx3 * 5
Flasher25b.IntensityScale = flashx3 * 5
Flasher25c1.IntensityScale = flashx3 * 0.5
Flasher25c2.IntensityScale = flashx3 * 0.5
Flasher25c3.IntensityScale = flashx3 * 0.5
PirateTownP.blenddisablelighting = 0.2 + 0.8 * flashx3 * 3
FlashLevel1B = FlashLevel1B * 0.9 - 0.01
If FlashLevel1B < 0 Then
F25.TimerEnabled = False
End If
end sub
Sub SolFlash8(enabled)
if Enabled then
FlashLevel8 = 1
Flasherf8_timer
end if
End Sub
sub Flasherf8_timer
dim flashx3
If not Flasherf8.TimerEnabled Then
Flasherf8.TimerEnabled = True
End If
flashx3 = FlashLevel8*FlashLevel8*FlashLevel8
Flasherf8.opacity = 80 * flashx3
f8a1.IntensityScale = 3 * flashx3
f8a2.IntensityScale = 3 * flashx3
FlashLevel8 = FlashLevel8 * 0.93 - 0.01
If FlashLevel8 < 0 Then
Flasherf8.TimerEnabled = False
End If
end sub
Sub SolFlash9(enabled)
if Enabled then
FlashLevel9 = 1
Flasherf9_timer
end if
End Sub
sub Flasherf9_timer
dim flashx3
If not Flasherf9.TimerEnabled Then
Flasherf9.TimerEnabled = True
End If
flashx3 = FlashLevel9*FlashLevel9*FlashLevel9
Flasherf9.opacity = 110 * flashx3
f9a1.IntensityScale = 3 * flashx3
f9a2.IntensityScale = 3 * flashx3
FlashLevel9 = FlashLevel9 * 0.93 - 0.01
If FlashLevel9 < 0 Then
Flasherf9.TimerEnabled = False
End If
end sub
Sub SolFlash12(enabled)
if Enabled then
FlashLevel12 = 1
Flasherf12_timer
end if
End Sub
sub Flasherf12_timer
dim flashx3
If not Flasherf12.TimerEnabled Then
Flasherf12.TimerEnabled = True
End If
flashx3 = FlashLevel12*FlashLevel12*FlashLevel12
Flasherf12.opacity = 110 * flashx3
f12a1.IntensityScale = 3 * flashx3
f12a2.IntensityScale = 3 * flashx3
FlashLevel12 = FlashLevel12 * 0.93 - 0.01
If FlashLevel12 < 0 Then
Flasherf12.TimerEnabled = False
End If
end sub
Sub SolFlash3B(enabled)
if Enabled then
FlashLevel3B = 1
Flasherf3b_timer
end if
End Sub
sub Flasherf3b_timer
dim flashx3
If not Flasherf3b.TimerEnabled Then
Flasherf3b.TimerEnabled = True
End If
flashx3 = FlashLevel3B*FlashLevel3B*FlashLevel3B
Flasherf3a.opacity = 60 * flashx3
Flasherf3b.opacity = 40 * flashx3
f3a.IntensityScale = flashx3
f3b.IntensityScale = flashx3
FlashLevel3B = FlashLevel3B * 0.93 - 0.01
If FlashLevel3B < 0 Then
Flasherf3b.TimerEnabled = False
End If
end sub
Sub SolFlash4B(enabled)
if Enabled then
FlashLevel4B = 1
Flasherf4b_timer
end if
End Sub
sub Flasherf4b_timer
dim flashx3
If not Flasherf4b.TimerEnabled Then
Flasherf4b.TimerEnabled = True
End If
flashx3 = FlashLevel4B*FlashLevel4B*FlashLevel4B
Flasherf4a.opacity = 50 * flashx3
Flasherf4b.opacity = 30 * flashx3
f4a.IntensityScale = flashx3
f4b.IntensityScale = flashx3
FlashLevel4B = FlashLevel4B * 0.92 - 0.01
If FlashLevel4B < 0 Then
Flasherf4b.TimerEnabled = False
End If
end sub
'Sub SolFlash4B(enabled)
' If enabled Then
' f4a.state = 1
' f4b.state = 1
' Else
' f4a.state = 0
' f4b.state = 0
' End If
'End Sub
Sub SolFlash6B(enabled)
If enabled Then
F6b2.opacity = 50
f6b.state = 1
f6c.state = 1
Else
F6b2.opacity = 0
f6b.state = 0
f6c.state = 0
End If
End Sub
' #####################################
' ###### Flupper Flasher Domes #####
' #####################################
Dim TestFlashers, TableRef, FlasherLightIntensity, FlasherFlareIntensity, FlasherBloomIntensity, FlasherOffBrightness
' *********************************************************************
TestFlashers = 0 ' *** set this to 1 to check position of flasher object ***
Set TableRef = Table1 ' *** change this, if your table has another name ***
FlasherLightIntensity = 0.4 ' *** lower this, if the VPX lights are too bright (i.e. 0.1) ***
FlasherFlareIntensity = 0.2 ' *** lower this, if the flares are too bright (i.e. 0.1) ***
FlasherBloomIntensity = 0.7
FlasherOffBrightness = 0.6 ' *** brightness of the flasher dome when switched off (range 0-2) ***
' *********************************************************************
Dim ObjLevel(20), objbase(20), objlit(20), objflasher(20), objbloom(20), objlight(20)
'Dim tablewidth, tableheight : tablewidth = TableRef.width : tableheight = TableRef.height
''initialise the flasher color, you can only choose from "green", "red", "purple", "blue", "white" and "yellow"
InitFlasher 1, "yellow" ' : InitFlasher 2, "blue" : InitFlasher 3, "red" : InitFlasher 4, "blue" : InitFlasher 5, "white"
'' rotate the flasher with the command below (first argument = flasher nr, second argument = angle in degrees)
RotateFlasher 1,-45
'Flasherlight3.BulbHaloHeight = 88
Sub InitFlasher(nr, col)
' store all objects in an array for use in FlashFlasher subroutine
Set objbase(nr) = Eval("Flasherbase" & nr) : Set objlit(nr) = Eval("Flasherlit" & nr)
Set objflasher(nr) = Eval("Flasherflash" & nr) : Set objlight(nr) = Eval("Flasherlight" & nr)
Set objbloom(nr) = Eval("Flasherbloom" & nr)
' If the flasher is parallel to the playfield, rotate the VPX flasher object for POV and place it at the correct height
If objbase(nr).RotY = 0 Then
objbase(nr).ObjRotZ = atn( (tablewidth/2 - objbase(nr).x) / (objbase(nr).y - tableheight*1.1)) * 180 / 3.14159
objflasher(nr).RotZ = objbase(nr).ObjRotZ : objflasher(nr).height = objbase(nr).z + 40
End If
' set all effects to invisible and move the lit primitive at the same position and rotation as the base primitive
objlight(nr).IntensityScale = 0 : objlit(nr).visible = 0 : objlit(nr).material = "Flashermaterial" & nr
objlit(nr).RotX = objbase(nr).RotX : objlit(nr).RotY = objbase(nr).RotY : objlit(nr).RotZ = objbase(nr).RotZ
objlit(nr).ObjRotX = objbase(nr).ObjRotX : objlit(nr).ObjRotY = objbase(nr).ObjRotY : objlit(nr).ObjRotZ = objbase(nr).ObjRotZ
objlit(nr).x = objbase(nr).x : objlit(nr).y = objbase(nr).y : objlit(nr).z = objbase(nr).z
objbase(nr).BlendDisableLighting = FlasherOffBrightness
' set the texture and color of all objects
select case objbase(nr).image
Case "dome2basewhite" : objbase(nr).image = "dome2base" & col : objlit(nr).image = "dome2lit" & col :
Case "ronddomebasewhite" : objbase(nr).image = "ronddomebase" & col : objlit(nr).image = "ronddomelit" & col
Case "domeearbasewhite" : objbase(nr).image = "domeearbase" & col : objlit(nr).image = "domeearlit" & col
end select
If TestFlashers = 0 Then objflasher(nr).imageA = "domeflashwhite" : objflasher(nr).visible = 0 : End If
select case col
Case "blue" : objlight(nr).color = RGB(4,120,255) : objflasher(nr).color = RGB(20,155,255) ': objlight(nr).intensity = 5000
Case "green" : objlight(nr).color = RGB(12,255,4) : objflasher(nr).color = RGB(12,255,4)
Case "red" : objlight(nr).color = RGB(255,32,4) : objflasher(nr).color = RGB(255,32,4)
Case "purple" : objlight(nr).color = RGB(230,49,255) : objflasher(nr).color = RGB(255,64,255)
Case "yellow" : objlight(nr).color = RGB(200,173,25) : objflasher(nr).color = RGB(255,200,50)
Case "white" : objlight(nr).color = RGB(255,240,150) : objflasher(nr).color = RGB(100,86,59)
end select
objlight(nr).colorfull = objlight(nr).color
If TableRef.ShowDT and ObjFlasher(nr).RotX = -45 Then
objflasher(nr).height = objflasher(nr).height - 20 * ObjFlasher(nr).y / tableheight
ObjFlasher(nr).y = ObjFlasher(nr).y + 10
End If
'FlasherFlash4.height = 226
'FlasherFlash3.height = 200
End Sub
Sub RotateFlasher(nr, angle) : angle = ((angle + 360 - objbase(nr).ObjRotZ) mod 180)/30 : objbase(nr).showframe(angle) : objlit(nr).showframe(angle) : End Sub
Sub FlashFlasher(nr)
If not objflasher(nr).TimerEnabled Then objflasher(nr).TimerEnabled = True : objflasher(nr).visible = 1 : objlit(nr).visible = 1 : objbloom(nr).visible = 1
objflasher(nr).opacity = 1000 * FlasherFlareIntensity * ObjLevel(nr)^2.5
objbloom(nr).opacity = 50 * FlasherBloomIntensity * ObjLevel(nr)^2.5
objlight(nr).IntensityScale = 0.5 * FlasherLightIntensity * ObjLevel(nr)^3' else objlight(nr).IntensityScale = 1 * FlasherLightIntensity * ObjLevel(nr)^3
objbase(nr).BlendDisableLighting = FlasherOffBrightness + 10 * ObjLevel(nr)^3
objlit(nr).BlendDisableLighting = 10 * ObjLevel(nr)^2
UpdateMaterial "Flashermaterial" & nr,0,0,0,0,0,0,ObjLevel(nr),RGB(255,255,255),0,0,False,True,0,0,0,0
ObjLevel(nr) = ObjLevel(nr) * 0.9 - 0.01
If ObjLevel(nr) < 0 Then objflasher(nr).TimerEnabled = False : objflasher(nr).visible = 0 : objbloom(nr).visible = 0 : objlit(nr).visible = 0 : End If
End Sub
Sub FlasherFlash1_Timer() : FlashFlasher(1) : End Sub
'
'Sub FlashSol31(flstate)
' If Flstate Then
' Objlevel(1) = 1 : FlasherFlash1_Timer
' End If
'End Sub
Sub SolFlash7B(enabled)
If enabled Then
' f7c.state = 1
' f7d.state = 1
' F7e.visible = 1
Objlevel(1) = 1 : FlasherFlash1_Timer
f7b.state = 1
F2g.visible = 1
F1g.opacity = 1000
F1g1.opacity = 800
Else
' f7c.state = 0
' f7d.state = 0
' F7e.visible = 0
f7b.state = 0
F2g.visible = 0
F1g.opacity = 700
F1g1.opacity = 500
End If
End Sub
'******************
'Keys Up and Down
'*****************
Sub Table1_KeyDown(ByVal Keycode)
If keycode = PlungerKey Then Plunger.Pullback:SoundPlungerPull()
If keycode = LeftTiltKey Then Nudge 90, 5:SoundNudgeLeft()
If keycode = RightTiltKey Then Nudge 270, 5:SoundNudgeRight()
If keycode = CenterTiltKey Then Nudge 0, 6: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=StartGameKey then soundStartButton()
'nFozzy Begin'
If keycode = LeftFlipperKey Then LFPress = 1
If keycode = RightFlipperKey Then rfpress = 1
'nFozzy End'
If keycode = RightMagnaSave Then 'AXS 'Fleep
if DisableLUTSelector = 0 then
If LutToggleSound Then
Playsound "LUT_Toggle_Up_Front", 0, LutToggleSoundLevel * VolumeDial, 0, 0.2, 0, 0, 0, 1
Playsound "LUT_Toggle_Up_Rear", 0, LutToggleSoundLevel * VolumeDial, 0, 0.2, 0, 0, 0, -1
End If
LUTSet = LUTSet + 1
if LutSet > 10 then LUTSet = 0
SetLUT
ShowLUT
end if
end if
If keycode = LeftMagnaSave Then
if DisableLUTSelector = 0 then
If LutToggleSound Then
Playsound "LUT_Toggle_Down_Front", 0, LutToggleSoundLevel * VolumeDial, 0, 0.2, 0, 0, 0, 1
Playsound "LUT_Toggle_Down_Rear", 0, LutToggleSoundLevel * VolumeDial, 0, 0.2, 0, 0, 0, -1
End If
LUTSet = LUTSet - 1
if LutSet < 0 then LUTSet = 10
SetLUT
ShowLUT
end if
end if
If vpmKeyDown(keycode) Then Exit Sub
End Sub
Sub Table1_KeyUp(ByVal Keycode)
If KeyCode = PlungerKey Then
Plunger.Fire
If BIPL = 1 Then
SoundPlungerReleaseBall() 'Plunger release sound when there is a ball in shooter lane
Else
SoundPlungerReleaseNoBall() 'Plunger release sound when there is no ball in shooter lane
End If
End If
'nFozzy Begin'
If keycode = LeftFlipperKey Then
lfpress = 0
leftflipper.eostorqueangle = EOSA
leftflipper.eostorque = EOST
End If
If keycode = RightFlipperKey Then
rfpress = 0
rightflipper.eostorqueangle = EOSA
rightflipper.eostorque = EOST
End If
'nFozzy End'
If vpmKeyUp(keycode) Then Exit Sub
End Sub
Sub Table1_Paused : Controller.Pause = True : End Sub
Sub Table1_unPaused : Controller.Pause = False : End Sub
Sub Table1_Exit() : Controller.Pause = False : Controller.Stop() : End Sub
'******************************************************
' LUT
'******************************************************
Sub SetLUT 'AXS
Table1.ColorGradeImage = "LUT" & LUTset & "_" & 8 - 1
end sub
Sub LUTBox_Timer
LUTBox.TimerEnabled = 0
LUTBox.Visible = 0
End Sub
Sub ShowLUT
LUTBox.visible = 1
Select Case LUTSet
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"
End Select
LUTBox.TimerEnabled = 1
End Sub
'******************************************************
' 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 LeftFlipper_Collide(parm)
LeftFlipperCollide parm
End Sub
Sub RightFlipper_Collide(parm)
RightFlipperCollide parm
End Sub
'******************************************************
' FLIPPER CORRECTION INITIALIZATION
'******************************************************
dim LF : Set LF = New FlipperPolarity
dim RF : Set RF = New FlipperPolarity
InitPolarity
Sub InitPolarity()
dim x, a : a = Array(LF, RF)
for each x in a
x.AddPoint "Ycoef", 0, RightFlipper.Y-65, 1 'disabled
x.AddPoint "Ycoef", 1, RightFlipper.Y-11, 1
x.enabled = True
x.TimeDelay = 60
Next
AddPt "Polarity", 0, 0, 0
AddPt "Polarity", 1, 0.05, -5.5
AddPt "Polarity", 2, 0.4, -5.5
AddPt "Polarity", 3, 0.6, -5.0
AddPt "Polarity", 4, 0.65, -4.5
AddPt "Polarity", 5, 0.7, -4.0
AddPt "Polarity", 6, 0.75, -3.5
AddPt "Polarity", 7, 0.8, -3.0
AddPt "Polarity", 8, 0.85, -2.5
AddPt "Polarity", 9, 0.9,-2.0
AddPt "Polarity", 10, 0.95, -1.5
AddPt "Polarity", 11, 1, -1.0
AddPt "Polarity", 12, 1.05, -0.5
AddPt "Polarity", 13, 1.1, 0
AddPt "Polarity", 14, 1.3, 0
addpt "Velocity", 0, 0, 1
addpt "Velocity", 1, 0.16, 1.06
addpt "Velocity", 2, 0.41, 1.05
addpt "Velocity", 3, 0.53, 1'0.982
addpt "Velocity", 4, 0.702, 0.968
addpt "Velocity", 5, 0.95, 0.968
addpt "Velocity", 6, 1.03, 0.945
LF.Object = LeftFlipper
LF.EndPoint = EndPointLp
RF.Object = RightFlipper
RF.EndPoint = EndPointRp
End Sub
Sub TriggerLF_Hit() : LF.Addball activeball : End Sub
Sub TriggerLF_UnHit() : LF.PolarityCorrect activeball : End Sub
Sub TriggerRF_Hit() : RF.Addball activeball : End Sub
Sub TriggerRF_UnHit() : RF.PolarityCorrect activeball : End Sub
'******************************************************
' FLIPPER CORRECTION FUNCTIONS
'******************************************************
Sub AddPt(aStr, idx, aX, aY) 'debugger wrapper for adjusting flipper script in-game
dim a : a = Array(LF, RF)
dim x : for each x in a
x.addpoint aStr, idx, aX, aY
Next
End Sub
Class FlipperPolarity
Public DebugOn, Enabled
Private FlipAt 'Timer variable (IE 'flip at 723,530ms...)
Public TimeDelay 'delay before trigger turns off and polarity is disabled TODO set time!
private Flipper, FlipperStart,FlipperEnd, FlipperEndY, LR, PartialFlipCoef
Private Balls(20), balldata(20)
dim PolarityIn, PolarityOut
dim VelocityIn, VelocityOut
dim YcoefIn, YcoefOut
Public Sub Class_Initialize
redim PolarityIn(0) : redim PolarityOut(0) : redim VelocityIn(0) : redim VelocityOut(0) : redim YcoefIn(0) : redim YcoefOut(0)
Enabled = True : TimeDelay = 50 : LR = 1: dim x : for x = 0 to uBound(balls) : balls(x) = Empty : set Balldata(x) = new SpoofBall : next
End Sub
Public Property let Object(aInput) : Set Flipper = aInput : StartPoint = Flipper.x : End Property
Public Property Let StartPoint(aInput) : if IsObject(aInput) then FlipperStart = aInput.x else FlipperStart = aInput : end if : End Property
Public Property Get StartPoint : StartPoint = FlipperStart : End Property
Public Property Let EndPoint(aInput) : FlipperEnd = aInput.x: FlipperEndY = aInput.y: End Property
Public Property Get EndPoint : EndPoint = FlipperEnd : End Property
Public Property Get EndPointY: EndPointY = FlipperEndY : End Property
Public Sub AddPoint(aChooseArray, aIDX, aX, aY) 'Index #, X position, (in) y Position (out)
Select Case aChooseArray
case "Polarity" : ShuffleArrays PolarityIn, PolarityOut, 1 : PolarityIn(aIDX) = aX : PolarityOut(aIDX) = aY : ShuffleArrays PolarityIn, PolarityOut, 0
Case "Velocity" : ShuffleArrays VelocityIn, VelocityOut, 1 :VelocityIn(aIDX) = aX : VelocityOut(aIDX) = aY : ShuffleArrays VelocityIn, VelocityOut, 0
Case "Ycoef" : ShuffleArrays YcoefIn, YcoefOut, 1 :YcoefIn(aIDX) = aX : YcoefOut(aIDX) = aY : ShuffleArrays YcoefIn, YcoefOut, 0
End Select
if gametime > 100 then Report aChooseArray
End Sub
Public Sub Report(aChooseArray) 'debug, reports all coords in tbPL.text
if not DebugOn then exit sub
dim a1, a2 : Select Case aChooseArray