'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWWNNNXXK0000KKK0OOOOOOOOOOkkOkkkkkkO0OOOO0KXXNNWWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMMMMMMWWNNXXXKKXXXXXXXXXXXXXXXXXNNXNXXXXXXKKKKKKK000OOOkkkkkkkOOOO00KKXNNWMMMMMMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMWWNXKKK000000KKXNNNWWWWWWXOkxxdddkXNNX0dccc:::cokKK0OdooxOOOOkkkkkxxxxxxxxkO00KXNWMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMWNNXK00OOOOO000KKK0Oxdoc:lkNWWNd..... 'xXXXk' ... .cOK0k;..lOOOxc,,,;:coxkkkxxxxdddxkO0KXNWMMMMMMMMMMMMM 'MMMMMMMMMWNKK0OOOOO0000OxodOKK0o'.... :KWWNd. ;oo, .dXXXk' 'dkc. :OKKk; .lOOko. .. .lkOkdc:clddddddxxxkOKXNWMMMMMMMM 'MMMMMWXK0OOkOOOOOkocok0x' ,kKK0c..;dl. ;KWWNo. .,'. 'kXXXk' ,kKo. :0KKk, .lOOOo. .::' .:xkkl. .:c;,cdddddoooxk0XNWMMMM 'MWNK0OkOOOkxdkOOOd' ,x0d. ,kKK0c. ... ;KWWNd. .;;. 'kXXXk' ,k0l. :0KKk; .lO0Oo. ... .:xkxl. .,. ,dxddocclooodxO0XWM 'XOOkOOkdl;'..lOOOd. ,x0d. ,kKK0c. 'c:. ;KWWNd..lXKc .dXXXk' .,,. :OKKk; .lOOOo. .;;. .:xkkl. . .. 'oxdo,...';:loodxk0 'OkOOxc'...';cxOO0d. ,x0d. ,kKK0c..oXO, ;KWWNd..dXXo.,kXXXO:','....;x000k:..lOOOo. ,dd; .:xkko. .'. 'ldxd, .....;lddoo 'kkOOo. .ldoc:dO00d. 'dxc. ,kKK0l..dNKl:dXWWWKkkKNNK00XXXKOO00xoxOO0K0000kooxOOOd:,:dd;..:xxko. .c, .lodd, .':;,',looll 'dk0Oo. ,xk:..lO0Od. ......lOKKKkdkKNNNXNNNXXK00OkkxxdddddOKOxxdollooooodddxxxkkkxxxxxdlloxxxl'.'ll. 'loddc'....',:loolc 'dkOOo. ,xx; .lOOOxc',:clox0000Okkxdolc::;;,'........ 'd0d,.'cl,. .......''',,;;:cloodddollooc'.,lddoc;;;,'. 'lolll 'dkOOo. .,'. .oO000OOOOOkdol:;,'... 'd0o. 'lo,. ....',;:clooooooodo,. ... .looll 'dO0Oo. ..;cdO0Okxol:,'... ................'dOo. ....'lo;. .. ..',;:clodoc;'.. ,odool 'dOOOkl:ldkOkxdc;'.. ...........'...............'oOo. 'lo:..,ll,. .. .. ..';cllllc::coooll 'dkO000Okdc;'.. .................'lx:............ .lko. 'oxxd;..,ll'... .;:.. ..',:clllllll 'xOOOOd;.. ...................;d0k:............ckd'..okxxxl'..;oc. .;l:,. . .':llllc 'kOO0k: ......................ldx0k:..........:kx,..lkkxxxdc. .:oc. .;ol:;. ... ,oddol 'OO00O:. ..............'.........;dl,lOOc........;xk:..:xkkkxxdo:. .cl;. .:oc',;,.. ,loolc 'Ok00Oc. ........................cd:..cOOc......'oOl. ,dkkkkxxddo;..,ll'. .:l:. .;;. .,lllcc 'Ok00Ol. ..............;,.......'od;. .;xOl'....cOx, .okkkkkxxdddl'..:oc. 'cl;. .,:'. .'. ... .. .,lllcl 'Ok00Oo. .............'od;......,dd;. .,dOd,..,xOc..:kOOkkkkxdddo:..'co;. .,cc,. .,:,. .;:' .. .;lll:o 'OxOOOd. .............;dOk:.....;xd;..'...oOx:'lOd' ,dOOOkkkkxxdddo,..;ol'.;lc'.... .':;. .;lc'. .;llccd '0xOOOd' ............;dk0Oc....:xx:..lx;..ckkxOOc..ckOOOkkkkkxxxddc...coccl:. .,;'..,c;. .:ol:'. .:lllck 'KkOOOx, .......... .:dookOl'..;xx:..lKOc..,d0Kx' 'dOOkkkkxxxxxxddo,..;odl;. .;::'..,c;. .'cl:,;,. . .cllcck 'XkkOOk:. ......... .:dc.'okd;.;dkc..c0X0o'..lkl..ckOOOOkdoldxdxddd:..'cc'..':c:;. .,c,..;lc'..;;. 'cllcl0 'NkxOOkc. ......... .:o:. .;ddccdko'.;OXXKx;..,'.'dOOOOOko;;lddxdddl'..'. .:lccc;. .;c;,cl;. .;,. .. .,lllcdX 'WOxOOOo. .......... .:dc. .:dxkkd,.,kXXKKOc.. .:kOOOOOkc'.:ddxdddd:....,cllccc,. .:clc:' .';,. ... .;lllcdN 'W0xkOOx, .......... .;dl. ....'lxkx;..oKXKKK0d,..oOOOOOOx:..;dxxxdddl,..:oollcc:'. 'cc:,. .. .';,. ... .. .:ollcdN 'MKxkOOk; ...........,oo,..lo'..,oxc..c0XKKKK0kccx0OOOOOd,..'lxxxdddo:;cooollcc;. .,:,. ..'. .,;'. . 'coollOW 'MXkkOOkc. ..... ....'ld:..l0Ol'..:c' 'xXKKKKKK0O00OOOOOo'. .cdxdddddoodddollcc,. .,. .';:,. .;;'. .. .,cllcdXM 'MWOxOOOo. .,,. .:dl..,kK0xc......l0KKKKKKKK00OOOOkc.. .:dxddddddddooollc:. .....:llc'..';;. ..'.. .:llllkWM 'MMKxkOOx; .;ol,. .,od;..l000Od:....;kKKKKKKKK00OOOOx:....;oxdddddddoooollc,. ...;cccc;. .,:'.......,c:... 'colllOWM 'MMXkkOOkc. 'lkxl,. .cdl. 'd000Oko;...l0KKKKKKK000OOOd,....,oxxxxddddoooool;. ..,:cccc:'..';;......,clc,....,ooolo0MM 'MMNOxkOOo. .:dxkko;...,ld:..;xOOOOOko;.,x0KKKKKK00OOOOo'....'oxxxxddddoooolc'..,:cccccc;. .;;'. ..;cllc;'....;lllcdXMM 'MMMKxkOOx; .,ol;:oxdc,':oo,..ckOOOOOOko:lOKKKKKK00OOOkc......cddddddddooool;',:ccc:ccc:...,;,..,:c:;',:;....'cllllOWMM 'MMMNkxOOkl. .ll'...;lddoddl'..lkOOOOO00OxO0KKKKKK00OOx:......:dddddddoooooc:ccccccccc:'..'::::::,....,:,....;lllcoXMMM 'MMMW0xkOOx, .:o:. ...;coddc'..lkOkOO0000KKKKKKKK00OOd,......,odddddoooooollcc:ccccc:,...;c:;,.... .'::'....:lllckWMMM 'MMMMXkkOOkc. ,ol' .::'...';:;..'lkkOO000KK0KKKKKK00OOo'......'ldddddoooooollcc::c:c:,...,,'....','..:c;....,lllcoKMMMM 'MMMMW0xkOOd' .cd:..ckxoc,...... .lkOO000K00KKKKKK000kc........cddddddooooollcc:::::'.......',;::;..'::,....:lllckWMMMM 'MMMMMXkkOOkc. ,oc. ,dkkxdol:,.....lkO00000KKKKKKKK00k:........;dddddddoooolccc:::;.....',;:::::;'..;c;'...,lllcl0MMMMM 'MMMMMW0xkOOx, .co,..ckkxdddddol:,''ck00kodOKKKKXKK00x,........,oddddddoool::cc::,..',::cc::::::,..'::,....:llllkWMMMMM 'MMMMMMNkxOOOl. .,o:. 'okxxddddddxxxooxO00o,:x0KXXKK00o'........'lddddddooc,':c:::;;:ccccc::::::;...;:;'...,lllcoKMMMMMM 'MMMMMMW0xO00k, .:l,..;dxxddddddxxkkOO000Oc..:xKXXKKOc..........cdddddoc,..;lcc::cccccccc::::::,..'::,...'cllll0WMMMMMM 'MMMMMMMNOk00Oo. .'lc. .cxxddddddxxkkkO0000k:..'lkKKKk:..........;ddddl;...;llcc::ccccccc::::::;...;:;'...;lllcxNMMMMMMM 'MMMMMMMMXkkOOk:. .;l;. 'oxddddddxxkkkO00000x;. .'oO0x;..........,odo:'...,llccc:ccccccccc::::;'..,:;'...,llllo0MMMMMMMM 'MMMMMMMMW0xkOOd, .:l,..;dxdddddxxkkOO00KKK0x,. .,ol'..........'cc'....,lolcc:::::cccccc::::,..';;'...'cllllOWMMMMMMMM 'MMMMMMMMMNOxOOkl. .cc'..cdxdddxxxkOOO000K0K0d,..................'.....'coolccc::::ccccc::::;...,;,'...:lollxNMMMMMMMMM 'MMMMMMMMMMXkxOOkc. ,lc. .lddddxxxkkOO00K00KK0o'......................'cooolcc:::::::::::::;'..,;''...,lolcoKMMMMMMMMMM 'MMMMMMMMMMMXkocc:. .,c;..,ldddxxxkkOO00KK00KK0l'........'''.........':ooollcc::::::cccc::;'..,,'.....;;;cxKWMMMMMMMMMM 'MMMMMMMMMMMMKo::,.. .... ..,,,;;:cloodxkOOO00KOc........'''''''''...:oolllc::;;,,,,,,,'''....'..''.....'lXMMMMMMMMMMMM 'MMMMMMMMMMMMWOxkkxl. .......'',;::c:'......''''''''''..';;,,''.........................;:cclkNMMMMMMMMMMMM 'MMMMMMMMMMMMMNOxOOOl. .',.. ... ................'''''''''''..........................',,''...:looldXMMMMMMMMMMMMM 'MMMMMMMMMMMMMMNOxOOkc. .'cl,...''.................'''.''..'''.'''..................'',,'..';,'....;looldKMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMXkkOOkc. .'cl,..;odol:;,'...........''......'...''.............',,;::::;..',,'....;looldKWMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMXkkOOk:. .'cl,..;oxkkOOkxoc;,'.........'..'''............',;;::cc::::,...,,'....,looloKWMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMXkkOOk:. .'cl;..,oxkOO0KKK0Okdoc:,................',;:cllllcc:::::;,...,,'''..,loolo0WMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMXkkOOk:. ..'co:..,okOO0KKKKKKKXXXKOxc'........';cloodoolllccc::::;'...,,'''..;looldKWMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMXkkOOkc. ..'coc'.'lkO0KKKKKKKXXNNNNO;........;odddooollllccc:::;'..',,'''..;oooloKWMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMXOkOOkl. ...:ol,..ck0KKKKKKKKXNNNNKl........cdddoooollllccc::,...',,'','.:oooldKWMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMNOkO0Oo'. ..,ll;..;dOKKKKKKKXXNNNXx'......'ldddooolllllcc:;'...'''....'codolxXMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMMW0kO00x;. ..'coc'..ckKKKKKKXXNWNNO:......:ddddoooollllc:;...',''....,lddookNMMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMMMWKkk00Ol.....;lo;..;d0KKKKXXNNWNKo......lxddooooolllc:,...,,'.....;oddod0WMMMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMMMMMXOk0KKx,. ..'cdl,..ck0KKKXNNWNXk,....,oxdddooolllc;...',,'....'cdddodKWMMMMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMMMMMMN0kOKKOc. ..:odc'.'lOKKXXNWNX0c....;dxdddoooll:'..',,'.....,lddookXMMMMMMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMMMMMMMWXOOKK0d,. ..'cxxc..,oOKXNNNNKd'...cxxxddool:,..',;,'....'cdddoo0WMMMMMMMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMN0OKXXOc. ..,okx:..,oOXNNNXO;..,dkxxddoc,..';:;'.....;ldxdokXWMMMMMMMMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWKO0XNXx;. ...:xkd:..,o0NNNKl'.cxkxxoc,..';::,.....,cdxddd0WMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN00KNNKd,....':dkxc'.,lOXXxccdkxo:'..';c:,'....'cdxxddkXMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX00XWNKo'.....;oxxl,.':dkkkko:'..,:c:,'....':oxxddxKWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWK0KNWN0l'.....,lxkxc'.,::;..':cc:,'''..':oxxxdx0NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNK0XNWN0l'.....,cxOOd:'.';lol:,''''.':dOOkddONMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNKKXNWN0o,....',:okOkxxoc:,,','',:dkkkxxOXMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNK0KNNN0o;...''',cool;,,,,'';ldkOkxxOXWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNK0KNNNKx:'..''',,,,,,',:okOOkxxOXWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNKKKNNNXOo;''',,,'';lx0KKOkk0XWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNXKKNWWNKxc,'.':oO000OkOKNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWXKKXWWWN0kxk0KK0OkOKWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNKKXNWWNNNK0Ok0XWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWXKXXNNKOOKNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM 'MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX0OOO0NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM ' **************************************************************** ' VISUAL PINBALL X ' Guardians of the Galaxy Script ' By Pincredibles ' (Started from JPSalas GhostBusters) ' Version 2.1.2 ' ' Special thanks to: ' Arngrim DOF help ' MPT3k Gameplay from real table ' Nailbuster Amazing work on the PUP framework and helping me get all those nice little features working so it feels like the real thing, ' Rik Amazing testing ' Orbital Group Awesome help with my first table and alpha testing (John M, G5K, Pinballfan2018, Scott, Bambi, Brian, James, .. the names go on) ' VAAS PupFrame ' wAxx Physics and tweaks ' Ashtone6 Awesome highres photos of the real table ' Al Help cleaning up Pup Graphics ' Terry Massive amount of support and help for release ' VPW Help everywhere ' Apophis - VPW Physics ' PinStratsDan - Testing ' BountyBob - Testing ' Sixtoe - VR Room/Lights ' Wylte - DynamicBallShadows ' Hauntfreaks - Testing and POV ' ' Known Issues ' 1) Pincontrol doesnt autofire because plunger needs to be moved ' Open table, Press "#" at the end of the Layer numbers on the left, Press "1" Layer, Select the plunger in the bottom right ' Under the Position section, change the y = 2213.8, Save and play ' 2) Some people seem to have some stutter in VPX 10.7 so stick to VPX 10.6 ' ' ************************************************************************** Option Explicit SetLocale 1033 ' Force US format so math works out Randomize Dim ScreenType:ScreenType = 0 ' 0=Desktop, 1=2screen ' Script should autodetect this and set correctly Const bCompetitionMode = False ' Start with Competition Rules (Cant select mode from Drain, Only save progress if > 50%) Const bUsePlungerForSternKey = False ' Defaults to Right Magna Button but you can use Plunger button also Const kBallSearchTimeout = 15000 ' Start ball search after 15 seconds of no activity Const DMDMode = 2 ' 2=PUP (Only use Pup) Const doCallouts = False ' Play random GOTG callouts during the game Const bUseClelandMusic = False ' Use the Cleland music update Const bNudgeShake = False ' Nudge table for SSF when the motor "shakes" Const bFlipperSkipEnabled = True ' Skip scenes Const AlternateSettings = 0 ' Increases Rocket Kicker Power Const FontScale = 1 ' Scales the PupFonts up/down for different sized DMDs [Desktop 0.75] Const FontScaleDmd = 1 ' Scales the SlimDMDFonts up/down for different sized DMDs [Desktop 0.5] Const ScorbitActive = 0 ' Is Scorbit Active Const ScorbitShowClaimQR = 1 ' If Scorbit is active this will show a QR Code in the bottom left on ball 1 that allows player to claim the active player from the app Const ScorbitClaimSmall = 0 ' Make Claim QR Code smaller for high res backglass Const ScorbitUploadLog = 1 ' Store local log and upload after the game is over Const ScorbitAlternateUUID = 0 ' Force Alternate UUID from Windows Machine and saves it in VPX Users directory (C:\Visual Pinball\User\ScorbitUUID.dat) Const osbactive = 0 ' Orbital Scoreboard: Set to 0 for off, 1 for only player 1 to be sent, 2 for all scores to be sent. ' See link to create obs.vbs: https://docs.orbitalpin.com/vpx-user-settings Const VRRoom = False ' Turns on VR Room and Cabinet. VPVR must also be set for desktop play. Const AltBlades = False ' Displays alternate sideblades. Const HasRealTiltBob = 0 ' 0=No Tilt Bob, 1=Real TiltBob Const bAltHadronFlashPosition = False ' moves flasher up for those whose POV doesnt show the lockbar. '----- 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 '************************** ' UltraDMD USER Config '************************** Const UseFullColor = "True" ' ULTRA: Enable full Color on UltraDMD "True" / "False" Const UltraDMDVideos = True ' ULTRA: Works on my DMDv3 but seems it causes issues on others '************************** ' PinUp Player USER Config '************************** Dim PupOption:PupOption=0 dim PuPDMDDriverType: PuPDMDDriverType=0 ' 0=LCD DMD, 1=RealDMD (For FULLDMD use the batch scripts in the pup pack) dim useRealDMDScale : useRealDMDScale=0 ' 0 or 1 for RealDMD scaling. Choose which one you prefer. dim useDMDVideos : useDMDVideos=True ' true or false to use DMD splash videos. Dim pGameName : pGameName="gotg_2020" ' pupvideos foldername, probably set to cGameName in realworld ' SERVICE Key Definitions Const ServiceCancelKey = 8 ' 7 key Const ServiceUpKey = 9 ' 8 key Const ServiceDownKey = 10 ' 9 key Const ServiceEnterKey = 11 ' 0 key '***********TABLE VOLUME LEVELS ********* ' [Value is from 0 to 1 where 1 is full volume. ' NOTE: you can go past 1 to amplify sounds] Const cVolBGVideo = 0.5 ' NOT USED Const VolMusic1 = 0.9 ' Volume for Cleland Music or Original Gameplay music and Wait Music Const cVolBGMusic = .7 ' Volume for Videos Const cVolDef = 1 ' Default volume for callouts (Voice callouts) Const cVolSfx = .4 ' Volume for Game Sound effects (Hitting targets, raps, etc) Const cVolTable = .5 ' Volume for table Sound effects (Kickers, flippers, bumpers, etc) Const BallSize = 50 ' 50 is the normal size Const BallMass = 1 ' 1 is normal ball Const kOrbMagnetTime = 1800 ' Seconds (was 2500) Const kOrbMagnetPower = 28 ' Was 24 Const kMouthAnimationSpeed = 800 ' CherryBomb and GrootMB Mouth Open/Close animation speed Dim RocketKickerPower:RocketKickerPower = 30 ' Default power for the Rocket Kicker Dim WaitSongCount:WaitSongCount=3 ' Number of Wait songs - Cleland has more dim ScreenPos(3) ScreenPos(0) = "'5,0,0,100,100'" ScreenPos(1) = "'2,21.5,41,57,56.2'" ScreenPos(3) = "'2,16.4,51.5,67.2,46.3'" '********* UltraDMD ************** Dim UltraDMD:UltraDMD=0 Const UltraDMD_VideoMode_Stretch = 0 Const UltraDMD_VideoMode_Top = 1 Const UltraDMD_VideoMode_Middle = 2 Const UltraDMD_VideoMode_Bottom = 3 Const UltraDMD_Animation_FadeIn = 0 Const UltraDMD_Animation_FadeOut = 1 Const UltraDMD_Animation_ZoomIn = 2 Const UltraDMD_Animation_ZoomOut = 3 Const UltraDMD_Animation_ScrollOffLeft = 4 Const UltraDMD_Animation_ScrollOffRight = 5 Const UltraDMD_Animation_ScrollOnLeft = 6 Const UltraDMD_Animation_ScrollOnRight = 7 Const UltraDMD_Animation_ScrollOffUp = 8 Const UltraDMD_Animation_ScrollOffDown = 9 Const UltraDMD_Animation_ScrollOnUp = 10 Const UltraDMD_Animation_ScrollOnDown = 11 Const UltraDMD_Animation_None = 14 Const UltraDMD_deOn = 1500 '********* End UltraDMD ************** Const BlinkIntFast = 70 Const BlinkIntDef = 125 Const BlinkIntSlow = 500 Const BlinkPatternDef = 10 Const BlinkPatternSlow = 100 Dim luts, lutpos luts = array("ColorGradeLUT256x16_1to1", "ColorGradeLUT_Bright2", "ColorGradeLUT_Bright", "ColorGradeLUT256x16_ConSat", "ColorGradeLUT256x16_HalfSat" ) lutpos = 0 '********* VR Room ************** If VRRoom = True Then 'Turns on VR Room and Cabinet Dim VRThings for each VRThings in VRStuff:VRThings.visible = 1:Next FireButtonBase.z=-96 hadron001.visible=False hadron.height = 170 hadron.Visible = True Flasherbase5.X = 473 Flasherbase5.Y = 2315 Flasherbase5.Z = 170 Flasherlit5.X = 473 Flasherlit5.Y = 2315 Flasherlit5.Z = 170 Flasherbase5.Size_X = 30 Flasherbase5.Size_Z = 30 Flasherlit5.Size_X = 30 Flasherlit5.Size_Z = 30 Flasherflash5.X = 473 Flasherflash5.Y = 2315 Flasherflash5.Height = 194 FlasherFlash5_5.X = 473 FlasherFlash5_5.Y = 2315 FlasherFlash5_5.Height = 230 Else for each VRThings in VRStuff:VRThings.visible = 0:Next hadron001.height = 170 hadron001.Visible = True Flasherbase5.X = 468 Flasherbase5.Y = 2330 Flasherbase5.Z = 150 Flasherlit5.X = 468 Flasherlit5.Y = 2330 Flasherlit5.Z = 150 Flasherbase5.Size_X = 22 Flasherbase5.Size_Z = 22 Flasherlit5.Size_X = 22 Flasherlit5.Size_Z = 22 Flasherflash5.X = 468 Flasherflash5.Y = 2330 Flasherflash5.Height = 194 FlasherFlash5_5.X = 468 FlasherFlash5_5.Y = 2330 FlasherFlash5_5.Height = 195 FireButtonBase.Visible=False ' Flasherbase5.X = 435 ' Flasherbase5.Y = 2205 ' Flasherbase5.Z = 70 ' Flasherlit5.X = 435 ' Flasherlit5.Y = 2205 ' Flasherlit5.Z = 70 ' Flasherbase5.Size_X = 20 ' Flasherbase5.Size_Z = 20 ' Flasherlit5.Size_X = 20 ' Flasherlit5.Size_Z = 20 ' Flasherflash5.X = 435 ' Flasherflash5.Y = 2215 ' Flasherflash5.Height = 120 ' FlasherFlash5_5.X = 435 ' FlasherFlash5_5.Y = 2205 ' FlasherFlash5_5.Height = 121 End If if bAltHadronFlashPosition then ' Move the hadton position for those that dont show the lockbar FlasherFlash5_5.y= 2100 Flasherflash5.y=2100 End if If AltBlades = True Then 'Displays alternate sideblades PinCab_Blades.image = "PinCab_Blades_GOTG2" End If ' DOF Notes ' DOF 129, DOFPulse ' DOF 140, DOFOn ' DOF 140, DOFOff ' PlaySoundAt SoundFXDOF("fx_flipperup", 101, [DOFOn, DOFOff, DOFPulse], ' [DOFContactors, DOFKnocker, DOFChimes, DOFBell, DOFGear, DOFShaker, DOFFlippers, DOFTargets, DOFDropTargets]), LeftFlipper ' DOF are EXXX since this is an EM table ' ' Load the core.vbs for supporting Subs and functions LoadCoreFiles Sub LoadCoreFiles On Error Resume Next ExecuteGlobal GetTextFile("core.vbs") If Err Then MsgBox "Can't open core.vbs" 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 ExecuteGlobal GetTextFile("VPMKeys.vbs") If Err Then MsgBox "Can't open VPMKeys.vbs" On Error Goto 0 '============================' Orbital Scoreboard'============================ if osbactive = 1 or osbactive = 2 Then On Error Resume Next ExecuteGlobal GetTextFile("osb.vbs") On Error Goto 0 end if End Sub '####################### CHECK FOR FILE ####################### ' Version: 2.0 ' Mar - 2022 ' Add function to check for an external file Dim fso Function FileExists(FilePath) Set fso = CreateObject("Scripting.FileSystemObject") If fso.FileExists(FilePath) Then FileExists=CBool(1) Else FileExists=CBool(0) End If End Function 'Example: 'If FileExists("\IamHere.txt") Then DoWhatYouWant 'Examples to check for a file: Dim PuPPlayer Dim PUPStatus Dim PUPEnabled Dim PuPPack_folder Dim PupPack_version Dim PupPack_verified PuPPack_folder = "gotg_2020" PupPack_verified = "2.1.0" ' ONLY CHANGE WITH PUP PACK '####################### END CHECK FOR FILE ####################### Dim bDebugMode:bDebugMode = False ' Magna buttons perform debug functions ' Define any Constants Const cGameName = "gotg_2020" ' Match DOF Config Tool Const TableName = "gotg_2020" Const TableNameOBS = "gotg" Const myVersion = "2.1.2" Const MaxPlayers = 4 ' Max Players = 4 for now Dim pupColorBrown:pupColorBrown=RGB(132,89,39) Dim pupColorGrey:pupColorGrey=RGB(132,132,132) Dim pupColorGreen:pupColorGreen=RGB(23,237,18) Dim pupColorBlack:pupColorBlack=RGB(0,0,0) Dim pupColorWhite:pupColorWhite=RGB(255,255,255) Dim pupColorYellow:pupColorYellow=RGB(223,220,40) Dim pupColorRed:pupColorRed=RGB(245, 8, 8) ' RGB(247, 170, 51)?? Dim pupColorBlue:pupColorBlue=RGB(14,23,212) ' RGB(69, 93, 218) ' Define Global Variables Dim bClelandMusic:bClelandMusic=bUseClelandMusic Dim PlayersPlayingGame Dim CurrentPlayer Dim Credits Dim ReplayValue Dim ComboCount Dim ModeScore(4, 4) ' CurrentPlayer, (Combo, CB, Immolation, Xandar) Dim BonusPoints(4) ' Dim BonusHeldPoints(4) Dim BonusMultiplier Dim PlayMultiplier Dim ModePointsGroot Dim ModePoints Dim ModePointsSave ' Save off mode points for use later Dim WizardModePoints Dim WizardBonusPoints Dim bBonusHeld Dim BallsRemaining(4) Dim ExtraBallsAwards(4) Dim LastScore(4) ' save off the last scores Dim Score(4) Dim ScoreSize(4) Dim HighScore(5) Dim HighScoreName(5) Dim HighScoreAwards(5) Dim HighScoreAwardsName(5) Dim bReplayAwarded(4) Dim TiltCount(4) Dim Jackpot Dim SuperJackpot Dim Tilt Dim TiltSensitivity Dim Tilted Dim TotalGamesPlayed Dim mBalls2Eject Dim ticksFromLastEject Dim SkillshotValue Dim bCreatedBall ' we just created a ball Dim bAutoPlunger ' Auto fire Dim bAutoPlunged ' Did AutoPlunger Fire Dim bInstantInfo Dim BumperMultiplier dim bLaneSaverEnabled Dim FlipperSkipCmd ' Command to when you FlipperSkip Dim VolMusic Dim BallsOutlaneDrainCnt Dim BallsOutlaneDrainIgnoreCnt Dim BonusArrowHits(9) ' Holds the total # of hits during game play Dim BonusModeTotal(9) ' Holds the total bonus during gameplay Dim BonusModeValue(9) ' Holds the bonus value that will get added to the next mode bonus ' Define Game Control Variables Dim LastSwitchHit Dim LastSwitchHit2 Dim BallsOnPlayfield Dim BallsInLock ' These are jsut virtual ones in groot Dim RealBallsInLock ' These are actually locked on the table Dim BallsInHole Dim GrootSJPReady ' SJP Is Enabled Dim GrootMBFinished ' Did we complete GrootMB Dim GrootMultiBallCount ' How many times have we completed Groot MB Dim GrootMBLocks ' How many Groot Lock we have done during this groot MB. We can only lock it a total of 3 times in MB Dim GrootMultiBallToggle Dim OrbTarget1Toggle Dim OrbMultiBallCount ' How many times have started ORB MB Dim OrbMultiBallProgress ' How far are we from starting ORB MB Dim OrbMBJackpotHits ' Orb Progress Dim OrbMBCompletions ' How many times have we completed ORB MB this round Dim OrbMBJackpot Dim OrbHurryUpValue Dim bOrbMultiBall Dim bOrb2xEnabled Dim bOrbDisabled Dim SpellGuardians Dim SpellRampage Dim bTableDisabled ' Disable table on Tilt/Reset ' Define Game Flags Dim bFirstStart Dim bFirstCredit ' Mute after the first Dim bFreePlay Dim bGameInPlay Dim bGameInPlayHidden ' We disable the table but this gets set to catch some special cases Dim bShowMatch Dim bOnTheFirstBall Dim bBallInPlungerLane Dim bBallSaverActive Dim BallSaverActiveBuffer ' Allows lanes to kick in ball saver Dim bBallSaverReady Dim bMultiBallMode Dim bMusicOn Dim TrackE_Idx dim SuperSkillShotIndex Dim bSkillshotsReady(3) Dim bSkillshotReady Dim bSkillShotPlayedOnce Dim bExtraBallWonThisBall Dim bJustStarted dim bsTrough Dim bSkipWaitVideo Dim plungerIM 'used mostly as an autofire plunger Dim ttable, cbleft, cbright Dim x 'Dim HadronCount Dim HadronEnforcerCount 'Dim Controller Dim bTableReady Dim bUseUltraDMD Dim bUsePUPDMD dim bPupStarted dim sndGeneralHit dim OrbJPDebounce dim bPlayerChanging ' Set during EndOfBallComplete player switch to prevent Restore() double-firing pBGPlayerSelect dim bAudioScreen14Busy ' Prevents rapid double-fire on PUP audio screen 14 causing VLC invalid pointer crash dim bPupEventBusy ' Prevents rapid-fire pDMDEvents on screen 13 causing VLC invalid pointer crash dim dScreen13LastActivity ' FIX8: Timestamp (Timer()) of last PlayMedia/B2S event touching screen 13 dim dScreen15LastActivity ' FIX11: Timestamp (Timer()) of last PlayMedia event on screen 15 (pUnderVid) dim baHadronLightsSaved dim baRampLightsSaved dim baLightsSaved dim HadronLightsSaveColor() dim RampLightsSaveColor() ' Pretty sure this is not used anymore dim LightsSaveColor() Dim YakaPops Dim MusicDir Const kModeNebula =0 Const kModeRonan =1 Const kModeYandu =2 Const kModeStarLord =3 Const kModeDrax =4 Const kModeRocket =5 Const kModeGamora =6 Const kModeBroker =7 Const kModeCherry =8 Const kModeOrbMB =8 Const kModeGrootMB =9 Const kModeImmo =10 Const kModeXandar =11 '***************************************** ' Structure to save/restore all player data before moving to a new ones ' *************************************** Const StackSize = 4 ' How Many Modes can be stacked - Higher priority wins Const kStack_Pri0 = 0 ' Base Modes Const kStack_Pri1 = 1 ' Groot/Orb MB Const kStack_Pri2 = 2 ' Wizard Modes Const kStack_Pri3 = 3 ' Skillshot Class cArrowState Public ArrowColor Public ArrowState Public MultipState Public NameState End Class Class cStack Public bStackActive ' Is there a mode here actually stacked? Public ModeIndex ' What is the index of this mode? Public ArrowStates(9) ' What are the arrow states for this mode 'This event is called when an instance of the class is instantiated Private Sub Class_Initialize( ) dim i For i = 0 to 8 set ArrowStates(i) = New cArrowState Next End Sub Public Sub Reset() dim i bStackActive = False ModeIndex = -1 For i = 0 to 8 ArrowStates(i).ArrowColor = "" ArrowStates(i).ArrowState = 0 ArrowStates(i).MultipState = 0 ' Color is always Green ArrowStates(i).NameState = 0 ' Color is always name color Next End Sub Public Function GetArrowState(light) dim lIndex lIndex = GetModeIndex(light.name) GetArrowState = ArrowStates(lIndex).ArrowState End Function Public Sub SetArrowState(light, state) dim lIndex lIndex = GetModeIndex(light.name) ArrowStates(lIndex).ArrowState = state End Sub Public Sub Enable (NewModeIndex) bStackActive = True ModeIndex = NewModeIndex End Sub Public Sub Disable() Reset End Sub End Class Public StackState(4) ' StackSize - Stores which modes are actually in play (stacked) Dim StackedLightsIdx(9) ' aRampLights.count Dim StackedLights(4, 4, 9) ' MaxPlayers, StackSize, aRampLights.count Sub SetLightColorRestore(light, lIndex) Dim finalColor Dim finalState Dim i Dim LightStackCount if lIndex = -1 then ' Got get it if they didnt already have it lIndex = GetModeIndex(light.name) End if finalState = 0 finalColor = "white" ' Should never need this line but just in case LightStackCount=0 for i = 0 to StackSize-1 ' Set the real color and state based on the stack (higher in the stack is higher prioroty) StackedLights(CurrentPlayer, i, lIndex)=-1 if StackState(i).bStackActive then ' if StackState(i).ArrowStates(lIndex).ArrowColor <> "" then ' finalColor = StackState(i).ArrowStates(lIndex).ArrowColor ' End If if StackState(i).ArrowStates(lIndex).ArrowState <> 0 then ' Handle Stacked Cycling Lights StackedLights(CurrentPlayer, i, lIndex)=1 if StackedLightsIdx(lIndex) = -1 then StackedLightsIdx(lIndex)=i End if LightStackCount=LightStackCount+1 ' Handle Primary Light finalState = StackState(i).ArrowStates(lIndex).ArrowState finalColor = StackState(i).ArrowStates(lIndex).ArrowColor 'debug.print "Stack: " & i & " lindex:" & lIndex & " state:" & finalState & " color:" & finalColor End If End If Next if LightStackCount<=1 then StackedLightsIdx(lIndex)=-1 ' Disable stacked 'debug.print "SetLightColorRestore " & light.name & " state:" & finalState & " color:" & finalColor SetLightColor light, finalColor, finalState End Sub Sub SSetLightColor(stackIndex, light, color, state) ' StackSetLightColor dim lIndex lIndex = GetModeIndex(light.name) 'debug.print "SSetLightColor " & stackIndex & " idx:" & lIndex & " " & light.name & " state:" & state if lIndex <> -1 then ' We should never hit this StackState(stackIndex).ArrowStates(lIndex).ArrowColor = color StackState(stackIndex).ArrowStates(lIndex).ArrowState = state SetLightColorRestore light, lIndex else ' MsgBox "Light Color Error:" & light.name & " idx:" & stackIndex & " " & lIndex debug.print "Light Color Error:" & light.name & " idx:" & stackIndex & " " & lIndex End If End Sub Sub CycleStackedLights() ' This will cycle colors on all the stacked lights Dim i Dim j Dim bModesStacked:bModesStacked=False Dim light if bGameInPlay=False then Exit Sub For j = 0 to aRampLights.count-1 ' See if any lights are on if StackedLightsIdx(j)<>-1 then 'Debug.print "LightStacked Idx:" & j 'Debug.print "Current Stacked Mode:" & StackedLightsIdx(j) for i = 0 to StackSize-1 ' Go through all Modes StackedLightsIdx(j)=StackedLightsIdx(j)+1 if StackedLightsIdx(j)>=StackSize then StackedLightsIdx(j)=0 if StackedLights(CurrentPlayer, StackedLightsIdx(j), j)<>-1 then 'Debug.print "Changing Stacked Idx:" & StackedLights(CurrentPlayer, i, j) select case j case 2: set light = lYonduArrow case 1: set light = lRonanArrow case 5: set light = lRocketArrow case 0: set light = lNebulaArrow case 8: set light = lgr_a case 7: set light = lBrokerArrow case 6: set light = lGamoraArrow case 4: set light = lDraxArrow case 3: set light = lStarLordArrow End Select SetLightColor light, StackState(StackedLightsIdx(j)).ArrowStates(j).ArrowColor, -1 Exit For End if Next End if Next End Sub Sub tmrStackedLights_Timer() CycleStackedLights ' Do this at a lower rate End Sub Sub SetSlowPulse2(Light) Light.blinkInterval=900 Light.fadespeedUp=0.1 Light.fadespeedDown=0.1 Light.falloff=50 End Sub Sub SetSlowPulse(Light) Light.blinkInterval=900 Light.fadespeedUp=0.1 Light.fadespeedDown=0.1 Light.falloff=50 End Sub Sub SetDefPulse(Light) Light.blinkInterval=125 Light.fadespeedUp=40 Light.fadespeedDown=40 Light.falloff=60 End Sub Const kYondu = 0 Const kRonan = 1 Const kRocket = 2 Const kNebula = 3 Const kGroot = 4 Const kBroker = 5 Const kGamora = 6 Const kDrax = 7 Const kStarLord = 8 Dim PlayerState(5) Class TableState ' These should hold state of the current mode Public sBumperMultiplier Public bFirstBall Public ArrowColor Public lStackState Public lArrowStates(9) Public lNameStates(9) Public lHadronStates(5) Public lHadronValues(5) Public lNovaStates(5) ' Progress toward Multiplier2x Public lNovaStatesKyln(5) ' Progress to Mode 5 Public lGrootStabStates(2) Public lGrootMBState ' If Groot Mouth is open and light is blinking Public bExtraball_1 ' Triggered - Groot or Orb MB Extra Ball (BAD RULE - Disabled) Public bExtraball_2 ' Triggered 3 Modes are started Public bExtraball_3 ' Triggered 6 Modes are complete ' Holds global info Public SModeProgress(8) ' 8 modes Public SModePercent(8) Public SMode2Progress(8) ' 8 modes Public SMode2Percent(8) Public SbImmolationProgress(9) ' Immolation progress 'Public GrootProgress(8) ' How far through Orb are we (One for drop and one for back DropDrop) 'Public OrbProgress(8) ' How far through Groot are we (for for mouth open and one for lock) Public GuardianCount ' Spell GUARDIANS Public RampageCount ' Spell RAMPAGE Public GrootFinish ' Did we finish GrootMB Public GrootCount ' Number of times we completed Groot Public bGrootMBToggle ' If we are on the second mouth hit Public GrootMBInLock ' Number of balls in Groot MB Lock Public OrbCount ' Number of times we completed Orbs Public OrbMBStartProgress ' How far to start ORB MB Public OrbMBProgress ' How far through OrbMB we are Public bOrbTargetDropped ' Is the OrbTarget Dropped? Public grootInsertState ' State of the insert for groot Public orbInsertState ' State of the insert for Orb Public immoInsertState ' State of the insert for Immolation Public xandarInsertState ' State of the insert for Xandar Dim SGrootMBJackpotCnt ' Save groot Progress Dim bSLaneSaverEnabled ' Save Lane saver state Dim bSXandarDone Dim bSXandarReady Dim SXandarCount Dim SXandarCompletions ' How many time have we completed Xandar Dim SYakaPops ' How many pops left if we are on Yaka Arrow Dim bSImmolationDone dim bSImmolationReady Dim SImmolationCount Dim bSImmolationQualSanctuary dim bSaveExtraBallState Dim bSaveUpgradedState dim bSCherryBombReady Dim SCherryBombCount dim bSCherryBombDone Dim SSkillshotValue Dim HadronCount Dim bCountDownEnabled ' Countdown Time info Dim CountdownValue Public bQQFirstTime ' Have we dont quills quest once? Public bOrbTargetDisabled ' If we are in the middle of quills quest this could be disabled (Hidden safe guard for Target disabled) Public bModeSelect Public SPlayerMode Public SPlayerMode2 Public Sub Reset() dim i, j for i = 0 to 4 lNovaStates(i) = 0 lNovaStatesKyln(i) = 2 Next bExtraball_1 = False bExtraball_2 = False bExtraball_3 = False SSkillshotValue = 250000 SPlayerMode = -1 SPlayerMode2 = -1 bFirstBall = True bModeSelect = True set lStackState = New cStack ' Store pri0 states for each player End Sub Public Sub Save() ' Grab all the current Table states and save into this player dim i,j sBumperMultiplier = BumperMultiplier ArrowColor = modeRampColor lArrowStates(kYondu) = lYonduArrow.state lArrowStates(kRonan) = lRonanArrow.state lArrowStates(kRocket) = lRocketArrow.state lArrowStates(kNebula) = lNebulaArrow.state lArrowStates(kGroot) = lgr_a.state lArrowStates(kBroker) = lBrokerArrow.state lArrowStates(kGamora) = lGamoraArrow.state lArrowStates(kDrax) = lDraxArrow.state lArrowStates(kStarLord) = lStarLordArrow.state lNameStates(kYondu) = lYonduName.state lNameStates(kRonan) = lRonanName.state lNameStates(kRocket) = lRocketName.state lNameStates(kNebula) = lNebulaName.state lNameStates(kGroot) = lgr.state lNameStates(kBroker) = lBrokerName.state lNameStates(kGamora) = lGamoraName.state lNameStates(kDrax) = lDraxName.state lNameStates(kStarLord) = lStarLordName.state lHadronStates(0) = lHadron0.state lHadronStates(1) = lHadron1.state lHadronStates(2) = lHadron2.state lHadronStates(3) = lHadron3.state lHadronStates(4) = lHadron4.state if (PlayerMode=kModeRonan) then ' Ronan state are stored in the targets lHadronValues(0) = tgHadron0.UserValue lHadronValues(1) = tgHadron1.UserValue lHadronValues(2) = tgHadron2.UserValue lHadronValues(3) = tgHadron3.UserValue lHadronValues(4) = tgHadron4.UserValue else lHadronValues(0) = lHadron0.UserValue lHadronValues(1) = lHadron1.UserValue lHadronValues(2) = lHadron2.UserValue lHadronValues(3) = lHadron3.UserValue lHadronValues(4) = lHadron4.UserValue End if ' Save the Stack States between players lStackState.bStackActive = StackState(kStack_Pri0 ).bStackActive lStackState.ModeIndex = StackState(kStack_Pri0 ).ModeIndex for i = 0 to 8 ' Set the real color and state based on the stack (higher in the stack is higher prioroty) lStackState.ArrowStates(i).ArrowColor = StackState(kStack_Pri0 ).ArrowStates(i).ArrowColor lStackState.ArrowStates(i).ArrowState = StackState(kStack_Pri0 ).ArrowStates(i).ArrowState lStackState.ArrowStates(i).MultipState = StackState(kStack_Pri0 ).ArrowStates(i).MultipState lStackState.ArrowStates(i).NameState = StackState(kStack_Pri0 ).ArrowStates(i).NameState Next 'lNovaStatesKyln ' Stored during game 'lNovaStates ' Stored during game lGrootStabStates(0) = l023.state lGrootStabStates(1) = l019.state lGrootMBState = lgr_mb.state SGrootMBJackpotCnt = GrootMBJackpotCnt bSLaneSaverEnabled = bLaneSaverEnabled for i = 0 to 8 SModeProgress(i) = ModeProgress(i) SModePercent(i) = ModePercent(i) SMode2Progress(i) = Mode2Progress(i) SMode2Percent(i) = Mode2Percent(i) Next for i = 0 to 9 SbImmolationProgress(i) = bImmolationProgress(i) Next GuardianCount = SpellGuardians RampageCount = SpellRampage GrootCount = GrootMultiBallCount GrootFinish = GrootMBFinished bGrootMBToggle = GrootMultiBallToggle GrootMBInLock = BallsInLock OrbCount = OrbMultiBallCount OrbMBStartProgress = OrbMultiBallProgress OrbMBProgress = OrbMBJackpotHits bOrbTargetDropped = OrbTarget1.IsDropped bQQFirstTime = bQuillsQuestFirstTime bOrbTargetDisabled = OrbTarget1Disabled.Collidable grootInsertState = Light030.state orbInsertState = Light033.state immoInsertState = Light029.state xandarInsertState = Light031.state SYakaPops = YakaPops SSkillshotValue = SkillshotValue bSXandarDone = bXandarDone bSXandarReady= bXandarReady SXandarCount = XandarCount SXandarCompletions = XandarCompletions bSImmolationQualSanctuary = bImmolationQualSanctuary bSImmolationDone = bImmolationDone bSImmolationReady= bImmolationReady SImmolationCount = ImmolationCount bSCherryBombReady= bCherryBombReady bSCherryBombDone = bCherryBombDone SCherryBombCount = CherryBombCount HadronCount = HadronEnforcerCount bCountDownEnabled = ModeCountdownTimer.Enabled CountdownValue = ModeCountdownTimer.UserValue bModeSelect = bPlayerModeSelect SPlayerMode = PlayerMode SPlayerMode2 = PlayerMode2 bSaveExtraBallState = flshExtraBall.TimerEnabled bSaveUpgradedState = bModeProgressUpgraded End Sub Public Sub Restore() ' Retore all the Table states Dim i ' if PlayersPlayingGame = 1 then exit sub ' Just in case I missed something We dont have to do this on single player BumperMultiplier = sBumperMultiplier modeRampColor = ArrowColor SetLightColor lYonduArrow, modeRampColor, lArrowStates(kYondu) SetLightColor lRonanArrow, modeRampColor, lArrowStates(kRonan) SetLightColor lRocketArrow, modeRampColor, lArrowStates(kRocket) SetLightColor lNebulaArrow, modeRampColor, lArrowStates(kNebula) SetLightColor lgr_a, modeRampColor, lArrowStates(kGroot) SetLightColor lBrokerArrow, modeRampColor, lArrowStates(kBroker) SetLightColor lGamoraArrow, modeRampColor, lArrowStates(kGamora) SetLightColor lDraxArrow, modeRampColor, lArrowStates(kDrax) SetLightColor lStarLordArrow, modeRampColor, lArrowStates(kStarLord) SetLightColor lYonduName, "white", lNameStates(kYondu) SetLightColor lRonanName, "white", lNameStates(kRonan) SetLightColor lRocketName, "white", lNameStates(kRocket) SetLightColor lNebulaName, "white", lNameStates(kNebula) SetLightColor lgr, "white", lNameStates(kGroot) SetLightColor lBrokerName, "white", lNameStates(kBroker) SetLightColor lGamoraName, "white", lNameStates(kGamora) SetLightColor lDraxName, "white", lNameStates(kDrax) SetLightColor lStarLordName, "white", lNameStates(kStarLord) ' Restore the Stack States between players StackState(kStack_Pri0 ).bStackActive = lStackState.bStackActive StackState(kStack_Pri0 ).ModeIndex = lStackState.ModeIndex for i = 0 to 8 ' Set the real color and state based on the stack (higher in the stack is higher prioroty) StackState(kStack_Pri0 ).ArrowStates(i).ArrowColor = lStackState.ArrowStates(i).ArrowColor StackState(kStack_Pri0 ).ArrowStates(i).ArrowState = lStackState.ArrowStates(i).ArrowState StackState(kStack_Pri0 ).ArrowStates(i).MultipState = lStackState.ArrowStates(i).MultipState StackState(kStack_Pri0 ).ArrowStates(i).NameState = lStackState.ArrowStates(i).NameState Next ' PlayerState(CurrentPlayer).lHadronStates(0) SetLightColor lHadron0, "yellow", lHadronStates(0):tgHadron0.UserValue = lHadronValues(0) SetLightColor lHadron1, "yellow", lHadronStates(1):tgHadron1.UserValue = lHadronValues(1) SetLightColor lHadron2, "yellow", lHadronStates(2):tgHadron2.UserValue = lHadronValues(2) SetLightColor lHadron3, "yellow", lHadronStates(3):tgHadron3.UserValue = lHadronValues(3) SetLightColor lHadron4, "yellow", lHadronStates(4):tgHadron4.UserValue = lHadronValues(4) 'lNovaStatesKyln ' Stored during game 'lNovaStates ' Stored during game l023.state = lGrootStabStates(0) l019.state = lGrootStabStates(1) lgr_mb.state = lGrootMBState if lgr_mb.state = 2 Then GrootMouth_Drop True Else GrootMouth_Drop False End If for i = 0 to 8 ModeProgress(i) = SModeProgress(i) ModePercent(i) = SModePercent(i) Mode2Progress(i) = SMode2Progress(i) Mode2Percent(i) = SMode2Percent(i) Next for i = 0 to 9 bImmolationProgress(i) = SbImmolationProgress(i) Next SpellGuardians = GuardianCount PuPlayer.LabelSet pDMDText, "Guardians2", "PuPOverlays\\GUARDIAN-"&SpellGuardians&".png",1,"{'mt':2,'color':111111,'width':31, 'height':8,'yalign':0,'ypos':0.0,'xpos':50.4}" If SpellGuardians = 8 then SetSlowPulse LightGuardians SetLightColor LightGuardians, "white", 2 Else SetDefPulse LightGuardians SetLightColor LightGuardians, "white", 0 End if SpellRampage = RampageCount GrootMultiBallCount = GrootCount GrootMBFinished = GrootFinish GrootMultiBallToggle = bGrootMBToggle BallsInLock = GrootMBInLock GrootMouthDone ' Restore Insert States GrootMBJackpotCnt=SGrootMBJackpotCnt OrbMultiBallCount = OrbCount OrbMultiBallProgress = OrbMBStartProgress OrbMBJackpotHits = OrbMBProgress OrbTarget1.IsDropped = bOrbTargetDropped if OrbTarget1.IsDropped then LightShootOrb.State = 2 Else LightShootOrb.State = 0 End IF bQuillsQuestFirstTime = bQQFirstTime OrbTarget1Disabled.Collidable = bOrbTargetDisabled bLaneSaverEnabled = bSLaneSaverEnabled if bLaneSaverEnabled then SetLightColor lLaneSaver, "yellow", 1 Else SetLightColor lLaneSaver, "yellow", 0 End if YakaPops = SYakaPops SkillshotValue = SSkillshotValue bXandarDone = bSXandarDone bXandarReady= bSXandarReady XandarCount = SXandarCount XandarCompletions = SXandarCompletions bImmolationQualSanctuary = bSImmolationQualSanctuary bImmolationDone = bSImmolationDone bImmolationReady= bSImmolationReady ImmolationCount = SImmolationCount bCherryBombReady= bSCherryBombReady bCherryBombDone = bSCherryBombDone CherryBombCount = SCherryBombCount 'ModeCountdownTimer.Enabled = bCountDownEnabled ' Dont restore this since we start it once they hit the ball ModeCountdownTimer.UserValue = CountdownValue bPlayerModeSelect = bModeSelect PlayerMode = SPlayerMode PlayerMode2 = SPlayerMode2 bModeProgressUpgraded = bSaveUpgradedState setUpgradeLight(False) setModeSelectLight(False) ' if ModeCountdownTimer.Enabled then ' SetBackglassTimer(ModeCountdownTimer.UserValue) ' End If ' Put PUP in the right mode playclear pUnderVid ' bSkipWaitVideo=True ' StopPlayerModeVideo ' bSkipWaitVideo=False if bPlayerModeSelect then playclear pDMDFull playclear pMusic if Not bPlayerChanging then pBGPlayerSelect ' Skip if ResetForNewPlayerBall already called it during player change else SetBackglassTimer(ModeCountdownTimer.UserValue) pBGGamePlay RefreshPlayerMode WaitPlayerMode if bModeProgressUpgraded=False then setUpgradeLight(True) end if if PlayersPlayingGame>1 then ' Restart the videos if we are in multiplayer playclear pDMDFull playclear pMusic StartPlayerModeVideo True ' TBD Make this skip to the correct position if PUP ever supports it pausemedia pDMDFull pausemedia pMusic End if End if HadronEnforcerCount = HadronCount CheckHadron False ' Set other lights back up StopScoopLightSeq Light030.state = grootInsertState Light033.state = orbInsertState Light029.state = immoInsertState Light031.state = xandarInsertState ' if OrbMultiBallCount > 0 then SetLightColor Light033, "purple", 1 ' Light Orb Multiball (We save the states so this isnt needed) if GrootMBFinished then SetLightColor Light030, "green", 1 ' Light Groot Multiball 'if bXandarDone then SetLightColor Light031, "white", 1 if bXandarReady then SetLightColor Light031, "white", 2:PlayScoopLightSeq if bImmolationDone then SetLightColor Light029, "white", 1 if bImmolationReady then SetLightColor Light029, "white", 2:PlayScoopLightSeq if bCherryBombReady then SetLightColor lStarLordArrow, "red", 1 Light020.State = 0 Light021.State = 0 Light022.State = 0 Light023.State = 0 Light024.State = 0 Light025.State = 0 Light026.State = 0 Light027.State = 0 If bSaveExtraBallState then flshExtraBall.TimerEnabled = True Else setExtraBallLight False End if SetModeLights ' Set the mode light on the playfield if PlayerMode=0 Then Light020.State = 2 if PlayerMode=1 Then Light021.State = 2 if PlayerMode=2 Then Light022.State = 2 if PlayerMode=3 Then Light023.State = 2 if PlayerMode=4 Then Light024.State = 2 if PlayerMode=5 Then Light025.State = 2 if PlayerMode=6 Then Light026.State = 2 if PlayerMode=7 Then Light027.State = 2 End Sub End Class Sub TableState_Init(Index) Set PlayerState(Index) = New TableState PlayerState(Index).Reset End Sub Sub StackState_Init(Index) Set StackState(Index) = New cStack StackState(Index).Reset End Sub const defBallSaverTime = 7 ' 5 + 2 grace (In seconds) Dim BallSaverTime BallSaverTime = defBallSaverTime Const MaxMultiplier = 10 'limit to 10x in this game Const BallsPerGame = 3 ' 3 Const MaxMultiballs = 6 ' max number of balls during multiballs '******************** ' Magnet '******************** Dim mMagnaSave 'Sub mMagnaSave_Hit() ' PlaySoundAt SoundFXDOF("fx_bumper", 107, DOFPulse, DOFContactors), Bumper001 ' 'mMagnaSave.AddBall ActiveBall ' vpmtimer.addtimer 1000, "MagnetDone '" ' SetLightColor lMagnet, "white", 0 'End Sub ' 'Sub MagnetDone ' mMagnaSave.RemoveBall ActiveBall ' mMagnaSave.MagnetOn = False ' SetLightColor lMagnet, "white", 0 'End Sub 'Sub MagnaSave_UnHit(): ' mMagnaSave.RemoveBall ActiveBall 'End Sub ' ********************************************************************* ' Visual Pinball Defined Script Events ' ********************************************************************* Dim serviceSaveAttract dim serviceIdx Dim serviceLevel dim bServiceMenu dim bServiceVol dim bServiceEdit dim serviceOrigValue Dim bInService:bInService=False Dim MasterVol:MasterVol=100 Dim VolBGVideo:VolBGVideo = cVolBGVideo Dim VolBGMusic :VolBGMusic = cVolBGMusic Dim VolDef:VolDef = cVolDef Dim VolSfx:VolSfx = cVolSfx Dim VolTable:VolTable = cVolTable Dim TopArray:TopArray = Array("GO TO DIAGNOSTIC MENU","GO TO AUDITS MENU","GO TO ADJUSTMENTS MENU","GO TO UTILITIES MENU","GO TO TOURNAMENT MENU","GO TO REDEMPTION MENU","EXIT SERVICE MENU") Dim AdjArray:AdjArray = Array("STANDARD ADJUSTMENTS","FEATURE ADJUSTMENTS","PREVIOUS MENU","EXIT SRVICE MENU","HELP") Const kMenuNone = -1 Const kMenuTop = 0 Const kMenuAdj = 1 Const kMenuAdjStd = 2 Const kMenuAdjFeat = 3 Sub StartServiceMenu(keycode) Dim i Dim maxVal Dim minVal Dim dataType dim TmpStr Dim direction Dim values Dim valuesLst Dim NewVal Dim displayText Dim bSkipSound:bSkipSound=False if keycode=ServiceEnterKey and bInService=False then debug.print "Start Service:" & bInService PlaySoundVol "stern-svc-enter", VolSfx serviceSaveAttract=pInAttract pInAttract=False bServiceMenu=False bServiceEdit=False bInService=True bServiceVol=False serviceIdx=-1 serviceLevel=kMenuNone playclear pOverVid ' PuPlayer.LabelShowPage pMVideo, 4, 0,"" ' Show Blank Page so it doesnt overlap (We shouldnt need this but labels are popping over) PuPlayer.LabelShowPage pOverVid, 3,0,"" ' PuPlayer.playlistplayex pBackglass, "PuPOverlays" ,"3_Multicolor_TVS.png", 1, 1 for i = 0 to 50 PuPlayer.LabelSet pOverVid,"ServiceV"&i,"\\PupOverlays\\clear.png" ,1,"{'mt':2,'height':10,'width':2,'ypos':45,'xpos':"&i*2&"}" Next ' If we are in attract PuPlayer.playlistplayex pOverVid,"PupOverlays","clear1.png", 1, 1 ' Only Full BG Pics need a clear.png to dissapear otherwise they stay in front all black (Labels dont need this and kill performance) PuPlayer.PlayStop pOverVid PuPlayer.playlistplayex pOverVid,"PupVideos","blank.mp4", 1, 1 PuPlayer.SetLoop pOverVid, 1 PuPlayer.LabelSet pOverVid,"ServiceL1","Guardians Of the Galaxy" ,1,"{'mt':2,'ypos':25,'size':5}" PuPlayer.LabelSet pOverVid,"ServiceL2","V" & myVersion & " SYS. 2.35.0 OS. 2.00.16" ,1,"{'mt':2,'ypos':35,'size':5}" PuPlayer.LabelSet pOverVid,"ServiceL3","" ,1,"{'mt':2,'ypos':65,'size':5}" PuPlayer.LabelSet pOverVid,"ServiceL3B","SERVICE MENU" ,1,"{'mt':2,'ypos':43,'size':14}" PuPlayer.LabelSet pOverVid,"ServiceL4","PRESS 'SELECT' TO CONTINUE" ,1,"{'mt':2,'ypos':65,'size':5}" PuPlayer.LabelSet pOverVid,"ServiceL3Img","PupOverlays\\clear.png", 1,"{'mt':2,'ypos':25,'width':90}" elseif keycode=ServiceCancelKey then ' 7 key starts the service menu if bInService then PlaySoundVol "stern-svc-cancel", VolSfx Select case serviceLevel: case kMenuTop, kMenuNone: bInService=False bServiceVol=False pInAttract=serviceSaveAttract if pInAttract then pAttractStart End if ' PuPlayer.LabelShowPage pMVideo, 1, 0,"" ' Show Blank Page so it doesnt overlap (We shouldnt need this but labels are popping over) PuPlayer.LabelShowPage pOverVid, 1,0,"" PuPlayer.PlayStop pOverVid PuPlayer.SetLoop pOverVid, 0 case kMenuAdj: serviceLevel=kMenuNone serviceIdx=0 StartServiceMenu 11 case kMenuAdjStd, kMenuAdjFeat: if bServiceEdit then bServiceEdit=False if DMDMenu(serviceIdx).StdIdx <> -1 then DMDStd(DMDMenu(serviceIdx).StdIdx)=serviceOrigValue PuPlayer.LabelSet pOverVid,"ServiceL3",DMDStd(DMDMenu(serviceIdx).StdIdx), 1,"{'mt':1,'at':1,'fq':150,'len':1}" else DMDStd(DMDMenu(serviceIdx).FeatureIdx)=serviceOrigValue PuPlayer.LabelSet pOverVid,"ServiceL3",DMDStd(DMDMenu(serviceIdx).FeatureIdx), 1,"{'mt':1,'at':1,'fq':150,'len':1}" End if else PuPlayer.LabelSet pOverVid,"ServiceL1","" ,1,"{'mt':2,'ypos':65,'size':5}" PuPlayer.LabelSet pOverVid,"ServiceL2","" ,1,"{'mt':2,'ypos':65,'size':5}" PuPlayer.LabelSet pOverVid,"ServiceL3","" ,1,"{'mt':2,'ypos':65,'size':14}" PuPlayer.LabelSet pOverVid,"ServiceL3B","" ,1,"{'mt':2,'ypos':65,'size':14}" PuPlayer.LabelSet pOverVid,"ServiceL4","" ,1,"{'mt':2,'ypos':65,'size':5}" serviceLevel=kMenuTop serviceIdx=2 StartServiceMenu 11 End if End Select End if elseif bInService Then if keycode=ServiceEnterKey then ' Select select case serviceLevel case kMenuNone: serviceLevel=kMenuTop serviceIdx=0 PuPlayer.LabelSet pOverVid,"ServiceL1","", 1,"{'mt':2,'ypos':65,'size':5}" PuPlayer.LabelSet pOverVid,"ServiceL2","", 1,"{'mt':2,'ypos':65,'size':5}" PuPlayer.LabelSet pOverVid,"ServiceL3","", 1,"{'mt':2,'ypos':65,'size':5}" PuPlayer.LabelSet pOverVid,"ServiceL3B","", 1,"{'mt':2,'ypos':65,'size':14}" PuPlayer.LabelSet pOverVid,"ServiceL3Img","PupOverlays\\DMDSettings1.png", 1,"{'mt':2,'ypos':25,'width':90,'height':30}" PuPlayer.LabelSet pOverVid,"ServiceL4","GO TO DIAGNOSTIC MENU", 1,"{'mt':2,'ypos':65,'size':5}" ' DIAGNOSTIC, AUDITS, ADJUSTMENTS, UTILITIES, TOURNAMENT, REDEMPTION, EXIT SERVICE MENU ' STANDARD ADJUSTMENTS, FEATURE ADJUSTMENTS case kMenuTop: if serviceIdx=2 then serviceLevel=kMenuAdj serviceIdx=0 PuPlayer.LabelSet pOverVid,"ServiceL3Img","PupOverlays\\DMDSettings8.png", 1,"{'mt':2,'ypos':25,'width':90}" PuPlayer.LabelSet pOverVid,"ServiceL4",AdjArray(serviceIdx), 1,"{'mt':2,'ypos':65,'size':5}" elseif serviceIdx=6 then StartServiceMenu 8 ' Exit Exit sub else PlaySoundVol "stern-svc-deny", VolSfx bSkipSound=True End if case kMenuAdj: if serviceIdx=0 then serviceLevel=kMenuAdjStd serviceIdx=0 StartServiceMenu 0 elseif serviceIdx=1 then serviceLevel=kMenuAdjFeat serviceIdx=kFeatureMenuStart StartServiceMenu 0 Exit sub elseif serviceIdx=2 then ' Go Up serviceLevel=kMenuNone serviceIdx=0 StartServiceMenu 11 Exit sub elseif serviceIdx=3 then StartServiceMenu 8 ' Exit Exit sub else PlaySoundVol "stern-svc-deny", VolSfx bSkipSound=True End if case kMenuAdjStd, kMenuAdjFeat: if DMDMenu(serviceIdx).ValType="FUN" then ' Function if DMDMenu(serviceIdx).FeatureIdx=0 then Clearhs PuPlayer.LabelSet pOverVid,"ServiceL3","", 1,"{'mt':2,'ypos':45,'size':5}" End if if DMDMenu(serviceIdx).FeatureIdx=1 then ClearAll PuPlayer.LabelSet pOverVid,"ServiceL3","", 1,"{'mt':2,'ypos':45,'size':5}" End if else if bServiceEdit=False then ' Start Editing bServiceEdit=True if DMDMenu(serviceIdx).StdIdx <> -1 then serviceOrigValue=DMDStd(DMDMenu(serviceIdx).StdIdx) else serviceOrigValue=DMDStd(DMDMenu(serviceIdx).FeatureIdx) End if PuPlayer.LabelSet pOverVid,"ServiceL3",serviceOrigValue, 1,"{'mt':1,'at':1,'fq':150,'len':20000}" else ' Save the change bServiceEdit=False if DMDMenu(serviceIdx).StdIdx <> -1 then PuPlayer.LabelSet pOverVid,"ServiceL3",DMDStd(DMDMenu(serviceIdx).StdIdx), 1,"{'mt':1,'at':1,'fq':150,'len':1}" else PuPlayer.LabelSet pOverVid,"ServiceL3",DMDStd(DMDMenu(serviceIdx).FeatureIdx), 1,"{'mt':1,'at':1,'fq':150,'len':1}" End if End if End if End Select if bSkipSound=False then PlaySoundVol "stern-svc-enter", VolSfx elseif serviceLevel<>kMenuNone then if bServiceEdit = False then if keycode=ServiceUpKey then ' Left PlaySoundVol "stern-svc-minus", VolSfx serviceIdx=serviceIdx-1 if serviceIdx<0 then serviceIdx=0 elseif keycode=ServiceDownKey then ' Right PlaySoundVol "stern-svc-plus", VolSfx serviceIdx=serviceIdx+1 End if select case serviceLevel case kMenuTop: if serviceIdx>6 then serviceIdx=0 PuPlayer.LabelSet pOverVid,"ServiceL3Img","PupOverlays\\DMDSettings" & serviceIdx+1 &".png", 1,"{'mt':2,'ypos':25,'width':90}" PuPlayer.LabelSet pOverVid,"ServiceL4",TopArray(serviceIdx), 1,"{'mt':2,'ypos':65,'size':5}" case kMenuAdj: if serviceIdx>4 then serviceIdx=0 PuPlayer.LabelSet pOverVid,"ServiceL3Img","PupOverlays\\DMDSettings" & serviceIdx+8 &".png", 1,"{'mt':2,'ypos':25,'width':90}" PuPlayer.LabelSet pOverVid,"ServiceL4",AdjArray(serviceIdx), 1,"{'mt':2,'ypos':65,'size':5}" case kMenuAdjStd,kMenuAdjFeat: if serviceLevel=kMenuAdjStd and serviceIdx>=kFeatureMenuStart then serviceIdx=kFeatureMenuStart-1 if serviceLevel=kMenuAdjFeat and serviceIdxubound(DMDMenu)-1 then serviceIdx=ubound(DMDMenu)-1 PuPlayer.LabelSet pOverVid,"ServiceL2",DMDMenu(serviceIdx).Name, 1,"{'mt':2,'ypos':35,'size':5}" if DMDMenu(serviceIdx).StdIdx <> -1 then PuPlayer.LabelSet pOverVid,"ServiceL1", "STANDARD ADJUSTMENT #" & serviceIdx & "(" & DMDMenu(serviceIdx).StdIdx & ")" , 1,"{'mt':2,'ypos':25,'size':5}" PuPlayer.LabelSet pOverVid,"ServiceL3",DMDStd(DMDMenu(serviceIdx).StdIdx), 1,"{'mt':2,'ypos':45,'size':5}" elseif DMDMenu(serviceIdx).ValType<>"FUN" then PuPlayer.LabelSet pOverVid,"ServiceL1", "GAME ADJUSTMENT #" & serviceIdx & "(" & DMDMenu(serviceIdx).FeatureIdx & ")", 1,"{'mt':2,'ypos':25,'size':5}" PuPlayer.LabelSet pOverVid,"ServiceL3",DMDFet(DMDMenu(serviceIdx).FeatureIdx), 1,"{'mt':2,'ypos':45,'size':5}" else PuPlayer.LabelSet pOverVid,"ServiceL1", "GAME FUNCTION #" & serviceIdx , 1,"{'mt':2,'ypos':25,'size':5}" PuPlayer.LabelSet pOverVid,"ServiceL3","", 1,"{'mt':2,'ypos':45,'size':5}" End if PuPlayer.LabelSet pOverVid,"ServiceL3B","", 1,"{'mt':2,'ypos':65,'size':14}" PuPlayer.LabelSet pOverVid,"ServiceL3Img","PupOverlays\\clear.png", 1,"{'mt':2,'ypos':25,'width':90}" PuPlayer.LabelSet pOverVid,"ServiceL4","", 1,"{'mt':2,'ypos':65,'size':5}" End Select else ' ****************************************************** HANDLE EDIT MODE dataType=mid(DMDMenu(serviceIdx).ValType, 1, 3) minVal=-1 maxVal=-1 if Instr(DMDMenu(serviceIdx).ValType, "[")<> 0 then TmpStr =mid(DMDMenu(serviceIdx).ValType, 5, Len(DMDMenu(serviceIdx).ValType)-5) values = Split(TmpStr, ":") if dataType="INT" or dataType="PCT" then minVal=CLng(values(0)) maxVal=CLng(values(1)) End if End if direction=0 if keycode=ServiceUpKey then ' Left PlaySoundVol "stern-svc-minus", VolSfx direction=-1 elseif keycode=ServiceDownKey then ' Right PlaySoundVol "stern-svc-plus", VolSfx direction=1 End if debug.print "EDIT DT:" & dataType & " min:" & minVal & " Max:" & maxVal & " dir:" & direction if direction<>0 then if dataType="INT" or dataType="PCT" then if DMDMenu(serviceIdx).StdIdx <> -1 then NewVal=DMDStd(DMDMenu(serviceIdx).StdIdx) + (direction*DMDMenu(serviceIdx).Increment) if minVal=-1 or (NewVal <= maxVal and NewVal >= minVal) then DMDStd(DMDMenu(serviceIdx).StdIdx)=DMDStd(DMDMenu(serviceIdx).StdIdx) + (direction*DMDMenu(serviceIdx).Increment) SaveValue TableName, "DMDStd_"&DMDMenu(serviceIdx).StdIdx, DMDStd(DMDMenu(serviceIdx).StdIdx) ' SAVE if DMDMenu(serviceIdx).StdIdx<>kDMDStd_Initials and DMDMenu(serviceIdx).StdIdx<>kDMDStd_LeftStartReset then SaveValue TableName, "dmdCriticalChanged", "True" ' SAVE dmdCriticalChanged=True End if end if displayText=DMDStd(DMDMenu(serviceIdx).StdIdx) else NewVal=DMDFet(DMDMenu(serviceIdx).FeatureIdx) + (direction*DMDMenu(serviceIdx).Increment) if minVal=-1 or (NewVal <= maxVal and NewVal >= minVal) then DMDFet(DMDMenu(serviceIdx).FeatureIdx)=DMDStd(DMDMenu(serviceIdx).FeatureIdx) + (direction*DMDMenu(serviceIdx).Increment) SaveValue TableName, "DMDFet_"&DMDMenu(serviceIdx).FeatureIdx, DMDFet(DMDMenu(serviceIdx).FeatureIdx) ' SAVE SaveValue TableName, "dmdCriticalChanged", "True" ' SAVE dmdCriticalChanged=True End if displayText=DMDFet(DMDMenu(serviceIdx).FeatureIdx) End if elseif dataType="BOL" then if DMDMenu(serviceIdx).StdIdx <> -1 then Debug.print "EDIT BOOL:" & DMDStd(DMDMenu(serviceIdx).StdIdx)&"" if DMDStd(DMDMenu(serviceIdx).StdIdx) = False then DMDStd(DMDMenu(serviceIdx).StdIdx)=True SaveValue TableName, "DMDStd_"&DMDMenu(serviceIdx).StdIdx, DMDStd(DMDMenu(serviceIdx).StdIdx) ' SAVE displayText="True" elseif DMDStd(DMDMenu(serviceIdx).StdIdx)=True then DMDStd(DMDMenu(serviceIdx).StdIdx)=False SaveValue TableName, "DMDStd_"&DMDMenu(serviceIdx).StdIdx, DMDStd(DMDMenu(serviceIdx).StdIdx) ' SAVE displayText="False" End if End if elseif dataType="LST" then if DMDMenu(serviceIdx).StdIdx <> -1 then For i = 0 to ubound(values) valuesLst=Split(values(i), ",") 'debug.print "EDIT LST:" & valuesLst(0) & " " & valuesLst(1) & " val: " & DMDStd(DMDMenu(serviceIdx).StdIdx) & " idx:" & i & " ubound:" & ubound(values) if DMDStd(DMDMenu(serviceIdx).StdIdx)&"" = valuesLst(0) and i <> ubound(values) and direction=1 then valuesLst=Split(values(i+1), ",") DMDStd(DMDMenu(serviceIdx).StdIdx)=valuesLst(0) SaveValue TableName, "DMDStd_"&DMDMenu(serviceIdx).StdIdx, DMDStd(DMDMenu(serviceIdx).StdIdx) ' SAVE displayText=valuesLst(1) Exit For elseif DMDStd(DMDMenu(serviceIdx).StdIdx)&"" = valuesLst(0) and i <> lbound(values) and direction=-1 then valuesLst=Split(values(i-1), ",") DMDStd(DMDMenu(serviceIdx).StdIdx)=valuesLst(0) SaveValue TableName, "DMDStd_"&DMDMenu(serviceIdx).StdIdx, DMDStd(DMDMenu(serviceIdx).StdIdx) ' SAVE displayText=valuesLst(1) Exit For End if Next End if End if if displayText<>"" then if DMDMenu(serviceIdx).StdIdx <> -1 then PuPlayer.LabelSet pOverVid,"ServiceL3",displayText, 1,"{'mt':1,'at':1,'fq':150,'len':20000}" else PuPlayer.LabelSet pOverVid,"ServiceL3",displayText, 1,"{'mt':1,'at':1,'fq':150,'len':20000}" End if End if End if ' TBD implement edit here End if End if elseif keycode=ServiceUpKey or keycode=ServiceDownKey then ' If you press 8 & 9 without being in service you do volume if keycode=ServiceUpKey and MasterVol>0 then ' Left MasterVol=MasterVol-1 PlaySoundVol "stern-svc-minus", VolSfx elseif keycode=ServiceDownKey and MasterVol<100 then ' Right PlaySoundVol "stern-svc-plus", VolSfx MasterVol=MasterVol+1 End if VolBGVideo = cVolBGVideo * (MasterVol/100.0) VolBGMusic = cVolBGMusic * (MasterVol/100.0) VolDef = cVolDef * (MasterVol/100.0) VolSfx = cVolSfx * (MasterVol/100.0) if bServiceVol=False then bServiceVol=True serviceSaveAttract=pInAttract pInAttract=False ' PuPlayer.LabelShowPage pMVideo, 4, 0,"" ' Show Blank Page so it doesnt overlap (We shouldnt need this but labels are popping over) PuPlayer.LabelShowPage pOverVid, 3,0,"" ' If we are in attract PuPlayer.playlistplayex pOverVid,"PupOverlays","clear1.png", 1, 1 ' Only Full BG Pics need a clear.png to dissapear otherwise they stay in front all black (Labels dont need this and kill performance) PuPlayer.PlayStop pOverVid PuPlayer.playlistplayex pOverVid,"PupVideos","blank.mp4", 1, 1 PuPlayer.SetLoop pOverVid, 1 End if PuPlayer.LabelSet pOverVid,"ServiceL1","" ,1,"{'mt':2,'ypos':65,'size':5}" PuPlayer.LabelSet pOverVid,"ServiceL2","" ,1,"{'mt':2,'ypos':65,'size':5}" PuPlayer.LabelSet pOverVid,"ServiceL4","" ,1,"{'mt':2,'ypos':65,'size':5}" PuPlayer.LabelSet pOverVid,"ServiceL3B","VOLUME " & MasterVol ,1,"{'mt':2,'ypos':25,'size':10}" for i = 0 to 50 if i<=(MasterVol/2) then PuPlayer.LabelSet pOverVid,"ServiceV"&i,"\\PupOverlays\\ServiceVol1.png" ,1,"{'mt':2,'height':10,'width':2,'ypos':45,'xpos':"&i*2&"}" else PuPlayer.LabelSet pOverVid,"ServiceV"&i,"\\PupOverlays\\ServiceVol2.png" ,1,"{'mt':2,'height':10,'width':2,'ypos':45,'xpos':"&i*2&"}" End if Next PuPlayer.LabelSet pOverVid,"ServiceL3","USE +/- TO ADJUST VOLUME" ,1,"{'mt':2,'ypos':65,'size':5}" PuPlayer.LabelSet pOverVid,"ServiceL3Img","PupOverlays\\clear.png", 1,"{'mt':2,'ypos':25,'width':90}" tmrService.Enabled = False tmrService.Interval = 5000 tmrService.Enabled = True End if End Sub Sub tmrService_Timer() tmrService.Enabled = False bServiceVol=False pInAttract=serviceSaveAttract if pInAttract then pAttractStart End if ' PuPlayer.LabelShowPage pMVideo, 1, 0,"" ' Show Blank Page so it doesnt overlap (We shouldnt need this but labels are popping over) PuPlayer.LabelShowPage pOverVid, 1,0,"" PuPlayer.PlayStop pOverVid PuPlayer.SetLoop pOverVid, 0 End Sub Class DMDSettings Public Name Public StdIdx Public FeatureIdx Public ValType ' bool, pct Public Increment ' value to increment by Public sub Setup(Name, StdIdx, FeatureIdx, ValType, Increment) me.name=name me.StdIdx=StdIdx me.FeatureIdx=FeatureIdx me.ValType=ValType me.Increment=Increment End sub End Class Const MaxDMDSetting = 19 Dim DMDMenu(18) ' MaxDMDSetting Dim dmdChanged:dmdChanged=False ' Did we change a value Dim dmdCriticalChanged:dmdCriticalChanged=False ' Did we change a critical value Const kFeatureMenuStart = 12 Const kDMDStd_Initials = 38 Const kDMDStd_ExtraBallLimit = 16 Const kDMDStd_ExtraBallPCT = 17 Const kDMDStd_MatchPCT = 19 Const kDMDStd_TiltWarn = 23 Const kDMDStd_TiltDebounce = 24 Const kDMDStd_LeftStartReset = 47 Const kDMDStd_BallSave = 48 Const kDMDStd_DynReplayStart = 55 Const kDMDStd_ReplayPct = 56 Const kDMDStd_FreePlay = 74 Const kDMDStd_BallSaveExtend = 80 Const kDMDFet_RightScoopePower = 134 Const kDMDFet_RampageSpellout = 142 Const kDMDFeT_GuardiansSpellout = 143 Const kDMDFet_HadronAwards = 144 Const kDMDFet_HadronLimit = 145 Sub DMDSettingsInit() Dim i Dim x DMDStd(kDMDStd_Initials)=3 ' 10 Initials DMDStd(kDMDStd_ExtraBallLimit)=5 ' 5 DMDStd(kDMDStd_ExtraBallPCT)=1 ' 1% (Looks like default was 25% but doesnt seem right) DMDStd(kDMDStd_TiltWarn)=2 ' 2 warnings DMDStd(kDMDStd_TiltDebounce)=1000 ' 1 second debounce DMDStd(kDMDStd_MatchPCT)=9 ' 9% DMDStd(kDMDStd_LeftStartReset)=True ' Allow Left + Start to Reset the Game (True, False, FreePlay) DMDStd(kDMDStd_BallSave) = 5 ' 5 second ball save DMDStd(kDMDStd_BallSaveExtend) = 2000 ' Time to pause ball save when triggers are hit (Custom) DMDStd(kDMDStd_DynReplayStart) = 60000000 ' Replay Score Starts at DMDStd(kDMDStd_ReplayPct) = 10 ' Replay Percent DMDStd(kDMDStd_FreePlay)=True ' FreePlay DMDFet(kDMDFet_RightScoopePower) = 90 ' Right Scoop Power DMDFet(kDMDFet_RampageSpellout) = 2 ' Where Rampage spelling starts DMDFet(kDMDFeT_GuardiansSpellout) = 4 ' Where Guardians always starts DMDFet(kDMDFet_HadronAwards) = 3 ' How Many Hadrons you get per award DMDFet(kDMDFet_HadronLimit) = 3 ' Max Hadrons ' Load any Values from saved config x = LoadValue(TableName, "DMDStd_"&kDMDStd_Initials): If(x <> "") Then DMDStd(kDMDStd_Initials)=x x = LoadValue(TableName, "DMDStd_"&kDMDStd_ExtraBallLimit): If(x <> "") Then DMDStd(kDMDStd_ExtraBallLimit)=INT(x) x = LoadValue(TableName, "DMDStd_"&kDMDStd_ExtraBallPCT): If(x <> "") Then DMDStd(kDMDStd_ExtraBallPCT)=INT(x) x = LoadValue(TableName, "DMDStd_"&kDMDStd_TiltWarn): If(x <> "") Then DMDStd(kDMDStd_TiltWarn)=INT(x) x = LoadValue(TableName, "DMDStd_"&kDMDStd_TiltDebounce): If(x <> "") Then DMDStd(kDMDStd_TiltDebounce)=INT(x) x = LoadValue(TableName, "DMDStd_"&kDMDStd_MatchPCT): If(x <> "") Then DMDStd(kDMDStd_MatchPCT)=INT(x) x = LoadValue(TableName, "DMDStd_"&kDMDStd_LeftStartReset): If(x <> "") Then DMDStd(kDMDStd_LeftStartReset)=CBool(x) x = LoadValue(TableName, "DMDStd_"&kDMDStd_BallSave): If(x <> "") Then DMDStd(kDMDStd_BallSave)=INT(x) x = LoadValue(TableName, "DMDStd_"&kDMDStd_DynReplayStart): If(x <> "") Then DMDStd(kDMDStd_DynReplayStart)=INT(x) x = LoadValue(TableName, "DMDStd_"&kDMDStd_ReplayPct): If(x <> "") Then DMDStd(kDMDStd_ReplayPct)=INT(x) x = LoadValue(TableName, "DMDStd_"&kDMDStd_BallSaveExtend): If(x <> "") Then DMDStd(kDMDStd_BallSaveExtend)=INT(x) x = LoadValue(TableName, "DMDStd_"&kDMDStd_FreePlay): If(x <> "") Then DMDStd(kDMDStd_FreePlay)=CBool(x) x = LoadValue(TableName, "DMDFet_"&kDMDFet_RightScoopePower): If(x <> "") Then DMDFet(kDMDFet_RightScoopePower)=INT(x) x = LoadValue(TableName, "DMDFet_"&kDMDFet_RampageSpellout): If(x <> "") Then DMDFet(kDMDFet_RampageSpellout)=INT(x) x = LoadValue(TableName, "DMDFet_"&kDMDFeT_GuardiansSpellout): If(x <> "") Then DMDFet(kDMDFeT_GuardiansSpellout)=INT(x) x = LoadValue(TableName, "DMDFet_"&kDMDFet_HadronAwards): If(x <> "") Then DMDFet(kDMDFet_HadronAwards)=INT(x) x = LoadValue(TableName, "DMDFet_"&kDMDFet_HadronLimit): If(x <> "") Then DMDFet(kDMDFet_HadronLimit)=INT(x) x = LoadValue(TableName, "dmdCriticalChanged"): If(x<>"") Then dmdCriticalChanged=True ReplayValue=DMDStd(kDMDStd_DynReplayStart) x = LoadValue(TableName, "ReplayValue"): If(x<>"") Then ReplayValue=INT(x) BallSaverTime = DMDStd(kDMDStd_BallSave) For i = 0 to MaxDMDSetting-1 set DMDMenu(i)=new DMDSettings select case i case 0:DMDMenu(i).Setup "HSTD INITIALS", kDMDStd_Initials , -1, "LST[3,3 INITIALS:10,10 LETTER NAME]", 1 case 1:DMDMenu(i).Setup "EXTRA BALL LIMIT", kDMDStd_ExtraBallLimit, -1, "INT[0:9]", 1 case 2:DMDMenu(i).Setup "EXTRA BALL PERCENT", kDMDStd_ExtraBallPCT, -1, "PCT[0:50]", 1 case 3:DMDMenu(i).Setup "MATCH PERCENT", kDMDStd_MatchPCT, -1, "PCT[0:10]", 1 case 4:DMDMenu(i).Setup "LEFT+START RESETS", kDMDStd_LeftStartReset, -1, "BOL", 0 case 5:DMDMenu(i).Setup "BALL SAVE SECONDS", kDMDStd_BallSave, -1, "INT[0:15]", 1 case 6:DMDMenu(i).Setup "DYNAMIC REPLAY START", kDMDStd_DynReplayStart, -1, "INT[60000000:150000000]", 1000000 case 7:DMDMenu(i).Setup "REPLAY PERCENTAGE", kDMDStd_ReplayPct, -1, "INT[1:50]", 1 case 8:DMDMenu(i).Setup "BALL SAVE EXTEND SEC", kDMDStd_BallSaveExtend, -1, "INT", 1 case 9:DMDMenu(i).Setup "TILT WARNINGS", kDMDStd_TiltWarn , -1, "INT[0:3]", 1 case 10:DMDMenu(i).Setup "TILT DEBOUNCE", kDMDStd_TiltDebounce, -1, "INT[750:1500]", 1 case 11:DMDMenu(i).Setup "FREE PLAY", kDMDStd_FreePlay, -1, "BOL", 0 case 12:DMDMenu(i).Setup "RIGHT SCOOP POWER", -1, kDMDFet_RightScoopePower, "INT[50:200]", 1 case 13:DMDMenu(i).Setup "RAMPAGE SPELLOUT DIFFICULTY", -1, kDMDFet_RampageSpellout, "INT[0:4]", 1 case 14:DMDMenu(i).Setup "GUARDIANS SPELLOUT DIFFICULTY", -1, kDMDFeT_GuardiansSpellout, "INT[0:4]", 1 case 15:DMDMenu(i).Setup "HADRON ENFORCER AWARDS", -1, kDMDFet_HadronAwards, "INT[1:5]", 1 case 16:DMDMenu(i).Setup "HADRON ENFORCERS LIMIT", -1, kDMDFet_HadronLimit, "INT[1:9]", 1 case 17:DMDMenu(i).Setup "CLEAR HIGHSCORE", -1, 0, "FUN", 1 case 18:DMDMenu(i).Setup "CLEAR ALL", -1, 1, "FUN", 1 End Select Next End Sub Dim DMDStd(81) Dim DMDFet(293) Sub Table1_Init() LoadEM Dim i Randomize if bClelandMusic then ' For those that dont like the Cleland update WaitSongCount=12 MusicDir="Topper" VolMusic=VolMusic1 ' * 1.3 Else MusicDir="Topper.orig" VolMusic=VolMusic1 '*.9 End If ReDim GrootMBJackpotHits(4, aRampLights.count) ' MaxPlayers Redim HadronLightsSaveColor(aHadronLights.count, 3) Redim RampLightsSaveColor(aRampLights.count, 3) Redim LightsSaveColor(aLights.count, 3) baLightsSaved=False baRampLightsSaved = False baHadronLightsSaved = False if AlternateSettings = 1 then ' VPW ' Table1.Friction = .2 ' 0.17 ' Looks like changing these in code does nothing ' Table1.SlopeMin = 6.5 ' 6 ' Table1.SlopeMax = 6.5 ' 6 RocketKickerPower=40 End If TrackE_Idx=0 'aHadronLightsSave 'aHadronLightsRestore ' TBD need to look into this vpmNudge.TiltSwitch = 14 vpmNudge.Sensitivity = 1 vpmNudge.TiltObj = Array(Bumper001, bumper002, bumper003, LeftSlingshot, RightSlingshot) bTableReady=False bUseUltraDMD=False bUsePUPDMD=False bPupStarted=False if DMDMode = 1 then bUseUltraDMD= True set PuPlayer = New PinupNULL elseif DMDMode = 2 Then bUsePUPDMD = True Else set PuPlayer = New PinupNULL End if ' if bClelandMusic then ' For those that dont like the Cleland update ' MusicDir="Topper" ' VolMusic=VolMusic1 ' Else ' MusicDir="Topper.orig" ' VolMusic=VolMusic1 '*.9 ' End If 'Set Controller = CreateObject("B2S.Server") 'Controller.B2SName = "GOTG" 'Controller.Run if b2son then Controller.B2SSetData 1,1 Controller.B2SSetData 2,1 Controller.B2SSetData 3,1 Controller.B2SSetData 4,1 Controller.B2SSetData 5,1 Controller.B2SSetData 6,1 Controller.B2SSetData 7,1 Controller.B2SSetData 8,1 End if 'Impulse Plunger as autoplunger Const IMPowerSetting = 45 ' Plunger Power Const IMTime = 1.1 ' Time in seconds for Full Plunge Set plungerIM = New cvpmImpulseP With plungerIM .InitImpulseP swplunger, IMPowerSetting, IMTime .Random 1.5 .InitExitSnd SoundFX("Saucer_Kick", DOFContactors), SoundFX("fx_solenoid", DOFContactors) .CreateEvents "plungerIM" End With ' Misc. VP table objects Initialisation, droptargets, animations... VPObjects_Init 'load saved values, highscore, names, jackpot Loadhs DMDSettingsInit() ' Load Defaul Settings 'Init main variables TableState_Init(0) TableState_Init(1) TableState_Init(2) TableState_Init(3) TableState_Init(4) for i = 0 to StackSize StackState_Init(i) Next SkillshotValue=250000 For i = 0 To MaxPlayers-1 LastScore(i)=0 Next ' initalise the DMD display DMD_Init ' freeplay or coins 'bFreePlay = False ' coins yes or no? bFreePlay = DMDStd(kDMDStd_FreePlay) bFirstStart=True bFirstCredit=True ' initialse any other flags bOnTheFirstBall = False bBallInPlungerLane = False bBallSaverActive = False BallSaverActiveBuffer = 0 bBallSaverReady = False bMultiBallMode = False bGameInPlay = False bGameInPlayHidden = False bShowMatch = False bCreatedBall = False bAutoPlunger = False bAutoPlunged = False bMusicOn = True BallsOutlaneDrainCnt=0 BallsOutlaneDrainIgnoreCnt=0 BallsOnPlayfield = 0 RealBallsInLock=0 BallsInLock = 0 BallsInHole = 0 SpellGuardians = DMDFet(kDMDFeT_GuardiansSpellout) SpellRampage=DMDFet(kDMDFet_RampageSpellout) LastSwitchHit = "" LastSwitchHit2 = "" Tilt = 0 TiltSensitivity = 6 Tilted = False bBonusHeld = False bJustStarted = True bInstantInfo = False 'Set bsTrough = New cvpmBallStack 'bsTrough.InitKick KickerRocket, 160, 10 Set mMagnaSave = New cvpmMagnet With mMagnaSave .InitMagnet MagnaSave, kOrbMagnetPower ' 24 ' was 60 power .GrabCenter = False .MagnetOn = 0 .CreateEvents "mMagnaSave" End With mMagnaSave.MagnetOn = False DOF 142, DOFOff if bUsePUPDMD Then PuPInit Else pupDMDUpdate.Enabled = False End if if bUseUltraDMD Then PlayDMDScene "vidIntro.wmv", 9000 vpmtimer.addtimer 4500, "bTableReady = True '" Else bTableReady = True End If bPupStarted=True EndOfGame() setUpgradeLight(True) ' Turn this back on for attract End Sub Private Function BigMod(Value1, Value2) BigMod = Value1 - (Int(Value1 / Value2) * Value2) End Function '****** ' Keys '****** Sub tmrHoldKey_Timer() ' Reset the game with Ball in lane tmrHoldKey.Enabled = False ' TBD Destroy balls If bBallInPlungerLane and BallsOnPlayfield-RealBallsInLock = 1 Then PlaySoundVol "start", VolSfx bResetCurrentGame=True DisableTable True AutoPlungeDelayed EndOfGame ' End game to drain locked balls ' if bUsePupDMD then ' PuPlayer.PlayStop pOverVid ' Stop overlay if there is one ' PuPlayer.SetLoop pOverVid, 0 ' End If ' ResetForNewGame() End If End Sub Sub Table1_KeyDown(ByVal Keycode) dim musicMode if bTableReady=False then Exit Sub ' If the ultraDMD hasnt finished intro then things look weird if bBallInPlungerLane and keycode = StartGameKey and LFPress then tmrHoldKey.Enabled = False tmrHoldKey.Enabled = True End If If (keycode = RightMagnaSave) and bGameInPlay=False and bGameInPlayHidden=False then lutpos = lutpos + 1 : If lutpos > ubound(luts) Then lutpos = 0 : end if table1.ColorGradeImage = luts(lutpos) TextBox001.Text = table1.ColorGradeImage End if ' Pup Testing ' Bonus Screen If (keycode = 19) then ' Score(2)=Score(2)+1000 ' UpdateNumberPlayers '' PuPlayer.playlistplayex 14, "Topper.orig", "m_wait.mp3", 90, 1 End if If (keycode = 18) then ' Score(1)=Score(1)+1000 ' UpdateNumberPlayers ' SSetLightColor kStack_Pri0, lNebulaArrow, "red", 0 ' playmedia "blank.mp4", "PupVideos", pDMDFull, "", -1, "", 105, 1 ' playclear pDMDFull ' playmedia "Video-0x0096.mp4", "PupVideos", pDMDFull, "", -1, "", 105, 1 ' pausemedia pDMDFull ' ' playclear pMusic ' playmedia "m_wait.mp3", MusicDir, pMusic, "", -1, "", 1, 1 ' pausemedia pMusic ' playclear pMusic ' playmedia "m_wait.mp3", MusicDir, pAudio, "", -1, "", 1, 1 ''' playmedia "m_wait2-" & INT(RND*3)+1 &".mp3", MusicDir, pAudio, "", -1, "", 1, 1 ' playclear pAudio ' playmedia "Match-00.mp4", "PupVideos", pOverVid, "", -1, "", 1, 1 ' PlaySoundVol "Match-Score", VolSfx '' PuPlayer.playstop 14 End if if (keycode = 17) then ' w key ' if Scorbit.DoInit(2082, "PupOverlays", myVersion, "GRWvz-MP37P") then ' Staging '' if Scorbit.DoInit(2108, "PupOverlays", myVersion, "GRWvz-MP37P") then ' Prod ' tmrScorbit.Interval=2000 ' tmrScorbit.UserValue = 0 ' tmrScorbit.Enabled=True ' Scorbit.UploadLog = ScorbitUploadLog ' End if ' debug.print "Spin X:" & Activeball.angmomx & " Y:" & Activeball.angmomy & " Z:" & Activeball.angmomz ' StackState(kStack_Pri0).bStackActive=True ' StackState(kStack_Pri1).bStackActive=True ' SSetLightColor kStack_Pri0, lNebulaArrow, "red", 2 ' SSetLightColor kStack_Pri1, lNebulaArrow, "green", 2 ' AnimateShotMult 2, 4 ' AddScore 10000000 ' AddScore 1000 ' PuPlayer.SendMSG "{ ""mt"":301, ""SN"": " & pDMDText & ", ""FN"":6 }" ' Bring screen to the front ' activeBall.x = 616.4103 ' activeBall.y = 1819.698 ' activeBall.z = 26.03442 ' activeBall.x = 612.5363 ' activeBall.y = 1822.981 ' activeBall.z = 26.03442 ' PlayE ' lDrax_m.UserValue =1 ' lGamora_m.UserValue =1 ' lYando_m.UserValue =1 ' lRocket_m.UserValue =1 ' lgr_m.UserValue =1 ' lNebula_m.UserValue = 1 ' lBroker_m.UserValue =1 ' lStarLord_m.UserValue =1 ' lRonan_m.UserValue =1 ' SetLightColor lDrax_m, "green", lDrax_m.UserValue ' SetLightColor lGamora_m, "green", lGamora_m.UserValue ' SetLightColor lYando_m, "green", lYando_m.UserValue ' SetLightColor lRocket_m, "green", lRocket_m.UserValue ' SetLightColor lgr_m, "green", lgr_m.UserValue ' SetLightColor lNebula_m, "green", lNebula_m.UserValue ' SetLightColor lBroker_m, "green", lBroker_m.UserValue ' SetLightColor lStarLord_m, "green", lStarLord_m.UserValue ' SetLightColor lRonan_m, "green", lRonan_m.UserValue ' CherryBombCount=8 ' playmedia "Video-0x0096.mp4", "PupVideos", pDMDFull, "", -1, "", 105, 1 ' playmedia "m_wait.mp3", MusicDir, pAudio, "", -1, "", 1, 1 ' playclear pAudio ' playclear pMusic ' playmedia "Song-1.mp3", MusicDir, pMusic, "", -1, "", 1, 1 ' AddMultiball 1 ' bQuillsQuestFirstTime=True ' tmrCherryBombMouth.Interval=kMouthAnimationSpeed ' tmrCherryBombMouth.Enabled = True' ' playmedia "m_wait2-" & INT(RND*3)+1 &".mp3", MusicDir, pAudio, "", -1, "", 1, 1 ' playclear pAudio ' AwardExtraBall 'Rightflipper.timerenabled=False ' Flasherflash4.TimerInterval=10 ' bFlash4Enabled=True ' ShowUpgrade 500000 ' FlashLevel4 = 0.5 ' Flasherflash4_Timer ' Score(0)=(Score(0)+10)*10 ' Score(1)=(Score(1)+10)*10 ' Score(2)=(Score(2)+10)*10 ' Score(3)=(Score(3)+10)*10 ' UpdateNumberPlayers ' Debug.print "ScoreSize->" & ScoreSize(0) & " " & ScoreSize(1) End if ' dim i ' for i = 0 to 9 ' BonusArrowHits(i) = 100 ' next ' DMDflush ' GrootMBJackpot = 0 ' PuPlayer.LabelShowPage pBonusScreen,1,0,"":PuPlayer.LabelShowPage pDMDText, 2,0,"" ' pDMDEvent(kDMD_BonusBG) ' playmedia "Video-0x007A-2.mp4", "PupVideos", pBonusScreen, "", -1, "", 1, 1 ' tmrEndOfBallBonus.Interval = 800 ' tmrEndOfBallBonus.UserValue = 0 ' Timer will start EndOfBall2 when it is done ' tmrEndOfBallBonus.Enabled = true ' End if ' Rocket Kicker Test ' if (keycode = 17) then ' w key ' RocketKicker.CreateSizedball BallSize / 2 ' RocketKicker.Kick 145, 85 ' End if ' End Modes ' if (keycode = 17) then ' PlayerMode=1 ' ModePercent(1)=100 ' ModePoints = 9999 ' ShowPlayerModeComplete(-1) ' PlayerMode2=1 ' bSecondMode=True ' StartPlayerModeVideo False ' ShowPlayerModeComplete(-1) ' End if If hsbModeActive Then if hsbModeActive and (keycode = LeftFlipperKey or keycode = RightFlipperKey) then ' Press and hold on HighScoreEntry tmrHSHoldFlipper.Interval = 300 tmrHSHoldFlipper.Enabled = True End if EnterHighScoreKey(keycode) Exit Sub End If StartServiceMenu keycode If Keycode = AddCreditKey Then musicMode="" if LFPress=1 then 'In Game toggle to CLELAND Music mode (Press Credit while holding Left Flipper) if bClelandMusic then bClelandMusic=False musicMode="^Original" Else bClelandMusic=True musicMode="^Cleland" End If DMDFlush DMD "_", CL(1, "CREDITS: " & Credits & musicMode), "", eNone, eNone, eNone, 500, True, "" PlaySoundVol "fx_coin", VolTable else Credits = Credits + 1 DOF 140, DOFOn If(Tilted = False)Then DMDFlush DMD "_", CL(1, "CREDITS: " & Credits), "", eNone, eNone, eNone, 500, True, "" PlaySoundVol "fx_coin", VolTable 'If NOT bGameInPlay Then ShowTableInfo End If End if End If If keycode = PlungerKey Then Plunger.Pullback: PlaysoundAt "fx_plungerpull", Plunger End If If keycode = LeftFlipperKey Then FlipperActivate LeftFlipper, LFPress 'LFPress = 1 If keycode = RightFlipperKey Then FlipperActivate RightFlipper, RFPress 'rfpress = 1 If keycode = LeftTiltKey Then Nudge 90, 2:PlaySound "fx_nudge", 0, 1, -0.1, 0.25:CheckTilt False If keycode = RightTiltKey Then Nudge 270, 2:PlaySound "fx_nudge", 0, 1, 0.1, 0.25:CheckTilt False If keycode = CenterTiltKey Then Nudge 0, 2:PlaySound "fx_nudge", 0, 1, 1, 0.25:CheckTilt False If keycode = MechanicalTilt then CheckTilt True ' Table specific if LFPress and RFPress and tmrEndOfBallBonus.Enabled then bonusSkip=True if keycode <> PlungerKey then bSkillshotsReady(1) = False ' Cancel Skillshot2 (you touched a key) If bGameInPlay AND NOT Tilted Then ' Select Player Mode if (bPlayerModeSelect) and bInstantInfo=False Then SelectPlayerMode(keycode) end If ' Normal flipper action If keycode = LeftFlipperKey Then SolLFlipper 1:StartInstantInfo(keycode) If keycode = RightFlipperKey Then SolRFlipper 1:StartInstantInfo(keycode) ' Debug mode If (keycode = LeftMagnaSave or keycode = RightMagnaSave) then HandleDebugDown(keycode) End If ' Hadron, Start Mode, fire ball If keycode = RightMagnaSave or keycode = LockBarKey or _ (keycode = PlungerKey and bUsePlungerForSternKey) Then if bPlayerModeSelect and bBallInPlungerLane = False then ' They selected a new player mode (kick the ball from the scoop) StartPlayerMode() RotateSong() vpmtimer.addtimer 1500, "LeftScoopExit '" exit sub elseif bAutoPlunger=False and bBallInPlungerLane = True then ' Auto fire ball with stern key plungerIM.Strength = 50 'plungerIM.InitImpulseP swplunger, 60, 0 ' Change impulse power while we are here PlungerIM.AutoFire DOF 125, DOFPulse DOF 112, DOFPulse plungerIM.Strength = 45 'plungerIM.InitImpulseP swplunger, 45, 1.1 Else CheckHadron True ' Hadron Enforcer end if End if If keycode = StartGameKey and LFPress=0 Then ' startkey (Without holding down any flippers for Reset) If((PlayersPlayingGame < MaxPlayers)AND(bOnTheFirstBall = True))Then If(bFreePlay = True)Then PlayersPlayingGame = PlayersPlayingGame + 1 TotalGamesPlayed = TotalGamesPlayed + 1 DMDFlush DMD "_", CL(1, PlayersPlayingGame & " PLAYERS"), "", eNone, eBlink, eNone, 500, True, "" PlaySoundVol "start", VolSfx Else If(Credits > 0)then PlayersPlayingGame = PlayersPlayingGame + 1 TotalGamesPlayed = TotalGamesPlayed + 1 Credits = Credits - 1 If Credits < 1 Then DOF 140, DOFOff DMD "_", CL(1, PlayersPlayingGame & " PLAYERS"), "", eNone, eBlink, eNone, 500, True, "" PlaySoundVol "start", VolSfx Else ' Not Enough Credits to start a game. 'DOF 140, DOFOff DMDFlush DMD CL(0, "CREDITS " & Credits), CL(1, "INSERT COIN"), "", eNone, eBlink, eNone, 500, True, "" End If End If UpdateNumberPlayers ' Update the screen layout on pup for multiple players End If End If ElseIf bShowMatch = False then ' (Also bGameInPlay=False) If keycode = StartGameKey Then If(bFreePlay = True)Then If(BallsOnPlayfield = 0)Then ResetForNewGame() End If Else If(Credits > 0)Then If(BallsOnPlayfield = 0)Then Credits = Credits - 1 If Credits < 1 Then DOF 140, DOFOff ResetForNewGame() End If Else ' Not Enough Credits to start a game. 'DOF 140, DOFOff DMDFlush DMD CL(0, "CREDITS " & Credits), CL(1, "INSERT COIN"), "", eNone, eBlink, eNone, 500, True, "" 'ShowTableInfo End If End If End If ' Cycle attract if BallsOnPlayfield = 0 and bInService=False then ' Dont allow this if balls are still on the PF if LFPress and RFPress then pCurAttractPos=4 pAttractNext else If keycode = LeftFlipperKey Then pCurAttractPos=pCurAttractPos-2 if pCurAttractPos=-1 then pCurAttractPos=pAttractEndIdx if pCurAttractPos=4 and LastScore(0)=0 then pCurAttractPos=3 ' No last high score - skip again pAttractNext End if If keycode = RightFlipperKey Then pAttractNext End If End if End if CheckE(keycode) ElseIf bShowMatch and keycode = StartGameKey Then 'Skip Show Match playclear pOverVid StopSound "Match-Score" EndOfGame() End If ' If (GameInPlay) End Sub Sub Table1_KeyUp(ByVal keycode) Dim NextCmd if bTableDisabled then exit sub tmrHoldKey.Enabled = False If keycode = PlungerKey Then Plunger.Fire: PlaysoundAt "fx_plunger", Plunger End If If hsbModeActive Then InstantInfoTimer.Enabled = False bInstantInfo = False Exit Sub End If ' Table specific If bGameInPLay AND NOT Tilted Then if LFPress=1 and RFPress = 1 then ' Pressed both at the same time if bFlipperSkipEnabled and FlipperSkipCmd<>"" then debug.print "Skip Command >"&FlipperSkipCmd&"<" NextCmd = FlipperSkipCmd FlipperSkipCmd="" Execute NextCmd End If End If If (keycode = LeftMagnaSave or keycode = RightMagnaSave) then HandleDebugUp(keycode) End If If keycode = LeftFlipperKey Then FlipperDeActivate LeftFlipper, LFPress ' lfpress = 0 ' leftflipper.eostorqueangle = EOSA ' leftflipper.eostorque = EOST End If If keycode = RightFlipperKey Then FlipperDeActivate RightFlipper, RFPress ' rfpress = 0 ' rightflipper.eostorqueangle = EOSA ' rightflipper.eostorque = EOST End If If keycode = LeftFlipperKey Then SolLFlipper 0 EndFlipperStatus(keycode) End If If keycode = RightFlipperKey Then SolRFlipper 0 EndFlipperStatus(keycode) End If Else If keycode = LeftFlipperKey Then FlipperDeActivate LeftFlipper, LFPress 'lfpress = 0 If keycode = RightFlipperKey Then FlipperDeActivate RightFlipper, RFPress ' rfpress = 0 End If End Sub sub tmrHSHoldFlipper_Timer() tmrHSHoldFlipper.Interval = 100 ' Speed it up if RFPress then EnterHighScoreKey(RightFlipperKey) elseif LFPress then EnterHighScoreKey(LeftFlipperKey) End if End Sub Sub TimerPlunger_Timer() 'debug.print plunger.position VR_Primary_plunger.Y = 94.1 + (5* Plunger.Position) -20 End Sub ' DONT FORGET TO CLEAR FlipperSkipCmd when you are past this stage. ' What this means is once you move on to the next command (without skipping) you need to clear this otherwise ' when you hit both flippers during gameplay it will call the command you put Sub SetFlipperSkipCmd(Cmd) if FlipperSkipCmd="" then FlipperSkipCmd=Cmd End If End Sub sub StartInstantInfo(keycode) debug.print "Start Instant " & keycode & " " & bInstantInfo if bInstantInfo = False Then ' I am already in instantinfo InstantInfoTimer.Interval = 8000 InstantInfoTimer.Enabled = True InstantInfoTimer.UserValue=keycode End If End Sub Sub InstantInfoTimer_Timer InstantInfoTimer.Enabled = False bInstantInfo = True debug.print "Instant Info timer" PuPlayer.LabelShowPage pOverVid, 1,0,"" 'PuPlayer.LabelShowPage pDMDText, 2,0,"" ' if bPlayerModeSelect Then ' pDMDEvent(kDMD_Attract) ' End If pCurAttractPos=pAttractInstantInfoIdx pInAttract=true pAttractNext End Sub Sub EndFlipperStatus(keycode) If bInstantInfo Then debug.print "EndInstantInfo check" & keycode & " " & InstantInfoTimer.UserValue if (keycode=InstantInfoTimer.UserValue) then ' They let go of the key debug.print "EndInstantInfo" ResetBallSearch InstantInfoTimer.Enabled = False bInstantInfo=False PuPlayer.LabelShowPage pDMDText,1,0,"" pInAttract=false playclear pOverVid PuPlayer.LabelSet pOverVid,"OverMessage1","",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2","",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2a","", 1, "" PuPlayer.LabelSet pOverVid,"OverMessage3","",1,"" PuPlayer.LabelSet pOverVid,"OverMessage4","",1,"" PuPlayer.LabelSet pOverVid,"SplashLogo","PupOverlays\\PinCredibles.png", 0,"" PuPlayer.LabelSet pOverVid, "Splash1", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "Splash2", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "Splash3", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" PuPlayer.LabelSet pOverVid, "Splash4", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" PuPlayer.LabelSet pOverVid, "SplashHS1", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "SplashHS2", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "SplashHS3", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" PuPlayer.LabelSet pOverVid, "SplashHS4", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" RefreshPlayerMode if bPlayerModeSelect Then pDMDEvent(kDMD_PlayerSelect) End If Else ' They pressed the other flipper so cycle faster PriorityReset=2000 pAttractNext End If Else 'debug.print "Stop Instant " & keycode InstantInfoTimer.Enabled = False End If End Sub '************* ' Pause Table '************* Sub table1_Paused End Sub Sub table1_unPaused End Sub Sub table1_Exit Scorbit.StopSession2 Score(0), Score(1), Score(2), Score(3), PlayersPlayingGame, True ' In case you stop mid game if b2son then Controller.Stop Savehs ' FIX: Shutdown active timers and mark PUP as stopped before VPX tears down. ' Prevents queued playmedia/LabelSet calls from firing into already-freed PUP ' VLC form instances, which causes "Invalid pointer operation" on screens 12/13/15/16. bPupStarted = False pupDMDUpdate.Enabled = False ' FIX2: This 250ms timer fires pUpdateScores→LabelSet; must stop before PUP teardown ModeCountdownTimer.Enabled = False tmrQueue.Enabled = False tmrShotMultAnim.Enabled = False tmrGuardiansAnim.Enabled = False tmrRovingHadron.Enabled = False tmrOrbHurryUp.Enabled = False tmrHurryUp.Enabled = False tmrAnimateScore.Enabled = False tmrFinishMode.Enabled = False tmrShotMultiplierStrobe.Enabled = False tmrImolationAnim.Enabled = False ' FIX 2.1.2: prevent LabelSet into freed PUP forms on exit End Sub '******************** ' Flippers '******************** Sub SolLFlipper(Enabled) If Enabled Then PlaySoundAt SoundFXDOF("Flipper_L02", 101, DOFOn, DOFFlippers), LeftFlipper LF.fire 'LeftFlipper.RotateToEnd RotateLaneLightsLeft Else PlaySoundAt SoundFXDOF("Flipper_Left_Down_1", 101, DOFOff, DOFFlippers), LeftFlipper LeftFlipper.RotateToStart End If End Sub Sub SolRFlipper(Enabled) If Enabled Then PlaySoundAt SoundFXDOF("Flipper_R02", 102, DOFOn, DOFFlippers), RightFlipper RF.fire 'RightFlipper.RotateToEnd RotateLaneLightsRight Else PlaySoundAt SoundFXDOF("Flipper_Right_Down_1", 102, DOFOff, DOFFlippers), RightFlipper RightFlipper.RotateToStart End If End Sub ' flippers hit Sound Sub LeftFlipper_Collide(parm) CheckLiveCatch Activeball, LeftFlipper, LFCount, parm if bUseUltraDMD then AddScore 1 ' Keep the display from blanking PlaySound "fx_rubber_flipper", 0, parm / 10, pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall) End Sub Sub RightFlipper_Collide(parm) CheckLiveCatch Activeball, RightFlipper, RFCount, parm if bUseUltraDMD then AddScore 1 ' Keep the display from blanking PlaySound "fx_rubber_flipper", 0, parm / 10, pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall) End Sub Sub RotateLaneLightsLeft() if PlayerMode = 5 then ' Escape Kyln debug.print "lNovaStatesKyln(0)" & PlayerState(CurrentPlayer).lNovaStatesKyln(0) & " " & PlayerState(CurrentPlayer).lNovaStatesKyln(1) if PlayerState(CurrentPlayer).lNovaStatesKyln(0) = 2 and PlayerState(CurrentPlayer).lNovaStatesKyln(1) = 0 then ' Selected (toggle) PlayerState(CurrentPlayer).lNovaStatesKyln(0) = 0 PlayerState(CurrentPlayer).lNovaStatesKyln(1) = 2 elseif PlayerState(CurrentPlayer).lNovaStatesKyln(0) = 0 and PlayerState(CurrentPlayer).lNovaStatesKyln(1) = 2 then ' Selected (toggle) PlayerState(CurrentPlayer).lNovaStatesKyln(0) = 2 PlayerState(CurrentPlayer).lNovaStatesKyln(1) = 0 End If if PlayerState(CurrentPlayer).lNovaStatesKyln(3) = 2 and PlayerState(CurrentPlayer).lNovaStatesKyln(4) = 0 then ' Selected (toggle) PlayerState(CurrentPlayer).lNovaStatesKyln(3) = 0 PlayerState(CurrentPlayer).lNovaStatesKyln(4) = 2 elseif PlayerState(CurrentPlayer).lNovaStatesKyln(3) = 0 and PlayerState(CurrentPlayer).lNovaStatesKyln(4) = 2 then ' Selected (toggle) PlayerState(CurrentPlayer).lNovaStatesKyln(3) = 2 PlayerState(CurrentPlayer).lNovaStatesKyln(4) = 0 End If lNova_sw8.BlinkInterval=BlinkIntDef lNova_sw9.BlinkInterval=BlinkIntDef SetLightColor lNova_sw2, "orange", PlayerState(CurrentPlayer).lNovaStatesKyln(0) SetLightColor lNova_sw3, "orange", PlayerState(CurrentPlayer).lNovaStatesKyln(1) SetLightColor lNova_sw8, "orange", PlayerState(CurrentPlayer).lNovaStatesKyln(3) SetLightColor lNova_sw9, "orange", PlayerState(CurrentPlayer).lNovaStatesKyln(4) ' Top lights are complete, handle skillshot normally if bSkillshotsReady(0) or bSkillshotsReady(1) then if bBallInPlungerLane=False and SkillshotValue > 250000 then SkillshotValue = SkillshotValue - 50000 ' goes down by 50K each time you move it if lNova_sw9.UserValue = 2 then ' Blinking is skillshot lNova_sw8.UserValue = 2 lNova_sw9.UserValue = 0 Else lNova_sw8.UserValue = 0 lNova_sw9.UserValue = 2 End If debug.print "bSkillshotsReady1: " & bSkillshotsReady(0) & " " & bSkillshotsReady(0) & " Nova " & lNova_sw8.UserValue & " " & lNova_sw9.UserValue if PlayerState(CurrentPlayer).lNovaStatesKyln(3)=0 and PlayerState(CurrentPlayer).lNovaStatesKyln(4)=0 then ' Handle normally SetLightColor lNova_sw8, "orange", lNova_sw8.UserValue SetLightColor lNova_sw9, "orange", lNova_sw9.UserValue else if lNova_sw8.UserValue=2 then lNova_sw8.BlinkInterval = BlinkIntFast if lNova_sw9.UserValue=2 then lNova_sw9.BlinkInterval = BlinkIntFast End if else SetLightColor lNova_sw8, "orange", PlayerState(CurrentPlayer).lNovaStatesKyln(3) SetLightColor lNova_sw9, "orange", PlayerState(CurrentPlayer).lNovaStatesKyln(4) End if 'Handle Skillshot elseif bSkillshotsReady(0) or bSkillshotsReady(1) then lNova_sw8.BlinkInterval=BlinkIntDef lNova_sw9.BlinkInterval=BlinkIntDef if bBallInPlungerLane=False and SkillshotValue > 250000 then SkillshotValue = SkillshotValue - 50000 ' goes down by 50K each time you move it if lNova_sw9.UserValue = 2 then ' Blinking is skillshot lNova_sw8.UserValue = 2 lNova_sw9.UserValue = 0 Else lNova_sw8.UserValue = 0 lNova_sw9.UserValue = 2 End If debug.print "bSkillshotsReady2: " & bSkillshotsReady(0) & " " & bSkillshotsReady(0) & " Nova " & lNova_sw8.UserValue & " " & lNova_sw9.UserValue SetLightColor lNova_sw8, "orange", lNova_sw8.UserValue SetLightColor lNova_sw9, "orange", lNova_sw9.UserValue ' Normal Handleing else lNova_sw8.BlinkInterval=BlinkIntDef lNova_sw9.BlinkInterval=BlinkIntDef if PlayerState(CurrentPlayer).lNovaStates(0) = 1 and PlayerState(CurrentPlayer).lNovaStates(1) = 0 then ' Selected (toggle) PlayerState(CurrentPlayer).lNovaStates(0) = 0 PlayerState(CurrentPlayer).lNovaStates(1) = 1 elseif PlayerState(CurrentPlayer).lNovaStates(0) = 0 and PlayerState(CurrentPlayer).lNovaStates(1) = 1 then ' Selected (toggle) PlayerState(CurrentPlayer).lNovaStates(0) = 1 PlayerState(CurrentPlayer).lNovaStates(1) = 0 End If if PlayerState(CurrentPlayer).lNovaStates(3) = 1 and PlayerState(CurrentPlayer).lNovaStates(4) = 0 then ' Selected (toggle) PlayerState(CurrentPlayer).lNovaStates(3) = 0 PlayerState(CurrentPlayer).lNovaStates(4) = 1 elseif PlayerState(CurrentPlayer).lNovaStates(3) = 0 and PlayerState(CurrentPlayer).lNovaStates(4) = 1 then ' Selected (toggle) PlayerState(CurrentPlayer).lNovaStates(3) = 1 PlayerState(CurrentPlayer).lNovaStates(4) = 0 End If debug.print "bSkillshotsReady3: " & bSkillshotsReady(0) & "Nova " & PlayerState(CurrentPlayer).lNovaStates(3) & " " & PlayerState(CurrentPlayer).lNovaStates(4) SetLightColor lNova_sw2, "orange", PlayerState(CurrentPlayer).lNovaStates(0) SetLightColor lNova_sw3, "orange", PlayerState(CurrentPlayer).lNovaStates(1) SetLightColor lNova_sw8, "orange", PlayerState(CurrentPlayer).lNovaStates(3) SetLightColor lNova_sw9, "orange", PlayerState(CurrentPlayer).lNovaStates(4) End If End Sub Sub RotateLaneLightsRight() RotateLaneLightsLeft() ' There are only 2 lanes End Sub '********* ' Queue - This could be used for anything but I use it to queue priority=1 items up with the option to have 1 Priority=2 item queued or running ' Thought here is Pri 1 items need to be shown, Pri 2 items can be shown if an item is running ' ' NOTE - Since VPMtimer is limited to 20 concurrent timers you need a timer called tmrQueue to ensure items dont get dropped ' QueueScene ' Command=vbscript command ex: "RunFunction ""Test"", 123 '" ' Length=milliseconds before running the next item in the queue ' Priority=Number, 0 being highest ' '********* dim PupQueue(20, 4) ' Size=20, Fields are 0=Command, 1=Priority, 2=time, 3=MustRun dim PupQueueEndPos ' Size of the queue (-1 = Empty) dim QueueActive ' We are actively running something Dim QueueCurrentTime ' How much time is this one going to run (Just used for gtting the queue time) QueueActive=False PupQueueEndPos=-1 Sub QueueFlush() QueueFlushPriority -1 End Sub Sub QueueFlushPriority(priority) ' Only flush ones with this priority Dim time dim xx dim nextFree nextFree=-1 for xx = 0 to PupQueueEndPos if PupQueue(xx, 3)=True or (PupQueue(xx, 1)<>priority and priority<>-1) then ' MustRun=True, keep it if nextFree=-1 then nextFree=0 else nextFree=nextFree+1 End if PupQueue(nextFree, 0 )=PupQueue(xx,0 ) PupQueue(nextFree, 1 )=PupQueue(xx,1 ) PupQueue(nextFree, 2 )=PupQueue(xx,2 ) PupQueue(nextFree, 3 )=PupQueue(xx,3 ) End if Next PupQueueEndPos=nextFree ' See if one is actively running time=0 if QueueActive and QueueCurrentTime <> 0 then time = (DateDiff("s", now, QueueCurrentTime) * 1000) if nextFree= -1 and time=0 then 'debug.print "QueueFlush Empty Deacivated" QueueActive=False tmrQueue.Enabled = False End if End Sub Function getQueueTime() ' Returns how much time left on queue Dim time,i time = 0 debug.print "GetQueueTime:" & now debug.print "GetQueueTime:" & QueueCurrentTime & " " & QueueActive if QueueActive and QueueCurrentTime <> 0 then time = (DateDiff("s", now, QueueCurrentTime) * 1000) debug.print "GetQueueTime Active:" & time for i = 0 to PupQueueEndPos time = time + PupQueue(i, 2) Next getQueueTime = time debug.print "GetQueueTime ret:" & time End Function Sub QueuePop() if PupQueueEndPos = -1 then exit sub PupQueue(0, 1 )=99 SortPupQueue PupQueue(PupQueueEndPos,0 )="" PupQueue(PupQueueEndPos,2 )=0 PupQueue(PupQueueEndPos,3 )=False PupQueueEndPos=PupQueueEndPos-1 Debug.print "--Q-Dump Pop---" Dim xx for xx = 0 to PupQueueEndPos debug.print xx & " " & PupQueue(xx, 0) & " " & PupQueue(xx, 1) & " " & PupQueue(xx, 2) & " " & PupQueue(xx, 3) Next Debug.print "--Q-Dump Pop---" End Sub Sub QueueScene(Command, msecLen, priority) QueueScene2 Command, msecLen, priority, False End Sub Sub QueueScene2(Command, msecLen, priority, bMustRun) debug.print "Queue Scene " & Command & " Len: " & msecLen if PupQueueEndPos < UBound(PupQueue, 1) then PupQueueEndPos=PupQueueEndPos+1 End if ' NOTE: If it is full we overwrite the lowest priority (Optionally we could make the queue bigger) PupQueue(PupQueueEndPos,0 )=Command PupQueue(PupQueueEndPos,1 )=priority PupQueue(PupQueueEndPos,2 )=msecLen PupQueue(PupQueueEndPos,3 )=bMustRun SortPupQueue Debug.print "--Q-Dump---" Dim xx for xx = 0 to PupQueueEndPos debug.print xx & " " & PupQueue(xx, 0) & " " & PupQueue(xx, 1) & " " & PupQueue(xx, 2) & " " & PupQueue(xx, 3) Next Debug.print "--Q-Dump---" RunQueue True End Sub Sub tmrQueue_Timer tmrQueue.Enabled = False RunQueue False End Sub Sub QueueSkip() ' Shortcycle the timer and move on 'debug.print "--Q Skip--" if tmrQueue.Enabled Then tmrQueue.Enabled = False RunQueue False End if End Sub Sub RunQueue(bNewItem) dim qCmd, qTime ' FIX: If PUP is shutting down, stop the queue immediately to prevent ' playmedia/LabelSet calls into freed VLC form instances (Invalid pointer operation). if NOT bPupStarted then tmrQueue.Enabled = False QueueActive = False Exit Sub end if debug.print "Run Queue " & QueueActive & " " & bNewItem & " " & Now if QueueActive = False or bNewItem=False then ' Nothing is running Or we just finished running something if PupQueueEndPos <> -1 then QueueActive = True qCmd=PupQueue(0, 0) qTime=PupQueue(0, 2) debug.print "Exec " & qCmd PupQueue(0, 3)=True ' Set MustRun to True so it cant get deleted while running Execute qCmd debug.print "Timer " & qTime if qTime > 0 then QueueCurrentTime = DateAdd("s",qTime/1000, now) debug.print QueueCurrentTime tmrQueue.Interval = qTime tmrQueue.Enabled = True 'vpmtimer.addtimer cInt(qTime), "RunQueue False '" QueuePop Else ' No timer just run the next item in the queue QueueCurrentTime = 0 QueuePop RunQueue False End If Else debug.print "Queue Empty Deacivated" QueueActive = False End If End if End Sub Sub SortPupQueue dim a, j, temp1, temp2, temp3, temp4 for a = PupQueueEndPos - 1 To 0 Step -1 for j= 0 to a if PupQueue(j, 1)>PupQueue(j+1, 1) then temp1=PupQueue(j+1,0 ) temp2=PupQueue(j+1,1 ) temp3=PupQueue(j+1,2 ) temp4=PupQueue(j+1,3 ) PupQueue(j+1,0 )=PupQueue(j,0 ) PupQueue(j+1,1 )=PupQueue(j,1 ) PupQueue(j+1,2 )=PupQueue(j,2 ) PupQueue(j+1,3 )=PupQueue(j,3 ) PupQueue(j, 0 )=temp1 PupQueue(j, 1 )=temp2 PupQueue(j, 2 )=temp3 PupQueue(j, 3 )=temp4 end if next next End Sub '********* ' TILT '********* Dim TiltDangerWait TiltDangerWait=False Sub SceneTilt(Message) GiOff TiltDangerWait=True PlaySoundVol "sfx_Tilt", VolSfx playmedia "Video-0x008E.mp4", "PupVideos", pOverVid, "", -1, "", 1, 1 PuPlayer.LabelShowPage pOverVid, 1,0,"" if TiltCount(CurrentPlayer) = 1 then puPlayer.LabelSet pOverVid,"OverMessage1", "" ,1,"" puPlayer.LabelSet pOverVid,"OverMessage2", Message ,1,"" puPlayer.LabelSet pOverVid,"OverMessage3", "" ,1,"" Else puPlayer.LabelSet pOverVid,"OverMessage1", Message ,1,"" puPlayer.LabelSet pOverVid,"OverMessage2", "" ,1,"" puPlayer.LabelSet pOverVid,"OverMessage3", Message ,1,"" End If End Sub Sub SceneClearTilt() GiOn TiltDangerWait=False puPlayer.LabelSet pOverVid,"OverMessage1", "" ,1,"" puPlayer.LabelSet pOverVid,"OverMessage2", "" ,1,"" PuPlayer.LabelSet pOverVid,"OverMessage2a","" ,1,"" puPlayer.LabelSet pOverVid,"OverMessage3", "" ,1,"" PuPlayer.LabelSet pOverVid,"OverMessage4","",1,"" playclear pOverVid End Sub 'NOTE: The TiltDecreaseTimer Subtracts .01 from the "Tilt" variable every round Sub CheckTilt(bReal) ' Called when table is nudged if HasRealTiltBob and bReal=False then exit sub ' Real tilt bob does the tilt If NOT bGameInPlay Then Exit Sub If TiltDangerWait then Exit Sub if BallsOnPlayfield-RealBallsInLock <=0 or bPlayerModeSelect then Exit Sub ' Cant tile with no balls on the table or in mode select Tilt = Tilt + TiltSensitivity 'Add to tilt count debug.print "Check Tilt " & Tilt TiltDecreaseTimer.Interval = DMDStd(kDMDStd_TiltDebounce) TiltDecreaseTimer.Enabled = True if (bReal or Tilt > 15) and TiltCount(CurrentPlayer) < DMDStd(kDMDStd_TiltWarn) Then TiltCount(CurrentPlayer) = TiltCount(CurrentPlayer) + 1 PlaySoundVol "sfx_Danger", VolSfx QueueScene "SceneTilt ""DANGER"" '", 3000, 1 QueueScene "SceneClearTilt '", 0, 1 ElseIf bReal or Tilt > 15 Then 'If more that 15 then TILT the table Tilted = True SceneTilt "TILT" vpmtimer.addtimer 3000, "SceneClearTilt '" DMDFlush DisplayDMDText "TILT","", 3000 DisableTable True TiltRecoveryTimer.Enabled = True 'start the Tilt delay to check for all the balls to be drained End If End Sub Sub TiltDecreaseTimer_Timer ' DecreaseTilt If Tilt > 0 Then Tilt = Tilt - 0.1 Else TiltDecreaseTimer.Enabled = False End If End Sub Sub DisableTable(Enabled) If Enabled Then 'turn off GI and turn off all the lights GiOff LightSeqTilt.Play SeqAllOff 'Disable slings, bumpers etc LeftFlipper.RotateToStart RightFlipper.RotateToStart Bumper001.threshold=10 Bumper002.threshold=10 Bumper003.threshold=10 LeftSlingshot.Disabled = 1 RightSlingshot.Disabled = 1 bTableDisabled=True Else 'turn back on GI and the lights GiOn LightSeqTilt.StopPlay LeftSlingshot.Disabled = 0 RightSlingshot.Disabled = 0 Bumper001.threshold=1.6 Bumper002.threshold=1.6 Bumper003.threshold=1.6 DMDFlush bTableDisabled=False End If End Sub Sub TiltRecoveryTimer_Timer() Dim QueueTime ' if all the balls have been drained then.. queueTime = getQueueTime ' See if we need to let animations finish playing If(BallsOnPlayfield = 0) and queueTime=0 Then ' do the normal end of ball thing (this doesn't give a bonus if the table is tilted) WaitPlayerMode RefreshPlayerMode EndOfBall() TiltRecoveryTimer.Enabled = False End If ' else retry (checks again in another second or so) End Sub '******************** ' Music as wav sounds '******************** Dim Song Song = "" Sub CherrySong PlaySong("Song-1") SongNum=1 End Sub Sub RotateSong() 'debug.print "Rotate " & SongNum PlaySong "Song-" & SongNum SongNum=SongNum+1 if (SongNum>=4) then SongNum=1 End Sub 'sub PauseSong() 'exit sub 'if bBGPlayingVideo then exit sub ' We are playing a movie ' ' if bUsePUPDMD then ''debug.print "PlayStop (p) " & Song ' PuPlayer.playpause pDMD ' bPlayPaused=True ' Else ''debug.print "PlayStop (p) " & Song ' StopSound Song ' End If 'End Sub dim bPlayPaused bPlayPaused = False Sub PlaySong(name) 'debug.print "PlaySong " & name & " " & song dim PlayLength if bUsePUPDMD then ' Use Pup if we have it so we can pause the music ' PlaySongPup(name) exit sub End If StopSound "m_wait" StopSound Song ' Stop the old song if name <> "" then Song = name PlayLength = -1 If Song = "m_end" Then PlayLength = 0 bPlayPaused=False PlaySound Song, PlayLength, VolBGMusic 'this last number is the volume, from 0 to 1 End Sub 'Sub PlaySongPup(name) 'exit sub ' if bBGPlayingVideo then exit sub ' We are playing a movie ' StopSound "m_wait" ' Song = name ' if name = "" and bPlayPaused = False Then ' ' Do Nothing ''debug.print "KeepPlaying" ' elseif name = "" and bPlayPaused then ''debug.print "PlayResume" ' PuPlayer.playresume pDMD ' bPlayPaused=False ' Else ''debug.print "PlayStop/Start" ' PuPlayer.setbackground pDMD, 0 ' Take out of background mode, stop and start the next song ' PuPlayer.playstop pDMD ' PuPlayer.playlistplayex pDMD,"Topper", song + ".mp3", 100 * VolBGMusic, 5 ' 'PuPlayer.setloop pDMD, 1 ' PuPlayer.setbackground pDMD, 1 ' Put in background mode so it loops ' End If 'End Sub '********************** ' GI effects ' independent routine ' it turns on the gi ' when there is a ball ' in play '********************** Sub aLightsSave() Dim a dim i baLightsSaved = True i = 0 For each a in aLights LightsSaveColor(i, 0) = a.name LightsSaveColor(i, 1) = a.color LightsSaveColor(i, 2) = a.colorfull LightsSaveColor(i, 3) = a.state i=i+1 next End Sub Sub aLightsRestore() Dim a, b ' Not sure why this doesnt work ' for b = 0 to aLights.count-1 ' aLights(aLightSaveColor(b, 0)).color = aLightSaveColor(b, 1) ' aLights(aLightSaveColor(b, 0)).colorfull = aLightSaveColor(b, 2) ' aLights(aLightSaveColor(b, 0)).state = aLightSaveColor(b, 3) ' Next if baLightsSaved then For each a in aLights for b = 0 to aLights.count-1 if LightsSaveColor(b, 0) = a.name then a.color = LightsSaveColor(b, 1) a.colorfull = LightsSaveColor(b, 2) 'if a.name = "LightShootAgain" then msgbox "hi" 'if a.name <> "LightShootAgain" and a.name <> "LightShootAgain2" then ' Dont restore the state on these because they are driven by a timer ' a.state = LightsSaveColor(b, 3) 'End If exit for End if Next next End If baLightsSaved = False End Sub Sub aHadronLightsSave() Dim a dim i baLightsSaved = True i = 0 For each a in aHadronLights HadronLightsSaveColor(i, 0) = a.name HadronLightsSaveColor(i, 1) = a.color HadronLightsSaveColor(i, 2) = a.colorfull HadronLightsSaveColor(i, 3) = a.state i=i+1 next End Sub Sub aHadronLightsRestore() Dim a, b ' Not sure why this doesnt work ' for b = 0 to aLights.count-1 ' aLights(aLightSaveColor(b, 0)).color = aLightSaveColor(b, 1) ' aLights(aLightSaveColor(b, 0)).colorfull = aLightSaveColor(b, 2) ' aLights(aLightSaveColor(b, 0)).state = aLightSaveColor(b, 3) ' Next if baLightsSaved Then ' Make sure we actually saved something For each a in aHadronLights for b = 0 to aHadronLights.count-1 if HadronLightsSaveColor(b, 0) = a.name then a.color = HadronLightsSaveColor(b, 1) a.colorfull = HadronLightsSaveColor(b, 2) a.state = HadronLightsSaveColor(b, 3) exit for End if Next next End If baLightsSaved = False End Sub Sub aRampLightsSave() ' Pretty sure sure this is not used anymore Dim a dim i baRampLightsSaved = True i = 0 For each a in aRampLights RampLightsSaveColor(i, 0) = a.name RampLightsSaveColor(i, 1) = a.color RampLightsSaveColor(i, 2) = a.colorfull RampLightsSaveColor(i, 3) = a.state i=i+1 next End Sub Sub aRampLightsRestore() Dim a, b for each a in aRampLights SetLightColorRestore a, -1 'SetLightColor a, modeRampColor, -1 a.Intensity = 10 Next ' if baRampLightsSaved then ' For each a in aRampLights ' for b = 0 to aRampLights.count-1 ' if RampLightsSaveColor(b, 0) = a.name then ' a.color = RampLightsSaveColor(b, 1) ' a.colorfull = RampLightsSaveColor(b, 2) ' a.state = RampLightsSaveColor(b, 3) ' exit for ' End if ' Next ' next ' End If baRampLightsSaved = False End Sub Dim OldGiState OldGiState = -1 'start witht the Gi off Sub ChangeGi(col) 'changes the gi color Dim bulb For each bulb in aGILights SetLightColor bulb, col, -1 Next End Sub Sub GIUpdateTimer_Timer Dim tmp, obj tmp = Getballs If UBound(tmp) <> OldGiState Then OldGiState = Ubound(tmp) If UBound(tmp) = 3 Then 'we have 4 captive balls on the table (-1 means no balls, 0 is the first ball, 1 is the second..) GiOff ' turn off the gi if no active balls on the table, we could also have used the variable ballsonplayfield. Else Gion End If End If End Sub Sub GiOn gilvl = 1 DOF 126, DOFOn Dim bulb For each bulb in aGiLights bulb.State = 1 Next GrootMouth.Image = "Groot Mouth" GrootHead.Image = "GrootHead" BackWall.Image = "GOTG Backwall ON" Primitive009.Image = "GOTG FluroGI ON" Primitive006.Image = "GOTG PlasticsLvl1 GI ON" Primitive008.Image = "GOTG PlasticsLvl2 GI ON" Primitive004.Image = "GOTG Metal Wall Ramp GI ON" PlasticRampsA.Image = "GOTG Plastic Ramp A ON" PlasticRampsB.Image = "GOTG Plastic Ramp B ON" StickerA.Image = "GOTG StickerA ON" StickerB.Image = "GOTG StickerB ON" StickerC.Image = "GOTG StickerC ON" StickerD.Image = "GOTG StickerD ON" BumperPlastic1.Image = "GOTG-_0007_BPA-GI-ON" BumperPlastic2.Image = "GOTG-_0004_BPB-GI-ON" BumperPlastic3.Image = "GOTG-_0001_BPC-GI-ON" RocketKickerButton.Image = "GOTG RocketKicker GI ON" RampGuardLeft.Image = "GOTG Ramp Metal guides B GI ON" RampGuardRight.Image = "GOTG Ramp Metal guides A GI ON" LeftFlipperMeta.Image = "GOTG Metal guides GI ON" 'GOTGSideBlades.Image = "GOTG Sideblades ON" PF_GiOFF.Opacity = 0 PinCab_Backglass.blenddisablelighting = 5 End Sub Sub GiOff gilvl = 0 GrootMouth.Image = "Groot Mouth_Off" GrootHead.Image = "GrootHead_Off" BackWall.Image = "GOTG Backwall OFF" Primitive009.Image = "GOTG FluroGI OFF" Primitive006.Image = "GOTG PlasticsLvl1 GI OFF" Primitive008.Image = "GOTG PlasticsLvl2 GI OFF" Primitive004.Image = "GOTG Metal Wall Ramp GI OFF" PlasticRampsA.Image = "GOTG Plastic Ramp A OFF" PlasticRampsB.Image = "GOTG Plastic Ramp B OFF" StickerA.Image = "GOTG StickerA OFF" StickerB.Image = "GOTG StickerB OFF" StickerC.Image = "GOTG StickerC OFF" StickerD.Image = "GOTG StickerD OFF" BumperPlastic1.Image = "GOTG-_0008_BPA-GI-OFF" BumperPlastic2.Image = "GOTG-_0005_BPB-GI-OFF" BumperPlastic3.Image = "GOTG-_0002_BPC-GI-OFF" 'GOTGSideBlades.Image = "GOTG Sideblades OFF" RocketKickerButton.Image = "GOTG RocketKicker GI OFF" RampGuardLeft.Image = "GOTG Ramp Metal guides B GI OFF" RampGuardRight.Image = "GOTG Ramp Metal guides A GI OFF" LeftFlipperMeta.Image = "GOTG Metal guides GI OFF" PF_GiOFF.Opacity = 100 PinCab_Backglass.blenddisablelighting = 0.2 DOF 126, DOFOff Dim bulb For each bulb in aGiLights bulb.State = 0 Next End Sub ' GI & light sequence effects Sub GiEffect(n) Select Case n Case 0 'all off LightSeqGi.Play SeqAlloff Case 1 'all blink LightSeqGi.UpdateInterval = 4 LightSeqGi.Play SeqBlinking, , 5, 100 Case 2 'random LightSeqGi.UpdateInterval = 10 LightSeqGi.Play SeqRandom, 5, , 1000 Case 3 'upon LightSeqGi.UpdateInterval = 4 LightSeqGi.Play SeqUpOn, 5, 1 Case 4 ' left-right-left LightSeqGi.UpdateInterval = 5 LightSeqGi.Play SeqLeftOn, 10, 1 LightSeqGi.UpdateInterval = 5 LightSeqGi.Play SeqRightOn, 10, 1 End Select End Sub Sub LightEffect(n) Select Case n Case 0 ' all off LightSeqInserts.Play SeqAlloff Case 1 'all blink LightSeqInserts.UpdateInterval = 4 LightSeqInserts.Play SeqBlinking, , 5, 100 Case 2 'random LightSeqInserts.UpdateInterval = 10 LightSeqInserts.Play SeqRandom, 5, , 1000 Case 3 'upon LightSeqInserts.UpdateInterval = 4 LightSeqInserts.Play SeqUpOn, 10, 1 Case 4 ' left-right-left LightSeqInserts.UpdateInterval = 5 LightSeqInserts.Play SeqLeftOn, 10, 1 LightSeqInserts.UpdateInterval = 5 LightSeqInserts.Play SeqRightOn, 10, 1 End Select End Sub ' Flasher Effects Dim FEStep, FEffect FEStep = 0 FEffect = 0 Sub FlashEffect(n) Select case n Case 1:FEStep = 0:FEffect = 1:FlashEffectTimer.Enabled = 1 'all blink Case 2:FEStep = 0:FEffect = 2:FlashEffectTimer.Enabled = 1 'random Case 3:FEStep = 0:FEffect = 3:FlashEffectTimer.Enabled = 1 'upon Case 4:FEStep = 0:FEffect = 4:FlashEffectTimer.Enabled = 1 'ordered random :) End Select End Sub Sub FlashEffectTimer_Timer() End Sub Dim BEStep, BEffect BEStep = 0 BEffect = 0 ' ********************************************************************* ' Supporting Ball & Sound Functions ' ********************************************************************* Function Vol(ball) ' Calculates the Volume of the sound based on the ball speed Vol = Csng(BallVel(ball) ^2 / 2000) End Function Function Pan(ball) ' Calculates the pan for a ball based on the X position on the table. "table1" is the name of the table Dim tmp tmp = ball.x * 2 / table1.width-1 If tmp > 0 Then Pan = Csng(tmp ^10) Else Pan = Csng(-((- tmp) ^10)) End If End Function Function Pitch(ball) ' Calculates the pitch of the sound based on the ball speed Pitch = BallVel(ball) * 20 End Function Function BallVel(ball) 'Calculates the ball speed BallVel = (SQR((ball.VelX ^2) + (ball.VelY ^2))) End Function Function AudioFade(ball) 'only on VPX 10.4 and newer Dim tmp tmp = ball.y * 2 / Table1.height-1 If tmp > 0 Then AudioFade = Csng(tmp ^10) Else AudioFade = Csng(-((- tmp) ^10)) End If End Function Sub PlaySoundAt(soundname, tableobj) 'play sound at X and Y position of an object, mostly bumpers, flippers and other fast objects PlaySound soundname, 0, VolTable, Pan(tableobj), 0, 0, 0, 0, AudioFade(tableobj) End Sub Sub PlaySoundAtBall(soundname) ' play a sound at the ball position, like rubbers, targets PlaySound soundname, 0, Vol(ActiveBall), pan(ActiveBall), 0, Pitch(ActiveBall), 0, 0, AudioFade(ActiveBall) End Sub Sub PlaySoundAtVol(soundname, tableobj, Volume) PlaySound soundname, 1, Volume, Pan(tableobj), 0,0,0, 1, AudioFade(tableobj) End Sub Sub PlaySoundVol(soundname, Volume) PlaySound soundname, 1, Volume End Sub Sub PlaySoundLoopVol(soundname, Volume) PlaySound soundname, -1, Volume End Sub '******************************************** ' JP's VP10 Rolling Sounds + Ballshadow '******************************************** Const tnob = 8 ' total number of balls Const lob = 0 'number of locked balls ReDim rolling(tnob) InitRolling Sub InitRolling Dim i For i = 0 to tnob rolling(i) = False Next End Sub Sub RollingUpdate() Dim BOT, b, ballpitch, ballvol BOT = GetBalls ' stop the sound of deleted balls For b = UBound(BOT) + 1 to tnob - 1 If AmbientBallShadowOn = 0 Then BallShadowA(b).visible = 0 rolling(b) = False StopSound("fx_ballrolling" & b) Next ' exit the sub if no balls on the table If UBound(BOT) = lob - 1 Then Exit Sub 'there no extra balls on this table 'debug.print lob & " " & UBound(BOT) ' play the rolling sound for each ball and draw the shadow For b = lob to UBound(BOT) 'debug.print "b" If BallVel(BOT(b) )> 1 Then If BOT(b).z <30 Then ballpitch = Pitch(BOT(b) ) ballvol = Vol(BOT(b) ) Else ballpitch = Pitch(BOT(b) ) + 25000 'increase the pitch on a ramp ballvol = Vol(BOT(b) ) * 10 End If rolling(b) = True PlaySound("fx_ballrolling" & b), -1, ballvol, Pan(BOT(b) ), 0, ballpitch, 1, 0, AudioFade(BOT(b) ) Else If rolling(b) = True Then StopSound("fx_ballrolling" & b) rolling(b) = False End If End If ' rothbauerw's Dropping Sounds If BOT(b).VelZ < -1 and BOT(b).z < 55 and BOT(b).z > 27 Then 'height adjust for ball drop sounds PlaySound "fx_balldrop", 0, ABS(BOT(b).velz)/17, Pan(BOT(b)), 0, Pitch(BOT(b)), 1, 0, AudioFade(BOT(b)) End If ' "Static" Ball Shadows If AmbientBallShadowOn = 0 Then If BOT(b).Z > 30 Then BallShadowA(b).height=BOT(b).z - BallSize/4 'This is technically 1/4 of the ball "above" the ramp, but it keeps it from clipping the ramp Else BallShadowA(b).height=BOT(b).z - BallSize/2 + 5 End If BallShadowA(b).Y = BOT(b).Y + Ballsize/5 + offsetY BallShadowA(b).X = BOT(b).X + offsetX BallShadowA(b).visible = 1 End If Next End Sub '********************** ' Ball Collision Sound '********************** Sub OnBallBallCollision(ball1, ball2, velocity) PlaySound("fx_collide"), 0, Csng(velocity) ^2 / 2000, Pan(ball1), 0, Pitch(ball1), 0, 0, AudioFade(ball1) End Sub '*************************************************************** '**** VPW DYNAMIC BALL SHADOWS by Iakki, Apophis, and Wylte '*************************************************************** '****** INSTRUCTIONS please read ****** '****** Part A: Table Elements ****** ' ' Import the "bsrtx7" and "ballshadow" images ' Import the shadow materials file (3 sets included) (you can also export the 3 sets from this table to create the same file) ' Copy in the BallShadowA flasher set and the sets of primitives named BallShadow#, RtxBallShadow#, and RtxBall2Shadow# ' * Count from 0 up, with at least as many objects each as there can be balls, including locked balls ' Ensure you have a timer with a -1 interval that is always running ' Create a collection called DynamicSources that includes all light sources you want to cast ball shadows ' It's recommended that you be selective in which lights go in this collection, as there are limitations: ' 1. The shadows can "pass through" solid objects and other light sources, so be mindful of where the lights would actually able to cast shadows ' 2. If there are more than two equidistant sources, the shadows can suddenly switch on and off, so places like top and bottom lanes need attention ' 3. At this time the shadows get the light on/off from tracking gilvl, so if you have lights you want shadows for that are on at different times you will need to either: ' a) remove this restriction (shadows think lights are always On) ' b) come up with a custom solution (see TZ example in script) ' After confirming the shadows work in general, use ball control to move around and look for any weird behavior '****** End Part A: Table Elements ****** '****** Part B: Code and Functions ****** ' *** Timer sub ' The "DynamicBSUpdate" sub should be called by a timer with an interval of -1 (framerate) ' Example timer sub: 'Sub FrameTimer_Timer() ' If DynamicBallShadowsOn Or AmbientBallShadowOn Then DynamicBSUpdate 'update ball shadows 'End Sub ' *** These are usually defined elsewhere (ballrolling), but activate here if necessary 'Const tnob = 10 ' total number of balls 'Const lob = 0 'locked balls on start; might need some fiddling depending on how your locked balls are done Dim tablewidth: tablewidth = Table1.width Dim tableheight: tableheight = Table1.height ' *** User Options - Uncomment here or move to top for easy access by players '----- 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 ' *** This segment goes within the RollingUpdate sub, so that if Ambient...=0 and Dynamic...=0 the entire DynamicBSUpdate sub can be skipped for max performance ' *** Includes lines commonly found there, for reference: ' ' stop the sound of deleted balls ' For b = UBound(gBOT) + 1 to tnob ' If AmbientBallShadowOn = 0 Then BallShadowA(b).visible = 0 ' ...rolling(b) = False ' ...StopSound("BallRoll_" & b) ' Next ' ' ...rolling and drop sounds... ' If DropCount(b) < 5 Then ' DropCount(b) = DropCount(b) + 1 ' End If ' ' ' "Static" Ball Shadows ' If AmbientBallShadowOn = 0 Then ' If gBOT(b).Z > 30 Then ' BallShadowA(b).height=gBOT(b).z - BallSize/4 'This is technically 1/4 of the ball "above" the ramp, but it keeps it from clipping the ramp ' Else ' BallShadowA(b).height=gBOT(b).z - BallSize/2 + 5 ' End If ' BallShadowA(b).Y = gBOT(b).Y + Ballsize/5 + offsetY ' BallShadowA(b).X = gBOT(b).X + offsetX ' BallShadowA(b).visible = 1 ' End If ' *** Required Functions, enable these if they are not already present elswhere in your table 'Function max(a,b) ' if a > b then ' max = a ' Else ' max = b ' end if 'end Function 'Function Distance(ax,ay,bx,by) ' Distance = SQR((ax - bx)^2 + (ay - by)^2) 'End Function 'Dim PI: PI = 4*Atn(1) 'Function Atn2(dy, dx) ' If dx > 0 Then ' Atn2 = Atn(dy / dx) ' ElseIf dx < 0 Then ' If dy = 0 Then ' Atn2 = pi ' Else ' Atn2 = Sgn(dy) * (pi - Atn(Abs(dy / dx))) ' end if ' ElseIf dx = 0 Then ' if dy = 0 Then ' Atn2 = 0 ' else ' Atn2 = Sgn(dy) * pi / 2 ' end if ' End If 'End Function 'Function AnglePP(ax,ay,bx,by) ' AnglePP = Atn2((by - ay),(bx - ax))*180/PI 'End Function '****** End Part B: Code and Functions ****** '****** Part C: The Magic ****** ' *** These define the appearance of shadows in your table *** 'Ambient (Room light source) Const AmbientBSFactor = 0.9 '0 to 1, higher is darker Const AmbientMovement = 2 '1 to 4, higher means more movement as the ball moves left and right Const offsetX = 0 'Offset x position under ball (These are if you want to change where the "room" light is for calculating the shadow position,) Const offsetY = 0 'Offset y position under ball (for example 5,5 if the light is in the back left corner) 'Dynamic (Table light sources) Const DynamicBSFactor = 0.95 '0 to 1, higher is darker Const Wideness = 20 'Sets how wide the dynamic ball shadows can get (20 +5 thinness is technically most accurate for lights at z ~25 hitting a 50 unit ball) Const Thinness = 5 'Sets minimum as ball moves away from source ' *** *** ' *** Trim or extend these to *match* the number of balls/primitives/flashers on the table! dim objrtx1(8), objrtx2(8) dim objBallShadow(8) Dim BallShadowA BallShadowA = Array (BallShadowA0,BallShadowA1,BallShadowA2,BallShadowA3,BallShadowA4, BallShadowA5, BallShadowA6, BallShadowA7) Dim DSSources(30), numberofsources', DSGISide(30) 'Adapted for TZ with GI left / GI right Dim gilvl : gilvl = 1 'Initialization DynamicBSInit sub DynamicBSInit() Dim iii, source for iii = 0 to tnob - 1 'Prepares the shadow objects before play begins Set objrtx1(iii) = Eval("RtxBallShadow" & iii) objrtx1(iii).material = "RtxBallShadow" & iii objrtx1(iii).z = 1 + iii/1000 + 0.01 'Separate z for layering without clipping objrtx1(iii).visible = 0 Set objrtx2(iii) = Eval("RtxBall2Shadow" & iii) objrtx2(iii).material = "RtxBallShadow2_" & iii objrtx2(iii).z = 1 + iii/1000 + 0.02 objrtx2(iii).visible = 0 Set objBallShadow(iii) = Eval("BallShadow" & iii) objBallShadow(iii).material = "BallShadow" & iii UpdateMaterial objBallShadow(iii).material,1,0,0,0,0,0,AmbientBSFactor,RGB(0,0,0),0,0,False,True,0,0,0,0 objBallShadow(iii).Z = 1 + iii/1000 + 0.04 objBallShadow(iii).visible = 0 BallShadowA(iii).Opacity = 100*AmbientBSFactor BallShadowA(iii).visible = 0 Next iii = 0 For Each Source in DynamicSources DSSources(iii) = Array(Source.x, Source.y) ' If Instr(Source.name , "Left") > 0 Then DSGISide(iii) = 0 Else DSGISide(iii) = 1 'Adapted for TZ with GI left / GI right iii = iii + 1 Next numberofsources = iii end sub Sub DynamicBSUpdate Dim falloff: falloff = 150 'Max distance to light sources, can be changed dynamically if you have a reason Dim ShadowOpacity1, ShadowOpacity2 Dim s, LSd, iii Dim dist1, dist2, src1, src2 Dim gBOT: gBOT=getballs 'Don't do it - #SaveTheBalls 'Hide shadow of deleted balls For s = UBound(gBOT) + 1 to tnob - 1 objrtx1(s).visible = 0 objrtx2(s).visible = 0 objBallShadow(s).visible = 0 BallShadowA(s).visible = 0 Next If UBound(gBOT) < lob Then Exit Sub 'No balls in play, exit 'The Magic happens now For s = lob to UBound(gBOT) ' *** Normal "ambient light" ball shadow 'Layered from top to bottom. If you had an upper pf at for example 80 units and ramps even above that, your segments would be z>110; z<=110 And z>100; z<=100 And z>30; z<=30 And z>20; Else invisible If AmbientBallShadowOn = 1 Then 'Primitive shadow on playfield, flasher shadow in ramps If gBOT(s).Z > 30 Then 'The flasher follows the ball up ramps while the primitive is on the pf If gBOT(s).X < tablewidth/2 Then objBallShadow(s).X = ((gBOT(s).X) - (Ballsize/10) + ((gBOT(s).X - (tablewidth/2))/(Ballsize/AmbientMovement))) + offsetX + 5 Else objBallShadow(s).X = ((gBOT(s).X) + (Ballsize/10) + ((gBOT(s).X - (tablewidth/2))/(Ballsize/AmbientMovement))) + offsetX - 5 End If objBallShadow(s).Y = gBOT(s).Y + BallSize/10 + offsetY objBallShadow(s).visible = 1 BallShadowA(s).X = gBOT(s).X + offsetX BallShadowA(s).Y = gBOT(s).Y + BallSize/5 + offsetY BallShadowA(s).height=gBOT(s).z - BallSize/4 'This is technically 1/4 of the ball "above" the ramp, but it keeps it from clipping the ramp BallShadowA(s).visible = 1 Elseif gBOT(s).Z <= 30 And gBOT(s).Z > 20 Then 'On pf, primitive only objBallShadow(s).visible = 1 If gBOT(s).X < tablewidth/2 Then objBallShadow(s).X = ((gBOT(s).X) - (Ballsize/10) + ((gBOT(s).X - (tablewidth/2))/(Ballsize/AmbientMovement))) + offsetX + 5 Else objBallShadow(s).X = ((gBOT(s).X) + (Ballsize/10) + ((gBOT(s).X - (tablewidth/2))/(Ballsize/AmbientMovement))) + offsetX - 5 End If objBallShadow(s).Y = gBOT(s).Y + offsetY BallShadowA(s).visible = 0 Else 'Under pf, no shadows objBallShadow(s).visible = 0 BallShadowA(s).visible = 0 end if Elseif AmbientBallShadowOn = 2 Then 'Flasher shadow everywhere If gBOT(s).Z > 30 Then 'In a ramp BallShadowA(s).X = gBOT(s).X + offsetX BallShadowA(s).Y = gBOT(s).Y + BallSize/5 + offsetY BallShadowA(s).height=gBOT(s).z - BallSize/4 'This is technically 1/4 of the ball "above" the ramp, but it keeps it from clipping the ramp BallShadowA(s).visible = 1 Elseif gBOT(s).Z <= 30 And gBOT(s).Z > 20 Then 'On pf BallShadowA(s).visible = 1 If gBOT(s).X < tablewidth/2 Then BallShadowA(s).X = ((gBOT(s).X) - (Ballsize/10) + ((gBOT(s).X - (tablewidth/2))/(Ballsize/AmbientMovement))) + offsetX + 5 Else BallShadowA(s).X = ((gBOT(s).X) + (Ballsize/10) + ((gBOT(s).X - (tablewidth/2))/(Ballsize/AmbientMovement))) + offsetX - 5 End If BallShadowA(s).Y = gBOT(s).Y + Ballsize/10 + offsetY BallShadowA(s).height=gBOT(s).z - BallSize/2 + 5 Else 'Under pf BallShadowA(s).visible = 0 End If End If ' *** Dynamic shadows If DynamicBallShadowsOn Then If gBOT(s).Z < 30 And gBOT(s).X < 850 Then 'Parameters for where the shadows can show, here they are not visible above the table (no upper pf) or in the plunger lane dist1 = falloff: dist2 = falloff For iii = 0 to numberofsources - 1 ' Search the 2 nearest influencing lights LSd = Distance(gBOT(s).x, gBOT(s).y, DSSources(iii)(0), DSSources(iii)(1)) 'Calculating the Linear distance to the Source If LSd < falloff And gilvl > 0 Then ' If LSd < dist2 And ((DSGISide(iii) = 0 And Lampz.State(100)>0) Or (DSGISide(iii) = 1 And Lampz.State(104)>0)) Then 'Adapted for TZ with GI left / GI right dist2 = dist1 dist1 = LSd src2 = src1 src1 = iii End If Next ShadowOpacity1 = 0 If dist1 < falloff Then objrtx1(s).visible = 1 : objrtx1(s).X = gBOT(s).X : objrtx1(s).Y = gBOT(s).Y 'objrtx1(s).Z = BOT(s).Z - 25 + s/1000 + 0.01 'Uncomment if you want to add shadows to an upper/lower pf objrtx1(s).rotz = AnglePP(DSSources(src1)(0), DSSources(src1)(1), gBOT(s).X, gBOT(s).Y) + 90 ShadowOpacity1 = 1 - dist1 / falloff objrtx1(s).size_y = Wideness * ShadowOpacity1 + Thinness UpdateMaterial objrtx1(s).material,1,0,0,0,0,0,ShadowOpacity1*DynamicBSFactor^3,RGB(0,0,0),0,0,False,True,0,0,0,0 Else objrtx1(s).visible = 0 End If ShadowOpacity2 = 0 If dist2 < falloff Then objrtx2(s).visible = 1 : objrtx2(s).X = gBOT(s).X : objrtx2(s).Y = gBOT(s).Y + offsetY 'objrtx2(s).Z = BOT(s).Z - 25 + s/1000 + 0.01 'Uncomment if you want to add shadows to an upper/lower pf objrtx2(s).rotz = AnglePP(DSSources(src2)(0), DSSources(src2)(1), gBOT(s).X, gBOT(s).Y) + 90 ShadowOpacity2 = 1 - dist2 / falloff objrtx2(s).size_y = Wideness * ShadowOpacity2 + Thinness UpdateMaterial objrtx2(s).material,1,0,0,0,0,0,ShadowOpacity2*DynamicBSFactor^3,RGB(0,0,0),0,0,False,True,0,0,0,0 Else objrtx2(s).visible = 0 End If If AmbientBallShadowOn = 1 Then 'Fades the ambient shadow (primitive only) when it's close to a light UpdateMaterial objBallShadow(s).material,1,0,0,0,0,0,AmbientBSFactor*(1 - max(ShadowOpacity1, ShadowOpacity2)),RGB(0,0,0),0,0,False,True,0,0,0,0 Else BallShadowA(s).Opacity = 100 * AmbientBSFactor * (1 - max(ShadowOpacity1, ShadowOpacity2)) End If Else 'Hide dynamic shadows everywhere else, just in case objrtx2(s).visible = 0 : objrtx1(s).visible = 0 End If End If Next End Sub '**************************************************************** '**** END VPW DYNAMIC BALL SHADOWS by Iakki, Apophis, and Wylte '**************************************************************** '****************************** ' Diverse Collection Hit Sounds '****************************** Sub aMetals_Hit(idx):PlaySoundAtBall "fx_MetalHit":End Sub Sub aRubber_Bands_Hit(idx):PlaySoundAtBall "fx_rubber_band":End Sub Sub aRubber_Posts_Hit(idx):PlaySoundAtBall "fx_rubber_post":End Sub Sub aRubber_Pins_Hit(idx):PlaySoundAtBall "fx_rubber_pin":End Sub Sub aYellowPins_Hit(idx):PlaySoundAtBall "fx_rubber_pin":End Sub Sub aPlastics_Hit(idx):PlaySoundAtBall "fx_PlasticHit":End Sub Sub aGates_Hit(idx):PlaySoundAtBall "fx_Gate":End Sub Sub aWoods_Hit(idx):PlaySoundAtBall "fx_Woodhit":End Sub Sub aCaptiveWalls_Hit(idx):PlaySoundAtBall "fx_collide":End Sub ' Some quotes from the 2 first movies Sub PlayQuote_timer() 'one quote each 2 minutes Dim Quote Quote = "gg_quote" & INT(RND * 30) + 1 PlaySoundVol Quote, VolDef End Sub ' ********************************************************************* ' User Defined Script Events ' ********************************************************************* ' Initialise the Table for a ' Sub ResetForNewGame() Dim i bGameInPLay = True TextBox001.Text="" tmrBallSearch.Interval = kBallSearchTimeout BallSearchCnt = 0 tmrBallSearch.Enabled = True 'resets the score display, and turn off attrack mode StopAttractMode GiOn TotalGamesPlayed = TotalGamesPlayed + 1 CurrentPlayer = 0 ComboCount=1 PlayersPlayingGame = 1 bOnTheFirstBall = True PlayMultiplier = 1 For i = 0 To MaxPlayers-1 LastScore(i)=0 Score(i) = 0 ModeScore(i,0)=0 ModeScore(i,1)=0 ModeScore(i,2)=0 ModeScore(i,3)=0 BonusPoints(i) = 0 BonusHeldPoints(i) = 0 BonusMultiplier = 1 BallsRemaining(i) = BallsPerGame ExtraBallsAwards(i) = 0 TiltCount(i) = 0 bReplayAwarded(i)=False Next ' initialise any other flags Tilt = 0 ' initialise Game variables Game_Init() UpdateNumberPlayers ' Do the first one 'PuPlayer.SendMSG "{ ""mt"":301, ""SN"": " & pDMDText & ", ""FN"":6 }" ' Bring screen to the front (TBD: Might need to do this) ' you may wish to start some music, play a sound, do whatever at this point Scorbit.StartSession() ' set up the start delay to handle any Start of Game Attract Sequence vpmtimer.addtimer 1500, "FirstBall '" End Sub ' This is used to delay the start of a game to allow any attract sequence to ' complete. When it expires it creates a ball for the player to start playing with Sub FirstBall ' reset the table for a new ball ResetForNewPlayerBall() ' create a new ball in the shooters lane ' If bResetCurrentGame = False then CreateNewBall() ' End If bResetCurrentGame = False End Sub ' (Re-)Initialise the Table for a new ball (either a new ball after the player has ' lost one or we have moved onto the next player (if multiple are playing)) Sub ResetForNewPlayerBall() Dim i ' make sure the correct display is upto date AddScore 0 For i = 0 to aRampLights.count-1 ' No stacked modes on new ball StackedLightsIdx(i)=-1 Next ' set the current players bonus multiplier back down to 1X SetBonusMultiplier 1 MultiplierShot = 1 bShotMultiplierSelect = False bWizardMode = False TiltCount(CurrentPlayer)=0 LastSwitchHit="" LastSwitchHit2="" OrbJPDebounce = False bAudioScreen14Busy = False bPupEventBusy = False dScreen13LastActivity = 0 dScreen15LastActivity = 0 ' Clear shot multipliers lDrax_m.UserValue =0 lGamora_m.UserValue =0 lYando_m.UserValue =0 lRocket_m.UserValue =0 lgr_m.UserValue =0 lNebula_m.UserValue = 0 lBroker_m.UserValue =0 lStarLord_m.UserValue =0 lRonan_m.UserValue =0 SetLightColor lDrax_m, "green", lDrax_m.UserValue SetLightColor lGamora_m, "green", lGamora_m.UserValue SetLightColor lYando_m, "green", lYando_m.UserValue SetLightColor lRocket_m, "green", lRocket_m.UserValue SetLightColor lgr_m, "green", lgr_m.UserValue SetLightColor lNebula_m, "green", lNebula_m.UserValue SetLightColor lBroker_m, "green", lBroker_m.UserValue SetLightColor lStarLord_m, "green", lStarLord_m.UserValue SetLightColor lRonan_m, "green", lRonan_m.UserValue ' reset any drop targets, lights, game modes etc.. BonusPoints(CurrentPlayer) = 0 ComboCount=1 bBonusHeld = False bExtraBallWonThisBall = False 'GrootMouth_Drop(False) 'ResetNewBallLights() 'Reset any table specific ResetNewBallVariables 'This is a new ball, so activate the ballsaver BallSaverTimerExpired.Enabled = False bBallSaverActive=False bBallSaverReady = True 'and the skillshot lNova_sw8.UserValue = 2 lNova_sw9.UserValue = 0 bSkillshotSelect = True bSkillShotReady = True debug.print "Reset Skillshot" bSkillshotsReady(0) = True ' First Inlane bSkillshotsReady(1) = True ' First Inlan without touching flippers bSkillshotsReady(2) = False ' Hold Left, Loop around and hit Orb, Right Ramp or Right Orbit SuperSkillShotIndex=-1 lNova_sw8.BlinkInterval=BlinkIntDef lNova_sw9.BlinkInterval=BlinkIntDef if bPlayerModeSelect = False and PlayerMode <> 5 then ' Set the lights SetLightColor lNova_sw8, "orange", lNova_sw8.UserValue SetLightColor lNova_sw9, "orange", lNova_sw9.UserValue elseif playermode=kModeRocket then if PlayerState(CurrentPlayer).lNovaStatesKyln(3)=0 and PlayerState(CurrentPlayer).lNovaStatesKyln(4)=0 then SetLightColor lNova_sw8, "orange", lNova_sw8.UserValue SetLightColor lNova_sw9, "orange", lNova_sw9.UserValue elseif (PlayerState(CurrentPlayer).lNovaStatesKyln(3)=2 and PlayerState(CurrentPlayer).lNovaStatesKyln(4)=0) or _ (PlayerState(CurrentPlayer).lNovaStatesKyln(3)=0 and PlayerState(CurrentPlayer).lNovaStatesKyln(4)=2) then lNova_sw8.UserValue=PlayerState(CurrentPlayer).lNovaStatesKyln(3) lNova_sw9.UserValue=PlayerState(CurrentPlayer).lNovaStatesKyln(4) SetLightColor lNova_sw8, "orange", lNova_sw8.UserValue SetLightColor lNova_sw9, "orange", lNova_sw9.UserValue else lNova_sw8.BlinkInterval=BlinkIntDef lNova_sw9.BlinkInterval=BlinkIntDef if lNova_sw8.UserValue=2 then lNova_sw8.BlinkInterval=BlinkIntFast if lNova_sw9.UserValue=2 then lNova_sw9.BlinkInterval=BlinkIntFast End if End If ScorbitBuildGameModes() 'Change the music ? End Sub ' Create a new ball on the Playfield Sub CreateNewBall() ' James DOF DOF 321, DOFOff DOF 322, DOFOff DOF 323, DOFOff DOF 324, DOFOff ' create a ball in the plunger lane kicker. bCreatedBall = True BallRelease.CreateSizedball BallSize / 2 BumperMultiplier=BumperMultiplier+1 ' There is a (or another) ball on the playfield BallsOnPlayfield = BallsOnPlayfield + 1 ' kick it out.. BallRelease.Kick 290, 10 PlaySoundAt SoundFXDOF("fx_Ballrel1", 121, DOFPulse, DOFContactors), BallRelease ' if there is 2 or more balls then set the multibal flag (remember to check for locked balls and other balls used for animations) ' set the bAutoPlunger flag to kick the ball in play automatically If BallsOnPlayfield > 1 Then DOF 129, DOFPulse 'debug.print "SETTING MULTIBALL MODE " & BallsOnPlayfield & "!!!!!!!!!!!!!!!!!!" bMultiBallMode = True bAutoPlunger = True End If End Sub Sub CreateNewBallGroot() BumperMultiplier=BumperMultiplier+1 ' create a ball in the plunger lane kicker. GrootKicker.CreateSizedball BallSize / 2 ' There is a (or another) ball on the playfield BallsOnPlayfield = BallsOnPlayfield + 1 ' kick it out.. 'GrootKicker.Kick 180, 10 GrootKicker.Kick (180 + (6*RND-2)), 20 PlaySoundAt SoundFXDOF("fx_Ballrel1", 109, DOFPulse, DOFContactors), GrootKicker DOF 112, DOFPulse ' if there is 2 or more balls then set the multibal flag (remember to check for locked balls and other balls used for animations) ' set the bAutoPlunger flag to kick the ball in play automatically If BallsOnPlayfield > 1 Then 'debug.print "GROOT SETTING MULTIBALL MODE " & BallsOnPlayfield & "!!!!!!!!!!!!!!!!!!" DOF 129, DOFPulse bMultiBallMode = True End If End Sub ' Add extra balls to the table with autoplunger ' Use it as AddMultiball 4 to add 4 extra balls to the table Sub AddMultiball(nballs) mBalls2Eject = mBalls2Eject + nballs CreateMultiballTimer.Enabled = True End Sub Sub AddMultiballFast(nballs) if CreateMultiballTimer.Enabled = False and ticksFromLastEject>200 then CreateMultiballTimer.Interval = 100 ' shortcut the first time through End If AddMultiball(nballs) End Sub ' Eject the ball after the delay, AddMultiballDelay Sub CreateMultiballTimer_Timer() ' wait if there is a ball in the plunger lane CreateMultiballTimer.Interval = 2000 If bBallInPlungerLane Then Exit Sub Else If BallsOnPlayfield < MaxMultiballs Then CreateNewBall() mBalls2Eject = mBalls2Eject -1 ticksFromLastEject=0 If mBalls2Eject = 0 Then 'if there are no more balls to eject then stop the timer Me.Enabled = False End If Else 'the max number of multiballs is reached, so stop the timer mBalls2Eject = 0 Me.Enabled = False End If End If End Sub Dim DoAnimateScore_Interval2 Dim DoAnimateScore_Fade Dim DoAnimateScore_txtOffsetY Dim DoAnimateScore_txtOffsetX Dim DoAnimateScore_txtItalic Dim DoAnimateScore_txtAngle Dim DoAnimateScore_txtSize Dim DoAnimateScore_ThisScore Dim DoAnimateScore_ThisTitle Dim DoAnimateScore_SmallScore Dim DoAnimateScore_txtType Dim DoAnimateScore_txtSlideUp Sub DoAnimateScore(ImageIdx, mode, thisScore) Dim Image Dim json Dim bStartOpaque:bStartOpaque=True DoAnimateScore_ThisTitle="" DoAnimateScore_SmallScore=False DoAnimateScore_txtItalic=0 DoAnimateScore_txtSize=10 DoAnimateScore_txtAngle=0 DoAnimateScore_txtOffsetX=0 DoAnimateScore_txtOffsetY=0 DoAnimateScore_Interval2=1500 DoAnimateScore_txtSlideUp=False DoAnimateScore_txtType=0 ' Score Font (1=Guardians Font) 'puPlayer.LabelSet pTransp,"ScoreAnimation", "PuPOverlays\\ScoreRonan2.gif", 1,"{'mt':2,'width':100, 'height':100, 'anigif':100, 'xpos':1, 'ypos':1}" DoAnimateScore_Fade=False if ImageIdx=kModeXandar then Select case mode Case kModeGamora: ' Green spinning Sword DoAnimateScore_txtType=1 PlaySoundVol "sfx_BaseHit13", VolSfx json="{'mt':2,'width':60, 'height':100, 'anigif':300, 'xpos':0, 'ypos':0, 'xalign':1, 'yalign':1}" case kModeStarLord: DoAnimateScore_txtType=1 PlaySoundVol "sfx_BaseHit12", VolSfx json="{'mt':2,'width':100, 'height':100, 'anigif':300, 'xpos':0, 'ypos':10,'xalign':0,'yalign':0}" case kModeDrax: ImageIdx=kModeDrax PlaySoundVol "sfx_BaseHit12", VolSfx case kModeBroker: ImageIdx=kModeBroker PlaySoundVol "sfx_BaseHit13", VolSfx case kModeRocket: ImageIdx=kModeRocket PlaySoundVol "sfx_BaseHit13", VolSfx case kModeYandu: ImageIdx=kModeYandu PlaySoundVol "sfx_BaseHit12", VolSfx Case kModeNebula: ' Blue knives DoAnimateScore_txtType=1 PlaySoundVol "sfx_BaseHit13", VolSfx json="{'mt':2,'width':60, 'height':100, 'anigif':300, 'xpos':0, 'ypos':0, 'xalign':1, 'yalign':1}" Case kModeRonan: ImageIdx=kModeRonan PlaySoundVol "sfx_BaseHit13", VolSfx End Select End if Select Case ImageIdx case kModeNebula: If Mode=2 then DoAnimateScore_SmallScore=True Image="PuPOverlays\\Clear.png" DoAnimateScore_txtSlideUp=True DoAnimateScore_txtOffsetX=INT(RND*90)-48 DoAnimateScore_txtOffsetY=50 DoAnimateScore_Interval2=60 Else bStartOpaque=False PuPlayer.SendMSG "{ ""mt"":301, ""SN"": " & pTransp &", ""FN"":22, ""AM"":1, ""AV"":200 }" Image="PuPOverlays\\ScoreNebula" & mode & ".gif" json="{'mt':2,'width':40, 'height':60, 'anigif':300, 'xpos':0, 'ypos':0,'xalign':1,'yalign':1}" End if case kModeRonan: Image="PuPOverlays\\ScoreRonan" & mode & ".gif" If Mode=1 then DoAnimateScore_Fade=True json="{'mt':2,'width':85, 'height':58, 'anigif':100, 'xpos':5, 'ypos':20,'xalign':0,'yalign':0}" Else json="{'mt':2,'width':100, 'height':100, 'anigif':100, 'xpos':0, 'ypos':0,'xalign':0,'yalign':0}" End if case kModeBroker: DoAnimateScore_txtItalic=1 DoAnimateScore_txtSize=7 DoAnimateScore_txtAngle=100 DoAnimateScore_txtOffsetX=20 DoAnimateScore_txtOffsetY=-5 DoAnimateScore_Interval2=2500 Image="PuPOverlays\\ScoreBroker" & INT(RND*2)+1 & ".gif" json= "{'mt':2,'width':39, 'height':65, 'anigif':200, 'xpos':20, 'ypos':15,'xalign':0,'yalign':0}" case kModeStarLord: bStartOpaque=False DoAnimateScore_txtSize=12 DoAnimateScore_txtOffsetY=18 Image="PuPOverlays\\ScoreQuill" & mode & ".gif" if mode=1 then PuPlayer.SendMSG "{ ""mt"":301, ""SN"": " & pTransp &", ""FN"":22, ""AM"":1, ""AV"":180 }" elseif mode=2 then PuPlayer.SendMSG "{ ""mt"":301, ""SN"": " & pTransp &", ""FN"":22, ""AM"":1, ""AV"":200 }" else PuPlayer.SendMSG "{ ""mt"":301, ""SN"": " & pTransp &", ""FN"":22, ""AM"":1, ""AV"":128 }" End if json="{'mt':2,'width':100, 'height':100, 'anigif':100, 'xpos':0, 'ypos':0, 'xalign':0,'yalign':0}" case kModeRocket: Image="PuPOverlays\\ScoreRocket" & mode & ".gif" DoAnimateScore_txtSize=12 DoAnimateScore_txtType=1 bStartOpaque=False PuPlayer.SendMSG "{ ""mt"":301, ""SN"": " & pTransp &", ""FN"":22, ""AM"":1, ""AV"":200 }" if mode = 1 then json="{'mt':2,'width':110, 'height':170, 'anigif':230, 'xpos':0, 'xalign':1,'yalign':1,'ypos':0}" else json="{'mt':2,'width':80, 'height':80, 'anigif':200, 'xpos':0, 'xalign':1,'yalign':1,'ypos':0}" End if case kModeCherry: Image="PuPOverlays\\ScoreCherry.gif" DoAnimateScore_SmallScore=True DoAnimateScore_txtSize=12 DoAnimateScore_txtType=1 bStartOpaque=False PuPlayer.SendMSG "{ ""mt"":301, ""SN"": " & pTransp &", ""FN"":22, ""AM"":1, ""AV"":255 }" json="{'mt':2,'width':60, 'height':100, 'anigif':190, 'xpos':0, 'xalign':1,'yalign':1,'ypos':0}" DoAnimateScore_Interval2=700 case kModeYandu: DoAnimateScore_txtOffsetY=-10 DoAnimateScore_txtType=1 PuPlayer.SendMSG "{ ""mt"":301, ""SN"": " & pTransp &", ""FN"":22, ""AM"":1, ""AV"":160 }" Image="PuPOverlays\\ScoreYandu" & mode & ".gif" json="{'mt':2,'width':100, 'height':100, 'anigif':300, 'xpos':0, 'ypos':0,'xalign':0,'yalign':0}" case kModeDrax: Image="PuPOverlays\\ScoreDrax" & mode & ".gif" If Mode=1 then DoAnimateScore_Fade=True json="{'mt':2,'width':85, 'height':58, 'anigif':100, 'xpos':5, 'ypos':20,'xalign':0,'yalign':0}" Else DoAnimateScore_SmallScore=True json="{'mt':2,'width':100, 'height':100, 'anigif':300, 'xpos':0, 'ypos':0,'xalign':0,'yalign':0}" End if case kModeGamora: Image="PuPOverlays\\ScoreGamora" & mode & ".gif" json="{'mt':2,'width':100, 'height':100, 'anigif':300, 'xpos':0, 'ypos':10,'xalign':0,'yalign':0}" DoAnimateScore_Interval2=2000 ' bStartOpaque=False ' PuPlayer.SendMSG "{ ""mt"":301, ""SN"": " & pTransp &", ""FN"":22, ""AM"":1, ""AV"":200 }" case kModeGrootMB: DoAnimateScore_txtType=1 DoAnimateScore_ThisTitle="JACKPOT" DoAnimateScore_SmallScore=True Image="PuPOverlays\\Clear.png" case kModeImmo: DoAnimateScore_txtType=1 DoAnimateScore_SmallScore=True Image="PuPOverlays\\ScoreImmo" & mode & ".gif" json="{'mt':2,'width':100, 'height':100, 'anigif':300, 'xpos':0, 'ypos':10,'xalign':0,'yalign':0}" DoAnimateScore_Interval2=2500 case kModeXandar: Image="PuPOverlays\\ScoreXandar" & mode & ".gif" DoAnimateScore_Interval2=1200 End Select if bStartOpaque then PuPlayer.SendMSG "{ ""mt"":301, ""SN"": " & pTransp &", ""FN"":22, ""AM"":1, ""AV"":255 }" puPlayer.LabelSet pTransp,"ScoreAnimation", Image, 1,json DoAnimateScore_ThisScore=thisScore tmrAnimateScore.UserValue = 0 tmrAnimateScore.Interval=500 tmrAnimateScore.Enabled = True End sub Sub tmrAnimateScore_Timer if NOT bPupStarted then tmrAnimateScore.Enabled = False : Exit Sub ' FIX9: guard teardown Dim ScoreTxt Dim ScoreTitle ScoreTitle=DoAnimateScore_ThisTitle tmrAnimateScore.UserValue=tmrAnimateScore.UserValue+1 If tmrAnimateScore.UserValue=1 then tmrAnimateScore.Interval=DoAnimateScore_Interval2 if DoAnimateScore_Fade then PuPlayer.SendMSG "{ ""mt"":301, ""SN"": " & pTransp &", ""FN"":22, ""AM"":1, ""AV"":80 }" End if ScoreTxt=FormatScore(DoAnimateScore_ThisScore) if DoAnimateScore_SmallScore then if DoAnimateScore_ThisScore>1000000 then ScoreTxt=DoAnimateScore_ThisScore/1000000 & "M" Else ScoreTxt=DoAnimateScore_ThisScore/100000 & "K" End if End if if DoAnimateScore_txtType=0 then puPlayer.LabelSet pDMDText,"ScoreText", ScoreTxt, 1,"{'mt':2, 'ztop':1,'size':" & DoAnimateScore_txtSize & ", 'xpos':" & 48+DoAnimateScore_txtOffsetX & ", 'ypos':" & 42+DoAnimateScore_txtOffsetY & ", 'xalign':1, 'rotate': " & DoAnimateScore_txtAngle & ",'italic':" & DoAnimateScore_txtItalic & "}" puPlayer.LabelSet pDMDText,"ScoreTextT", ScoreTitle, 1,"{'mt':2, 'ztop':1,'size':" & DoAnimateScore_txtSize-4 & ", 'xpos':" & 48+DoAnimateScore_txtOffsetX & ", 'ypos':" & 32+DoAnimateScore_txtOffsetY & ", 'xalign':1, 'rotate': " & DoAnimateScore_txtAngle & ",'italic':" & DoAnimateScore_txtItalic & "}" else puPlayer.LabelSet pDMDText,"ScoreText2", ScoreTxt, 1,"{'mt':2, 'ztop':1,'size':" & DoAnimateScore_txtSize & ", 'xpos':" & 48+DoAnimateScore_txtOffsetX & ", 'ypos':" & 42+DoAnimateScore_txtOffsetY & ", 'xalign':1, 'rotate': " & DoAnimateScore_txtAngle & ",'italic':" & DoAnimateScore_txtItalic & "}" puPlayer.LabelSet pDMDText,"ScoreText2T", ScoreTitle, 1,"{'mt':2, 'ztop':1,'size':" & DoAnimateScore_txtSize-4 & ", 'xpos':" & 48+DoAnimateScore_txtOffsetX & ", 'ypos':" & 32+DoAnimateScore_txtOffsetY & ", 'xalign':1, 'rotate': " & DoAnimateScore_txtAngle & ",'italic':" & DoAnimateScore_txtItalic & "}" End if Else if DoAnimateScore_txtSlideUp Then DoAnimateScore_txtOffsetY=DoAnimateScore_txtOffsetY-8 ScoreTxt=FormatScore(DoAnimateScore_ThisScore) if DoAnimateScore_ThisScore>1000000 then ScoreTxt=DoAnimateScore_ThisScore/1000000 & "M" Else ScoreTxt=DoAnimateScore_ThisScore/100000 & "K" End if if DoAnimateScore_txtType=0 then puPlayer.LabelSet pDMDText,"ScoreText", ScoreTxt, 1,"{'mt':2, 'ztop':1,'size':" & DoAnimateScore_txtSize & ", 'xpos':" & 48+DoAnimateScore_txtOffsetX & ", 'ypos':" & 42+DoAnimateScore_txtOffsetY & ", 'xalign':1, 'rotate': " & DoAnimateScore_txtAngle & ",'italic':" & DoAnimateScore_txtItalic & "}" puPlayer.LabelSet pDMDText,"ScoreTextT", ScoreTitle, 1,"{'mt':2, 'ztop':1,'size':" & DoAnimateScore_txtSize-4 & ", 'xpos':" & 48+DoAnimateScore_txtOffsetX & ", 'ypos':" & 32+DoAnimateScore_txtOffsetY & ", 'xalign':1, 'rotate': " & DoAnimateScore_txtAngle & ",'italic':" & DoAnimateScore_txtItalic & "}" else puPlayer.LabelSet pDMDText,"ScoreText2", ScoreTxt, 1,"{'mt':2, 'ztop':1,'size':" & DoAnimateScore_txtSize & ", 'xpos':" & 48+DoAnimateScore_txtOffsetX & ", 'ypos':" & 42+DoAnimateScore_txtOffsetY & ", 'xalign':1, 'rotate': " & DoAnimateScore_txtAngle & ",'italic':" & DoAnimateScore_txtItalic & "}" puPlayer.LabelSet pDMDText,"ScoreText2T", ScoreTitle, 1,"{'mt':2, 'ztop':1,'size':" & DoAnimateScore_txtSize-4 & ", 'xpos':" & 48+DoAnimateScore_txtOffsetX & ", 'ypos':" & 32+DoAnimateScore_txtOffsetY & ", 'xalign':1, 'rotate': " & DoAnimateScore_txtAngle & ",'italic':" & DoAnimateScore_txtItalic & "}" End if if DoAnimateScore_txtOffsetY<=-48 then tmrAnimateScore.Enabled=False DoAnimateScoreClear End if Else tmrAnimateScore.Enabled=False DoAnimateScoreClear End if End if End Sub Sub DoAnimateScoreClear If NOT bPupStarted Then Exit Sub ' FIX 2.1.2: guard against PUP teardown puPlayer.LabelSet pTransp,"ScoreAnimation", "", 0,"" puPlayer.LabelSet pDMDText,"ScoreText", "", 1, "" puPlayer.LabelSet pDMDText,"ScoreTextT", "", 1, "" puPlayer.LabelSet pDMDText,"ScoreText2", "", 1, "" puPlayer.LabelSet pDMDText,"ScoreText2T", "", 1, "" End Sub Sub BonusAddModeHit(Index) if Index <> -1 then ' We are adding the standard bonus Select case index case "0" ' Yando BonusArrowHits(index) = BonusArrowHits(index) + 5000 case "1" ' Ronan BonusArrowHits(index) = BonusArrowHits(index) + 4000 case "2" ' Rocket BonusArrowHits(index) = BonusArrowHits(index) + 5000 case "3" ' Nebula BonusArrowHits(index) = BonusArrowHits(index) + 3000 case "4" ' Groot BonusArrowHits(index) = BonusArrowHits(index) + 2000 case "5" ' Broker BonusArrowHits(index) = BonusArrowHits(index) + 3000 case "6" ' Gamora BonusArrowHits(index) = BonusArrowHits(index) + 3000 case "7" ' Drax BonusArrowHits(index) = BonusArrowHits(index) + 4000 case "8" ' StarLord BonusArrowHits(index) = BonusArrowHits(index) + 5000 End Select debug.print "BonusAddModeHit " & index & " " & BonusArrowHits(index) 'BonusAddMode(-1) ' Add the default bonus for this End if End Sub Sub BonusAddMode(value, bDoublePoints) ' Add bonus to the mode and add actual score Dim BonusIndex dim BonusValue BonusIndex = 0 BonusValue = 0 if PlayerMode <> -1 then Select case PlayerMode case 0 ' Nebula BonusIndex = 3 BonusValue = 300000 case 1 ' Ronan BonusIndex = 1 if (BonusModeValue(BonusIndex) = 0) then BonusValue = 300000 else BonusValue = 200000 End If case 2 ' Yandu BonusIndex = 0 if (BonusModeValue(BonusIndex) = 0) then BonusValue = 1000000 else BonusValue = 500000 End If case 3 ' Star Lord BonusIndex = 8 BonusValue = value ' BONUS is the countdown timer case 4 ' Drax BonusIndex = 7 BonusValue = 200000 case 5 ' Rocket BonusIndex = 2 BonusValue = 300000 case 6 ' Gamora BonusIndex = 6 BonusValue = 400000 case 7 ' Broker BonusIndex = 5 BonusValue = 250000 End Select 'debug.print "Bonus " & PlayerMode & " " & BonusIndex & " " & BonusValue & " OldVal: " & BonusModeValue(BonusIndex) & " Double:" & bDoublePoints if bDoublePoints then BonusValue = BonusValue * 2 BonusModeValue(BonusIndex) = BonusModeValue(BonusIndex) + BonusValue if value = -1 Then AddScore BonusModeValue(BonusIndex) BonusModeTotal(BonusIndex) = BonusModeTotal(BonusIndex) + BonusModeValue(BonusIndex) else AddScore value BonusModeTotal(BonusIndex) = BonusModeTotal(BonusIndex) + value end if End If End Sub ' The Player has lost his ball (there are no more balls on the playfield). ' Handle any bonus points awarded Dim tmpBonusTotal dim bonusCnt dim bonusSkip dim tmrEndOfBallBonusMultiCount Sub tmrEndOfBallBonus_Timer() dim i, a dim mode dim tmpModeIndex dim ModeBonus dim bAddedBonus Dim bDone dim FastBonus bDone = False mode=0 i=0 FastBonus = 0 tmrEndOfBallBonus.Interval = 510 tmrEndOfBallBonus.Enabled = False bAddedBonus = False if tmrEndOfBallBonus.UserValue = 0 then aRampLightsSave ' Save off the ramp colors End If ' Turn off the Name lights as we cycle through them SetLightColor lYonduName, "blue-light", 0 SetLightColor lYonduArrow, "blue-light", 0 DOF 300, DOFOff ' James DOF SetLightColor lRonanName, "yellow", 0 SetLightColor lRonanArrow, "yellow", 0 DOF 301, DOFOff ' James DOF SetLightColor lRocketName, "red", 0 SetLightColor lRocketArrow, "red", 0 DOF 302, DOFOff ' James DOF SetLightColor lNebulaName, "blue", 0 SetLightColor lNebulaArrow, "blue", 0 DOF 303, DOFOff ' James DOF SetLightColor lgr, "green", 0 SetLightColor lgr_a, "green", 0 DOF 304, DOFOff ' James DOF SetLightColor lBrokerName, "cyan", 0 SetLightColor lBrokerArrow, "cyan", 0 DOF 305, DOFOff ' James DOF SetLightColor lGamoraName, "green", 0 SetLightColor lGamoraArrow, "green", 0 DOF 306, DOFOff ' James DOF SetLightColor lDraxName, "amber", 0 SetLightColor lDraxArrow, "amber", 0 DOF 307, DOFOff ' James DOF SetLightColor lStarLordName, "orange", 0 SetLightColor lStarLordArrow, "orange", 0 DOF 308, DOFOff ' James DOF if bonusSkip then FastBonus = 501 tmrEndOfBallBonus.Interval = 100 End If 'debug.print "Start " & tmrEndOfBallBonus.UserValue Select case INT(tmrEndOfBallBonus.UserValue) case 0 ' Show Mode Total tmrEndOfBallBonusMultiCount=0 tmpBonusTotal = 0 bonusCnt=0 tmrEndOfBallBonus.UserValue = 1.0 tmrEndOfBallBonus.Interval = 500 - FastBonus DMD FormatScore(ModePoints), CL(1, "MODE POINTS"), "", eBlink, eNone, eNone, 1000, False, "" debug.print "ModePoints: " & ModePoints ' For i = mode to 8 ' if (BonusArrowHits(i) <> 0 or BonusModeTotal(i) <> 0) then ' See how many bonuses we do ' bonusCnt=bonusCnt+1 ' End if ' Next case 1 ' Scroll through Hit Bonus (1.x) tmrEndOfBallBonus.Interval = 375 - FastBonus mode = CInt((tmrEndOfBallBonus.UserValue - 1) * 10) ' Get the .x for the second part of mode For i = mode to 8 debug.print "BonusIdx: " & i & " " & BonusArrowHits(i) if (BonusArrowHits(i) <> 0 or BonusModeTotal(i) <> 0) and bAddedBonus=False then ' If we have any bonus points bAddedBonus=True bonusCnt=bonusCnt+1 'pDMDEvent(kDMD_BonusBG+1+i) ModeBonus = BonusArrowHits(i) ' All the bonus points accumulated for this mode tmpModeIndex = Bonus2ModeIndex(i) if tmpModeIndex <> -1 then ' Make sure we got something valid if ModePercent(tmpModeIndex) >= 100 or XandarCompletions>0 then ' If you completed the level you get 2x of your total mode bonus points (If we didnt play the level BonusModeTotal will be 0) if XandarCompletions > 0 then ' Xandard complete (add another 0.25) ModeBonus = ModeBonus + (BonusModeTotal(i) / 2) + (BonusModeTotal(i) / 4) Else ModeBonus = ModeBonus + (BonusModeTotal(i) / 2) End If ModeBonus=(ModeBonus\10)*10 ' Ensure score is even End If End If tmpBonusTotal = tmpBonusTotal + ModeBonus if tmpModeIndex <> -1 then debug.print "BL: " & i & " - HITS: " & BonusArrowHits(i) & " ModeBonus: " & BonusModeTotal(i) & " TotalBonus:" & ModeBonus & " ModePercent: " & ModePercent(tmpModeIndex) & " " & tmpModeIndex DOF 300 +i, DOFOn ' James DOF Select case i case 0 ' Yando SetLightColor lYonduName, "blue-light", 2 SetLightColor lYonduArrow, "blue-light", 2 ' ModeBonus = BonusArrowHits(i) + (BonusModeTotal(i) / 2) ' tmpBonusTotal = tmpBonusTotal + ModeBonus tmrEndOfBallBonus.UserValue = 1.1 DMD CL(1, "YANDU BONUS"), FormatScore(ModeBonus), "", eBlink, eNone, eNone, 500, False, "" if bonusSkip=False then PlaySoundVol "BonusA-" & i+1, VolSfx pBgShowBonus "YANDU BONUS", FormatScore(ModeBonus) PuPlayer.LabelSet pBonusScreen, "Bonus1", "PuPOverlays\\Bonus1g.png",1,"{'mt':2,'color':111111,'width':22, 'height':56.5,'yalign':0,'ypos':6.5,'xpos':1.4}" vpmtimer.addtimer tmrEndOfBallBonus.Interval, "PuPlayer.LabelSet pBonusScreen, ""Bonus1"", ""PuPOverlays\\Bonus1.png"",1,""{'mt':2,'color':111111,'width':22, 'height':56.5,'yalign':0,'ypos':6.5,'xpos':1.4}"" '" case 1 ' Ronan SetLightColor lRonanName, "yellow", 2 SetLightColor lRonanArrow, "yellow", 2 ' ModeBonus = BonusArrowHits(i) + (BonusModeTotal(i) / 2) ' tmpBonusTotal = tmpBonusTotal + ModeBonus tmrEndOfBallBonus.UserValue = 1.2 DMD CL(1, "RONAN BONUS"), FormatScore(ModeBonus), "", eBlink, eNone, eNone, 500, False, "" if bonusSkip=False then PlaySoundVol "BonusA-" & i+1, VolSfx pBgShowBonus "RONAN BONUS", FormatScore(ModeBonus) PuPlayer.LabelSet pBonusScreen, "Bonus2", "PuPOverlays\\Bonus2g.png",1,"{'mt':2,'color':111111,'width':22, 'height':56.5,'yalign':0,'ypos':6.5,'xpos':11.7}" vpmtimer.addtimer tmrEndOfBallBonus.Interval,"PuPlayer.LabelSet pBonusScreen, ""Bonus2"", ""PuPOverlays\\Bonus2.png"",1,""{'mt':2,'color':111111,'width':22, 'height':56.5,'yalign':0,'ypos':6.5,'xpos':11.7}"" '" case 2 ' Rocket SetLightColor lRocketName, "red", 2 SetLightColor lRocketArrow, "red", 2 'PuPlayer.playlistplayex pPopUP2,"PuPOverlays","BonusScreen-2.mp4",0,20 ' ModeBonus = BonusArrowHits(i) + (BonusModeTotal(i) / 2) ' tmpBonusTotal = tmpBonusTotal + ModeBonus tmrEndOfBallBonus.UserValue = 1.3 DMD CL(1, "ROCKET BONUS"), FormatScore(ModeBonus), "", eBlink, eNone, eNone, 500, False, "" if bonusSkip=False then PlaySoundVol "BonusA-" & i+1, VolSfx pBgShowBonus "ROCKET BONUS", FormatScore(ModeBonus) PuPlayer.LabelSet pBonusScreen, "Bonus3", "PuPOverlays\\Bonus3g.png",1,"{'mt':2,'color':111111,'width':22, 'height':56.5,'yalign':0,'ypos':6.5,'xpos':21.3}" vpmtimer.addtimer tmrEndOfBallBonus.Interval,"PuPlayer.LabelSet pBonusScreen, ""Bonus3"", ""PuPOverlays\\Bonus3.png"",1,""{'mt':2,'color':111111,'width':22, 'height':56.5,'yalign':0,'ypos':6.5,'xpos':21.3}"" '" case 3 ' Nebula SetLightColor lNebulaName, "blue", 2 SetLightColor lNebulaArrow, "blue", 2 ' ModeBonus = BonusArrowHits(i) + (BonusModeTotal(i) / 2) ' tmpBonusTotal = tmpBonusTotal + ModeBonus tmrEndOfBallBonus.UserValue = 1.4 DMD CL(1, "NEBULA BONUS"), FormatScore(ModeBonus), "", eBlink, eNone, eNone, 500, False,"" if bonusSkip=False then PlaySoundVol "BonusA-" & i+1, VolSfx pBgShowBonus "NEBULA BONUS", FormatScore(ModeBonus) PuPlayer.LabelSet pBonusScreen, "Bonus4", "PuPOverlays\\Bonus4g.png",1,"{'mt':2,'color':111111,'width':22, 'height':56.5,'yalign':0,'ypos':6.5,'xpos':30.5}" vpmtimer.addtimer tmrEndOfBallBonus.Interval,"PuPlayer.LabelSet pBonusScreen, ""Bonus4"", ""PuPOverlays\\Bonus4.png"",1,""{'mt':2,'color':111111,'width':22, 'height':56.5,'yalign':0,'ypos':6.5,'xpos':30.5}"" '" case 4 ' Groot SetLightColor lgr, "green", 2 SetLightColor lgr_a, "green", 2 ' ModeBonus = BonusArrowHits(i) + (BonusModeTotal(i) / 2) ' tmpBonusTotal = tmpBonusTotal + ModeBonus tmrEndOfBallBonus.UserValue = 1.5 DMD CL(1, "GROOT BONUS"), FormatScore(ModeBonus), "", eBlink, eNone, eNone, 500, False, "" if bonusSkip=False then PlaySoundVol "BonusA-" & i+1, VolSfx pBgShowBonus "GROOT BONUS", FormatScore(ModeBonus) PuPlayer.LabelSet pBonusScreen, "Bonus5", "PuPOverlays\\Bonus5g.png",1,"{'mt':2,'color':111111,'width':22, 'height':56.5,'yalign':0,'ypos':6.5,'xpos':39.5}" vpmtimer.addtimer tmrEndOfBallBonus.Interval,"PuPlayer.LabelSet pBonusScreen, ""Bonus5"", ""PuPOverlays\\Bonus5.png"",1,""{'mt':2,'color':111111,'width':22, 'height':56.5,'yalign':0,'ypos':6.5,'xpos':39.5}"" '" case 5 ' Broker SetLightColor lBrokerName, "cyan", 2 SetLightColor lBrokerArrow, "cyan", 2 ' ModeBonus = BonusArrowHits(i) + (BonusModeTotal(i) / 2) ' tmpBonusTotal = tmpBonusTotal + ModeBonus tmrEndOfBallBonus.UserValue = 1.6 DMD CL(1, "BROKER BONUS"), FormatScore(ModeBonus), "", eBlink, eNone, eNone, 500, False, "" if bonusSkip=False then PlaySoundVol "BonusA-" & i+1, VolSfx pBgShowBonus "BROKER BONUS", FormatScore(ModeBonus) PuPlayer.LabelSet pBonusScreen, "Bonus6", "PuPOverlays\\Bonus6g.png",1,"{'mt':2,'color':111111,'width':22, 'height':56.5,'yalign':0,'ypos':6.5,'xpos':49}" vpmtimer.addtimer tmrEndOfBallBonus.Interval,"PuPlayer.LabelSet pBonusScreen, ""Bonus6"", ""PuPOverlays\\Bonus6.png"",1,""{'mt':2,'color':111111,'width':22, 'height':56.5,'yalign':0,'ypos':6.5,'xpos':49}"" '" case 6 ' Gamora SetLightColor lGamoraName, "green", 2 SetLightColor lGamoraArrow, "green", 2 ' ModeBonus = BonusArrowHits(i) + (BonusModeTotal(i) / 2) ' tmpBonusTotal = tmpBonusTotal + ModeBonus tmrEndOfBallBonus.UserValue = 1.7 DMD CL(1, "GAMORA BONUS"), FormatScore(ModeBonus), "", eBlink, eNone, eNone, 500, False, "" if bonusSkip=False then PlaySoundVol "BonusA-" & i+1, VolSfx pBgShowBonus "GAMORA BONUS", FormatScore(ModeBonus) PuPlayer.LabelSet pBonusScreen, "Bonus7", "PuPOverlays\\Bonus7g.png",1,"{'mt':2,'color':111111,'width':22, 'height':56.5,'yalign':0,'ypos':6.5,'xpos':58}" vpmtimer.addtimer tmrEndOfBallBonus.Interval,"PuPlayer.LabelSet pBonusScreen, ""Bonus7"", ""PuPOverlays\\Bonus7.png"",1,""{'mt':2,'color':111111,'width':22, 'height':56.5,'yalign':0,'ypos':6.5,'xpos':58}"" '" case 7 ' Drax SetLightColor lDraxName, "amber", 2 SetLightColor lDraxArrow, "amber", 2 ' ModeBonus = BonusArrowHits(i) + (BonusModeTotal(i) / 2) ' tmpBonusTotal = tmpBonusTotal + ModeBonus tmrEndOfBallBonus.UserValue = 1.8 DMD CL(1, "DRAX BONUS"), FormatScore(ModeBonus), "", eBlink, eNone, eNone, 500, False, "" if bonusSkip=False then PlaySoundVol "BonusA-" & i+1, VolSfx pBgShowBonus "DRAX BONUS", FormatScore(ModeBonus) PuPlayer.LabelSet pBonusScreen, "Bonus8", "PuPOverlays\\Bonus8g.png",1,"{'mt':2,'color':111111,'width':22, 'height':56.5,'yalign':0,'ypos':6.5,'xpos':67}" vpmtimer.addtimer tmrEndOfBallBonus.Interval,"PuPlayer.LabelSet pBonusScreen, ""Bonus8"", ""PuPOverlays\\Bonus8.png"",1,""{'mt':2,'color':111111,'width':22, 'height':56.5,'yalign':0,'ypos':6.5,'xpos':67}"" '" case 8 ' StarLord SetLightColor lStarLordName, "orange", 2 SetLightColor lStarLordArrow, "orange", 2 ' ModeBonus = BonusArrowHits(i) + (BonusModeTotal(i) / 2) ' tmpBonusTotal = tmpBonusTotal + ModeBonus tmrEndOfBallBonus.UserValue = 2 DMD CL(1, "STARLORD BONUS"), FormatScore(ModeBonus), "", eBlink, eNone, eNone, 500, False, "" if bonusSkip=False then PlaySoundVol "BonusA-" & i+1, VolSfx pBgShowBonus "STARLORD BONUS", FormatScore(ModeBonus) PuPlayer.LabelSet pBonusScreen, "Bonus9", "PuPOverlays\\Bonus9g.png",1,"{'mt':2,'color':111111,'width':22, 'height':56.5,'yalign':0,'ypos':6.5,'xpos':76}" vpmtimer.addtimer tmrEndOfBallBonus.Interval, "PuPlayer.LabelSet pBonusScreen, ""Bonus9"", ""PuPOverlays\\Bonus9.png"",1,""{'mt':2,'color':111111,'width':22, 'height':56.5,'yalign':0,'ypos':6.5,'xpos':76}"" '" End Select End If Next if bAddedBonus = False then if bonusSkip then tmrEndOfBallBonus.Interval = 200 Else tmrEndOfBallBonus.Interval = 1 End if tmrEndOfBallBonus.UserValue = 2 End If case 2 if bonusSkip then tmrEndOfBallBonus.UserValue = 3 Else tmrEndOfBallBonusMultiCount=tmrEndOfBallBonusMultiCount+1 PlaySoundVol "Bonus-" & tmrEndOfBallBonusMultiCount, VolSfx pBgShowBonus "TOTAL BONUS x " & tmrEndOfBallBonusMultiCount, FormatScore(tmpBonusTotal * tmrEndOfBallBonusMultiCount) ' Some reason I have to send this twice??? if tmrEndOfBallBonusMultiCount = BonusMultiplier then tmrEndOfBallBonus.UserValue = 3 End if End if case 3 ' Show Total Bonus PlaySoundVol "sfx_BonusEnd", VolSfx SetLightColor LightGuardians, "white", 2 tmrEndOfBallBonus.UserValue = 4 tmrEndOfBallBonus.Interval = 1000 DMD CL(1, "TOTAL BONUS"), FormatScore(tmpBonusTotal * BonusMultiplier), "", eBlink, eNone, eNone, 1000, False, "" pBgShowBonus "TOTAL BONUS x " & BonusMultiplier, FormatScore(tmpBonusTotal * BonusMultiplier) AddScore (tmpBonusTotal * BonusMultiplier) SetBonusMultiplier 1 ' Push it back down to 1 case 4 pDMDEvent(470) For i = 0 to 8 PuPlayer.LabelSet pBonusScreen, "Bonus" & i+1, "", 0,"" Next vpmtimer.addtimer 200, "playclear pBonusScreen '" ' Reset xandar if you beat it bXandarDone = False pBgShowBonus "", " " pBgShowBonus "", "" SetLightColor LightGuardians, "white", 0 aRampLightsRestore ' Restore ramp colors pBGGamePlay ' Change the backglass to the play mode pDMDSetPage(pScores) CheckWizardModesReady RefreshPlayerMode vpmtimer.addtimer 200, "EndOfBall2 '" ' debug.print "CLEAR" pDMDEvent(kDMD_BonusClear) bDone = True exit sub End Select tmrEndOfBallBonus.Enabled = True End Sub Sub EndOfBall() ' Show the End of Ball Bonus Scene Dim AwardPoints, TotalBonus, ii AwardPoints = 0 TotalBonus = 0 ' the first ball has been lost. From this point on no new players can join in bOnTheFirstBall = False if PlayerMode <> -1 Then ' Pause the countdown timer ModeCountdownTimer.Enabled = False End If ' only process any of this if the table is not tilted. (the tilt recovery ' mechanism will handle any extra balls or end of game) If(Tilted = False)Then ' Count the bonus. This table uses several bonus DMDflush GrootMBJackpot = 0 if bUsePupDMD then PuPlayer.LabelShowPage pBonusScreen,1,0,"":PuPlayer.LabelShowPage pDMDText, 2,0,"" pDMDEvent(kDMD_BonusBG) playmedia "Video-0x007A-2.mp4", "PupVideos", pBonusScreen, "", -1, "", 1, 1 playclear pAudio ' PlaySoundVol "sfx_BonusStart", VolSfx PlaySoundVol "BonusA-0", VolSfx 'This command merged Black and White background with video ' ffmpeg -i Video-0x007A.mp4 -i BonusScreen-BW2.png -filter_complex "[1:v]scale=1360:768 [ovrl],[0:v][ovrl]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -strict -2 ./output.mp4 ' add a bit of a delay to allow for the bonus points to be shown & added up bonusSkip=False tmrEndOfBallBonus.Interval = 800 tmrEndOfBallBonus.UserValue = 0 ' Timer will start EndOfBall2 when it is done tmrEndOfBallBonus.Enabled = true Else vpmtimer.addtimer 100, "EndOfBall2 '" End If End Sub ' The Timer which delays the machine to allow any bonus points to be added up ' has expired. Check to see if there are any extra balls for this player. ' if not, then check to see if this was the last ball (of the currentplayer) ' Sub EndOfBall2() dim i dim thisMode ' Reset Just in case BallsOutlaneDrainCnt=0 BallsOutlaneDrainIgnoreCnt=0 ' if were tilted, reset the internal tilted flag (this will also ' set TiltWarnings back to zero) which is useful if we are changing player LOL Tilted = False Tilt = 0 PlayMultiplier = 1 DisableTable False 'enable again bumpers and slingshots ' Disable Player select if we have competion mode or we didnt start Cherry or Imolation: https://youtu.be/pOW5GzQp0wM If PlayerMode = -1 and bCompetitionMode = False and bCherryBombReady=False and bImmolationReady=False and bXandarReady=False and ModesCompleted<>8 Then ' Dont go into a mode in CherryBomb is ready EnablePlayerSelect ElseIf PlayerMode = -1 and bCompetitionMode = False and (bCherryBombReady or bImmolationReady or bXandarReady) Then StopPlayerModeVideo End If for i = 0 to 8 ' Clear Bonus counters BonusArrowHits(i) = 0 ' Completing the mode allows you to carryover the BonusModeTotal instead of blanking it thisMode = Bonus2ModeIndex(i) if thisMode <> -1 then ' Make sure we got something valid if ModePercent(thisMode) < 100 then BonusModeTotal(i) = 0 End If 'BonusModeTotal(i) = 0 BonusModeValue(i) = 0 next ' has the player won an extra-ball ? (might be multiple outstanding) If(ExtraBallsAwards(CurrentPlayer) <> 0) and bBallInPlungerLane=False Then ' Save Extra ball for later if there is a ball in the plunger lane debug.print "Extra Ball" ' yep got to give it to them ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer)- 1 ' if no more EB's then turn off any shoot again light If(ExtraBallsAwards(CurrentPlayer) = 0)Then LightShootAgain.State = 0 LightShootAgain2.State = 0 End If If PlayerMode <> -1 then ' Mode isnt dont show the wait Scene WaitPlayerMode End if ' You may wish to do a bit of a song AND dance at this point DMD "_", CL(1, ("EXTRA BALL")), "_", eNone, eBlink, eNone, 1000, True, "" PlaySoundVol "vo_extraball", VolDef ResetForNewPlayerBall if INT(RND * 2) = 0 then pDMDEvent(kDMD_ExtraBall) Else pDMDEvent(kDMD_ShootAgain) End If ' Create a new ball in the shooters lane CreateNewBall() Else ' no extra balls BallsRemaining(CurrentPlayer) = BallsRemaining(CurrentPlayer)- 1 ' was that the last ball ? If(BallsRemaining(CurrentPlayer) <= 0) Then ' GAME OVER debug.print "No More Balls, High Score Entry" if bUsePupDMD then PuPlayer.PlayStop pOverVid ' Stop overlay if there is one PuPlayer.SetLoop pOverVid, 0 End If playclear pUnderVid playclear pAudio 'StopSound "m_wait" debug.print "Stopping sound m_wait" bSkipWaitVideo=True StopPlayerMode StopPlayerMode2 bSkipWaitVideo=False ' Turn off DOF so we dont accidently leave it on PlaySoundAt SoundFXDOF("fx_flipperdown", 101, DOFOff, DOFFlippers), LeftFlipper LeftFlipper.RotateToStart PlaySoundAt SoundFXDOF("fx_flipperdown", 102, DOFOff, DOFFlippers), RightFlipper RightFlipper.RotateToStart ' Submit the currentplayers score to the High Score system CheckHighScore() ' you may wish to play some music at this point Else ' not the last ball (for that player) ' if multiple players are playing then move onto the next one EndOfBallComplete() End If End If End Sub ' This function is called when the end of bonus display ' (or high score entry finished) AND it either end the game or ' move onto the next player (or the next ball of the same player) 'all of the same player) ' Sub EndOfBallComplete() Dim NextPlayer dim Match dim i debug.print "EndOfBall - Complete " ' are there multiple players playing this game ? If(PlayersPlayingGame > 1)Then ' then move to the next player NextPlayer = CurrentPlayer + 1 ' are we going from the last player back to the first ' (ie say from player 4 back to player 1) If(NextPlayer > PlayersPlayingGame-1)Then NextPlayer = 0 End If Else NextPlayer = CurrentPlayer End If debug.print "Next Player = " & NextPlayer ' is it the end of the game ? (all balls been lost for all players) If((BallsRemaining(CurrentPlayer) <= 0)AND(BallsRemaining(NextPlayer) <= 0))Then ' you may wish to do some sort of Point Match free game award here ' generally only done when not in free play mode puPlayer.LabelSet pDMDText,"Time", "" ,0,"" DisplayDMDText2 "_", "GAME OVER", 20000, 5, 0 bGameInPLay = False ' EndOfGame sets this but need to set early to disable flippers bShowMatch = True playclear pAudio ' Do Match end score code Match=10 * INT(RND * 9) if RND<(DMDStd(kDMDStd_MatchPCT)/100.0) then Match = Score(CurrentPlayer) mod 100 ' Force Match based on Percent Setup 'Match = Score(CurrentPlayer) mod 100 ' Force Match for testing 'If Score(CurrentPlayer) mod 100 = Match Then for i = 0 to PlayersPlayingGame-1 if BigMod(Score(CurrentPlayer), 100) = Match then ' Handles large scores vpmtimer.addtimer 6000, "PlayYouMatched '" Exit for End If Next pDMDEvent(kDMD_PlayerMode2) ' Remove Display if Match = 0 then playUnderMedia "PupVideos", "Match-00.mp4", pUnderVid, 7000 ' playmedia "Match-00.mp4", "PupVideos", pOverVid, "", -1, "", 1, 1 Else playUnderMedia "PupVideos", "Match-"&Match&".mp4", pUnderVid, 7000 ' playmedia "Match-"&Match&".mp4", "PupVideos", pOverVid, "", -1, "", 1, 1 End If PlaySoundVol "Match-Score", VolSfx If bReplayAwarded(CurrentPlayer)=False then ' Lower the replay value if they didnt get it ReplayValue=ReplayValue - INT(DMDStd(kDMDStd_DynReplayStart)*(DMDStd(kDMDStd_ReplayPct)/100)) if ReplayValue < 15000000 then ReplayValue=DMDStd(kDMDStd_DynReplayStart) SaveValue TableName, "ReplayValue", ReplayValue ' SAVE End if ' vpmtimer.addtimer 100, "PlaySoundVol ""Match-Score"", VolSfx '" ' set the machine into game over mode if osbactive <> 0 then ' Orbital takes more time vpmtimer.addtimer 9000, "if bShowMatch then EndOfGame() '" else vpmtimer.addtimer 8000, "if bShowMatch then EndOfGame() '" End If ' you may wish to put a Game Over message on the desktop/backglass Else ' set the next player PlayerState(CurrentPlayer).bFirstBall = False PlayerState(CurrentPlayer).Save CurrentPlayer = NextPlayer UpdateNumberPlayers ' Update the Score Sizes ' make sure the correct display is up to date AddScore 0 ' reset the playfield for the new player (or new ball) bPlayerChanging = True ' Prevent Restore() from double-firing pBGPlayerSelect ResetForNewPlayerBall() PlayerState(CurrentPlayer).Restore bPlayerChanging = False ' Player change complete, safe to fire pBGPlayerSelect normally again ScorbitBuildGameModes() ' AND create a new ball CreateNewBall() ' play a sound if more than 1 player If PlayersPlayingGame > 1 Then PlaySoundVol "say-player" &CurrentPlayer+1, VolDef DMD "", CL(1, "PLAYER " &CurrentPlayer+1), "", eNone, eNone, eNone, 800, True, "" End If End If End Sub ' This function is called at the End of the Game, it should reset all ' Drop targets, AND eject any 'held' balls, start any attract sequences etc.. Sub EndOfGame() debug.print "End Of Game" StopPlayerMode StopPlayerMode2 bGameInPLay = False bShowMatch = False tmrBallSearch.Enabled = False ' ensure that the flippers are down SolLFlipper 0 SolRFlipper 0 LFPress=0 RFPress=0 Scorbit.StopSession Score(0), Score(1), Score(2), Score(3), PlayersPlayingGame InstantInfoTimer.Enabled = False bInstantInfo = False ' Drop the target just in case the ball is behind it (just in Case) OrbTarget1.IsDropped = True vpmtimer.addtimer 1000, "OrbTargetReset'" ' terminate all modes - eject locked balls ' most of the modes/timers terminate at the end of the ball PlayQuote.Enabled = 0 ' just ended your game then play the end of game tune If NOT bJustStarted Then PlaySong "m_end" playmedia "m_end.mp3", MusicDir, pAudio, "", 49405, "", 1, 1 End If bJustStarted = False ' set any lights for the attract mode GiOff bFlash1Enabled = True bFlash2Enabled = True bFlash3Enabled = True bFlash4Enabled = True 'tmrRedLightFlash.Enabled = True HadronFlash "white", True pDMDGameOver ' you may wish to light any Game Over Light you may have End Sub Sub PlayYouMatched PlaySoundVol "YouMatchedPlayAgain", VolDef DOF 140, DOFOn DMDFlush DMD "_", CL(1, "CREDITS: " & Credits), "", eNone, eNone, eNone, 500, True, "" PlaySoundVol "fx_coin", VolTable End Sub Dim DefScoreSize:DefScoreSize=8.5 Dim ScoreTable(4, 18) ' MaxPlayers, MaxDigit (Adjust score size based on number of players and Font) ScoreTable(0,1) =8.5 :ScoreTable(1,1) =8.5 : ScoreTable(2,1) =8.5 : ScoreTable(3,1) =8.5 ScoreTable(0,2) =8.5 :ScoreTable(1,2) =8.5 : ScoreTable(2,2) =8.5 : ScoreTable(3,2) =8.5 ScoreTable(0,3) =8.5 :ScoreTable(1,3) =8.5 : ScoreTable(2,3) =8.5 : ScoreTable(3,3) =8.5 ScoreTable(0,4) =8.5 :ScoreTable(1,4) =8.5 : ScoreTable(2,4) =8.5 : ScoreTable(3,4) =7.5 ScoreTable(0,5) =8.5 :ScoreTable(1,5) =8.5 : ScoreTable(2,5) =8.5 : ScoreTable(3,5) =6.5 ScoreTable(0,6) =8.5 :ScoreTable(1,6) =8.5 : ScoreTable(2,6) =7.5 : ScoreTable(3,6) =5.5 ScoreTable(0,7) =8.5 :ScoreTable(1,7) =8.5 : ScoreTable(2,7) =6.5 : ScoreTable(3,7) =4.5 ScoreTable(0,8) =8.5 :ScoreTable(1,8) =8.5 : ScoreTable(2,8) =5.5 : ScoreTable(3,8) =4.5 ScoreTable(0,9) =8.5 :ScoreTable(1,9) =7.5 : ScoreTable(2,9) =4.5 : ScoreTable(3,9) =3.5 ScoreTable(0,10)=8.5 :ScoreTable(1,10)=7.5 : ScoreTable(2,10)=4.5 : ScoreTable(3,10)=3.5 ScoreTable(0,11)=7.5 :ScoreTable(1,11)=7 : ScoreTable(2,11)=4.5 : ScoreTable(3,11)=3 ScoreTable(0,12)=7.5 :ScoreTable(1,12)=7 : ScoreTable(2,12)=4.5 : ScoreTable(3,12)=3 ScoreTable(0,13)=6.5 :ScoreTable(1,13)=7 : ScoreTable(2,13)=4.5 : ScoreTable(3,13)=3 ScoreTable(0,14)=6.5 :ScoreTable(1,14)=7 : ScoreTable(2,14)=4.5 : ScoreTable(3,14)=3 ScoreTable(0,15)=6.5 :ScoreTable(1,15)=7 : ScoreTable(2,15)=4.5 : ScoreTable(3,15)=3 ScoreTable(0,16)=6.5 :ScoreTable(1,16)=7 : ScoreTable(2,16)=4.5 : ScoreTable(3,16)=3 ScoreTable(0,17)=6.5 :ScoreTable(1,17)=7 : ScoreTable(2,17)=4.5 : ScoreTable(3,17)=3 ScoreTable(0,18)=6.5 :ScoreTable(1,18)=7 : ScoreTable(2,18)=4.5 : ScoreTable(3,18)=3 ' 99,000,000,000,000 Dim ScoreOffset(4) ScoreOffset(0)=0 ScoreOffset(1)=2 ScoreOffset(2)=1 ScoreOffset(3)=.5 Sub UpdateNumberPlayers UpdateNumberPlayers2 True End Sub Sub UpdateNumberPlayers2(bForce) dim text1Size dim text2Size dim text3Size dim text4Size Dim i Dim ScoreTag(3) Dim ScoreHeight(3) Dim ScoreWidth(3) Dim Offset Dim Offset2 Dim saveDefScoreSize if bUsePUPDMD = False then Exit Sub ' just PUP (for now) saveDefScoreSize=DefScoreSize for i = 0 to MaxPlayers-1 if DefScoreSize > ScoreTable(PlayersPlayingGame-1, Max(Len(Score(i) & ""), 17)) then DefScoreSize = ScoreTable(PlayersPlayingGame-1, Max(Len(Score(i) & ""), 17)) End if Next if saveDefScoreSize<>DefScoreSize or bForce then ' Size changed or force for i = 0 to MaxPlayers-1 if i=CurrentPlayer then ScoreSize(i) = DefScoreSize Else ScoreSize(i)=DefScoreSize-ScoreOffset(PlayersPlayingGame-1) End if ScoreTag(i)="{'mt':2,'size':"& ScoreSize(i) &"}" Next Select case PlayersPlayingGame case 1: puPlayer.LabelSet pDMDText,"CurScore",FormatScore(score(0)),1,"{'mt':2,'size': "& ScoreSize(0) & ", 'ypos': 95, 'xpos': 50, 'xalign': 1, 'yalign':1}" puPlayer.LabelSet pDMDText,"Play1score","",0,"" puPlayer.LabelSet pDMDText,"Play2score","",0,"" puPlayer.LabelSet pDMDText,"Play3score","",0,"" puPlayer.LabelSet pDMDText,"Play4score","",0,"" case 2: puPlayer.LabelSet pDMDText,"CurScore","",0,"" puPlayer.LabelSet pDMDText,"Play1score",FormatScore(score(0)),1,"{'mt':2,'size': "&ScoreSize(0)&", 'ypos': 95, 'xpos': 25, 'xalign': 1, 'yalign':1}" puPlayer.LabelSet pDMDText,"Play2score",FormatScore(score(1)),1,"{'mt':2,'size': "&ScoreSize(1)&", 'ypos': 95, 'xpos': 75, 'xalign': 1, 'yalign':1}" puPlayer.LabelSet pDMDText,"Play3score","",0,"" puPlayer.LabelSet pDMDText,"Play4score","",0,"" case 3: puPlayer.LabelSet pDMDText,"CurScore","",0,"" puPlayer.LabelSet pDMDText,"Play1score",FormatScore(score(0)),1,"{'mt':2,'size': "&ScoreSize(0)&", 'ypos': 95, 'xpos': 16.5, 'xalign': 1, 'yalign':1}" puPlayer.LabelSet pDMDText,"Play2score",FormatScore(score(1)),1,"{'mt':2,'size': "&ScoreSize(1)&", 'ypos': 95, 'xpos': 50, 'xalign': 1, 'yalign':1}" puPlayer.LabelSet pDMDText,"Play3score",FormatScore(score(2)),1,"{'mt':2,'size': "&ScoreSize(2)&", 'ypos': 95, 'xpos': 82.5, 'xalign': 1, 'yalign':1}" puPlayer.LabelSet pDMDText,"Play4score","",0,"" case 4: puPlayer.LabelSet pDMDText,"CurScore","",0,"" puPlayer.LabelSet pDMDText,"Play1score",FormatScore(score(0)),1,"{'mt':2,'size': "&ScoreSize(0)&", 'ypos': 95, 'xpos': 12.5, 'xalign': 1, 'yalign':1}" puPlayer.LabelSet pDMDText,"Play2score",FormatScore(score(1)),1,"{'mt':2,'size': "&ScoreSize(1)&", 'ypos': 95, 'xpos': 37.5, 'xalign': 1, 'yalign':1}" puPlayer.LabelSet pDMDText,"Play3score",FormatScore(score(2)),1,"{'mt':2,'size': "&ScoreSize(2)&", 'ypos': 95, 'xpos': 62.5, 'xalign': 1, 'yalign':1}" puPlayer.LabelSet pDMDText,"Play4score",FormatScore(score(3)),1,"{'mt':2,'size': "&ScoreSize(3)&", 'ypos': 95, 'xpos': 87.5, 'xalign': 1, 'yalign':1}" End Select End if End sub Function Balls Dim tmp tmp = BallsPerGame - BallsRemaining(CurrentPlayer) + 1 If tmp > BallsPerGame Then Balls = BallsPerGame Else Balls = tmp End If End Function Sub DoBallSave() if bGrootMultiball or bOrbMultiBall or tmrXandar.Enabled or tmrImmolation.Enabled or tmrCherryBomb.Enabled then exit sub ' Dont play the clip during wizard modes since it shows up 1000 times if bUseUltraDMD then PlayDMDScene "vidBallSave.wmv", 4000 Else playUnderMedia "PupVideos", "Video-0x000C.mp4", pUnderVid, 3402 ' FIX14: Debounce pDMDEvent(kDMD_BallSave) - fires on screen 13 immediately after ' playUnderMedia on screen 15, causing concurrent VLC access crash bPupEventBusy = True dScreen13LastActivity = Timer() vpmtimer.addtimer 4500, "bPupEventBusy = False '" vpmtimer.addtimer 4500, "dScreen13LastActivity = 0 '" vpmtimer.addtimer 200, "pDMDEvent(kDMD_BallSave) '" End If DMD "_", CL(1, "BALL SAVED"), "_", eNone, eBlinkfast, eNone, 800, True, "" End Sub ' ********************************************************************* ' Drain / Plunger Functions ' ********************************************************************* ' lost a ball ;-( check to see how many balls are on the playfield. ' if only one then decrement the remaining count AND test for End of game ' if more than 1 ball (multi-ball) then kill of the ball but don't create ' a new one ' Sub DrainDummy_Hit() ' Call this to short cycle outlane drains debug.print "DrainDummy_Hit:" & BallsOutlaneDrainCnt BallsOutlaneDrainCnt=BallsOutlaneDrainCnt+1 BallsOutlaneDrainIgnoreCnt=BallsOutlaneDrainIgnoreCnt+1 Drain_Hit() End Sub Sub Drain_Hit() dim bShortCycle:bShortCycle=False Dim tmpBallSaver Dim queueTime debug.print "Drain_Hit:" & BallsOutlaneDrainCnt if (LightShootAgain.state = 2 or LightShootAgain2.state =2) and bBallSaverActive=False then ' Msgbox "ERROR BALL SAVE" debug.print "ERROR Ball SAVE" End If ' Handle Outlane BallSave Insert tmpBallSaver=BallSaverActiveBuffer <> 0 if BallSaverActiveBuffer>0 then BallSaverActiveBuffer = BallSaverActiveBuffer-1 if BallsOutlaneDrainCnt>0 and bGameInPLay then ' Fake event triggered by DrainDummy_Hit to pretend a ball drained and run normal process BallsOutlaneDrainCnt=BallsOutlaneDrainCnt-1 bShortCycle=True Else ' Destroy the ball Drain.DestroyBall BallsOnPlayfield = BallsOnPlayfield - 1 if BallsOutlaneDrainIgnoreCnt>0 then BallsOutlaneDrainIgnoreCnt=BallsOutlaneDrainIgnoreCnt-1 if BallsOnPlayfield-RealBallsInLock=1 then bMultiBallMode=False Exit Sub End if End if ' pretend to knock the ball into the ball storage mech PlaySoundAt "fx_drain",Drain 'if Tilted the end Ball modes If Tilted and bGameInPlay Then ' Dont call this over and over when table is disabled for Cherry Bomb End BallSaverTimerCancel ' End Modes and timers if tmrCherryBomb.Enabled Then EndCherryBomb else EndGrootMB(False) EndXandar EndQuillMB EndImmolation(0) StopPlayerMode StopPlayerMode2 if (bOrbMultiBall) then ' Reset Orb Stuff StopOrbMultiball end if ' if bImmolationWait then ' They drained all balls but completed immolation. (Verified video) ' bImmolationWait=False ' exit sub ' We finished immolation ' End if 'PauseSong if PlayerMode <> -1 then pausemedia pDMDFull pausemedia pMusic playmedia "m_wait.mp3", MusicDir, pAudio, "", -1, "", 1, 1 End If StopEndOfBallModes bMultiBallMode = False WaitPlayerMode RefreshPlayerMode End if End If ' if there is a game in progress AND it is not Tilted If(bGameInPLay = True)AND(Tilted = False)Then ' is the ball saver active If bBallSaverActive or tmpBallSaver or mBalls2Eject<>0 Then ' Need to account for ballsaves that are in the queue ' yep, create a new ball in the shooters lane ' we use the Addmultiball in case the multiballs are being ejected DOF 134, DOFPulse ' James DOF debug.print "Ball Save multiball" if bShortCycle then AddMultiballFast 1 Else AddMultiball 1 End if ' we kick the ball with the autoplunger bAutoPlunger = True ' you may wish to put something on a display or play a sound at this point DoBallSave Else Debug.print "Drain " & BallsOnPlayfield & " " & RealBallsInLock & " " & bMultiBallMode if EndGrootMB(True) then exit sub ' See if we need to throw more balls back into play ' cancel any multiball if on last ball (ie. lost all other balls) If(BallsOnPlayfield-RealBallsInLock = 1)Then ' AND in a multi-ball?? If(bMultiBallMode = True)then ' not in multiball mode any more bMultiBallMode = False ChangeGi "white" ' turn off any multiball specific lights 'ResetJackpotLights EndGrootMB(False) EndQuillMB EndImmolation(1) EndXandar End If End If If(BallsOnPlayfield-RealBallsInLock <= 1)Then ' Stop Orb Multiball if (bOrbMultiBall) then ' Reset Orb Stuff bMultiBallMode = False ' Release last locked ball. Stop Multiball StopOrbMultiball end if End If tmrPauseTimers.Enabled = False ' Clear Pause Timers ' was that the last ball on the playfield If(BallsOnPlayfield - RealBallsInLock = 0)Then ' End Modes and timers EndGrootMB(False) 'EndImmolation(0) StopPlayerMode2 ' if bImmolationWait then ' They drained all balls but completed immolation. (Verified video) ' bImmolationWait=False ' exit sub ' We finished immolation ' End if 'PauseSong if PlayerMode <> -1 then pausemedia pDMDFull pausemedia pMusic debug.print "Start m_wait-1" 'PlaySoundLoopVol "m_wait", VolMusic playmedia "m_wait.mp3", MusicDir, pAudio, "", -1, "", 1, 1 End If StopEndOfBallModes ChangeGi "white" queueTime = getQueueTime ' See if we need to let animations finish playing if queueTime = 0 then queueTime = 1500 ' handle the end of ball (count bonus, change player, high score entry etc..) vpmtimer.addtimer queueTime, "EndOfBall '" End If End If End If End Sub Sub AutoPlungeDelayed() 'debug.print "autofire the ball" PlungerIM.AutoFire DOF 121, DOFPulse 'autoplunger DOF 112, DOFPulse 'strobe bAutoPlunger = False bAutoPlunged = True End Sub ' The Ball has rolled out of the Plunger Lane and it is pressing down the trigger in the shooters lane ' Check to see if a ball saver mechanism is needed and if so fire it up. Sub swPlungerRest_Hit() debug.print "ball in plunger lane " & bPlayerModeSelect & " " & bAutoPlunger & " " & bCreatedBall & " " & PlayerMode ' some sound according to the ball position PlaySoundAt "fx_sensor", swPlungerRest bBallInPlungerLane = True ' turn on Launch light is there is one 'LaunchLight.State = 2 ' kick the ball in play if the bAutoPlunger flag is on if bCreatedBall = False then ' If we didnt create a ball this must have gone up and back so kick it out automatically bAutoPlunger = True End if bCreatedBall = False If bAutoPlunger Then debug.print "autofire the ball" PlungerIM.AutoFire DOF 125, DOFPulse DOF 112, DOFPulse bAutoPlunger = False bAutoPlunged = True bBallInPlungerLane = False ' Dont set the ball in plungerlane during autofire Else ScorbitClaimQR(True) End If if (bPlayerModeSelect) Then if ModePercent(LastPlayerMode)>=100 then SelectPlayerMode LeftFlipperKey ' Force them to select a new mode Else 'Debug.print "tmrCherryBomb.Enabled:" & tmrCherryBomb.Enabled & " " & PlayerMode PlayerMode=LastPlayerMode UpdatePlayerMode() End if 'Debug.print "PlayerMode:"& PlayerMode ' if PlayerMode = -1 then SelectPlayerMode LeftFlipperKey ' UpdatePlayerMode() 'PauseSong if PlayerState(CurrentPlayer).bFirstBall then debug.print "Start m_wait-2" 'PlaySoundLoopVol "m_wait", VolDef ' Guard: prevent double-fire on audio screen 14 causing VLC invalid pointer crash if Not bAudioScreen14Busy then bAudioScreen14Busy = True vpmtimer.addtimer 1500, "bAudioScreen14Busy = False '" playmedia "m_wait3.mp3", MusicDir, pAudio, "", -1, "", 1, 1 End If End If End If ' remember last trigger hit by the ball. SwitchHit "swPlungerRest" End Sub ' The ball is released from the plunger turn off some flags and check for skillshot Sub swPlungerRest_UnHit() ResetBallSearch bBallInPlungerLane = False DOF 125, DOFPulse ' James DOF 'if (bPlayerModeSelect) then pBGGamePlay ' Change the backglass to the play mode ' Need to do this before the check model below because it will set the gate based on the mode 'MsgBox LeftFlipper.CurrentAngle & " - " & LeftFlipper.EndAngle if (bAutoPlunged = False) then ' Only start the skillshot if it is a manual plunge if LeftFlipper.CurrentAngle = LeftFlipper.EndAngle and bWizardMode = False Then ' No skill shot on Wizard Modes LoopGateLeft.Open = True ' If they hold down the left flipper we open the back gate bSkillshotsReady(2) = True ' Enable the third skillshot StackState(kStack_Pri3).Enable(-1) 'msgbox randomNum SuperSkillShotIndex = INT(3 * RND) Select Case SuperSkillShotIndex case 0 SSetLightColor kStack_Pri3, lBrokerArrow, "white", 2 case 1 SSetLightColor kStack_Pri3, lGamoraArrow, "white", 2 case 2 SSetLightColor kStack_Pri3, lDraxArrow, "white", 2 End Select End If tmrPauseTimers.Enabled=False ' Unpause the timers on a new ball tmrSkillshot.Enabled = True PlaySoundVol "sfx_Launch1", VolSfx ScorbitClaimQR(False) End If bAutoPlunged = False if (bXandarReady) then ' There are no modes to start PlayerMode = -1 End if ' Check Mode if (bPlayerModeSelect) Then DOF 300, DOFOff ' James DOF DOF 301, DOFOff DOF 302, DOFOff DOF 303, DOFOff DOF 304, DOFOff DOF 305, DOFOff DOF 306, DOFOff DOF 307, DOFOff DOF 308, DOFOff pBGGamePlay ' Change the backglass to the play mode aLightsSave ' Always start the skillshot StartPlayerMode() ' Start the mode and clear bPlayerModeSelect RotateSong() elseif PlayerMode <> -1 then ' If a mode is selected we should start the timer back Update ModeCountdownTimer.enabled = True ' If we are paused resume media if bUsePupDMD then playclear pUnderVid ' PuPlayer.PlayStop pUnderVid ' PuPlayer.SetLoop pUnderVid, 0 End If RefreshPlayerMode 'StopSound "m_wait" playclear pAudio resumemedia pDMDFull resumemedia pMusic End If ' if there is a need for a ball saver, then start off a timer ' only start if it is ready, and it is currently not running, else it will reset the time period debug.print "Ballsaver Ready:" & bBallSaverReady & " T:" & BallSaverTime & " Active:" & bBallSaverActive If(bBallSaverReady = True)AND(BallSaverTime <> 0)And(bBallSaverActive = False)Then EnableBallSaver BallSaverTime End If if PlayerMode=kModeRonan and bSkillshotsReady(2)=False then ' Sanctuary closes the gates on ball launch LoopGateLeft.Open = False Gate002.Open = False End if if tmrCherryBomb.Enabled then ' I think it has a countdown from rocket for each one also PlaySoundVol "gg_CBLaunch", VolSfx End if If NOT bMultiballMode Then PlaySong "" End If ' turn off LaunchLight 'LaunchLight.State = 0 End Sub Sub tmrSkillshot_Timer() if tmrSkillshot.Enabled then aHadronLightsRestore bSkillshotsReady(0) = False ' First Inlane bSkillshotsReady(1) = False ' First Inlane without touching flippers bSkillshotsReady(2) = False ' Hold Left, Loop around and hit Orb, Right Ramp or Right Orbit StackState(kStack_Pri3).Disable Select Case SuperSkillShotIndex ' Turn it off case 0 SetLightColorRestore lBrokerArrow, -1 case 1 SetLightColorRestore lGamoraArrow, -1 case 2 SetLightColorRestore lDraxArrow, -1 End Select lNova_sw8.BlinkInterval=BlinkIntDef lNova_sw9.BlinkInterval=BlinkIntDef if PlayerMode = 5 then ' Set the state based on progress SetLightColor lNova_sw8, "orange", PlayerState(CurrentPlayer).lNovaStatesKyln(3) SetLightColor lNova_sw9, "orange", PlayerState(CurrentPlayer).lNovaStatesKyln(4) Else 'debug.print "SW Off" SetLightColor lNova_sw8, "orange", PlayerState(CurrentPlayer).lNovaStates(3) SetLightColor lNova_sw9, "orange", PlayerState(CurrentPlayer).lNovaStates(4) End If if PlayerMode<>kModeRonan then LoopGateLeft.Open = False tmrSkillshot.Enabled = False End if End if End Sub Sub EnableBallSaver(seconds) if bBallSaverActive then exit sub ' Dont clear Active ball save EnableBallSaverForce(Seconds) End Sub Sub EnableBallSaverForce(seconds) debug.print "Ballsaver started " & seconds bBallSaverActive = True bBallSaverReady = False ' start the timer BallSaverTimerExpired.Enabled = False BallSaverTimerExpired.Interval = 10 BallSaverTimerExpired.UserValue = 1000 * (seconds+2) ' 2 second grace period BallSaverTimerExpired.Enabled = True ' if you have a ball saver light you might want to turn it on at this point (or make it flash) LightShootAgain.BlinkInterval = 160 LightShootAgain.State = 2 LightShootAgain2.BlinkInterval = 160 LightShootAgain2.State = 2 PauseTimers(-1) ' Go ahead and do 1 extend End Sub ' The ball saver timer has expired. Turn it off AND reset the game flag ' Sub BallSaverTimerExpired_Timer() if tmrPauseTimers.Enabled then exit sub ' Dont change timer BallSaverTimerExpired.UserValue = BallSaverTimerExpired.UserValue - BallSaverTimerExpired.Interval ' Drop 500 msec if BallSaverTimerExpired.UserValue <= 0 then ' Stop BallSaver 'debug.print "Ballsaver ended" BallSaverTimerExpired.Enabled = False bBallSaverActive = False if ExtraBallsAwards(CurrentPlayer)<>0 then LightShootAgain.State = 1 ' They have extra ball, go solid LightShootAgain2.State = 1 ' They have extra ball, go solid else LightShootAgain.State = 0 ' Make sure the light is off LightShootAgain2.State = 0 ' Make sure the light is off End if BallSaverTime = DMDStd(kDMDStd_BallSave) elseif BallSaverTimerExpired.UserValue < 2000 then ' Just turn off the light but we still have 2 seconds left if ExtraBallsAwards(CurrentPlayer)<>0 then LightShootAgain.State = 1 ' They have extra ball, go solid LightShootAgain2.State = 1 ' They have extra ball, go solid else LightShootAgain.State = 0 ' Make sure the light is off LightShootAgain2.State = 0 ' They have extra ball, go solid End if elseif BallSaverTimerExpired.UserValue < 4000 and LightShootAgain.BlinkInterval <> 80 then 'debug.print "BallSaver Speedup" LightShootAgain.BlinkInterval = 80 LightShootAgain.State = 2 LightShootAgain2.BlinkInterval = 80 LightShootAgain2.State = 2 End If End Sub Sub BallSaverTimerCancel() debug.print "Ballsaver Cancel" BallSaverTimerExpired.Enabled = False bBallSaverActive = False ' if you have a ball saver light then turn it off at this point If(ExtraBallsAwards(CurrentPlayer) = 0)Then LightShootAgain.State = 0 LightShootAgain2.State = 0 Else LightShootAgain.State = 1 LightShootAgain2.State = 1 End if BallSaverTime = defBallSaverTime BallSaverTimerExpired.UserValue=0 End Sub 'Sub BallSaverSpeedUpTimer_Timer() ' debug.print "Ballsaver Speed Up Light" ' BallSaverSpeedUpTimer.Enabled = False ' ' Speed up the blinking ' LightShootAgain.BlinkInterval = 80 ' LightShootAgain.State = 2 ' LightShootAgain2.BlinkInterval = 80 ' LightShootAgain2.State = 2 'End Sub Sub PauseTimers(mSec) If (tmrPauseTimers.Enabled=False or tmrPauseTimers.UserValue<=10) and bMultiBallMode=False then ' Allow to overlap by 100msec PauseTimersForce mSec End if End Sub Sub PauseTimersForce(mSec) dim PauseTime tmrPauseTimers.Enabled=False if mSec=-1 then PauseTime=DMDStd(kDMDStd_BallSaveExtend) Else PauseTime=mSec End if tmrPauseTimers.Interval=10 tmrPauseTimers.UserValue=PauseTime/tmrPauseTimers.Interval tmrPauseTimers.Enabled = True 'debug.print "PauseTimers: " & tmrPauseTimers.UserValue & " " & Now End Sub Sub tmrPauseTimers_Timer() tmrPauseTimers.UserValue=tmrPauseTimers.UserValue-1 'debug.print "PauseTimers: " & tmrPauseTimers.UserValue & " " & Now if tmrPauseTimers.UserValue<=0 then 'debug.print "UNPAUSE Timers: " tmrPauseTimers.Enabled = False tmrPauseTimers.UserValue=0 End if End Sub Dim bSetBackglassTimer_Hide:bSetBackglassTimer_Hide=False Sub SetBackglassTimer(value) if bUsePUPDMD then if bSetBackglassTimer_Hide=False then PuPlayer.LabelSet pDMDText,"Time", value ,1,"{'mt':2,'xpos':8.4}" End if else dim ones dim tens dim hund dim thou ones = value Mod 10 tens = (value Mod 100) \ 10 hund = (value Mod 1000) \ 100 thou = (value Mod 10000) \ 1000 if b2son then Controller.B2SSetReel 1, thou Controller.B2SSetReel 2, hund Controller.B2SSetReel 3, tens Controller.B2SSetReel 4, ones End If End If End Sub dim ModeCountdownTimerGrace:ModeCountdownTimerGrace=2 Sub ModeCountdownTimer_Timer() if ModeCountdownTimer.UserValue >0 then ModeCountdownTimer.UserValue = ModeCountdownTimer.UserValue -1 SetBackglassTimer(ModeCountdownTimer.UserValue) 'Debug.print ModeCountdownTimer.UserValue & " " & ModeCountdownTimerGrace 'DMDScore ' This wont do anything unless the score changes (I thought I would increment the score by 1 point every second but looks weird) if (ModeCountdownTimer.UserValue = 20) Then PlaySoundVol "YourTimeIsRunningOut" & INT(RND*2) +1, VolDef End If if ModeCountdownTimer.UserValue > 0 and ModeCountdownTimer.UserValue <= 5 then PlaySoundVol "gg_Guitar-4", VolSfx End If if ModeCountdownTimer.UserValue = 1 then ModeCountdownTimerGrace=3 ' setup 2 second grace period if (ModeCountdownTimer.UserValue <= 0) Then ModeCountdownTimerGrace=ModeCountdownTimerGrace - 1 if ModeCountdownTimerGrace <= 0 then 'Debug.print "END" PlaySoundVol "YourTimeIsUp" & INT(RND*2) +1, VolDef StopPlayerMode() End If End If End Sub ' ********************************************************************* ' Supporting Score Functions ' ********************************************************************* ' Add points to the score AND update the score board ' Sub AddScore(points) dim multiplierVal ResetBallSearch If(Tilted = False)Then multiplierVal = Multiplier3x * MultiplierShot * PlayMultiplier debug.print "Add Score: " & points & " x" & multiplierVal ModePoints = ModePoints + points * multiplierVal if bWizardMode then WizardModePoints = WizardModePoints + points * multiplierVal ' add the points to the current players score variable Score(CurrentPlayer) = Score(CurrentPlayer) + points * multiplierVal 'only for this table if (multiplierVal > 1) then ' Popup the bonus puPlayer.LabelSet pDMDText,"MPx","x" & multiplierVal ,1,"" tmrMultiplierVal.Interval=1500 if tmrMultiplierVal.Enabled then ' Just Extend it tmrMultiplierVal.Enabled = False tmrMultiplierVal.Enabled = True else tmrMultiplierVal.Enabled = True End if End If if Multiplier3x <> 1 then Multiplier3x = 1 ' 3x only last for next score SetLightColor lDrax_m, "green", lDrax_m.UserValue SetLightColor lGamora_m, "green", lGamora_m.UserValue SetLightColor lYando_m, "green", lYando_m.UserValue SetLightColor lRocket_m, "green", lRocket_m.UserValue SetLightColor lgr_m, "green", lgr_m.UserValue SetLightColor lNebula_m, "green", lNebula_m.UserValue SetLightColor lBroker_m, "green", lBroker_m.UserValue SetLightColor lStarLord_m, "green", lStarLord_m.UserValue SetLightColor lRonan_m, "green", lRonan_m.UserValue End If if Score(CurrentPlayer) > ReplayValue then ' TBD Use DMD Settings AwardReplay End if Scorbit.SendUpdate Score(0), Score(1), Score(2), Score(3), Balls, CurrentPlayer+1, PlayersPlayingGame ' update the score displays UpdateNumberPlayers2 False DMDScore End if ' you may wish to check to see if the player has gotten a replay End Sub Sub tmrMultiplierVal_Timer() ' Clears the Multiplier value after a while ' Guard: wait for shot mult animation to finish before clearing to avoid pDMDText collision if tmrShotMultAnim.Enabled then vpmtimer.AddTimer 500, "puPlayer.LabelSet pDMDText,""MPx"", """" ,1,"""" '" Else vpmtimer.AddTimer 1500, "puPlayer.LabelSet pDMDText,""MPx"", """" ,1,"""" '" End If End Sub ' Add bonus to the bonuspoints AND update the score board Sub AddBonus(points) If(Tilted = False)Then ' add the bonus to the current players bonus variable BonusPoints(CurrentPlayer) = BonusPoints(CurrentPlayer) + points if BonusPoints(CurrentPlayer) <= 0 then BonusPoints(CurrentPlayer) = 1 ' update the score displays DMDScore End if ' you may wish to check to see if the player has gotten a replay End Sub ' Add some points to the current Jackpot. ' Sub AddJackpot(points) 'not used in this table ' Jackpots only generally increment in multiball mode AND not tilted ' but this doesn't have to be the case 'If(Tilted = False)Then ' If(bMultiBallMode = True) Then ' Jackpot = Jackpot + points ' you may wish to limit the jackpot to a upper limit, ie.. ' If (Jackpot >= 6000) Then ' Jackpot = 6000 ' End if 'End if 'End if End Sub Sub AddSuperJackpot(points) If(Tilted = False)Then ' If(bMultiBallMode = True) Then SuperJackpot = SuperJackpot + points ' you may wish to limit the jackpot to a upper limit, ie.. ' If (Jackpot >= 6000) Then ' Jackpot = 6000 ' End if 'End if End if End Sub Sub AddPlayMultiplier(n) PlayMultiplier = PlayMultiplier * n if PlayMultiplier < 1 then PlayMultiplier = 1 ' Dont go less than 0 End Sub Sub AddBonusMultiplier(n) ' if not at the maximum bonus level if(BonusMultiplier + n < MaxMultiplier)then SetBonusMultiplier(BonusMultiplier + n) if bUsePUPDMD then ' Guard: defer if shot mult animation is running to avoid pDMDText collision causing VLC crash if tmrShotMultAnim.Enabled then vpmtimer.addtimer 900, "if BonusMultiplier>1 then pupDMDDisplay ""-"", ""BONUS|13535251^"" & BonusMultiplier & ""X|827358^Multiplier|13535251"", """" ,1, 0, 10 '" Else pupDMDDisplay "-", "BONUS|13535251^" & BonusMultiplier & "X|827358^Multiplier|13535251", "" ,1, 0, 10 End If Else DisplayDMDText2 "BONUS MULTIPLIER",BonusMultiplier & "x", 1000, 11, 0 End if End if End Sub ' Set the Bonus Multiplier to the specified level AND set any lights accordingly ' There is no bonus multiplier lights in this table Sub SetBonusMultiplier(Level) ' Set the multiplier to the specified level BonusMultiplier = Level End Sub ' Replay Notes: Found this link that explained replays pretty well (https://sternpinball.com/wp-content/uploads/2018/11/Pirates_of_the_Caribbean_Manual.pdf) ' 'ReplayType: Set to AUTO, NONE, FIXED or DYNAMIC. Factory Default = AUTO. '- AUTO & DYNAMIC are based on the Replay Percentage. '- Select FIXED to give the player a Replay Award as the Replay Levels are reached '-- The Replay Level(s) will not adjust up or down '- Select AUTO to give the player a Replay Award as the Auto Replay Start score level is reached '-- This score threshold will automatically adjust up or down based on the Replay Percentage chosen. '-- The game periodically (every 50 games?) adjust based upon the Player Base Skill LEvel '- Select DYNAMIC to give the player a Replay Award as the Dynamic Replay Start score level is reached. '-- This score threshold will go down every game based on the Replay Percentage selected '- Select NONE to turn off Standard Adjustments ' 'Replay Percentage: Set between 1% to 50%. Factory Default = 10%. '- Adjustable only if AUTO or DYNAMIC is installed in Replay Type. '- For [DYNAMIC] example, if the score threshold is 50,000,000 and the Replay Percentage selected is 10%, ' every game a player does not reach the score threshold, the score to reach will drop by 5,000,000 (10% of 50M). ' This will continue every game until the threshold score is reached. Thus, if the score then drops to 15,000,000 ' after 7 games and is then achieved, the Replay Award is given. The original score threshold is added to 15,000,000 ' and is now 65,000,000. It will then take the same player 10 games to reach 15,000,000. It will then take the same ' player 10 games to reach 15,000,000. This adjustment is shown only if AUTO or DYNAMIC is installed in Replay Type Sub AwardReplay() if bReplayAwarded(CurrentPlayer)=False then ' Increment Replay value ReplayValue=DMDStd(kDMDStd_DynReplayStart) + ReplayValue SaveValue TableName, "ReplayValue", ReplayValue ' SAVE bReplayAwarded(CurrentPlayer)=True QueueScene "PlayReplayScene '", 5000, 1 DMD "_", CL(1, ("REPLAY")), "_", eNone, eBlink, eNone, 1000, True, SoundFXDOF("fx_Knocker", 122, DOFPulse, DOFKnocker) End if End Sub Sub PlayReplayScene() If NOT bPupStarted Then Exit Sub ' FIX 2.1.2: guard against PUP teardown playmedia "Video-Replay.mp4", "PupVideos", pOverVid , "", -1, "", 1, 1 End Sub Sub PlayE() Debug.print "Playing E" pCurAttractPos=98 pAttractNext End Sub Sub AwardExtraBall() QueueScene "PlayExtraBallScene '", 5000, 1 DMD "_", CL(1, ("EXTRA BALL WON")), "_", eNone, eBlink, eNone, 1000, True, SoundFXDOF("fx_Knocker", 122, DOFPulse, DOFKnocker) ExtraBallsAwards(CurrentPlayer) = ExtraBallsAwards(CurrentPlayer) + 1 bExtraBallWonThisBall = True GiEffect 1 LightEffect 2 ' bLeftScoopSkip=False ' QueueScene2 "if bLeftScoopSkip=False then FlipperSkipCmd="""":LeftScoop_Hit '", 0, 1, True ' SetFlipperSkipCmd "bLeftScoopSkip=True:LeftScoop_Hit '" ' DONT FORGET TO CLEAR FlipperSkipCmd when you are past this stage If BallSaverTimerExpired.Enabled=False Then ' If Ball Saver isnt running light Extra Ball Indicators LightShootAgain.State = 1 LightShootAgain2.State = 1 End if LeftScoop_Hit End Sub Sub PlayExtraBallScene() If NOT bPupStarted Then Exit Sub ' FIX 2.1.2: guard against PUP teardown VpmTimer.AddTimer 4300, "PlaySoundVol ""vo_ExtraBall1"", VolDef '" PlaySoundVol "sfx_ExtraBall", VolSfx playmedia "Video-0x0040.mp4", "PupVideos", pOverVid , "", -1, "", 1, 1 End Sub Sub ExtraBallLit() If NOT bPupStarted Then Exit Sub ' FIX 2.1.2: guard against PUP teardown PlaySoundVol "sfx_ExtraBallLit", VolSfx playUnderMedia "PupVideos", "Video-0x0026a.mp4", pUnderVid, 5000 'QueueScene "playmedia ""Video-0x0026a.mp4"", ""PupVideos"", pOverVid , """", -1, """", 1, 1 '", 5000, 1 DMD "_", CL(1, ("EXTRA BALL WON")), "_", eNone, eBlink, eNone, 1000, True, SoundFXDOF("fx_Knocker", 122, DOFPulse, DOFKnocker) End Sub Sub AwardSpecial() ' TBD: Make work for GOTG Specials DMD "_", CL(1, ("EXTRA GAME WON")), "_", eNone, eBlink, eNone, 1000, True, "" PlaySoundAt SoundFXDOF("fx_Knocker", 122, DOFPulse, DOFKnocker), VUK Credits = Credits + 1 DOF 140, DOFOn GiEffect 1 LightEffect 1 End Sub 'Sub Congratulation() ' Dim tmp ' tmp = "vo_congrat" & INT(RND * 21 + 1) ' PlaySoundVol tmp, VolDef 'End Sub '***************************** ' Load / Save / Highscore '***************************** Sub Loadhs ' Load Orbital scores GetScores Dim x x = LoadValue(TableName, "HighScore1") If(x <> "")Then HighScore(0) = CDbl(x)Else HighScore(0) = 75000000 End If x = LoadValue(TableName, "HighScore1Name") If(x <> "")Then HighScoreName(0) = x Else HighScoreName(0) = "MPT" End If x = LoadValue(TableName, "HighScore2") If(x <> "")then HighScore(1) = CDbl(x)Else HighScore(1) = 55000000 End If x = LoadValue(TableName, "HighScore2Name") If(x <> "")then HighScoreName(1) = x Else HighScoreName(1) = "DAP" End If x = LoadValue(TableName, "HighScore3") If(x <> "")then HighScore(2) = CDbl(x)Else HighScore(2) = 40000000 End If x = LoadValue(TableName, "HighScore3Name") If(x <> "")then HighScoreName(2) = x Else HighScoreName(2) = "HMR" End If x = LoadValue(TableName, "HighScore4") If(x <> "")then HighScore(3) = CDbl(x)Else HighScore(3) = 30000000 End If x = LoadValue(TableName, "HighScore4Name") If(x <> "")then HighScoreName(3) = x Else HighScoreName(3) = "MRH" End If x = LoadValue(TableName, "HighScore5") If(x <> "")then HighScore(4) = CDbl(x)Else HighScore(4) = 25000000 End If x = LoadValue(TableName, "HighScore5Name") If(x <> "")then HighScoreName(4) = x Else HighScoreName(4) = "DPF" End If x = LoadValue(TableName, "Credits") If(x <> "")then Credits = CInt(x)Else Credits = 0 End If x = LoadValue(TableName, "HighScoreCombo") If(x <> "")then HighScoreAwards(0) = CDbl(x)Else HighScoreAwards(0) = 15 End If x = LoadValue(TableName, "HighScoreComboName") If(x <> "")then HighScoreAwardsName(0) = x Else HighScoreAwardsName(0) = "VPW" End If x = LoadValue(TableName, "HighScoreCB") If(x <> "")then HighScoreAwards(1) = CDbl(x)Else HighScoreAwards(1) = 25000000 End If x = LoadValue(TableName, "HighScoreCBName") If(x <> "")then HighScoreAwardsName(1) = x Else HighScoreAwardsName(1) = "GCC" End If x = LoadValue(TableName, "HighScoreIMMO") If(x <> "")then HighScoreAwards(2) = CDbl(x)Else HighScoreAwards(2) = 25000000 End If x = LoadValue(TableName, "HighScoreIMMOName") If(x <> "")then HighScoreAwardsName(2) = x Else HighScoreAwardsName(2) = "FGW" End If x = LoadValue(TableName, "HighScoreXandar") If(x <> "")then HighScoreAwards(3) = CDbl(x)Else HighScoreAwards(3) = 25000000 End If x = LoadValue(TableName, "HighScoreXandarName") If(x <> "")then HighScoreAwardsName(3) = x Else HighScoreAwardsName(3) = "EJL" End If 'x = LoadValue(TableName, "Jackpot") 'If(x <> "") then Jackpot = CDbl(x) Else Jackpot = 200000 End If x = LoadValue(TableName, "TotalGamesPlayed") If(x <> "")then TotalGamesPlayed = CInt(x)Else TotalGamesPlayed = 0 End If End Sub ' x = LoadValue(TableName, "DMDStd_"&kDMDStd_Initials): If(x <> "") Then DMDStd(kDMDStd_Initials)=x ' x = LoadValue(TableName, "DMDStd_"&kDMDStd_ExtraBallLimit): If(x <> "") Then DMDStd(kDMDStd_ExtraBallLimit)=INT(x) ' x = LoadValue(TableName, "DMDStd_"&kDMDStd_ExtraBallPCT): If(x <> "") Then DMDStd(kDMDStd_ExtraBallPCT)=INT(x) ' x = LoadValue(TableName, "DMDStd_"&kDMDStd_TiltWarn): If(x <> "") Then DMDStd(kDMDStd_TiltWarn)=INT(x) ' x = LoadValue(TableName, "DMDStd_"&kDMDStd_TiltDebounce): If(x <> "") Then DMDStd(kDMDStd_TiltDebounce)=INT(x) ' x = LoadValue(TableName, "DMDStd_"&kDMDStd_MatchPCT): If(x <> "") Then DMDStd(kDMDStd_MatchPCT)=INT(x) ' x = LoadValue(TableName, "DMDStd_"&kDMDStd_LeftStartReset): If(x <> "") Then DMDStd(kDMDStd_LeftStartReset)=x ' x = LoadValue(TableName, "DMDStd_"&kDMDStd_BallSave): If(x <> "") Then DMDStd(kDMDStd_BallSave)=INT(x) ' x = LoadValue(TableName, "DMDStd_"&kDMDStd_DynReplayStart): If(x <> "") Then DMDStd(kDMDStd_DynReplayStart)=INT(x) ' x = LoadValue(TableName, "DMDStd_"&kDMDStd_BallSaveExtend): If(x <> "") Then DMDStd(kDMDStd_BallSaveExtend)=INT(x) ' x = LoadValue(TableName, "DMDStd_"&kDMDStd_FreePlay): If(x <> "") Then DMDStd(kDMDStd_FreePlay)=x ' ' x = LoadValue(TableName, "DMDFet_"&kDMDFet_RightScoopePower): If(x <> "") Then DMDFet(kDMDFet_RightScoopePower)=INT(x) ' x = LoadValue(TableName, "DMDFet_"&kDMDFet_RampageSpellout): If(x <> "") Then DMDFet(kDMDFet_RampageSpellout)=INT(x) ' x = LoadValue(TableName, "DMDFet_"&kDMDFeT_GuardiansSpellout): If(x <> "") Then DMDFet(kDMDFeT_GuardiansSpellout)=INT(x) ' x = LoadValue(TableName, "DMDFet_"&kDMDFet_HadronAwards): If(x <> "") Then DMDFet(kDMDFet_HadronAwards)=INT(x) ' x = LoadValue(TableName, "DMDFet_"&kDMDFet_HadronLimit): If(x <> "") Then DMDFet(kDMDFet_HadronLimit)=INT(x) ' x = LoadValue(TableName, "dmdCriticalChanged"): If(x<>"") Then dmdCriticalChanged=True ' x = LoadValue(TableName, "ReplayValue"): If(x <> "") Then ReplayValue=INT(x)Else ReplayValue= Sub ClearAll() Clearhs SaveValue TableName, "DMDStd_"&kDMDStd_Initials, "" SaveValue TableName, "DMDStd_"&kDMDStd_ExtraBallLimit, "" SaveValue TableName, "DMDStd_"&kDMDStd_ExtraBallPCT, "" SaveValue TableName, "DMDStd_"&kDMDStd_TiltWarn, "" SaveValue TableName, "DMDStd_"&kDMDStd_TiltDebounce, "" SaveValue TableName, "DMDStd_"&kDMDStd_MatchPCT, "" SaveValue TableName, "DMDStd_"&kDMDStd_LeftStartReset, "" SaveValue TableName, "DMDStd_"&kDMDStd_BallSave, "" SaveValue TableName, "DMDStd_"&kDMDStd_BallSaveExtend, "" SaveValue TableName, "DMDStd_"&kDMDStd_DynReplayStart, "" SaveValue TableName, "DMDStd_"&kDMDStd_FreePlay, "" SaveValue TableName, "DMDFet_"&kDMDFet_RightScoopePower, "" SaveValue TableName, "DMDFet_"&kDMDFet_RampageSpellout, "" SaveValue TableName, "DMDFet_"&kDMDFeT_GuardiansSpellout, "" SaveValue TableName, "DMDFet_"&kDMDFet_HadronAwards, "" SaveValue TableName, "DMDFet_"&kDMDFet_HadronLimit, "" SaveValue TableName, "dmdCriticalChanged", "" SaveValue TableName, "ReplayValue", "" End Sub Sub Savehs SaveValue TableName, "HighScore1", HighScore(0) SaveValue TableName, "HighScore1Name", HighScoreName(0) SaveValue TableName, "HighScore2", HighScore(1) SaveValue TableName, "HighScore2Name", HighScoreName(1) SaveValue TableName, "HighScore3", HighScore(2) SaveValue TableName, "HighScore3Name", HighScoreName(2) SaveValue TableName, "HighScore4", HighScore(3) SaveValue TableName, "HighScore4Name", HighScoreName(3) SaveValue TableName, "HighScore5", HighScore(4) SaveValue TableName, "HighScore5Name", HighScoreName(4) SaveValue TableName, "Credits", Credits SaveValue TableName, "HighScoreCombo", HighScoreAwards(0) SaveValue TableName, "HighScoreComboName", HighScoreAwardsName(0) SaveValue TableName, "HighScoreCB", HighScoreAwards(1) SaveValue TableName, "HighScoreCBName", HighScoreAwardsName(1) SaveValue TableName, "HighScoreIMMO", HighScoreAwards(2) SaveValue TableName, "HighScoreIMMOName", HighScoreAwardsName(2) SaveValue TableName, "HighScoreXandar", HighScoreAwards(3) SaveValue TableName, "HighScoreXandarName", HighScoreAwardsName(3) 'SaveValue TableName, "Jackpot", Jackpot SaveValue TableName, "TotalGamesPlayed", TotalGamesPlayed End Sub Sub Clearhs HighScore(0) = 75000000 HighScoreName(0) = "MPT" HighScore(1) = 55000000 HighScoreName(1) = "DAP" HighScore(2) = 40000000 HighScoreName(2) = "HMR" HighScore(3) = 30000000 HighScoreName(3) = "MRH" HighScore(4) = 25000000 HighScoreName(4) = "DPF" HighScoreAwards(0) = 15 HighScoreAwardsName(0) = "VPW" HighScoreAwards(1) = 25000000 HighScoreAwardsName(1) = "GCC" HighScoreAwards(2) = 25000000 HighScoreAwardsName(2) = "FGW" HighScoreAwards(3) = 25000000 HighScoreAwardsName(3) = "EJL" SaveValue TableName, "HighScore1", HighScore(0) SaveValue TableName, "HighScore1Name", HighScoreName(0) SaveValue TableName, "HighScore2", HighScore(1) SaveValue TableName, "HighScore2Name", HighScoreName(1) SaveValue TableName, "HighScore3", HighScore(2) SaveValue TableName, "HighScore3Name", HighScoreName(2) SaveValue TableName, "HighScore4", HighScore(3) SaveValue TableName, "HighScore4Name", HighScoreName(3) SaveValue TableName, "HighScore5", HighScore(4) SaveValue TableName, "HighScore5Name", HighScoreName(4) SaveValue TableName, "HighScoreCombo", HighScoreAwards(0) SaveValue TableName, "HighScoreComboName", HighScoreAwardsName(0) SaveValue TableName, "HighScoreCB", HighScoreAwards(1) SaveValue TableName, "HighScoreCBName", HighScoreAwardsName(1) SaveValue TableName, "HighScoreIMMO", HighScoreAwards(2) SaveValue TableName, "HighScoreIMMOName", HighScoreAwardsName(2) SaveValue TableName, "HighScoreXandar", HighScoreAwards(3) SaveValue TableName, "HighScoreXandarName", HighScoreAwardsName(3) End Sub ' *********************************************************** ' High Score Initals Entry Functions - based on Black's code ' *********************************************************** Dim hsbModeActive Dim hsEnteredName Dim hsEnteredDigits(3) Dim hsCurrentDigit Dim hsValidLetters Dim hsCurrentLetter Dim hsLetterFlash Dim hsMAXStart:hsMAXStart=20 Dim hsMAX:hsMAX=10 'V 26 V Dim hsStrSelect:hsStrSelect="N O P Q R S T U V W X Y Z : ; 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z : ; 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M " Dim hsCurrentPlace dim hsGoBackIdx Dim bAchScoreOnly ' No HighScore just Champ for Xandar, Cherry or Immolation Sub CheckHighscore() 'Score(CurrentPlayer)=110000000 bAchScoreOnly=False hsGoBackIdx=-1 osbtempscore = Score(CurrentPlayer) LastScore(CurrentPlayer)=Score(CurrentPlayer) ' Save off for attract later If Score(CurrentPlayer) > HighScore(0) Then 'add 1 credit for beating the highscore AwardSpecial End If ' Bail out on high score when auto testing If AutoQa=False and Score(CurrentPlayer) >= HighScore(4) Then ' Overwrite the lowest vpmtimer.addtimer 2000, "PlaySoundVol ""say-greatScore"", VolDef '" HighScore(4) = Score(CurrentPlayer) 'enter player's name HighScoreEntryInit() Elseif ModeScore(CurrentPlayer,0) > HighScoreAwards(0) or ModeScore(CurrentPlayer,1) > HighScoreAwards(1) or _ ModeScore(CurrentPlayer,2) > HighScoreAwards(2) or ModeScore(CurrentPlayer,3) > HighScoreAwards(3) then ' Achievement Only bAchScoreOnly=True vpmtimer.addtimer 2000, "PlaySoundVol ""say-greatScore"", VolDef '" HighScoreEntryInit() Else if osbactive <> 0 then ' Submit to Orbital osbtemp = osbdefinit SubmitOSBScore End if EndOfBallComplete() End If End Sub Sub HighScoreEntryInit() Dim i hsMAX = DMDStd(kDMDStd_Initials)+1 if hsMax=4 then hsMAXStart=35 ' where do fields start on the screen ' Reset underscores for i = 1 to 11 puPlayer.LabelSet pDMDText,"EnterHS3" & i, " ", 1, "{mt:2,'xpos':" & hsMAXStart+(i*5) & "}" if i <= hsMax then puPlayer.LabelSet pDMDText,"EnterHSU3" & i, "_", 1, "{mt:2,'xpos':" & hsMAXStart+(i*5) & "}" else puPlayer.LabelSet pDMDText,"EnterHSU3" & i, "", 1, "{mt:2,'xpos':" & hsMAXStart+(i*5) & "}" End if Next ' Show Yellow Page if bUsePUPDMD then PuPlayer.LabelShowPage pDMDText, 3,0,"" PuPlayer.playlistplayex pDMDText, "PuPOverlays" ,"black.png", 1, 1 PuPlayer.playlistplayex pDMDFull, "PupImages" ,"blank.png", 1, 1 puPlayer.LabelSet pDMDText,"EnterHS1", "Player " & CurrentPlayer+1 & " - Enter Initials" ,1,"" if Score(CurrentPlayer) > HighScore(0) then puPlayer.LabelSet pDMDText,"EnterHS2", "GRAND CHAMPION" ,1,"" hsCurrentPlace=0 Else if Score(CurrentPlayer) > HighScore(1) then hsCurrentPlace=1 puPlayer.LabelSet pDMDText,"EnterHS2", "HIGH SCORE #1" ,1,"" elseif Score(CurrentPlayer) > HighScore(2) then hsCurrentPlace=2 puPlayer.LabelSet pDMDText,"EnterHS2", "HIGH SCORE #2" ,1,"" elseif Score(CurrentPlayer) > HighScore(3) then hsCurrentPlace=3 puPlayer.LabelSet pDMDText,"EnterHS2", "HIGH SCORE #3" ,1,"" elseif Score(CurrentPlayer) > HighScore(4) then hsCurrentPlace=4 puPlayer.LabelSet pDMDText,"EnterHS2", "HIGH SCORE #4" ,1,"" else hsCurrentPlace=4 puPlayer.LabelSet pDMDText,"EnterHS2", "HIGH SCORE" ,1,"" End if End if hsEnteredName="" End If hsbModeActive = True PlaySoundLoopVol "sfx_hs_music", VolSfx PlaySoundVol "say-EnterYourInitials2", VolDef hsLetterFlash = 0 hsEnteredDigits(0) = " " hsEnteredDigits(1) = " " hsEnteredDigits(2) = " " hsCurrentDigit = 1 hsValidLetters = " ABCDEFGHIJKLMNOPQRSTUVWXYZ:;0123456789" ' < is used to delete the last letter hsCurrentLetter = 2 DMD_Clearforhighscore() DMDId "hsc", "Enter", "Your Name", 999999 HighScoreDisplayName() HighScoreFlashTimer.Interval = 250 HighScoreFlashTimer.Enabled = True End Sub Sub HighScoreFlashTimer_Timer() ' if(hsCurrentDigit <> hsMAX) then if(hsLetterFlash mod 2 =0) then puPlayer.LabelSet pDMDText,"EnterHSU3" & hsCurrentDigit, " " ,1,"" else puPlayer.LabelSet pDMDText,"EnterHSU3" & hsCurrentDigit, "_" ,1,"" end if if(hsLetterFlash=0) then puPlayer.LabelSet pDMDText,"EnterHS4Sel", "", 1, "" elseif(hsLetterFlash=3) then puPlayer.LabelSet pDMDText,"EnterHS4Sel", "[ ]", 1, "{'mt':2,'xpos':49.5}" end if ' end if hsLetterFlash=hsLetterFlash+1 if hsLetterFlash=6 then hsLetterFlash=0 End Sub Sub EnterHighScoreKey(keycode) If keycode = LeftFlipperKey and (hsCurrentDigit <> hsMAX or hsCurrentLetter=29) Then PlaySoundVol "fx_Previous", VolSfx hsCurrentLetter = hsCurrentLetter - 1 if(hsCurrentLetter = 0)then hsCurrentLetter = len(hsValidLetters) end if HighScoreDisplayName() End If If keycode = RightFlipperKey and (hsCurrentDigit <> hsMAX or hsCurrentLetter = 28) Then PlaySoundVol "fx_Next", VolSfx hsCurrentLetter = hsCurrentLetter + 1 if(hsCurrentLetter > len(hsValidLetters))then hsCurrentLetter = 1 end if HighScoreDisplayName() End If ' Stern key - same as start key If (keycode = RightMagnaSave and bDebugLeftMagnaDown=False) or keycode = LockBarKey or _ (keycode = PlungerKey and bUsePlungerForSternKey) Then keycode = StartGameKey End if If keycode = StartGameKey Then if(mid(hsValidLetters, hsCurrentLetter, 1) = ";")then ' Commit HighScoreCommitName() elseif(mid(hsValidLetters, hsCurrentLetter, 1) <> ":")then ' Not Delete if hsCurrentDigit <> hsMAX then PlaySoundVol "sfx-hs-select", VolSfx HighScoreFlashTimer.Enabled=False hsEnteredName= hsEnteredName&mid(hsValidLetters, hsCurrentLetter, 1) puPlayer.LabelSet pDMDText,"EnterHSU3" & hsCurrentDigit, " " ,1,"" hsCurrentDigit = hsCurrentDigit + 1 HighScoreFlashTimer.Enabled=True if(hsCurrentDigit = hsMAX)then hsCurrentLetter = 29 HighScoreDisplayName() else HighScoreDisplayName() end if End if else HighScoreFlashTimer.Enabled=False puPlayer.LabelSet pDMDText,"EnterHS3" & hsCurrentDigit, "" ,1,"" puPlayer.LabelSet pDMDText,"EnterHSU3" & hsCurrentDigit, "_" ,1,"" if(hsCurrentDigit > 1)then hsCurrentDigit = hsCurrentDigit - 1 end if HighScoreFlashTimer.Enabled=True hsEnteredName= mid(hsEnteredName, 1, hsCurrentDigit-1) HighScoreDisplayName() end if 'debug.print "NAME: " & hsEnteredName end if End Sub Sub HighScoreDisplayName() Dim i, TempStr i = (32+hsCurrentLetter)*2 'debug.print "i=" & i puPlayer.LabelSet pDMDText,"EnterHS4", Mid(hsStrSelect, i-(13*2), (26*2)), 1,"{'mt':2,'xpos':2.8}" puPlayer.LabelSet pDMDText,"EnterHS3" & hsCurrentDigit, mid(hsValidLetters, hsCurrentLetter, 1) ,1,"" 'DMDMod "hsc", "YOUR NAME" & bugFIX, Mid(TempStr, 2, 5), 999999 End Sub Function RPad(StringToPad, Length, CharacterToPad) Dim x : x = 0 If Length > Len(StringToPad) Then x = Length - len(StringToPad) RPad = StringToPad & String(x, CharacterToPad) End Function Sub HighScoreCommitName() Dim i StopSound "sfx_hs_music" ' PuPlayer.playlistplayex pDMDText, "PuPOverlays" ,"batsignal1.png", 1, 1 PuPlayer.playlistplayex pDMDText, "PupOverlays" ,"clear1.png", 1, 1 ' Only Full BG Pics need a clear.png to dissapear otherwise they stay in front all black (Labels dont need this and kill performance) HighScoreFlashTimer.Enabled = False tmrHSHoldFlipper.Enabled = False ResetBallSearch hsbModeActive = False if(hsEnteredName = "")then hsEnteredName = "YOU" end if if hsGoBackIdx = -1 then ' Save HS if they didnt just get an achievement if ModeScore(CurrentPlayer,0) > HighScoreAwards(0) then HighScoreAwards(0)=ModeScore(CurrentPlayer,0):HighScoreAwardsName(0)=hsEnteredName if ModeScore(CurrentPlayer,1) > HighScoreAwards(1) then HighScoreAwards(1)=ModeScore(CurrentPlayer,1):HighScoreAwardsName(1)=hsEnteredName if ModeScore(CurrentPlayer,2) > HighScoreAwards(2) then HighScoreAwards(2)=ModeScore(CurrentPlayer,2):HighScoreAwardsName(2)=hsEnteredName if ModeScore(CurrentPlayer,3) > HighScoreAwards(3) then HighScoreAwards(3)=ModeScore(CurrentPlayer,3):HighScoreAwardsName(3)=hsEnteredName if bAchScoreOnly=False then HighScoreName(4) = hsEnteredName SortHighscore DMD_Clearforhighscore ' Submit to Orbital osbtemp = hsEnteredName SubmitOSBScore End if End if puPlayer.LabelSet pDMDText,"EnterHS1", "",1,"" puPlayer.LabelSet pDMDText,"EnterHS2", "",1,"" puPlayer.LabelSet pDMDText,"EnterHS3", "",1,"" puPlayer.LabelSet pDMDText,"EnterHS4", "",1,"" for i = 1 to 10 puPlayer.LabelSet pDMDText,"EnterHS3" &i, "",1,"" Next pBGGamePlay EndOfBallComplete() End Sub Sub SortHighscore Dim tmp, tmp2, i, j For i = 0 to 4 For j = 0 to 3 If HighScore(j) < HighScore(j + 1)Then tmp = HighScore(j + 1) tmp2 = HighScoreName(j + 1) HighScore(j + 1) = HighScore(j) HighScoreName(j + 1) = HighScoreName(j) HighScore(j) = tmp HighScoreName(j) = tmp2 End If Next Next End Sub Sub DMD_Clearforhighscore() if (bUseUltraDMD) then UltraDMD.CancelRendering UltraDMD.Clear End If End Sub ' ************************************************************************* ' ULTRA DMD Instead of the local DMD display ' ************************************************************************* Sub LoadUltraDMD Dim WshShell Set WshShell = CreateObject("WScript.Shell") WshShell.RegWrite "HKCU\Software\UltraDMD\fullcolor",UseFullColor,"REG_SZ" On Error Resume Next Set UltraDMD = CreateObject("UltraDMD.DMDObject") If UltraDMD is Nothing Then MsgBox "No UltraDMD found. This table MAY run without it." bUseUltraDMD=False On Error Goto 0 Exit Sub End If On Error Goto 0 UltraDMD.Init UltraDMD.SetVideoStretchMode 2 If Not UltraDMD.GetMajorVersion = 1 Then MsgBox "Incompatible Version of UltraDMD found." Exit Sub End If If UltraDMD.GetMinorVersion < 1 Then MsgBox "Incompatible Version of UltraDMD found. Please update to version 1.1 or newer." Exit Sub End If Dim fso Set fso = CreateObject("Scripting.FileSystemObject") Dim curDir curDir = fso.GetAbsolutePathName(".") UltraDMD.SetProjectFolder curDir & "\GOTG.UltraDMD" dim vid0 End Sub Sub DMDClearQueue ' It looks like if we call this too fast it will cancel the ULTRA DMD logo scene if bUseUltraDMD and UltraDMDVideos Then If UltraDMD.IsRendering Then UltraDMD.CancelRendering 'UltraDMD.CancelRenderingWithId video 'UltraDMD.Clear End If End If End Sub Sub PlayDMDScene(video, timeMs) if bUseUltraDMD and UltraDMDVideos Then ' Note Video needs to not have sounds and must be more then 3 seconds (Export from iMovie, I chose 540p, high quality, Faster compression. UltraDMD.DisplayScene00 video, "", 15, "", 15, UltraDMD_Animation_None, timeMs, UltraDMD_Animation_None 'UltraDMD.DisplayScene00ExWithId video, False, video, "", 15, 15, "", 15, 15, 14, 4000, 14 End If End Sub Sub DisplayDMDText(Line1, Line2, duration) 'debug.print "DMDText " & Line1 & " " & Line2 if bUseUltraDMD Then UltraDMD.DisplayScene00 "", Line1, 15, Line2, 15, 14, duration, 14 Elseif bUsePUPDMD Then If bPupStarted then if Line1 = "" or Line1 = "_" then pupDMDDisplay "-", Line2, "" ,Duration/1000, 0, 10 else pupDMDDisplay "-", Line1 & "^" & Line2, "" ,Duration/1000, 0, 10 End If End If End If End Sub Sub DisplayDMDText2(Line1, Line2, duration, pri, blink) if bUseUltraDMD Then UltraDMD.DisplayScene00 "", Line1, 15, Line2, 15, 14, duration, 14 Elseif bUsePUPDMD Then If bPupStarted then if Line1 = "" or Line1 = "_" then pupDMDDisplay "-", Line2, "" ,Duration/1000, blink, pri else pupDMDDisplay "-", Line1 & "^" & Line2, "" ,Duration/1000, blink, pri End If End If End If End Sub Sub DMDId(id, toptext, bottomtext, duration) 'used in the highscore entry routine if bUseUltraDMD then UltraDMD.DisplayScene00ExwithID id, false, "", toptext, 15, 0, bottomtext, 15, 0, 14, duration, 14 Elseif bUsePUPDMD Then If bPupStarted then pupDMDDisplay "default", toptext & "^" & bottomtext, "" ,Duration/1000, 0, 10 End If End Sub Sub DMDMod(id, toptext, bottomtext, duration) 'used in the highscore entry routine if bUseUltraDMD then UltraDMD.ModifyScene00Ex id, toptext, bottomtext, duration Elseif bUsePUPDMD Then If bPupStarted then pupDMDDisplay "default", toptext & "^" & bottomtext, "" ,Duration/1000, 0, 10 End If End Sub ' ************************************************************************* ' JP's Reduced Display Driver Functions (based on script by Black) ' only 5 effects: none, scroll left, scroll right, blink and blinkfast ' 3 Lines, treats all 3 lines as text. 3rd line is just 1 character ' Example format: ' DMD "text1","text2","backpicture", eNone, eNone, eNone, 250, True, "sound" ' Short names: ' dq = display queue ' de = display effect ' ************************************************************************* Const eNone = 0 ' Instantly displayed Const eScrollLeft = 1 ' scroll on from the right Const eScrollRight = 2 ' scroll on from the left Const eBlink = 3 ' Blink (blinks for 'TimeOn') Const eBlinkFast = 4 ' Blink (blinks for 'TimeOn') at user specified intervals (fast speed) Const dqSize = 64 Dim dqHead Dim dqTail Dim deSpeed Dim deBlinkSlowRate Dim deBlinkFastRate Dim dCharsPerLine(2) Dim dLine(2) Dim deCount(2) Dim deCountEnd(2) Dim deBlinkCycle(2) Dim dqText(2, 64) Dim dqEffect(2, 64) Dim dqTimeOn(64) Dim dqbFlush(64) Dim dqSound(64) Sub DMD_Init() 'default/startup values Dim i, j if bUseUltraDMD then LoadUltraDMD() DMDFlush() deSpeed = 20 deBlinkSlowRate = 5 deBlinkFastRate = 2 dCharsPerLine(0) = 20 dCharsPerLine(1) = 20 dCharsPerLine(2) = 3 For i = 0 to 2 dLine(i) = Space(dCharsPerLine(i)) deCount(i) = 0 deCountEnd(i) = 0 deBlinkCycle(i) = 0 dqTimeOn(i) = 0 dqbFlush(i) = True dqSound(i) = "" Next For i = 0 to 2 For j = 0 to 64 dqText(i, j) = "" dqEffect(i, j) = eNone Next Next DMD dLine(0), dLine(1), dLine(2), eNone, eNone, eNone, 25, True, "" End Sub Sub DMDFlush() DMDClearQueue End Sub Sub DMDScore() Dim tmp, tmp1, tmp2 Dim TimeStr ' if(dqHead = dqTail)Then ' tmp = FL(0, "PL " & CurrentPlayer, FormatScore(Score(Currentplayer))) ' tmp1 = FL(1, "o " & Ghosts(CurrentPlayer) + GhostsHundreds(CurrentPlayer) * 100, " BALL " & Balls) ' tmp2 = "" ' End If 'DMD tmp, tmp1, tmp2, eNone, eNone, eNone, 25, True, "" if bUseUltraDMD Then If Not UltraDMD.IsRendering Then if tmrCherryBomb.Enabled then TimeStr = "Time:" & ModeCountdownTimer.UserValue & "(" & CherryBombCount & ")" elseif tmrImmolation.Enabled then TimeStr = "Hits:" & ImmolationCount & " Sw:" & SwitchHitCount elseif tmrXandar.Enabled then TimeStr = "Hits:" & XandarCount elseif PlayerMode = -1 Then If bSecondMode then if PlayerMode2 = -1 then TimeStr = "Select Mode/2nd" Else if PlayerMode2 = 7 or PlayerMode2 = 2 Then ' SwitchHits TimeStr = Mode2Percent(PlayerMode2) & "% HITS:" & SwitchHitCount & " 2nd" else TimeStr = Mode2Percent(PlayerMode2) & "% 2nd" end If End if else TimeStr = "Select Mode" End If elseif PlayerMode = 7 Then ' SwitchHits TimeStr = "Time:" & ModeCountdownTimer.UserValue & "(" & ModePercent(PlayerMode) & ") Sw:" & SwitchHitCount else TimeStr = "Time:" & ModeCountdownTimer.UserValue & "(" & ModePercent(PlayerMode) & ")" end If if Score(1) < 2300000000 then ' UltraDMD cant handle alything greater than 2.4 billion ???? sux UltraDMD.DisplayScoreboard PlayersPlayingGame, CurrentPlayer, Score(0), Score(1), Score(2), Score(3), TimeStr, "Ball " & CStr(Balls) End if End If End If End Sub Sub DMDScoreNow DMDFlush DMDScore End Sub Sub DMD(Text0, Text1, Text2, Effect0, Effect1, Effect2, TimeOn, bFlush, Sound) DisplayDMDText Text0, Text1, TimeOn 'if bUsePUPDMD and bPupStarted Then pupDMDDisplay "default", Text0 & "^" & Text1, "" ,2, 0, 10 'if (bUsePUPDMD) Then pupDMDDisplay "attract", Text1 & "^" Text2, "@vidIntro.mp4" ,9, 1, 10 PlaySoundVol Sound, VolDef End Sub Function ExpandLine(TempStr, id) 'id is the number of the dmd line If TempStr = "" Then TempStr = Space(dCharsPerLine(id)) Else if(Len(TempStr) > Space(dCharsPerLine(id)))Then TempStr = Left(TempStr, Space(dCharsPerLine(id))) Else if(Len(TempStr) < dCharsPerLine(id))Then TempStr = TempStr & Space(dCharsPerLine(id)- Len(TempStr)) End If End If End If ExpandLine = TempStr End Function Function FormatScore(ByVal Num) 'it returns a string with commas (as in Black's original font) dim i dim NumString NumString = CStr(abs(Num)) For i = Len(NumString)-3 to 1 step -3 if IsNumeric(mid(NumString, i, 1))then NumString = left(NumString, i) & "," & right(NumString, Len(NumString)-i) end if Next if NumString="0" then NumString="00" FormatScore = NumString End function Function CL(id, NumString) 'center line Dim Temp, TempStr NumString = LEFT(NumString, dCharsPerLine(id)) Temp = (dCharsPerLine(id)- Len(NumString)) \ 2 TempStr = Space(Temp) & NumString & Space(Temp) CL = TempStr End Function Function RL(id, NumString) 'right line Dim Temp, TempStr NumString = LEFT(NumString, dCharsPerLine(id)) Temp = dCharsPerLine(id)- Len(NumString) TempStr = Space(Temp) & NumString RL = TempStr End Function Function FL(id, aString, bString) 'fill line Dim tmp, tmpStr aString = LEFT(aString, dCharsPerLine(id)) bString = LEFT(bString, dCharsPerLine(id)) tmp = dCharsPerLine(id)- Len(aString)- Len(bString) If tmp <0 Then tmp = 0 tmpStr = aString & Space(tmp) & bString FL = tmpStr End Function '************** ' Update DMD '************** 'Sub DMDUpdate(id) ' Dim digit, value ' ' Select Case id ' Case 0 'top text line ' For digit = 0 to 19 ' DMDDisplayChar mid(dLine(0), digit + 1, 1), digit ' Next ' Case 1 'bottom text line ' For digit = 20 to 39 ' DMDDisplayChar mid(dLine(1), digit -19, 1), digit ' Next ' Case 2 ' back image - back animations ' If dLine(2) = "" Then dLine(2) = "@@@" ' For digit = 40 to 42 ' DMDDisplayChar mid(dLine(2), digit -39, 1), digit ' Next ' End Select 'End Sub ' 'Sub DMDDisplayChar(achar, adigit) ' If achar = "" Then achar = " " ' achar = ASC(achar) ' Digits(adigit).ImageA = Chars(achar) 'End Sub '**************************** ' JP's new DMD using flashers '**************************** 'Dim Digits, Chars(255) 'DMDInit ' 'Sub DMDInit ' Dim i ' ' Digits = Array(digit001, digit002, digit003, digit004, digit005, digit006, digit007, digit008, digit009, digit010, _ ' digit011, digit012, digit013, digit014, digit015, digit016, digit017, digit018, digit019, digit020, _ ' digit021, digit022, digit023, digit024, digit025, digit026, digit027, digit028, digit029, digit030, _ ' digit031, digit032, digit033, digit034, digit035, digit036, digit037, digit038, digit039, digit040, _ ' digit041, digit042, digit043) ' ' For i = 0 to 255:Chars(i) = "dempty":Next ' ' Chars(32) = "dempty" ' Chars(35) = "jp1" ' Chars(36) = "jp2" ' Chars(37) = "jp3" ' Chars(38) = "title1" ' Chars(39) = "title2" ' Chars(40) = "title3" ' Chars(46) = "dot" '. ' Chars(48) = "d0" '0 ' Chars(49) = "d1" '1 ' Chars(50) = "d2" '2 ' Chars(51) = "d3" '3 ' Chars(52) = "d4" '4 ' Chars(53) = "d5" '5 ' Chars(54) = "d6" '6 ' Chars(55) = "d7" '7 ' Chars(56) = "d8" '8 ' Chars(57) = "d9" '9 ' Chars(60) = "dless" '< ' Chars(61) = "dequal" '= ' Chars(62) = "dgreater" '> ' Chars(64) = "bkempty" '@ ' Chars(65) = "da" 'A ' Chars(66) = "db" 'B ' Chars(67) = "dc" 'C ' Chars(68) = "dd" 'D ' Chars(69) = "de" 'E ' Chars(70) = "df" 'F ' Chars(71) = "dg" 'G ' Chars(72) = "dh" 'H ' Chars(73) = "di" 'I ' Chars(74) = "dj" 'J ' Chars(75) = "dk" 'K ' Chars(76) = "dl" 'L ' Chars(77) = "dm" 'M ' Chars(78) = "dn" 'N ' Chars(79) = "do" 'O ' Chars(80) = "dp" 'P ' Chars(81) = "dq" 'Q ' Chars(82) = "dr" 'R ' Chars(83) = "ds" 'S ' Chars(84) = "dt" 'T ' Chars(85) = "du" 'U ' Chars(86) = "dv" 'V ' Chars(87) = "dw" 'W ' Chars(88) = "dx" 'X ' Chars(89) = "dy" 'Y ' Chars(90) = "dz" 'Z ' Chars(94) = "dup" '^ ' ' Chars(95) = '_ ' Chars(96) = "d0a" '0. ' Chars(97) = "d1a" '1. 'a ' Chars(98) = "d2a" '2. 'b ' Chars(99) = "d3a" '3. 'c ' Chars(100) = "d4a" '4. 'd ' Chars(101) = "d5a" '5. 'e ' Chars(102) = "d6a" '6. 'f ' Chars(103) = "d7a" '7. 'g ' Chars(104) = "d8a" '8. 'h ' Chars(105) = "d9a" '9 'i ' Chars(111) = "do2" 'o ' Chars(112) = "dp2" 'p 'p dark ' Chars(113) = "dk2" 'q 'k dark ' Chars(114) = "de2" 'r 'e dark ' ' bumper images ' Chars(131) = "b1" ' Chars(132) = "b2" ' Chars(133) = "b3" ' Chars(134) = "b4" ' Chars(135) = "b5" ' Chars(136) = "b6" ' Chars(137) = "b7" ' Chars(138) = "b8" ' Chars(139) = "b9" ' Chars(140) = "b10" ' Chars(141) = "b11" ' Chars(142) = "b12" ' Chars(143) = "b13" ' Chars(144) = "b14" ' Chars(145) = "b15" ' Chars(146) = "b16" ' Chars(147) = "b17" ' Chars(148) = "b18" ' Chars(149) = "b19" ' Chars(150) = "b20" ' Chars(151) = "b21" ' Chars(152) = "b22" ' Chars(153) = "b23" ' Chars(154) = "b24" ' Chars(155) = "b25" ' Chars(156) = "b26" ' Chars(157) = "b27" ' Chars(158) = "b28" ' Chars(159) = "b29" ' Chars(160) = "b30" 'End Sub '**************************************** ' Real Time updatess using the GameTimer '**************************************** 'used for all the real time updates Sub GameTimer_Timer RollingUpdate ' add any other real time update subs, like gates or diverters End Sub '******************************************************************************************** ' Only for VPX 10.2 and higher. ' FlashForMs will blink light or a flasher for TotalPeriod(ms) at rate of BlinkPeriod(ms) ' When TotalPeriod done, light or flasher will be set to FinalState value where ' Final State values are: 0=Off, 1=On, 2=Return to previous State '******************************************************************************************** Sub FlashForMs(MyLight, TotalPeriod, BlinkPeriod, FinalState) 'thanks gtxjoe for the first myVersion If TypeName(MyLight) = "Light" Then If FinalState = 2 Then FinalState = MyLight.State 'Keep the current light state End If MyLight.BlinkInterval = BlinkPeriod MyLight.Duration 2, TotalPeriod, FinalState ElseIf TypeName(MyLight) = "Flasher" Then Dim steps ' Store all blink information steps = Int(TotalPeriod / BlinkPeriod + .5) 'Number of ON/OFF steps to perform If FinalState = 2 Then 'Keep the current flasher state FinalState = ABS(MyLight.Visible) End If MyLight.UserValue = steps * 10 + FinalState 'Store # of blinks, and final state ' Start blink timer and create timer subroutine MyLight.TimerInterval = BlinkPeriod MyLight.TimerEnabled = 0 MyLight.TimerEnabled = 1 ExecuteGlobal "Sub " & MyLight.Name & "_Timer:" & "Dim tmp, steps, fstate:tmp=me.UserValue:fstate = tmp MOD 10:steps= tmp\10 -1:Me.Visible = steps MOD 2:me.UserValue = steps *10 + fstate:If Steps = 0 then Me.Visible = fstate:Me.TimerEnabled=0:End if:End Sub" End If End Sub '****************************************** ' Change light color - simulate color leds ' changes the light color and state ' colors: red, orange, yellow, green, blue, white '****************************************** Sub SetLightColor(n, col, stat) ' States: 0=Off, 1=On, 2=Flash, 3=Flash On, 4=Flash Off SetLightColorTimed n, col, stat, 500 End Sub Sub SetLightColorTimed(n, col, stat, msec) ' States: 0=Off, 1=On, 2=Flash, 3=Flash On, 4=Flash Off Select Case col Case "cyan" n.color = RGB(0, 128, 128) n.colorfull = RGB(0, 231, 231) Case "red" n.color = RGB(18, 0, 0) n.colorfull = RGB(255, 0, 0) Case "orange" n.color = RGB(18, 3, 0) n.colorfull = RGB(255, 64, 0) Case "yellow" n.color = RGB(18, 18, 0) n.colorfull = RGB(255, 255, 0) Case "green" n.color = RGB(0, 18, 0) n.colorfull = RGB(0, 255, 0) Case "green-intense" n.color = RGB(0, 255, 0) n.colorfull = RGB(0, 255, 0) Case "blue" n.color = RGB(0, 0, 128) n.colorfull = RGB(0, 0, 255) Case "blue-light" n.color = RGB(18, 18, 18) n.colorfull = RGB(18, 18, 255) Case "white" n.color = RGB(255, 252, 224) n.colorfull = RGB(193, 91, 0) Case "purple" n.color = RGB(128, 0, 128) n.colorfull = RGB(255, 0, 255) Case "amber" n.color = RGB(193, 49, 0) n.colorfull = RGB(255, 153, 0) End Select If stat <> -1 Then n.State = 0 if stat=3 then ' Flash then go to On n.State = 2 vpmTimer.addTimer msec, n.name & ".state =1 '" elseif stat=4 then ' Flash then go to Off n.State = 2 vpmTimer.addTimer msec, n.name & ".state =0 '" Else n.State = stat End if End If End Sub ' ******************************** ' Table info & Attract Mode ' ******************************** 'Sub ShowTableInfo ' Dim tmp ' 'info goes in a loop only stopped by the credits and the startkey '' If Score(1)Then '' DMD CL(0, "LAST SCORE"), CL(1, "PLAYER1 " &FormatScore(Score(1))), "", eNone, eNone, eNone, 3000, False, "" '' End If '' If Score(2)Then '' DMD CL(0, "LAST SCORE"), CL(1, "PLAYER2 " &FormatScore(Score(2))), "", eNone, eNone, eNone, 3000, False, "" '' End If '' If Score(3)Then '' DMD CL(0, "LAST SCORE"), CL(1, "PLAYER3 " &FormatScore(Score(3))), "", eNone, eNone, eNone, 3000, False, "" '' End If '' If Score(4)Then '' DMD CL(0, "LAST SCORE"), CL(1, "PLAYER4 " &FormatScore(Score(4))), "", eNone, eNone, eNone, 3000, False, "" '' End If ' DMD "", CL(1, "GAME oVER"), "", eNone, eBlink, eNone, 2000, False, "" ' If bFreePlay Then ' DMD CL(0, "FREE PLAY"), CL(1, "PRESS START"), "", eNone, eBlink, eNone, 2000, False, "" ' Else ' If Credits > 0 Then ' DMD CL(0, "CREDITS " & Credits), CL(1, "PRESS START"), "", eNone, eBlink, eNone, 2000, False, "" ' Else ' DMD CL(0, "CREDITS " & Credits), CL(1, "INSERT COIN"), "", eNone, eBlink, eNone, 2000, False, "" ' End If ' End If '' tmp = chr(35)&chr(36)&chr(37) '' DMD "", "", tmp, eNone, eNone, eNone, 3000, False, "" 'jpsalas presents '' tmp = chr(38)&chr(39)&chr(40) '' DMD "", "", tmp, eNone, eNone, eNone, 4000, False, "" 'title '' DMD CL(0, "HIGHSCORES"), Space(dCharsPerLine(1)), "", eScrollLeft, eScrollLeft, eNone, 20, False, "" '' DMD CL(0, "HIGHSCORES"), "", "", eBlinkFast, eNone, eNone, 1000, False, "" '' DMD CL(0, "HIGHSCORES"), "1> " &HighScoreName(0) & " " &FormatScore(HighScore(0)), "", eNone, eScrollLeft, eNone, 2000, False, "" '' DMD "_", "2> " &HighScoreName(1) & " " &FormatScore(HighScore(1)), "", eNone, eScrollLeft, eNone, 2000, False, "" '' DMD "_", "3> " &HighScoreName(2) & " " &FormatScore(HighScore(2)), "", eNone, eScrollLeft, eNone, 2000, False, "" '' DMD "_", "4> " &HighScoreName(3) & " " &FormatScore(HighScore(3)), "", eNone, eScrollLeft, eNone, 2000, False, "" '' DMD Space(dCharsPerLine(0)), Space(dCharsPerLine(1)), "", eScrollLeft, eScrollLeft, eNone, 500, False, "" 'End Sub Sub StartAttractMode(dummy) StartLightSeq DMDFlush 'ShowTableInfo 'StartRainbow "arrows" End Sub Sub StopAttractMode LightSeqAttract.StopPlay 'StopRainbow DMDScoreNow 'StopSong End Sub Sub StartLightSeq() 'lights sequences LightSeqAttract.UpdateInterval = 25 LightSeqAttract.Play SeqBlinking, , 5, 150 LightSeqAttract.Play SeqRandom, 40, , 4000 LightSeqAttract.Play SeqAllOff LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqUpOn, 50, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqDownOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqCircleOutOn, 15, 2 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqUpOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqDownOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqUpOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqDownOn, 25, 1 LightSeqAttract.UpdateInterval = 10 LightSeqAttract.Play SeqCircleOutOn, 15, 3 LightSeqAttract.UpdateInterval = 5 LightSeqAttract.Play SeqRightOn, 50, 1 LightSeqAttract.UpdateInterval = 5 LightSeqAttract.Play SeqLeftOn, 50, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqRightOn, 50, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqLeftOn, 50, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqRightOn, 40, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqLeftOn, 40, 1 LightSeqAttract.UpdateInterval = 10 LightSeqAttract.Play SeqRightOn, 30, 1 LightSeqAttract.UpdateInterval = 10 LightSeqAttract.Play SeqLeftOn, 30, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqRightOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqLeftOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqRightOn, 15, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqLeftOn, 15, 1 LightSeqAttract.UpdateInterval = 10 LightSeqAttract.Play SeqCircleOutOn, 15, 3 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqLeftOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqRightOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqLeftOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqUpOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqDownOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqUpOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqDownOn, 25, 1 LightSeqAttract.UpdateInterval = 5 LightSeqAttract.Play SeqStripe1VertOn, 50, 2 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqCircleOutOn, 15, 2 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqStripe1VertOn, 50, 3 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqLeftOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqRightOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqLeftOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqUpOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqDownOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqCircleOutOn, 15, 2 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqStripe2VertOn, 50, 3 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqLeftOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqRightOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqLeftOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqUpOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqDownOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqUpOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqDownOn, 25, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqStripe1VertOn, 25, 3 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqStripe2VertOn, 25, 3 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqUpOn, 15, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqDownOn, 15, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqUpOn, 15, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqDownOn, 15, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqUpOn, 15, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqDownOn, 15, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqRightOn, 15, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqLeftOn, 15, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqRightOn, 15, 1 LightSeqAttract.UpdateInterval = 8 LightSeqAttract.Play SeqLeftOn, 15, 1 End Sub Sub LightSeqAttract_PlayDone() StartLightSeq() End Sub Sub LightSeqTilt_PlayDone() LightSeqTilt.Play SeqAllOff End Sub Sub LightSeqSkillshot_PlayDone() LightSeqSkillshot.Play SeqAllOff End Sub '************************* ' Rainbow Changing Lights '************************* Dim RGBStep, RGBFactor, Red, Green, Blue, RainbowLights Sub StartRainbow(n) RainbowLights = n RGBStep = 0 RGBFactor = 1 Red = 255 Green = 0 Blue = 0 RainbowTimer.Enabled = 1 End Sub Sub StopRainbow() Dim obj RainbowTimer.Enabled = 0 If RainbowLights = "arrows" Then For each obj in aLEDLights SetLightColor obj, "white", 0 Next ElseIf RainbowLights = "gi" Then For each obj in aGiLights SetLightColor obj, "white", 0 Next End If End Sub Sub RainbowTimer_Timer 'rainbow led light color changing Dim obj Select Case RGBStep Case 0 'Green Green = Green + RGBFactor If Green > 255 then Green = 255 RGBStep = 1 End If Case 1 'Red Red = Red - RGBFactor If Red < 0 then Red = 0 RGBStep = 2 End If Case 2 'Blue Blue = Blue + RGBFactor If Blue > 255 then Blue = 255 RGBStep = 3 End If Case 3 'Green Green = Green - RGBFactor If Green < 0 then Green = 0 RGBStep = 4 End If Case 4 'Red Red = Red + RGBFactor If Red > 255 then Red = 255 RGBStep = 5 End If Case 5 'Blue Blue = Blue - RGBFactor If Blue < 0 then Blue = 0 RGBStep = 0 End If End Select If RainbowLights = "arrows" Then For each obj in aLEDLights obj.color = RGB(Red \ 10, Green \ 10, Blue \ 10) obj.colorfull = RGB(Red, Green, Blue) Next ElseIf RainbowLights = "gi" Then For each obj in aGiLights obj.color = RGB(Red \ 10, Green \ 10, Blue \ 10) obj.colorfull = RGB(Red, Green, Blue) Next End If End Sub '*********************************************************************** ' ********************************************************************* ' Table Specific Script Starts Here ' ********************************************************************* '*********************************************************************** ' droptargets, animations, etc Sub VPObjects_Init ' LScoleriTarget.IsDropped = 1 ' RScoleriTarget.IsDropped = 1 ' LeftScoopK.IsDropped = 1 ' RightScoopK.IsDropped = 1 End Sub ' tables variables and modes init dim bPlayerModeSelect dim bWizardMode dim LastPlayerMode dim PlayerMode Dim bSecondMode Dim PlayerMode2 Dim bSkillshotSelect 'used to select the skillshot you want Dim UpperSkillShot Dim LowerSkillshot Dim PKELevel 'used in the PKE frenzy, increased by the top lanes, the proton pack targets, right ramp Dim PKEMult Dim Ghosts(4) Dim GhostsHundreds(4) Dim bSuperJackpot Dim bDoubleSuperJackpot Dim bTripleSuperJackpot Dim bJackpot Dim bLoopinSupers Dim HiddenJackpot Dim bMassHysteria Dim SpinnerValue Dim SpinnerLevel Dim LeftScoleri Dim RightScoleri Dim GozerAward Dim bTerrorDogActive Dim TerrorDogAward Dim SymmetricalBookStep Dim FirestationHoleHits Dim ModesCompleted Dim bShotMultiplierSelect Dim MultiplierShot Dim Multiplier3x Dim SpookedLibrarianHits Dim BackOffManHits Dim WeGotOneHits Dim bSlimerSuperJackpot Dim HeSlimedMeHits Dim HeSlimedMeValue Dim TheBallroomHits Dim WhoBroughttheDogHits Dim SpookCentralHits Dim GozerianValue Dim GozerianHits Dim StayPuftHits Dim StayPuftMultiballHits Dim Gear(5) Dim ectoHits Dim NextGhostAward 'Dim SlimerDefeats Dim JumpSuitHits Dim LaneBonus Dim bAddedABall Dim bGrootMultiballWait Dim bGrootMultiball Dim GrootMBJackpotHits() Dim GrootMBJackpotCnt Dim GrootMBJackpot Dim SMBHits Dim SongNum Dim BonusLaneSaver Dim ModeCountdown Dim HurryUpCounter dim SwitchHitCount dim SwitchHitResetCount dim bCherryBombReady Dim CherryBombCount Dim CherryBombLocks ' How many balls got locked in dim bCherryBombDone Dim bImmolationQualSanctuary Dim bImmolationWait Dim bImmolationDone dim bImmolationReady Dim ImmolationCount dim ImmolationScoreOdd dim ImmolationScoreEven Dim bImmolationProgress(9) ' Stores which all lights we have already hit Dim bImmolationAllMode ' All Light vs Single Lights dim bImmolationSJPReady ' SJP Is Lit Dim bXandarDone dim bXandarReady Dim XandarCount Dim XandarCompletions Dim HurryUpCount Dim bGrootMouthDisabled Dim bSaveGrootMouthOpen Dim bQuillsQuestFirstTime Dim bQuillsQuestBonusWait Dim bIModeComplete Dim BallSearchCnt Dim bGrootBonus3x Dim bResetCurrentGame Dim modes50 Dim modesStarted dim bFlash1Enabled dim bFlash2Enabled dim bFlash3Enabled dim bFlash4Enabled Dim bFlash4FastEnabled Sub Game_Init() 'called at the start of a new game Dim i dim j dim k ' Disabled this (Rules mention it but actual game seems like it uses flippers to toggle) 'tmrNovaCorps.Enabled = True BallSearchCnt = 0 modesStarted = 0 modes50 = 0 modesCompleted = 0 bPlayPaused = False bSkipWaitVideo = False bAutoPlunger=False bCreatedBall = False baLightsSaved=False baRampLightsSaved = False baHadronLightsSaved = False BallSaverTime = defBallSaverTime HurryUpCount=0 GrootMBFinished =False bGrootMouthDisabled=False bSaveGrootMouthOpen=False bQuillsQuestFirstTime=False bQuillsQuestBonusWait=False CherryBombCount=0 CherryBombLocks=0 bCherryBombDone = False bCherryBombReady = False bIModeComplete=False ImmolationCount=0 ImmolationScoreOdd=0 ImmolationScoreEven=0 bImmolationQualSanctuary=False bImmolationWait = False bImmolationDone = False bImmolationReady = False bImmolationAllMode = False bImmolationSJPReady = False For i = 0 to 8 bImmolationProgress(i) = False Next DisableTable False DefScoreSize=8.5 ' Reset XandarCount=0 ' Number of Xandar Shots taken XandarCompletions=0 ' How Many times have we compelted Xandar bXandarDone = False ' Has Xandar been started bXandarReady = False HurryUpCounter = 0 SwitchHitCount = 0 SwitchHitResetCount=0 ModeCountdown = 0 ModeCountdownTimer.UserValue = 0 ModeCountdownTimer.Enabled = False BonusLaneSaver = 0 bLaneSaverEnabled = False FlipperSkipCmd="" 'HadronCount=0 HadronEnforcerCount=0 BumperMultiplier = 0 GrootMultiBallCount = 0 OrbMultiBallProgress = 0 OrbMultiBallCount = 0 OrbMBJackpot = 0 OrbHurryUpValue=0 OrbMBJackpotHits = 0 OrbMBCompletions=0 bOrbMultiBall = False bOrb2xEnabled = False bOrbDisabled = False OrbTarget1Disabled.Collidable = False OrbTarget1Toggle=False bGrootBonus3x = False tmrGrootMBBonus.Enabled = False GrootMultiBallToggle = False GrootMultiBallCount = 0 GrootMultiBallToggle = False BallsInLock = 0 RealBallsInLock=0 SpellGuardians = DMDFet(kDMDFeT_GuardiansSpellout) ' Start with GUAR SpellRampage=DMDFet(kDMDFet_RampageSpellout) bExtraBallWonThisBall = False 'TurnOffPlayfieldLights() 'Play some Music SongNum = 1 'PlaySong "Song-" & SongNum 'Init Variables EnablePlayerSelect 'bPlayerModeSelect = True PlayerMode = -1 LastPlayerMode = -1 bSecondMode = False PlayerMode2 = -1 bWizardMode = False bSkillshotSelect = False UpperSkillShot = 0 LowerSkillshot = 0 PKELevel = 100 PKEMult = 8 Jackpot = 1000000 SuperJackpot = 1000000 ResetBumpers ' Ghosts(1) = 0 'captured ghosts ' Ghosts(2) = 0 ' Ghosts(3) = 0 ' Ghosts(4) = 0 ' GhostsHundreds(1) = 0 ' GhostsHundreds(2) = 0 ' GhostsHundreds(3) = 0 ' GhostsHundreds(4) = 0 ' NextGhostAward = 0 'InitGhostTarget 'bSlimerUp = False 'bPlayfieldSlimed = False 'SlimerHits = 0 'SlimerDefeats = 0 ' bSlimerSuperJackpot = False ' bSuperJackpot = False ' bDoubleSuperJackpot = False ' bTripleSuperJackpot = False ' bJackpot = False bLoopinSupers = False HiddenJackpot = 0 bMassHysteria = False SpinnerValue = 1000 SpinnerLevel = 1 'StorageLights 0 bMultiBallMode = False bBonusHeld = False LeftScoleri = 0 RightScoleri = 0 GozerAward = 0 bTerrorDogActive = False TerrorDogAward = 4000000 SymmetricalBookStep = 0 FirestationHoleHits = 0 bShotMultiplierSelect = False MultiplierShot = 1 Multiplier3x = 1 ' SpookedLibrarianHits = 0 BackOffManHits = 0 WeGotOneHits = 0 bSlimerSuperJackpot = False HeSlimedMeHits = 0 HeSlimedMeValue = 1000000 TheBallroomHits = 0 WhoBroughttheDogHits = 0 SpookCentralHits = 0 GozerianValue = 1000000 GozerianHits = 0 StayPuftHits = 0 StayPuftMultiballHits = 0 Gear(1) = 0 Gear(2) = 0 Gear(3) = 0 Gear(4) = 0 Gear(5) = 0 ectoHits = 0 JumpSuitHits = 0 LaneBonus = 0 HadronColor="" tmrGrootMouth.Enabled = False tmrGrootMouth.UserValue = False GrootMouth_Drop(False) bAddedABall=False bGrootMultiball = false bGrootMultiballWait=False GrootMBLocks=0 GrootMBJackpot = 0 GrootMBJackpotCnt = 0 For j = 0 to MaxPlayers -1 For i = 0 to aRampLights.count GrootMBJackpotHits(j, i) = 0 Next For i=0 to StackSize-1 StackedLightsIdx(i)=-1 For k = 0 to aRampLights.count StackedLights(j, i, k)=0 Next Next Next bLeftScoopWait=False SMBHits = 0 tGrootLeft.UserValue = 0 tGrootRight.UserValue = 0 ' Reset game progress For i = 0 to 7 ModeProgress(i) = 0 ModePercent(i) = 0 Mode2Progress(i) = 0 Mode2Percent(i) = 0 Next SetLightColor lHadron0, "yellow", 0 SetLightColor lHadron1, "yellow", 0 SetLightColor lHadron2, "yellow", 0 SetLightColor lHadron3, "yellow", 0 SetLightColor lHadron4, "yellow", 0 tgHadron0.UserValue = 0 tgHadron1.UserValue = 0 tgHadron2.UserValue = 0 tgHadron3.UserValue = 0 tgHadron4.UserValue = 0 OrbTarget1.IsDropped = False OrbTarget2.IsDropped = False 'Init Delays/Timers PlayQuote.Enabled = doCallouts 'Skillshot Init 'MainModes Init() 'Init lights 'storage facility lights ContainerFlasher1. Visible = 0 ContainerFlasher2. Visible = 0 ContainerFlasher3. Visible = 0 ContainerFlasher4. Visible = 0 ContainerFlasher5. Visible = 0 ContainerFlasher6. Visible = 0 ' ' Reset Switches for shot multiplier ' sw2.UserValue=0 ' sw3.UserValue=0 ' sw4.UserValue=0 ' sw8.UserValue=0 ' sw9.UserValue=0 tgtGuardians.UserValue = 0 bDebounce = False modeRampColor = "white" TurnOffPlayfieldLights() SetLightColor lgr_a, "green", 1 setUpgradeLight(True) setModeSelectLight(False) setExtraBallLight(False) setMysteryLight(False) ' flshUpgrade.TimerEnabled = True ' flshModeSelect.TimerEnabled = False ' flshExtraBall.TimerEnabled = False ' flshMystery.TimerEnabled = False tmrRovingHadron.Enabled = False tmrShotMultiplierStrobe.Enabled = False sndGeneralHit = "" DMDClearQueue ' Cancel intro movie if it playing pDMDStartGame bFlash1Enabled = False bFlash2Enabled = False bFlash3Enabled = False bFlash4Enabled = False bFlash4FastEnabled=False 'tmrRedLightFlash.Enabled = False ' Stop the Big flashers tmrHadronLightFlash.Enabled = False if bCompetitionMode=False then PlayerMode = INT(RND * 7) ' Start with a random mode unless they override LastPlayerMode = PlayerMode UpdatePlayerMode() End If for i = 0 to 8 ' Clear Bonus counters BonusArrowHits(i) = 0 BonusModeTotal(i) = 0 BonusModeValue(i) = 0 next ' Reset all the player states PlayerState(0).Reset ' Unused since we are one based PlayerState(1).Reset PlayerState(2).Reset PlayerState(3).Reset PlayerState(4).Reset PlayerState(1).Save ' Save new state PlayerState(2).Save ' Save new state PlayerState(3).Save ' Save new state PlayerState(4).Save ' Save new state sw13.UserValue = "" ' TESTING ************************************** ' Blink the lights 100 times, off for 200 msec, 80 = blink rate (0=slow, 1= fast) 'LightSeqMultiplier.Interval = 80 'LightSeqMultiplier.Play SeqBlinking, 0, 100, 200 'PlayDMDScene "vidOrbOpen.mp4" 'OrbOpen() 'vpmtimer.addtimer 3000, "OrbClose '" 'mMagnaSave.MagnetOn = True 'SetLightColor lMagnet, "white", 1 ' Test Cherry Bomb ' ModeProgress(0) = 10 ' ModePercent(0) = 100 ' ModeProgress(1) = 5 ' ModePercent(1) = 100 ' ModeProgress(2) = 8 ' ModePercent(2) = 100 ' ModeProgress(4) = 7 ' ModePercent(4) = 90 ' HadronEnforcerCount = 100 'Immolation flash 'LightSeqImmolation.TimerInterval = 40 'LightSeqImmolation.Play SeqBlinking, 0, 50, 40 ' 50 time, 40ms on/off 'HighScoreEntryInit 'bCherryBombReady = True 'bImmolationReady = True 'bXandarReady = True 'PlayDMDScene "Video-0x0091.wmv", 5000 ' Test Ramp bounce out 'BallReleaseTest.CreateSizedball BallSize / 2 'BallReleaseTest.Kick -18, 70 'BallReleaseTest.CreateSizedball BallSize / 2 'BallReleaseTest.Kick 20, 60 ' Test Ramp bounce out 'BallReleaseTest2.CreateSizedball BallSize / 2 'BallReleaseTest2.Kick 16.5, 30 'puPlayer.LabelSet pDMDText,"MTimer", "3X FOR 20" ,1,"" 'tmrEndOfBallBonus.UserValue = 1.2 'debug.print ((tmrEndOfBallBonus.UserValue - 1) * 10) 'tmrEndOfBallBonus.UserValue = 0 'tmrEndOfBallBonus.Enabled = true ' PuPlayer.playlistplayex pPopUP2,"PuPOverlays","clear.mp4",0,1 ' ' pDMDEvent(kDMD_BonusBG) ' pDMDEvent(kDMD_Bonus1) ' pDMDEvent(kDMD_Bonus3) ' pDMDEvent(kDMD_Bonus5) ' pDMDEvent(kDMD_Bonus7) ' pDMDEvent(kDMD_Bonus9) ' vpmtimer.addtimer 2500, "pDMDEvent(kDMD_BonusClear) '" 'PuPlayer.playlistplayex pPopUP1, "PuPOverlays", "BonusScreen-1.png", 0, 1 'vpmtimer.addtimer 3000, "PuPlayer.playlistplayex kDMD_BonusBG, ""PuPOverlays"", ""blank.png"", 0, 1' " 'PuPlayer.playlistplayex pPopUP1, "PuPOverlays", "blank.png", 0, 1 ' Swipe flash ' Dim interval:interval=3 ' dim angle:angle=30 ' dim j ' for j = 0 to 6 ' LightSeqGroot.UpdateInterval = interval ' LightSeqGroot.Play SeqWiperLeftOn, angle,0,-1 ' LightSeqGroot.UpdateInterval = interval ' LightSeqGroot.Play SeqWiperRightOn, angle,0,-1 ' next 'LightSeqGroot_Playdone 'LightSeqScoopArrow.Play SeqDiagUpRightOn, 30, 1 'vpmtimer.addtimer 4200, "pBGPlayVideo ""Video-0x0059.mp4"", 27000 '" 'PuPEvent(455) 'PuPEvent(kDMD_BallSave) ' PuPEvent(537) ' vpmtimer.addtimer 5000, "PuPEvent(kDMD_BallSave) '" ' vpmtimer.addtimer 8000, "stopTest '" ' Test Immolation ' ModePercent(1)=55 ' ModePercent(2)=50 ' ModePercent(3)=52 ' ModePercent(4)=56 ' ModePercent(5)=78 ' Light030.state =1 ' Light033.state =1 ' DoImmolationI ' ' Test Queue ' QueueScene "Test1", 100, 1 ' QueueScene "Test4", 200, 2 ' QueueScene "Test2", 300, 1 ' QueueScene "Test5", 400, 2 ' QueueScene "Test6", 500, 2 ' QueueScene "Test3", 600, 1 ' dim xx ' Debug.print "Q0" ' for xx = 0 to PupQueueEndPos ' debug.print xx & " " & PupQueue(xx, 0) & " " & PupQueue(xx, 1) & " " & PupQueue(xx, 2) ' Next ' QueuePop ' Debug.print "Q1" ' for xx = 0 to PupQueueEndPos ' debug.print xx & " " & PupQueue(xx, 0) & " " & PupQueue(xx, 1) & " " & PupQueue(xx, 2) ' Next ' QueuePop ' Debug.print "Q2" ' for xx = 0 to PupQueueEndPos ' debug.print xx & " " & PupQueue(xx, 0) & " " & PupQueue(xx, 1) & " " & PupQueue(xx, 2) ' Next ' QueuePop ' QueuePop ' QueuePop ' Debug.print "Q3" ' for xx = 0 to PupQueueEndPos ' debug.print xx & " " & PupQueue(xx, 0) & " " & PupQueue(xx, 1) & " " & PupQueue(xx, 2) ' Next ' QueuePop ' QueueScene "ScenePlayerModeComplete """& "Video-0x004B.mp4" &""", """&"TEST MODE"&""","""&FormatScore(120000)&""",""TOTAL"" '", 3000, 1 ' QueueScene "SceneClearPlayerModeComplete '", 0, 1 ' QueueScene "ScenePlayerModeComplete """& "Video-0x0088.mp4" &""", """&"2nd TEST MODE"&""","""&FormatScore(200003)&""",""TOTAL"" '", 3000, 1 ' QueueScene "SceneClearPlayerModeComplete '", 0, 1 'ModePercent(1)=100 'QueueScene "SceneFinishMode 4 '", 6000, 1 'QueueScene "SceneClearFinishMode '", 0, 1 'Lampz.SetLamp 1, True ' puPlayer.LabelSet pDMDText,"Message", 75700000 / 1000000 & "M" ,1,"" ' vpmTimer.addTimer 2000, "puPlayer.LabelSet pDMDText,""Message"", """" ,1,"""" '" ' Clear it ' puPlayer.LabelSet pDMDText,"PopImg1", "PuPOverlays\\BumperPop.gif", 1,"{'mt':2,'color':111111,'ypos':50,'xpos':5,'width':20, 'height':28, 'anigif':100,'pagenum':1}" ' puPlayer.LabelSet pDMDText, "PopScore1", "10.4K", 1,"" ' ' puPlayer.LabelSet pDMDText,"PopImg2", "PuPOverlays\\BumperPop.gif", 1,"{'mt':2,'color':111111,'ypos':40,'xpos':15,'width':20, 'height':28, 'anigif':100,'pagenum':1}" ' puPlayer.LabelSet pDMDText, "PopScore2", "20.4K", 1,"" 'puPlayer.LabelSet pDMDText, "PopScore1", "12.4K", 0,"{'mt':1,'at':2,'ype':150,'len':400,'mlen':400,'tt':3}" End Sub 'Sub LightSeqImmolation_Playdone() ' LightSeqImmolation.Play SeqMiddleOutHorizOn, 20, 0 'End Sub Sub LightSeqXandar_PlayDone() if (LightSeqXandar.UserValue=0) Then LightSeqXandar.UserValue=1 LightSeqXandar.TimerInterval = 40 LightSeqXandar.Play SeqBlinking, 0, 15, 40 ' 20 time, 40ms on/off End If End Sub Sub LightSeqXandarFinale_PlayDone() if (LightSeqXandarFinale.UserValue=0) Then LightSeqXandarFinale.UserValue = 1 LightSeqXandarFinale.Play SeqDownOn, 30, 1 Elseif (LightSeqXandarFinale.UserValue=1) Then LightSeqXandarFinale.UserValue = 2 LightSeqXandarFinale.Play SeqUpOn, 30, 1 Elseif (LightSeqXandarFinale.UserValue=2) Then LightSeqXandarFinale.UserValue = 3 LightSeqXandarFinale.Play SeqDownOn, 30, 1 Elseif (LightSeqXandarFinale.UserValue=3) Then LightSeqXandarFinale.UserValue = 4 LightSeqXandarFinale.Play SeqRandom, 30, 1, 3000 End If End Sub Sub StopEndOfBallModes() 'this sub is called after the last ball is drained ' Short cycle Rampage Timer if tmrRampage.Enabled then tmrRampage.UserValue=0 ' Turn off lane save SetLightColor lLaneSaver, "yellow", 0 if PlayerMode = kModeStarLord then HurryUpCount=0 HurryUpFinish End if End Sub Sub ResetNewBallVariables() 'reset variables for a new ball or player 'bPlayfieldSlimed = False bSlimerSuperJackpot = False bSuperJackpot = False bDoubleSuperJackpot = False bTripleSuperJackpot = False bJackpot = False HiddenJackpot = 0 LaneBonus = 0 SuperJackpot = 1000000 PKELevel = 100 End Sub Sub ResetNewBallLights() 'turn on or off the needed lights before a new ball is released End Sub Sub TurnOffPlayfieldLights() Dim a For each a in aLights a.State = 0 Next 'Bumper1Light.Visible = 0 'Bumper2Light.Visible = 0 'Bumper3Light.Visible = 0 End Sub Dim FlashLevel1,FlashLevel2, FlashLevel3, FlashLevel4, FlashLevel5 tmrRedLightFlash.Interval = 200 Flasherflash1.TimerInterval = 30 Sub tmrRedLightFlash_Timer 'tmrRedLightFlash.Enabled = False if bFlash1Enabled and Flasherflash1.TimerEnabled=False then FlashLevel1 = 1 : Flasherflash1_Timer : If BallsOnPlayfield > 0 Then DOF 202, DOFPulse if bFlash2Enabled and Flasherflash2.TimerEnabled=False then FlashLevel2 = 1 : Flasherflash2_Timer : If BallsOnPlayfield > 0 Then DOF 201, DOFPulse if bFlash3Enabled and Flasherflash3.TimerEnabled=False then FlashLevel3 = 1 : Flasherflash3_Timer : If BallsOnPlayfield > 0 Then DOF 200, DOFPulse if bFlash4Enabled and Flasherflash4.TimerEnabled=False then FlashLevel4 = 1 : Flasherflash4_Timer : If BallsOnPlayfield > 0 Then DOF 203, DOFPulse if bFlash4FastEnabled then FlashLevel4 = 0.5 : Flasherflash4_Timer : If BallsOnPlayfield > 0 Then DOF 203, DOFPulse End Sub Sub RedLightFlashNebula ' Flashes nebula first and then others bFlash1Enabled = True vpmtimer.addtimer 200, "bFlash3Enabled = True'" vpmtimer.addtimer 400, "bFlash2Enabled = True'" vpmtimer.addtimer 600, "bFlash4Enabled = True'" vpmtimer.addtimer 1500, "bFlash1Enabled = False:bFlash2Enabled = False:bFlash3Enabled = False:bFlash4Enabled = False' " End Sub Sub RedLightFlashGamora ' Flashes Gamora first and then others bFlash3Enabled = True vpmtimer.addtimer 200, "bFlash1Enabled = True'" vpmtimer.addtimer 400, "bFlash2Enabled = True'" vpmtimer.addtimer 600, "bFlash4Enabled = True'" vpmtimer.addtimer 1500, "bFlash1Enabled = False:bFlash2Enabled = False:bFlash3Enabled = False:bFlash4Enabled = False' " End Sub Sub PlayProgress(name) ' Does Score light effects and sound PlayProgress2 name, True End Sub Sub PlayProgress2(name, bAudio) ' Does score light effects and optional sound if bAudio then PlaySoundVol "gg_RampHit", VolDef LightSeqScore.UpdateInterval = 2 LightSeqScore.Play SeqUpOn, 100, 0 if name = "lGamoraArrow" or _ name = "lBrokerArrow" or _ name = "lDraxArrow" or _ name = "lStarLordArrow" Then RedLightFlashGamora ' Elseif name = "lYonduArrow" or _ ' name = "lNebulaArrow" or _ ' name = "lRocketArrow" or _ ' name = "lRonanArrow" Then ' RedLightFlashNebula Else RedLightFlashNebula End if End Sub Dim RGB_r Dim RGB_g Dim RGB_b Dim HadronColor Sub HadronFlash(color, enabled) if enabled Then debug.print "Hadron Flash: " & color if HadronColor<>color then tmrHadronLightFlash.Enabled = False End if HadronColor=color If color = "green" then ' if color is blank just use what the color was before Flasherflash5_5.Color = RGB(0,255,0) Flasherflash5.ImageA = "domegreenflash" Flasherbase5.Image = "domegreenbase" Flasherlit5.Image = "domegreenlit" RGB_r=0:RGB_g=255:RGB_b=0 elseif color = "white" then Flasherflash5_5.Color = RGB(255,255,255) Flasherflash5.ImageA = "domewhiteflash" Flasherbase5.Image = "domewhitebase" Flasherlit5.Image = "domewhitelit" RGB_r=255:RGB_g=255:RGB_b=255 elseif color = "cyan" then Flasherflash5_5.Color = RGB(0,255,255) Flasherflash5.ImageA = "domecyanflash" Flasherbase5.Image = "domecyanbase" Flasherlit5.Image = "domecyanlit" RGB_r=0:RGB_g=255:RGB_b=255 elseif color = "orange" then Flasherflash5_5.Color = RGB(255,165,0) Flasherflash5.ImageA = "domeorangeflash" Flasherbase5.Image = "domeorangebase" Flasherlit5.Image = "domeorangelit" RGB_r=255:RGB_g=165:RGB_b=0 elseif color = "orangedark" then Flasherflash5_5.Color = RGB(204,85,0) Flasherflash5.ImageA = "domeorangedarkflash" Flasherbase5.Image = "domeorangedarkbase" Flasherlit5.Image = "domeorangedarklit" RGB_r=204:RGB_g=85:RGB_b=0 elseif color = "red" then Flasherflash5_5.Color = RGB(255,0,0) Flasherflash5.ImageA = "domeredflash2" Flasherbase5.Image = "domeredbase" Flasherlit5.Image = "domeredlit" RGB_r=255:RGB_g=0:RGB_b=0 elseif color = "blue" then Flasherflash5_5.Color = RGB(0,0,255) Flasherflash5.ImageA = "domeblueflash" Flasherbase5.Image = "domebluebase" Flasherlit5.Image = "domebluelit" RGB_r=0:RGB_g=0:RGB_b=255 elseif color = "purple" then Flasherflash5_5.Color = RGB(128,0,128) Flasherflash5.ImageA = "domepurpleflash" Flasherbase5.Image = "domepurplebase" Flasherlit5.Image = "domepurplelit" RGB_r=128:RGB_g=0:RGB_b=128 elseif color = "yellow" then Flasherflash5_5.Color = RGB(255,255,0) Flasherflash5.ImageA = "domeyellowflash" Flasherbase5.Image = "domeyellowbase" Flasherlit5.Image = "domeyellowlit" RGB_r=255:RGB_g=255:RGB_b=0 elseif color = "white" then Flasherflash5_5.Color = RGB(255,255,255) Flasherflash5.ImageA = "domewhiteflash" Flasherbase5.Image = "domewhitebase" Flasherlit5.Image = "domewhitelit" RGB_r=255:RGB_g=255:RGB_b=255 End If tmrHadronLightFlash.Enabled = True DOF 141, DOFOn elseif HadronEnforcerCount <= 0 or enabled=False then RGB_r=0:RGB_g=255:RGB_b=0 tmrHadronLightFlash.Enabled = False DOF 141, DOFOff End If End Sub Sub tmrHadronLightFlash_Timer tmrHadronLightFlash.interval = 500 FlashLevel5 = 1 : Flasherflash5_Timer If BallsOnPlayfield > 0 Then DOF 204, DOFPulse End Sub Sub Flasherflash1_Timer dim flashx3, matdim If Flasherflash1.TimerEnabled = False Then Flasherflash1.TimerEnabled = True FlasherFlash1_1.TimerEnabled = True Flasherflash1.visible = 1 FlasherFlash1_1.visible = 1 Flasherlit1.visible = 1 End If flashx3 = FlashLevel1 * FlashLevel1 * FlashLevel1 Flasherflash1.opacity = 1000 * flashx3 Flasherlit1.BlendDisableLighting = 30 * flashx3 Flasherbase1.BlendDisableLighting = flashx3 FlasherFlash1_1.opacity = 6000 * flashx3 matdim = Round(10 * FlashLevel2) Flasherlit1.material = "domelit" & matdim FlashLevel1 = FlashLevel1 * 0.9 - 0.01 If FlashLevel1 < 0.15 Then Flasherlit1.visible = 0 Else Flasherlit1.visible = 1 end If If FlashLevel1 < 0 Then Flasherflash1.TimerEnabled = False Flasherflash1.visible = 0 Flasherflash1_1.TimerEnabled = False FlasherFlash1_1.visible = 0 End If End Sub Sub Flasherflash2_Timer dim flashx3, matdim If Flasherflash2.TimerEnabled = False Then Flasherflash2.TimerEnabled = True FlasherFlash2_2.TimerEnabled = True Flasherflash2.visible = 1 FlasherFlash2_2.visible = 1 Flasherlit2.visible = 1 End If flashx3 = FlashLevel2 * FlashLevel2 * FlashLevel2 Flasherflash2.opacity = 1000 * flashx3 Flasherlit2.BlendDisableLighting = 30 * flashx3 Flasherbase2.BlendDisableLighting = flashx3 FlasherFlash2_2.opacity = 6000 * flashx3 matdim = Round(10 * FlashLevel2) Flasherlit2.material = "domelit" & matdim FlashLevel2 = FlashLevel2 * 0.9 - 0.01 If FlashLevel2 < 0.15 Then Flasherlit2.visible = 0 Else Flasherlit2.visible = 1 end If If FlashLevel2 < 0 Then Flasherflash2.TimerEnabled = False Flasherflash2.visible = 0 FlasherFlash2_2.TimerEnabled = False FlasherFlash2_2.visible = 0 End If End Sub Sub Flasherflash3_Timer dim flashx3, matdim If Flasherflash3.TimerEnabled = False Then Flasherflash3.TimerEnabled = True FlasherFlash3_3.TimerEnabled = True Flasherflash3.visible = 1 FlasherFlash3_3.visible = 1 Flasherlit3.visible = 1 End If flashx3 = FlashLevel3 * FlashLevel3 * FlashLevel3 Flasherflash3.opacity = 1000 * flashx3 Flasherlit3.BlendDisableLighting = 30 * flashx3 Flasherbase3.BlendDisableLighting = flashx3 FlasherFlash3_3.opacity = 3000 * flashx3 matdim = Round(10 * FlashLevel3) Flasherlit3.material = "domelit" & matdim FlashLevel3 = FlashLevel3 * 0.9 - 0.01 If FlashLevel3 < 0.15 Then Flasherlit3.visible = 0 Else Flasherlit3.visible = 1 end If If FlashLevel3 < 0 Then Flasherflash3.TimerEnabled = False Flasherflash3.visible = 0 FlasherFlash3_3.TimerEnabled = False FlasherFlash3_3.visible = 0 End If End Sub Sub Flasherflash4_Timer dim flashx3, matdim If Flasherflash4.TimerEnabled = False Then Flasherflash4.TimerEnabled = True FlasherFlash4_4.TimerEnabled = True Flasherflash4.visible = 1 FlasherFlash4_4.visible = 1 Flasherlit4.visible = 1 End If flashx3 = FlashLevel4 * FlashLevel4 * FlashLevel4 Flasherflash4.opacity = 1000 * flashx3 Flasherlit4.BlendDisableLighting = 30 * flashx3 Flasherbase4.BlendDisableLighting = flashx3 FlasherFlash4_4.opacity = 6000 * flashx3 matdim = Round(10 * FlashLevel4) Flasherlit4.material = "domelit" & matdim FlashLevel4 = FlashLevel4 * 0.9 - 0.01 If FlashLevel4 < 0.15 Then Flasherlit4.visible = 0 Else Flasherlit4.visible = 1 end If If FlashLevel4 < 0 Then Flasherflash4.TimerEnabled = False Flasherflash4.visible = 0 FlasherFlash4_4.TimerEnabled = False FlasherFlash4_4.visible = 0 End If End Sub Sub Flasherflash5_Timer dim flashx3, matdim If Flasherflash5.TimerEnabled = False Then Flasherflash5.TimerEnabled = True Flasherflash5_5.TimerEnabled = True Flasherflash5.visible = 1 Flasherflash5_5.visible = 1 Flasherlit5.visible = 1 End If flashx3 = FlashLevel5 * FlashLevel5 * FlashLevel5 Flasherflash5.opacity = 200 * flashx3 Flasherflash5_5.opacity = 500 * flashx3 Flasherlit5.BlendDisableLighting = 10 * flashx3 Flasherbase5.BlendDisableLighting = flashx3 matdim = Round(10 * FlashLevel5) Flasherlit5.material = "domelit" & matdim FlashLevel5 = FlashLevel5 * 0.9 - 0.01 If FlashLevel5 < 0.15 Then Flasherlit5.visible = 0 DOF 114,0:DOF 115,0:DOF 116,0 Else DOF 114,RGB_r:DOF 115,RGB_g:DOF 116,RGB_b Flasherlit5.visible = 1 end If If FlashLevel5 < 0 Then Flasherflash5.TimerEnabled = False Flasherflash5_5.TimerEnabled = False Flasherflash5.visible = 0 Flasherflash5_5.visible = 0 DOF 114,0:DOF 115,0:DOF 116,0 End If End Sub sub ResetBallSearch() if BallSearchResetting then Exit Sub ' We are resetting jsut exit for now 'debug.print "Ball Search Reset" tmrBallSearch.Enabled = False ' Reset Ball Search BallSearchCnt=0 tmrBallSearch.Enabled = True End Sub dim BallSearchResetting:BallSearchResetting=False Sub tmrBallSearch_Timer() ' We timed out Dim BallStr Dim NumBallsHere:NumBallsHere=0 ' See if we are in mode select, a flipper is up that might be holding the ball or a ball is in the lane 'debug.print "Ball Search" if bGameInPlay and bPlayerModeSelect = False and _ hsbModeActive = False and _ bLeftScoopWait=False and _ getQueueTime=0 and _ tmrPauseTimers.Enabled = False and _ tmrEndOfBallBonus.Enabled = False and _ bBallInPlungerLane = False and _ bInstantInfo = False and _ LeftFlipper.CurrentAngle <> LeftFlipper.EndAngle and _ RightFlipper.CurrentAngle <> RightFlipper.EndAngle Then debug.print "Ball Search - NO ACTIVITY " & BallSearchCnt dim Ball debug.print "--- listing balls ---" For each Ball in GetBalls NumBallsHere=NumBallsHere+1 BallStr = "(x:" & Ball.x & " y:" & Ball.y & " z:" & Ball.z & ")" Next debug.print "--- listing balls ---" if BallSearchCnt >= 3 Then ' TBD Might want to implement this ' BallsOnPlayfield = 0 ' for each Ball in GetBalls ' Ball.DestroyBall ' Next BallSearchCnt = 0 if BallsOnPlayfield > 0 then ' somehow we might have drained and didnt catch it?? BallsOnPlayfield = BallsOnPlayfield - 1 ' We cant find the ball (remove one) End if AddMultiball(1) ' Do Pup Animation PuPlayer.LabelShowPage pOverVid, 1,0,"" PuPlayer.PlayStop pOverVid PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x008E.mp4", 1, 1 PuPlayer.LabelSet pOverVid, "Splash2", "LOCATING PINBALLS", 1, "{'mt':2,'size':7.5, 'xalign':0, 'ypos':45}" PuPlayer.LabelSet pOverVid, "Splash3", " FAILED... " , 1, "{'mt':2,'size':7.5, 'xalign':0, 'ypos':55}" vpmtimer.addtimer 3000, "BallSearchClear '" Exit sub End if PuPlayer.LabelShowPage pOverVid, 1,0,"" PuPlayer.PlayStop pOverVid PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x008E.mp4", 1, 1 PuPlayer.LabelSet pOverVid, "Splash1", BallStr, 1, "{'mt':2,'size':3, 'xalign':1, 'ypos':65}" PuPlayer.LabelSet pOverVid, "Splash2", "LOCATING PINBALLS", 1, "{'mt':2,'size':7.5, 'xalign':0, 'ypos':45}" PuPlayer.LabelSet pOverVid, "Splash3", " PLEASE WAIT... " , 1, "{'mt':2,'size':7.5, 'xalign':0, 'ypos':55}" if BallSearchCnt = 2 and NumBallsHere=1 then ' go ahead and move it PuPlayer.LabelSet pOverVid, "Splash2", " LOCATING FAILED ", 1, "{'mt':2,'size':7.5, 'xalign':0, 'ypos':45}" PuPlayer.LabelSet pOverVid, "Splash3", "CALLING OPERATOR. " , 1, "{'mt':2,'size':7.5, 'xalign':0, 'ypos':55}" For each Ball in GetBalls Ball.x = 891 Ball.y = 675 Ball.z = 26 Next End if BallSearchResetting=True BallSearchCnt = BallSearchCnt + 1 DisplayDMDText "BALL SEARCH","", 1000 if OrbTarget1Disabled.Collidable then ' They didnt hit the drop target so drop it for them and let the ball go OrbTarget1Disabled.Collidable = False OrbTarget1.IsDropped = True vpmtimer.addtimer 1500, "OrbTargetReset:OrbTarget1Disabled.Collidable = True '" Elseif OrbTarget1.IsDropped=False then ' Only do this if it is dropped already OrbTarget1.IsDropped = True vpmtimer.addtimer 1500, "OrbTargetReset '" End If leftScoop.Kick 150, 25 DOF 123, DOFPulse RocketKicker.Kick 165, 90 DOF 113, DOFPulse DOF 112, DOFPulse vpmtimer.addtimer 3000, "BallSearchClear '" Else ResetBallSearch End if End Sub Sub BallSearchClear() PuPlayer.LabelSet pOverVid, "Splash1", "", 1, "{'mt':2,'size':7.5, 'xalign':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "Splash2", "", 1, "{'mt':2,'size':7.5, 'xalign':0, 'ypos':45}" PuPlayer.LabelSet pOverVid, "Splash3", "" , 1, "{'mt':2,'size':7.5, 'xalign':0, 'ypos':55}" PuPlayer.playlistplayex pOverVid, "PuPOverlays" ,"clear.png", 1, 1 ' I dont think we need this line because we never set the full screen Image to anything PuPlayer.PlayStop pOverVid BallSearchResetting = False End Sub Sub flshExtraBall_Timer() ' if flshExtraBall.Visible then ' flshExtraBall.Visible = False ' Else ' flshExtraBall.Visible = True ' End If if Lampz.State(4) then Lampz.SetLamp 4, False Else Lampz.SetLamp 4, True End If End Sub Sub setExtraBallLight(bValue) if bValue then QueueScene2 "ExtraBallLit '", 1, 1, True flshExtraBall.TimerEnabled = True Else flshExtraBall.TimerEnabled = False Lampz.SetLamp 4, False End If End Sub Sub flshMystery_Timer() ' if flshMystery.Visible then ' flshMystery.Visible = False ' Else ' flshMystery.Visible = True ' End If if Lampz.State(3) then Lampz.SetLamp 3, False Else Lampz.SetLamp 3, True End If End Sub Sub setMysteryLight(bValue) if bValue then flshMystery.TimerEnabled = True Else flshMystery.TimerEnabled = False Lampz.SetLamp 3, False End If End Sub Sub flshModeSelect_Timer() ' if flshModeSelect.Visible then ' flshModeSelect.Visible = False ' Else ' flshModeSelect.Visible = True ' End If if Lampz.State(2) then Lampz.SetLamp 2, False Else Lampz.SetLamp 2, True End If End Sub Sub setModeSelectLight(bValue) if bValue and ModesCompleted<>8 then ' If Modes are all complete we dont light this flshModeSelect.TimerEnabled = True Else flshModeSelect.TimerEnabled = False Lampz.SetLamp 2, False DOF 300, DOFOff ' James DOF DOF 301, DOFOff DOF 302, DOFOff DOF 303, DOFOff DOF 304, DOFOff DOF 305, DOFOff DOF 306, DOFOff DOF 307, DOFOff DOF 308, DOFOff End If End Sub Sub flshUpgrade_Timer() ' if flshUpgrade.Visible then ' flshUpgrade.Visible = False ' Else ' flshUpgrade.Visible = True ' End If if Lampz.State(1) then Lampz.SetLamp 1, False Else Lampz.SetLamp 1, True End If End Sub Sub setUpgradeLight(bValue) if bValue then flshUpgrade.TimerEnabled = True Else flshUpgrade.TimerEnabled = False Lampz.SetLamp 1, False End If End Sub Sub StartHurryUpQQ() tmrHurryUp.UserValue=2000000 tmrHurryUp.Interval=5000 HurryUpStart puPlayer.LabelSet pDMDText,"Timer", FormatScore(tmrHurryUp.UserValue) ,1,"" puPlayer.LabelSet pDMDText,"Message", "" ,1,"" End Sub ' Add the current hurry up bonus points to our score and start it over (Quills Quest) Sub HurryUpAddBonus(InitialBonus, AddBonus, NextDelay) tmrHurryUp.Enabled=False ' if bUsePUPDMD then puPlayer.LabelSet pDMDText,"Message", tmrHurryUp.UserValue ,1,"" 'Debug.print "HurryUpAddBonus:" & tmrHurryUp.UserValue BonusAddMode tmrHurryUp.UserValue, False HurryUpCount=HurryUpCount+1 tmrHurryUp.UserValue=InitialBonus + (AddBonus * HurryUpCount) if bUsePUPDMD then puPlayer.LabelSet pDMDText,"Timer", tmrHurryUp.UserValue ,1,"" tmrHurryUp.Interval = NextDelay HurryUpStart2 End Sub Sub HurryUpStart2() ' We need this since they could of added a bonus and restarted the timer after we cancelled / Drained if PlayerMode <> -1 and bBallInPlungerLane=False then HurryUpStart End If End Sub Sub HurryUpStart() if PlayerMode = -1 and bQuillsQuestBonusWait=False then exit sub ' Final hurryup was alresady collected tmrHurryUp.Enabled = True if bUsePUPDMD then puPlayer.LabelSet pDMDText,"Timer", FormatScore(tmrHurryUp.UserValue) ,1,"" puPlayer.LabelSet pDMDText,"Message", "" ,1,"" End If End Sub Sub HurryUpFinish() Debug.print "HurryUpFinish:" & bQuillsQuestBonusWait if bQuillsQuestBonusWait then ' End 2nd Mode StopPlayerMode2 End if tmrHurryUp.Enabled = False if bUsePUPDMD then puPlayer.LabelSet pDMDText,"Timer", "" ,1,"" puPlayer.LabelSet pDMDText,"Message", "" ,1,"" End If End Sub Sub tmrHurryUp_Timer() tmrHurryUp.Interval = 50 if tmrPauseTimers.Enabled then exit Sub if tmrHurryUp.UserValue > 0 then ' 500000 then tmrHurryUp.UserValue=tmrHurryUp.UserValue - 4210 if tmrHurryUp.UserValue < 0 then tmrHurryUp.UserValue = 0 if bUsePUPDMD then puPlayer.LabelSet pDMDText,"Timer", FormatScore(tmrHurryUp.UserValue) ,1,"" Else HurryUpFinish End If End Sub Sub AwardMystery() dim award Dim VideoStr award = INT((kDMD_Myst_MAX-600+1)*Rnd+600) if ((bOrbMultiBall and tmrOrbHurryUp.Enabled=False) or bGrootMultiball or tmrImmolation.Enabled or tmrXandar.Enabled) and bAddedABall=False Then award = kDMD_Myst_AddABall elseif award=kDMD_Myst_ExtraBallLit and bExtraBallWonThisBall then award = kDMD_Myst_2Million ' These are not coded Elseif award=kDMD_Myst_SpecialLit or award=kDMD_Myst_BonusHold or award=kDMD_Myst_BonusXHold or award=kDMD_Myst_IncreasePopB or _ award=kDMD_Myst_HadronLit or award=kDMD_Myst_HPhoneHurry then award=kDMD_Myst_2Million End If ' if award <> kDMD_Myst_BonusMultiplier then ' This one is based off the current multiplier ' pDMDEvent(award) ' End If if (bSecondMode or PlayerMode = -1) and award=kDMD_Myst_AddABall then ' If we are in player select and you get Add a ball it messes things up so Switch to Extra Ball award=kDMD_Myst_BallSaveLit End if if award=kDMD_Myst_AddABall then bAddedABall=True ' Only add 1 ball Debug.print "MYSTERY: " & award Select Case award case kDMD_Myst_AddABall: ' Add Multiball 'DisplayDMDText2 "MYSTERY","Add A Ball", 1000, 11, 0 VideoStr="Mystery-AddABall.mp4" AddMultiball 1 case kDMD_Myst_SpecialLit: DisplayDMDText2 "MYSTERY","SPECIAL", 1000, 11, 0 case kDMD_Myst_ShotMult: 'DisplayDMDText2 "MYSTERY","Shot Multipier", 1000, 11, 0 VideoStr="Mystery-ShotMult.mp4" LightShotMultipliers case kDMD_Myst_Orb1: OrbMultiBallProgress=OrbMultiBallProgress+1 if OrbMultiBallProgress=1 then VideoStr="Mystery-Orb1.mp4" if OrbMultiBallProgress=2 then VideoStr="Mystery-Orb2.mp4" ' DisplayDMDText2 "MYSTERY","ORB 1", 1000, 11, 0 ' OrbMultiBallCount = OrbMultiBallCount + 1 ' vpmtimer.addtimer 4000, "pDMDEvent(" & kDMD_Orb1Collected + OrbMultiBallCount -1 & ") '" case kDMD_Myst_OrbIsLit: 'DisplayDMDText2 "MYSTERY","ORB IS LIT", 1000, 11, 0 OrbTarget1_Dropped VideoStr="Mystery-Orb.mp4" case kDMD_Myst_2Million: 'DisplayDMDText2 "MYSTERY","2 MILLION", 1000, 11, 0 VideoStr="Mystery-2M.mp4" DOF 128, DOFPulse AddScore 2000000 case kDMD_Myst_10Million: 'DisplayDMDText2 "MYSTERY","10 MILLION", 1000, 11, 0 VideoStr="Mystery-10M.mp4" DOF 128, DOFPulse AddScore 10000000 case kDMD_Myst_20Million: 'DisplayDMDText2 "MYSTERY","20 MILLION", 1000, 11, 0 VideoStr="Mystery-20M.mp4" DOF 128, DOFPulse AddScore 20000000 case kDMD_Myst_BonusHold: DisplayDMDText2 "MYSTERY","Bonus Hold", 1000, 11, 0 ' END OF Ball Bonus doesnt get cleared case kDMD_Myst_BonusXHold: 'DisplayDMDText2 "MYSTERY","Bonus Hold", 1000, 11, 0 ' End of ball BonusMultiplier does not get cleared case kDMD_Myst_IncreasePopB: DisplayDMDText2 "MYSTERY","Increase Pop Bumpers", 1000, 11, 0 case kDMD_Myst_HadronLit: DisplayDMDText2 "MYSTERY","HADRON IS LIT", 1000, 11, 0 ' Award HADRONS case kDMD_Myst_RampageR,kDMD_Myst_RampageA,kDMD_Myst_RampageM,kDMD_Myst_RampageP,kDMD_Myst_RampageG,kDMD_Myst_RampageE: if SpellRampage=0 then VideoStr="Mystery-RampageP.mp4" if SpellRampage=1 then VideoStr="Mystery-RampageA.mp4" if SpellRampage=2 then VideoStr="Mystery-RampageG.mp4" if SpellRampage=3 then VideoStr="Mystery-Rampage2x.mp4" CheckRocket() case kDMD_Myst_Rampage: VideoStr="Mystery-Rampage2x.mp4" SpellRampage = 3 CheckRocket() case kDMD_Myst_HPhoneHurry: DisplayDMDText2 "MYSTERY","HURRY", 1000, 11, 0 case kDMD_Myst_BallSaveLit: VideoStr="Mystery-BallSave.mp4" bBallSaverReady = True ' Usually this is done on the plunger but we do it here for the grootkicker EnableBallSaver BallSaverTime ' AwardExtraBall case kDMD_Myst_ExtraBallLit: VideoStr="Mystery-EBisLit.mp4" setExtraBallLight(True) 'flshExtraBall.TimerEnabled = True case kDMD_Myst_BonusMultiplier: if BonusMultiplier < 10 then VideoStr="Mystery-B" & BonusMultiplier+1 & ".mp4" AddBonusMultiplier 1 End If End Select ' Play Clip and jump back to process rest of events bLeftScoopSkip=False If VideoStr <> "" Then ' Guard against empty VideoStr causing invalid VLC pointer crash QueueScene "playmedia """ & VideoStr & """, ""PupVideos"", pOverVid, """", -1, """", 1, 1 '", 6111, 1 End If ' QueueScene2 "if bLeftScoopSkip=False then FlipperSkipCmd="""":LeftScoop_Hit '", 0, 1, True ' SetFlipperSkipCmd "bLeftScoopSkip=True:LeftScoop_Hit '" ' DONT FORGET TO CLEAR FlipperSkipCmd when you are past this stage LeftScoop_Hit End Sub '************************************************** '******** Debug routines Dim debugEnableCount:debugEnableCount=0 Dim bDebugLeftMagnaDown:bDebugLeftMagnaDown=False Dim bDebugRightMagnaDown:bDebugRightMagnaDown=False Sub HandleDebugDown(keycode) exit sub If KeyCode = LeftMagnaSave then bDebugLeftMagnaDown = True If KeyCode = RightMagnaSave then bDebugRightMagnaDown = True debug.print "DEBUG L:" & bDebugLeftMagnaDown & " R:" & bDebugRightMagnaDown if (bDebugMode = False) Then ' Turn on debug whne you pres magnas together three times if (bDebugLeftMagnaDown and bDebugRightMagnaDown) then debugEnableCount=debugEnableCount+1 if debugEnableCount = 3 then PlaySoundVol "gg_WeAreTheGOTG", VolDef bDebugMode = True End If End If Exit Sub End if if (bDebugLeftMagnaDown and bDebugRightMagnaDown = False) then vpmtimer.addtimer 200, "HandleDebugLeft '" Elseif (bDebugLeftMagnaDown = False and bDebugRightMagnaDown) then vpmtimer.addtimer 200, "HandleDebugRight '" elseif (bDebugLeftMagnaDown and bDebugRightMagnaDown) then ' Setup for Wizard modes if modesCompleted < 4 and bCherryBombDone=False then ' Cherry Bomb debug.print "Enable Cherry Bomb" ModePercent(0) = 100 ModePercent(1) = 100 ModePercent(2) = 100 ModePercent(3) = 100 PlayerState(CurrentPlayer).bExtraball_1 = True PlayerState(CurrentPlayer).bExtraball_2 = True ModeCountdownTimer.UserValue=-1 elseif modes50 < 8 then ' Immolation debug.print "Enable Immolation" bCherryBombReady = False bCherryBombDone=True 'bPlayerModeSelect = False ModePercent(0) = 50 ModePercent(1) = 50 ModePercent(2) = 50 ModePercent(3) = 50 ModePercent(4) = 50 ModePercent(5) = 50 ModePercent(6) = 50 ModePercent(7) = 50 Light033.state=1:Light030.state=1 ' Groot and ORB 'HadronEnforcerCount = 100 elseif modesCompleted<8 then debug.print "Enable Xandar" PlayerState(CurrentPlayer).bExtraball_1 = True PlayerState(CurrentPlayer).bExtraball_2 = True PlayerState(CurrentPlayer).bExtraball_3 = True EndImmolation(0) bImmolationReady = False bImmolationDone=True ModePercent(0) = 100 ModePercent(1) = 100 ModePercent(2) = 100 ModePercent(3) = 100 ModePercent(4) = 100 ModePercent(5) = 100 ModePercent(6) = 100 ModePercent(7) = 100 Light029.state = 1 ' Immolation End if StopPlayerMode if bPlayerModeSelect then ' Clean up some things SelectPlayerMode(LeftFlipperKey) End If End If End Sub Sub HandleDebugUp(keycode) exit sub If KeyCode = LeftMagnaSave then bDebugLeftMagnaDown = False If KeyCode = RightMagnaSave then bDebugRightMagnaDown = False End Sub Sub HandleDebugLeft() Dim Ball if bPlayerModeSelect then exit sub ' Dont do this when in player select if (bDebugLeftMagnaDown and bDebugRightMagnaDown = False) then if BallsOnPlayfield = 1 then For each Ball in GetBalls Ball.VelY = 0 Ball.VelX = 0 Ball.VelZ = 0 Ball.x = 320 Ball.y = 1820.173 Next End If End If End Sub Sub HandleDebugRight() Dim Ball if bPlayerModeSelect then exit sub ' Dont do this when in player select if (bDebugLeftMagnaDown = False and bDebugRightMagnaDown) then if BallsOnPlayfield = 1 then For each Ball in GetBalls Ball.VelY = 0 Ball.VelX = 0 Ball.VelZ = 0 Ball.x = 640 Ball.y = 1789.111 Next End If End If End Sub Sub CheckE(keycode) if bGameInPlay then exit sub if keycode = KeyUpperRight then exit sub ' Skip Staged Flippers if keycode = KeyUpperLeft then exit sub TrackE_Idx=TrackE_Idx+1 Select case TrackE_Idx case 1: if LFPress=False or RFPress=False then TrackE_Idx=0 case 2,3,4,5,6,7,8,9,10,11,12,13,14: if keycode<>RightFlipperKey then TrackE_Idx=0 case 15: if keycode<>LeftFlipperKey then TrackE_Idx=0 case 16,17,18: if keycode<>RightFlipperKey then TrackE_Idx=0 case 19: if keycode<>LeftFlipperKey then TrackE_Idx=0 case 20,21,22,23: if keycode<>RightFlipperKey then TrackE_Idx=0 case 24: PlayE TrackE_Idx=0 End Select Debug.print "CheckE:" & TrackE_Idx End Sub '************************************************** Sub EnablePlayerSelect() bPlayerModeSelect = True pBGPlayerSelect End sub dim modeRampColor Sub SelectPlayerMode(keycode) Dim cnt cnt = 0 If keycode = LeftFlipperKey Then tmrPlayerSelect_PrevMode=PlayerMode tmrPlayerSelect_Direction=0 PlaySoundVol "fx_Previous", VolSfx Do cnt=cnt+1 PlayerMode = (PlayerMode + 1)MOD 8 Loop While ModePercent(PlayerMode) >= 100 and cnt<8 LastPlayerMode = PlayerMode AnimateSelect UpdatePlayerMode End If If keycode = RightFlipperKey Then tmrPlayerSelect_Direction=1 tmrPlayerSelect_PrevMode=PlayerMode PlaySoundVol "fx_Next", VolSfx Do cnt=cnt+1 PlayerMode = (PlayerMode - 1) if (PlayerMode < 0) then PlayerMode=7 Loop While ModePercent(PlayerMode) >= 100 and cnt<8 LastPlayerMode = PlayerMode AnimateSelect UpdatePlayerMode End If End Sub Dim AnimateSelect_Interval:AnimateSelect_Interval=10 Sub AnimateSelect() puPlayer.LabelSet pDMDText, "PlayerSelect" & tmrPlayerSelect_CurIndex, "",0,"" tmrPlayerSelect_CurIndex=tmrPlayerSelect_PrevMode tmrPlayerSelect_XPos=50 tmrPlayerSelect.UserValue=0 tmrPlayerSelect.Interval=AnimateSelect_Interval tmrPlayerSelect.Enabled=True End Sub Dim tmrPlayerSelect_CurIndex Dim tmrPlayerSelect_XPos Dim tmrPlayerSelect_PrevMode Dim tmrPlayerSelect_Direction ' 0=Left 1=Right Sub tmrPlayerSelect_Timer() tmrPlayerSelect.UserValue=tmrPlayerSelect.UserValue+1 if tmrPlayerSelect.UserValue=14 and tmrPlayerSelect_Direction=1 then tmrPlayerSelect_XPos=0 puPlayer.LabelSet pDMDText, "PlayerSelect" & tmrPlayerSelect_CurIndex, "",0,"" tmrPlayerSelect_CurIndex=PlayerMode elseif tmrPlayerSelect.UserValue=13 and tmrPlayerSelect_Direction=0 then tmrPlayerSelect_XPos=100 puPlayer.LabelSet pDMDText, "PlayerSelect" & tmrPlayerSelect_CurIndex, "",0,"" tmrPlayerSelect_CurIndex=PlayerMode elseif tmrPlayerSelect.UserValue=25 then tmrPlayerSelect.Enabled=False end if if tmrPlayerSelect_Direction=1 then tmrPlayerSelect_XPos=tmrPlayerSelect_XPos+4 Else tmrPlayerSelect_XPos=tmrPlayerSelect_XPos-4 End if puPlayer.LabelSet pDMDText, "PlayerSelect" & tmrPlayerSelect_CurIndex, "",1,"{'mt':2,'width':50, 'height':90,'xalign':1,'yalign':2,'ypos':100,'xpos':" & tmrPlayerSelect_XPos & ",'zback':1}" End Sub Sub UpdatePlayerMode() 'Updates the DMD & lights with the chosen skillshots debug.print "UpdatePlayerMode " & PlayerMode LightSeqSkillshot.Play SeqAllOff 'turn off lights BumperLight001.State = 0 BumperLight002.State = 0 BumperLight003.State = 0 Light020.State = 0:Light020.BlinkInterval=BlinkIntDef:Light020.BlinkPattern=BlinkPatternDef Light021.State = 0:Light021.BlinkInterval=BlinkIntDef:Light021.BlinkPattern=BlinkPatternDef Light022.State = 0:Light022.BlinkInterval=BlinkIntDef:Light022.BlinkPattern=BlinkPatternDef Light023.State = 0:Light023.BlinkInterval=BlinkIntDef:Light023.BlinkPattern=BlinkPatternDef Light024.State = 0:Light024.BlinkInterval=BlinkIntDef:Light024.BlinkPattern=BlinkPatternDef Light025.State = 0:Light025.BlinkInterval=BlinkIntDef:Light025.BlinkPattern=BlinkPatternDef Light026.State = 0:Light026.BlinkInterval=BlinkIntDef:Light026.BlinkPattern=BlinkPatternDef Light027.State = 0:Light027.BlinkInterval=BlinkIntDef:Light027.BlinkPattern=BlinkPatternDef ScorbitBuildGameModes dim time time = 24 if bUsePUPDMD then time = -1 '*********************** Turn off last player ***************** ' Nebula DOF 303, DOFOff ' James DOF SetLightColor lGamoraArrow, "purple", 0 SetLightColor lNebulaArrow, "purple", 0 ' Ronan DOF 301, DOFOff ' James DOF SetLightColor lHadron0, "yellow", 0 SetLightColor lHadron1, "yellow", 0 SetLightColor lHadron2, "yellow", 0 SetLightColor lHadron3, "yellow", 0 SetLightColor lHadron4, "yellow", 0 SetLightColor lRonanArrow, "yellow", 0 ' Yondu DOF 300, DOFOff ' James DOF SetLightColor lYonduArrow, "white", 0 SetLightColor lgr_a, "white", 0 ' Start Lord DOF 308, DOFOff ' James DOF SetLightColor lStarLordArrow, "white", 0 SetLightColor lRonanArrow, "white", 0 SetLightColor lRocketArrow, "white", 0 ' Drax DOF 307, DOFOff ' James DOF SetLightColor lDraxArrow, modeRampColor, 0 SetLightColor lRonanArrow, modeRampColor, 0 ' Rocket DOF 302, DOFOff ' James DOF SetLightColor lRocketArrow, "orange", 0 SetLightColor lgr_a, "orange", 0 SetLightColor lNova_sw2, "orange", PlayerState(CurrentPlayer).lNovaStates(0) SetLightColor lNova_sw3, "orange", PlayerState(CurrentPlayer).lNovaStates(1) SetLightColor lNova_sw4, "orange", PlayerState(CurrentPlayer).lNovaStates(2) SetLightColor lNova_sw8, "orange", lNova_sw8.UserValue ' Override with skill shot SetLightColor lNova_sw9, "orange", lNova_sw9.UserValue ' Gamora DOF 306, DOFOff ' James DOF SetLightColor lGamoraArrow, "green", 0 SetLightColor lNebulaArrow, "green", 0 ' Broker DOF 305, DOFOff ' James DOF SetLightColor lNebulaArrow, "blue", 0 SetLightColor lBrokerArrow, "blue", 0 if bCherryBombReady Then SetLightColor lStarLordArrow, "red", 2 End if if tmrPlayerSelect.enabled = False then puPlayer.LabelSet pDMDText, "PlayerSelect" & PlayerMode, "",1,"{'mt':2,'width':55, 'height':90,'xalign':1,'yalign':2,'ypos':100,'xpos':50,'zback':1}" End if playmedia "PlayerSelect.mp4", "PupVideos", pDMdFull, "", -1, "", 1, 1 DMDFlush Dim Line1 if PlayerMode = -1 Then Line1 = "Select Mode" Else Line1 = "Mode Select (" & ModePercent(PlayerMode) & ")" End If Select Case PlayerMode case -1:' No Mode is selected yet DisplayDMDText2 "PLEASE SELECT ","A MODE", 20000, 10, 1 ' DMD "PLEASE SELECT", "A MODE", "", eNone, eNone, eNone, time, False, "":Light020.State = 2 ' Focuses on the Ramps Case 0: ' Nebula DOF 303, DOFOn ' James DOF DMD Line1, CL(0, "Pod Chase"), "", eNone, eNone, eNone, time, False, "":Light020.State = 2 ' Focuses on the Ramps modeRampColor = "blue" SetLightColor lGamoraArrow, modeRampColor, 1 SetLightColor lNebulaArrow, modeRampColor, 1 ModeCountdown = 154 ' seconds HadronFlash "blue", True UpdateModeSelection ' pDMDEvent(kDMD_SelPodChase) RefreshPlayerMode 'puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress10-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':24,'yalign':0,'ypos':4.5,'xpos':0,'pagenum':1}" Case 1: ' Ronan DOF 301, DOFOn ' James DOF modeRampColor = "yellow" DMD Line1, CL(0, "Sanctuary"), "", eNone, eNone, eNone, time, False, "":Light021.State = 2 ' Focuses on the Left Loop SetLightColor lHadron0, "yellow", 1 SetLightColor lHadron1, "yellow", 1 SetLightColor lHadron2, "yellow", 1 SetLightColor lHadron3, "yellow", 1 SetLightColor lHadron4, "yellow", 1 SetLightColor lRonanArrow, "yellow", 2 ModeCountdown = 68 ' seconds HadronFlash "yellow", True UpdateModeSelection ' pDMDEvent(kDMD_SelSanctuary) RefreshPlayerMode 'puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress5-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':24,'yalign':0,'ypos':4.5,'xpos':0,'pagenum':1}" Case 2: ' Yandu DOF 300, DOFOn ' James DOF DMD Line1, CL(0, "Yaka Arrow"), "", eNone, eNone, eNone, time, False, "":Light022.State = 2 ' St Bobilee ?? modeRampColor = "blue-light" SetLightColor lYonduArrow, modeRampColor, 1 SetLightColor lgr_a, modeRampColor, 1 ModeCountdown = 54 ' seconds HadronFlash "white", True UpdateModeSelection ' pDMDEvent(kDMD_SelYakaArrow) RefreshPlayerMode 'puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress8-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':24,'yalign':0,'ypos':4.5,'xpos':0,'pagenum':1}" Case 3: ' Star Lord DOF 308, DOFOn ' James DOF DMD Line1, CL(0, "Quills Quest"), "", eNone, eNone, eNone, time, False, "":Light023.State = 2 ' 2 Ball multiball at the beginning. St Bobilee ?? SetLightColor lStarLordArrow, "yellow", 2 SetLightColor lRonanArrow, "yellow", 1 SetLightColor lRocketArrow, "yellow", 1 modeRampColor = "yellow" ModeCountdown = 166 ' seconds HadronFlash "orange", True UpdateModeSelection ' pDMDEvent(kDMD_SelQuillsQuest) RefreshPlayerMode 'puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress12-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':24,'yalign':0,'ypos':4.5,'xpos':0,'pagenum':1}" Case 4: ' Drax DOF 307, DOFOn ' James DOF DMD Line1, CL(0, "Knowhere"), "", eNone, eNone, eNone, time, False, "":Light024.State = 2 ' ModeCountdown = 85 ' seconds modeRampColor = "red" SetLightColor lDraxArrow, modeRampColor, 2 SetLightColor lRonanArrow, modeRampColor, 2 SetLightColor lGamoraArrow, modeRampColor, 1 SetLightColor lNebulaArrow, modeRampColor, 1 HadronFlash "red", True UpdateModeSelection ' pDMDEvent(kDMD_SelKnowhere) RefreshPlayerMode 'puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress8r-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':24,'yalign':0,'ypos':4.5,'xpos':0,'pagenum':1}" Case 5: ' Rocket DOF 302, DOFOn ' James DOF DMD Line1, CL(0, "Escape Kyln"), "", eNone, eNone, eNone, time, False, "":Light025.State = 2 ' ModeCountdown = 85 ' seconds modeRampColor = "orange" SetLightColor lRocketArrow, modeRampColor, 1 SetLightColor lgr_a, modeRampColor, 1 SetLightColor lNova_sw2, "orange", PlayerState(CurrentPlayer).lNovaStatesKyln(0) SetLightColor lNova_sw3, "orange", PlayerState(CurrentPlayer).lNovaStatesKyln(1) SetLightColor lNova_sw4, "orange", PlayerState(CurrentPlayer).lNovaStatesKyln(2) SetLightColor lNova_sw8, "orange", PlayerState(CurrentPlayer).lNovaStatesKyln(3) SetLightColor lNova_sw9, "orange", PlayerState(CurrentPlayer).lNovaStatesKyln(4) HadronFlash "orangedark", True UpdateModeSelection ' pDMDEvent(kDMD_SelEscapeKyln) RefreshPlayerMode 'puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress7-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':24,'yalign':0,'ypos':4.5,'xpos':0,'pagenum':1}" Case 6: ' Gamora DOF 306, DOFOn ' James DOF DMD Line1, CL(0, "Sibling Rivalry"), "", eNone, eNone, eNone, time, False, "":Light026.State = 2 ' Gamora modeRampColor = "green" SetLightColor lGamoraArrow, modeRampColor, 2 SetLightColor lNebulaArrow, modeRampColor, 2 ModeCountdown = 101 ' seconds HadronFlash "green", True UpdateModeSelection ' pDMDEvent(kDMD_SelSibling) RefreshPlayerMode 'puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress8g-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':24,'yalign':0,'ypos':4.5,'xpos':0,'pagenum':1}" Case 7: ' Broker DOF 305, DOFOn ' James DOF DMD Line1, CL(0, "Antiquities Shop"), "", eNone, eNone, eNone, time, False, "":Light027.State = 2 ' modeRampColor = "cyan" SetLightColor lNebulaArrow, modeRampColor, 1 SetLightColor lBrokerArrow, modeRampColor, 2 ModeCountdown = 61 ' seconds HadronFlash "cyan", True UpdateModeSelection ' pDMDEvent(kDMD_SelAntiquities) RefreshPlayerMode 'puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress7t-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':24,'yalign':0,'ypos':4.5,'xpos':0,'pagenum':1}" End Select if PlayerMode <> -1 Then SetBackglassTimer(ModeCountdown) End If SetModeLights End Sub Sub UpdateModeSelection() Dim i Dim ModeText0 Dim ModeText1 Dim ModeText2 Dim offsets(8) for i = 0 to 7 offsets(i)=0 Next offsets(PlayerMode)=2 Select Case PlayerMode case -1:' No Mode is selected yet Case 0: ' Nebula ModeText1="Pod" ModeText2="Chase" Case 1: ' Ronan ModeText0="Sanctuary" Case 2: ' Yandu ModeText1="Yaka" ModeText2="Arrow" Case 3: ' Star Lord ModeText1="Quill's" ModeText2="Quest" Case 4: ' Drax ModeText0="Knowhere" Case 5: ' Rocket ModeText1="Escape" ModeText2="Kyln" Case 6: ' Gamora ModeText1="Sibling" ModeText2="Rivalry" Case 7: ' Broker ModeText1="Antiques" ModeText2="Shop" End Select puPlayer.LabelSet pDMDText, "ModeSelectPic1", "PuPOverlays\\ModeSel7.png",1,"{'mt':2,'width':"& 6.4 + offsets(7) & ", 'height':"& 14 + offsets(7)*2 & ",'xalign':1,'yalign':1,'ypos':24.5,'xpos':73}" puPlayer.LabelSet pDMDText, "ModeSelectCir1", "PuPOverlays\\ModeSelR7.png",1,"{'mt':2,'width':"& 10 + offsets(7) & ", 'height':"& 18 + offsets(7)*2 & ",'xalign':1,'yalign':1,'ypos':25,'xpos':73.5, 'ztop':1}" puPlayer.LabelSet pDMDText, "ModeSelectPic2", "PuPOverlays\\ModeSel6.png",1,"{'mt':2,'width':"& 6.4 + offsets(6) & ", 'height':"& 14 + offsets(6)*2 & ",'xalign':1,'yalign':1,'ypos':24.5,'xpos':84}" puPlayer.LabelSet pDMDText, "ModeSelectCir2", "PuPOverlays\\ModeSelR6.png",1,"{'mt':2,'width':"& 10 + offsets(6) & ", 'height':"& 18 + offsets(6)*2 & ",'xalign':1,'yalign':1,'ypos':25,'xpos':84, 'ztop':1}" puPlayer.LabelSet pDMDText, "ModeSelectPic3", "PuPOverlays\\ModeSel0.png",1,"{'mt':2,'width':"& 6.4 + offsets(0) & ", 'height':"& 14 + offsets(0)*2 & ",'xalign':1,'yalign':1,'ypos':40,'xpos':68.5}" puPlayer.LabelSet pDMDText, "ModeSelectCir3", "PuPOverlays\\ModeSelR0.png",1,"{'mt':2,'width':"& 10 + offsets(0) & ", 'height':"& 18 + offsets(0)*2 & ",'xalign':1,'yalign':1,'ypos':40.5,'xpos':68.5, 'ztop':1}" puPlayer.LabelSet pDMDText, "ModeSelectPic4", "PuPOverlays\\ModeSel5.png",1,"{'mt':2,'width':"& 6.4 + offsets(5) & ", 'height':"& 14 + offsets(5)*2 & ",'xalign':1,'yalign':1,'ypos':40,'xpos':90}" puPlayer.LabelSet pDMDText, "ModeSelectCir4", "PuPOverlays\\ModeSelR5.png",1,"{'mt':2,'width':"& 10 + offsets(5) & ", 'height':"& 18 + offsets(5)*2 & ",'xalign':1,'yalign':1,'ypos':40.5,'xpos':90, 'ztop':1}" puPlayer.LabelSet pDMDText, "ModeSelectPic5", "PuPOverlays\\ModeSel1.png",1,"{'mt':2,'width':"& 6.4 + offsets(1) & ", 'height':"& 14 + offsets(1)*2 & ",'xalign':1,'yalign':1,'ypos':58,'xpos':68.5}" puPlayer.LabelSet pDMDText, "ModeSelectCir5", "PuPOverlays\\ModeSelR1.png",1,"{'mt':2,'width':"& 10 + offsets(1) & ", 'height':"& 18 + offsets(1)*2 & ",'xalign':1,'yalign':1,'ypos':58.5,'xpos':68.5, 'ztop':1}" puPlayer.LabelSet pDMDText, "ModeSelectPic6", "PuPOverlays\\ModeSel4.png",1,"{'mt':2,'width':"& 6.4 + offsets(4) & ", 'height':"& 14 + offsets(4)*2 & ",'xalign':1,'yalign':1,'ypos':58,'xpos':90}" puPlayer.LabelSet pDMDText, "ModeSelectCir6", "PuPOverlays\\ModeSelR4.png",1,"{'mt':2,'width':"& 10 + offsets(4) & ", 'height':"& 18 + offsets(4)*2 & ",'xalign':1,'yalign':1,'ypos':58.5,'xpos':90, 'ztop':1}" puPlayer.LabelSet pDMDText, "ModeSelectPic7", "PuPOverlays\\ModeSel2.png",1,"{'mt':2,'width':"& 6.4 + offsets(2) & ", 'height':"& 14 + offsets(2)*2 & ",'xalign':1,'yalign':1,'ypos':74.5,'xpos':73}" puPlayer.LabelSet pDMDText, "ModeSelectCir7", "PuPOverlays\\ModeSelR2.png",1,"{'mt':2,'width':"& 10 + offsets(2) & ", 'height':"& 18 + offsets(2)*2 & ",'xalign':1,'yalign':1,'ypos':75,'xpos':73.5, 'ztop':1}" puPlayer.LabelSet pDMDText, "ModeSelectPic8", "PuPOverlays\\ModeSel3.png",1,"{'mt':2,'width':"& 6.4 + offsets(3) & ", 'height':"& 14 + offsets(3)*2 & ",'xalign':1,'yalign':1,'ypos':74.5,'xpos':84}" puPlayer.LabelSet pDMDText, "ModeSelectCir8", "PuPOverlays\\ModeSelR3.png",1,"{'mt':2,'width':"& 10 + offsets(3) & ", 'height':"& 18 + offsets(3)*2 & ",'xalign':1,'yalign':1,'ypos':75,'xpos':84, 'ztop':1}" puPlayer.LabelSet pDMDText, "ModeSelectLabel1", ModeText1 ,1,"{'mt':2, 'size':3, 'xalign':1, 'ypos':44, 'xpos':79}" puPlayer.LabelSet pDMDText, "ModeSelectLabel2", ModeText2 ,1,"{'mt':2, 'size':3, 'xalign':1, 'ypos':49, 'xpos':79}" puPlayer.LabelSet pDMDText, "ModeSelectLabel3", ModeText0 ,1,"{'mt':2, 'size':3, 'xalign':1, 'ypos':46.5, 'xpos':79}" End Sub Sub ClearModeSelection() dim i tmrPlayerSelect.Enabled=False For i = 1 to 8 puPlayer.LabelSet pDMDText, "ModeSelectPic" & i, "PuPOverlays\\clear.png",1,"" puPlayer.LabelSet pDMDText, "ModeSelectCir" & i, "PuPOverlays\\clear.png",1,"" puPlayer.LabelSet pDMDText, "PlayerSelect" & i-1, "" ,0,"" Next ' puPlayer.LabelSet pDMDText, "PlayerSelect", "PupOverlays\\clear.png" ,1,"" puPlayer.LabelSet pDMDText, "ModeSelectLabel1", "" ,1,"{'mt':2, 'size':3.5, 'xalign':1, 'ypos':44, 'xpos':79}" puPlayer.LabelSet pDMDText, "ModeSelectLabel2", "" ,1,"{'mt':2, 'size':3.5, 'xalign':1, 'ypos':49, 'xpos':79}" puPlayer.LabelSet pDMDText, "ModeSelectLabel3", "" ,1,"{'mt':2, 'size':3.5, 'xalign':1, 'ypos':46.5, 'xpos':79}" End Sub Sub RefreshPlayerMode() 'Refreshed the Progress Image and others since they dissapear when you switch screen and come back if bUsePUPDMD then If bSetBackglassTimer_Hide then Exit Sub ' Hide Progress 'width=17, height=24 'puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress7-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':20,'yalign':0,'ypos':5.5,'xpos':0,'pagenum':1}" Select Case PlayerMode case -1:' No Mode is selected yet Case 0: ' Nebula puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress10-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':20,'yalign':0,'ypos':5.5,'xpos':0,'pagenum':1}" Case 1: ' Ronan puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress5-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':20,'yalign':0,'ypos':5.5,'xpos':0,'pagenum':1}" Case 2: ' Yandu puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress8-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':20,'yalign':0,'ypos':5.5,'xpos':0,'pagenum':1}" Case 3: ' Star Lord puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress12-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':20,'yalign':0,'ypos':5.5,'xpos':0,'pagenum':1}" Case 4: ' Drax puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress8r-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':20,'yalign':0,'ypos':5.5,'xpos':0,'pagenum':1}" Case 5: ' Rocket puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress7-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':20,'yalign':0,'ypos':5.5,'xpos':0,'pagenum':1}" Case 6: ' Gamora puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress8g-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':20,'yalign':0,'ypos':5.5,'xpos':0,'pagenum':1}" Case 7: ' Broker puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress7t-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':20,'yalign':0,'ypos':5.5,'xpos':0,'pagenum':1}" End Select if tmrRampage.Enabled then puPlayer.LabelSet pDMDText, "RampImg", "PuPOverlays\\Rampage.gif",1,"{'mt':2,'color':111111,'width':11, 'height':21, 'anigif':100,}" End If End If End Sub Sub CherryBombAddBalls() ' Kicks all the balls after a delay AddMultiball 6 - BallsOnPlayfield End Sub Function CheckWizardModeStart(trigger_name) dim a,i,b dim delay dim delay2 CheckWizardModeStart=False if trigger_name = "lStarLordArrow" and bMultiBallMode=False Then ' scoop hit and not in MB Check Wizard modes ' ******* Handle Cherry Bomb ******** Start Cherry Bomb if bCherryBombReady Then debug.print "Start Cherry Bomb" DMD "Start Mode", CL(0, "Cherry Bomb"), "", eNone, eNone, eNone, 1000, False, "" QueueScene "PlaySoundVol ""vo_multiball"", VolDef '", 1, 1 QueueScene "PlaySoundVol ""sfx_cheer2"", VolDef '", 1, 1 QueueScene "ScenePlayMessage ""Video-0x0092.mp4"", ""CHERRY BOMB"","""",""MULTIBALL"" '", 2000, 1 QueueScene "SceneClearPlayMessage '", 0, 1 QueueScene2 "CherryBombAddBalls '", 0, 1, True ' Add the balls after a delay delay2=0 delay=getQueueTime if delay > 2000 then LeftScoopDelay = delay ' Add a few more seconds before we kick the ball out delay2=delay \ 1000 else LeftScoopDelay = 1500 ' Add a few more seconds before we kick the ball out End if bSkipWaitVideo=True ' Make sure we dont start the wait video since we are going to start Cherry StopPlayerMode StopPlayerMode2 ' Stop the mode since CB doesnt stack bSkipWaitVideo=False playclear pAudio setUpgradeLight(True) setModeSelectLight(False) ' flshUpgrade.TimerEnabled = True ' flshModeSelect.TimerEnabled = False bCherryBombReady = False CherryBombCount=0 CherryBombLocks=0 tmrCherryBomb.UserValue = 61 tmrCherryBomb.Interval = 3500 + LeftScoopDelay ' Delay the timer tmrCherryBomb.Enabled = True bWizardMode = True WizardModePoints=0 WizardBonusPoints=0 EnableOrb(True) ' Drop the orb Target OrbTarget1.isDropped = True GrootMouth_Drop(False) ' Close Groots Mouth in case it is open EnableBallSaverForce 60 + delay2 + 10 ' Delay a little extra so ball save doesnt run out mid mode ' BallSaverTimerCancel ' Stop ballsaver if it is currently running ' BallSaverTime = 60 ' Setup new Ball Saver ' bBallSaverReady = True 'AddMultiball 5 - BallsOnPlayfield ' Moved to Queue 'ModeCountdownTimer.UserValue = 60 'ModeCountdownTimer.Enabled = True StartPlayerModeVideo False ' Play cherry video LoopGateLeft.Open = True ' Gates are open for a full orbit shots Gate002.Open = True StackState(kStack_Pri2).Enable(-1) For each a in aRampLights ' Upgrade so All the arrows count now SSetLightColor kStack_Pri2, a, "red", 2 Next CheckWizardModeStart = True ScorbitBuildGameModes() ' ********* Immolation Mode ready Start Immolation Mode ' * All Arrows are lit ' * Hit an arrow, Turns off all arrows, except the one you Hit ' * Hit the single lit arrow (Note, Switch hits and "Hadron Enforcer Lit", Spot a Shot from left to right) ' * Arrows you havent hit light up elseIf bImmolationReady Then debug.print "Start Immolation" StopScoopLightSeq DMD "Start Mode", CL(0, "Immolation Initiative"), "", eNone, eNone, eNone, 1000, False, "" setUpgradeLight(True) setModeSelectLight(False) ' flshUpgrade.TimerEnabled = True ' flshModeSelect.TimerEnabled = False LightSeqImmolation.TimerInterval = 40 LightSeqImmolation.Play SeqBlinking, 0, 50, 40 ' 50 time, 40ms on/off ' TBD: Play Immolation Video SwitchHitCount=50 SwitchHitResetCount=0 bAddedABall=False UpdateSwitchHitCnt SwitchHitCount tmrImmolation.Enabled = True GrootMouth_Drop(False) ' Close Groots Mouth in case it is open bImmolationReady = False ImmolationCount=0 ImmolationScoreOdd=3000000 ImmolationScoreEven=6200000 SetLightColor Light029, "white", 1 ' Mark Immolation as complete playclear pAudio EnableOrb(True) OrbTarget1.isDropped = True ' Drop the orb Target bBallSaverReady = True EnableBallSaverForce 30 AddMultiball 3 - BallsOnPlayfield bWizardMode = True WizardModePoints=0 WizardBonusPoints=0 StartPlayerModeVideo False StackState(kStack_Pri2).Enable(-1) bImmolationAllMode=True bImmolationSJPReady=False For each a in aRampLights ' light ramps (Remember progress) select case a.name ' Mark it so we dont light it up again case "lYonduArrow": i=0 case "lRonanArrow": i=1 case "lRocketArrow": i=2 case "lNebulaArrow": i=3 case "lgr_a": i=4 case "lBrokerArrow": i=5 case "lGamoraArrow": i=6 case "lDraxArrow": i=8 case "lStarLordArrow": i=8 End Select if bImmolationProgress(i)=False then SSetLightColor kStack_Pri2, a, "yellow", 2 Else SSetLightColor kStack_Pri2, a, "yellow", 0 End if Next CheckWizardModeStart = True ScorbitBuildGameModes() ' ********* Xandar Mode ready Start Save Xandar Mode ' Hit each upper arrow 3 times, Each hit flashes border lights and plays du, duh, duhh, duhha ' All Arrows lights starlord arrow and name. Hit starlord and win the game ' Play Video-0x0091.mp4, flash up, down, up then random (4 seconds Total) elseif bXandarReady Then debug.print "Start Xanadar" StopScoopLightSeq DMD "Start Mode", CL(0, "Save Xandar"), "", eNone, eNone, eNone, 1000, False, "" setUpgradeLight(False) ' No upgrade during Xandar setModeSelectLight(False) ' flshUpgrade.TimerEnabled = True ' flshModeSelect.TimerEnabled = False ' Multi Step Light Sequence LightSeqXandar.UserValue=0 LightSeqXandar.Play SeqDownOn, 30, 3 'SwitchHitCount=100 EnableOrb(True) OrbTarget1.isDropped = True ' Drop the orb Target tmrXandar.Enabled = True GrootMouth_Drop(False) ' Close Groots Mouth in case it is open bXandarReady = False XandarCount=0 bWizardMode = True bXandarDone=False WizardModePoints=0 WizardBonusPoints=0 bAddedABall=False ' Stop ballsaver if it is currently running BallSaverTimerCancel playclear pAudio ' Setup new Ball Saver EnableBallSaverForce 60 BallSaverTime = 60 ' Note: initially you get 60 seconds but watching videos something can add another 60 seconds (scoop maybe?) bBallSaverReady = True QueueScene2 "PlaySoundVol ""sfx_XandarStart"", VolSfx '", 0, 1, True QueueScene2 "StartPlayerModeVideo False '", 3000, 1, True QueueScene2 "PlaySoundVol ""gg_quote11"", VolDef '", 2000, 1, True QueueScene2 "LeftScoopExit '", 100, 1, True QueueScene2 "AddMultiball 4 - BallsOnPlayfield '", 0, 1, True ' VpmTimer.AddTimer 3000, "PlaySoundVol ""gg_quote11"", VolDef '" ' PlaySoundVol "sfx_XandarStart", VolSfx ' StartPlayerModeVideo False StackState(kStack_Pri2).Enable(-1) For each a in aRampLights ' light ramps and set value so we can track progress SSetLightColor kStack_Pri2, a, "purple", 2 'SetLightColor a, modeRampColor, 2 a.UserValue = 0 Next CheckWizardModeStart = True ScorbitBuildGameModes() End If End If End Function Sub CloseCherryMouth() Dim i if CherryBombLocks = 0 then GrootMouth_Drop(False) Else for i = 0 to CherryBombLocks-1 vpmtimer.addtimer 100*i, "CreateNewBallGroot() '" Next vpmtimer.addtimer 100*CherryBombLocks+200, "CloseCherryMouth '" CherryBombLocks=0 End if End Sub Sub CheckWizardModeProgress(trigger_name) dim a,b,i Dim bValidHit dim bFinalShot dim hitLight Dim holdScore Dim bSwitchHit if bDebounce then exit sub bSwitchHit = False ' Catch other sitches if trigger_name = "switch" or trigger_name = "sw2" or trigger_name = "sw3" or trigger_name = "sw4" or trigger_name = "sw8" or trigger_name = "sw9" or trigger_name = "sw11" or trigger_name = "sw12" then bSwitchHit=True End if if tmrCherryBomb.Enabled Then ' We are in cherry bomb mode (Should we make this its own mode?) if trigger_name = "GrootKicker" then ' Finished CherryBomb bDebounce = True vpmtimer.addtimer 400, "debounceReset '" CherryBombLocks=CherryBombLocks+1 if tmrCherryBombMouth.Enabled then ' Reset and do it again tmrCherryBombMouth.Enabled = False CherryBombCount=0 GrootMouth_Drop(True) ' Open groots mouth For each a in aRampLights ' Upgrade so All the arrows count now SSetLightColor kStack_Pri2, a, "red", 2 Next QueueScene "DoCBombComplete " & WizardModePoints * Multiplier3x * MultiplierShot * PlayMultiplier & "'", 5000, 1 QueueScene "DoCBombClear'", 0, 1 AddScore WizardModePoints for i = 0 to CherryBombLocks-1 vpmtimer.addtimer 1000 + (100*i), "CreateNewBallGroot() '" Next CherryBombLocks=0 vpmtimer.addtimer 2000, "CloseCherryMouth '" 'tmrCherryBomb.UserValue = -1 'EndCherryBomb ' Note the player mode take 8 second for all the balls to drain anyway, so modes should be finished End if exit sub end if For each a in aRampLights ' Need to hit flashing arrows and turn them solid if a.name = trigger_name and StackState(kStack_Pri2).GetArrowState(a) <> 0 then 'PlaySound "gg_RampHit" 'LightSeqScore.Play SeqUpOn, 100, 0 if StackState(kStack_Pri2).GetArrowState(a) = 2 Then ' Add Score (Is this supposed to go to a jackpot instead?) PlayProgress trigger_name DOF 128, DOFPulse AddScore 3000000 SSetLightColor kStack_Pri2, a, "red", 1 CherryBombCount=CherryBombCount+1 holdScore=3000000 ' BonusModeValue(GetBonusIndexFromMode(PlayerMode)) holdScore = holdScore * Multiplier3x * MultiplierShot * PlayMultiplier QueueFlushPriority 2 ' Clear other scores waiting QueueScene "DoAnimateScore kModeCherry, 1, " & holdScore & " '", 2000, 2 Else AddScore 1000000 ' TBD - If you hit it a third time looks like it is only 500K End If if (CherryBombCount = 9) Then ' Groot Mouth Opens and closes for final shot tmrCherryBombMouth.Interval=kMouthAnimationSpeed tmrCherryBombMouth.Enabled = True For each b in aRampLights ' Turn off all arrows except GrootArrow SSetLightColor kStack_Pri2, b, "red", 0 Next SSetLightColor kStack_Pri2, lgr_a, "red", 2 End if End If Next elseif tmrImmolation.Enabled Then ' We are in Immolation Mode if bSwitchHit Then ' Find one to spot (Left to Right) SwitchHitCount = SwitchHitCount - 1 if (SwitchHitCount <= 0) then if StackState(kStack_Pri2).GetArrowState(lYonduArrow) <> 0 then trigger_name = "lYonduArrow" elseif StackState(kStack_Pri2).GetArrowState(lRonanArrow) <> 0 then trigger_name = "lRonanArrow" elseif StackState(kStack_Pri2).GetArrowState(lRocketArrow) <> 0 then trigger_name = "lRocketArrow" elseif StackState(kStack_Pri2).GetArrowState(lNebulaArrow) <> 0 then trigger_name = "lNebulaArrow" elseif StackState(kStack_Pri2).GetArrowState(lgr_a) <> 0 then trigger_name = "lgr_a" elseif StackState(kStack_Pri2).GetArrowState(lBrokerArrow) <> 0 then trigger_name = "lBrokerArrow" elseif StackState(kStack_Pri2).GetArrowState(lGamoraArrow) <> 0 then trigger_name = "lGamoraArrow" elseif StackState(kStack_Pri2).GetArrowState(lDraxArrow) <> 0 then trigger_name = "lDraxArrow" elseif StackState(kStack_Pri2).GetArrowState(lStarLordArrow) <> 0 then trigger_name = "lStarLordArrow" End If BonusAddModeHit(GetBonusIndex(trigger_name)) ' Adds the minor points but more importantly ensures we trigger bonus at the end if SwitchHitResetCount < 4 then SwitchHitResetCount=SwitchHitResetCount+1 SwitchHitCount=50 + (20*SwitchHitResetCount) End If UpdateSwitchHitCnt SwitchHitCount Else ' This is really for debugging bDebounce = True vpmtimer.addtimer 400, "debounceReset '" End If For each a in aRampLights ' See which arrow they hit if a.name = trigger_name and StackState(kStack_Pri2).GetArrowState(a) <> 0 then bValidHit = True set hitLight=a exit for End If Next debug.print "Immolation:" & bValidHit & " " & bImmolationSJPReady if bValidHit and bImmolationSJPReady then ' Hit SJP debug.print "Immolation Complete" ' Add the Immolation Bonus first time through (TBD: Is this every time through???) bImmolationSJPReady=False PlaySoundVol "sfx_BaseHit11", VolSfx holdScore=WizardBonusPoints ' JP is Total Collected points AddScore holdScore holdScore = holdScore * Multiplier3x * MultiplierShot * PlayMultiplier DoAnimateScore kModeImmo, 2, holdScore EnableBallSaverForce 5 AddMultiball 1 ' Add a ball for completing ImmolationScoreOdd=3000000+100000 ImmolationScoreEven=6200000+200000 ' if holdScore > 1000000 then ' puPlayer.LabelSet pDMDText,"Message", holdScore / 1000000 & "M" ,1,"" ' vpmTimer.addTimer 2000, "puPlayer.LabelSet pDMDText,""Message"", """" ,1,"""" '" ' Clear it ' End If ImmolationCount=0 SetLightColor Light029, "white", 1 ' Mark Immolation as complete ' Reset lights for another round For i = 0 to 8 bImmolationProgress(i)=False Next For i = 0 to 8 if bImmolationProgress(i) = False then select case i case 0: SSetLightColor kStack_Pri2, lYonduArrow, "yellow", 2 case 1: SSetLightColor kStack_Pri2, lRonanArrow, "yellow", 2 case 2: SSetLightColor kStack_Pri2, lRocketArrow, "yellow", 2 case 3: SSetLightColor kStack_Pri2, lNebulaArrow, "yellow", 2 case 4: SSetLightColor kStack_Pri2, lgr_a, "yellow", 2 case 5: SSetLightColor kStack_Pri2, lBrokerArrow, "yellow", 2 case 6: SSetLightColor kStack_Pri2, lGamoraArrow, "yellow", 2 case 7: SSetLightColor kStack_Pri2, lDraxArrow, "yellow", 2 case 8: SSetLightColor kStack_Pri2, lStarLordArrow, "yellow", 2 End Select End If Next elseif bValidHit Then 'PlaySound "gg_RampHit" 'LightSeqScore.Play SeqUpOn, 100, 0 PlayProgress2 trigger_name, False ImmolationCount=ImmolationCount+1 if bImmolationAllMode then holdScore=ImmolationScoreOdd ImmolationScoreOdd=ImmolationScoreOdd+100000 Else holdScore=ImmolationScoreEven ImmolationScoreEven=ImmolationScoreEven+200000 End if WizardBonusPoints=WizardBonusPoints+(holdScore * Multiplier3x * MultiplierShot * PlayMultiplier) DOF 128, DOFPulse AddScore holdScore if ImmolationCount mod 4 = 0 then ' Add a ball evry 4 shots EnableBallSaverForce 5 AddMultiball 1 End If if bImmolationAllMode then ' When all the lights are on, we turn them all off and then flash the one they hit for a 2nd shot Debug.print "All Mode" For each a in aRampLights 'a.state = 0 SSetLightColor kStack_Pri2, a, "yellow", 0 Next SSetLightColor kStack_Pri2, hitLight, "yellow", 2 bImmolationAllMode=False select case hitLight.name ' Mark it so we dont light it up again case "lYonduArrow": bImmolationProgress(0)=True case "lRonanArrow": bImmolationProgress(1)=True case "lRocketArrow": bImmolationProgress(2)=True case "lNebulaArrow": bImmolationProgress(3)=True case "lgr_a": bImmolationProgress(4)=True case "lBrokerArrow": bImmolationProgress(5)=True case "lGamoraArrow": bImmolationProgress(6)=True case "lDraxArrow": bImmolationProgress(7)=True case "lStarLordArrow": bImmolationProgress(8)=True End Select PlaySoundVol "sfx_BaseHit9", VolSfx holdScore = holdScore * Multiplier3x * MultiplierShot * PlayMultiplier DoAnimateScore kModeImmo, 1, holdScore Else bImmolationAllMode=True SSetLightColor kStack_Pri2, hitLight, "yellow", 0 ' Immolation just loops forever If we got the ball just reset progress and go again (If all are true then we Reset) bValidHit = False For i = 0 to 8 if bImmolationProgress(i)=False then bValidHit=True debug.print "Immolation arrow not complete:" & i End If Next If bValidHit =False then ' No more valid hits, setup SJP bImmolationSJPReady=True SSetLightColor kStack_Pri2, lgr_a, "yellow", 2 End If PlaySoundVol "sfx_BaseHit10", VolSfx holdScore = holdScore * Multiplier3x * MultiplierShot * PlayMultiplier DoAnimateScore kModeImmo, 1, holdScore ' Reset lights based on progress For i = 0 to 8 if bImmolationProgress(i) = False then select case i case 0: SSetLightColor kStack_Pri2, lYonduArrow, "yellow", 2 case 1: SSetLightColor kStack_Pri2, lRonanArrow, "yellow", 2 case 2: SSetLightColor kStack_Pri2, lRocketArrow, "yellow", 2 case 3: SSetLightColor kStack_Pri2, lNebulaArrow, "yellow", 2 case 4: SSetLightColor kStack_Pri2, lgr_a, "yellow", 2 case 5: SSetLightColor kStack_Pri2, lBrokerArrow, "yellow", 2 case 6: SSetLightColor kStack_Pri2, lGamoraArrow, "yellow", 2 case 7: SSetLightColor kStack_Pri2, lDraxArrow, "yellow", 2 case 8: SSetLightColor kStack_Pri2, lStarLordArrow, "yellow", 2 End Select End If Next End If End If elseif tmrXandar.Enabled and bXandarDone=False Then ' We are in Xandar Mode debug.print "Xandar:" & trigger_name if trigger_name = "lStarLordArrow" and lStarLordArrow.UserValue>=4 then ' Save XANDAR Super Jackpot bXandarDone=True AddScore 100000000 * Multiplier3x * MultiplierShot * PlayMultiplier ' 100M for Xandar complete XandarCompletions=XandarCompletions+1 LightSeqXandarFinale.UserValue = 0 LightSeqXandarFinale.Play SeqUpOn, 30, 1 PlayDMDScene "Video-0x0091.wmv", 5040 ' Pink light show on DMD QueueScene "DoXandarComplete'", 5000, 1 ' Show Pink light show QueueScene "DoXandarClear'", 0, 1 QueueScene2 "ShowPlayerModeComplete(2) '", 2000, 1, True ' Show Save Xandar Total / Show Mode total QueueScene2 "EndXandar '", 1, 1, True ' End the Mode ' vpmtimer.addtimer 8200, "EndXandar '" ' End the Mode Exit sub End If For each a in aRampLights ' Need to hit flashing arrows ' if a.state=2 then set hitLight=a if a.name = trigger_name and StackState(kStack_Pri2).GetArrowState(a)>=1 then bValidHit = True set hitLight=a a.UserValue = a.UserValue+1 exit for End If Next ' No Switch hits ' if trigger_name = "switch" Then ' SwitchHitCount = SwitchHitCount - 1 ' if (SwitchHitCount <= 0) then ' if Not IsEmpty(hitLight) then ' Did we find an arrow light to mark off ' bValidHit = True ' SwitchHitCount = 100 ' End If ' End If ' End If if bValidHit Then 'PlaySound "gg_RampHit" 'LightSeqScore.Play SeqUpOn, 100, 0 PlayProgress2 trigger_name, False 'msgbox hitLight.UserValue if StackState(kStack_Pri2).GetArrowState(hitLight) = 2 Then ' Add Score (Is this supposed to go to a jackpot instead?) DOF 128, DOFPulse XandarCount=XandarCount+1 holdScore=200000 + (XandarCount*250000) AddScore holdScore SSetLightColor kStack_Pri2, hitLight, modeRampColor, 1 holdScore = holdScore * Multiplier3x * MultiplierShot * PlayMultiplier QueueFlushPriority 2 ' Clear other scores waiting if hitLight.UserValue >=3 then QueueScene "DoAnimateScore kModeXandar, " & GetModeIndex(a.name)+10 & ", " & holdScore & " '", 2000, 2 Else QueueScene "DoAnimateScore kModeXandar, " & GetModeIndex(a.name) & ", " & holdScore & " '", 2000, 2 End if elseif StackState(kStack_Pri2).GetArrowState(hitLight) = 1 Then DOF 128, DOFPulse XandarCount=XandarCount+1 holdScore=200000 + (XandarCount*250000) AddScore holdScore SSetLightColor kStack_Pri2, hitLight, modeRampColor, 2 PlaySoundVol "sfx_BaseHit13", VolSfx holdScore = holdScore * Multiplier3x * MultiplierShot * PlayMultiplier QueueFlushPriority 2 ' Clear other scores waiting QueueScene "DoAnimateScore kModeXandar, " & GetModeIndex(a.name)+10 & ", " & holdScore & " '", 2000, 2 End If if hitLight.UserValue >= 3 Then ' three hits turns it off EnableBallSaverForce 5 AddMultiball 1 ' Add a ball for completing SSetLightColor kStack_Pri2, hitLight, modeRampColor, 0 'SetLightColor hitLight, modeRampColor, 0 debug.print "Finished: " & hitLight.name & " " & hitLight.UserValue End If bFinalShot=True ' See if we got all of the arrows For each a in aRampLights if a.UserValue < 3 Then debug.print "Not Finished: " & a.name & " " & a.UserValue & " " & StackState(kStack_Pri2).GetArrowState(a) bFinalShot=False exit For End If Next if bFinalShot then ' Light Super Jackpot PlaySoundVol "gg_SuperJackpot", VolDef ' Flash StarLord lStarLordArrow.UserValue = 4 SSetLightColor kStack_Pri2, lStarLordArrow, modeRampColor, 2 'SetLightColor lStarLordArrow, modeRampColor, 2 End If End If End If End Sub Sub ShowUpgrade(thisScore) dim color:color=pupColorWhite Select case PlayerMode case kModeNebula: color=pupColorBlue case kModeRonan: color=pupColorYellow case kModeYandu: color=RGB(18, 18, 255) ' Light Blue case kModeStarLord: color=pupColorYellow case kModeDrax: color=pupColorRed case kModeRocket: color=RGB(255, 64, 0) ' Orange case kModeGamora: color=pupColorGreen case kModeBroker: color=RGB(0, 128, 128) ' cyan End Select QueueScene "SceneSetMessage ""UPGRADE"","""",""" & FormatScore(thisScore) & """, 9, """ & color & "^" & color & "^" & color & """ '", 2000, 1 QueueScene2 "SceneClearMessage '", 0, 1, True End Sub dim Mode2Percent(8) dim Mode2Progress(8) dim ModeProgress(8) dim ModePercent(8) dim bModeProgressUpgraded dim bDebounce dim bQualifyYando Sub CheckModeProgress(trigger_name) dim bValidHit dim bFinalShot dim hitLight dim a, b, i dim thisScore dim MB_Multiplier:MB_Multiplier=1 Dim bModeComplete Dim bDoubleBonus dim bSwitchHit bDoubleBonus = False bModeComplete = False bValidHit = False bSwitchHit = False if bTableDisabled or bGameInPlay=False then exit sub if bDebounce Then ' we cant hit it twice or in between resets debug.print "Debounce" exit Sub End If debug.print "Check Mode Progress " & trigger_name & " " & BallSearchCnt ' Catch other sitches if trigger_name = "switch" or trigger_name = "sw2" or trigger_name = "sw3" or trigger_name = "sw4" or trigger_name = "sw8" or trigger_name = "sw9" or trigger_name = "sw11" or trigger_name = "sw12" then bSwitchHit=True End if if BallSearchCnt > 0 then exit sub ' We are in an error mode skip doing anything ResetBallSearch if bGrootMultiball then ' Check MB Lights Debug.print "GrootMBJackpotCnt: " & GrootMBJackpotCnt & " " & GrootSJPReady For each a in aRampLights ' Need to hit flashing arrows and turn them solid if GrootSJPReady and _ (((trigger_name = "lgr_a" or trigger_name = "GrootKicker") and GrootMBJackpotCnt<=12) or _ (trigger_name = "GrootKicker" and GrootMBJackpotCnt>12)) then ' Final Groot Shot ' See if we are done with Groot MB if GrootMBJackpotCnt>=18 then bModeComplete=True if bModeComplete or tmrCherryBombMouth.Enabled Then ' Groot MB is Complete, Mark it and restart GrootMBFinished=True GrootMBJackpotCnt=0 For each b in aRampLights ' Turn then all back on and do it again i = GetModeIndex(b.name) GrootMBJackpotHits(CurrentPlayer, i) = 0 SSetLightColor kStack_Pri1, b, "green", 2 Next GrootMBLocks=0 tmrCherryBombMouth.Enabled = False GrootMouth_Drop(False) ' Close Groots Mouth 'If we got multib all then set the playfield lights SetLightColor Light030, "green", 1 ' Light Groot Multiball as done AddScore GrootMBJackpot ModePointsGroot=ModePointsGroot+GrootMBJackpot QueueFlush QueueScene "PlaySoundVol ""sfx_GrootJP1"", VolSfx '", 0, 1 QueueScene "ScenePlayMessage ""Groot-JP3.mp4"", """",""" & FormatScore(GrootMBJackpot) & """, """" '", 2000, 1 ' QueueScene2 "ShowPlayerModeComplete(0) '", 2000, 1, True ' show Groot MB total else For each b in aRampLights ' Turn then all back on and do it again i = GetModeIndex(b.name) if GrootMBJackpotHits(CurrentPlayer, i) < 3 or bIsModeComplete(i) then Debug.print "GrootMBJackpotHits(CurrentPlayer, i): " & GrootMBJackpotHits(CurrentPlayer, i) SSetLightColor kStack_Pri1, b, "green", 2 End if Next Debug.print "bModeComplete: " & bModeComplete AddScore GrootMBJackpot ModePointsGroot=ModePointsGroot+GrootMBJackpot QueueFlush QueueScene "PlaySoundVol ""sfx_GrootJP1"", VolSfx '", 0, 1 QueueScene "ScenePlayMessage ""Groot-JP1.mp4"", """",""" & FormatScore(GrootMBJackpot) & """, """" '", 2000, 1 End if bModeComplete=False GrootSJPReady=False exit sub End If Debug.print "StackState(kStack_Pri1).GetArrowState(a):" & StackState(kStack_Pri1).GetArrowState(a) & " " & GrootMBJackpotHits(CurrentPlayer, i) if GrootSJPReady=False and a.name = trigger_name and StackState(kStack_Pri1).GetArrowState(a) <> 0 then 'PlaySound "gg_RampHit" 'LightSeqScore.Play SeqUpOn, 100, 0 PlayProgress trigger_name ' Hit a target 3 times to complete i = GetModeIndex(trigger_name) GrootMBJackpotHits(CurrentPlayer, i) = GrootMBJackpotHits(CurrentPlayer, i) + 1 if (GrootMBJackpotHits(CurrentPlayer, i) = 3) then if bIsModeComplete(i)=False Then ' If Mode is complete then we dont turn off the insert SSetLightColor kStack_Pri1, a, modeRampColor, 0 End if End if ' Process score for this shot i = GetModeIndex(trigger_name) if bIsModeComplete(i) then MB_Multiplier=5 ' We get 5x multiplier if this mode is completed GrootMBJackpotCnt = GrootMBJackpotCnt + 1 if GrootMBJackpotCnt = 6 or GrootMBJackpotCnt = 12 and tmrCherryBombMouth.Enabled=False then ' SJP For each b in aRampLights ' Turn off all arrows except GrootArrow SSetLightColor kStack_Pri1, b, "green", 0 Next SSetLightColor kStack_Pri1, lgr_a, "green", 2 GrootSJPReady=True end if thisScore = ((GrootMBJackpotCnt-1) * 25000) + 300000 thisScore = thisScore * MB_Multiplier AddScore thisScore thisScore = thisScore * Multiplier3x * MultiplierShot * PlayMultiplier GrootMBJackpot = GrootMBJackpot + thisScore ModePointsGroot=ModePointsGroot+thisScore ' Is SJP Points and Mode points the same? QueueFlushPriority 2 ' Clear other scores waiting QueueScene "DoAnimateScore kModeGrootMB, 1, " & thisScore & " '", 2000, 2 ' See if we are done with Groot MB if GrootMBJackpotCnt=18 then bModeComplete=True if bModeComplete Then ' Groot MB is Complete, start double super jackpot for final shot (use cherrybomb function since it works the same) Debug.print "Start GROOT SUPER JP" StartGrootFinalShot End if bModeComplete=False ' Set this back so we dont mess up stacked modes exit for End If Next elseif bOrbMultiBall then ' FIX17: Debounce rapid jackpot hits to prevent PUP DMD race condition crash, ' but exempt the lock-3 broker arrow path (OrbMultiBallProgress=3 + hurry up active) ' so AddMultiball for the 3rd ball is never blocked by the debounce. ' FIX 2.1.2: Reduced debounce from 2500ms to 100ms - 2500ms blocked legitimate ' jackpot shots during multiball (lights blinked but shots never registered). if OrbJPDebounce = True and Not (OrbMultiBallProgress = 3 and tmrOrbHurryUp.Enabled) then Exit Sub if Not (OrbMultiBallProgress = 3 and tmrOrbHurryUp.Enabled) then OrbJPDebounce = True vpmtimer.addtimer 100, "OrbJPDebounce = False '" end if For each a in aRampLights ' Need to hit flashing arrows and turn them solid 'if a.name = trigger_name and a.state <> 0 then debug.print "ORB: " & OrbMBJackpotHits & " " & trigger_name if a.name = trigger_name and StackState(kStack_Pri1).GetArrowState(a) <> 0 then SSetLightColor kStack_Pri1, a, "purple", 0 if "lBrokerArrow" = trigger_name then if OrbMultiBallProgress = 3 and tmrOrbHurryUp.Enabled Then ' They hit it before the timer, start 3 multiball (otherwise you ony get the 2) ' if ExtraBallsAwards(CurrentPlayer) = 0 and PlayerState(CurrentPlayer).bExtraball_1=False then ' You get extra ball for first MB ' PlayerState(CurrentPlayer).bExtraball_1 = True ' AwardExtraBall ' End If 'OrbMultiBallCount=OrbMultiBallCount+1 ' Should set this unless we complete RealBallsInLock=RealBallsInLock-1 OrbHurryUpFinish OrbHurryUpValue=tmrOrbHurryUp.UserValue AddMultiball 1 ' Add 3rd Multiball ' we kick the ball with the autoplunger bAutoPlunger = True elseif OrbMBJackpotHits = 9 then ' Hit super Jackpot PlaySoundVol "gg_SuperJackpot", VolDef PlaySoundVol "sfx_OrbSJP", VolSfx DOF 128, DOFPulse AddScore tmrOrbHurryUp.UserValue OrbHurryUpFinish SetLightColor Light033, "purple", 1 ' Light Orb Multiball because we finished OrbTarget1.IsDropped = True vpmtimer.addtimer 1500, "OrbTargetReset '" vpmtimer.addtimer kOrbMagnetTime, "OrbMagnetOff '" OrbMBCompletions=OrbMBCompletions+1 if OrbMBCompletions=1 then AddMultiball 1 ' Only Add a bal lthe 1st time QueueFlush QueueScene2 "ScenePlayMessage ""ORB-JP4.mp4"", ""SUPER"",""" & FormatScore(OrbMBJackpot) & """,""JACKPOT"" '", 4620, 1, True QueueScene2 "SceneClearPlayMessage '", 0, 1, True OrbHurryUpValue=OrbHurryUpValue+1000000 OrbMBJackpot = OrbMBJackpot *2 ' Store this off so the total bonus works elseif OrbMBJackpotHits = 8 then ' ORB DoubleJackpot OrbMBJackpotHits = OrbMBJackpotHits + 1 if tmrOrbHurryUp.UserValue>1000000 then thisScore=INT(tmrOrbHurryUp.UserValue / 100000)/10 & "M" else thisScore=INT(tmrOrbHurryUp.UserValue / 100)/10 & "K" End If tmrOrbHurryUp.Interval = 5000 ' 5 second start tmrOrbHurryUp.UserValue = OrbMBJackpot ' Start with total points for mode tmrOrbHurryUp.Enabled = True puPlayer.LabelSet pDMDText,"Timer", FormatScore(tmrOrbHurryUp.UserValue) ,1,"" SSetLightColor kStack_Pri1, a, "purple", 2 PlaySoundVol "sfx_OrbSJPQ", VolSfx OrbTarget1.IsDropped = False QueueFlush QueueScene "ScenePlayMessage ""ORB-JP3.mp4"", ""JACKPOT"","""",""" & thisScore & """ '", 2572, 1 QueueScene "SceneClearPlayMessage '", 0, 1 Elseif LightShootOrb.State = 2 then 'https://www.youtube.com/watch?v=Yc3cLybc_II - 2x Jackpot Lit LightShootOrb.State = 0 OrbTarget1.IsDropped = False playmedia "ORB-2x.mp4", "PupVideos", pOverVid, "", -1, "", 1, 1 PlaySoundVol "gg_Orb2", VolSfx bOrb2xEnabled=True ' For 3 seconds VpmTimer.AddTimer 3500, "bOrb2xEnabled=False '" VpmTimer.AddTimer 2000, "PlaySoundVol ""gg_OrbReleaseBall"", VolSfx:OrbTarget1.IsDropped = True '" End if Else thisScore=OrbHurryUpValue if bOrb2xEnabled then thisScore=thisScore*2 AddScore thisScore OrbMBJackpot = OrbMBJackpot + thisScore PlayProgress trigger_name if thisScore>1000000 then thisScore=INT(thisScore / 100000)/10 & "M" else thisScore=INT(thisScore / 100)/10 & "K" End If ' Show PupVideo QueueScene "ScenePlayMessage ""ORB-JP1.mp4"", ""JACKPOT"","""",""" & thisScore & """ '", 2082, 1 QueueScene "SceneClearPlayMessage '", 0, 1 i = GetModeIndex(trigger_name) OrbMBJackpotHits = OrbMBJackpotHits + 1 Debug.print "Orb Jackpot for " & trigger_name & ":" & OrbMBJackpotHits ' TBD: Add a timer for 3 seonds of 2x if (OrbMBJackpotHits = 8) Then ' After you get them all light Double Jackpot OrbTarget2.IsDropped = False For each b in aRampLights ' Turn off all arrows except BrokerArrow SSetLightColor kStack_Pri1, b, "purple", 0 Next SSetLightColor kStack_Pri1, lBrokerArrow, "purple", 1 PlaySoundVol "say-SuperJackpotIsLit", VolDef End if End If exit for End If Next End if ' if trigger_name = "lStarLordArrow" and _ ' (bCherryBombReady or bImmolationReady or bXandarReady) Then ' Stop modes and go into Wizard mode ' bSkipWaitVideo = True ' Dont go into wait because we are just going to start up another mode ' StopPlayerMode ' StopPlayerMode2 ' PlayerMode = -1 ' bSkipWaitVideo = False ' End if if CheckWizardModeStart(trigger_name) then Exit Sub ' Wizard Modes Stack so we check here, bail out when we Start CheckWizardModeProgress(trigger_name) debug.print "Check progress 2nd: " & bSecondMode & " " & PlayerMode & " " & trigger_name if (bSecondMode) Then if trigger_name = "lStarLordArrow" and bMultiBallMode=False Then ' scoop hit CheckModeProgress2nd(trigger_name) StopPlayerMode2 Else CheckModeProgress2nd(trigger_name) End If else if PlayerMode <> -1 Then debug.print "Mode Progress: " & ModePercent(PlayerMode) if ModePercent(PlayerMode) >= 100 then debug.print "Skip Score: " & ModePercent(PlayerMode) Exit Sub End If End If Select Case PlayerMode case -1:' No Mode Selected Case 0: ' Nebula - Pod Chase (10 shots) 'MsgBox trigger_name if trigger_name = "lStarLordArrow" and bModeProgressUpgraded=False Then ' scoop hit - perform upgrade AddScore 500000 ShowUpgrade 500000 PlaySoundVol "gg_lazer", VolSfx For each a in aRampLights ' Upgrade so All the arrows count now SSetLightColor kStack_Pri0, a, modeRampColor, 1 Next setUpgradeLight(False) 'flshUpgrade.TimerEnabled = False bModeProgressUpgraded=True SetLightColor lNebulaName, "blue", 2 else For each a in aRampLights if a.name = trigger_name and StackState(kStack_Pri0).GetArrowState(a) <> 0 then bDebounce = True ' So the ball doesnt roll over twice before we reset vpmtimer.addtimer 400, "debounceReset '" 'PlaySound "gg_RampHit" ' Play sounds and reset the timer to reset the lights 'LightSeqScore.Play SeqUpOn, 100, 0 PlayProgress2 trigger_name, False PlaySoundVol "sfx_BaseHit5", VolSfx BonusAddMode -1, StackState(kStack_Pri0).GetArrowState(a) = 2 thisScore=BonusModeValue(GetBonusIndexFromMode(PlayerMode)) thisScore = thisScore * Multiplier3x * MultiplierShot * PlayMultiplier QueueFlushPriority 2 ' Clear other scores waiting QueueScene "DoAnimateScore kModeNebula, 1, " & thisScore & " '", 2000, 2 ModeProgress(PlayerMode) = ModeProgress(PlayerMode)+1 ModePercent(PlayerMode) = CINT((ModeProgress(PlayerMode) / 10) * 100) RefreshPlayerMode 'puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress10-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':24,'yalign':0,'ypos':4.5,'xpos':0,'pagenum':1}" if (ModeProgress(PlayerMode) = 10) Then ModePercent(PlayerMode) = 100 bModeComplete = True End If end if Next end if Case 1: ' Ronan - Sanctuary (5 shots) if trigger_name = "lStarLordArrow" and bModeProgressUpgraded=False Then ' scoop hit - perform upgrade ' lRonanArrow spots shots ShowUpgrade 500000 setUpgradeLight(False) 'flshUpgrade.TimerEnabled = True bModeProgressUpgraded=True SetLightColor lRonanName, "yellow", 2 if lHadron0.state=1 then lHadron0.state=2 if lHadron1.state=1 then lHadron1.state=2 if lHadron2.state=1 then lHadron2.state=2 if lHadron3.state=1 then lHadron3.state=2 if lHadron4.state=1 then lHadron4.state=2 elseif trigger_name = "sw8" or trigger_name="sw9" then LoopGateLeft.Open = True ' Gates are open for a full orbit shots Gate002.Open = True Else if ((trigger_name = "tgHadron0") or (trigger_name = "tgHadron1") or (trigger_name = "tgHadron2") or _ (trigger_name = "tgHadron3") or (trigger_name = "tgHadron4")) or _ (trigger_name = "lRonanArrow") Then ' We are going up the ramp if trigger_name = "lRonanArrow" then if StackState(0).GetArrowState(lRonanArrow) = 2 then bDoubleBonus=True if bModeProgressUpgraded or bCompetitionMode=False then ' No Competition mode you dont need to upgrade bValidHit = true if tgHadron0.UserValue = False Then ' Spot a target for them (if there is one - there should be) tgHadron0.UserValue=1 lHadron0.UserValue=1 lHadron0.state = 2 elseif tgHadron1.UserValue = False Then tgHadron1.UserValue=1 lHadron1.UserValue=1 lHadron1.state = 2 elseif tgHadron2.UserValue = False Then tgHadron2.UserValue=1 lHadron2.UserValue=1 lHadron2.state = 2 elseif tgHadron3.UserValue = False Then tgHadron3.UserValue=1 lHadron3.UserValue=1 lHadron3.state = 2 elseif tgHadron4.UserValue = False Then tgHadron4.UserValue=1 lHadron4.UserValue=1 lHadron4.state = 2 End If CheckCount() ' Update that are state 2 when we spot a shot End if Elseif ModeProgress(PlayerMode)<5 then if bModeProgressUpgraded then bDoubleBonus=True bValidHit = True End if if bValidHit then BonusAddMode -1, bDoubleBonus 'PlaySound "gg_RampHit" 'LightSeqScore.Play SeqUpOn, 100, 0 ' Play sounds and reset the timer to reset the lights thisScore=BonusModeValue(GetBonusIndexFromMode(PlayerMode)) thisScore = thisScore * Multiplier3x * MultiplierShot * PlayMultiplier QueueFlushPriority 2 ' Clear other scores waiting QueueScene "DoAnimateScore kModeRonan, 1, " & thisScore & " '", 2000, 2 PlaySoundVol "sfx_BaseHit" & (ModeProgress(PlayerMode) Mod 2)+1, VolSfx PlayProgress2 trigger_name, False ModeProgress(PlayerMode) = ModeProgress(PlayerMode)+1 ModePercent(PlayerMode) = CINT((ModeProgress(PlayerMode) / 5) * 100) RefreshPlayerMode ' puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress5-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':24,'yalign':0,'ypos':4.5,'xpos':0,'pagenum':1}" if (ModeProgress(PlayerMode) = 5) Then CheckCount() ModePercent(PlayerMode) = 100 bModeComplete = True End If End If end if End If Case 2: ' Yondu - Yaka Arrow (8 shots) ' Scoop makes light blink for more points ??? if trigger_name = "lStarLordArrow" and bModeProgressUpgraded=False Then ' scoop hit - perform upgrade AddScore 500000 ShowUpgrade 500000 setUpgradeLight(False) PlaySoundVol "gg_lazer", VolSfx SSetLightColor kStack_Pri0, lRonanArrow, modeRampColor, 2 For each a in aRampLights ' Upgrade to blinking if StackState(kStack_Pri0).GetArrowState(a) <> 0 then SSetLightColor kStack_Pri0, a, modeRampColor, 2 End If Next SetLightColor lYonduName, "blue-light", 2 bModeProgressUpgraded=True bValidHit=True else if trigger_name = "GrootKicker" then ' When Groot mouth closes then light Groot Arrow back up SSetLightColor kStack_Pri0, lgr_a, modeRampColor, 1 End If if trigger_name = "lYonduArrow" then PlaySoundVol "say-AboballyBo", VolDef End If if trigger_name = "sw8" or trigger_name = "sw9" or trigger_name = "sw2" or trigger_name = "sw3" or trigger_name = "sw4" then bQualifyYando=True End If 'debug.print "Yondu " & trigger_name & " " & LastSwitchHit if trigger_name = "bumper" and bQualifyYando then ' (LastSwitchHit = "sw8" or LastSwitchHit = "sw9") then ' Spot a shot 'bDebounce=True bQualifyYando=False if YakaPops>0 then ' After completing it spots a shots and lights one on the PF LastSwitchHit="" YakaPops = YakaPops -1 dim newState:newState=1 if bModeProgressUpgraded then newState=2 ' Add Flashing if we upgraded Select case YakaPops case 3 SSetLightColor kStack_Pri0, lRonanArrow, modeRampColor, newState case 2 SSetLightColor kStack_Pri0, lDraxArrow, modeRampColor, newState case 1 SSetLightColor kStack_Pri0, lGamoraArrow, modeRampColor, newState case 0 SSetLightColor kStack_Pri0, lBrokerArrow, modeRampColor, newState End Select bValidHit = True End if UpdateHitCntMsg "Pops Remaining: ", YakaPops 'PupDisplay "Pops Remaining " & YakaPops end if if (bModeProgressUpgraded) and (trigger_name = "tgHadron0" or trigger_name="tgHadron1") then ' Upgrade allows left hadrons to spot shots bValidHit = True else For each a in aRampLights if a.name = trigger_name then debug.print "Yondu Arrow: " & trigger_name & " State:" & StackState(kStack_Pri0).GetArrowState(a) if a.name = trigger_name and StackState(kStack_Pri0).GetArrowState(a) <> 0 Then ' Hit Ramp that was lit bValidHit=True if StackState(kStack_Pri0).GetArrowState(a) = 2 then bDoubleBonus=True if trigger_name <> "lYonduArrow" then SSetLightColor kStack_Pri0, a, modeRampColor, 0 'StackState(kStack_Pri0).SetArrowState a, 0 End If Next End If End if if bValidHit then debug.print "HIT " & trigger_name 'PlaySound "gg_RampHit" 'LightSeqScore.Play SeqUpOn, 100, 0 ' Play sounds and reset the timer to reset the lights PlayProgress2 trigger_name, False BonusAddMode -1, bDoubleBonus PlaySoundVol "sfx_Arrow1", VolSfx thisScore=BonusModeValue(GetBonusIndexFromMode(PlayerMode)) thisScore = thisScore * Multiplier3x * MultiplierShot * PlayMultiplier QueueFlushPriority 2 ' Clear other scores waiting QueueScene "DoAnimateScore kModeYandu, 1, " & thisScore & " '", 2000, 2 ModeProgress(PlayerMode) = ModeProgress(PlayerMode)+1 ModePercent(PlayerMode) = CINT((ModeProgress(PlayerMode) / 8) * 100) RefreshPlayerMode ' puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress8-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':24,'yalign':0,'ypos':4.5,'xpos':0,'pagenum':1}" if (ModeProgress(PlayerMode) = 8) Then ModePercent(PlayerMode) = 100 bModeComplete = True End If End If Case 3: ' Star Lord - Quills Quest (12 shots) if bSwitchHit and HurryUpCount=0 then ' 1st switch start the hurry up StartHurryUpQQ End if if trigger_name = "lStarLordArrow" and bModeProgressUpgraded = False Then ' scoop hit - perform upgrade ShowUpgrade 500000 setUpgradeLight(False) 'flshUpgrade.TimerEnabled = False bModeProgressUpgraded=True 'PlaySound "gg_RampHit" 'LightSeqScore.Play SeqUpOn, 100, 0 PlayProgress trigger_name ' Give Progress ModeProgress(PlayerMode) = ModeProgress(PlayerMode)+1 ModePercent(PlayerMode) = CINT((ModeProgress(PlayerMode) / 12) * 100) RefreshPlayerMode if (ModeProgress(PlayerMode) = 12) Then ModePercent(PlayerMode) = 100 bModeComplete = True ' vpmtimer.addtimer 3000, "QuillsQuestBonus '" ' Start timer to hit scoop again and get bonus End If QuestLight2 trigger_name if ModePercent(PlayerMode) > 100 then ModePercent(PlayerMode) = 100 End If thisScore=tmrHurryUp.UserValue thisScore = thisScore * Multiplier3x * MultiplierShot * PlayMultiplier QueueFlushPriority 2 ' Clear other scores waiting QueueScene "DoAnimateScore kModeStarLord, 1, " & thisScore & " '", 2000, 2 HurryUpAddBonus 2000000, 250000, 5000 SetLightColor lStarLordName, "orange", 2 else For each a in aRampLights if a.name = trigger_name then debug.print "Arrow State: " & StackState(kStack_Pri0).GetArrowState(a) if a.name = trigger_name and StackState(kStack_Pri0).GetArrowState(a) <> 0 Then ' Hit Ramp that was lit bDebounce = True ' so the ball doesnt roll over twice before we reset vpmtimer.addtimer 400, "debounceReset '" 'PlaySound "gg_RampHit" 'LightSeqScore.Play SeqUpOn, 100, 0 ' Play sounds and reset the timer to reset the lights PlayProgress trigger_name ' tmrQuestRamps.Enabled = False ' This will kick the debounce and reset the lights to another area ' tmrQuestRamps.Interval = 1000 ' tmrQuestRamps.Enabled = True ' Capture the Hurry Up Points if trigger_name="lStarLordArrow" or trigger_name="lDraxArrow" then i = 1 elseif trigger_name="lGamoraArrow" then i = 2 else i = 3 End if thisScore=tmrHurryUp.UserValue thisScore = thisScore * Multiplier3x * MultiplierShot * PlayMultiplier QueueFlushPriority 2 ' Clear other scores waiting QueueScene "DoAnimateScore kModeStarLord, " & i & ", " & thisScore & " '", 2000, 2 HurryUpAddBonus 2000000, 250000, 5000 ModeProgress(PlayerMode) = ModeProgress(PlayerMode)+1 ModePercent(PlayerMode) = CINT((ModeProgress(PlayerMode) / 12) * 100) RefreshPlayerMode 'puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress12-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':24,'yalign':0,'ypos':4.5,'xpos':0,'pagenum':1}" if (ModeProgress(PlayerMode) = 12) Then ModePercent(PlayerMode) = 100 bModeComplete = True ' vpmtimer.addtimer 3000, "QuillsQuestBonus '" ' Start timer to hit scoop again and get bonus End If QuestLight2 trigger_name if ModePercent(PlayerMode) > 100 then ModePercent(PlayerMode) = 100 End If end if Next End If Case 4: ' Drax - Knowhere (8 shots) if trigger_name = "lStarLordArrow" and bModeProgressUpgraded=False Then ' scoop hit - perform upgrade AddScore 500000 ShowUpgrade 500000 setUpgradeLight(False) PlaySoundVol "gg_lazer", VolSfx For each a in aRampLights ' Upgrade so All the arrows if StackState(kStack_Pri0).GetArrowState(a) <> 2 then ' Drax and Ronan start out blinking so dont downgrade SSetLightColor kStack_Pri0, a, modeRampColor, 1 End If Next 'flshUpgrade.TimerEnabled = False bModeProgressUpgraded=True SetLightColor lDraxName, "amber", 2 else For each a in aRampLights if a.name = trigger_name and StackState(kStack_Pri0).GetArrowState(a) <> 0 Then ' Hit Ramp that was lit PlaySoundVol "sfx_BaseHit1", VolSfx PlayProgress2 trigger_name, False if bCompetitionMode then ' Real game didnt do this For each b in aRampLights ' Turn off the upgrade for all but the primary arrows if b.name <> "lRonanArrow" and b.name <> "lDraxArrow" then SSetLightColor kStack_Pri0, b, modeRampColor, 0 End if Next Elseif StackState(kStack_Pri0).GetArrowState(a) = 1 then ' Drax and Ronan start out blinking so they wont clear SSetLightColor kStack_Pri0, a, modeRampColor, 0 End if ModeProgress(PlayerMode) = ModeProgress(PlayerMode)+1 ModePercent(PlayerMode) = CINT((ModeProgress(PlayerMode) / 8) * 100) RefreshPlayerMode 'puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress8r-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':24,'yalign':0,'ypos':4.5,'xpos':0,'pagenum':1}" BonusAddMode -1, StackState(kStack_Pri0).GetArrowState(a) = 2 thisScore=BonusModeValue(GetBonusIndexFromMode(PlayerMode)) thisScore = thisScore * Multiplier3x * MultiplierShot * PlayMultiplier QueueFlushPriority 2 ' Clear other scores waiting QueueScene "DoAnimateScore kModeDrax, 1, " & thisScore & " '", 2000, 2 if (ModeProgress(PlayerMode) >= 8) Then ModePercent(PlayerMode) = 100 bModeComplete = True End If End If Next End If Case 5: ' Rocket - Escape Kyln (7 shots, Hadron Enforcer works on all except Rocket) if trigger_name = "lStarLordArrow" and bModeProgressUpgraded=False Then ' scoop hit - 500K Bonus AddScore 500000 bModeProgressUpgraded=True ShowUpgrade 500000 setUpgradeLight(False) SetLightColor lRocketName, "red", 2 End If ' debug.print "KYLN Trigger:" & trigger_name & " 2val:" & PlayerState(CurrentPlayer).lNovaStatesKyln(0) & " " & ModeProgress(PlayerMode) ' debug.print "KYLN Trigger:" & trigger_name & " 3val:" & PlayerState(CurrentPlayer).lNovaStatesKyln(1) ' debug.print "KYLN Trigger:" & trigger_name & " 4val:" & PlayerState(CurrentPlayer).lNovaStatesKyln(2) ' debug.print "KYLN Trigger:" & trigger_name & " 8val:" & PlayerState(CurrentPlayer).lNovaStatesKyln(3) ' debug.print "KYLN Trigger:" & trigger_name & " 9val:" & PlayerState(CurrentPlayer).lNovaStatesKyln(4) ' if (trigger_name <> "lRocketArrow" and ModeProgress(PlayerMode) = 6) Then ' ' Not Rocket ' exit sub ' Rocket must be the last shot ' else if (trigger_name = "lRocketArrow" and ModeProgress(PlayerMode) = 6) Then bValidHit = True elseif (trigger_name = "lRocketArrow1" and ModeProgress(PlayerMode) = 5) Then ' Special quirk in the real code trigger_name="lRocketArrow" bValidHit = True Elseif trigger_name = "lRocketArrow" Then ' Spot a shot (If It isnt the last one) for i = 0 to 4 if PlayerState(CurrentPlayer).lNovaStatesKyln(i) = 2 then bValidHit = True PlayerState(CurrentPlayer).lNovaStatesKyln(i) = 0 exit for End If Next if bValidHit=False and StackState(kStack_Pri0).GetArrowState(lgr_a) <> 0 Then ' Spot Groot if others are done SSetLightColor kStack_Pri0, lgr_a, modeRampColor, 0 bValidHit = True End if End If if trigger_name = "sw2" and PlayerState(CurrentPlayer).lNovaStatesKyln(0) = 2 then PlayerState(CurrentPlayer).lNovaStatesKyln(0) = 0:bValidHit = True if trigger_name = "sw3" and PlayerState(CurrentPlayer).lNovaStatesKyln(1) = 2 then PlayerState(CurrentPlayer).lNovaStatesKyln(1) = 0:bValidHit = True if trigger_name = "sw4" and PlayerState(CurrentPlayer).lNovaStatesKyln(2) = 2 then PlayerState(CurrentPlayer).lNovaStatesKyln(2) = 0:bValidHit = True if trigger_name = "sw8" and PlayerState(CurrentPlayer).lNovaStatesKyln(3) = 2 then PlayerState(CurrentPlayer).lNovaStatesKyln(3) = 0:bValidHit = True if trigger_name = "sw9" and PlayerState(CurrentPlayer).lNovaStatesKyln(4) = 2 then PlayerState(CurrentPlayer).lNovaStatesKyln(4) = 0:bValidHit = True if trigger_name = "lgr_a" and StackState(kStack_Pri0).GetArrowState(lgr_a) <> 0 Then bValidHit = True if trigger_name = "lgr_a" then SSetLightColor kStack_Pri0, lgr_a, modeRampColor, 0 if bValidHit Then SetLightColor lNova_sw2, modeRampColor, PlayerState(CurrentPlayer).lNovaStatesKyln(0) SetLightColor lNova_sw3, modeRampColor, PlayerState(CurrentPlayer).lNovaStatesKyln(1) SetLightColor lNova_sw4, modeRampColor, PlayerState(CurrentPlayer).lNovaStatesKyln(2) SetLightColor lNova_sw8, modeRampColor, PlayerState(CurrentPlayer).lNovaStatesKyln(3) SetLightColor lNova_sw9, modeRampColor, PlayerState(CurrentPlayer).lNovaStatesKyln(4) 'PlaySound "gg_RampHit" 'LightSeqScore.Play SeqUpOn, 100, 0 ' Play sounds PlayProgress trigger_name ModeProgress(PlayerMode) = ModeProgress(PlayerMode)+1 ModePercent(PlayerMode) = CINT((ModeProgress(PlayerMode) / 7) * 100) RefreshPlayerMode 'puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress7-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':24,'yalign':0,'ypos':4.5,'xpos':0,'pagenum':1}" BonusAddMode -1, bDoubleBonus thisScore=BonusModeValue(GetBonusIndexFromMode(PlayerMode)) thisScore = thisScore * Multiplier3x * MultiplierShot * PlayMultiplier QueueFlushPriority 2 ' Clear other scores waiting if (ModeProgress(PlayerMode) >= 7) then QueueScene "DoAnimateScore kModeRocket, 2, " & thisScore & " '", 2000, 2 Else QueueScene "DoAnimateScore kModeRocket, 1, " & thisScore & " '", 2000, 2 End if if (ModeProgress(PlayerMode) >= 7) Then ModePercent(PlayerMode) = 100 bModeComplete = True End If End If Case 6: ' Gamora - Sibling Rivalry (8 shots) if trigger_name = "lStarLordArrow" and bModeProgressUpgraded=False Then ' scoop hit - perform upgrade AddScore 500000 ShowUpgrade 500000 setUpgradeLight(False) PlaySoundVol "gg_lazer", VolSfx bModeProgressUpgraded = True '' Upgrade Toggles all Left and All right when lit SSetLightColor kStack_Pri0, lNebulaArrow, modeRampColor, 0 SSetLightColor kStack_Pri0, lBrokerArrow, modeRampColor, 1 SSetLightColor kStack_Pri0, lGamoraArrow, modeRampColor, 2 SSetLightColor kStack_Pri0, lDraxArrow, modeRampColor, 1 SSetLightColor kStack_Pri0, lStarLordArrow, modeRampColor, 1 bModeProgressUpgraded=True SetLightColor lGamoraName, "green", 2 else For each a in aRampLights if a.name = trigger_name and StackState(kStack_Pri0).GetArrowState(a) <> 0 Then ' Hit Ramp that was lit 'PlaySound "gg_RampHit" 'LightSeqScore.Play SeqUpOn, 100, 0 ' Play sounds PlayProgress2 trigger_name, False BonusAddMode -1, StackState(kStack_Pri0).GetArrowState(a) =2 PlaySoundVol "sfx_BaseHit7", VolSfx thisScore=BonusModeValue(GetBonusIndexFromMode(PlayerMode)) thisScore = thisScore * Multiplier3x * MultiplierShot * PlayMultiplier QueueFlushPriority 2 ' Clear other scores waiting QueueScene "DoAnimateScore kModeGamora, 1, " & thisScore & " '", 2000, 2 if (bModeProgressUpgraded) then ' Toggle Left and Right if (StackState(kStack_Pri0).GetArrowState(lGamoraArrow) <> 0) then SSetLightColor kStack_Pri0, lYonduArrow, modeRampColor, 1 SSetLightColor kStack_Pri0, lNebulaArrow, modeRampColor, 2 SSetLightColor kStack_Pri0, lRocketArrow, modeRampColor, 1 SSetLightColor kStack_Pri0, lRonanArrow, modeRampColor, 1 SSetLightColor kStack_Pri0, lBrokerArrow, modeRampColor, 0 SSetLightColor kStack_Pri0, lGamoraArrow, modeRampColor, 0 SSetLightColor kStack_Pri0, lDraxArrow, modeRampColor, 0 SSetLightColor kStack_Pri0, lStarLordArrow, modeRampColor, 0 else SSetLightColor kStack_Pri0, lYonduArrow, modeRampColor, 0 SSetLightColor kStack_Pri0, lNebulaArrow, modeRampColor, 0 SSetLightColor kStack_Pri0, lRocketArrow, modeRampColor, 0 SSetLightColor kStack_Pri0, lRonanArrow, modeRampColor, 0 SSetLightColor kStack_Pri0, lBrokerArrow, modeRampColor, 1 SSetLightColor kStack_Pri0, lGamoraArrow, modeRampColor, 2 SSetLightColor kStack_Pri0, lDraxArrow, modeRampColor, 1 SSetLightColor kStack_Pri0, lStarLordArrow, modeRampColor, 1 End If End If ModeProgress(PlayerMode) = ModeProgress(PlayerMode)+1 ModePercent(PlayerMode) = CINT((ModeProgress(PlayerMode) / 8) * 100) RefreshPlayerMode 'puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress8g-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':24,'yalign':0,'ypos':4.5,'xpos':0,'pagenum':1}" if (ModeProgress(PlayerMode) >= 8) Then ModePercent(PlayerMode) = 100 bModeComplete = True ModePointsSave=ModePoints ' Save this off the 2nd mode bonus End If End If Next End If Case 7: ' Broker - Antique Shop (7 shots) if trigger_name = "lStarLordArrow" and bModeProgressUpgraded=False Then ' scoop hit - perform upgrade AddScore 500000 ShowUpgrade 500000 bModeProgressUpgraded = True setUpgradeLight(False) End if if trigger_name = "lBrokerArrow" then ' Broker is always lit bValidHit = True elseif trigger_name = "lNebulaArrow" and StackState(kStack_Pri0).GetArrowState(lNebulaArrow) <> 0 then if ModeProgress(PlayerMode) < 3 then SSetLightColor kStack_Pri0, lGamoraArrow, modeRampColor, 1 SSetLightColor kStack_Pri0, lNebulaArrow, modeRampColor, 0 Else SSetLightColor kStack_Pri0, lDraxArrow, modeRampColor, 1 SSetLightColor kStack_Pri0, lNebulaArrow, modeRampColor, 0 End If bValidHit = True elseif trigger_name = "lGamoraArrow" and StackState(kStack_Pri0).GetArrowState(lGamoraArrow) <> 0 then SSetLightColor kStack_Pri0, lGamoraArrow, modeRampColor, 0 SSetLightColor kStack_Pri0, lNebulaArrow, modeRampColor, 1 bValidHit = True elseif trigger_name = "lDraxArrow" and StackState(kStack_Pri0).GetArrowState(lDraxArrow) <> 0 then SSetLightColor kStack_Pri0, lDraxArrow, modeRampColor, 0 SSetLightColor kStack_Pri0, lStarLordArrow, modeRampColor, 1 bValidHit = True elseif trigger_name = "lStarLordArrow" and StackState(kStack_Pri0).GetArrowState(lStarLordArrow) <> 0 then SetLightColor lBrokerName, "cyan", 1 SSetLightColor kStack_Pri0, lRonanArrow, modeRampColor, 1 bValidHit = True ' These are all the switch hits elseif bSwitchHit or _ (trigger_name = "tgHadron0") or (trigger_name = "tgHadron1") or (trigger_name = "tgHadron2") or _ (trigger_name = "tgHadron3") or (trigger_name = "tgHadron4") then BonusAddModeHit(GetBonusIndex("lBrokerArrow")) ' Adds minor score, but more importantly ensures we trigger bonus calculation at the end SwitchHitCount = SwitchHitCount - 1 if (SwitchHitCount <= 0) then bValidHit = True SwitchHitCount = 20 End If UpdateHitCntMsg "SWITCH HITS REMAINING: ", SwitchHitCount End If if (bValidHit = True) Then 'PlaySound "gg_RampHit" 'LightSeqScore.Play SeqUpOn, 100, 0 ' Play sounds and reset the timer to reset the lights BonusAddMode -1, bDoubleBonus thisScore=BonusModeValue(GetBonusIndexFromMode(PlayerMode)) thisScore = thisScore * Multiplier3x * MultiplierShot * PlayMultiplier QueueFlushPriority 2 ' Clear other scores waiting QueueScene "DoAnimateScore kModeBroker, 1, " & thisScore & " '", 2000, 2 PlayProgress trigger_name ModeProgress(PlayerMode) = ModeProgress(PlayerMode)+1 ModePercent(PlayerMode) = CINT((ModeProgress(PlayerMode) / 7) * 100) RefreshPlayerMode 'puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress7t-"&ModeProgress(PlayerMode)&".png",1,"{'mt':2,'color':111111,'width':17, 'height':24,'yalign':0,'ypos':4.5,'xpos':0,'pagenum':1}" if (ModeProgress(PlayerMode) >= 7) Then ModePercent(PlayerMode) = 100 bModeComplete = True End If End If End Select ' Check if we are 50% through the current level. Show Immolation Progress if PlayerMode <> -1 then if ModePercent(PlayerMode) >= 50 and bIModeComplete=False Then ' Just show this once DMD "Immolation", CL(0, "Progress"), "", eNone, eNone, eNone, 2000, False, "" 'pDMDEvent(kDMD_ImmProgress) 'DoImmolationI QueueScene "DoImmolationI PlayerMode '", 6000, 1 QueueScene2 "DoImmolationIClear '", 0, 1, True SetModeLights bIModeComplete=True End if End If if bModeComplete Then UpdateSwitchHitCnt 0 PlaySoundVol "ModeComplete", VolSfx ModeCountdownTimer.Enabled = False ' Stop the countdown immediatly ShowPlayerModeComplete(-1) ' Show Mode total 'Finished the level bSecondMode = True StopPlayerMode ' QueueScene "StopPlayerMode '", 1, 1 ' Queue this to catch last scene 'vpmtimer.addtimer 9000, "bSecondMode = True:StopPlayerMode '" ' Start the second mode and stop this mode after the Mode complete clip finishes End If End If CheckHadron False ' See if we can use the Hadrons, If so light the light End Sub Sub StartQQFinalHurryup() Debug.print "StartQQFinalHurryup:" HurryUpFinish tmrHurryUp.UserValue=INT(Score(CurrentPlayer) / 100) * 10 ' 10% (0.10) of score (rounded) bQuillsQuestBonusWait=True puPlayer.LabelSet pDMDText,"Timer", FormatScore(tmrHurryUp.UserValue) ,1,"" tmrHurryUp.Interval=8000 HurryUpStart End Sub Sub CollectQQFinalHurryUp() Debug.print "CollectQQFinalHurryUp:" & bQuillsQuestBonusWait bQuillsQuestBonusWait=False PlaySoundVol "Boom-4", VolSfx ModePointsSave=tmrHurryUp.UserValue HurryUpFinish BonusAddMode ModePointsSave, False QueueScene2 "DoAnimateScore kModeStarLord, 1, " & ModePointsSave * Multiplier3x * MultiplierShot * PlayMultiplier & " '", 2000, 1, True AddScore ModePointsSave End Sub Sub DoXandarComplete dim multiplierVal multiplierVal = Multiplier3x * MultiplierShot * PlayMultiplier vpmTimer.AddTimer 1000, "PlaySoundVol ""vo_GOTG_Finish"" & INT(RND*4)+1, VolSfx '" PlaySoundVol "sfx_XandarFinish", VolSfx ScenePlayMessage2 "Video-0x0091.mp4", "SUPER", FormatScore(100000000*multiplierVal) ,"JACKPOT", 4 ' playmedia "Video-0x0091.mp4", "PupVideos", pOverVid, "", -1, "", 1, 1 End Sub Sub DoXandarClear SceneClearPlayMessage ' puPlayer.LabelSet pDMDText,"Message", "" ,1,"" ' playclear pOverVid End Sub Sub DoCBombComplete(score) ScenePlayMessage2 "Video-0x00B1.mp4", "SUPER", FormatScore(score) ,"JACKPOT", 4 ' playmedia "Video-0x00B1.mp4", "PupVideos", pOverVid, "", -1, "", 1, 1 End Sub Sub DoCBombClear SceneClearPlayMessage ' playclear pOverVid End Sub Sub HideProgress(bValue) if bValue Then bSetBackglassTimer_Hide=True puPlayer.LabelSet pDMDText, "ModeProgress", "",0,"" puPlayer.LabelSet pDMDText,"TimeLbl", "Timer" ,0,"" puPlayer.LabelSet pDMDText,"Time", "" ,0,"" Else bSetBackglassTimer_Hide=False RefreshPlayerMode puPlayer.LabelSet pDMDText,"TimeLbl", "Timer" ,1,"" End if End Sub Sub tmrImolationAnim_Timer() puPlayer.LabelSet pUnderVid,"PFace", "PuPOverlays\\ModeSel" & DoImmolationI_Mode & ".png" ,1,"{'mt':2,'height':"& 24*tmrImolationAnim.UserValue &", 'width':" & 12*tmrImolationAnim.UserValue & ",'xpos':49,'ypos':58}" puPlayer.LabelSet pUnderVid,"PFaceCircle", "PuPOverlays\\ModeSelR" & DoImmolationI_Mode & ".png" ,1,"{'mt':2,'height':"& 28*tmrImolationAnim.UserValue &", 'width':" & 16*tmrImolationAnim.UserValue & ",'xpos':49,'ypos':58}" 'Debug.print "TMRHeight:" & 24*tmrImolationAnim.UserValue tmrImolationAnim.UserValue=tmrImolationAnim.UserValue-0.09 if tmrImolationAnim.UserValue <=1 then tmrImolationAnim.Enabled = False End if End Sub Dim DoImmolationI_Mode:DoImmolationI_Mode=-1 Sub DoImmolationI(Mode) ' Add Overlay to video ' ffmpeg -i Video-0x00A1.mp4 -i ImmolationProgress.png -filter_complex "[1:v]scale=1360:768 [ovrl],[0:v][ovrl]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -strict -2 ./output.mp4 ' FIX 2.1.2: Guard against Invalid pointer operation crash. DoImmolationI can be queued ' via QueueScene at the 50% mode progress point (e.g. mid-Quill's Quest) and fire after ' the ball drains, at which point PUP has already begun tearing down its VLC form instances. ' Calling playUnderMedia or LabelSet into freed forms causes "Invalid pointer operation". If NOT bPupStarted Then Exit Sub Dim Text dim c0,c1,c2,c3,c4,c5,c6,c7,cOrb,cGroot DoImmolationI_Mode=Mode HideProgress True pDMDEvent(kDMD_PlayerMode2) ' Remove Display PlaySoundVol "gg_Immolation50", VolSfx if ModePercent(0)<50 then c0=8618883 else c0=16777215 if ModePercent(1)<50 then c1=8618883 else c1=16777215 if ModePercent(2)<50 then c2=8618883 else c2=16777215 if ModePercent(3)<50 then c3=8618883 else c3=16777215 if ModePercent(4)<50 then c4=8618883 else c4=16777215 if ModePercent(5)<50 then c5=8618883 else c5=16777215 if ModePercent(6)<50 then c6=8618883 else c6=16777215 if ModePercent(7)<50 then c7=8618883 else c7=16777215 if Light033.state=0 then cOrb=8618883 else cOrb=16777215 if Light030.state=0 then cGroot=8618883 else cGroot=16777215 playUnderMedia "PupVideos", "Video-0x00A1b.mp4", pUnderVid, -1 ' playmedia "Video-0x00A1b.mp4", "PupVideos", pOverVid, "", -1, "", 1, 1 PuPlayer.LabelShowPage pUnderVid, 2,0,"" puPlayer.LabelSet pUnderVid,"P0", "Pod Chase" ,1,"{'mt':2,'color':"&c0&"}" puPlayer.LabelSet pUnderVid,"P1", "Sanctuary" ,1,"{'mt':2,'color':"&c1&"}" puPlayer.LabelSet pUnderVid,"P2", "Yaka Arrow" ,1,"{'mt':2,'color':"&c2&"}" puPlayer.LabelSet pUnderVid,"P3", "Quill's Quest" ,1,"{'mt':2,'color':"&c3&"}" puPlayer.LabelSet pUnderVid,"P4", "Knowhere" ,1,"{'mt':2,'color':"&c4&"}" puPlayer.LabelSet pUnderVid,"P5", "Escape Kyln" ,1,"{'mt':2,'color':"&c5&"}" puPlayer.LabelSet pUnderVid,"P6", "Sibling Rivalry" ,1,"{'mt':2,'color':"&c6&"}" puPlayer.LabelSet pUnderVid,"P7", "Antiques Shop" ,1,"{'mt':2,'color':"&c7&"}" puPlayer.LabelSet pUnderVid,"PGroot", "Groot Multiball" ,1,"{'mt':2,'color':"&cGroot&"}" puPlayer.LabelSet pUnderVid,"POrb", "Orb Multiball" ,1,"{'mt':2,'color':"&cOrb&"}" if (Mode <> -1) then Select case Mode case 0: Text="Pod Chase" case 1: Text="Sanctuary" case 2: Text="Yaka Arrow" case 3: Text="Quill's Quest" case 4: Text="Knowhere" case 5: Text="Escape Kyln" case 6: Text="Sibling Rivalry" case 7: Text="Antiques Shop" case 6: Text="Sibling Rivalry" case 7: Text="Antiques Shop" case 8: Text="Orb MB" case 9: Text="Groot MB" End Select puPlayer.LabelSet pUnderVid,"P" & Mode, Text ,1,"{'mt':1,'at':1,'fq':250,'len':6000,'fc':16777215}" End If tmrImolationAnim.UserValue=7 tmrImolationAnim.Interval = 30 tmrImolationAnim.Enabled = True 'vpmtimer.addtimer 6000, "DoImmolationIClear '" End Sub Sub DoImmolationIClear() tmrImolationAnim.Enabled=False puPlayer.LabelSet pUnderVid,"PFace", "PuPOverlays\\Clear.png" ,0,"" puPlayer.LabelSet pUnderVid,"PFaceCircle", "PuPOverlays\\Clear.png" ,0,"" HideProgress False pDMDEvent(kDMD_PlayerMode) puPlayer.LabelSet pUnderVid,"P0", "" ,0,"" puPlayer.LabelSet pUnderVid,"P1", "" ,0,"" puPlayer.LabelSet pUnderVid,"P2", "" ,0,"" puPlayer.LabelSet pUnderVid,"P3", "" ,0,"" puPlayer.LabelSet pUnderVid,"P4", "" ,0,"" puPlayer.LabelSet pUnderVid,"P5", "" ,0,"" puPlayer.LabelSet pUnderVid,"P6", "" ,0,"" puPlayer.LabelSet pUnderVid,"P7", "" ,0,"" puPlayer.LabelSet pUnderVid,"P8", "" ,0,"" puPlayer.LabelSet pUnderVid,"POrb", "" ,0,"" puPlayer.LabelSet pUnderVid,"PGroot", "" ,0,"" playclear pUnderVid 'PuPlayer.LabelShowPage pDMDText, 1,0,"""" End Sub Sub WaitPlayerMode() ' chooses the correct wait video Dim VideoName if PlayerMode <> -1 then debug.print "Player Wait Mode" if bUsePupDMD then PuPlayer.playstop pDMDText PuPlayer.SetBackGround pDMDText, 0 PuPlayer.SetLoop pDMDText, 0 PuPlayer.playstop pDMDText End If Select Case PlayerMode case -1:' No Mode Selected Case 0: ' Nebula - Pod Chase (10 shots) VideoName = "Video-0x001D.mp4" playmedia "Song-10w.mp3", MusicDir, pAudio, "", -1, "", 1, 1 Case 1: ' Ronan - Sanctuary (5 shots) VideoName = "Video-0x005C.mp4" playmedia "Song-12w.mp3", MusicDir, pAudio, "", -1, "", 1, 1 Case 2: ' Yandu - Yaka Arrow (8 shots) VideoName = "Video-0x003B.mp4" playmedia "Song-7w.mp3", MusicDir, pAudio, "", -1, "", 1, 1 Case 3: ' Star Lord - Quills Quest (12 shots) VideoName = "Video-0x0029.mp4" playmedia "Song-9w.mp3", MusicDir, pAudio, "", -1, "", 1, 1 Case 4: ' Drax - Knowhere (8 shots) VideoName = "Video-0x0008.mp4" playmedia "Song-8w.mp3", MusicDir, pAudio, "", -1, "", 1, 1 Case 5: ' Rocket - Escape Kyln (7 shots, Hadron Enforcer works on all except Rocket) VideoName = "Video-0x000E.mp4" playmedia "Song-5w.mp3", MusicDir, pAudio, "", -1, "", 1, 1 Case 6: ' Gamora - Siblng Rvlry (8 shots) VideoName = "Video-0x0015.mp4" playmedia "Song-6w.mp3", MusicDir, pAudio, "", -1, "", 1, 1 Case 7: ' Broker - Antique Shop (7 shots) VideoName = "Video-0x00AB.mp4" playmedia "Song-13w.mp3", MusicDir, pAudio, "", -1, "", 1, 1 End Select playUnderMedia "PupVideos", VideoName, pUnderVid, -1 ' playmedia VideoName, "PupVideos", pDMDText, "", -1, "", 1, 1 if bUsePupDMD then PuPlayer.SetLoop pUnderVid, 1 End If End sub dim tmrFinishModeBlinkCnt dim tmrFinishModeIndex Sub tmrFinishMode_Timer() if NOT bPupStarted then tmrFinishMode.Enabled = False : Exit Sub ' FIX3: guard teardown ' FIX3: defer one tick if ShotMultAnim is actively sending LabelSet bursts on screen 13 ' Prevents concurrent LabelSet storms across screens 13+15 causing VLC invalid pointer crash if tmrShotMultAnim.Enabled then Exit Sub ' FIX11: Skip this tick if a new PlayMedia just fired on screen 15 - VLC needs to settle ' before receiving LabelSet on the same screen (concurrent PlayMedia+LabelSet crashes VLC) if dScreen15LastActivity <> 0 and Abs(Timer() - dScreen15LastActivity) < 1.5 then Exit Sub dim x,y dim rot Dim Xrad Dim yRad Dim xOffset Dim yOffset Dim Index Dim startAngle Dim EndAngle Dim step rot=-0.6 step=7 '0.09 xRad=48:yRad=15 ' Circle 2 Index=tmrFinishModeIndex Select case Index case 0: ' Gamora xRad=48:yRad=15 ' Circle 2 xOffset = 42 yOffset = 35 startAngle = 240 EndAngle = -125 case 1: ' Ronan xRad=48:yRad=15 ' Circle 2 xOffset = 42 yOffset = 31 startAngle = 200 EndAngle = -230 case 2: ' Yandu xRad=48:yRad=15 ' Circle 2 xOffset = 42 yOffset = 31 startAngle = 170 ' Decrease=CounterClockwise EndAngle = -252 ' Increase=Clockwise case 3: ' Star Lord xRad=48:yRad=15 ' Circle 2 xOffset = 42 yOffset = 35 startAngle = 170 ' Decrease=CounterClockwise EndAngle = -286 ' Increase=Clockwise case 4: ' Drax xRad=48:yRad=15 ' Circle 2 xOffset = 42 yOffset = 33 startAngle = 140 ' Decrease=CounterClockwise EndAngle = -310 ' Increase=Clockwise case 5: ' Rocket xRad=48:yRad=15 ' Circle 2 xOffset = 42 yOffset = 38 startAngle = 50 ' Decrease=CounterClockwise EndAngle = -400 ' Increase=Clockwise case 6: ' Gamora xRad=48:yRad=15 ' Circle 2 xOffset = 42 yOffset = 38 startAngle = 20 ' Decrease=CounterClockwise EndAngle = -425 ' Increase=Clockwise case 7: ' Broker xRad=48:yRad=15 ' Circle 2 xOffset = 42 yOffset = 38 startAngle = -40 ' Decrease=CounterClockwise EndAngle = -460 ' Increase=Clockwise case 8: ' Orb xRad=48:yRad=23 ' Circle 2 xOffset = 42 yOffset = 38 startAngle = -40 ' Decrease=CounterClockwise EndAngle = -440 ' Increase=Clockwise case 9: ' Groot xRad=48:yRad=23 ' Circle 2 xOffset = 42 yOffset = 38 startAngle = 150 EndAngle = -260 End Select ' Convert degrees to radians startAngle = startAngle*3.1415926/180 endAngle = EndAngle*3.1415926/180 step=step*3.1415926/180 if tmrFinishMode.UserValue=-1 then tmrFinishMode.UserValue = startAngle End If ' Ellipse formula Width=xRad, Height=yRad, Rotation=rot, tmrFinishMode.UserValue=Degrees in Radians, x/yOffset offset from 0 'debug.print "Val: " & tmrFinishMode.UserValue & " " & (tmrFinishMode.UserValue*180/3.1415926) & " " & step x = xOffset+ xRad * cos(tmrFinishMode.UserValue) * cos(rot) - yRad*sin(tmrFinishMode.UserValue)*sin(rot) y = yOffset+ xRad * cos(tmrFinishMode.UserValue) * sin(rot) + yRad*sin(tmrFinishMode.UserValue)*cos(rot) 'debug.print EndAngle if tmrFinishMode.UserValue > EndAngle then tmrFinishModeBlinkCnt=0 PuPlayer.LabelSet pUnderVid, "F"&Index, "PuPOverlays\\CompleteLevel-"&Index&"s.png",1,"{'mt':2,'color':111111,'width':14, 'height':22,'yalign':0,'ypos':" & y & ",'xpos':" & x & "}" tmrFinishMode.UserValue=tmrFinishMode.UserValue-step Else 'debug.print "BLINK" tmrFinishModeBlinkCnt=tmrFinishModeBlinkCnt+1 tmrFinishMode.Interval = 100 ' Blink if tmrFinishModeBlinkCnt mod 2=0 then PuPlayer.LabelSet pUnderVid, "F"&Index, "PuPOverlays\\CompleteLevel-"&Index&".png",1,"{'mt':2,'color':111111,'width':100, 'height':100,'yalign':0,'ypos':0,'xpos':0}" Else PuPlayer.LabelSet pUnderVid, "F"&Index, "PuPOverlays\\CompleteLevel-"&Index&".png",0,"{'mt':2,'color':111111,'width':100, 'height':100,'yalign':0,'ypos':0,'xpos':0}" End If if tmrFinishModeBlinkCnt > 8 then tmrFinishMode.Enabled = False PuPlayer.LabelSet pUnderVid, "F"&Index, "PuPOverlays\\CompleteLevel-"&Index&".png",1,"{'mt':2,'color':111111,'width':100, 'height':100,'yalign':0,'ypos':0,'xpos':0}" End If end If End Sub Sub SceneFinishMode(Mode) If NOT bPupStarted Then Exit Sub ' FIX 2.1.2: guard against PUP teardown dim i Dim ModeText Dim visible if Mode = -1 then exit sub ' Just in case ModeText = Mode Select Case Mode case -1:' No Mode is selected yet Case 0: ' Nebula ModeText="Pod Chase" Case 1: ' Ronan ModeText="Sanctuary" Case 2: ' Yandu ModeText="Yaka Arrow" Case 3: ' Star Lord ModeText="Quill's Quest" Case 4: ' Drax ModeText="Knowhere" Case 5: ' Rocket ModeText="Escape Kyln" Case 6: ' Gamora ModeText="Sibling Rivalry" Case 7: ' Broker ModeText="Antiques Shop" End Select ' Overlay the final onto a video for background ' ffmpeg -i Video-0x00A1.mp4 -i CompleteLevel-C.png -filter_complex "[1:v]scale=1360:768 [ovrl],[0:v][ovrl]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -strict -2 FinishMode.mp4 'playmedia "FinishMode.mp4", "PupVideos", pOverVid, "", -1, "", 1, 1 PuPlayer.LabelSet pUnderVid, "ModeBG1", "PuPOverlays\\CompleteFrame2.png", 1, "{'mt':2, 'width':50, 'height':30,'yalign':0,'ypos':71,'xpos':65,'zback':1}" PuPlayer.LabelSet pUnderVid, "txtMode", ModeText & " Completed", 1, "{'mt':2, 'color': " & pupColorWhite & ", 'size':1.5, 'xalign':0,'ypos':75,'xpos':68}" PuPlayer.LabelSet pUnderVid, "ModeBG2", "PuPOverlays\\CompleteFrame1.png", 1, "{'mt':2, 'width':50, 'height':10,'xalign':2,'ypos':21.5,'xpos':39,'zback':1}" PuPlayer.LabelSet pUnderVid, "txtModeInfo1", "COMPLETE MISSIONS TO", 1, "{'mt':2, 'color':" & pupColorWhite & ", 'size':1.5, 'xalign':0,'ypos':23,'xpos':6.5}" PuPlayer.LabelSet pUnderVid, "txtModeInfo2", "SAVE XANDAR", 1, "{'mt':2, 'color':" & pupColorWhite & ", 'size':1.5, 'xalign':0,'ypos':27,'xpos':6.5}" PuPlayer.LabelShowPage pUnderVid, 3,0,"" playUnderMedia "PupVideos", "FinishMode.mp4", pUnderVid, -1 'PuPlayer.LabelSet pOverVid, "F0", "" ,1,"{'mt':1,'at':1,'fq':250,'len':6000}" For i = 0 to 9 if i = kModeOrbMB then if Light033.state = 1 then visible = 1 else visible =0 elseif i = kModeGrootMB then if Light030.state = 1 then visible = 1 else visible =0 else if ModePercent(i) >= 100 then visible = 1 else visible = 0 End If End If PuPlayer.LabelSet pUnderVid, "F" & i, "PuPOverlays\\CompleteLevel-"&i&".png", visible,"{'mt':2,'color':111111,'width':100, 'height':100,'yalign':0,'ypos':0,'xpos':0}" Next PlaySoundVol "gg_FinishMode", VolSfx tmrFinishMode.UserValue=-1 tmrFinishModeIndex=Mode tmrFinishMode.Interval = 50 tmrFinishMode.enabled = true ' puPlayer.LabelSet pOverVid,"OverMessage1", "TEST" ,1,"" ' puPlayer.LabelSet pOverVid,"OverMessage2", Message2 ,1,"" ' puPlayer.LabelSet pOverVid,"OverMessage3", Message3 ,1,"" End Sub Sub SceneClearFinishMode() If NOT bPupStarted Then Exit Sub ' FIX 2.1.2: guard against PUP teardown tmrFinishMode.enabled = False debug.print "Scene Clear" PuPlayer.LabelSet pUnderVid, "F0", "PuPOverlays\\CompleteLevel-0.png",0,"{'mt':2,'color':111111,'width':100, 'height':100,'yalign':0,'ypos':0,'xpos':0}" PuPlayer.LabelSet pUnderVid, "F1", "PuPOverlays\\CompleteLevel-1.png",0,"{'mt':2,'color':111111,'width':100, 'height':100,'yalign':0,'ypos':0,'xpos':0}" PuPlayer.LabelSet pUnderVid, "F2", "PuPOverlays\\CompleteLevel-2.png",0,"{'mt':2,'color':111111,'width':100, 'height':100,'yalign':0,'ypos':0,'xpos':0}" PuPlayer.LabelSet pUnderVid, "F3", "PuPOverlays\\CompleteLevel-3.png",0,"{'mt':2,'color':111111,'width':100, 'height':100,'yalign':0,'ypos':0,'xpos':0}" PuPlayer.LabelSet pUnderVid, "F4", "PuPOverlays\\CompleteLevel-4.png",0,"{'mt':2,'color':111111,'width':100, 'height':100,'yalign':0,'ypos':0,'xpos':0}" PuPlayer.LabelSet pUnderVid, "F5", "PuPOverlays\\CompleteLevel-5.png",0,"{'mt':2,'color':111111,'width':100, 'height':100,'yalign':0,'ypos':0,'xpos':0}" PuPlayer.LabelSet pUnderVid, "F6", "PuPOverlays\\CompleteLevel-6.png",0,"{'mt':2,'color':111111,'width':100, 'height':100,'yalign':0,'ypos':0,'xpos':0}" PuPlayer.LabelSet pUnderVid, "F7", "PuPOverlays\\CompleteLevel-7.png",0,"{'mt':2,'color':111111,'width':100, 'height':100,'yalign':0,'ypos':0,'xpos':0}" PuPlayer.LabelSet pUnderVid, "F8", "PuPOverlays\\CompleteLevel-8.png",0,"{'mt':2,'color':111111,'width':100, 'height':100,'yalign':0,'ypos':0,'xpos':0}" PuPlayer.LabelSet pUnderVid, "F9", "PuPOverlays\\CompleteLevel-9.png",0,"{'mt':2,'color':111111,'width':100, 'height':100,'yalign':0,'ypos':0,'xpos':0}" PuPlayer.LabelSet pUnderVid, "ModeBG1", "PuPOverlays\\clear.png", 1, "" PuPlayer.LabelSet pUnderVid, "txtMode", "", 1, "" PuPlayer.LabelSet pUnderVid, "ModeBG2", "PuPOverlays\\clear.png", 1, "" PuPlayer.LabelSet pUnderVid, "txtModeInfo1", "", 1, "" PuPlayer.LabelSet pUnderVid, "txtModeInfo2", "", 1, "" PuPlayer.LabelShowPage pUnderVid, 1,0,"" playclear pUnderVid End Sub Sub ScenePlayMessageUnder(Media, Message1, Message2, Message3, len, MsgColors) ' Sets a video message under the boarder If NOT bPupStarted Then Exit Sub ' FIX 2.1.2: guard against PUP teardown Dim i, colors playUnderMedia "PupVideos", Media, pUnderVid, len if MsgColors<> "" then colors = Split(MsgColors, "^") else colors = Split("^^", "^") End if For i = 0 to 2 If colors(i)="" then colors(i)=RGB(255,255,255) Debug.print colors(i) Next PuPlayer.LabelShowPage pUnderVid, 1,0,"" puPlayer.LabelSet pUnderVid,"UnderMessage1", Message1 ,1,"{'mt':2, 'color':" & colors(0) & "}" puPlayer.LabelSet pUnderVid,"UnderMessage2", Message2 ,1,"{'mt':2, 'color':" & colors(1) & "}" puPlayer.LabelSet pUnderVid,"UnderMessage3", Message3 ,1,"{'mt':2, 'color':" & colors(2) & "}" End Sub Sub SceneClearPlayMessageUnder() If NOT bPupStarted Then Exit Sub ' FIX 2.1.2: guard against PUP teardown PuPlayer.LabelSet pUnderVid,"UnderMessage1","",0,"" PuPlayer.LabelSet pUnderVid,"UnderMessage2","",0,"" PuPlayer.LabelSet pUnderVid,"UnderMessage3","",0,"" playclear pUnderVid End Sub Sub ScenePlayMessage(Media, Message1, Message2, Message3) ' Sets a video message over the whole screen ScenePlayMessage2 Media, Message1, Message2, Message3, 9 End Sub Sub ScenePlayMessage2(Media, Message1, Message2, Message3, fontSize) ScenePlayMessageColor Media, Message1, Message2, Message3, fontSize, "" End Sub Sub ScenePlayMessageColor(Media, Message1, Message2, Message3, fontSize, MsgColors) Dim i, colors If NOT bPupStarted Then Exit Sub ' FIX 2.1.2: guard against PUP teardown if MsgColors<> "" then colors = Split(MsgColors, "^") else colors = Split("^^", "^") End if For i = 0 to 2 If colors(i)="" then colors(i)=RGB(255,255,255) Debug.print colors(i) Next playmedia Media, "PupVideos", pOverVid, "", -1, "", 1, 1 PuPlayer.LabelShowPage pOverVid, 1,0,"" puPlayer.LabelSet pOverVid,"OverMessage1", Message1 ,1,"{'mt':2, 'size':" & fontSize & ", 'xpos':50, 'color':" & colors(0) & "}" puPlayer.LabelSet pOverVid,"OverMessage2", Message2 ,1,"{'mt':2, 'xpos':50, 'color':" & colors(1) & "}" puPlayer.LabelSet pOverVid,"OverMessage3", Message3 ,1,"{'mt':2, 'size':" & fontSize & ", 'xpos':50, 'color':" & colors(2) & "}" 'vpmtimer.addtimer 3000, "SceneClearPlayerModeComplete '" End Sub Sub SceneClearPlayMessage() If NOT bPupStarted Then Exit Sub ' FIX 2.1.2: guard against PUP teardown PuPlayer.LabelSet pOverVid,"OverMessage1","",0,"" PuPlayer.LabelSet pOverVid,"OverMessage2","",0,"" PuPlayer.LabelSet pOverVid,"OverMessage3","",0,"" playclear pOverVid End Sub Sub SceneSetMessage(Message1, Message2, Message3, fontSize, MsgColors) ' Sets a text message with no video Dim i, colors If NOT bPupStarted Then Exit Sub ' FIX 2.1.2: guard against PUP teardown if MsgColors<> "" then colors = Split(MsgColors, "^") else colors = Split("^^", "^") End if For i = 0 to 2 If colors(i)="" then colors(i)=RGB(255,255,255) Debug.print colors(i) Next puPlayer.LabelSet pDMDText,"SceneMessage1", Message1 ,1,"{'mt':2, 'size':" & fontSize & ", 'xpos':50, 'color':" & colors(0) & "}" puPlayer.LabelSet pDMDText,"SceneMessage2", Message2 ,1,"{'mt':2, 'xpos':50, 'color':" & colors(1) & "}" puPlayer.LabelSet pDMDText,"SceneMessage3", Message3 ,1,"{'mt':2, 'size':" & fontSize & ", 'xpos':50, 'color':" & colors(2) & "}" End Sub Sub SceneClearMessage() If NOT bPupStarted Then Exit Sub ' FIX 2.1.2: guard against PUP teardown PuPlayer.LabelSet pDMDText,"SceneMessage1","",0,"" PuPlayer.LabelSet pDMDText,"SceneMessage2","",0,"" PuPlayer.LabelSet pDMDText,"SceneMessage3","",0,"" playclear pOverVid End Sub Sub ShowPlayerModeComplete(ExtraMode) ' Show the total for the player mode (ExtraMode: 0=GrootMB, 1=OrbMB, 2=WizardModes, -1=DefaultMode) If NOT bPupStarted Then Exit Sub ' FIX 2.1.2: guard against PUP teardown dim ModeStr dim ModeStr2 Dim bOverMessage Dim MediaStr Dim ScoreVal Dim SecondStr dim thisMode Dim fontSize fontSize=9 bOverMessage=False ModeStr="" ModeStr2="TOTAL" MediaStr="" if ExtraMode = 0 Then ' GrootMB ModeStr = "Groot Multiball" MediaStr= "Video-0x008E.mp4" 'playmedia "Video-0x008E.mp4", "PupVideos", pOverVid, "", 3000, "", 1, 1 ScoreVal = ModePointsGroot elseif ExtraMode = 1 Then ' OrbMB ModeStr = "Orb Multiball" MediaStr= "Video-0x004B.mp4" 'playmedia "Video-0x004B.mp4", "PupVideos", pOverVid, "", 3000, "", 1, 1 ScoreVal = OrbMBJackpot elseif ExtraMode= 2 then ScoreVal=WizardModePoints if tmrXandar.Enabled then ModeScore(CurrentPlayer,3)=ScoreVal ModeStr = "Save Xandar" MediaStr= "Video-0x004B.mp4" 'playmedia "Video-0x004B.mp4", "PupVideos", pOverVid, "", 3000, "", 1, 1 elseif tmrImmolation.Enabled then ModeScore(CurrentPlayer,2)=ScoreVal ModeStr = "Immolation Initiative" MediaStr= "Video-0x005A.mp4" 'playmedia "Video-0x005A.mp4", "PupVideos", pOverVid, "", 3000, "", 1, 1 elseif tmrCherryBomb.Enabled then ModeScore(CurrentPlayer,1)=ScoreVal bOverMessage=True fontSize=6 ModeStr = "CHERRY BOMB MULTIBALL" ModeStr2 = "COMPLETED" MediaStr="Video-0x0092.mp4" 'playmedia "Video-0x0088.mp4", "PupVideos", pOverVid, "", 3000, "", 1, 1 End If else thisMode = PlayerMode if bSecondMode then SecondStr = " 2":thisMode=PlayerMode2 ' Handle 2nd Mode 'playclear pDMDText ScoreVal=ModePoints Select Case thisMode case -1:' No Mode Selected Case 0: ' Nebula - Pod Chase (10 shots) 'playmedia "Video-0x004B.mp4", "PupVideos", pOverVid, "", 3000, "", 1, 1 MediaStr="Video-0x004B.mp4" ModeStr ="Pod Chase" & SecondStr Case 1: ' Ronan - Sanctuary (5 shots) 'playmedia "Video-0x0088.mp4", "PupVideos", pOverVid, "", 3000, "", 1, 1 MediaStr="Video-0x0088.mp4" ModeStr ="Sanctuary" & SecondStr Case 2: ' Yandu - Yaka Arrow (8 shots) 'playmedia "Video-0x005A.mp4", "PupVideos", pOverVid, "", 3000, "", 1, 1 MediaStr="Video-0x005A.mp4" ModeStr ="Yaka Arrow" & SecondStr Case 3: ' Star Lord - Quills Quest (12 shots) 'playmedia "Video-0x0060.mp4", "PupVideos", pOverVid, "", 3000, "", 1, 1 MediaStr="Video-0x0060.mp4" ModeStr ="Quills Quest" & SecondStr Case 4: ' Drax - Knowhere (8 shots) 'playmedia "Video-0x0092.mp4", "PupVideos", pOverVid, "", 3000, "", 1, 1 MediaStr="Video-0x0092.mp4" ModeStr ="Knowhere" & SecondStr Case 5: ' Rocket - Escape Kyln (7 shots, Hadron Enforcer works on all except Rocket) 'playmedia "Video-0x0065.mp4", "PupVideos", pOverVid, "", 3000, "", 1, 1 MediaStr="Video-0x0065.mp4" ModeStr ="Escape Kyln" & SecondStr Case 6: ' Gamora - Siblng Rvlry (8 shots) 'playmedia "Video-0x008E.mp4", "PupVideos", pOverVid, "", 3000, "", 1, 1 MediaStr="Video-0x008E.mp4" ModeStr ="Sibling Rivalry" & SecondStr Case 7: ' Broker - Antique Shop (7 shots) 'playmedia "Video-0x000B.mp4", "PupVideos", pOverVid, "", 3000, "", 1, 1 MediaStr="Video-0x000B.mp4" ModeStr ="Antique Shop" & SecondStr End Select End If if ModeStr <> "" then ' Queue up PlayerModeComplete scene if bOverMessage Then QueueScene2 "ScenePlayMessage2 """&MediaStr&""", """&ModeStr&""","""&FormatScore(ScoreVal)&""",""" & ModeStr2 & """, " & fontSize & " '", 3000, 1, True QueueScene2 "SceneClearPlayMessage '", 0, 1, True Else ' UNDER Message QueueScene2 "ScenePlayMessageUnder """&MediaStr&""", """&ModeStr&""","""&FormatScore(ScoreVal)&""",""" & ModeStr2 & """, -1, """ & pupColorGrey & "^^" & pupColorGrey &""" '", 3000, 1, True QueueScene2 "SceneClearPlayMessageUnder '", 0, 1, True End if if tmrCherryBomb.Enabled then ' Add Post Message for Cherry QueueScene2 "ScenePlayMessage2 """&MediaStr&""", ""PLAYER " & CurrentPlayer + 1 & ""","""",""KEEP SHOOTING"", 9 '", 2000, 1, True QueueScene2 "SceneClearPlayMessage '", 0, 1, True End if if ExtraMode = -1 then If PlayerMode <> -1 and bSecondMode=False then ' PlayerMode2 doesnt do the around the world finish if ModePercent(PlayerMode) >= 100 then QueueScene2 "SceneFinishMode " & PlayerMode & " '", 6000, 1, True QueueScene2 "SceneClearFinishMode '", 0, 1, True End If End If elseif ExtraMode = 0 and Light030.state = 1 then ' We completed it QueueScene2 "SceneFinishMode 9 '", 6000, 1, True QueueScene2 "SceneClearFinishMode '", 0, 1, True elseif ExtraMode = 1 and Light033.state = 1 then ' We completed it QueueScene2 "SceneFinishMode 8 '", 6000, 1, True QueueScene2 "SceneClearFinishMode '", 0, 1, True End if End If End sub ' Cleland Song List ' https://pinside.com/pinball/forum/topic/gotg-sound-replacment-mod/page/16#post-5707522 Sub StartPlayerModeVideo(bSkipInitial) ' Play the GamePlay Video - SkipInitial skips the scene where we show the splash for this mode Dim overVideo Dim bgVideo dim newVolume newVolume=1 debug.print "StartPlayerModeVideo: " & bSecondMode & " " & PlayerMode ' FIX15: If screen 15 fired within the last 2 seconds, defer this call to avoid ' concurrent playUnderMedia (e.g. DoImmolationI + mode video) crashing VLC if dScreen15LastActivity <> 0 and Abs(Timer() - dScreen15LastActivity) < 2 then vpmtimer.addtimer 2000, "StartPlayerModeVideo " & bSkipInitial & " '" Exit Sub end if 'StopSound "m_wait" 'playclear pAudio ' Removed this so it doesnt kill WaitMusic if bXandarReady then StopPlayerModeVideo End If if tmrXandar.Enabled or tmrImmolation.Enabled or tmrCherryBomb.Enabled then ' Wizard Mode playclear pDMDFull playclear pMusic if tmrXandar.Enabled then playmedia "Video-0x0034.mp4", "PupVideos", pDMDFull, "", 4000, "Video-0x0059.mp4", 1, 1 playmedia "Song-2.mp3", MusicDir, pMusic, "", -1, "", 1, 1 elseif tmrImmolation.Enabled then playmedia "Video-0x0064.mp4", "PupVideos", pDMDFull, "", -1, "", 1, 1 playmedia "Song-11.mp3", MusicDir, pMusic, "", -1, "", 1, 1 PlaySoundVol "say-immolation0x06E5", VolDef elseif tmrCherryBomb.Enabled then playmedia "Video-0x0026.mp4", "PupVideos", pDMDFull, "", 4200, "Video-0x0028.mp4", 1, 1 playmedia "Song-1.mp3", MusicDir, pMusic, "", -1, "", 1, 1 'playmedia "default.mp4", "BGDefault", pDMDText, "", 4200, "Video-0x0059.mp4", 1, 1 End If ElseIf bOrbMultiBall then if PlayerMode=-1 then ' Kill wait music playclear pAudio End if playmedia "Orb-MB.mp4", "PupVideos", pDMDFull, "", -1, "", VolBGMusic * 150, 1 playmedia "Song-Orb.mp3", MusicDir, pMusic, "", -1, "", 1, 1 ElseIf bGrootMultiballWait or bGrootMultiball then if PlayerMode=-1 then ' Kill wait music playclear pAudio End if if bSkipInitial = False then PlaySoundVol "sfx_GrootMBStart", VolSfx VpmTimer.AddTimer 1000, "PlaySoundVol ""vo_GrootMB"", VolDef '" playUnderMedia "PupVideos", "GrootMB_Start.mp4", pUnderVid, 11929 End if playmedia "GrootMB.mp4", "PupVideos", pDMDFull, "", -1, "", VolBGMusic * 100, 1 playmedia "Song-groot.mp3", MusicDir, pMusic, "", -1, "", 1, 1 Elseif bSecondMode = False then playclear pDMDFull Select Case PlayerMode case -1:' No Mode Selected ' if bXandarReady then ' StopPlayerModeVideo ' End If ' ' if tmrXandar.Enabled then ' playmedia "Video-0x0034.mp4", "PupVideos", pDMDText, "", 4200, "Video-0x0059.mp4", 1, 1 ' playmedia "Song-2.mp3", MusicDir, pMusic, "", -1, "", 1, 1 ' elseif tmrImmolation.Enabled then ' playmedia "Video-0x0064.mp4", "PupVideos", pDMDText, "", -1, "", 1, 1 ' playmedia "Song-11.mp3", MusicDir, pMusic, "", -1, "", 1, 1 ' PlaySoundVol "say-immolation0x06E5", VolDef ' elseif tmrCherryBomb.Enabled then ' playmedia "Video-0x0026.mp4", "PupVideos", pDMDText, "", 4200, "Video-0x0028.mp4", 1, 1 ' playmedia "Song-1.mp3", MusicDir, pMusic, "", -1, "", 1, 1 ' 'playmedia "default.mp4", "BGDefault", pDMDText, "", 4200, "Video-0x0059.mp4", 1, 1 ' End If Case 0: ' Nebula - Pod Chase (10 shots) if bSkipInitial = False then playUnderMedia "PupVideos", "Video-0x00AD.mp4", pUnderVid, 3534 End If playmedia "Video-0x0047.mp4", "PupVideos", pDMDFull, "", -1, "", VolBGMusic * 150, 1 playmedia "Song-10.mp3", MusicDir, pMusic, "", -1, "", 1, 1 Case 1: ' Ronan - Sanctuary (5 shots) if bSkipInitial=False then playUnderMedia "PupVideos", "Video-0x0054.mp4", pUnderVid, 3534 End If playmedia "Video-0x0079.mp4", "PupVideos", pDMDFull, "", -1, "", VolBGMusic * 150, 1 playmedia "Song-12.mp3", MusicDir, pMusic, "", -1, "", 1, 1 ' Needs to be aligned with the video Case 2: ' Yandu - Yaka Arrow (8 shots) if bSkipInitial = False then playUnderMedia "PupVideos", "Video-0x0002.mp4", pUnderVid, 3534 End If playmedia "Video-0x0090.mp4", "PupVideos", pDMDFull, "", -1, "", VolBGMusic * 180, 1 playmedia "Song-7.mp3", MusicDir, pMusic, "", -1, "", 1, 1 Case 3: ' Star Lord - Quills Quest (12 shots) if bSkipInitial = False then playUnderMedia "PupVideos", "Video-0x0080.mp4", pUnderVid, 3534 End If playmedia "Video-0x00A0.mp4", "PupVideos", pDMDFull, "", -1, "", VolBGMusic * 150, 1 playmedia "Song-9.mp3", MusicDir, pMusic, "", -1, "", 1, 1 Case 4: ' Drax - Knowhere (8 shots) if bSkipInitial = False then playUnderMedia "PupVideos", "Video-0x0020.mp4", pUnderVid, 3534 End If playmedia "Video-0x009D.mp4", "PupVideos", pDMDFull, "", -1, "", VolBGMusic * 150, 1 playmedia "Song-8.mp3", MusicDir, pMusic, "", -1, "", 1, 1 Case 5: ' Rocket - Escape Kyln (7 shots, Hadron Enforcer works on all except Rocket) if bSkipInitial = False then playUnderMedia "PupVideos", "Video-0x0016.mp4", pUnderVid, 3534 End If playmedia "Video-0x0096.mp4", "PupVideos", pDMDFull, "", -1, "", VolBGMusic * 150, 1 playmedia "Song-5.mp3", MusicDir, pMusic, "", -1, "", 1, 1 Case 6: ' Gamora - Siblng Rvlry (8 shots) if bSkipInitial = False then playUnderMedia "PupVideos", "Video-0x005B.mp4", pUnderVid, 3534 End If playmedia "Video-0x0081.mp4", "PupVideos", pDMDFull, "", -1, "", VolBGMusic * 150, 1 playmedia "Song-6.mp3", MusicDir, pMusic, "", -1, "", 1, 1 Case 7: ' Broker - Antique Shop (7 shots) if bSkipInitial = False then playUnderMedia "PupVideos", "Video-0x001B.mp4", pUnderVid, 3534 End If playmedia "Video-0x0007.mp4", "PupVideos", pDMDFull, "", -1, "", VolBGMusic * 180, 1 playmedia "Song-13.mp3", MusicDir, pMusic, "", -1, "", 1, 1 End Select Elseif PlayerMode2 <> -1 then playclear pDMDFull Select Case PlayerMode2 case -1:' No Mode Selected Case 0: ' Nebula - Pod Chase (10 shots) overVideo = "Video-0x0043.mp4" bgVideo = "Video-0x0069.mp4" Case 1: ' Ronan - Sanctuary (5 shots) overVideo = "Video-0x0045.mp4" bgVideo = "Video-0x003C.mp4" newVolume=VolBGMusic * 150 Case 2: ' Yandu - Yaka Arrow (8 shots) overVideo = "Video-0x00AA.mp4" bgVideo = "Video-0x0001.mp4" Case 3: ' Star Lord - Quills Quest (12 shots) overVideo = "Video-0x006B.mp4" bgVideo = "Video-0x00B8.mp4" Case 4: ' Drax - Knowhere (8 shots) overVideo = "Video-0x00A6.mp4" bgVideo = "Video-0x007B.mp4" Case 5: ' Rocket - Escape Kyln (7 shots, Hadron Enforcer works on all except Rocket) overVideo = "Video-0x003A.mp4" bgVideo = "Video-0x0049.mp4" Case 6: ' Gamora - Siblng Rvlry (8 shots) overVideo = "Video-0x00B2.mp4" bgVideo = "Video-0x0098.mp4" Case 7: ' Broker - Antique Shop (7 shots) overVideo = "Video-0x0005.mp4" bgVideo = "Video-0x0067.mp4" newVolume=VolBGMusic * 150 End Select newVolume=VolBGMusic * 150 if PlayerMode2 <> -1 then ' Just make sure QueueScene "playUnderMedia ""PupVideos"", """&overVideo&""", pUnderVid, 3540 ", 3540, 1 ' QueueScene "playmedia """&overVideo&""", ""PupVideos"", pOverVid , """", -1, """", 1, 1 '", 3540, 1 playmedia bgVideo, "PupVideos", pDMDFull, "", -1, "", newVolume , 1 End if End If End sub Sub StopPlayerModeVideo() ' chooses the wait video if bWizardMode then exit sub if bGrootMultiball or bOrbMultiBall then Exit sub ' Dont stop the video if MG is still running if bGameInPlay = false then exit sub Debug.print "StopPlayerModeVideo: (Mix Music/video)" playclear pDMDFull playclear pMusic if bSkipWaitVideo = False then playmedia "Video-0x000F.mp4", "PupVideos", pDMDFull, "", -1, "", 1, 1 debug.print "Start m_wait2-xx" ' Guard: prevent double-fire on audio screen 14 causing VLC invalid pointer crash if Not bAudioScreen14Busy then bAudioScreen14Busy = True vpmtimer.addtimer 1500, "bAudioScreen14Busy = False '" playmedia "m_wait2-" & INT(RND*WaitSongCount)+1 &".mp3", MusicDir, pAudio, "", -1, "", 1, 1 End If End If End sub ' This is called when they hit the plunger and when they press start after ball is in the scoop Sub StartPlayerMode() debug.print "StartPlayerMode " & PlayerMode pDMDSetPage(pScores) setUpgradeLight(True) setModeSelectLight(False) ' flshUpgrade.TimerEnabled = True ' flshModeSelect.TimerEnabled = False bIModeComplete=False bSecondMode = False PlayerMode2 = -1 dim time time = 1000 sndGeneralHit = "" 'StopSound "m_wait" playclear pAudio ModePoints = 0 bModeProgressUpgraded = False ResetBallSearch ' Reset before starting a mode since we might of sat there for a while bPlayerModeSelect = False pBGGamePlay bPlayPaused = False ' Force song to change HadronFlash "", False if bSkillshotsReady(2) = False Then ' Close the gate before the mode start unless we are doing a skill shot LoopGateLeft.Open = False End If Gate002.Open = False if bUsePUPDMD then puPlayer.LabelSet pDMDText,"Message", "" ,1,"" ' Clear the select your mission if (PlayerMode <> -1) then ' Add this to the stack StackState(kStack_Pri0).Enable(PlayerMode) End If Select Case PlayerMode case -1:' No Mode Selected Case 0: ' Nebula - Pod Chase (10 shots) DMD "Start Mode", CL(0, "Pod Chase"), "", eNone, eNone, eNone, time, False, "" SSetLightColor kStack_Pri0, lGamoraArrow, modeRampColor, 1 SSetLightColor kStack_Pri0, lNebulaArrow, modeRampColor, 1 Case 1: ' Ronan - Sanctuary (5 shots) DMD "Start Mode", CL(0, "Sanctuary"), "", eNone, eNone, eNone, time, False, "" ' Gates are Open during the mode but not during plunge/ModeStart tgHadron0.UserValue = 0 tgHadron1.UserValue = 0 tgHadron2.UserValue = 0 tgHadron3.UserValue = 0 tgHadron4.UserValue = 0 lHadron0.UserValue=0 lHadron1.UserValue=0 lHadron2.UserValue=0 lHadron3.UserValue=0 lHadron4.UserValue=0 SSetLightColor kStack_Pri0, lRonanArrow, "yellow", 2 Case 2: ' Yandu - Yaka Arrow (8 shots) DMD "Start Mode", CL(0, "Yaka Arrow"), "", eNone, eNone, eNone, time, False, "" YakaPops = 4 UpdateHitCntMsg "Pops Remaining: ", YakaPops bQualifyYando=False SSetLightColor kStack_Pri0, lYonduArrow, modeRampColor, 1 SSetLightColor kStack_Pri0, lgr_a, modeRampColor, 1 Case 3: ' Star Lord - Quills Quest (12 shots) SSetLightColor kStack_Pri0, lStarLordArrow, "yellow", 2 SSetLightColor kStack_Pri0, lRonanArrow, "yellow", 1 SSetLightColor kStack_Pri0, lRocketArrow, "yellow", 1 ' Reset hurryup so it starts on a switch hit HurryUpCount=0 ' Start timers to switch Arrows ' tmrQuestRamps.Interval = 1000 * INT(RND * 6 + 7) ' Range 7-12 = (12-7+1) * Rnd + 7 ' tmrQuestRamps.Enabled = True if bQuillsQuestFirstTime = False Then ' You only get multiball on the first play DisableGrootMouth(True) ' Disable Groots Mouth EnableBallSaverForce 25 AddMultiball 1 ' Automatic multiball on start EnableOrb(False) 'OrbTarget1Disabled.Collidable = True ' Disable OrbMB on Quill MB End If DMD "Start Mode", CL(0, "Quills Quest"), "", eNone, eNone, eNone, time, False, "" Case 4: ' Drax - Knowhere (8 shots) DMD "Start Mode", CL(0, "Knowhere"), "", eNone, eNone, eNone, time, False, "" SSetLightColor kStack_Pri0, lDraxArrow, modeRampColor, 2 SSetLightColor kStack_Pri0, lRonanArrow, modeRampColor, 2 SSetLightColor kStack_Pri0, lGamoraArrow, modeRampColor, 1 SSetLightColor kStack_Pri0, lNebulaArrow, modeRampColor, 1 Case 5: ' Rocket - Escape Kyln (7 shots, Hadron Enforcer works on all except Rocket) ' LoopGateLeft.Open = False ' Gates are closed for bumper shots Gate002.Open = False DMD "Start Mode", CL(0, "Escape Kyln"), "", eNone, eNone, eNone, time, False, "" SSetLightColor kStack_Pri0, lRocketArrow, modeRampColor, 1 SSetLightColor kStack_Pri0, lgr_a, modeRampColor, 1 SetLightColor lNova_sw2, modeRampColor, PlayerState(CurrentPlayer).lNovaStatesKyln(0) SetLightColor lNova_sw3, modeRampColor, PlayerState(CurrentPlayer).lNovaStatesKyln(1) SetLightColor lNova_sw4, modeRampColor, PlayerState(CurrentPlayer).lNovaStatesKyln(2) SetLightColor lNova_sw8, modeRampColor, PlayerState(CurrentPlayer).lNovaStatesKyln(3) SetLightColor lNova_sw9, modeRampColor, PlayerState(CurrentPlayer).lNovaStatesKyln(4) if ModeProgress(PlayerMode)>=6 then SSetLightColor kStack_Pri0, lgr_a, modeRampColor, 0 End if Case 6: ' Gamora - Siblng Rvlry (8 shots) DMD "Start Mode", CL(0, "Sibling Rivalry"), "", eNone, eNone, eNone, time, False, "" sndGeneralHit = "gg_lazer" SetLightColor lGamoraName, "green", 2 SSetLightColor kStack_Pri0, lGamoraArrow, modeRampColor, 2 SSetLightColor kStack_Pri0, lNebulaArrow, modeRampColor, 2 Case 7: ' Broker - Antique Shop (7 shots) SSetLightColor kStack_Pri0, lNebulaArrow, modeRampColor, 1 SSetLightColor kStack_Pri0, lBrokerArrow, modeRampColor, 2 SwitchHitCount = 20 UpdateHitCntMsg "SWITCH HITS REMAINING: ", SwitchHitCount DMD "Start Mode", CL(0, "Antiquites Shop"), "", eNone, eNone, eNone, time, False, "" End Select ClearModeSelection StartPlayerModeVideo False ' If this mode are already past 50% then dont show Immolation Screen if PlayerMode <> -1 then CheckHadron False ' Set light back up if ModePercent(playerMode)=0 then AddScore 250000 ' 250K just for starting the 1st time if ModePercent(playerMode) >= 50 Then bIModeComplete=True if PlayerMode = kModeRonan and bImmolationQualSanctuary then bIModeComplete=True ' Special case for Sanctuary - Mark Immolation already complete if PlayerMode<>kModeRonan then ' Restore hadron states if tgHadron0.UserValue then SetLightColor lHadron0, "yellow", 1 if tgHadron1.UserValue then SetLightColor lHadron1, "yellow", 1 if tgHadron2.UserValue then SetLightColor lHadron2, "yellow", 1 if tgHadron3.UserValue then SetLightColor lHadron3, "yellow", 1 if tgHadron4.UserValue then SetLightColor lHadron4, "yellow", 1 End if ModeCountdownTimer.UserValue = ModeCountdown ModeCountdownTimer.Enabled = True End If ScorbitBuildGameModes() SetModeLights() End Sub Function bIsModeComplete(Index) If Index >=0 and Index <=7 then bIsModeComplete = ModePercent(Index) >= 100 else bIsModeComplete = False End if End Function Function GetModeIndex(lightArrowName) GetModeIndex = -1 Select Case lightArrowName Case "lNebulaArrow": ' Nebula - Pod Chase (10 shots) GetModeIndex = 0 Case "lRonanArrow": ' Ronan - Sanctuary (5 shots) GetModeIndex = 1 Case "lYonduArrow": ' Yandu - Yaka Arrow (8 shots) GetModeIndex = 2 Case "lStarLordArrow": ' Star Lord - Quills Quest (12 shots) GetModeIndex = 3 Case "lDraxArrow": ' Drax - Knowhere (8 shots) GetModeIndex = 4 Case "lRocketArrow": ' Rocket - Escape Kyln (7 shots, Hadron Enforcer works on all except Rocket) GetModeIndex = 5 Case "lGamoraArrow": ' Gamora - Siblng Rvlry (8 shots) GetModeIndex = 6 Case "lBrokerArrow": ' Broker - Antique Shop (7 shots) GetModeIndex = 7 case "lgr_a": GetModeIndex = 8 ' Groot Arrow (not really used) End Select end Function Function GetBonusIndex(lightArrowName) GetBonusIndex = -1 Select Case lightArrowName Case "lNebulaArrow": ' Nebula - Pod Chase (10 shots) GetBonusIndex = 3 Case "lRonanArrow": ' Ronan - Sanctuary (5 shots) GetBonusIndex = 1 Case "lYonduArrow": ' Yandu - Yaka Arrow (8 shots) GetBonusIndex = 0 Case "lStarLordArrow": ' Star Lord - Quills Quest (12 shots) GetBonusIndex = 8 Case "lDraxArrow": ' Drax - Knowhere (8 shots) GetBonusIndex = 7 Case "lRocketArrow": ' Rocket - Escape Kyln (7 shots, Hadron Enforcer works on all except Rocket) GetBonusIndex = 2 Case "lGamoraArrow": ' Gamora - Siblng Rvlry (8 shots) GetBonusIndex = 6 Case "lBrokerArrow": ' Broker - Antique Shop (7 shots) GetBonusIndex = 5 case "lgr_a": GetBonusIndex = 4 ' Groot Arrow (not really used) End Select end Function Function GetBonusIndexFromMode(Mode) Dim BonusIndex:BonusIndex=-1 Select case Mode case 0 ' Nebula BonusIndex = 3 case 1 ' Ronan BonusIndex = 1 case 2 ' Yandu BonusIndex = 0 case 3 ' Star Lord BonusIndex = 8 case 4 ' Drax BonusIndex = 7 case 5 ' Rocket BonusIndex = 2 case 6 ' Gamora BonusIndex = 6 case 7 ' Broker BonusIndex = 5 End Select GetBonusIndexFromMode = BonusIndex End Function Function Bonus2ModeIndex(BonusIndex) Bonus2ModeIndex = -1 Select Case BonusIndex Case 3: ' Nebula - Pod Chase (10 shots) Bonus2ModeIndex = 0 Case 1: ' Ronan - Sanctuary (5 shots) Bonus2ModeIndex = 1 Case 0: ' Yandu - Yaka Arrow (8 shots) Bonus2ModeIndex = 2 Case 8: ' Star Lord - Quills Quest (12 shots) Bonus2ModeIndex = 3 Case 7: ' Drax - Knowhere (8 shots) Bonus2ModeIndex = 4 Case 2: ' Rocket - Escape Kyln (7 shots, Hadron Enforcer works on all except Rocket) Bonus2ModeIndex = 5 Case 6: ' Gamora - Siblng Rvlry (8 shots) Bonus2ModeIndex = 6 Case 5: ' Broker - Antique Shop (7 shots) Bonus2ModeIndex = 7 case 4: Bonus2ModeIndex = -1 ' Groot Arrow (not really used) End Select debug.print "BonusIndex: " & BonusIndex & " ret:" & Bonus2ModeIndex end Function ' If you didnt start and drain dont reset - https://youtu.be/pOW5GzQp0wM?t=957 Sub EndImmolation(mode) ' 1 - Down to 1 Ball, 0 - All Balls Drained dim a,i ' if bImmolationWait and mode = 0 then ' Throw a ball back on the field (I dont think you can get here) ' bAutoPlunger = True ' bBallSaverReady = True ' Need to enable ball saver for the next ball ' CreateNewBall() ' end If ' if tmrImmolation.Enabled and (Light029.state = 1 or mode = 0) then ' Either we finished or we drained everything if tmrImmolation.Enabled then debug.print "End Immolation" StackState(kStack_Pri2).Disable setUpgradeLight(False) ' flshUpgrade.TimerEnabled = False ' flshModeSelect.TimerEnabled = True OrbTarget1.IsDropped = False EnableOrb(True) For each a in aRampLights ' Turn off all the ramp lights to reset the mode SetLightColorRestore a, -1 'SetLightColor a, "white", 0 Next ' if Light029.state = 1 then ' We Complete it (TBD: Should this be a competition mode thing?) bImmolationDone=True ShowPlayerModeComplete(2) ' Show Immolation Mode total ' bImmolationWait=True ' if mode = 0 then ' Throw a ball back on the field (I dont think you can get here) ' bAutoPlunger = True ' bBallSaverReady = True ' Need to enable ball saver for the next ball ' CreateNewBall() ' end If ' Elseif mode =0 then ' We didnt finish and they drained all the balls - Set it back up ' bImmolationReady = True ' SetLightColor lStarLordArrow, "white", 0 ' SetLightColor Light029, "white", 2 ' PlaySoundVol "Bells", VolSfx ' PlayScoopLightSeq ' End If bWizardMode = False StopPlayerModeVideo CheckWizardModesReady tmrImmolation.Enabled = False setModeSelectLight(True) ScorbitBuildGameModes() end if End Sub Sub EndXandar() dim a dim i if tmrXandar.Enabled Then debug.print "End Xandar" bWizardMode = False StopPlayerModeVideo 'pBGPlayVideoDone ' Stop the video PlaySound "YourTimeIsUp" ' flshUpgrade.TimerEnabled = False ' flshModeSelect.TimerEnabled = True OrbTarget1.IsDropped = False EnableOrb(True) For each a in aRampLights ' Turn off all the ramp lights to reset the mode SSetLightColor kStack_Pri2, a, "white", 0 Next StackState(kStack_Pri2).Disable ' Reset all the modes back to 0 and light the xandar light solid for i = 0 to 8 ModeProgress(i) = 0 ModePercent(i) = 0 Mode2Progress(i) = 0 Mode2Percent(i) = 0 Next Light020.State = 0 Light021.State = 0 Light022.State = 0 Light023.State = 0 Light024.State = 0 Light025.State = 0 Light026.State = 0 Light027.State = 0 bQuillsQuestFirstTime = False bImmolationDone = False bCherryBombDone = False bXandarDone = False XandarCount=0 SetLightColor Light031, "white", 0 ' Mark Xandar Complete SetLightColor Light033, "purple", 0 ' Clear OrbMB SetLightColor Light030, "green", 0 ' Clear GrootMB SetLightColor Light029, "White", 0 ' Clear Immolation modesCompleted=0 setUpgradeLight(False) setModeSelectLight(True) GrootMBFinished=False GrootMBJackpotCnt=0 GrootSJPReady=False For each a in aRampLights ' Clear GrootMb Progress i = GetModeIndex(a.name) GrootMBJackpotHits(CurrentPlayer, i) = 0 Next OrbMBJackpotHits=0 tmrXandar.Enabled = False ScorbitBuildGameModes() end if End Sub sub EndCherryBomb() if tmrCherryBomb.Enabled Then debug.print "End CherryBomb" ModeCountdownTimer.enabled = False ' Pause the timer tmrCherryBomb.UserValue = -1 puPlayer.LabelSet pDMDText,"Timer", "" ,1,"" if Tilted=False then ShowPlayerModeComplete(2) setUpgradeLight(False) setModeSelectLight(True) ' flshUpgrade.TimerEnabled = False ' flshModeSelect.TimerEnabled = True OrbTarget1.IsDropped = False ' Re-Enable ORB EnableOrb(True) ' CAN'T BE IN ORB during Cherry Bomb ' if (bOrbMultiBall) then ' Reset Orb MB if we are in it, because CB forces all balls to drain, cant do GrootMB so no need to check that ' bMultiBallMode = False ' StopOrbMultiball ' end if bCherryBombDone = True ' Not sure if you can only do it once or not BallSaverTime = defBallSaverTime' Put it back to the original BallSaverTimerCancel ' Stop BallSaver bWizardMode=False:StopPlayerModeVideo:bWizardMode=True ' Must be done before bGameInPlay is set (Force it with boolean) bGameInPlayHidden = True Table1_KeyUp(LeftFlipperKey) ' Force Flippers Down Table1_KeyUp(RightFlipperKey) bGameInPlay = False SolLFlipper 0 ' ensure that the flippers are down SolRFlipper 0 mBalls2Eject = 0 ' Kill all the queued up multiballs CreateMultiballTimer.Enabled = False 'TBD: Play Red light screen like End Of Game 'TBD: Flash Light Up and Down 'TBD: Show Red background screen with Cherry Bomb Totals Summary ' whichever is more queue time or 8 seconds dim queueTime queueTime = getQueueTime ' See if we need to let animations finish playing if queueTime < 8000 then queueTime = 8000 vpmtimer.addtimer queueTime, "CherryBombDrained'" ' Let all the balls drain and then put bGameInPlay back and start a ball ScorbitBuildGameModes() end if End Sub Sub StopPlayerMode() debug.print "StopPlayerMode " & PlayerMode bIModeComplete=False ModeCountdownTimer.Enabled = False setUpgradeLight(False) ' flshUpgrade.TimerEnabled = False ' flshModeSelect.TimerEnabled = True sndGeneralHit = "" if bUsePUPDMD then ' FIX6: Mark screen 13 busy before LabelSet calls so AnimateShotMultLit defers ' (mode expiry + nova hit in same moment causes rapid LabelSet storm → VLC crash) bPupEventBusy = True dScreen13LastActivity = Timer() vpmtimer.addtimer 8000, "bPupEventBusy = False '" vpmtimer.addtimer 8000, "dScreen13LastActivity = 0 '" ' Turn off mode progress puPlayer.LabelSet pDMDText, "ModeProgress", "",0,"" ' Clear this in case they finished the mode puPlayer.LabelSet pDMDText,"HighScore1", "" ,1,"" puPlayer.LabelSet pDMDText,"HighScore2", "" ,1,"" puPlayer.LabelSet pDMDText,"HighScore3", "" ,1,"" End if dim a For each a in aRampLights ' Turn off all the ramp lights to reset the mode SSetLightColor kStack_Pri0, a, "white", 0 Next For each a in aNameLights ' Turn off all the Name lights to reset the mode a.state = 0 Next Select Case PlayerMode case -1:' No Mode Selected ' if tmrCherryBomb.Enabled Then ' ' tmrCherryBomb.UserValue = -1 ' puPlayer.LabelSet pDMDText,"Timer", "" ,1,"" ' ' ShowPlayerModeComplete(2) ' flshUpgrade.TimerEnabled = False ' flshModeSelect.TimerEnabled = True ' ' bCherryBombDone = True ' Not sure if you can only do it once or not ' BallSaverTime = defBallSaverTime' Put it back to the original ' BallSaverTimerCancel ' Stop BallSaver ' StopPlayerModeVideo ' Must be done before bGameInPlay is set ' bGameInPlay = False ' SolLFlipper 0 ' ensure that the flippers are down ' SolRFlipper 0 ' ' mBalls2Eject = 0 ' Kill all the queued up multiballs ' CreateMultiballTimer.Enabled = False ' BallSaverActiveBuffer = 0 ' ' 'TBD: Play Red light screen like End Of Game ' 'TBD: Flash Light Up and Down ' 'TBD: Show Red background screen with Cherry Bomb Totals Summary ' vpmtimer.addtimer 8000, "CherryBombDrained'" ' Let all the balls drain and then put bGameInPlay back and start a ball ' end if Case 0: ' Nebula - Pod Chase (10 shots) Case 1: ' Ronan - Sanctuary (5 shots) If ModePercent(PlayerMode) < 100 Then ' We didnt complete the mode timer expired, start over ModeProgress(PlayerMode) = 0 ModePercent(PlayerMode) = 0 End If Case 2: ' Yandu - Yaka Arrow (8 shots) Case 3: ' Star Lord - Quills Quest (12 shots) ' Start timers to switch Arrows if ModePercent(PlayerMode) < 100 then HurryUpFinish ' Stop Hurryup if we didnt finish BallSaverTime = defBallSaverTime bQuillsQuestFirstTime=True EnableOrb(True) 'OrbTarget1Disabled.Collidable = False ' Enable OrbMB if bGrootMouthDisabled then DisableGrootMouth(False) ' Re-Enable Case 4: ' Rocket - Knowhere (8 shots) SSetLightColor kStack_Pri0, lRocketArrow, "orange", 0 SSetLightColor kStack_Pri0, lgr_a, "orange", 0 Case 5: ' DRAX - Escape Kyln (7 shots, Hadron Enforcer works on all except Rocket) SetLightColor lNova_sw2, modeRampColor, PlayerState(CurrentPlayer).lNovaStates(0) SetLightColor lNova_sw3, modeRampColor, PlayerState(CurrentPlayer).lNovaStates(1) SetLightColor lNova_sw4, modeRampColor, PlayerState(CurrentPlayer).lNovaStates(2) SetLightColor lNova_sw8, modeRampColor, PlayerState(CurrentPlayer).lNovaStates(3) SetLightColor lNova_sw9, modeRampColor, PlayerState(CurrentPlayer).lNovaStates(4) Case 6: ' Gamora - Siblng Rvlry (8 shots) Case 7: ' Broker - Antique Shop (7 shots) End Select ' Turn off all the Mode Lights Light020.State = 0:Light021.State = 0:Light022.State = 0:Light023.State = 0 Light024.State = 0:Light025.State = 0:Light026.State = 0:Light027.State = 0 if PlayerMode <> -1 then StackState(kStack_Pri0).Disable ' Disable this stack level if bCompetitionMode and ModePercent(PlayerMode) < 50 then ' If we didnt get at least 50% we dont save (Competition Mode) ModePercent(PlayerMode) = 0 ModeProgress(PlayerMode) = 0 End If End If SetModeLights() ' Set mode lights based on progress setModeSelectLight(True) UpdateSwitchHitCnt 0 if PlayerMode <> -1 Then ' Start 2nd Mode debug.print "2nd Mode? " & ModePercent(PlayerMode) & " 2ndMode:" & bSecondMode if ModePercent(PlayerMode) >= 100 and bSecondMode then PlayerMode2 = PlayerMode StartPlayerMode2 ' If you drain to 1 ball 2nd mode ends Else StopPlayerModeVideo End if End If PlayerMode = -1 CheckWizardModesReady ' See if we need to enable wizard modes ScorbitBuildGameModes() End Sub sub CheckWizardModesReady() if bWizardMode then exit sub ' We are in a wizard mode no need to check to enable one if modesCompleted >= 4 and bCherryBombDone=False and bGrootMultiball=False and bOrbMultiBall=False and PlayerMode=-1 Then ' Dont stack CB debug.print "Setup CherryBomb" SetLightColor lStarLordArrow, "red", 2 if bCherryBombReady = False Then ' Dont ring bell if we aready set it bCherryBombReady = True PlaySoundVol "Bells", VolSfx End if elseif modes50 = 8 and Light033.state <>0 and Light030.state <>0 and bImmolationDone=False and PlayerMode=-1 Then ' Immolation Mode (all 8 >50, groot and orb multi ball complete) debug.print "Setup Immolation" SetLightColor lStarLordArrow, "white", 0 SetLightColor Light029, "white", 2 if bImmolationReady=False then bImmolationReady = True PlaySoundVol "Bells", VolSfx End If PlayScoopLightSeq elseif modesCompleted=8 and Light029.state <>0 and Light033.state=1 and Light030.state=1 Then ' Complete all modes and immolation completed debug.print "Setup Xandar" if bXandarReady=False then PlaySoundVol "gg_quote11", VolDef bXandarReady = True SetLightColor lStarLordArrow, "purple", 0 SetLightColor Light031, "white", 2 PlayScoopLightSeq End If End Sub Sub PlayScoopLightSeq() LightSeqScoopArrow.Play SeqDiagUpRightOn, 30, 1 End Sub Sub StopScoopLightSeq() LightSeqScoopArrow.StopPlay End Sub Sub LightSeqScoopArrow_Playdone() PlayScoopLightSeq End Sub Sub SetModeLightComplete(Idx, Light) Debug.print "SetModeLightComplete: " & idx & " pct:" & ModePercent(Idx) Dim bUpdated:bUpdated = False if ModePercent(idx) > 0 then modesStarted=modesStarted+1 End If If (ModePercent(Idx) >= 50) or (bImmolationQualSanctuary and idx=kModeRonan) Then ' 50% flashes slow - Sactuary is special if idx=kModeRonan then bImmolationQualSanctuary=True ' Save this off bUpdated=True Light.State = 2 modes50=modes50+1 Light.BlinkInterval=BlinkIntSlow Light.BlinkPattern=BlinkPatternSlow End If if ModePercent(Idx) >= 100 Then ' 100% Is Solid bUpdated=True Light.State = 1 modesCompleted=modesCompleted+1 Light.BlinkInterval=BlinkIntDef Light.BlinkPattern=BlinkPatternDef End If if Idx = PlayerMode then ' Current mode flashes if bSecondMode = False then bUpdated=True Light.State = 2 Light.BlinkInterval=BlinkIntDef Light.BlinkPattern=BlinkPatternDef End if End If if bUpdated=False Then Light.BlinkInterval=BlinkIntDef Light.BlinkPattern=BlinkPatternDef End If End Sub Sub SetModeLights debug.print "SetModeLights" ' Of any of the modes are 1/2 done then Flash modesStarted=0 modes50=0 modesCompleted=0 SetModeLightComplete 0, Light020 SetModeLightComplete 1, Light021 SetModeLightComplete 2, Light022 SetModeLightComplete 3, Light023 SetModeLightComplete 4, Light024 SetModeLightComplete 5, Light025 SetModeLightComplete 6, Light026 SetModeLightComplete 7, Light027 if modes50 >=3 and PlayerState(CurrentPlayer).bExtraball_2 = False then ' started 3 modes PlayerState(CurrentPlayer).bExtraball_2 = True setExtraBallLight(True) 'flshExtraBall.TimerEnabled = True End If if modesCompleted >=6 and PlayerState(CurrentPlayer).bExtraball_3 = False then ' Finished 6 modes PlayerState(CurrentPlayer).bExtraball_3 = True setExtraBallLight(True) 'flshExtraBall.TimerEnabled = True End If End Sub Sub CheckModeProgress2nd(trigger_name) dim bValidHit dim a, b, i dim hitLight Dim bModeComplete bModeComplete = False bValidHit = False dim thisScore if PlayerMode <> -1 Then ' Just in case we get back in here we bail because we are already 100% progress debug.print "Mode Progress2: " & ModePercent(PlayerMode) if Mode2Percent(PlayerMode) >= 100 then debug.print "WE SHOULDNT GET HERE. Skip Score: " & ModePercent(PlayerMode) Exit Sub End If End If Select Case PlayerMode2 case -1:' No Mode Selected Case 0: ' Nebula - Pod Chase (10 shots) - CHECKED SCORE For each a in aRampLights if a.name = trigger_name and StackState(kStack_Pri0).GetArrowState(a) <> 0 Then ' Hit Ramp that was lit 'PlaySound "gg_RampHit" 'LightSeqScore.Play SeqUpOn, 100, 0 ' Play sounds PlayProgress2 trigger_name, False PlaySoundVol "sfx_BaseHit6", VolSfx DoAnimateScore kModeNebula, 2, 750000 Mode2Progress(PlayerMode2) = Mode2Progress(PlayerMode2)+1 Mode2Percent(PlayerMode2) = CINT((Mode2Progress(PlayerMode2) / 10) * 100) 'AddScore 125000 * Mode2Progress(PlayerMode2) ' Looks like the 2nd mode is 125k increase for each ramp shot AddScore 750000 ' Manu Video UpdateHitCntMsg "Ramps Left: ", 10 - Mode2Progress(PlayerMode2) if (Mode2Progress(PlayerMode2) >= 10) Then Mode2Percent(PlayerMode2) = 100 bModeComplete = True End If exit for End If Next Case 1: ' Ronan - Sanctuary (20 shots) if trigger_name = "tgHadron0" then tgHadron0.UserValue = 0 If rovHadronPos=0 then bValidHit = true lHadron0.state=1 rovHadronStates(0)=1 Else lHadron0.state=rovHadronStates(0) End if end if if trigger_name = "tgHadron1" then tgHadron1.UserValue = 0 If rovHadronPos=1 then bValidHit = true lHadron1.state=1 rovHadronStates(1)=1 Else lHadron1.state=rovHadronStates(1) End if end if if trigger_name = "tgHadron2" then tgHadron2.UserValue = 0 If rovHadronPos=2 then bValidHit = true lHadron2.state=1 rovHadronStates(2)=1 Else lHadron2.state=rovHadronStates(2) End if end if if trigger_name = "tgHadron3" then tgHadron3.UserValue = 0 If rovHadronPos=3 then bValidHit = true lHadron3.state=1 rovHadronStates(3)=1 Else lHadron3.state=rovHadronStates(3) End if end if if trigger_name = "tgHadron4" then tgHadron4.UserValue = 0 If rovHadronPos=4 then bValidHit = true lHadron4.state=1 rovHadronStates(4)=1 Else lHadron4.state=rovHadronStates(4) End if end if if bValidHit then ' Only Roving count as actual hits AddScore 1250000 thisScore=1250000 thisScore = thisScore * Multiplier3x * MultiplierShot * PlayMultiplier QueueFlushPriority 2 ' Clear other scores waiting QueueScene "DoAnimateScore kModeRonan, 2, " & thisScore & " '", 2000, 2 PlaySoundVol "sfx_BaseHit" & INT(RND *2)+2, VolSfx 'SetLightColor hitLight, "yellow", 1 Mode2Progress(PlayerMode2) = Mode2Progress(PlayerMode2)+1 Mode2Percent(PlayerMode2) = CINT((Mode2Progress(PlayerMode2) / 20) * 100) UpdateSwitchHitCnt 20-Mode2Progress(PlayerMode2) if (Mode2Progress(PlayerMode2) >= 20) Then Mode2Percent(PlayerMode2) = 100 bModeComplete = True End If End If Case 2: ' Yandu - Yaka Arrow (8 shots) - CHECKED SCORE if trigger_name = "switch" then if SwitchHitCount > 0 then SwitchHitCount = SwitchHitCount - 1 UpdateSwitchHitCnt SwitchHitCount 'ModePoints = ModePoints + 250000 AddScore 300000 ' Video show 250K for each switch hit Mode2Percent(PlayerMode2) = (SwitchHitCount / 50) * 100 if SwitchHitCount = 1 then ' To get the big bonus you have to hit it before time is up SSetLightColor kStack_Pri0, lYonduArrow, modeRampColor, 0 End If Else bModeComplete = True End If elseif trigger_name = "lYonduArrow" then DMD "BONUS", CL(0, ModePoints), "", eNone, eNone, eNone, 1500, False, "" AddScore ModePoints Mode2Percent(PlayerMode2) = 100 bModeComplete = True End If Case 3: ' Star Lord - Quills Quest (12 shots) ' There really is no 2nd mode for quills quest. You just shoot the scoop for a hurry up finish if trigger_name = "lStarLordArrow" and bQuillsQuestBonusWait Then CollectQQFinalHurryUp bModeComplete = True End if Case 4: ' Drax - Knowhere (10 shots) For each a in aRampLights if a.name = trigger_name and StackState(kStack_Pri0).GetArrowState(a) <> 0 Then ' Loop that was lit 'PlaySound "gg_RampHit" 'LightSeqScore.Play SeqUpOn, 100, 0 ' Play sounds PlayProgress trigger_name Mode2Progress(PlayerMode2) = Mode2Progress(PlayerMode2)+1 Mode2Percent(PlayerMode2) = CINT((Mode2Progress(PlayerMode2) / 10) * 100) AddScore 2950000 ' 3350000 ' Manu Video thisScore=2950000 thisScore = thisScore * Multiplier3x * MultiplierShot * PlayMultiplier QueueFlushPriority 2 ' Clear other scores waiting QueueScene "DoAnimateScore kModeDrax, 2, " & thisScore & " '", 2000, 2 UpdateHitCntMsg "Loops Left: ", 10 - Mode2Progress(PlayerMode2) if (Mode2Progress(PlayerMode2) >= 10) Then Mode2Percent(PlayerMode2) = 100 bModeComplete = True End If exit for End If Next Case 5: ' Rocket - Escape Kyln (10 super lanes) 'if a.state <> 0 Then ' Hit lane (that was lit??) if trigger_name = "sw8" or trigger_name = "sw9" or trigger_name = "sw2" or trigger_name = "sw3" or trigger_name = "sw4" then 'PlaySound "gg_RampHit" 'LightSeqScore.Play SeqUpOn, 100, 0 ' Play sounds PlayProgress trigger_name Mode2Progress(PlayerMode2) = Mode2Progress(PlayerMode2)+1 Mode2Percent(PlayerMode2) = CINT((Mode2Progress(PlayerMode2) / 10) * 100) AddScore 2000000 ' Manu Video UpdateSwitchHitCnt 10-Mode2Progress(PlayerMode2) if (Mode2Progress(PlayerMode2) >= 10) Then Mode2Percent(PlayerMode2) = 100 bModeComplete = True End If End If 'End If Case 6: ' Gamora - Siblng Rvlry (10 shots) if trigger_name = "lGamoraArrow" then DMD "BONUS", CL(0, ModePointsSave), "", eNone, eNone, eNone, 1500, False, "" AddScore ModePointsSave PlaySoundVol "sfx_BaseHit8", VolSfx QueueFlushPriority 2 ' Clear other scores waiting QueueScene "DoAnimateScore kModeGamora, 1, " & ModePointsSave * Multiplier3x * MultiplierShot * PlayMultiplier & " '", 2000, 2 bModeComplete = True SetLightColor lGamoraName, "white", 0 End If Case 7: ' Broker - Antique Shop (100 Switch Hits) if trigger_name = "switch" Then SwitchHitCount = SwitchHitCount - 1 if SwitchHitCount Mod 25 = 0 then PlayProgress trigger_name 'UpdateSwitchHitCnt SwitchHitCount UpdateHitCntMsg "SWITCH HITS REMAINING: ", SwitchHitCount HurryUpCounter = HurryUpCounter + 10000 AddScore HurryUpCounter Mode2Percent(PlayerMode2) = 100-SwitchHitCount Mode2Progress(PlayerMode2) = SwitchHitCount debug.print "Broker Switch:" & SwitchHitCount if (SwitchHitCount <= 0) then bModeComplete = True Mode2Percent(PlayerMode2) = 100 End If End If End Select if bModeComplete then debug.print "2nd Mode complete" ShowPlayerModeComplete(-1) ' Show 2nd Mode total UpdateSwitchHitCnt 0 PlaySoundVol "LevelUp-3", VolSfx StopPlayerMode2 ' Stop this mode. End If End Sub Sub StartPlayerMode2() dim time if bSkillshotsReady(2) = False Then ' Close the gate before the mode start unless we are doing a skill shot LoopGateLeft.Open = False End If Gate002.Open = False puPlayer.LabelSet pDMDText,"TimeLbl", "Timer" ,0,"" puPlayer.LabelSet pDMDText,"Time", "" ,0,"" pDMDEvent(kDMD_PlayerMode2) Debug.print "StartPlayerMode2:" & PlayerMode2 if PlayerMode2 <> -1 Then StackState(kStack_Pri0).Enable(PlayerMode2) End If ModePoints = 0 ' Reset modepoints time = 2000 Select Case PlayerMode2 case -1:' No Mode Selected Case 0: ' Nebula - Pod Chase (10 shots) DMD "Start Mode", CL(0, "Pod Chase 2nd"), "", eNone, eNone, eNone, time, False, "" SSetLightColor kStack_Pri0, lGamoraArrow, modeRampColor, 1 SSetLightColor kStack_Pri0, lNebulaArrow, modeRampColor , 1 HurryUpCounter = 0 LoopGateLeft.Open = True ' Gates are open for a full orbit shots Gate002.Open = True 'UpdateHitCntMsg "Ramps Left: ", 10 QueueScene "UpdateHitCntMsg ""Ramps Left: "", 10 - Mode2Progress(PlayerMode2) '", 1, 1 Case 1: ' Ronan - Sanctuary (5 shots) DMD "Start Mode", CL(0, "Sanctuary 2nd"), "", eNone, eNone, eNone, time, False, "" SetLightColor lHadron0, "yellow", 1 ' make one flash to start the roving SetLightColor lHadron1, "yellow", 0 SetLightColor lHadron2, "yellow", 0 SetLightColor lHadron3, "yellow", 0 SetLightColor lHadron4, "yellow", 0 tgHadron0.UserValue = 0 tgHadron1.UserValue = 0 tgHadron2.UserValue = 0 tgHadron3.UserValue = 0 tgHadron4.UserValue = 0 rovHadronStates(0)=0 rovHadronStates(1)=0 rovHadronStates(2)=0 rovHadronStates(3)=0 rovHadronStates(4)=0 rovHadronPos=0 tmrRovingHadron.Enabled = True 'UpdateSwitchHitCnt 20 QueueScene "UpdateSwitchHitCnt 20-Mode2Progress(PlayerMode2) '", 1, 1 Case 2: ' Yandu - Yaka Arrow (8 shots) DMD "Start Mode", CL(0, "Yaka Arrow 2nd"), "", eNone, eNone, eNone, time, False, "" SSetLightColor kStack_Pri0, lYonduArrow, modeRampColor , 1 SwitchHitCount = 50 'UpdateSwitchHitCnt SwitchHitCount QueueScene "UpdateSwitchHitCnt SwitchHitCount '", 1, 1 PlaySoundVol "say-ShootTheTargets", VolDef Case 3: ' Star Lord - Quills Quest (12 shots) DMD "Start Mode", CL(0, "Quills Quest 2nd"), "", eNone, eNone, eNone, time, False, "" StartQQFinalHurryup SSetLightColor kStack_Pri0, lStarLordArrow, modeRampColor , 2 Case 4: ' Drax - Knowhere (8 shots) DMD "Start Mode", CL(0, "Knowhere 2nd"), "", eNone, eNone, eNone, time, False, "" SSetLightColor kStack_Pri0, lRonanArrow, modeRampColor , 1 SSetLightColor kStack_Pri0, lDraxArrow, modeRampColor , 1 HurryUpCounter = 0 LoopGateLeft.Open = True ' Gates are open for a full orbit shots Gate002.Open = True 'UpdateHitCntMsg "Loops Left: ", 10 QueueScene "UpdateHitCntMsg ""Loops Left: "", 10 - Mode2Progress(PlayerMode2) '", 1, 1 Case 5: ' Rocket - Escape Kyln (7 shots, Hadron Enforcer works on all except Rocket) DMD "Start Mode", CL(0, "Escape Kyln 2nd"), "", eNone, eNone, eNone, time, False, "" ' These are not lit during the second mode ' SSetLightColor kStack_Pri0, lRonanArrow, modeRampColor , 1 ' SSetLightColor kStack_Pri0, lDraxArrow, modeRampColor , 1 PlayerState(CurrentPlayer).lNovaStates(0)=0 ' Clear it so this mode didnt count progress PlayerState(CurrentPlayer).lNovaStates(1)=0 PlayerState(CurrentPlayer).lNovaStates(2)=0 PlayerState(CurrentPlayer).lNovaStates(3)=0 PlayerState(CurrentPlayer).lNovaStates(4)=0 'UpdateSwitchHitCnt 10 QueueScene "UpdateSwitchHitCnt 10-Mode2Progress(PlayerMode2) '", 1, 1 LoopGateLeft.Open = True ' Gates are open for a full orbit shots Gate002.Open = True Case 6: ' Gamora - Siblng Rvlry (8 shots) 'UpdateHitCntMsg "Gamora Ramp = ", FormatScore(ModePointsSave) QueueScene "UpdateHitCntMsg ""Gamora Ramp = "", FormatScore(ModePointsSave) '", 1, 1 DMD "Start Mode", CL(0, "Sibling Rivalry 2nd"), "", eNone, eNone, eNone, time, False, "" 'SSetLightColor kStack_Pri0, lGamoraArrow, modeRampColor, 1 SetLightColor lGamoraName, "white", 2 Case 7: ' Broker - Antique Shop (7 shots) DMD "Start Mode", CL(0, "Antiquites Shop 2nd"), "", eNone, eNone, eNone, time, False, "" SwitchHitCount = 100 HurryUpCounter = 10000 'UpdateSwitchHitCnt SwitchHitCount QueueScene "UpdateHitCntMsg ""SWITCH HITS REMAINING: "", SwitchHitCount '", 1, 1 PlaySoundVol "say-ShootTheTargets", VolDef End Select StartPlayerModeVideo False End Sub Sub StopPlayerMode2() If bSecondMode then debug.print "StopPlayerMode2 " & PlayerMode Dim a For each a in aRampLights ' Turn off all the ramp lights to reset the mode SSetLightColor kStack_Pri0, a, "white", 0 Next ' FIX6: Mark screen 13 busy before LabelSet so AnimateShotMultLit defers if nova hit simultaneously bPupEventBusy = True dScreen13LastActivity = Timer() vpmtimer.addtimer 8000, "bPupEventBusy = False '" vpmtimer.addtimer 8000, "dScreen13LastActivity = 0 '" puPlayer.LabelSet pDMDText,"Timer", "" ,1,"" ' Clear label just in case there is one Select Case PlayerMode2 case -1:' No Mode Selected Case 0: ' Nebula - Pod Chase (10 shots) LoopGateLeft.Open = False Gate002.Open = False Case 1: ' Ronan - Sanctuary (5 shots) tmrRovingHadron.Enabled = False Case 2: ' Yandu - Yaka Arrow (8 shots) Case 3: ' Star Lord - Quills Quest (12 shots) bQuillsQuestBonusWait=False HurryUpFinish Case 4: ' Drax - Knowhere (8 shots) LoopGateLeft.Open = False Gate002.Open = False Case 5: ' Rocket - Escape Kyln (7 shots, Hadron Enforcer works on all except Rocket) LoopGateLeft.Open = False Gate002.Open = False Case 6: ' Gamora - Siblng Rvlry (10 shots) SetLightColor lGamoraName, "white", 0 Case 7: ' Broker - Antique Shop (7 shots) End Select StopPlayerModeVideo StackState(kStack_Pri0).Disable End If UpdateSwitchHitCnt 0 bSecondMode = False CheckWizardModesReady ' See of we need to enable wizard modes End sub Sub debounceReset() ' Reset Debounce for those that dont have a timer bDebounce = False End Sub Dim rovHadronStates(5) dim rovHadronPos Sub tmrRovingHadron_Timer select case rovHadronPos case 0: lHadron0.state = rovHadronStates(rovHadronPos) lHadron1.state = 2 case 1: lHadron1.state = rovHadronStates(rovHadronPos) lHadron2.state = 2 case 2: lHadron2.state = rovHadronStates(rovHadronPos) lHadron3.state = 2 case 3: lHadron3.state = rovHadronStates(rovHadronPos) lHadron4.state = 2 case 4: lHadron4.state = rovHadronStates(rovHadronPos) lHadron0.state = 2 End Select rovHadronPos=rovHadronPos+1 if rovHadronPos>4 then rovHadronPos=0 End Sub Sub UpdateSwitchHitCnt(value) UpdateHitCntMsg "TARGETS LEFT: ", value End Sub Sub UpdateHitCntMsg(Message, value) if bUsePUPDMD and bPupStarted then if value <= "0" then puPlayer.LabelSet pDMDText,"Timer", "" ,1,"" Else puPlayer.LabelSet pDMDText,"Timer", Message & value ,1,"{'mt':2,'size':3.1}" End If End If End Sub Sub QuestLight2(LightName) ' Light the next 2 inserts dim light1 dim light2 dim a dim cnt Dim state Dim CurIdx bDebounce = False if (ModeProgress(PlayerMode) >= 12) Then light1 = 8 light2 = -1 Else CurIdx=GetBonusIndex(LightName) light1 = INT(7 * RND) Do While light1 = CurIdx light1 = INT(7 * RND) Loop light2 = light1 +1 End if for cnt = 0 to 7 state = 0 if cnt = light1 then state =1 if cnt = light2 then state =1 select case cnt case 0: SSetLightColor kStack_Pri0, lYonduArrow, "yellow", state case 1: SSetLightColor kStack_Pri0, lRonanArrow, "yellow", state case 2: SSetLightColor kStack_Pri0, lRocketArrow, "yellow", state case 3: SSetLightColor kStack_Pri0, lNebulaArrow, "yellow", state case 4: SSetLightColor kStack_Pri0, lgr_a, "yellow", state case 5: SSetLightColor kStack_Pri0, lBrokerArrow, "yellow", state case 6: SSetLightColor kStack_Pri0, lGamoraArrow, "yellow", state case 7: SSetLightColor kStack_Pri0, lDraxArrow, "yellow", state case 8: SSetLightColor kStack_Pri0, lStarLordArrow, "yellow", 2 End Select Next End Sub 'Sub tmrQuestRamps_Timer ' dim light1 ' dim light2 ' dim state1 ' dim state2 ' bDebounce = False ' ' light1 = INT(8 * RND + 1) ' Range 7-12 = (12-7+1) * Rnd + 7 ' light2 = INT(8 * RND + 1) ' Range 7-12 = (12-7+1) * Rnd + 7 ' Do While light2 = light1 ' light2 = INT(8 * RND + 1) ' Range 7-12 = (12-7+1) * Rnd + 7 ' Loop ' state1 = INT(RND * 2 + 1) ' Range 7-12 = (12-7+1) * Rnd + 7 ' state2 = INT(RND * 2 + 1) ' Range 7-12 = (12-7+1) * Rnd + 7 ' ' dim a ' dim cnt ' cnt = 1 ' For each a in aRampLights ' if (a.name <> "lStarLordArrow") then ' Skip Starlord arrow since it is always lit ' if (cnt = light1) then ' SSetLightColor kStack_Pri0, a, "yellow", state1 ' Elseif cnt = light2 then ' SSetLightColor kStack_Pri0, a, "yellow", state2 ' Else ' SSetLightColor kStack_Pri0, a, "yellow", 0 ' end if ' cnt = cnt+1 ' End If ' Next ' ' tmrQuestRamps.Interval = 1000 * INT(RND * 6 + 7) ' Range 7-12 = (12-7+1) * Rnd + 7 'End Sub Sub tmrCherryBombMouth_Timer if GrootMouth_IsDropped Then tmrCherryBombMouth.Interval=kMouthAnimationSpeed GrootMouth_Drop(False) Else tmrCherryBombMouth.Interval=kMouthAnimationSpeed+300 GrootMouth_Drop(True) End If End Sub Sub tmrCherryBomb_Timer tmrCherryBomb.Interval = 1000 if tmrCherryBomb.UserValue > 0 then tmrCherryBomb.UserValue=tmrCherryBomb.UserValue-1 puPlayer.LabelSet pDMDText,"Timer", "Time remaining: " & tmrCherryBomb.UserValue ,1, "{'mt':2, 'size':3.5}" ' puPlayer.LabelSet pDMDText,"Timer", "Time remaining: " & tmrCherryBomb.UserValue ,1, "" if tmrCherryBomb.UserValue <= 10 Then PlaySoundVol "say-" & tmrCherryBomb.UserValue, VolDef End if Elseif tmrCherryBomb.UserValue <> -1 then EndCherryBomb End If End Sub Sub CherryBombDrained if BallsOnPlayfield<>0 then ' Make sure all the balls are done vpmtimer.addtimer 500, "CherryBombDrained'" ' Let all the balls drain and then put bGameInPlay back and start a ball Exit Sub End if debug.print "CherryBombDrained: " & BallsOnPlayfield & " " & ModeCountdownTimer.UserValue puPlayer.LabelSet pDMDText,"Timer", "" ,1, "{'mt':2, 'size': 6}" bGameInPlay = True bGameInPlayHidden = False bMultiBallMode=False ' BallsOnPlayfield = 0 bAutoPlunger = False bBallSaverReady = True ' Need to enable ball saver for the next ball StackState(kStack_Pri2).Disable tmrCherryBombMouth.Enabled = False tmrCherryBomb.Enabled = False bWizardMode = False if PlayerMode <> -1 and bSecondMode=False and ModeCountdownTimer.UserValue > 0 then ' Still in a mode then restart the video aRampLightsRestore ' Restore ramp colors WaitPlayerMode StartPlayerModeVideo True ' TBD Make this skip to the correct position if PUP ever supports it pausemedia pDMDFull pausemedia pMusic ModeCountdownTimer.enabled = False ' Pause the timer ' TBD Find out what the first time I called this it sometimes doesnt work (The drain_unhit is getting called somehow) else EnablePlayerSelect UpdatePlayerMode End if if (bBallInPlungerLane=False) then CreateNewBall() ' Put a ball in the lane End If End Sub ' Standard things for all switches ' Need to track the last 2 because sometimes you can hit 1 switch and durimg a Multiball another switch gets hit before the one you were tracking and event gets missed Sub SwitchHit(switch) LastSwitchHit2 = LastSwitchHit LastSwitchHit = switch End Sub ' ********************************************************************* ' Table Object Hit Events ' ' Any target hit Sub will follow this: ' - play a sound ' - do some physical movement ' - add a score, bonus ' - check some variables/modes this trigger is a member of ' - set the "LastSwicthHit" variable in case it is needed later ' ********************************************************************* ' Slingshots has been hit Dim LStep, RStep Sub LeftSlingShot_Slingshot If Tilted Then Exit Sub LS.VelocityCorrect(activeball) PlaySoundAt SoundFXDOF("CrispySlingLeft", 103, DOFPulse, DOFContactors), Lemk DOF 104, DOFPulse LeftSling4.Visible = 1:LeftSling1.Visible = 0 Lemk.RotX = 26 LStep = 0 LeftSlingShot.TimerEnabled = True ' add some points AddScore 170 ' add some effect to the table? 'FlashForMs l20, 1000, 50, 0:FlashForMs l20f, 1000, 50, 0 'FlashForMs l21, 1000, 50, 0:FlashForMs l21f, 1000, 50, 0 ' remember last trigger hit by the ball SwitchHit "LeftSlingShot" CheckModeProgress "switch" End Sub Sub LeftSlingShot_Timer Select Case LStep Case 1:LeftSLing4.Visible = 0:LeftSLing3.Visible = 1:Lemk.RotX = 14 Case 2:LeftSLing3.Visible = 0:LeftSLing2.Visible = 1:Lemk.RotX = 2 Case 3:LeftSLing2.Visible = 0:LeftSling1.Visible = 1:Lemk.RotX = -10:Gi2.State = 1:LeftSlingShot.TimerEnabled = False End Select LStep = LStep + 1 End Sub Sub RightSlingShot_Slingshot If Tilted Then Exit Sub RS.VelocityCorrect(activeball) PlaySoundAt SoundFXDOF("CrispySlingRight", 105, DOFPulse, DOFContactors),Remk DOF 106, DOFPulse RightSling4.Visible = 1:RightSling1.Visible = 0 Remk.RotX = 26 RStep = 0 RightSlingShot.TimerEnabled = True ' add some points AddScore 170 ' add some effect to the table? 'FlashForMs l22, 1000, 50, 0:FlashForMs l22f, 1000, 50, 0 'FlashForMs l23, 1000, 50, 0:FlashForMs l23f, 1000, 50, 0 ' remember last trigger hit by the ball SwitchHit "RightSlingShot" CheckModeProgress "switch" End Sub Sub RightSlingShot_Timer Select Case RStep Case 1:RightSLing4.Visible = 0:RightSLing3.Visible = 1:Remk.RotX = 14: Case 2:RightSLing3.Visible = 0:RightSLing2.Visible = 1:Remk.RotX = 2: Case 3:RightSLing2.Visible = 0:RightSLing1.Visible = 1:Remk.RotX = -10:Gi4.State = 1:RightSlingShot.TimerEnabled = False End Select RStep = RStep + 1 End Sub '****************** ' Guardians Target '****************** Sub tgtGuardians_Hit() if tgtGuardians.UserValue = 1 then exit sub if tmrCherryBomb.enabled then exit sub ' No guardians during CherryBomb tgtGuardians.UserValue=1 tmrGuardiansAnim_Type=0 SpellGuardians=SpellGuardians+1 PuPlayer.LabelSet pDMDText, "Guardians2", "PuPOverlays\\GUARDIAN-"&SpellGuardians&".png",1,"{'mt':2,'color':111111,'width':31, 'height':8,'yalign':0,'ypos':0.0,'xpos':50.4}" PlaySoundVol "gg_SpellG", VolSfx If SpellGuardians < 8 then If LightGuardians.state = 0 then SetLightColor LightGuardians, "white", 4 Else SetLightColor LightGuardians, "white", 3 End if End if Select Case SpellGuardians case 1: tmrGuardiansAnim_XPos=36.8 DisplayDMDText "G","", 1000 case 2: tmrGuardiansAnim_XPos=40.2 DisplayDMDText "GU","", 1000 case 3: tmrGuardiansAnim_XPos=44 DisplayDMDText "GUA","", 1000 case 4: tmrGuardiansAnim_XPos=48 DisplayDMDText "GUAR","", 1000 case 5: tmrGuardiansAnim_XPos=51.4 DisplayDMDText "GUARD","", 1000 case 6: tmrGuardiansAnim_XPos=53.9 DisplayDMDText "GUARDI","", 1000 case 7: tmrGuardiansAnim_XPos=56.5 DisplayDMDText "GUARDIA","", 1000 case 8: tmrGuardiansAnim_XPos=60 DisplayDMDText "GUARDIAN","", 1000 SetLightColor LightGuardians, "white", 2 SetSlowPulse LightGuardians case 9: tmrGuardiansAnim_XPos=64 AddScore 48890 ' 48890+26110=75K PlaySoundVol "gg_WeAreTheGOTG", VolDef 'PlaySoundVol "gg_SpellGuardians", VolSfx PlaySoundVol "sfx_SpellGOTG", VolSfx AddBonusMultiplier 1 tmrGuardiansAnim_Type=1 SpellGuardians=DMDFet(kDMDFeT_GuardiansSpellout) setMysteryLight(True) SetDefPulse LightGuardians SetLightColor LightGuardians, "white", 0 End Select 'vpmtimer.addtimer 1200, "tgtGuardians_debounce '" tmrGuardiansAnim_YPos=150 tmrGuardiansAnim_Size=10 tmrGuardiansAnim_BSize1=1 tmrGuardiansAnim_BSize2=1.05 tmrGuardiansAnim_BSize3=1.12 tmrGuardiansAnim.UserValue=0 tmrGuardiansAnim.Interval = 50 tmrGuardiansAnim.Enabled = True End Sub 'Sub tgtGuardians_debounce ' AddScore 26110 ' tgtGuardians.UserValue = 0 ' if bUsePUPDMD then puPlayer.LabelSet pDMDText,"Guardians", "PuPOverlays\\clear.png" ,1,"" 'End Sub Dim tmrGuardiansAnim_Type ' 0=Letter, 1=Complete Dim tmrGuardiansAnim_Size Dim tmrGuardiansAnim_YPos Dim tmrGuardiansAnim_XPos Dim tmrGuardiansAnim_BSize1 Dim tmrGuardiansAnim_BSize2 Dim tmrGuardiansAnim_BSize3 Sub tmrGuardiansAnim_Timer() dim BorderSize if tmrGuardiansAnim_Type=0 then ' Add Letter if tmrGuardiansAnim.UserValue=0 then tmrGuardiansAnim_YPos=tmrGuardiansAnim_YPos-15 if tmrGuardiansAnim_Size>1 then tmrGuardiansAnim_Size=tmrGuardiansAnim_Size-1 if tmrGuardiansAnim_YPos<=15 then tmrGuardiansAnim.UserValue=1:tmrGuardiansAnim_YPos=15 ' puPlayer.LabelSet pDMDText,"Guardians", "PuPOverlays\\G_" & SpellGuardians+1 & ".png" ,1,"{'mt':2, 'yalign':2, 'width':" & 12 & ",'height':" & 21.8 & ",'xpos':51.4,'ypos':15}" puPlayer.LabelSet pDMDText,"Guardians", "PuPOverlays\\G_" & SpellGuardians & ".png" ,1,"{'mt':2, 'yalign':2, 'width':" & 12*tmrGuardiansAnim_Size & ",'height':" & 21.8*tmrGuardiansAnim_Size & ",'xpos':" & tmrGuardiansAnim_XPos & ",'ypos':" & tmrGuardiansAnim_YPos & "}" Else tgtGuardians.UserValue=0 tmrGuardiansAnim_BSize1=tmrGuardiansAnim_BSize1+0.03 tmrGuardiansAnim_BSize2=tmrGuardiansAnim_BSize2+0.03 tmrGuardiansAnim_BSize3=tmrGuardiansAnim_BSize3+0.03 if tmrGuardiansAnim_BSize1>1.25 then tmrGuardiansAnim_BSize1=1 if tmrGuardiansAnim_BSize2>1.25 then tmrGuardiansAnim_BSize2=1 if tmrGuardiansAnim_BSize3>1.25 then tmrGuardiansAnim_BSize3=1 PuPlayer.LabelSet pDMDText, "Guardians3a", "PuPOverlays\\G_B.png",1,"{'mt':2,'width':" & 36*tmrGuardiansAnim_BSize1 & ", 'height':" & 22*tmrGuardiansAnim_BSize1 & ",'yalign':0,'ypos':0,'xpos':50.5}" PuPlayer.LabelSet pDMDText, "Guardians3b", "PuPOverlays\\G_B.png",1,"{'mt':2,'width':" & 36*tmrGuardiansAnim_BSize2 & ", 'height':" & 22*tmrGuardiansAnim_BSize2 & ",'yalign':0,'ypos':0,'xpos':50.5}" PuPlayer.LabelSet pDMDText, "Guardians3c", "PuPOverlays\\G_B.png",1,"{'mt':2,'width':" & 36*tmrGuardiansAnim_BSize3 & ", 'height':" & 22*tmrGuardiansAnim_BSize3 & ",'yalign':0,'ypos':0,'xpos':50.5}" if tmrGuardiansAnim.UserValue=1 then puPlayer.LabelSet pDMDText,"Guardians", "PuPOverlays\\G_" & SpellGuardians & ".gif" ,1,"{'mt':2, 'anigif':150, 'yalign':2, 'width':" & 12*tmrGuardiansAnim_Size & ",'height':" & 21.8*tmrGuardiansAnim_Size & ",'xpos':" & tmrGuardiansAnim_XPos & ",'ypos':" & tmrGuardiansAnim_YPos & "}" elseif tmrGuardiansAnim.UserValue=40 then AddScore 26110 tmrGuardiansAnim.Enabled=False puPlayer.LabelSet pDMDText,"Guardians", "PuPOverlays\\clear.png",1,"" PuPlayer.LabelSet pDMDText, "Guardians3a", "PuPOverlays\\clear.png",1,"" PuPlayer.LabelSet pDMDText, "Guardians3b", "PuPOverlays\\clear.png",1,"" PuPlayer.LabelSet pDMDText, "Guardians3c", "PuPOverlays\\clear.png",1,"" End if tmrGuardiansAnim.UserValue=tmrGuardiansAnim.UserValue+1 End if Else ' Completion tmrGuardiansAnim.UserValue=tmrGuardiansAnim.UserValue+1 if tmrGuardiansAnim.UserValue=1 then puPlayer.LabelSet pDMDText,"Guardians", "PuPOverlays\\GOTG.gif" ,1,"{'mt':2, 'anigif':100, 'yalign':1, 'width':110,'height':110,'xpos':50,'ypos':0}" tmrGuardiansAnim_YPos=150 tmrGuardiansAnim_XPos=48 Elseif tmrGuardiansAnim.UserValue>80 and tmrGuardiansAnim.UserValue<115 then tmrGuardiansAnim_YPos=tmrGuardiansAnim_YPos-15 if tmrGuardiansAnim_Size>1 then tmrGuardiansAnim_Size=tmrGuardiansAnim_Size-1 if tmrGuardiansAnim_YPos<=60 then tmrGuardiansAnim_YPos=60 puPlayer.LabelSet pDMDText,"Guardians3a", "PuPOverlays\\x" & BonusMultiplier & ".gif" ,1,"{'mt':2, 'anigif':100, 'yalign':0, 'width':31.8, 'height':55,'xpos':48.2,'ypos':22}" else puPlayer.LabelSet pDMDText,"Guardians3a", "PuPOverlays\\x" & BonusMultiplier & ".png" ,1,"{'mt':2, 'yalign':2, 'width':" & 12*tmrGuardiansAnim_Size & ",'height':" & 21.8*tmrGuardiansAnim_Size & ",'xpos':" & tmrGuardiansAnim_XPos & ",'ypos':" & tmrGuardiansAnim_YPos & "}" End if elseif tmrGuardiansAnim.UserValue >= 115 then puPlayer.LabelSet pDMDText,"Guardians", "PuPOverlays\\clear.png",1,"" PuPlayer.LabelSet pDMDText, "Guardians3a", "PuPOverlays\\clear.png",1,"" PuPlayer.LabelSet pDMDText, "Guardians3b", "PuPOverlays\\clear.png",1,"" PuPlayer.LabelSet pDMDText, "Guardians3c", "PuPOverlays\\clear.png",1,"" if flshMystery.TimerEnabled=False then ' Only Award Mystery if it isnt lit PlaySoundVol "sfx_Mystery1", VolSfx 'pDMDEvent(kDMD_Myst_IsLit) QueueScene "playmedia ""Video-0x0032.mp4"", ""PupVideos"", pOverVid, """", -1, """", 1, 1 '", 3124, 1 End if tgtGuardians.UserValue=0 tmrGuardiansAnim.Enabled=False End if End if End Sub Sub SpinnerDrax_Spin() If Tilted Then Exit Sub if PlayerMode2 <> kModeYandu then CheckModeProgress("switch") ' No spinner progress on YakaArrow 2 PlaySoundAt "fx_spinner", SpinnerDrax PlaySoundVol "sfx-spinner", VolSfx AddScore 1000 End Sub Sub SpinnerRonan_Spin() If Tilted Then Exit Sub if PlayerMode2 <> kModeYandu then CheckModeProgress("switch") ' No spinner progress on YakaArrow 2 PlaySoundAt "fx_spinner", SpinnerRonan PlaySoundVol "sfx-spinner", VolSfx AddScore 1000 End Sub '********************* ' Catch the Arrow ramps and if their multipliers are flashing mark it and disable multipliers '********************* Sub tRonan_m_Hit() ' Moved to sw12_hit ' Left Loop SwitchHit "tRonan_m" End Sub Sub tGroot_m_Hit() ClearShotMultiplier(lgr_m) MultiplierShot = 1 ' Clear shot multiplier ' Moved to GrootMouth_Hit End Sub Sub tDrax_m_Hit() ' Moved to sw11_hit SwitchHit "tDrax_m" End Sub Sub tGamora_m_Hit() ClearShotMultiplier(lGamora_m) DoCombo lGamoraArrow, False ' Add MultiplierShot If tmrSkillshot.Enabled and lGamoraArrow.state = 2 Then ' Hold Left, Loop around and hit Orb, Right Ramp or Right Orbit AddScore 1000000 DOF 127, DOFPulse PlaySoundVol "gg_SkillShot", VolDef DOF 325, DOFPulse ' James DOF QueueScene "ScenePlayMessage ""SkillShot.mp4"", """","""",""1000000"" '", 2000, 1 QueueScene "SceneClearPlayMessage '", 0, 1 End If CheckModeProgress "lGamoraArrow" SwitchHit "tGamora_m" Addscore 1170 BonusAddModeHit(6) ' Setup ramp combo ' lNebulaArrow.BlinkInterval = BlinkIntFast ' lNebulaArrow.state = 2 ' vpmtimer.addtimer 3500, "rampComboNebula '" MultiplierShot = 1 ' Clear shot multiplier End Sub Sub tgAntiqueShop_Dropped ' What does the antique target do?? Bonus?? AddScore 1110 tgAntiqueShop.isDropped = False ' TBD Play Antique Shop Video End Sub 'Sub tYando_m_Hit() ' Should this move to tgAntiqueShop_hit? (Seems like in the video it didnt have to get all the way up to Count) ' If lYando_m.State = 2 Then ' If multilier is flashing ' ClearShotMultiplier() ' SetLightColor lYando_m, "green", 1 ' End If ' CheckModeProgress "lYonduArrow" ' LastSwitchHit="tYando_m" 'End Sub ' 'sub rampComboGamora ' lGamoraArrow.BlinkInterval = BlinkIntDef ' SetLightColorRestore lGamoraArrow, -1 'End Sub 'sub rampComboNebula ' lNebulaArrow.BlinkInterval = BlinkIntDef ' SetLightColorRestore lNebulaArrow, -1 'End Sub Sub DoCombo(light, bLeftSide) dim i if tmrCombo.Enabled then ' Combo is Active (onlt active on 2 or more combos if bLeftSide<>tmrCombo.UserValue then ' It is on the other side if light.state=2 and light.BlinkInterval = BlinkIntFast then ' Fast blink for the combo Debug.print "COMBO! " & MultiplierShot & " " & ComboCount ModeScore(CurrentPlayer, 0)=ModeScore(CurrentPlayer, 0)+1 MultiplierShot=MultiplierShot+ComboCount ComboCount=ComboCount+1 End if End if End if 'StackState(kStack_Pri3).GetArrowState(lBrokerArrow) if bLeftSide then Debug.print "COMBO LEFT:" & MultiplierShot if lBrokerArrow.state<>0 then lBrokerArrow.BlinkInterval = BlinkIntFast lBrokerArrow.state = 2 End if if lGamoraArrow.state<>0 then lGamoraArrow.BlinkInterval = BlinkIntFast lGamoraArrow.state = 2 End if if lDraxArrow.state<>0 then lDraxArrow.BlinkInterval = BlinkIntFast lDraxArrow.state = 2 End if if lStarLordArrow.state<>0 then lStarLordArrow.BlinkInterval = BlinkIntFast lStarLordArrow.state = 2 End if If lgr_a.state<>0 then lgr_a.BlinkInterval = BlinkIntFast lgr_a.state = 2 else lgr_a.BlinkInterval = BlinkIntDef SetLightColorRestore lgr_a, -1 End if lYonduArrow.BlinkInterval = BlinkIntDef lRonanArrow.BlinkInterval = BlinkIntDef lRocketArrow.BlinkInterval = BlinkIntDef lNebulaArrow.BlinkInterval = BlinkIntDef SetLightColorRestore lYonduArrow, -1 SetLightColorRestore lRonanArrow, -1 SetLightColorRestore lRocketArrow, -1 SetLightColorRestore lNebulaArrow, -1 Else Debug.print "COMBO Right:" & MultiplierShot if lYonduArrow.state<>0 then lYonduArrow.BlinkInterval = BlinkIntFast lYonduArrow.state = 2 End if if lRonanArrow.state<>0 then lRonanArrow.BlinkInterval = BlinkIntFast lRonanArrow.state = 2 End if if lRocketArrow.state<>0 then lRocketArrow.BlinkInterval = BlinkIntFast lRocketArrow.state = 2 End if if lNebulaArrow.state<>0 then lNebulaArrow.BlinkInterval = BlinkIntFast lNebulaArrow.state = 2 End if If lgr_a.state<>0 then lgr_a.BlinkInterval = BlinkIntFast lgr_a.state = 2 else lgr_a.BlinkInterval = BlinkIntDef SetLightColorRestore lgr_a, -1 End if lBrokerArrow.BlinkInterval = BlinkIntDef lGamoraArrow.BlinkInterval = BlinkIntDef lDraxArrow.BlinkInterval = BlinkIntDef lStarLordArrow.BlinkInterval = BlinkIntDef SetLightColorRestore lBrokerArrow, -1 SetLightColorRestore lGamoraArrow, -1 SetLightColorRestore lDraxArrow, -1 SetLightColorRestore lStarLordArrow, -1 if bCherryBombReady or bXandarReady or bImmolationReady Then ' Make sure we dont kill this CheckWizardModesReady End if End if tmrCombo.Enabled = False tmrCombo.UserValue = bLeftSide tmrCombo.Interval = 3500 tmrCombo.Enabled = True End Sub Sub tmrCombo_Timer() ' Clear the Combo Debug.print "COMBO END:" & tmrCombo.UserValue if tmrCombo.UserValue then ' bLeftSide (Gamora) lBrokerArrow.BlinkInterval = BlinkIntDef lGamoraArrow.BlinkInterval = BlinkIntDef lDraxArrow.BlinkInterval = BlinkIntDef lStarLordArrow.BlinkInterval = BlinkIntDef lgr_a.BlinkInterval = BlinkIntDef SetLightColorRestore lBrokerArrow, -1 SetLightColorRestore lGamoraArrow, -1 SetLightColorRestore lDraxArrow, -1 SetLightColorRestore lStarLordArrow, -1 SetLightColorRestore lgr_a, -1 if bCherryBombReady or bXandarReady or bImmolationReady Then ' Make sure we dont kill this CheckWizardModesReady End if Else ' RightSide (Nebula) lYonduArrow.BlinkInterval = BlinkIntDef lRonanArrow.BlinkInterval = BlinkIntDef lRocketArrow.BlinkInterval = BlinkIntDef lNebulaArrow.BlinkInterval = BlinkIntDef lgr_a.BlinkInterval = BlinkIntDef SetLightColorRestore lYonduArrow, -1 SetLightColorRestore lRonanArrow, -1 SetLightColorRestore lRocketArrow, -1 SetLightColorRestore lNebulaArrow, -1 SetLightColorRestore lgr_a, -1 End if ComboCount=1 tmrCombo.Enabled = False End Sub 'Sub tRocket_m_Hit() ' Dummy function thaat is called from RocketKicker Now ' ClearShotMultiplier(lRocket_m) ' CheckModeProgress "lRocketArrow" ' LastSwitchHit="tRocket_m" ' MultiplierShot = 1 ' Clear shot multiplier 'End Sub Sub tNebula_m_Hit() ClearShotMultiplier(lNebula_m) DoCombo lNebulaArrow, True ' Add to ShotMultiplier CheckModeProgress "lNebulaArrow" SwitchHit "tNebula_m" Addscore 1170 BonusAddModeHit(3) ' Setup ramp combo ' lGamoraArrow.BlinkInterval = BlinkIntFast ' lGamoraArrow.state = 2 ' vpmtimer.addtimer 3500, "rampComboGamora '" MultiplierShot = 1 ' Clear shot multiplier End Sub Sub tBroker_m_Hit() ' This is really a dummy function now since I switched to the Orb Triggers ClearShotMultiplier(lBroker_m) DoCombo lBrokerArrow, False ' Add to ShotMultiplier CheckModeProgress "lBrokerArrow" SwitchHit "tBroker_m" MultiplierShot = 1 ' Clear shot multiplier End Sub 'Sub tStarLord_m_Hit() ' Moved to Left Scoop ' If lStarLord_m.State = 2 Then ' If multilier is flashing ' ClearShotMultiplier() ' SetLightColor lStarLord_m, "green", 1 ' End If ' 'LastSwitchHit="tStarLord_m" ' 'CheckModeProgress "lStarLordArrow" ' You have to get it in the scoop 'End Sub Dim ShotMultiplierStrobe Sub ClearShotMultiplier(light) ' Clear Green Strobing Shot Multipliers dim idx:idx=-1 If light.State = 2 then ' Blinking Multiplier Select case light.name case "lNebula_m":idx=0 case "lRonan_m":idx= 1 case "lYando_m":idx=2 case "lStarLord_m":idx=3 case "lDrax_m":idx=4 case "lRocket_m":idx=5 case "lGamora_m":idx=6 case "lgr_m":idx=7 case "lBroker_m":idx=8 End Select if (tmrShotMultiplierStrobe.Enabled = False) Then ' Hit a shot on the Multiplier ' LightSeqMultiplier.StopPlay() light.UserValue =1 ' Mark we hit this one SetLightColor lDrax_m, "green", lDrax_m.UserValue SetLightColor lGamora_m, "green", lGamora_m.UserValue SetLightColor lYando_m, "green", lYando_m.UserValue SetLightColor lRocket_m, "green", lRocket_m.UserValue SetLightColor lgr_m, "green", lgr_m.UserValue SetLightColor lNebula_m, "green", lNebula_m.UserValue SetLightColor lBroker_m, "green", lBroker_m.UserValue SetLightColor lStarLord_m, "green", lStarLord_m.UserValue SetLightColor lRonan_m, "green", lRonan_m.UserValue AnimateShotMult 2, idx 'Multiplier2x = Multiplier2x + 1 bShotMultiplierSelect = False ' 'Start the moving spot shot ' if lDrax_m.UserValue>=1 and lGamora_m.UserValue>=1 and lYando_m.UserValue>=1 and lRocket_m.UserValue>=1 and _ ' lgr_m.UserValue>=1 and lNebula_m.UserValue>=1 and lBroker_m.UserValue>=1 and lStarLord_m.UserValue>=1 and lRonan_m.UserValue>=1 then ' vpmtimer.addtimer 1500, "PlaySoundVol ""RovingShotMultiplierIsLit"", VolDef '" ' ShotMultiplierStrobe=0 ' tmrShotMultiplierStrobe.Enabled = True ' SetLightColor lDrax_m, "green", 2 ' End if Else ' We are in Strobing mode tmrShotMultiplierStrobe.Enabled = False SetLightColor lDrax_m, "green", lDrax_m.UserValue SetLightColor lGamora_m, "green", lGamora_m.UserValue SetLightColor lYando_m, "green", lYando_m.UserValue SetLightColor lRocket_m, "green", lRocket_m.UserValue SetLightColor lgr_m, "green", lgr_m.UserValue SetLightColor lNebula_m, "green", lNebula_m.UserValue SetLightColor lBroker_m, "green", lBroker_m.UserValue SetLightColor lStarLord_m, "green", lStarLord_m.UserValue SetLightColor lRonan_m, "green", lRonan_m.UserValue AnimateShotMult 3, idx Multiplier3x = 3 ' 3x is just for this shot end If elseif light.state =1 then ' Solid lit setup 2x for the shot MultiplierShot = 2 End If End Sub Sub tmrShotMultiplierStrobe_Timer Select case ShotMultiplierStrobe case 0: SetLightColor lDrax_m, "green", lDrax_m.UserValue SetLightColor lGamora_m, "green", 2 case 1: SetLightColor lGamora_m, "green", lGamora_m.UserValue SetLightColor lYando_m, "green", 2 case 2: SetLightColor lYando_m, "green", lYando_m.UserValue SetLightColor lRocket_m, "green", 2 case 3: SetLightColor lRocket_m, "green", lRocket_m.UserValue SetLightColor lgr_m, "green", 2 case 4: SetLightColor lgr_m, "green", lgr_m.UserValue SetLightColor lNebula_m, "green", 2 case 5: SetLightColor lNebula_m, "green", lNebula_m.UserValue SetLightColor lBroker_m, "green", 2 case 6: SetLightColor lBroker_m, "green", lBroker_m.UserValue SetLightColor lStarLord_m, "green", 2 case 7: SetLightColor lStarLord_m, "green", lStarLord_m.UserValue SetLightColor lRonan_m, "green", 2 case 8: SetLightColor lRonan_m, "green", lRonan_m.UserValue SetLightColor lDrax_m, "green", 2 End Select ShotMultiplierStrobe=ShotMultiplierStrobe+1 if ShotMultiplierStrobe>8 then ShotMultiplierStrobe=0 End Sub Sub CheckShotMultiplier if PlayerMode = 5 and PlayerMode2 = -1 then Exit Sub ' Cant do shot multiplier in Ronan mode if bShotMultiplierSelect then debug.print "Already in 2x Multiplier" ' We can do this for each if (PlayerState(CurrentPlayer).lNovaStates(0)=1 and _ PlayerState(CurrentPlayer).lNovaStates(1)=1 and _ PlayerState(CurrentPlayer).lNovaStates(2)=1 and _ PlayerState(CurrentPlayer).lNovaStates(3)=1 and _ PlayerState(CurrentPlayer).lNovaStates(4)=1) and bShotMultiplierSelect=False and tmrShotMultiplierStrobe.Enabled = False Then LightShotMultipliers end If End Sub Sub LightShotMultipliers() ' Reset Nova Corp Lights (If we are not in Kyln Mode) ' TBD - I Think this should stay disabled until they hit one if PlayerMode <> 5 then SetLightColor lNova_sw2, "orange", 0 SetLightColor lNova_sw3, "orange", 0 SetLightColor lNova_sw4, "orange", 0 SetLightColor lNova_sw8, "orange", 0 SetLightColor lNova_sw9, "orange", 0 End If PlayerState(CurrentPlayer).lNovaStates(0)=0 ' Clear it so we can hit it again PlayerState(CurrentPlayer).lNovaStates(1)=0 PlayerState(CurrentPlayer).lNovaStates(2)=0 PlayerState(CurrentPlayer).lNovaStates(3)=0 PlayerState(CurrentPlayer).lNovaStates(4)=0 AnimateShotMultLit PlaySoundVol "say-MultipliersAreLit", VolDef DisplayDMDText "Shot Multipliers","Are Lit", 1000 bShotMultiplierSelect = True ' LightSeqMultiplier.Play SeqBlinking, 1, 0 'Start the moving spot shot if they have everything complete if lDrax_m.UserValue>=1 and lGamora_m.UserValue>=1 and lYando_m.UserValue>=1 and lRocket_m.UserValue>=1 and _ lgr_m.UserValue>=1 and lNebula_m.UserValue>=1 and lBroker_m.UserValue>=1 and lStarLord_m.UserValue>=1 and lRonan_m.UserValue>=1 then vpmtimer.addtimer 1500, "PlaySoundVol ""RovingShotMultiplierIsLit"", VolDef '" ShotMultiplierStrobe=0 tmrShotMultiplierStrobe.Enabled = True SetLightColor lDrax_m, "green", 2 Else ' Flash all the ones that are not already lit if lDrax_m.UserValue=0 then SetLightColor lDrax_m, "green", 2 if lGamora_m.UserValue=0 then SetLightColor lGamora_m, "green", 2 if lYando_m.UserValue=0 then SetLightColor lYando_m, "green", 2 if lRocket_m.UserValue=0 then SetLightColor lRocket_m, "green", 2 if lgr_m.UserValue=0 then SetLightColor lgr_m, "green", 2 if lNebula_m.UserValue=0 then SetLightColor lNebula_m, "green", 2 if lBroker_m.UserValue=0 then SetLightColor lBroker_m, "green", 2 if lStarLord_m.UserValue=0 then SetLightColor lStarLord_m, "green", 2 if lRonan_m.UserValue=0 then SetLightColor lRonan_m, "green", 2 End if End Sub Dim AnimateShotMult_Type Dim AnimateShotMult_Bonus Sub AnimateShotMult(Bonus, NameIdx) ' FIX12: All LabelSet-based overlay animation removed (same reason as AnimateShotMultLit). ' Audio plays immediately; tmrShotMultAnim runs briefly so dependent guards still work. debug.print "AnimateShotMult FIRING (audio-only mode, FIX12) Bonus=" & Bonus AnimateShotMult_Type=0 AnimateShotMult_Bonus=Bonus PlaySoundVol "sfx_Multiplier1", VolSfx tmrShotMultAnim.UserValue=99 ' Skip straight to end - no LabelSet calls will fire tmrShotMultAnim.Interval = 100 tmrShotMultAnim.Enabled = True End Sub Sub AnimateShotMultLit() ' FIX12: All LabelSet-based overlay animation removed. Every guard combination we tried ' still resulted in VLC "Invalid pointer operation" crashes when these LabelSet calls fired ' on screen 11 (pDMDText). The audio cue plays immediately; the visual overlay is suppressed. ' tmrShotMultAnim is started briefly so existing guards in tmrMultiplierVal_Timer and ' AddBonusMultiplier that check .Enabled still work correctly (they delay their own labels). debug.print "AnimateShotMultLit FIRING (audio-only mode, FIX12)" PlaySoundVol "sfx_Multiplier1", VolSfx AnimateShotMult_Type=1 tmrShotMultAnim.UserValue=99 ' Skip straight to end - no LabelSet calls will fire tmrShotMultAnim.Interval = 100 tmrShotMultAnim.Enabled = True End Sub Sub tmrShotMultAnim_Timer() if NOT bPupStarted then tmrShotMultAnim.Enabled = False : Exit Sub ' FIX3: guard teardown tmrShotMultAnim.UserValue=tmrShotMultAnim.UserValue+0.5 ' FIX12: UserValue starting at 99 means audio-only mode (AnimateShotMultLit). ' Skip all LabelSet calls and just disable the timer so dependent guards clear correctly. if tmrShotMultAnim.UserValue >= 99.5 then tmrShotMultAnim.Enabled = False Exit Sub End If ' FIX10: First tick (UserValue=0.5) for Lit type: fire the 4 setup LabelSets that were ' previously synchronous in AnimateShotMultLit. Now deferred 200ms to avoid VLC crash. if AnimateShotMult_Type=1 and tmrShotMultAnim.UserValue=0.5 then tmrShotMultAnim.Interval = 70 ' Switch to normal 70ms cadence for remaining ticks puPlayer.LabelSet pDMDText,"AnimateShotMultBorder1", "PuPOverlays\\MultiLitBorder.png", 1,"{'mt':2,'xalign':1, 'yalign':1, 'xpos':50, 'ypos':47.5,'width':30,'height':54}" puPlayer.LabelSet pDMDText,"AnimateShotMultBorder2", "PuPOverlays\\MultiLitBorder.png", 1,"{'mt':2,'xalign':1, 'yalign':1, 'xpos':50, 'ypos':47.5,'width':30,'height':54}" puPlayer.LabelSet pDMDText,"AnimateShotMultBorder3", "PuPOverlays\\MultiLitBorder.png", 1,"{'mt':2,'xalign':1, 'yalign':1, 'xpos':50, 'ypos':47.5,'width':30,'height':54}" puPlayer.LabelSet pDMDText,"AnimateShotMultC", "PuPOverlays\\MultiLit1.png", 1,"{'mt':2,'xalign':1, 'yalign':1, 'ypos':48, 'xpos':50,'width':33,'height':55}" Exit Sub End If if AnimateShotMult_Type=0 then puPlayer.LabelSet pDMDText,"AnimateShotMultBorder1", "PuPOverlays\\MultBorder.png", 1,"{'mt':2,'xalign':1, 'yalign':1, 'width':" & 30*(tmrShotMultAnim.UserValue-1) &",'height':" & 54*(tmrShotMultAnim.UserValue-1) &"}" puPlayer.LabelSet pDMDText,"AnimateShotMultBorder2", "PuPOverlays\\MultBorder.png", 1,"{'mt':2,'xalign':1, 'yalign':1, 'width':" & 30*(tmrShotMultAnim.UserValue-.5) &",'height':" & 54*(tmrShotMultAnim.UserValue-.5) &"}" puPlayer.LabelSet pDMDText,"AnimateShotMultBorder3", "PuPOverlays\\MultBorder.png", 1,"{'mt':2,'xalign':1, 'yalign':1, 'width':" & 30*tmrShotMultAnim.UserValue &",'height':" & 54*tmrShotMultAnim.UserValue &"}" if tmrShotMultAnim.UserValue>12 then if AnimateShotMult_Bonus=3 then PlaySoundVol "3xMultiplier", VolDef Else PlaySoundVol "2xMultiplier", VolDef End if puPlayer.LabelSet pDMDText,"AnimateShotMultBorder1", "PuPOverlays\\clear.png", 0,"" puPlayer.LabelSet pDMDText,"AnimateShotMultBorder2", "PuPOverlays\\clear.png", 0,"" puPlayer.LabelSet pDMDText,"AnimateShotMultBorder3", "PuPOverlays\\clear.png", 0,"" puPlayer.LabelSet pDMDText,"AnimateShotMultL", "PuPOverlays\\clear.png", 0,"" puPlayer.LabelSet pDMDText,"AnimateShotMultC", "PuPOverlays\\clear.png", 0,"" puPlayer.LabelSet pDMDText,"AnimateShotMultR", "PuPOverlays\\clear.png", 0,"" puPlayer.LabelSet pDMDText,"AnimateShotMultName","PuPOverlays\\clear.png", 0,"" tmrShotMultAnim.Enabled=False End if Else puPlayer.LabelSet pDMDText,"AnimateShotMultBorder1", "PuPOverlays\\MultiLitBorder.png", 1,"{'mt':2,'xalign':1, 'yalign':1, 'width':" & 30*(tmrShotMultAnim.UserValue-1) &",'height':" & 54*(tmrShotMultAnim.UserValue-1) &"}" puPlayer.LabelSet pDMDText,"AnimateShotMultBorder2", "PuPOverlays\\MultiLitBorder.png", 1,"{'mt':2,'xalign':1, 'yalign':1, 'width':" & 30*(tmrShotMultAnim.UserValue-.5) &",'height':" & 54*(tmrShotMultAnim.UserValue-.5) &"}" puPlayer.LabelSet pDMDText,"AnimateShotMultBorder3", "PuPOverlays\\MultiLitBorder.png", 1,"{'mt':2,'xalign':1, 'yalign':1, 'width':" & 30*tmrShotMultAnim.UserValue &",'height':" & 54*tmrShotMultAnim.UserValue &"}" if tmrShotMultAnim.UserValue>12 then puPlayer.LabelSet pDMDText,"AnimateShotMultBorder1", "PuPOverlays\\clear.png", 0,"" puPlayer.LabelSet pDMDText,"AnimateShotMultBorder2", "PuPOverlays\\clear.png", 0,"" puPlayer.LabelSet pDMDText,"AnimateShotMultBorder3", "PuPOverlays\\clear.png", 0,"" puPlayer.LabelSet pDMDText,"AnimateShotMultC", "PuPOverlays\\clear.png", 0,"" tmrShotMultAnim.Enabled=False End if End if End Sub Sub tmrNovaCorps_Timer ' Rotate the lit nova corp lights ' if sw2.UserValue = 1 and sw3.UserValue <> 1 then ' Lower Lanes ' sw2.UserValue = 0 ' sw3.UserValue = 1 ' Elseif sw2.UserValue <> 1 and sw3.UserValue = 1 then ' sw2.UserValue = 1 ' sw3.UserValue = 0 ' End If ' SetLightColor lNova_sw2, "orange", sw2.UserValue ' SetLightColor lNova_sw3, "orange", sw3.UserValue ' ' ' if sw8.UserValue = 1 and sw9.UserValue <> 1 then ' Upper Lanes ' sw8.UserValue = 0 ' sw9.UserValue = 1 ' Elseif sw8.UserValue <> 1 and sw9.UserValue = 1 then ' sw8.UserValue = 1 ' sw9.UserValue = 0 ' End If ' ' SetLightColor lNova_sw8, "orange", sw8.UserValue ' SetLightColor lNova_sw9, "orange", sw9.UserValue End Sub Sub sw1_Hit() PlaySoundAt "fx_sensor", sw1 If Tilted or bTableDisabled Then Exit Sub if bGameInPlay = False then Exit sub LaneBonus = LaneBonus + 1 AddScore 100000 ' change some light 'FlashForms l5f, 1000, 40, 0:FlashForms l5, 1000, 40, 0 If bBallSaverActive Then ' Quick add new ball DrainDummy_Hit() End if SwitchHit "sw1" CheckModeProgress "switch" End Sub 'Sub Kicker001_Hit ' vpmtimer.addtimer 1000, "Kicker001.kick 17.9, 57 '" 'End Sub Sub sw2_Hit() ' ball is comming in too hot slow it down since trigger in VPX doesnt affect bll motion if (ActiveBall.angmomz >100 or ActiveBall.angmomz < -100) then ActiveBall.angmomz=ActiveBall.angmomz/4 if (ActiveBall.angmomx >100 or ActiveBall.angmomx < -100) then ActiveBall.angmomx=ActiveBall.angmomx/4 'Debug.print "ANGMOM:" & ActiveBall.angmomz & " " & ActiveBall.angmomy & " " & ActiveBall.angmomx PlaySoundAt "fx_sensor", sw2 If Tilted or bTableDisabled Then Exit Sub LaneBonus = LaneBonus + 1 AddScore 10000 ' change some light 'FlashForms l5f, 1000, 40, 0:FlashForms l5, 1000, 40, 0 SwitchHit "sw2" if PlayerMode <> 5 then SetLightColor lNova_sw2, "orange", 1 Else BonusAddModeHit(2) ' This add to bonus on Rocket mode End If PlayerState(CurrentPlayer).lNovaStates(0) = 1 CheckModeProgress("sw2") CheckShotMultiplier() End Sub Sub sw3_Hit() ' ball is comming in too hot slow it down since trigger in VPX doesnt affect bll motion if (ActiveBall.angmomz >100 or ActiveBall.angmomz < -100) then ActiveBall.angmomz=ActiveBall.angmomz/4 if (ActiveBall.angmomx >100 or ActiveBall.angmomx < -100) then ActiveBall.angmomx=ActiveBall.angmomx/4 PlaySoundAt "fx_sensor", sw3 If Tilted or bTableDisabled Then Exit Sub LaneBonus = LaneBonus + 1 AddScore 10000 ' change some light 'FlashForms l5f, 1000, 40, 0:FlashForms l5, 1000, 40, 0 SwitchHit "sw3" if PlayerMode <> 5 then SetLightColor lNova_sw3, "orange", 1 Else BonusAddModeHit(2) ' This add to bonus on Rocket mode End if PlayerState(CurrentPlayer).lNovaStates(1) = 1 CheckModeProgress("sw3") CheckShotMultiplier() End Sub Sub sw4_Hit() ' ball is comming in too hot slow it down since trigger in VPX doesnt affect bll motion if (ActiveBall.angmomz >100 or ActiveBall.angmomz < -100) then ActiveBall.angmomz=ActiveBall.angmomz/4 if (ActiveBall.angmomx >100 or ActiveBall.angmomx < -100) then ActiveBall.angmomx=ActiveBall.angmomx/4 ' PlaySoundAt "fx_sensor", sw4 If Tilted or bTableDisabled Then Exit Sub LaneBonus = LaneBonus + 1 AddScore 10000 ' change some light 'FlashForms l6f, 1000, 40, 0:FlashForms l6, 1000, 40, 0 SwitchHit "sw4" if PlayerMode <> 5 then SetLightColor lNova_sw4, "orange", 1 Else BonusAddModeHit(2) ' This add to bonus on Rocket mode End if PlayerState(CurrentPlayer).lNovaStates(2) = 1 CheckModeProgress("sw4") CheckShotMultiplier() End Sub Sub sw6_Hit() PlaySoundAt "fx_sensor", sw6 If Tilted or bTableDisabled Then Exit Sub if bGameInPlay = False then Exit sub LaneBonus = LaneBonus + 1 AddScore 100000 ' change some light 'FlashForms l6f, 1000, 40, 0:FlashForms l6, 1000, 40, 0 if bLaneSaverEnabled and bBallSaverActive=False then ' Virtual Lane Saver pDMDEvent(kDMD_BallSaveAwarded) AddScore BonusLaneSaver BonusLaneSaver = 0 SetLightColor lLaneSaver, "yellow", 0 bLaneSaverEnabled = False BallSaverActiveBuffer = BallSaverActiveBuffer+1 DrainDummy_Hit() Else If bBallSaverActive Then ' Quick add new ball DrainDummy_Hit() End if End if SwitchHit "sw6" CheckModeProgress "switch" End Sub '************ ' Other lanes '************ Sub sw11_Hit() 'right loop PlaySoundAt "fx_sensor", sw11 If Tilted or bSkillshotsReady(2) Then Exit Sub if LastSwitchHit = "tDrax_m" or LastSwitchHit2 = "tDrax_m" Then ' We are going up the ramp ClearShotMultiplier(lDrax_m) DoCombo lDraxArrow, False CheckModeProgress "lDraxArrow" If tmrSkillshot.Enabled and lDraxArrow.state = 2 Then ' Hold Left, Loop around and hit Orb, Right Ramp or Right Orbit AddScore 1000000 DOF 127, DOFPulse PlaySoundVol "gg_SkillShot", VolDef QueueScene "ScenePlayMessage ""SkillShot.mp4"", """","""",""1000000"" '", 2000, 1 QueueScene "SceneClearPlayMessage '", 0, 1 End If AddScore 1220 BonusAddModeHit(7) MultiplierShot = 1 ' Clear shot multiplier End If ' change some extra light, do other checks SwitchHit "sw11" End Sub Sub sw12_Hit() 'left loop PlaySoundAt"fx_sensor", sw12 If Tilted Then Exit Sub if LastSwitchHit = "tRonan_m" or LastSwitchHit2 = "tRonan_m" and LastSwitchHit<>"sw12" Then ' We are going up the ramp ClearShotMultiplier(lRonan_m) DoCombo lRonanArrow, True CheckModeProgress "lRonanArrow" CheckModeProgress "switch" AddScore 1220 BonusAddModeHit(1) MultiplierShot = 1 ' Clear shot multiplier end if bSkillshotsReady(2) = False ' Mark so they can hit the skill shot ' change some light SwitchHit "sw12" ' do some check End Sub Sub sw13_Hit() 'Yondu tunnel debug.print "SW13 HIT" ' tgAntiqueShop_Dropped ' What does the antique target do?? Bonus?? if sw13.UserValue = "debounce" then ' Need a little debounce here because this is like a ramp and hits switch twice going up an down exit Sub End if sw13.UserValue = "debounce" vpmtimer.addtimer 1500, "sw13.UserValue = """" '" ClearShotMultiplier(lYando_m) DoCombo lYonduArrow, True CheckModeProgress "switch" CheckModeProgress "lYonduArrow" SwitchHit "tYando_m" AddScore 2560 BonusAddModeHit(0) ' change some light SwitchHit "sw13" MultiplierShot = 1 ' Clear shot multiplier End Sub Sub HandleSkillshot() Debug.print "HandleSkillshot:" & bSkillshotsReady(0) & " " & bSkillshotsReady(1) if bSkillshotsReady(1) then ' Hands free skillshot is 2x AddScore SkillshotValue*2 PlaySoundVol "vo_SkillShot" & INT(RND*2)+1, VolDef tmrSkillshot_Timer DOF 325, DOFPulse ' James DOF QueueScene "ScenePlayMessage ""SkillShot.mp4"", """","""","""&SkillshotValue*2&""" '", 2000, 1 QueueScene "SceneClearPlayMessage '", 0, 1 SkillshotValue=SkillshotValue+50000 ' Start out at 250k, Every time you change lanes it goes down 50k until you get to 250, adds 50K each new ball elseif bSkillshotsReady(0) Then AddScore SkillshotValue PlaySoundVol "vo_SkillShot" & INT(RND*2)+1, VolDef tmrSkillshot_Timer DOF 325, DOFPulse ' James DOF QueueScene "ScenePlayMessage ""SkillShot.mp4"", """","""","""&SkillshotValue&""" '", 2000, 1 QueueScene "SceneClearPlayMessage '", 0, 1 SkillshotValue=SkillshotValue+50000 ' Start out at 250k, Every time you change lanes it goes down 50k until you get to 250, adds 50K each new ball End If End Sub '************* ' Top lanes '************* Sub sw8_Hit() DOF 130, DOFPulse PlaySoundAt "fx_sensor", sw8 If Tilted or bTableDisabled Then Exit Sub DOF 127, DOFPulse if lNova_sw8.UserValue = 2 then HandleSkillshot elseif bSkillshotsReady(0) then bSkillshotsReady(0)=False bSkillshotsReady(1)=False tmrSkillshot_Timer End If CheckModeProgress("sw8") if PlayerMode <> 5 then if lNova_sw8.state = 0 then PlaySoundVol "sfx_Inlane1", VolSfx Else PlaySoundVol "sfx_Inlane2", VolSfx End if SetLightColor lNova_sw8, "orange", 1 Else BonusAddModeHit(2) ' This add to bonus on Rocket mode End if PlayerState(CurrentPlayer).lNovaStates(3) = 1 CheckShotMultiplier() AddScore 5000 ' change some light 'Bumper1Light.Visible = 1 SwitchHit "sw8" End Sub Sub sw9_Hit() DOF 131, DOFPulse PlaySoundAt "fx_sensor", sw9 If Tilted or bTableDisabled Then Exit Sub DOF 127, DOFPulse if lNova_sw9.UserValue = 2 then HandleSkillshot elseif bSkillshotsReady(0) then bSkillshotsReady(0)=False bSkillshotsReady(1)=False tmrSkillshot_Timer End If CheckModeProgress("sw9") if PlayerMode <> 5 then if lNova_sw9.state = 0 then PlaySoundVol "sfx_Inlane1", VolSfx Else PlaySoundVol "sfx_Inlane2", VolSfx End if SetLightColor lNova_sw9, "orange", 1 Else BonusAddModeHit(2) ' This add to bonus on Rocket mode End If PlayerState(CurrentPlayer).lNovaStates(4) = 1 CheckShotMultiplier() AddScore 15500 ' change some light 'Bumper2Light.Visible = 1 SwitchHit "sw9" End Sub Sub sw10_Hit() DOF 120, DOFPulse PlaySoundAt "fx_sensor", sw10 If Tilted Then Exit Sub LaneBonus = LaneBonus + 1 AddScore 10000 ' change some light 'Bumper3Light.Visible = 1 SwitchHit "sw10" End Sub '******** ' Ramps '******** Sub LeftRampDone_Hit() If Tilted Then Exit Sub DOF 210, DOFPulse End Sub ' you can catch a loop this way Sub RightRampDone_Hit() End Sub '******** ' Bumper '******** Sub tmrPupBumper_Timer dim i dim bStopTimer bStopTimer=True for i = 0 to 8 if BumperPops(i) <> -1 then BumperPops(i) = BumperPops(i) -1 if BumperPops(i) = 0 then puPlayer.LabelSet pDMDText,"PopImg" & i, "PuPOverlays\\BumperPopClear.png", 0,"" puPlayer.LabelSet pDMDText, "PopScore" & i, "", 1,"" BumperPops(i) =-1 elseif BumperPops(i) = 1 then ' Loop period so everything is aligned bStopTimer=False Elseif BumperPops(i) = 2 then ' Start the score moving up puPlayer.LabelSet pDMDText, "PopScore" & i, BumperPopsScore(i)/1000 & "K", 0,"{'mt':1,'at':2,'ype':150,'len':400,'mlen':400,'tt':3}" bStopTimer=False End If End if Next if bStopTimer then tmrPupBumper.Enabled = False End Sub dim BumperPopPos Dim BumperPops(9) Dim BumperPopsScore(9) BumperPopPos=0 BumperPops(0)=-1:BumperPops(1)=-1:BumperPops(2)=-1:BumperPops(3)=-1:BumperPops(4)=-1:BumperPops(5)=-1:BumperPops(6)=-1:BumperPops(7)=-1:BumperPops(8)=-1: Sub FlashPupbumper(Score) if BumperPops(BumperPopPos) = -1 then ' If it is available PlaySoundVol "sfx_bumper" & INT(RND*28), VolTable ' These are really quiet for some reason Using VolTable instead of VolSfx BumperPopsScore(BumperPopPos) = score * PlayMultiplier dim x,y BumperPops(BumperPopPos)=3 if (BumperPopPos mod 2)=0 then y=50 else y=40 x=5+BumperPopPos*10 'debug.print BumperPopPos & " " & x & " " & y if PlayerMode=kModeNebula then puPlayer.LabelSet pDMDText,"PopImg" & BumperPopPos, "PuPOverlays\\BumperPop2.gif", 1,"{'mt':2,'color':111111,'ypos':"&y&",'xpos':"&x& ",'width':55, 'height':100, 'anigif':100,'yalign':1}" tmrPupBumper.Interval = 200 ' puPlayer.LabelSet pDMDText,"PopImg" & BumperPopPos, "PuPOverlays\\BumperPop2.gif", 1,"{'mt':2,'color':111111,'ypos':"&y&",'xpos':"&x&",'width':48, 'height':64, 'anigif':100,'pagenum':1}" else tmrPupBumper.Interval = 100 puPlayer.LabelSet pDMDText,"PopImg" & BumperPopPos, "PuPOverlays\\BumperPop.gif", 1,"{'mt':2,'color':111111,'ypos':"&y&",'xpos':"&x&",'width':24, 'height':32, 'anigif':100,'yalign':0}" End if puPlayer.LabelSet pDMDText, "PopScore" & BumperPopPos, BumperPopsScore(BumperPopPos)/1000 & "K", 1,"" tmrPupBumper.Enabled = true BumperPopPos=BumperPopPos+1 if BumperPopPos>8 then BumperPopPos=0 End If End Sub ' puPlayer.LabelSet pDMDText,"PopImg1", "PuPOverlays\\BumperPop.gif", 1,"{'mt':2,'color':111111,'ypos':50,'xpos':5,'width':20, 'height':28, 'anigif':100,'pagenum':1}" ' puPlayer.LabelSet pDMDText, "PopScore1", "10.4K", 1,"" ' ' puPlayer.LabelSet pDMDText,"PopImg2", "PuPOverlays\\BumperPop.gif", 1,"{'mt':2,'color':111111,'ypos':40,'xpos':15,'width':20, 'height':28, 'anigif':100,'pagenum':1}" ' puPlayer.LabelSet pDMDText, "PopScore2", "20.4K", 1,"" Dim b1, b2, b3 'the values of the actual award for each bumper. Get 3 of a kind and get an award Sub ResetBumpers() b1 = INT(RND * 30) b2 = INT(RND * 30) b3 = INT(RND * 30) End Sub Sub Bumper001_Hit If Tilted or bTableDisabled Then Exit Sub PauseTimers(-1) If sndGeneralHit <> "" then PlaySoundAt SoundFXDOF(sndGeneralHit, 107, DOFPulse, DOFContactors), Bumper001 Else PlaySoundAt SoundFXDOF("fx_bumper", 107, DOFPulse, DOFContactors), Bumper001 End If DOF 205, DOFPulse BumperLight001.State = 2 FlashForMs Bumper1Light, 200, 50, 0 FlashForMs flshLightShootOrb001, 200, 50, 0 FlashPupBumper 10470 + (1000 * BumperMultiplier) ' BumperPlastic1.Image = "GOTG-_0006_BPA-GI-FLASH-ON" ' vpmtimer.addtimer 300, "BumperPlastic1.Image = ""GOTG-_0007_BPA-GI-ON"" '" 'FlashForMs BumperFlash1, 500, 50, 0 AddScore 10470 + (1000 * BumperMultiplier) ' Each ball adds 1000 If b1 <> b2 AND b1 <> b3 Then b1 = (b1 + 1)MOD 30 End If CheckModeProgress("switch") CheckModeProgress("bumper") SwitchHit "bumper" End Sub Sub Bumper002_Hit If Tilted or bTableDisabled Then Exit Sub PauseTimers(-1) PlaySoundAt SoundFXDOF("fx_bumper", 109, DOFPulse, DOFContactors), Bumper002 DOF 205, DOFPulse BumperLight002.State = 2 FlashForMs Bumper2Light, 200, 50, 0 FlashForMs flshLightShootOrb001, 200, 50, 0 FlashPupBumper 10470 + (1000 * BumperMultiplier) ' BumperPlastic2.Image = "GOTG-_0003_BPB-GI-FLASH-ON" ' vpmtimer.addtimer 300, "BumperPlastic2.Image = ""GOTG-_0004_BPB-GI-ON"" '" 'FlashForMs BumperFlash, 500, 50, 0:FlashForMs BumperFlash1, 500, 50, 0 AddScore 10470 + (1000 * BumperMultiplier) ' Each ball adds 1000 If b2 <> b1 AND b2 <> b3 Then b2 = (b2 + 1)MOD 30 End If CheckModeProgress("switch") CheckModeProgress("bumper") SwitchHit "bumper" End Sub Sub Bumper003_Hit If Tilted or bTableDisabled Then Exit Sub PauseTimers(-1) PlaySoundAt SoundFXDOF("fx_bumper", 111, DOFPulse, DOFContactors), Bumper003 DOF 205, DOFPulse BumperLight003.State = 2 FlashForMs Bumper3Light, 200, 50, 0 FlashForMs flshLightShootOrb001, 200, 50, 0 FlashPupBumper 10470 + (1000 * BumperMultiplier) ' BumperPlastic3.Image = "GOTG-_0000_BPC-GI-FLASH-ON" ' vpmtimer.addtimer 300, "BumperPlastic3.Image = ""GOTG-_0001_BPC-GI-ON"" '" 'FlashForMs BumperFlash, 500, 50, 0:FlashForMs BumperFlash1, 500, 50, 0 AddScore 10470 + (1000 * BumperMultiplier) ' Each ball adds 1000 If b3 <> b1 AND b3 <> b2 Then b3 = (b3 + 1)MOD 30 End If CheckModeProgress("switch") CheckModeProgress("bumper") SwitchHit "bumper" End Sub ' Check the bumper awards Sub CheckBumpers() ' 1st display the awards Dim tmp tmp = chr(131 + b1) & chr(131 + b2) & chr(131 + b3) DMD "", "", tmp, eNone, eNone, eNone, 100, True, "" If b1 = b2 AND b1 = b3 Then 'give award 'DMD "", "", tmp, eNone, eNone, eBlinkFast, 1000, True, "gb_fanfare" 'GiveBumperAward End If End Sub Sub GiveBumperAward() ' Select Case b1 ' Case 1:l58.State = 2:PlaySound "vo_tobinspiritguideislit" 'Light Tobin's Spirit Guide ' Case 2:StartTerrorDog 'Start Terror Dog ' Case 3:StartScoleriBrothers 'Start Scoleri Brothers ' Case 4:StartScoleriBrothers 'Start Scoleri Brothers ' Case 5:LitRandomGhost:LitRandomGhost:LitRandomGhost 'Light Three Ghosts ' Case 6:LitRandomGhost:LitRandomGhost 'Light two Ghosts ' Case 7:StorageLights 1 'Light Storage Facility ' Case 8:Enable2XMultiplier:Enable3XMultiplier 'Light Playfield Multipliers ' Case 9:l53.State = 2 'Light Extra Ball ' Case 10:AddSuperJackpot 1000000 'Increase Super Jackpot ' Case 11:SpinnerLevel = SpinnerLevel + 1 'Increase Spinner Level ' Case 12:SpinnerValue = SpinnerValue + 1000 'Increase Spinner Value ' Case 13:CatchGhost 3 'Catch Three Ghosts ' Case 14:CatchGhost 2 'Catch two Ghosts ' Case 15:CatchGhost 1 'Catch One Ghost ' Case 16:SpinnerValue = SpinnerValue + 1000 'Bump Spinner Value ' Case 17:bBonusHeld = True 'Bonus Held ' Case 18:AddScore INT(RND * 9 + 1) * 200000 'Bigger Points ' Case 19:AddScore INT(RND * 9 + 1) * 100000 'Big Points ' Case 20:AwardSpecial 'Award Special ' Case 21:SpinnerLevel = SpinnerLevel + 1 'Advance Spinner Level ' Case 22:AddBonusMultiplier 3 'Advance Bonus X by 3X ' Case 23:AddBonusMultiplier 1 'Advance Bonus X by 1X ' 'Case 24:AddTime 'Add Time ' Case 25 'Lit Add A Ball ' If bMultiBallMode Then ' AddMultiball 1 ' Else ' l57.State = 2 ' End If ' Case 26:PKELevel = PKELevel + 300 '+300 PKE Level ' Case 27:PKELevel = PKELevel + 100 '+100 PKE Level ' Case 28:AddBonusMultiplier 3 '+3 Bonus X ' Case 29:AddBonusMultiplier 2 '+2 Bonus X ' Case 30:AddBonusMultiplier 1 '+1 Bonus X ' End Select ResetBumpers End Sub '******************* ' Multiplier targets '******************* '************************** ' Right Scoop: TBD Rename '************************** Dim bLeftScoopWait Dim bLeftScoopSkip Dim bLeftScoopSkip2 Dim LeftScoopDelay ' milliseconds to delay releasing the ball for starting modes Sub LeftScoop_Hit() Debug.print "LeftScoop_Hit" Dim tmp if bTableDisabled then ' Kick the ball and bail out LeftScoopExit Exit sub End if dim bSaveXandarReady dim bSaveUpgradeState bSaveUpgradeState = bModeProgressUpgraded PlaySoundAt "fx_kicker_enter",LeftScoop If Tilted Then LeftScoopExit Exit Sub End If LeftScoopDelay=0 bLeftScoopWait=True ' Set this so Ball Search doesnt kick in and kick the ball out if flshMystery.TimerEnabled then ' Check Mystery setMysteryLight(False) 'flshMystery.TimerEnabled = False AwardMystery Exit Sub Elseif flshExtraBall.TimerEnabled then setExtraBallLight(False) 'flshExtraBall.TimerEnabled = False AwardExtraBall Exit Sub End If bSaveXandarReady=bXandarReady ' if bImmolationWait then bImmolationWait=False ' Cleared the last ball on immolation ClearShotMultiplier(lStarLord_m) DoCombo lStarLordArrow, False AddScore 5070 BonusAddModeHit(8) CheckModeProgress "lStarLordArrow" ' This will grab the last Starlord Hurry Up MultiplierShot = 1 ' Clear shot multiplier debug.print "Scoop Hit: PlayerMode:" & PlayerMode & " MB:" & bMultiBallMode if tmrCherryBomb.Enabled Then ' Go into cherry bomb mode CherrySong debug.print "Scoop Cherry" elseif tmrImmolation.Enabled then ' Do nothing debug.print "Scoop Immolation" elseif tmrXandar.Enabled then ' Do nothing debug.print "Scoop Xandar: " & bSaveXandarReady & " " & bXandarReady if bSaveXandarReady and bXandarReady=False then Exit Sub ' We just started dont kick elseif bSecondMode then ' Do nothing debug.print "Scoop 2nd Mode" elseif BallSearchCnt=0 and PlayerMode = -1 and bMultiBallMode=False Then ' If we are in multiball dont go into player select and we didnt cancel because of ball search if modesCompleted=8 and (Light029.state<>0 and Light033.state<>1 or Light030.state<>1) then debug.print "Must Finish OrbMB or GrootMB" else QueueFlush() bPlayerModeSelect=True ' Disables Ball Search QueueScene2 "StartPlayerSelect '", 0, 1, True bLeftScoopWait=False Exit Sub ' Hold the ball until they select the next mode End If End if debug.print "Scoop HIT Finish" bLeftScoopSkip=False PauseTimers(-1) vpmtimer.addtimer 1000, "FlashLeftScoop '" if bModeProgressUpgraded <> bSaveUpgradeState then ' They upgraded vpmtimer.addtimer 1500 + INT(RND * 1000)+LeftScoopDelay, "if bLeftScoopSkip=False then FlipperSkipCmd="""":LeftScoopRumble '" SetFlipperSkipCmd "bLeftScoopSkip=True:QueueFlush:QueueSkip:QueueSkip:LeftScoopExit '" ' DONT FORGET TO CLEAR FlipperSkipCmd when you are past this stage Else vpmtimer.addtimer 1500+LeftScoopDelay, "if bLeftScoopSkip=False then FlipperSkipCmd="""":LeftScoopExit '" SetFlipperSkipCmd "bLeftScoopSkip=True:QueueFlush:QueueSkip:LeftScoopExit '" ' DONT FORGET TO CLEAR FlipperSkipCmd when you are past this stage End If LeftScoopDelay=0 ResetBallSearch bLeftScoopWait=False End Sub Sub StartPlayerSelect() ' Handles Player Select from the Right Scoop debug.print "Player Select " setUpgradeLight(True) setModeSelectLight(False) puPlayer.LabelSet pDMDText,"Timer", "" ,1,"" ' Clear label just in case there is one StopSound Song EnablePlayerSelect if ModePercent(LastPlayerMode)>=100 then SelectPlayerMode LeftFlipperKey ' Force them to select a new mode Else PlayerMode=LastPlayerMode UpdatePlayerMode() End if End Sub Sub FlashLeftScoop 'FlashForms l5f, 1000, 40, 0 'FlashForms LibraryFlasher, 1000, 40, 0 DOF 206, DOFPulse End Sub Sub LeftScoopExit2 Debug.print "LeftScoopExit" FlipperSkipCmd="" ' Clear it bFlash4FastEnabled = False tmrRedLightFlash.Interval = 200 PlaySoundVol "gg_Camera", VolSfx leftScoop.Kick 217, DMDFet(kDMDFet_RightScoopePower) leftScoopk.IsDropped = 0 PlaySoundAt SoundFXDOF("Saucer_Kick", 123, DOFPulse, DOFContactors), LeftScoop vpmtimer.addtimer 100, "leftScoopK.IsDropped = 1 '" End Sub Sub LeftScoopExit Debug.print "LeftScoopExit" tmrRedLightFlash.Interval = 80 bFlash4FastEnabled = True vpmtimer.addtimer 400, "LeftScoopExit2 '" End Sub Sub LeftScoopRumble Debug.print "LeftScoopRumble" if bNudgeShake then Nudge 90, 0.25 vpmtimer.addtimer 200, "Nudge 270, 0.25 '" End If ' This is how Avatar does it and you can feel it 'PlaySoundAtVol SoundFX("fmotor4", DOFGear), sw6, 0.31 PlaySoundAtVol SoundFXDOF("fmotor4", 132, DOFOn, DOFGear), sw6, VolTable vpmtimer.addtimer 1000, "DOFGearStop '" PlaySoundVol "ShakeBass", VolSfx PlaySoundVol "ShakeBass2", VolSfx vpmtimer.addtimer 1000 + INT(RND * 1000), "LeftScoopExit '" End Sub Sub DOFGearStop() DOF 132, DOFOff End Sub Sub CheckGear() 'when all the gear is collected then start "Are you a god?" mode (mode 12) If Gear(1) + Gear(2) + Gear(3) + Gear(4) + Gear(5) = 5 Then StartAreYouaGod End If End Sub ' Gear 1: Proton Pack Sub CheckProtonTargets() End Sub Dim HoloPos, HoloDir, HoloStep, HoloRandom, HoloAngle Sub HologramStop End Sub Sub HologramTimer_Timer() End Sub Sub HologramTimerExpired_Timer() HologramStop End Sub '****************** ' Catching Ghosts '****************** ' to catch ghosts: Sub LitRandomGhost() '9 lights. lits a random ghost light aCatchGhostLights(INT(RND * 8)).State = 1 End Sub Sub LitAllGhosts() dim lamp For each lamp in aCatchGhostLights lamp.State = 1 Next End Sub Sub tGrootRight_Hit DOF 109, DOFPulse if tGrootRight.UserValue = 0 then AddScore 26110 SetLightColor l019, "yellow", 1 tGrootRight.UserValue=1 vpmtimer.addtimer 500, "tGrootStab 0'" ' Add a little debounce (for debugger mostly) Else AddScore 8610 End If End Sub Sub tGrootLeft_Hit DOF 109, DOFPulse if tGrootLeft.UserValue = 0 then AddScore 26110 SetLightColor l023, "yellow", 1 tGrootLeft.UserValue=1 vpmtimer.addtimer 500, "tGrootStab 1'" Else AddScore 8610 End If End Sub Sub tGrootStab(bIsRightStab) AddScore 10 PlaySoundVol "gg_Lazer", VolSfx If tGrootLeft.UserValue=1 and tGrootRight.UserValue=1 then if bIsRightStab then if BonusLaneSaver = 0 then ' If you hit left then right stab BonusLaneSaver = 575000 Else BonusLaneSaver = BonusLaneSaver + 20000 End If else if BonusLaneSaver = 0 then ' If you hit right then lefy BonusLaneSaver = 275000 Else BonusLaneSaver = BonusLaneSaver + 10000 End If End If SetLightColor lLaneSaver, "yellow", 1 SetLightColor l019, "yellow", 0 SetLightColor l023, "yellow", 0 tGrootLeft.UserValue = 0 tGrootRight.UserValue = 0 if bLaneSaverEnabled=False then QueueScene "playUnderMedia ""PupVideos"", ""vidBallSave.mp4"", pUnderVid, 4134 '", 4134, 1 bLaneSaverEnabled = True End if End If CheckModeProgress("switch") End Sub 'Sub kLaneSaver_Hit ' vpmtimer.addtimer 100, "LaneSaverKick '" 'End Sub ' 'Sub LaneSaverKick() ' kLaneSaver.Kick -30, 40 ' AddScore BonusLaneSaver ' BonusLaneSaver = 0 ' SetLightColor lLaneSaver, "yellow", 0 ' kLaneSaver.Enabled = False 'End Sub Sub Target001_Hit() PlaySoundVol "gg_hadron", VolSfx End Sub Sub tgHadron0_Hit() PlaySoundVol "fx_target", VolTable DOF 200, DOFPulse dim saveCnt:saveCnt=0 if PlayerMode <> -1 then saveCnt = ModeProgress(PlayerMode) if tgHadron0.UserValue = 0 then PlaySoundVol "gg_hadron", VolSfx SetLightColor lHadron0, "yellow", 2 lHadron0.UserValue=1 tgHadron0.UserValue = 1 CheckModeProgress("tgHadron0") if PlayerMode <> -1 then ' Add a base score if this didnt give progress if saveCnt = ModeProgress(PlayerMode) then AddScore 20000 else AddScore 20000 End If if PlayerMode=1 then BonusAddModeHit(1) ' These are special when we are in ronan mode vpmtimer.addtimer 500, "CheckCount '" elseIf tgHadron0.UserValue = 1 and tgHadron1.UserValue = 1 and tgHadron2.UserValue =1 and tgHadron3.UserValue = 1 and tgHadron4.UserValue = 1 Then CheckCount ' Just in case (Overflow can cuase the addtimer to fail) else PlaySoundVol "sfx_miss", VolTable End If End Sub Sub tgHadron1_Hit() PlaySoundVol "fx_target", VolTable DOF 117, DOFPulse dim saveCnt:saveCnt=0 if PlayerMode <> -1 then saveCnt = ModeProgress(PlayerMode) if tgHadron1.UserValue = 0 then PlaySoundVol "gg_hadron", VolSfx SetLightColor lHadron1, "yellow", 2 lHadron1.UserValue=1 tgHadron1.UserValue = 1 CheckModeProgress("tgHadron1") if PlayerMode <> -1 then ' Add a base score if this didnt give progress if saveCnt = ModeProgress(PlayerMode) then AddScore 20000 else AddScore 20000 End If if PlayerMode=1 then BonusAddModeHit(1) ' These are special when we are in ronan mode vpmtimer.addtimer 500, "CheckCount '" elseIf tgHadron0.UserValue = 1 and tgHadron1.UserValue = 1 and tgHadron2.UserValue =1 and tgHadron3.UserValue = 1 and tgHadron4.UserValue = 1 Then CheckCount ' Just in case (Overflow can cuase the addtimer to fail) else PlaySoundVol "sfx_miss", VolTable End If End Sub Sub tgHadron2_Hit() PlaySoundVol "fx_target", VolTable DOF 117, DOFPulse dim saveCnt:saveCnt=0 if PlayerMode <> -1 then saveCnt = ModeProgress(PlayerMode) if tgHadron2.UserValue = 0 then PlaySoundVol "gg_hadron", VolSfx SetLightColor lHadron2, "yellow", 2 lHadron2.UserValue=1 tgHadron2.UserValue = 1 CheckModeProgress("tgHadron2") if PlayerMode <> -1 then ' Add a base score if this didnt give progress if saveCnt = ModeProgress(PlayerMode) then AddScore 20000 else AddScore 20000 End If if PlayerMode=1 then BonusAddModeHit(1) ' These are special when we are in ronan mode vpmtimer.addtimer 500, "CheckCount '" elseIf tgHadron0.UserValue = 1 and tgHadron1.UserValue = 1 and tgHadron2.UserValue =1 and tgHadron3.UserValue = 1 and tgHadron4.UserValue = 1 Then CheckCount ' Just in case (Overflow can cuase the addtimer to fail) else PlaySoundVol "sfx_miss", VolTable End If End Sub Sub tgHadron3_Hit() PlaySoundVol "fx_target", VolTable DOF 118, DOFPulse dim saveCnt:saveCnt=0 if PlayerMode <> -1 then saveCnt = ModeProgress(PlayerMode) if tgHadron3.UserValue = 0 then PlaySoundVol "gg_hadron", VolSfx SetLightColor lHadron3, "yellow", 2 lHadron3.UserValue=1 tgHadron3.UserValue = 1 CheckModeProgress("tgHadron3") if PlayerMode <> -1 then ' Add a base score if this didnt give progress if saveCnt = ModeProgress(PlayerMode) then AddScore 20000 else AddScore 20000 End If if PlayerMode=1 then BonusAddModeHit(1) ' These are special when we are in ronan mode vpmtimer.addtimer 500, "CheckCount '" elseIf tgHadron0.UserValue = 1 and tgHadron1.UserValue = 1 and tgHadron2.UserValue =1 and tgHadron3.UserValue = 1 and tgHadron4.UserValue = 1 Then CheckCount ' Just in case (Overflow can cuase the addtimer to fail) else PlaySoundVol "sfx_miss", VolTable End If End Sub Sub tgHadron4_Hit() PlaySoundVol "fx_target", VolTable DOF 119, DOFPulse dim saveCnt:saveCnt=0 if PlayerMode <> -1 then saveCnt = ModeProgress(PlayerMode) if tgHadron4.UserValue = 0 then PlaySoundVol "gg_hadron", VolSfx SetLightColor lHadron4, "yellow", 2 lHadron4.UserValue=1 tgHadron4.UserValue = 1 CheckModeProgress("tgHadron4") if PlayerMode <> -1 then ' Add a base score if this didnt give progress if saveCnt = ModeProgress(PlayerMode) then AddScore 20000 else AddScore 20000 End If if PlayerMode=1 then BonusAddModeHit(1) ' These are special when we are in ronan mode vpmtimer.addtimer 500, "CheckCount '" elseIf tgHadron0.UserValue = 1 and tgHadron1.UserValue = 1 and tgHadron2.UserValue =1 and tgHadron3.UserValue = 1 and tgHadron4.UserValue = 1 Then CheckCount ' Just in case (Overflow can cuase the addtimer to fail) else PlaySoundVol "sfx_miss", VolTable End If End Sub Sub CheckCount() ' FIX13: Abort if PUP is shutting down to prevent invalid pointer crash If Not bPupStarted Then Exit Sub 'Debug.print "CheckCount:" & lHadron0.UserValue & " " & lHadron1.UserValue & " " & lHadron2.UserValue & " " & lHadron3.UserValue & " " & lHadron4.UserValue ' Whichever one is flashing is the one we hit (make it solid) Dim state:state = 1 if PlayerMode = 1 then state = 0 ' RONAN level inverts the state when hit if PlayerMode2 = 1 then Exit Sub ' Cant earn again?? if (lHadron0.UserValue =1) Then lHadron0.State = state:lHadron0.UserValue=0 if (lHadron1.UserValue =1) Then lHadron1.State = state:lHadron1.UserValue=0 if (lHadron2.UserValue =1) Then lHadron2.State = state:lHadron2.UserValue=0 if (lHadron3.UserValue =1) Then lHadron3.State = state:lHadron3.UserValue=0 if (lHadron4.UserValue =1) Then lHadron4.State = state:lHadron4.UserValue=0 'debug.print "HadronCheck:" & tgHadron0.UserValue & " " & tgHadron1.UserValue & " " & tgHadron2.UserValue & " " & tgHadron3.UserValue & " " & tgHadron4.UserValue AddScore 6110 ' Add default points for hadron 'HadronCount = HadronCount+1 If tgHadron0.UserValue and tgHadron1.UserValue and tgHadron2.UserValue and tgHadron3.UserValue and tgHadron4.UserValue Then ' FIX13: Mark screen 13 busy before pOverVid playmedia to prevent collision with ' simultaneous StartPlayerMode pDMDEvent when scoop triggers a mode change at the ' same time all Hadron targets are lit (same crash pattern as FIX7) bPupEventBusy = True dScreen13LastActivity = Timer() vpmtimer.addtimer 4000, "bPupEventBusy = False '" vpmtimer.addtimer 4000, "dScreen13LastActivity = 0 '" QueueScene "playmedia ""Video-0x0035.mp4"", ""PupVideos"", pOverVid , """", -1, """", 1, 1 '", 3492, 1 HadronEnforcerCount=HadronEnforcerCount + DMDFet(kDMDFet_HadronAwards) if HadronEnforcerCount>DMDFet(kDMDFet_HadronLimit) then HadronEnforcerCount=DMDFet(kDMDFet_HadronLimit) CheckHadron False ' Let this flash it so we can check rules PlaySoundVol "gg_Hadron" & INT(RND*2)+1, VolDef tgHadron0.UserValue = 0 tgHadron1.UserValue = 0 tgHadron2.UserValue = 0 tgHadron3.UserValue = 0 tgHadron4.UserValue = 0 SetLightColor lHadron0, "yellow", 0 SetLightColor lHadron1, "yellow", 0 SetLightColor lHadron2, "yellow", 0 SetLightColor lHadron3, "yellow", 0 SetLightColor lHadron4, "yellow", 0 'HadronCount = 0 AddScore 20000 ' 20k for lighting hadron ' Manual test with no mode it was 75000 End if End Sub Sub FakeHadronHit(LightName) Debug.print "FakeHadronHit:" & LightName bDebounce=False ' Skip debounce so we can slam through these really quickly BonusAddModeHit(GetBonusIndex(LightName)) CheckModeProgress(LightName) End Sub Sub CheckHadron(bUseIt) ' Execute the Hadron Endorcer if we have one Dim bUsed dim FakedSwitch Dim a bUsed = False If (HadronEnforcerCount>0) Then Debug.print "CheckHadron:" & HadronEnforcerCount ' Execute Hadron Enforcer For Wizard Modes If tmrCherryBomb.Enabled Then For each a in aRampLights ' Hit the Blinking ones if a.state = 2 and tmrCherryBombMouth.Enabled=False Then ' Spot everything except Final shot bUsed=True if bUseIt then FakeHadronHit a.name exit for End if Next elseif tmrImmolation.Enabled Then For each a in aRampLights ' Hit the Blinking ones if a.state = 2 Then bUsed=True if bUseIt then FakeHadronHit a.name exit for End if Next elseif tmrXandar.Enabled Then if lYonduArrow.state = 2 then ' Prioritize Yando bUsed=True if bUseIt then FakeHadronHit "lYonduArrow" elseif lStarLordArrow.state = 2 then ' Prioritize StarLord bUsed=True if bUseIt then FakeHadronHit "lStarLordArrow" else ' Do others For each a in aRampLights ' Hit the Blinking ones if a.state = 2 Then bUsed=True if bUseIt then FakeHadronHit(a.name) exit for End if Next end if elseif bGrootMultiball then For each a in aRampLights ' Hit the Blinking ones if a.state = 2 and Not (a.name = "lgr_a" and (GrootMBJackpotCnt=6 or GrootMBJackpotCnt>=12)) Then ' Spot everything except Final shots if PlayerMode=-1 or (PlayerMode<>-1 and a.name<>"lStarLordArrow") then ' Cant get to Starlord for Hadron if we are stacked bUsed=True if bUseIt then FakeHadronHit a.name exit for End if End if Next elseif bOrbMultiBall then For each a in aRampLights ' Hit the Blinking ones if a.state = 2 and tmrOrbHurryUp.Enabled=False and NOT (a.name= "lBrokerArrow" and (OrbMBJackpotHits=9 or OrbMBJackpotHits=8)) Then ' Spot everything except Final shots if PlayerMode=-1 or (PlayerMode<>-1 and a.name<>"lStarLordArrow") then ' Cant get to Starlord for Hadron if we are stacked bUsed=True if bUseIt then FakeHadronHit a.name exit for End if End if Next End if ' Execute Hadron Enforcer For Standard Modes if bUsed=False then ' Make sure we didnt already use it Select Case PlayerMode case -1:' No Mode Selected Case 0: ' Nebula - Pod Chase (10 shots) If ModeProgress(PlayerMode) >= 10 Then 'TBD: What does it do when mode is done? else For each a in aRampLights if a.state <> 0 Then bUsed=True if bUseIt then FakeHadronHit a.name exit for ' TBD Prioritize the ones that are blinking End if Next End If Case 1: ' Ronan - Sanctuary (5 shots) Case 2: ' Yandu - Yaka Arrow (8 shots) If ModeProgress(PlayerMode) >= 8 Then 'TBD: What does it do when mode is done? else if bUseIt then FakeHadronHit "lYonduArrow" ' This light is always lit during this mode and farthest left bUsed = True End If Case 3: ' Star Lord - Quills Quest (12 shots) If ModeProgress(PlayerMode) >= 12 Then 'TBD: What does it do when mode is done? else For each a in aRampLights ' Upgrade to blinking if a.state <> 0 then if bUseIt then FakeHadronHit a.name bUsed = True Exit For End If Next End If Case 4: ' Drax - Knowhere (8 shots) If ModeProgress(PlayerMode) >= 8 Then 'TBD: What does it do when mode is done? else if bUseIt then FakeHadronHit "lRonanArrow" bUsed = True End If Case 5: ' Rocket - Escape Kyln (7 shots, Hadron Enforcer works on all except Rocket) If ModeProgress(PlayerMode) >= 7 Then 'TBD: What does it do when mode is done? else if PlayerState(CurrentPlayer).lNovaStatesKyln(0) = 2 then FakedSwitch="sw2" elseif PlayerState(CurrentPlayer).lNovaStatesKyln(1) = 2 then FakedSwitch="sw3" elseif PlayerState(CurrentPlayer).lNovaStatesKyln(2) = 2 then FakedSwitch="sw4" elseif PlayerState(CurrentPlayer).lNovaStatesKyln(3) = 2 then FakedSwitch="sw8" elseif PlayerState(CurrentPlayer).lNovaStatesKyln(4) = 2 then FakedSwitch="sw9" elseif StackState(kStack_Pri0).GetArrowState(lgr_a) = 1 and StackState(kStack_Pri0).GetArrowState(lRocketArrow)=1 then FakedSwitch="lRocketArrow1" elseif StackState(kStack_Pri0).GetArrowState(lgr_a) = 2 then FakedSwitch="lgr_a" End if if FakedSwitch<>"" and ModeProgress(PlayerMode) <= 6 then if bUseIt then FakeHadronHit FakedSwitch bUsed = True End if ' if lgr_a.state <> 0 then ' Hit Groot for them ' if bUseIt then FakeHadronHit "lgr_a" ' bUsed = True ' elseif ModeProgress(PlayerMode) < 6 then ' Last one must be RocketKicker and cant use Hadron on it ' if bUseIt then FakeHadronHit "lRocketArrow" ' bUsed = True ' End If End If Case 6: ' Gamora - Siblng Rvlry (10 shots) If ModeProgress(PlayerMode) >= 10 Then 'TBD: What does it do when mode is done? else For each a in aRampLights ' Upgrade to blinking if a.state <> 0 then if bUseIt then FakeHadronHit a.name bUsed = True Exit For End If Next End If Case 7: ' Broker - Antique Shop (7 shots) If ModeProgress(PlayerMode) >= 7 Then 'TBD: What does it do when mode is done? else if bUseIt then FakeHadronHit "lBrokerArrow" bUsed = True End If End Select End if debug.print "HadronCheck cnt:" & HadronEnforcerCount & " used:" & bUsed & " useIt:" & bUseIt If bUsed and bUseIt Then pDMDEvent(kDMD_UseHadron) 'PlaySound "Lightning-5" PlaySoundVol "Hadron-Arrow2", VolSfx HadronEnforcerCount = HadronEnforcerCount - 1 if HadronEnforcerCount <= 0 Then HadronFlash "", False End If Elseif bUseIt = False then ' See if we would have used the Hadron if HadronEnforcerCount <= 0 Then HadronFlash "", False elseif bUsed then HadronFlash "yellow", True else HadronFlash "", False End If End If End If End Sub '****************************************** ' Groot Lock & Multiball (GrootMB) '****************************************** Sub OrbHurryUpFinish() Debug.print "OrbHurryUpFinish:" & OrbMBJackpotHits dim a if OrbMBJackpotHits = 9 then ' Super Jackpot HurryUp OrbMBJackpotHits=0 tmrOrbHurryUp.Enabled = False puPlayer.LabelSet pDMDText,"Timer", "" ,1,"" ' Setup Lights for bonus shots For each a in aRampLights SSetLightColor kStack_Pri1, a, "purple", 2 'SetLightColor a, "blue", 2 a.Intensity = 100 Next else OrbMultiBallProgress = 0 if bUsePUPDMD then puPlayer.LabelSet pDMDText,"Timer", "" ,1,"" if tmrOrbHurryUp.UserValue < 50000 then tmrOrbHurryUp.UserValue = 500000 if bUsePUPDMD then pupDMDDisplay "-", "Orb Bonus" & "^" & tmrOrbHurryUp.UserValue, "" ,2, 0, 10 AddScore tmrOrbHurryUp.UserValue OrbMBJackpot = OrbMBJackpot + tmrOrbHurryUp.UserValue tmrOrbHurryUp.Enabled = False ' Start Ball Saver EnableBallSaverForce 8 if OrbTarget1.IsDropped = False then ' They didnt hit the drop target so drop it for them and let the ball go OrbTarget1.IsDropped = True End If LoopGateLeft.Open = False ' Close back gate SetLightColor lMagnet, "white", 2 SetSlowPulse lMagnet ' Just BackOrb Target Goes back up OrbTarget2.IsDropped = False ' vpmtimer.addtimer 1500, "OrbTargetReset '" ' vpmtimer.addtimer 2000, "EnableOrb(False) '" ' Disable the orb target once it has had time to drop if (OrbMBJackpotHits = 8) Then ' Setup Double Jackpot OrbTarget2.IsDropped = False For each a in aRampLights ' Turn off all arrows except BrokerArrow SSetLightColor kStack_Pri1, a, "purple", 0 Next SSetLightColor kStack_Pri1, lBrokerArrow, "purple", 1 PlaySoundVol "say-SuperJackpotIsLit", VolDef Else ' Setup Lights for bonus shots For each a in aRampLights SSetLightColor kStack_Pri1, a, "purple", 2 'a.Intensity = 100 Next End if End if End Sub Sub tmrOrbHurryUp_Timer() tmrOrbHurryUp.Interval =50 if tmrPauseTimers.Enabled then Exit sub if tmrOrbHurryUp.UserValue > 500000 then tmrOrbHurryUp.UserValue=tmrOrbHurryUp.UserValue - 4210 if bUsePUPDMD then puPlayer.LabelSet pDMDText,"Timer", FormatScore(tmrOrbHurryUp.UserValue) ,1,"" Else RealBallsInLock=RealBallsInLock-1 OrbHurryUpFinish End If End Sub dim bOrbRealHit:bOrbRealHit=False Sub OrbTarget1_Hit() bOrbRealHit=True End Sub Sub OrbTarget1_Dropped() ' Drop the Target In front of the ORB ' PlaySoundVol SoundFXDOF("fx_Target",133,DOFPulse,DOFContactors), VolDef ' James DOF Removed if bGrootMultiball then 'debug.print "bGrootMultiball" OrbTarget1.isDropped = False if bOrbRealHit then tBroker_m_Hit ' Only real hits trigger score bOrbRealHit=False exit sub ' Cant start or Make progress during MB or CherryBomb End if debug.print "OrbTarget1_Dropped " & bOrbRealHit ' Check Broker Arrow if bOrbRealHit then tBroker_m_Hit ' Only real hits trigger score if bOrbMultiBall then bOrbRealHit=False exit sub End if If tmrSkillshot.Enabled and StackState(kStack_Pri3).GetArrowState(lBrokerArrow) = 2 Then ' Hold Left, Loop around and hit Orb, Right Ramp or Right Orbit AddScore 1000000 DOF 127, DOFPulse PlaySoundVol "gg_SkillShot", VolDef DOF 325, DOFPulse ' James DOF QueueScene "ScenePlayMessage ""SkillShot.mp4"", """","""",""1000000"" '", 2000, 1 QueueScene "SceneClearPlayMessage '", 0, 1 End If if (bQuillsQuestFirstTime=False and PlayerMode = 3) or (bOrbMultiBall and bOrbDisabled) then ' Stop the Orb drop when Arrows are lit OrbTarget1.isDropped = False bOrbRealHit=False Exit Sub End if if OrbMultiBallCount >= 2 and bOrbRealHit then ' Take 2 hits to drop after the second round if OrbTarget1Toggle then OrbTarget1Toggle=False Else playmedia "Orb-1More.mp4", "PupVideos", pOverVid, "", -1, "", 1, 1 OrbTarget1Toggle=True OrbTarget1.isDropped = False bOrbRealHit=False Exit Sub End If End If if bGameInPlay = False then bOrbRealHit=False exit sub ' Init reset target triggers this End if LightShootOrb.State = 2 if bOrbRealHit Then PlaySoundVol "vo_NebulaRetOrb", VolDef playmedia "Video-0x008D.mp4", "PupVideos", pOverVid, "", -1, "", 1, 1 DOF 133, DOFPulse ' James DOF end if if bOrbRealHit then CheckModeProgress("switch") AddScore 20030 BonusAddModeHit(5) End if bOrbRealHit=False End Sub dim bOrbDebounce ' This is so you cant hit it twice (usually only happens in the debugger) bOrbDebounce = False Sub OrbTarget2_Dropped() ' Hit the target inside the ORB ' PlaySoundVol SoundFXDOF("fx_Target",133,DOFPulse,DOFContactors), VolDef ' James DOF Removed PlaySoundVol SoundFX("fx_Target", DOFContactors), VolTable ' dim waittime:waittime=1 ' Check Broker Arrow tBroker_m_Hit if bOrbMultiBall then exit sub if (bOrbDebounce) then Exit Sub ' Bail (Changed to dropped instead of hit event..might not need this anymore) if (tmrXandar.Enabled or tmrImmolation.Enabled) Then ' Save Xandar and Immolation doesnt trigger OrbProgress OrbTarget2.IsDropped = False Exit Sub End If if tmrCherryBomb.Enabled then ' Cherry bomb doesnt do ORB OrbTarget2.IsDropped = False Exit Sub End If bOrbDebounce = True OrbMultiBallProgress = OrbMultiBallProgress + 1 OrbTarget1.IsDropped = False AddScore 100000 if (OrbMultiBallProgress = 1) then ' playmedia "Video-0x00AF.mp4", "PupVideos", pOverVid, "", -1, "", 1, 1 QueueScene "playmedia ""Video-0x00AF.mp4"", ""PupVideos"", pOverVid, """", -1, """", 1, 1 '", 2000, 1 DOF 321, DOFOn ' James DOF ' waittime = 2000 elseif (OrbMultiBallProgress = 2) then ' playmedia "Video-0x002A.mp4", "PupVideos", pOverVid, "", -1, "", 1, 1 QueueScene "playmedia ""Video-0x002A.mp4"", ""PupVideos"", pOverVid, """", -1, """", 1, 1 '", 2000, 1 DOF 322, DOFOn ' James DOF ' waittime = 2000 SetLightColor lBrokerName, "white", 2 elseif (OrbMultiBallProgress >= 3) Then ' StartOrbMB QueueFlush() PauseTimersForce(5000) QueueScene "playmedia ""Video-0x008F.mp4"", ""PupVideos"", pOverVid, """", -1, """", 1, 1 '", 2000, 1 QueueScene "ScenePlayMessage ""Video-0x004B.mp4"", ""ORB"","""",""MULTIBALL"" '", 2000, 1 QueueScene "SceneClearPlayMessage '", 0, 1 if Light033.state=0 then ' Do ORB Immolation Progress the 1st time QueueScene "DoImmolationI 8 '", 5000, 1 QueueScene2 "DoImmolationIClear '", 0, 1, True End if ' playmedia "Video-0x008F.mp4", "PupVideos", pOverVid, "", -1, "", 1, 1 DOF 323, DOFOn ' James DOF 'aRampLightsSave PlayDMDScene "vidOrbOpen.wmv", 3000 OrbMBCompletions=0 OrbMultiBallCount=OrbMultiBallCount+1 bOrbMultiBall=True bOrb2xEnabled=False bAddedABall=False StackState(kStack_Pri1).Enable(10) SetLightColor Light033, "purple", 2 ' Flash Orb Multiball on lower playfield GrootMouth_Drop(False) ' Close Groots Mouth in case it is open StartPlayerModeVideo True ' Play ORB MB Video OrbOpen() ' waittime = 5000 ' Wait for the clip to finish playing if bUsePUPDMD then puPlayer.LabelSet pDMDText,"Timer", FormatScore(2000000) ,1,"" ScorbitBuildGameModes() End If ' Play Light Sequence dim a For each a in aRampLights SetLightColor a, "purple", -1 a.Intensity = 100 Next GiOff LightSeqOrb.Play SeqCircleInOn, 100, 2 PlaySoundVol "gg_Orb2", VolSfx 'vpmtimer.addtimer waittime, "OrbPauseDone'" QueueScene2 "OrbPauseDone '", 1, 1, True CheckModeProgress("switch") End Sub Sub OrbPauseDone() ' Drop ball after effects bOrbDebounce=False GiOn OrbLightReset ' Put lights back after show if (OrbMultiBallProgress <= 2) Then ' Release ball DOF 321, DOFOff ' James DOF DOF 322, DOFOff DOF 323, DOFOff PlaySoundVol "gg_OrbReleaseBall", VolSfx LightShootOrb.State = 0 mMagnaSave.MagnetOn = True ' Turn on magna force DOF 142, DOFOn OrbTarget1.IsDropped = True vpmtimer.addtimer 1500, "OrbTargetReset '" vpmtimer.addtimer kOrbMagnetTime, "OrbMagnetOff '" end if if (OrbMultiBallProgress = 3) Then ' Third time dont release the ball (They have to hit it to start 3 multiball) PlaySoundVol "Bells", VolSfx SSetLightColor kStack_Pri1, lBrokerArrow, "purple", 2 LightSeqOrb.Play SeqRandom, 100, ,4000 RealBallsInLock=RealBallsInLock+1 ' Restart a ballsave for enture hurryup EnableBallSaverForce 40 LoopGateLeft.Open = True ' Open Back gate for Hurry up tmrOrbHurryUp.Interval = 4000 ' Initial delay (after the ball gets to the top) tmrOrbHurryUp.UserValue = 2000000 + (500000 * OrbMultiBallCount) ' 500K additional for each time you completed OrbMB tmrOrbHurryUp.Enabled = True ' Start the Hurry Up AddMultiball 1 ' Add Second Multiball ' we kick the ball with the autoplunger bAutoPlunger = True 'vpmtimer.addtimer 1000, "OrbLightReset '" ' Turn the light back to normal End If End Sub Sub OrbLightReset() ' Put the arrows back to their original color dim a for each a in aRampLights SetLightColorRestore a, -1 'SetLightColor a, modeRampColor, -1 a.Intensity = 10 Next End Sub sub OrbMagnetOff() mMagnaSave.MagnetOn = False DOF 142, DOFOff SetLightColor lMagnet, "white", 0 End Sub Sub OrbTargetReset() ' Put the target back up after we release the ball OrbTarget1.IsDropped = False OrbTarget2.IsDropped = False End Sub Sub OrbOpen() if (OrbRight.X < 636) Then OrbRight.X = OrbRight.X+2 OrbLeft.X = OrbLeft.X-2 vpmtimer.addtimer 100, "OrbOpen'" End If End Sub Sub OrbClose() if (OrbRight.X > 628) Then OrbRight.X = OrbRight.X-2 OrbLeft.X = OrbLeft.X+2 vpmtimer.addtimer 100, "OrbClose'" End If End Sub Sub EnableOrb(bEnabled) if bEnabled=False then OrbTarget1.IsDropped=False ' Make sure the target is up so we can hit it End if bOrbDisabled=(bEnabled = False) OrbTarget1Disabled.Collidable = (bEnabled = False) End Sub Sub StopOrbMultiball() if RealBallsInLock<>0 then RealBallsInLock=RealBallsInLock-1 ' TBD: Check if this is groot or ORB?? EnableOrb(True) bOrbMultiBall=False StackState(kStack_Pri1).Disable OrbMultiBallProgress=0 if (OrbMBJackpotHits >8) Then OrbMBJackpotHits=8 ' Go Back to Double JP LightSeqOrb.StopPlay() OrbTarget1.IsDropped = True 'SetLightColor Light033, "purple", 0 ' Didnt Finish, it just stays flashing if tmrOrbHurryUp.Enabled then ' Lost the before timer ran down (Release the Locked ones) if bUsePUPDMD then puPlayer.LabelSet pDMDText,"Timer", "" ,1,"" tmrOrbHurryUp.Enabled = False if bUsePUPDMD then pupDMDDisplay "-", "Orb Bonus" & "^500000", "" ,2, 0, 10 AddScore 500000 End If QueueScene2 "ShowPlayerModeComplete(1) '", 2000, 1, True ' Show ORB MB Total SetLightColor lMagnet, "white", 0 if bSecondMode=False and PlayerMode=-1 then StopPlayerModeVideo ' No Modes running go to wait screen Else StartPlayerModeVideo False ' Restart the Mode Video End if aRampLightsRestore ' Put the arrows back to their original color SetLightColor lBrokerName, "cyan", 0 'SetLightColorRestore lBrokerName, -1 vpmtimer.addtimer 1000, "OrbTargetReset' " CheckWizardModesReady OrbClose ScorbitBuildGameModes() End Sub Dim tmrGrootMBBonus_PreRelease:tmrGrootMBBonus_PreRelease=0 Sub tmrGrootMBBonus_Timer() Dim i Dim value debug.print "Groot MB Timer " & tmrGrootMBBonus.UserValue tmrGrootMBBonus.UserValue = tmrGrootMBBonus.UserValue - 1 value=tmrGrootMBBonus.UserValue-2 if value <0 then value = 0 if bGrootBonus3x then if bUsePUPDMD then puPlayer.LabelSet pDMDText,"MTimer", "3X FOR " & value ,1,"" Else if bUsePUPDMD then puPlayer.LabelSet pDMDText,"MTimer", "2X FOR " & value ,1,"" End If if tmrGrootMBBonus.UserValue = 20 and tmrGrootMBBonus_PreRelease<>0 then GrootMouth_Drop(True) BallsInLock = BallsInLock -1 vpmtimer.addtimer 1000, "CreateNewBallGroot() '" if tmrGrootMBBonus_PreRelease=2 then BallsInLock = BallsInLock -1 vpmtimer.addtimer 1100, "CreateNewBallGroot() '" End if EnableBallSaver BallSaverTime tmrGrootMBBonus_PreRelease=0 tmrGrootMouthClose.Interval = 2000 tmrGrootMouthClose.Enabled = True elseif tmrGrootMBBonus.UserValue = 0 then if (bGrootBonus3x) Then ' Clear 3x or 2x Play Multipliers AddPlayMultiplier 1/3 Else AddPlayMultiplier 1/2 End If bGrootBonus3x = False tmrGrootMBBonus.Enabled = False if bUsePUPDMD then puPlayer.LabelSet pDMDText,"MTimer", "" ,1,"" If BallsInLock <> 0 and bGrootMultiball then ' During MB if we lock any balls we let the go after the timer runs out (If we are still in MB) debug.print "Groot MB Release " & BallsInLock bBallSaverReady = True ' Turn On Ball Saver EnableBallSaver BallSaverTime GrootMouth_Drop(True) for i = 0 to BallsInLock - 1 BallsInLock = BallsInLock -1 vpmtimer.addtimer 1000 + (i*200), "CreateNewBallGroot() '" Next tmrGrootMouthClose.Interval = 2000 tmrGrootMouthClose.Enabled = True End If End If End Sub Sub tmrGrootMouth_Timer ' This actually drops the mouth if tmrGrootMouth.UserValue = True Then ' Drop if GrootMouth.z > -30 then GrootMouth.z = GrootMouth.z - 5 Else GrootMouth.z = -30 tmrGrootMouth.Enabled = False GrootMouth.Collidable = False End If Else ' Close if GrootMouth.z < 19.33 then GrootMouth.z = GrootMouth.z + 8 Else 'GrootMouth.z = 19.33 tmrGrootMouth.Enabled = False End If End If End Sub Sub DisableGrootMouth(bDisable) ' Closes the save the current state, close the mouth and set disable flag. Opposite restores the state if bDisable then bGrootMouthDisabled=True bSaveGrootMouthOpen=GrootMouth_IsDropped() GrootMouth_Drop(False) Else bGrootMouthDisabled=False GrootMouth_Drop(bSaveGrootMouthOpen) End if End Sub Sub GrootMouth_Drop(value) if Value = True Then tmrGrootMouth.UserValue = True tmrGrootMouth.Enabled = True Elseif Value = False Then tmrGrootMouth.UserValue = False GrootMouth.Collidable = True ' As it is going up make it collidable tmrGrootMouth.Enabled = True End If End Sub Function GrootMouth_IsDropped() GrootMouth_IsDropped = tmrGrootMouth.UserValue End Function Sub GrootMouth_Hit() ' Default stuff we do every time DOF 120, DOFPulse CheckModeProgress("lgr_a") CheckModeProgress("switch") SwitchHit "tGroot_m" AddScore 1510 ' Default Score BonusAddModeHit(4) if tmrImmolation.Enabled then Exit Sub ' Immolation cant drop the mouth if tmrCherryBomb.Enabled then Exit Sub ' Cherry Bomb cant drop the mouth if tmrXandar.Enabled then Exit Sub ' Save Xandar cant do Groot MB if bQuillsQuestFirstTime = False and PlayerMode = 3 then Exit Sub ' Quills Quest Cant drop mouth on MB if bOrbMultiBall then Exit Sub ' Cant do Groot mouth during OrbMB 'debug.print "Groot MB:" & bGrootMultiball & " " & GrootMBLocks if (bGrootMultiball) then ' If we are in MultiBall dont open (confusing here Video doesnt open but rules say it does) if GrootMBJackpotCnt=6 or GrootMBJackpotCnt=12 Then AddScore 3000000 GrootMBJackpot = GrootMBJackpot + (3000000 * Multiplier3x * MultiplierShot * PlayMultiplier) ModePointsGroot=ModePointsGroot + (3000000 * Multiplier3x * MultiplierShot * PlayMultiplier) Else AddScore 100000 GrootMBJackpot = GrootMBJackpot + (100000 * Multiplier3x * MultiplierShot * PlayMultiplier) ModePointsGroot=ModePointsGroot + (100000 * Multiplier3x * MultiplierShot * PlayMultiplier) end if if GrootMBLocks >= 3 or bGrootBonus3x then Exit Sub ' You only get 3 locks during MB. If you have 3x then you have to wait until it is done to get your third lock if tmrCherryBombMouth.Enabled then exit sub ' Dont accepts hits when mouth is openeing and closing for final shot if bGrootBonus3x=False and tmrGrootMBBonus.Enabled then QueueScene "ScenePlayMessage2 ""Video-0x008E.mp4"", ""100,000"",""LOCK IS LIT"",""ADD BALLS FOR 3X TIMED LOCK"", 3 '", 2000, 1 Else QueueScene "ScenePlayMessage2 ""Video-0x008E.mp4"", ""100,000"",""LOCK IS LIT"",""ADD BALLS FOR 2X TIMED LOCK"", 3 '", 2000, 1 End if QueueScene2 "SceneClearPlayMessage '", 0, 1, True Else PlayDMDScene "vidGrootLockIsLit.wmv", 4000 pDMDEvent(kDMD_GrootLockIsLit) End If PlaySoundVol "GrootHit1-284", VolSfx if (GrootMultiBallCount >=2) then ' On the 3rd MultiBall you have to hit the mouth twice if (GrootMultiBallToggle=True) Then '2nd time do it GrootMouth_Drop(True) tmrGrootMouthClose.Interval = 1000 DOF 120, DOFPulse ' James DOF GrootMultiBallToggle = False Else '1st time skip GrootMultiBallToggle = True end If else ' Others just drop it the first time GrootMouth_Drop(True) tmrGrootMouthClose.Interval = 1000 End If ' if (GrootMouth_IsDropped) Then ' AddScore 250000 ' Dim a ' aLightsSave ' For each a in aRampLights ' SetLightColor a, "green", -1 ' a.Intensity = 100 ' Next ' GiOff ' LightSeqGroot.Play SeqCircleInOn, 12, 0 ' LightSeqGroot.Play SeqWiperLeftOn, 45 ' End If SetLightColor lgr_mb, "white", 2 if bGrootMultiball=False then ' Setup Inserts for MB vpmtimer.addtimer 1500, "GrootMouthDone'" End if End Sub Sub PlayGrootMBLightSeq() bGrootMultiballWait=True StartPlayerModeVideo False ' Play GrootMB MB Video PauseTimersForce(8000) if bCompetitionMode = False then ' Shortened because people thought it took too long PlayGrootMBLightSeqShort Exit Sub End if ' This is what the original game does Dim interval:interval=8 dim angle:angle=10 dim j for j = 0 to 6 LightSeqGroot.UpdateInterval = interval LightSeqGroot.Play SeqRightOn, angle,0,0 LightSeqGroot.UpdateInterval = interval LightSeqGroot.Play SeqLeftOn, angle,0,0 next LightSeqGroot.UpdateInterval = 5 LightSeqGroot.Play SeqRandom, 20, ,3000 GrootMouth_Drop False ' Close the Mouth End Sub Sub PlayGrootMBLightSeqShort() Dim interval:interval=8 dim angle:angle=10 dim j for j = 0 to 3 LightSeqGroot.UpdateInterval = interval LightSeqGroot.Play SeqRightOn, angle,0,0 LightSeqGroot.UpdateInterval = interval LightSeqGroot.Play SeqLeftOn, angle,0,0 next LightSeqGroot.UpdateInterval = 5 LightSeqGroot.Play SeqRandom, 20, ,1000 SetFlipperSkipCmd "LightSeqGroot.StopPlay:LightSeqGroot_Playdone '" ' DONT FORGET TO CLEAR FlipperSkipCmd when you are past this stage GrootMouth_Drop False ' Close the Mouth End Sub Sub LightSeqGroot_Playdone() FlipperSkipCmd="" ' Clear it ' Dim str ' str = "IAmGroot" & INT(RND * 10) + 1 vpmtimer.addtimer 100, "PlaySoundVol ""IAmGroot1"", VolDef '" SetFlipperSkipCmd "tmrIAmGroot.UserValue=""GROOT"" '" ' DONT FORGET TO CLEAR FlipperSkipCmd when you are past this stage tmrIAmGroot.UserValue = "I" tmrIAmGroot.Enabled = True End Sub Sub tmrIAmGroot_Timer() DOF 321, DOFOff ' James DOF DOF 322, DOFOff DOF 323, DOFOff DOF 324, DOFOff Select case tmrIAmGroot.UserValue case "I" if GrootMouth.z > 0 then GrootMouth.z = GrootMouth.z - 5 Else tmrIAmGroot.UserValue = "I-close" DOF 310, DOFPulse ' James DOF End If case "I-close" if GrootMouth.z < 19.4 then GrootMouth.z = GrootMouth.z + 5 Else tmrIAmGroot.UserValue = "Pause1" End If case "Pause1" tmrIAmGroot.UserValue = "AM" DOF 311, DOFPulse ' James DOF case "AM" if GrootMouth.z > -10 then GrootMouth.z = GrootMouth.z - 5 Else tmrIAmGroot.UserValue = "AM-close" End If case "AM-close" if GrootMouth.z < 19.4 then GrootMouth.z = GrootMouth.z + 5 Else tmrIAmGroot.UserValue = "Pause2" End If case "Pause2" tmrIAmGroot.UserValue = "Pause3" case "Pause3" tmrIAmGroot.UserValue = "GROOT" case "GROOT" DOF 312, DOFPulse ' James DOF FlipperSkipCmd="" ' Clear it if GrootMouth.z > -30 then GrootMouth.z = GrootMouth.z - 5 Else GrootMouth.z = -30 tmrIAmGroot.Enabled = False GrootMouth.Collidable = False tmrGrootMouth.UserValue = True vpmtimer.addtimer 1000, "StartGrootMB '" End If End Select End Sub Sub PlayGrootLockLightSeq() DOF 133, DOFOff ' James DOF SetLightColor lgr_mb, "white", 0 LightSeqGrootLock.UpdateInterval = 4 LightSeqGrootLock.Play SeqUpOn, 100, 0 LightSeqGrootLock.Play SeqUpOn, 100, 0 End Sub Sub GrootMouthDone() 'debug.print "Balls In Lock Mouth Done:" & BallsInLock SetLightColor lgr_1, "green", 0 SetLightColor lgr_2, "green", 0 SetLightColor lgr_3, "green", 0 SetLightColor lgr_4, "green", 0 if (BallsInLock=0) then if lgr_mb.state = 2 then SetLightColor lgr_1, "green", 2 elseif (BallsInLock=1) then SetLightColor lgr_1, "green", 1 if lgr_mb.state = 2 then SetLightColor lgr_2, "green", 2 elseif (BallsInLock=2) then SetLightColor lgr_1, "green", 1 SetLightColor lgr_2, "green", 1 if lgr_mb.state = 2 then SetLightColor lgr_3, "green", 2 elseif (BallsInLock=3) then SetLightColor lgr_1, "green", 1 SetLightColor lgr_2, "green", 1 SetLightColor lgr_3, "green", 1 if lgr_mb.state = 2 then SetLightColor lgr_4, "green", 2 end if End Sub Sub tmrGrootMouthClose_Timer() if bGrootMultiball then OrbMagnetOff End If GrootMouth_Drop(False) tmrGrootMouthClose.Enabled = False End Sub 'Sub GrootKicker_Hit() ' GrootKicker.DestroyBall ' BallsOnPlayfield = BallsOnPlayfield - 1 ' GrootMouth.IsDropped = False ' GrootMouth.TimerEnabled = False ' CreateNewBall() ' 'score 20:BallsUsed=BallsUsed-1:DMD.AddMessage "","*** Skee Balls "&Skeeballs-BallsUsed&" Left ***",1050,"" ' 'K20.State=LightStateOn:playsound "targ":CheckSkee:Kicker20.DestroyBall:SkeeKicker.CreateBall:SkeeKicker.kick 0,0 'End Sub Sub GrootKicker_Hit() Dim waittime waittime = 100 ' Default Groot Hit Checks CheckModeProgress("lgr_a") CheckModeProgress("switch") SwitchHit "tGroot_m" AddScore 1510 ' Default Score BonusAddModeHit(4) ' Mount Open Checks CheckModeProgress("GrootKicker") GrootKicker.DestroyBall BallsOnPlayfield = BallsOnPlayfield - 1 if tmrCherryBomb.Enabled Then Exit Sub ' Cherry Bomb final shot so bail out PlaySoundVol "gg_lazer", VolSfx BallsInLock = BallsInLock + 1 if bGrootMultiball then GrootMBLocks = GrootMBLocks + 1 'debug.print "Balls In Lock:" & BallsInLock Select Case BallsInLock Case 1 DMD "", CL(1, "BALL 1 LOCKED"), "", eNone, eBlinkFast, eNone, 1000, True, "" PlaySoundVol "sfx_BallLock1", VolSfx DOF 321, DOFOn ' James DOF if bGrootMultiball then bGrootBonus3x = False tmrGrootMBBonus_PreRelease=0 if BallsOnPlayfield=0 then tmrGrootMBBonus_PreRelease=1 ' No balls, release one tmrGrootMBBonus.Enabled = True tmrGrootMBBonus.UserValue = 20+2 PlaySoundVol "2xMultiplier", VolDef AddPlayMultiplier 2 QueueScene "ScenePlayMessage2 ""Video-0x008E.mp4"", ""100,000"",""BALL LOCKED"",""ALL SCORES 2X FOR 20 SECONDS"", 3 '", 2000, 1 QueueScene "SceneClearPlayMessage '", 0, 1 else pDMDEvent(kDMD_GrootBallLock1) SetLightColor lgr_1, "green", 1 End if GrootMouth_Drop(False) AddScore 100000 GiOff PlayGrootLockLightSeq 'bBallSaverReady = True bAutoPlunger = True if (tmrGrootMBBonus.Enabled=False) then vpmtimer.addtimer 2000, "AddMultiballFast(1) '" ' Dont create a ball if already in MB, timer allows video to play Case 2 DMD "", CL(1, "BALL 2 LOCKED"), "", eNone, eBlinkFast, eNone, 1000, True, "" PlaySoundVol "sfx_BallLock1", VolSfx DOF 322, DOFOn ' James DOF if bGrootMultiball then if tmrGrootMBBonus.Enabled and bGrootBonus3x=False then bGrootBonus3x = True PlaySoundVol "3xMultiplier", VolDef AddPlayMultiplier 3/2 ' Remove the 2x and add the 3x QueueScene "ScenePlayMessage2 ""Video-0x008E.mp4"", ""100,000"",""BALL LOCKED"",""ALL SCORES 3X FOR 20 SECONDS"", 3 '", 2000, 1 QueueScene2 "SceneClearPlayMessage '", 0, 1, True Else PlaySoundVol "2xMultiplier", VolDef AddPlayMultiplier 2 QueueScene "ScenePlayMessage2 ""Video-0x008E.mp4"", ""100,000"",""BALL LOCKED"",""ALL SCORES 2X FOR 20 SECONDS"", 3 '", 2000, 1 QueueScene2 "SceneClearPlayMessage '", 0, 1, True End If tmrGrootMBBonus_PreRelease=0 if BallsOnPlayfield=0 then tmrGrootMBBonus_PreRelease=1 ' No balls, release one if BallsOnPlayfield=0 and bGrootBonus3x then tmrGrootMBBonus_PreRelease=2 ' when we are at 3x it releases both tmrGrootMBBonus.Enabled = True tmrGrootMBBonus.UserValue = 20+2 Else pDMDEvent(kDMD_GrootBallLock2) SetLightColor lgr_2, "green", 1 End if GrootMouth_Drop(False) AddScore 200000 GiOff PlayGrootLockLightSeq 'bBallSaverReady = True bAutoPlunger = True if (tmrGrootMBBonus.Enabled=False) then vpmtimer.addtimer 3000, "AddMultiballFast(1) '" ' Dont create a ball if already in MB, timer allows video to play Case 3 DMD "", CL(1, "BALL 3 LOCKED"), "", eNone, eBlinkFast, eNone, 1000, True, "" DOF 323, DOFOn ' James DOF if GrootMultiBallCount = 0 then ' First round of MB SetLightColor lgr_3, "green", 1 PlayGrootMBLightSeq else ' Other rounds take 4 hits PlaySoundVol "sfx_BallLock1", VolSfx pDMDEvent(kDMD_GrootBallLock3) SetLightColor lgr_3, "green", 1 GrootMouth_Drop(False) AddScore 300000 GiOff PlayGrootLockLightSeq 'bBallSaverReady = True bAutoPlunger = True vpmtimer.addtimer 2000, "AddMultiballFast(1) '" ' Timer allows video to play End If Case 4 DMD "", CL(1, "BALL 4 LOCKED"), "", eNone, eBlinkFast, eNone, 1000, True, "" PlaySoundVol "say-GrootLock4", VolDef DOF 324, DOFOn ' James DOF SetLightColor lgr_4, "green", 1 GiOff PlayGrootMBLightSeq End Select End Sub Sub StartGrootFinalShot() Dim b tmrCherryBombMouth.Interval=kMouthAnimationSpeed tmrCherryBombMouth.Enabled = True For each b in aRampLights ' Turn off all arrows except GrootArrow SSetLightColor kStack_Pri1, b, "green", 0 Next SSetLightColor kStack_Pri1, lgr_a, "green", 2 GrootSJPReady=True End Sub Sub StartGrootMB() 'Multiball dim a, i, str dim shotsRemaining:shotsRemaining=0 GrootSJPReady=False ModePointsGroot=0 if Light030.state=0 then ' Do Groot Immolation Progress the 1st time QueueScene "DoImmolationI 9 '", 5000, 1 QueueScene2 "DoImmolationIClear '", 0, 1, True SetLightColor Light030, "green", 2 ' Flash Groot Multiball End if StackState(kStack_Pri1).Enable(9) aRampLightsSave For each a in aRampLights ' Upgrade so all arrows are extra i = GetModeIndex(a.name) if GrootMBJackpotHits(CurrentPlayer, i) < 3 then SSetLightColor kStack_Pri1, a, "green", 2 shotsRemaining=shotsRemaining+(3-GrootMBJackpotHits(CurrentPlayer, i)) End if if bIsModeComplete(i) Then ' Light their name for 5x if they are done select case i case 0: Setlightcolor lNebulaName, "white", 2 case 1: Setlightcolor lRonanName, "white", 2 case 2: Setlightcolor lYonduName, "white", 2 case 3: Setlightcolor lStarLordName, "white", 2 case 4: Setlightcolor lDraxName, "white", 2 case 5: Setlightcolor lRocketName, "white", 2 case 6: Setlightcolor lGamoraName, "white", 2 case 7: Setlightcolor lBrokerName, "white", 2 case 8: Setlightcolor lgr, "white", 2 End Select end if Next Debug.print "StartGrootMB: Remaining:" & shotsRemaining & "/" & 18-GrootMBJackpotCnt if 18-GrootMBJackpotCnt=0 then ' No more shots left StartGrootFinalShot End if ' if ExtraBallsAwards(CurrentPlayer) = 0 and PlayerState(CurrentPlayer).bExtraball_1 = False then ' You get extra ball for first MB ' PlayerState(CurrentPlayer).bExtraball_1 = True ' AwardExtraBall ' End If ' str = "IAmGroot" & INT(RND * 10) + 1 ' vpmtimer.addtimer 1500, "PlaySoundVol """ & str & """, VolDef '" DMD "", CL(1, "SF MULTIBALL"), "", eNone, eBlinkFast, eNone, 1000, True, "" PlaySoundVol "vo_multiball", VolDef AddScore 200000 BallsInLock = 0 bGrootMultiballWait=False bGrootMultiball = True bAddedABall=False GrootMBLocks = 0 EnableOrb(False) 'OrbTarget1Disabled.Collidable = True GrootMBJackpot=0 ' GrootMBJackpotCnt = 0 SMBHits = 0 SetLightColor lgr_1, "green", 0 SetLightColor lgr_2, "green", 0 SetLightColor lgr_3, "green", 0 SetLightColor lgr_4, "green", 0 DOF 321, DOFOff ' James DOF DOF 322, DOFOff DOF 323, DOFOff ' TBD: Ramp Light are supposed to flash 'LightSeqGates.Play SeqBlinking, 100, 7, 200 bBallSaverReady = True ' Usually this is done on the plunger but we do it here for the grootkicker EnableBallSaverForce 15 mMagnaSave.MagnetOn = True ' Turn on magna force DOF 142, DOFOn GrootMultiBallCount = GrootMultiBallCount + 1 vpmtimer.addtimer 100, "CreateNewBallGroot() '" vpmtimer.addtimer 200, "CreateNewBallGroot() '" vpmtimer.addtimer 300, "CreateNewBallGroot() '" if GrootMultiBallCount > 1 then ' 4 Multiballs after the first round vpmtimer.addtimer 400, "CreateNewBallGroot() '" End If tmrGrootMouthClose.Interval = 1500 tmrGrootMouthClose.Enabled = True ScorbitBuildGameModes() End Sub Function EndGrootMB(checkRelease) EndGrootMB=False if bGrootMultiball then debug.print "check Release: " & checkRelease & " pfBalls:" & BallsOnPlayfield & " lock:" & BallsInLock & " GrootMBBonus:" & tmrGrootMBBonus.Enabled ' Release saved balls If BallsOnPlayfield=0 and BallsInLock <> 0 and tmrGrootMBBonus.Enabled then ' During MB if we lock any balls we let them go once we drain (If we are still in MB) debug.print "Groot MB Release " & BallsInLock GrootMouth_Drop(True) bBallSaverReady = True ' Turn On Ball Saver EnableBallSaver BallSaverTime EndGrootMB=True if BallsInLock = 1 and checkRelease then ' Go ahead and EndGrootMB but keep playing checkRelease = False End If if BallsInLock + BallsOnPlayfield = 1 then bMultiBallMode=False ' Just in case we are ending Groot MB and keeping 1 ball in play for i = 0 to BallsInLock - 1 BallsInLock = BallsInLock -1 vpmtimer.addtimer 1000 + (i*200), "CreateNewBallGroot() '" Next tmrGrootMouthClose.Interval = 2000 tmrGrootMouthClose.Enabled = True elseif BallsOnPlayfield=1 and BallsInLock <> 0 then ' We stay in MB because when the ball releases normally we can play MB EndGrootMB=True End If if checkRelease then Exit Function ' Bail out because we are just checking if we continue debug.print "Ending GrootMB" GrootSJPReady=False ' Stop mouth from openeing and closing tmrCherryBombMouth.Enabled = False GrootMouth_Drop(False) ' Close Groots Mouth SetLightColor lgr_mb, "white", 0 dim a, i for each a in aNameLights ' Turn off the name lights a.state=0 next Dim lamp StackState(kStack_Pri1).Disable aRampLightsRestore ' Put light back to what they should be for mode (Hopefully) bGrootMultiball = False QueueScene2 "ShowPlayerModeComplete(0) '", 2000, 1, True ' show Groot MB total if bSecondMode=False and PlayerMode=-1 then StopPlayerModeVideo ' No Modes running go to wait screen Else StartPlayerModeVideo False ' Restart the last mode video if we are stacked End if GrootMBLocks = 0 tmrGrootMBBonus.Enabled=False ' Disable the timer but leave whatever balls in there if bUsePUPDMD then puPlayer.LabelSet pDMDText,"MTimer", "" ,1,"" bGrootBonus3x=False bAutoPlunger=False EnableOrb(True) 'OrbTarget1Disabled.Collidable = False ContainerFlasher1.Visible = 0 ContainerFlasher2.Visible = 0 ContainerFlasher3.Visible = 0 ContainerFlasher4.Visible = 0 ContainerFlasher5.Visible = 0 ContainerFlasher6.Visible = 0 DOF 321, DOFOff ' James DOF DOF 322, DOFOff DOF 323, DOFOff DOF 324, DOFOff CheckWizardModesReady ScorbitBuildGameModes() End if ' For each lamp in aStorageLights ' lamp.State = 0 ' Next ' StopRainbow End Function Sub EndQuillMB() if PlayerMode=3 and bQuillsQuestFirstTime = False then ' First time through you stop the mode bQuillsQuestFirstTime=True EnableOrb(True) 'OrbTarget1Disabled.Collidable = False ' Enable OrbMB StopPlayerMode End If End Sub Sub Wall034_Timer() Wall034.UserValue = Wall034.Uservalue -1 if Wall034.UserValue=1 then RocketGun001.Rotx=5 RocketHead001.Rotx=5 RocketBody001.Rotx=5 RocketKickerKick ' Kickout the ball elseif Wall034.UserValue=0 then RocketGun001.Rotx=0 RocketHead001.Rotx=0 RocketBody001.Rotx=0 Wall034.TimerEnabled = False End if End Sub Sub RocketKicker_Hit() ClearShotMultiplier(lRocket_m) DoCombo lRocketArrow, True AddScore 1110 BonusAddModeHit(2) CheckModeProgress("switch") CheckModeProgress("lRocketArrow") RocketGun001.Rotx=10 RocketHead001.Rotx=10 RocketBody001.Rotx=10 Wall034.TimerInterval=60 Wall034.UserValue =2 Wall034.TimerEnabled = True ' Start timer to Kick out ball and Animate Rocket toy CheckRocket() SwitchHit "tRocket_m" MultiplierShot = 1 ' Clear shot multiplier End Sub Sub CheckRocket() if SpellRampage < 4 Then SpellRampage=SpellRampage+1 Select Case SpellRampage case 1: PlaySoundVol "gg_SpellG", VolSfx puPlayer.LabelSet pDMDText,"Rampage"," RAMP" ,1,"{'mt':2,'color':" & pupColorWhite & ",'ypos':65,'outline':1,'shadowstate': 1, 'xoffset':8, 'yoffset':8, 'shadowcolor':"&RGB( 0, 0, 0)&"}" DisplayDMDText "RAMP","", 1000 case 2: PlaySoundVol "gg_SpellG", VolSfx DisplayDMDText "RAMPA","", 1000 puPlayer.LabelSet pDMDText,"Rampage"," RAMPA" ,1,"{'mt':2,'color':" & pupColorWhite & ",'ypos':65,'outline':1,'shadowstate': 1, 'xoffset':8, 'yoffset':8, 'shadowcolor':"&RGB( 0, 0, 0)&"}" 'puPlayer.LabelSet pDMDText,"Rampage","RAMPA" ,1,"" case 3: PlaySoundVol "gg_SpellG", VolSfx DisplayDMDText "RAMPAG","", 1000 puPlayer.LabelSet pDMDText,"Rampage"," RAMPAG" ,1,"{'mt':2,'color':" & pupColorWhite & ",'ypos':65,'outline':1,'shadowstate': 1, 'xoffset':8, 'yoffset':8, 'shadowcolor':"&RGB( 0, 0, 0)&"}" 'puPlayer.LabelSet pDMDText,"Rampage","RAMPAG" ,1,"" SetLightColor lRocketArrow, "orange", 2 SetLightColor l004, "orange", 2 case 4: DisplayDMDText "RAMPAGE","", 1000 'puPlayer.LabelSet pDMDText,"Rampage"," RAMPAGE" ,1,"{'mt':2,'color':" & pupColorWhite & ",'ypos':65,'outline':1,'shadowstate': 1, 'xoffset':8, 'yoffset':8, 'shadowcolor':"&RGB( 0, 0, 0)&"}" 'puPlayer.LabelSet pDMDText,"Rampage","RAMPAGE" ,1,"" PlaySoundVol "gg_ImOnRampage", VolDef DisplayDMDText "2x BONUS","", 1000 AddPlayMultiplier 2 SetLightColor l004, "orange", 1 'SetLightColor LightGuardians, "white", 0 'SetLightColor LightMystery, "white", 1 tmrRampage.Interval = 1000 tmrRampage.UserValue = 30 tmrRampage.Enabled = True ' Start 30 seconds timer puPlayer.LabelSet pDMDText, "RampImg2", "PuPOverlays\\Rampage2.gif",1,"{'mt':2, 'ypos':50,'width':100, 'height':100, 'xalign':1, 'yalign':1, 'anigif':200,}" puPlayer.LabelSet pDMDText, "RampImg", "PuPOverlays\\Rampage.gif",1,"{'mt':2,'color':111111,'width':11, 'height':21, 'anigif':100,}" vpmtimer.addtimer 2000, "puPlayer.LabelSet pDMDText, ""RampImg2"", ""PuPOverlays\\Rampage2.gif"",0,"""" '" End Select vpmtimer.addtimer 1500, "puPlayer.LabelSet pDMDText,""Rampage"","""" ,1,"""" '" Else PlaySoundVol "gg_SpellG", VolSfx tmrRampage.UserValue = tmrRampage.UserValue + 30 End If End Sub Sub tmrRampage_Timer if tmrPauseTimers.Enabled and bMultiBallMode=False then Exit sub ' Pasue Rampage on timer only when not in MB if bPlayerModeSelect and tmrRampage.UserValue<>0 then exit sub ' Dont countdown during player select tmrRampage.UserValue = tmrRampage.UserValue -1 puPlayer.LabelSet pDMDText,"RampTimer", tmrRampage.UserValue ,1,"{'mt':2,'size':5,'xalign':1,'xpos':5.2,'ypos':45}" 'puPlayer.LabelSet pDMDText,"RampTimer", tmrRampage.UserValue ,1,"{'mt':2,'size':6,'xpos':0, 'ypos':45'}" ' TBD: needs foot icon around it if tmrRampage.UserValue <= 0 then puPlayer.LabelSet pDMDText, "RampImg", "PuPOverlays\\Rampage.gif",0,"{'mt':2,'color':111111,'width':11, 'height':21, 'anigif':100,}" puPlayer.LabelSet pDMDText,"RampTimer", "" ,1,"" SpellRampage = DMDFet(kDMDFet_RampageSpellout) AddPlayMultiplier 1/2 tmrRampage.Enabled = False SetLightColor l004, "orange", 0 'SetLightColor lRocketArrow, "orange", 0 SetLightColorRestore lRocketArrow, -1 ' Restore the state based on the mode End If End Sub Sub RocketKickerKick() ' Kick out +- 2 degrees 'RocketKicker.Kick 170, 170 ' (60 + (5*RND-2)) 'RocketKicker.Kick (165 + (5*RND-2)), 90 ' (165 + (5*RND-2)) RocketKicker.Kick 161, RocketKickerPower ' ANGLE, Power DOF 113, DOFPulse DOF 112, DOFPulse End Sub 'Sub StorageLights(stat) ' Dim lamp ' If stat then ' DMD "", CL(1, "STORAGE IS LIT"), "", eNone, eBlinkFast, eNone, 1500, True, "vo_storageislit" ' 'FlashEffect 1 ' For each lamp in aStorageLights ' lamp.State = 2 ' Next ' 'l56.state = 2 ' Else ' For each lamp in aStorageLights ' lamp.State = 0 ' Next ' 'l56.state = 0 ' End If 'End Sub '************************ ' Add Time to a Hurry Up '************************ ' this "Add Time" does reset the timer if it is active, but it won't reset the score values 'Sub AddTime() ' If TerrorDogExpired.Enabled Then ' TerrorDogExpired.Enabled = 0 ' TerrorDogExpired.Enabled = 1 ' PlaySound "vo_timeadded" ' End If ' If GozerHurryUpExpired.Enabled Then ' GozerHurryUpExpired.Enabled = 0 ' GozerHurryUpExpired.Enabled = 1 ' PlaySound "vo_timeadded" ' End If ' If NROEATimerExpired.Enabled Then ' NROEATimerExpired.Enabled = 0 ' NROEATimerExpired.Enabled = 1 ' PlaySound "vo_timeadded" ' End If ' If LoopTimerExpired.Enabled Then ' LoopTimerExpired.Enabled = 0 ' LoopTimerExpired.Enabled = 1 ' PlaySound "vo_timeadded" ' End If ' If PKETimerExpired.Enabled Then ' PKETimerExpired.Enabled = 0 ' PKETimerExpired.Enabled = 1 ' PlaySound "vo_timeadded" ' End If 'End Sub const kVLCDelay = 400 ' Fixes Bug in VLC when Playing a video and then stopping or Pausing really quick the stop/pause doesnt actually work 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ' X X X X X X X X X X X X X X X X X X X X X X X '/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ '\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ ' X X X X X X X X X X X X X X X X X X X X X X X '/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ ' UTILITY - Video Manager & skipper '\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ ' X X X X X X X X X X X X X X X X X X X X X X X '/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ '\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ ' X X X X X X X X X X X X X X X X X X X X X X X ' ' NOTE: There is some kind if Bug in libVLC where if you start an audio or video clip and them immidiately stop or pause it doesnt actually stop or pause. ' So I have added a hack in place that delays the pause 400 msec. Not sure if a newer libVLC would fix this but this will make it work with the one in Pup ' It should really be replaced with a Queue since commands can be cascaded. ' ' Const pTopper=0 ' show, ' Const pDMD=1 ' ForceBack ' Const pDMDText=2 ' ForceBack ' Const pPlayfield=3 ' off ' Const pMusic=4 ' Music Only ' Const pAudio=5 ' Music Only ' Const pCallouts=8 ' Music Only ' Const pOvervid=14 ' ForcePopBack ' Const pGame=15 ' ForcePop - In Game mini game dim currentqueue dim cineon:cineon = 0 dim skipped:skipped = 0 dim bCancelNext:bCancelNext=False dim lastPlayMS(20) dim bMediaPaused(20) dim bMediaSet(20) dim videoInitCnt For videoInitCnt = 0 to 19 bMediaPaused(videoInitCnt)=False bMediaSet(videoInitCnt)=False lastPlayMS(videoInitCnt)=kVLCDelay ' 1st time nothing playing Next Sub CheckClearPupBug() ' We cant start and stop media right after each other otherwise it breaks VLC so catch it to delay the stop if bMediaSet(pAudio) and lastPlayMS(pAudio)<1000 then lastPlayMS(pAudio)=lastPlayMS(pAudio)+1 End if if bMediaSet(pMusic) and lastPlayMS(pMusic)<1000 then lastPlayMS(pMusic)=lastPlayMS(pMusic)+1 End if if bMediaSet(pDMDFull) and lastPlayMS(pDMDFull)<1000 then lastPlayMS(pDMDFull)=lastPlayMS(pDMDFull)+1 End if End Sub sub pausemedia(channel) if bUsePUPDMD=False then exit sub debug.print "pause media ch:" & channel & " current:" & bMediaPaused(channel) & " " & lastPlayMS(channel) if bMediaSet(channel) = False then Exit Sub if bMediaPaused(channel) = False then debug.print "pause" if lastPlayMS(channel) < kVLCDelay and (channel=pAudio or channel=pMusic or channel=pDMDFull) then Debug.print "Pausing with delay" ' Not sure but this needs to be a bit more than 400 vpmtimer.addtimer 1000 - lastPlayMS(channel), "PuPlayer.playpause " & channel & " '" ' If you play audio and then pause it real quick it fail to stop (always add a delay) Else PuPlayer.playpause channel End if bMediaPaused(channel)=True End If End Sub sub resumemedia(channel) if bUsePUPDMD=False then exit sub debug.print "resume media ch:" & channel & " current:" & bMediaPaused(channel) if bMediaSet(channel) = False then Exit Sub if bMediaPaused(channel) then debug.print "resume" PuPlayer.playresume channel bMediaPaused(channel)=False End If End Sub Function PlayClearDelayed(chan) Debug.print "PlayClearDelayed:" & lastPlayMS(chan) PlayClearDelayed = (lastPlayMS(chan) < 400) End Function sub playclear(chan) if bUsePUPDMD=False then exit sub debug.print "play clear'd " & chan bMediaSet(chan) = False bMediaPaused(chan) = False if chan = pOverVid then PuPlayer.PlayStop pOverVid 'PuPlayer.SetLoop pOverVid, 0 End If if chan = pUnderVid then PuPlayer.PlayStop pUnderVid PuPlayer.SetLoop pUnderVid, 0 PuPlayer.SendMsg "{ 'mt':301, 'SN':" & pUnderVid & ",'FN':15,'CP':'5,0,0,0,0'}" End If if chan = pAudio Then PuPlayer.SetLoop chan, 0 if lastPlayMS(chan) < kVLCDelay then Debug.print "Stopping with delay" vpmtimer.addtimer kVLCDelay - lastPlayMS(chan), "PuPlayer.playstop " & chan & " '" ' If you play audio and then stop it real quick it fail to stop (always add a delay) Else PuPlayer.playstop chan End if End If if chan = pBonusScreen then PuPlayer.SetBackGround chan, 0 PuPlayer.SetLoop chan, 0 PuPlayer.playstop chan End If if chan = pMusic Then if lastPlayMS(chan) < kVLCDelay then Debug.print "Stopping with delay" vpmtimer.addtimer kVLCDelay - lastPlayMS(chan), "PuPlayer.playstop " & chan & " '" ' If you play audio and then stop it real quick it fail to stop (always add a delay) Else PuPlayer.playstop chan End if End If if chan = pDMDText or chan = pDMDFull Then if currentqueue <> "" then bCancelNext = True debug.print "Clear is cancelling " & currentqueue End If PuPlayer.SetBackGround chan, 0 PuPlayer.SetLoop chan, 0 PuPlayer.playstop chan end if end Sub dim lastvocall:lastvocall="" dim noskipper:noskipper=0 ' Special function so we can have a screen between the DMDFull and pDMDText Sub playUnderMedia(Folder, Video, Screen, Length) PuPlayer.SendMsg "{ 'mt':301, 'SN':15,'FN':15,'CP':" & ScreenPos(ScreenType) & "}" ' Move the screen in place playmedia Video, Folder, Screen , "", Length, "", 1, 1 ' Show the Video if Length=-1 then PuPlayer.SetLoop Screen, 1 Else VpmTimer.AddTimer Length, "PuPlayer.SendMsg ""{ 'mt':301, 'SN':15,'FN':15,'CP':'5,0,0,0,0'}"" '" ' Queue to Hide the screen End if PuPlayer.SendMSG "{ ""mt"":301, ""SN"": " & pDMDText & ", ""FN"":6 }" ' Bring main screen to the front End Sub 'example playmedia "hs.mp3","audiomultiballs",pAudio,"cineon",10000,"",1,1 // (name,playlist,channel,cinematic,length,nextitem,audiolevel,priority) ' Note - If media is Paused this doesnt do anything sub playmedia(name,playlist,channel,cinematic,length,nextitem,audiolevel,priority) dim bPlayDelayed Dim DelayedCmd if bUsePUPDMD=False then exit sub bMediaSet(channel) = True lastPlayMS(channel)=0 debug.print "RESET:" & lastPlayMS(channel) & " " & channel if audiolevel = 1 Then if channel = pDMDText or channel=pDMDFull Then audiolevel = VolBGMusic currentqueue = "" Elseif channel = pCallouts Then audiolevel = VolBGMusic Elseif channel = pMusic Then audiolevel = VolMusic Elseif channel = pAudio Then audiolevel = VolMusic Elseif channel = pOverVid Then audiolevel = VolBGMusic end If audiolevel = audiolevel * 100 end If if channel = pCallouts Then if lastvocall = name then exit sub end if if nextitem = "" Then If cinematic = "cineon" Then noskipper=1 vpmtimer.addtimer length, "nextitems '" end If Else currentqueue = "playclear " &channel& ":playmedia """ & nextitem &""","""&playlist&""","&channel&","""",-1,"""", "&audiolevel&",1 '" vpmtimer.addtimer length, "nextitems '" 'vpmtimer.AddTimer length, "playclear " &channel& ":playmedia """ & nextitem &""","""&playlist&""","&channel&","""",-1,"""", "&audiolevel&",1 '" 'vpmtimer.addtimer length, "nextitems '" 'currentqueue = nextitem end If If cinematic = "cineon" and length <> -1 Then debug.print "ChangeVol pMusic for Cineon" skipped=0 'PuPlayer.playpause 4 ' stop then resume the music PuPlayer.SendMSG "{ ""mt"":301, ""SN"": " & pMusic &", ""FN"":11, ""VL"":20 }" vpmtimer.addtimer length, "turnitbackupcine '" GiOff cineon = 1 end If debug.print "PlayMedia " & channel & " Dir:" & playlist & " File:" & name & " Vol:" & audiolevel & " Pri:" & priority & " Len:" & length ' FIX7: Refresh screen-13 busy window whenever a video fires on pOverVid if channel = pOverVid then bPupEventBusy = True dScreen13LastActivity = Timer() vpmtimer.addtimer 8000, "bPupEventBusy = False '": vpmtimer.addtimer 8000, "dScreen13LastActivity = 0 '" end if ' FIX11: Track screen 15 (pUnderVid) activity to guard tmrFinishMode LabelSet concurrency if channel = pUnderVid then dScreen15LastActivity = Timer() vpmtimer.addtimer 5000, "dScreen15LastActivity = 0 '" ' FIX14: extended from 3000 to cover 3402ms ball save clip + margin end if if PlayClearDelayed(channel) and (channel = pAudio or channel=pMusic or channel=pDMDFull) then ' If the clear is delayed then the start needs to be delayed also so it doesnt clear Debug.print "Start Delayed" DelayedCmd="PuPlayer.playlistplayex " & channel & ", """ & playlist & """,""" & name & """," & audiolevel & "," & priority if channel = pAudio and length=-1 then DelayedCmd=DelayedCmd & ":PuPlayer.SetLoop " & channel & ", 1" if channel = pDMDFull then DelayedCmd=DelayedCmd & ":PuPlayer.SetBackGround " & channel & ", 1" DelayedCmd=DelayedCmd & " '" VpmTimer.Addtimer kVLCDelay, DelayedCmd Else PuPlayer.playlistplayex channel,playlist,name,audiolevel,priority if channel = pDMDFull then PuPlayer.SetBackGround channel, 1 if channel = pDMDText then PuPlayer.SetBackGround channel, 1 if channel = pAudio and length=-1 then PuPlayer.SetLoop channel, 1 if channel = pBonusScreen then PuPlayer.SetLoop channel, 1 End if If channel = pCallouts and length <> -1 Then debug.print "ChangeVol pDMDText Volume for Callouts" PuPlayer.SendMSG "{ ""mt"":301, ""SN"": "&pDMDText&", ""FN"":11, ""VL"":60 }" PuPlayer.SendMSG "{ ""mt"":301, ""SN"": "&pMusic&", ""FN"":11, ""VL"":60 }" PuPlayer.SendMSG "{ ""mt"":301, ""SN"": "&pAudio&", ""FN"":11, ""VL"":60 }" vpmtimer.addtimer length, "turnitbackup'" end If If channel = pOverVid and length <> -1 Then debug.print "ChangeVol pDMDText for OverVid" PuPlayer.SendMSG "{ ""mt"":301, ""SN"": "&pDMDText&", ""FN"":11, ""VL"":50 }" vpmtimer.addtimer length, "turnitbackupvid'" end If if channel = pCallouts Then lastvocall=name end if end sub Sub turnitbackup debug.print "Change Volume5" PuPlayer.SendMSG "{ ""mt"":301, ""SN"": "&pDMDText&", ""FN"":11, ""VL"":"&VolBGMusic&" }" PuPlayer.SendMSG "{ ""mt"":301, ""SN"": "&pMusic &", ""FN"":11, ""VL"":"&VolMusic&" }" PuPlayer.SendMSG "{ ""mt"":301, ""SN"": "&pAudio&", ""FN"":11, ""VL"":"&VolSfx&" }" debug.print "turnitbackup " 'puplayer.setvolume pMusic sndtrkvol End Sub Sub turnitbackupvid debug.print "Change Volume4" PuPlayer.SendMSG "{ ""mt"":301, ""SN"": "&pDMDText&", ""FN"":11, ""VL"":"&VolBGMusic&" }" debug.print "turnitbackupvid " End Sub Sub turnitbackupcine debug.print "Change Volume3" PuPlayer.SendMSG "{ ""mt"":301, ""SN"": "&pMusic&", ""FN"":11, ""VL"":"&VolMusic&" }" debug.print "turnitbackupcine " End Sub sub holder end sub sub nextitems if bCancelNext then ' Cancel the last items that was sent to the queue debug.print "Cancel Queue" bCancelNext=False Exit Sub End If debug.print "Executing " & currentqueue Execute currentqueue currentqueue = "" bCancelNext = False ' Items in queue can trigger a cancel debug.print "Queue Empty" ' if skipped = 0 Then ' noskipper=0 ' 'PuPlayer.playresume 4 'debug.print "Change Volume1" ' PuPlayer.SendMSG "{ ""mt"":301, ""SN"": "&pMusic&", ""FN"":11, ""VL"":"&VolMusic&" }" ' gion ' cineon = 0 ' 'looktimer = 0 ' execute currentqueue ' Elseif skipped = 1 Then ' 'PuPlayer.playresume 4 'debug.print "Change Volume2" ' PuPlayer.SendMSG "{ ""mt"":301, ""SN"": "&pMusic&", ""FN"":11, ""VL"":"&VolMusic&" }" ' gion ' cineon = 0 ' 'looktimer = 0 ' skipped = 3 ' execute currentqueue ' currentqueue = " " ' end If end Sub sub vidskipper_timer ' TBD: Make this work (flippers skip cinematics) if cineon = 1 and noskipper = 0 Then if ldown = 1 and rdown = 1 Then nextitems skipped = 1 end If end If end Sub 'logic for skipping ' vid starts. is it cinematic? ' yes cineon = 1 Sub FlipperMPT3K(Flipper) Flipper.Strength = 2250 Flipper.Elasticity = 0.76 Flipper.ElasticityFalloff = 0.2 Flipper.Friction = 0.75 Flipper.Return=0.1 Flipper.RampUp=0 Flipper.EOSTorque=0.75 End Sub Sub FlipperDap(Flipper) ' table1.Gravity=1 ' table1.Friction=0.04 ' table1.Elasticity=0 ' table1.ElasticityFalloff=0.2 Flipper.Strength = 3000 Flipper.Elasticity = 0.76 Flipper.ElasticityFalloff = 0.2 Flipper.Friction = 0.75 Flipper.Return=0.1 Flipper.RampUp=0 Flipper.EOSTorque=0.75 End Sub ' ''******************************************* '' Early 90's and after 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 'Methods: '.TimeDelay - Delay before trigger shuts off automatically. Default = 80 (ms) '.AddPoint - "Polarity", "Velocity", "Ycoef" coordinate points. Use one of these 3 strings, keep coordinates sequential. x = %position on the flipper, y = output '.Object - set to flipper reference. Optional. '.StartPoint - set start point coord. Unnecessary, if .object is used. 'Called with flipper - 'ProcessBalls - catches ball data. ' - OR - '.Fire - fires flipper.rotatetoend automatically + processballs. Requires .Object to be set to the flipper. 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 case "Polarity" : a1 = PolarityIn : a2 = PolarityOut Case "Velocity" : a1 = VelocityIn : a2 = VelocityOut Case "Ycoef" : a1 = YcoefIn : a2 = YcoefOut case else :tbpl.text = "wrong string" : exit sub End Select dim str, x : for x = 0 to uBound(a1) : str = str & aChooseArray & " x: " & round(a1(x),4) & ", " & round(a2(x),4) & vbnewline : next tbpl.text = str End Sub Public Sub AddBall(aBall) : dim x : for x = 0 to uBound(balls) : if IsEmpty(balls(x)) then set balls(x) = aBall : exit sub :end if : Next : End Sub Private Sub RemoveBall(aBall) dim x : for x = 0 to uBound(balls) if TypeName(balls(x) ) = "IBall" then if aBall.ID = Balls(x).ID Then balls(x) = Empty Balldata(x).Reset End If End If Next End Sub Public Sub Fire() Flipper.RotateToEnd processballs End Sub Public Property Get Pos 'returns % position a ball. For debug stuff. dim x : for x = 0 to uBound(balls) if not IsEmpty(balls(x) ) then pos = pSlope(Balls(x).x, FlipperStart, 0, FlipperEnd, 1) End If Next End Property Public Sub ProcessBalls() 'save data of balls in flipper range FlipAt = GameTime dim x : for x = 0 to uBound(balls) if not IsEmpty(balls(x) ) then balldata(x).Data = balls(x) End If Next PartialFlipCoef = ((Flipper.StartAngle - Flipper.CurrentAngle) / (Flipper.StartAngle - Flipper.EndAngle)) PartialFlipCoef = abs(PartialFlipCoef-1) End Sub Private Function FlipperOn() : if gameTime < FlipAt+TimeDelay then FlipperOn = True : End If : End Function 'Timer shutoff for polaritycorrect Public Sub PolarityCorrect(aBall) if FlipperOn() then dim tmp, BallPos, x, IDX, Ycoef : Ycoef = 1 'y safety Exit if aBall.VelY > -8 then 'ball going down RemoveBall aBall exit Sub end if 'Find balldata. BallPos = % on Flipper for x = 0 to uBound(Balls) if aBall.id = BallData(x).id AND not isempty(BallData(x).id) then idx = x BallPos = PSlope(BallData(x).x, FlipperStart, 0, FlipperEnd, 1) if ballpos > 0.65 then Ycoef = LinearEnvelope(BallData(x).Y, YcoefIn, YcoefOut) 'find safety coefficient 'ycoef' data end if Next If BallPos = 0 Then 'no ball data meaning the ball is entering and exiting pretty close to the same position, use current values. BallPos = PSlope(aBall.x, FlipperStart, 0, FlipperEnd, 1) if ballpos > 0.65 then Ycoef = LinearEnvelope(aBall.Y, YcoefIn, YcoefOut) 'find safety coefficient 'ycoef' data End If 'Velocity correction if not IsEmpty(VelocityIn(0) ) then Dim VelCoef VelCoef = LinearEnvelope(BallPos, VelocityIn, VelocityOut) if partialflipcoef < 1 then VelCoef = PSlope(partialflipcoef, 0, 1, 1, VelCoef) if Enabled then aBall.Velx = aBall.Velx*VelCoef if Enabled then aBall.Vely = aBall.Vely*VelCoef End If 'Polarity Correction (optional now) if not IsEmpty(PolarityIn(0) ) then If StartPoint > EndPoint then LR = -1 'Reverse polarity if left flipper dim AddX : AddX = LinearEnvelope(BallPos, PolarityIn, PolarityOut) * LR if Enabled then aBall.VelX = aBall.VelX + 1 * (AddX*ycoef*PartialFlipcoef) End If End If RemoveBall aBall End Sub End Class '****************************************************** ' FLIPPER POLARITY AND RUBBER DAMPENER ' SUPPORTING FUNCTIONS '****************************************************** ' Used for flipper correction and rubber dampeners Sub ShuffleArray(ByRef aArray, byVal offset) 'shuffle 1d array dim x, aCount : aCount = 0 redim a(uBound(aArray) ) for x = 0 to uBound(aArray) 'Shuffle objects in a temp array if not IsEmpty(aArray(x) ) Then if IsObject(aArray(x)) then Set a(aCount) = aArray(x) Else a(aCount) = aArray(x) End If aCount = aCount + 1 End If Next if offset < 0 then offset = 0 redim aArray(aCount-1+offset) 'Resize original array for x = 0 to aCount-1 'set objects back into original array if IsObject(a(x)) then Set aArray(x) = a(x) Else aArray(x) = a(x) End If Next End Sub ' Used for flipper correction and rubber dampeners Sub ShuffleArrays(aArray1, aArray2, offset) ShuffleArray aArray1, offset ShuffleArray aArray2, offset End Sub ' Used for flipper correction, rubber dampeners, and drop targets Function BallSpeed(ball) 'Calculates the ball speed BallSpeed = SQR(ball.VelX^2 + ball.VelY^2 + ball.VelZ^2) End Function ' Used for flipper correction and rubber dampeners Function PSlope(Input, X1, Y1, X2, Y2) 'Set up line via two points, no clamping. Input X, output Y dim x, y, b, m : x = input : m = (Y2 - Y1) / (X2 - X1) : b = Y2 - m*X2 Y = M*x+b PSlope = Y End Function ' Used for flipper correction Class spoofball Public X, Y, Z, VelX, VelY, VelZ, ID, Mass, Radius Public Property Let Data(aBall) With aBall x = .x : y = .y : z = .z : velx = .velx : vely = .vely : velz = .velz id = .ID : mass = .mass : radius = .radius end with End Property Public Sub Reset() x = Empty : y = Empty : z = Empty : velx = Empty : vely = Empty : velz = Empty id = Empty : mass = Empty : radius = Empty End Sub End Class ' Used for flipper correction and rubber dampeners Function LinearEnvelope(xInput, xKeyFrame, yLvl) dim y 'Y output dim L 'Line dim ii : for ii = 1 to uBound(xKeyFrame) 'find active line if xInput <= xKeyFrame(ii) then L = ii : exit for : end if Next if xInput > xKeyFrame(uBound(xKeyFrame) ) then L = uBound(xKeyFrame) 'catch line overrun Y = pSlope(xInput, xKeyFrame(L-1), yLvl(L-1), xKeyFrame(L), yLvl(L) ) if xInput <= xKeyFrame(lBound(xKeyFrame) ) then Y = yLvl(lBound(xKeyFrame) ) 'Clamp lower if xInput >= xKeyFrame(uBound(xKeyFrame) ) then Y = yLvl(uBound(xKeyFrame) ) 'Clamp upper LinearEnvelope = Y End Function '****************************************************** ' FLIPPER TRICKS '****************************************************** RightFlipper.timerinterval=1 Rightflipper.timerenabled=True sub RightFlipper_timer() FlipperTricks LeftFlipper, LFPress, LFCount, LFEndAngle, LFState FlipperTricks RightFlipper, RFPress, RFCount, RFEndAngle, RFState FlipperNudge RightFlipper, RFEndAngle, RFEOSNudge, LeftFlipper, LFEndAngle FlipperNudge LeftFlipper, LFEndAngle, LFEOSNudge, RightFlipper, RFEndAngle end sub Dim LFEOSNudge, RFEOSNudge Sub FlipperNudge(Flipper1, Endangle1, EOSNudge1, Flipper2, EndAngle2) Dim b, BOT BOT = GetBalls If Flipper1.currentangle = Endangle1 and EOSNudge1 <> 1 Then EOSNudge1 = 1 'debug.print Flipper1.currentangle &" = "& Endangle1 &"--"& Flipper2.currentangle &" = "& EndAngle2 If Flipper2.currentangle = EndAngle2 Then For b = 0 to Ubound(BOT) If FlipperTrigger(BOT(b).x, BOT(b).y, Flipper1) Then 'Debug.Print "ball in flip1. exit" exit Sub end If Next For b = 0 to Ubound(BOT) If FlipperTrigger(BOT(b).x, BOT(b).y, Flipper2) Then BOT(b).velx = BOT(b).velx / 1.3 BOT(b).vely = BOT(b).vely - 0.5 end If Next End If Else If Abs(Flipper1.currentangle) > Abs(EndAngle1) + 30 then EOSNudge1 = 0 End If End Sub '***************** ' Maths '***************** Dim PI: PI = 4*Atn(1) Function dSin(degrees) dsin = sin(degrees * Pi/180) End Function Function dCos(degrees) dcos = cos(degrees * Pi/180) End Function Function Atn2(dy, dx) If dx > 0 Then Atn2 = Atn(dy / dx) ElseIf dx < 0 Then If dy = 0 Then Atn2 = pi Else Atn2 = Sgn(dy) * (pi - Atn(Abs(dy / dx))) end if ElseIf dx = 0 Then if dy = 0 Then Atn2 = 0 else Atn2 = Sgn(dy) * pi / 2 end if End If End Function '************************************************* ' Check ball distance from Flipper for Rem '************************************************* Function Distance(ax,ay,bx,by) Distance = SQR((ax - bx)^2 + (ay - by)^2) End Function Function DistancePL(px,py,ax,ay,bx,by) ' Distance between a point and a line where point is px,py DistancePL = ABS((by - ay)*px - (bx - ax) * py + bx*ay - by*ax)/Distance(ax,ay,bx,by) End Function Function Radians(Degrees) Radians = Degrees * PI /180 End Function Function AnglePP(ax,ay,bx,by) AnglePP = Atn2((by - ay),(bx - ax))*180/PI End Function Function DistanceFromFlipper(ballx, bally, Flipper) DistanceFromFlipper = DistancePL(ballx, bally, Flipper.x, Flipper.y, Cos(Radians(Flipper.currentangle+90))+Flipper.x, Sin(Radians(Flipper.currentangle+90))+Flipper.y) End Function Function FlipperTrigger(ballx, bally, Flipper) Dim DiffAngle DiffAngle = ABS(Flipper.currentangle - AnglePP(Flipper.x, Flipper.y, ballx, bally) - 90) If DiffAngle > 180 Then DiffAngle = DiffAngle - 360 If DistanceFromFlipper(ballx,bally,Flipper) < 48 and DiffAngle <= 90 and Distance(ballx,bally,Flipper.x,Flipper.y) < Flipper.Length Then FlipperTrigger = True Else FlipperTrigger = False End If End Function '************************************************* ' End - Check ball distance from Flipper for Rem dim LFPress, RFPress, LFCount, RFCount dim LFState, RFState dim EOST, EOSA,Frampup, FElasticity,FReturn dim RFEndAngle, LFEndAngle Const FlipperCoilRampupMode = 0 '0 = fast, 1 = medium, 2 = slow (tap passes should work) LFState = 1 RFState = 1 EOST = leftflipper.eostorque EOSA = leftflipper.eostorqueangle Frampup = LeftFlipper.rampup FElasticity = LeftFlipper.elasticity FReturn = LeftFlipper.return 'Const EOSTnew = 1 'EM's to late 80's Const EOSTnew = 0.8 '90's and later Const EOSAnew = 1 Const EOSRampup = 0 Dim SOSRampup Select Case FlipperCoilRampupMode Case 0: SOSRampup = 2.5 Case 1: SOSRampup = 6 Case 2: SOSRampup = 8.5 End Select Const LiveCatch = 16 Const LiveElasticity = 0.45 Const SOSEM = 0.815 Const EOSReturn = 0.025 'mid 90's and later LFEndAngle = Leftflipper.endangle RFEndAngle = RightFlipper.endangle Sub FlipperActivate(Flipper, FlipperPress) FlipperPress = 1 Flipper.Elasticity = FElasticity Flipper.eostorque = EOST Flipper.eostorqueangle = EOSA End Sub Sub FlipperDeactivate(Flipper, FlipperPress) FlipperPress = 0 Flipper.eostorqueangle = EOSA Flipper.eostorque = EOST*EOSReturn/FReturn If Abs(Flipper.currentangle) <= Abs(Flipper.endangle) + 0.1 Then Dim b, BOT BOT = GetBalls For b = 0 to UBound(BOT) If Distance(BOT(b).x, BOT(b).y, Flipper.x, Flipper.y) < 55 Then 'check for cradle If BOT(b).vely >= -0.4 Then BOT(b).vely = -0.4 End If Next End If End Sub Sub FlipperTricks (Flipper, FlipperPress, FCount, FEndAngle, FState) Dim Dir Dir = Flipper.startangle/Abs(Flipper.startangle) '-1 for Right Flipper If Abs(Flipper.currentangle) > Abs(Flipper.startangle) - 0.05 Then If FState <> 1 Then Flipper.rampup = SOSRampup Flipper.endangle = FEndAngle - 3*Dir Flipper.Elasticity = FElasticity * SOSEM FCount = 0 FState = 1 End If ElseIf Abs(Flipper.currentangle) <= Abs(Flipper.endangle) and FlipperPress = 1 then if FCount = 0 Then FCount = GameTime If FState <> 2 Then Flipper.eostorqueangle = EOSAnew Flipper.eostorque = EOSTnew Flipper.rampup = EOSRampup Flipper.endangle = FEndAngle FState = 2 End If Elseif Abs(Flipper.currentangle) > Abs(Flipper.endangle) + 0.01 and FlipperPress = 1 Then If FState <> 3 Then Flipper.eostorque = EOST Flipper.eostorqueangle = EOSA Flipper.rampup = Frampup Flipper.Elasticity = FElasticity FState = 3 End If End If End Sub Const LiveDistanceMin = 30 'minimum distance in vp units from flipper base live catch dampening will occur Const LiveDistanceMax = 114 'maximum distance in vp units from flipper base live catch dampening will occur (tip protection) Sub CheckLiveCatch(ball, Flipper, FCount, parm) 'Experimental new live catch Dim Dir Dir = Flipper.startangle/Abs(Flipper.startangle) '-1 for Right Flipper Dim LiveCatchBounce 'If live catch is not perfect, it won't freeze ball totally Dim CatchTime : CatchTime = GameTime - FCount if CatchTime <= LiveCatch and parm > 6 and ABS(Flipper.x - ball.x) > LiveDistanceMin and ABS(Flipper.x - ball.x) < LiveDistanceMax Then if CatchTime <= LiveCatch*0.5 Then 'Perfect catch only when catch time happens in the beginning of the window LiveCatchBounce = 0 else LiveCatchBounce = Abs((LiveCatch/2) - CatchTime) 'Partial catch when catch happens a bit late end If If LiveCatchBounce = 0 and ball.velx * Dir > 0 Then ball.velx = 0 ball.vely = LiveCatchBounce * (32 / LiveCatch) ' Multiplier for inaccuracy bounce ball.angmomx= 0 ball.angmomy= 0 ball.angmomz= 0 Else If Abs(Flipper.currentangle) <= Abs(Flipper.endangle) + 1 Then FlippersD.Dampenf Activeball, parm End If End Sub '****************************************************** ' SLINGSHOT CORRECTION FUNCTIONS '****************************************************** ' To add these slingshot corrections: ' - On the table, add the endpoint primitives that define the two ends of the Slingshot ' - Initialize the SlingshotCorrection objects in InitSlingCorrection ' - Call the .VelocityCorrect methods from the respective _Slingshot event sub dim LS : Set LS = New SlingshotCorrection dim RS : Set RS = New SlingshotCorrection InitSlingCorrection Sub InitSlingCorrection LS.Object = LeftSlingshot LS.EndPoint1 = EndPoint1LS LS.EndPoint2 = EndPoint2LS RS.Object = RightSlingshot RS.EndPoint1 = EndPoint1RS RS.EndPoint2 = EndPoint2RS 'Slingshot angle corrections (pt, BallPos in %, Angle in deg) ' These values are best guesses. Retune them if needed based on specific table research. AddSlingsPt 0, 0.00, -4 AddSlingsPt 1, 0.45, -6 AddSlingsPt 2, 0.48, 0 AddSlingsPt 3, 0.52, 0 AddSlingsPt 4, 0.55, 6 AddSlingsPt 5, 1.00, 4 End Sub Sub AddSlingsPt(idx, aX, aY) 'debugger wrapper for adjusting flipper script in-game dim a : a = Array(LS, RS) dim x : for each x in a x.addpoint idx, aX, aY Next End Sub Function RotPoint(x,y,angle) dim rx, ry rx = x*dCos(angle) - y*dSin(angle) ry = x*dSin(angle) + y*dCos(angle) RotPoint = Array(rx,ry) End Function Class SlingshotCorrection Public DebugOn, Enabled private Slingshot, SlingX1, SlingX2, SlingY1, SlingY2 Public ModIn, ModOut Private Sub Class_Initialize : redim ModIn(0) : redim Modout(0): Enabled = True : End Sub Public Property let Object(aInput) : Set Slingshot = aInput : End Property Public Property Let EndPoint1(aInput) : SlingX1 = aInput.x: SlingY1 = aInput.y: End Property Public Property Let EndPoint2(aInput) : SlingX2 = aInput.x: SlingY2 = aInput.y: End Property Public Sub AddPoint(aIdx, aX, aY) ShuffleArrays ModIn, ModOut, 1 : ModIn(aIDX) = aX : ModOut(aIDX) = aY : ShuffleArrays ModIn, ModOut, 0 If gametime > 100 then Report End Sub Public Sub Report() 'debug, reports all coords in tbPL.text If not debugOn then exit sub dim a1, a2 : a1 = ModIn : a2 = ModOut dim str, x : for x = 0 to uBound(a1) : str = str & x & ": " & round(a1(x),4) & ", " & round(a2(x),4) & vbnewline : next TBPout.text = str End Sub Public Sub VelocityCorrect(aBall) dim BallPos, XL, XR, YL, YR 'Assign right and left end points If SlingX1 < SlingX2 Then XL = SlingX1 : YL = SlingY1 : XR = SlingX2 : YR = SlingY2 Else XL = SlingX2 : YL = SlingY2 : XR = SlingX1 : YR = SlingY1 End If 'Find BallPos = % on Slingshot If Not IsEmpty(aBall.id) Then If ABS(XR-XL) > ABS(YR-YL) Then BallPos = PSlope(aBall.x, XL, 0, XR, 1) Else BallPos = PSlope(aBall.y, YL, 0, YR, 1) End If If BallPos < 0 Then BallPos = 0 If BallPos > 1 Then BallPos = 1 End If 'Velocity angle correction If not IsEmpty(ModIn(0) ) then Dim Angle, RotVxVy Angle = LinearEnvelope(BallPos, ModIn, ModOut) 'debug.print " BallPos=" & BallPos &" Angle=" & Angle 'debug.print " BEFORE: aBall.Velx=" & aBall.Velx &" aBall.Vely" & aBall.Vely RotVxVy = RotPoint(aBall.Velx,aBall.Vely,Angle) If Enabled then aBall.Velx = RotVxVy(0) If Enabled then aBall.Vely = RotVxVy(1) 'debug.print " AFTER: aBall.Velx=" & aBall.Velx &" aBall.Vely" & aBall.Vely 'debug.print " " End If End Sub End Class '**************************************************************************** 'PHYSICS DAMPENERS '**************************************************************************** 'These are data mined bounce curves, 'dialed in with the in-game elasticity as much as possible to prevent angle / spin issues. 'Requires tracking ballspeed to calculate COR Sub dPosts_Hit(idx) RubbersD.dampen Activeball End Sub Sub dSleeves_Hit(idx) SleevesD.Dampen Activeball End Sub dim RubbersD : Set RubbersD = new Dampener 'frubber RubbersD.name = "Rubbers" RubbersD.debugOn = False 'shows info in textbox "TBPout" RubbersD.Print = False 'debug, reports in debugger (in vel, out cor) 'cor bounce curve (linear) 'for best results, try to match in-game velocity as closely as possible to the desired curve 'RubbersD.addpoint 0, 0, 0.935 'point# (keep sequential), ballspeed, CoR (elasticity) RubbersD.addpoint 0, 0, 1.1 'point# (keep sequential), ballspeed, CoR (elasticity) RubbersD.addpoint 1, 3.77, 0.97 RubbersD.addpoint 2, 5.76, 0.967 'dont take this as gospel. if you can data mine rubber elasticitiy, please help! RubbersD.addpoint 3, 15.84, 0.874 RubbersD.addpoint 4, 56, 0.64 'there's clamping so interpolate up to 56 at least dim SleevesD : Set SleevesD = new Dampener 'this is just rubber but cut down to 85%... SleevesD.name = "Sleeves" SleevesD.debugOn = False 'shows info in textbox "TBPout" SleevesD.Print = False 'debug, reports in debugger (in vel, out cor) SleevesD.CopyCoef RubbersD, 0.85 '######################### Add new FlippersD Profile '######################### Adjust these values to increase or lessen the elasticity dim FlippersD : Set FlippersD = new Dampener FlippersD.name = "Flippers" FlippersD.debugOn = False FlippersD.Print = False FlippersD.addpoint 0, 0, 1.1 FlippersD.addpoint 1, 3.77, 0.99 FlippersD.addpoint 2, 6, 0.99 Class Dampener Public Print, debugOn 'tbpOut.text public name, Threshold 'Minimum threshold. Useful for Flippers, which don't have a hit threshold. Public ModIn, ModOut Private Sub Class_Initialize : redim ModIn(0) : redim Modout(0): End Sub Public Sub AddPoint(aIdx, aX, aY) ShuffleArrays ModIn, ModOut, 1 : ModIn(aIDX) = aX : ModOut(aIDX) = aY : ShuffleArrays ModIn, ModOut, 0 if gametime > 100 then Report End Sub public sub Dampen(aBall) if threshold then if BallSpeed(aBall) < threshold then exit sub end if end if dim RealCOR, DesiredCOR, str, coef DesiredCor = LinearEnvelope(cor.ballvel(aBall.id), ModIn, ModOut ) RealCOR = BallSpeed(aBall) / (cor.ballvel(aBall.id)+0.0001) coef = desiredcor / realcor if debugOn then str = name & " in vel:" & round(cor.ballvel(aBall.id),2 ) & vbnewline & "desired cor: " & round(desiredcor,4) & vbnewline & _ "actual cor: " & round(realCOR,4) & vbnewline & "ballspeed coef: " & round(coef, 3) & vbnewline if Print then debug.print Round(cor.ballvel(aBall.id),2) & ", " & round(desiredcor,3) aBall.velx = aBall.velx * coef : aBall.vely = aBall.vely * coef if debugOn then TBPout.text = str End Sub public sub Dampenf(aBall, parm) 'Rubberizer is handle here dim RealCOR, DesiredCOR, str, coef DesiredCor = LinearEnvelope(cor.ballvel(aBall.id), ModIn, ModOut ) RealCOR = BallSpeed(aBall) / (cor.ballvel(aBall.id)+0.0001) coef = desiredcor / realcor If abs(aball.velx) < 2 and aball.vely < 0 and aball.vely > -3.75 then aBall.velx = aBall.velx * coef : aBall.vely = aBall.vely * coef End If End Sub Public Sub CopyCoef(aObj, aCoef) 'alternative addpoints, copy with coef dim x : for x = 0 to uBound(aObj.ModIn) addpoint x, aObj.ModIn(x), aObj.ModOut(x)*aCoef Next End Sub Public Sub Report() 'debug, reports all coords in tbPL.text if not debugOn then exit sub dim a1, a2 : a1 = ModIn : a2 = ModOut dim str, x : for x = 0 to uBound(a1) : str = str & x & ": " & round(a1(x),4) & ", " & round(a2(x),4) & vbnewline : next TBPout.text = str End Sub End Class '****************************************************** ' TRACK ALL BALL VELOCITIES ' FOR RUBBER DAMPENER AND DROP TARGETS '****************************************************** dim cor : set cor = New CoRTracker Class CoRTracker public ballvel, ballvelx, ballvely Private Sub Class_Initialize : redim ballvel(0) : redim ballvelx(0): redim ballvely(0) : End Sub Public Sub Update() 'tracks in-ball-velocity dim str, b, AllBalls, highestID : allBalls = getballs for each b in allballs if b.id >= HighestID then highestID = b.id Next if uBound(ballvel) < highestID then redim ballvel(highestID) 'set bounds if uBound(ballvelx) < highestID then redim ballvelx(highestID) 'set bounds if uBound(ballvely) < highestID then redim ballvely(highestID) 'set bounds for each b in allballs ballvel(b.id) = BallSpeed(b) ballvelx(b.id) = b.velx ballvely(b.id) = b.vely Next End Sub End Class Sub RDampen_Timer() Cor.Update End Sub '*********************** END FOZZY Physics ' *************************************************************************************************** ' This subroutine updates the flipper shadows and visual primitives Sub FlipperVisualUpdate FlipperLSh.RotZ = LeftFlipper.CurrentAngle FlipperRSh.RotZ = RightFlipper.CurrentAngle LFLogo.RotZ = LeftFlipper.CurrentAngle RFlogo.RotZ = RightFlipper.CurrentAngle End Sub ' *************************************************************************************************** ' ****************************** Lampz from funhouse Dim MaterialWhiteArray: MaterialWhiteArray = Array("BulbWhiteOff", "BulbWhiteOff","BulbWhiteOff","BulbWhiteOn") Dim MaterialBlueArray: MaterialBlueArray = Array("BulbBlueOff", "BulbBlueOff","BulbBlueOff","BulbBlueOn") Dim MaterialRedArray: MaterialRedArray = Array("BulbRedOff", "BulbRedOff","BulbRedOff","BulbRedOn") Dim MaterialYellowArray: MaterialYellowArray = Array("BulbYellowOff", "BulbYellowOff","BulbYellowOff","BulbYellowOn") Dim NullFader : set NullFader = new NullFadingObject Dim Lampz : Set Lampz = New LampFader InitLampsNF ' Setup lamp assignments LampTimer.Interval = -1 LampTimer.Enabled = 1 'Lampz.SetLamp 1, True 'Lampz.SetLamp 1, True Sub LampTimer_Timer() If DynamicBallShadowsOn Or AmbientBallShadowOn Then DynamicBSUpdate 'update ball shadows CheckClearPupBug FlipperVisualUpdate if ticksFromLastEject<500 then ticksFromLastEject=ticksFromLastEject+1 dim x, chglamp if b2son then chglamp = Controller.ChangedLamps If Not IsEmpty(chglamp) Then For x = 0 To UBound(chglamp) 'nmbr = chglamp(x, 0), state = chglamp(x, 1) Lampz.state(chglamp(x, 0)) = chglamp(x, 1) next End If Lampz.Update1 'update (fading logic only) End Sub dim FrameTime, InitFrameTime : InitFrameTime = 0 LampTimer2.Interval = -1 LampTimer2.Enabled = True Sub LampTimer2_Timer() 'Stealing this random wall's timer for -1 updates FrameTime = gametime - InitFrameTime : InitFrameTime = gametime 'Count frametime. Unused atm? Lampz.Update 'updates on frametime (Object updates only) End Sub Function FlashLevelToIndex(Input, MaxSize) FlashLevelToIndex = cInt(MaxSize * Input) End Function '***Material Swap*** 'Fade material for green, red, yellow colored Bulb prims Sub FadeMaterialColoredBulb(pri, group, ByVal aLvl) 'cp's script ' if Lampz.UseFunction then aLvl = LampFilter(aLvl) 'Callbacks don't get this filter automatically if Lampz.UseFunction then aLvl = Lampz.FilterOut(aLvl) 'Callbacks don't get this filter automatically Select case FlashLevelToIndex(aLvl, 3) Case 0:pri.Material = group(0) 'Off Case 1:pri.Material = group(1) 'Fading... Case 2:pri.Material = group(2) 'Fading... Case 3:pri.Material = group(3) 'Full End Select 'if tb.text <> pri.image then tb.text = pri.image : debug.print pri.image end If 'debug pri.blenddisablelighting = aLvl * 1 'Intensity Adjustment End Sub 'Fade material for red, yellow colored bulb Filiment prims Sub FadeMaterialColoredFiliment(pri, group, ByVal aLvl) 'cp's script ' if Lampz.UseFunction then aLvl = LampFilter(aLvl) 'Callbacks don't get this filter automatically if Lampz.UseFunction then aLvl = Lampz.FilterOut(aLvl) 'Callbacks don't get this filter automatically Select case FlashLevelToIndex(aLvl, 3) Case 0:pri.Material = group(0) 'Off Case 1:pri.Material = group(1) 'Fading... Case 2:pri.Material = group(2) 'Fading... Case 3:pri.Material = group(3) 'Full End Select 'if tb.text <> pri.image then tb.text = pri.image : debug.print pri.image end If 'debug pri.blenddisablelighting = aLvl * 50 'Intensity Adjustment End Sub Sub InitLampsNF() 'Filtering (comment out to disable) Lampz.Filter = "LampFilter" 'Puts all lamp intensityscale output (no callbacks) through this function before updating 'Adjust fading speeds (1 / full MS fading time) dim x : for x = 0 to 140 : Lampz.FadeSpeedUp(x) = 3/10 : Lampz.FadeSpeedDown(x) = 3/10 : next 'Lamp Assignments 'MassAssign is an optional way to do assignments. It'll create arrays automatically / append objects to existing arrays Lampz.MassAssign(1)= l80 Lampz.Callback(1) = "FadeMaterialColoredBulb pFBase80, MaterialWhiteArray, " Lampz.Callback(1) = "FadeMaterialColoredFiliment pFiliment80, MaterialWhiteArray, " Lampz.MassAssign(2)= l79 Lampz.Callback(2) = "FadeMaterialColoredBulb pFBase79, MaterialYellowArray, " Lampz.Callback(2) = "FadeMaterialColoredFiliment pFiliment79, MaterialYellowArray, " Lampz.MassAssign(3)= l78 Lampz.Callback(3) = "FadeMaterialColoredBulb pFBase78, MaterialBlueArray, " Lampz.Callback(3) = "FadeMaterialColoredFiliment pFiliment78, MaterialBlueArray, " Lampz.MassAssign(4)= l77 Lampz.Callback(4) = "FadeMaterialColoredBulb pFBase77, MaterialRedArray, " Lampz.Callback(4) = "FadeMaterialColoredFiliment pFiliment77, MaterialRedArray, " 'Turn off all lamps on startup Lampz.Init 'This just turns state of any lamps to 1 'Immediate update to turn on GI, turn off lamps Lampz.update End Sub '==================== 'Class jungle nf '============= 'No-op object instead of adding more conditionals to the main loop 'It also prevents errors if empty lamp numbers are called, and it's only one object 'should be g2g? Class NullFadingObject : Public Property Let IntensityScale(input) : : End Property : End Class 'version 0.11 - Mass Assign, Changed modulate style 'version 0.12 - Update2 (single -1 timer update) update method for core.vbs 'Version 0.12a - Filter can now be accessed via 'FilterOut' 'Version 0.12b - Changed MassAssign from a sub to an indexed property (new syntax: lampfader.MassAssign(15) = Light1 ) 'Version 0.13 - No longer requires setlocale. Callback() can be assigned multiple times per index ' Note: if using multiple 'LampFader' objects, set the 'name' variable to avoid conflicts with callbacks Class LampFader Public FadeSpeedDown(140), FadeSpeedUp(140) Private Lock(140), Loaded(140), OnOff(140) Public UseFunction Private cFilter Public UseCallback(140), cCallback(140) Public Lvl(140), Obj(140) Private Mult(140) Public FrameTime Private InitFrame Public Name Sub Class_Initialize() InitFrame = 0 dim x : for x = 0 to uBound(OnOff) 'Set up fade speeds FadeSpeedDown(x) = 1/100 'fade speed down FadeSpeedUp(x) = 1/80 'Fade speed up UseFunction = False lvl(x) = 0 OnOff(x) = False Lock(x) = True : Loaded(x) = False Mult(x) = 1 Next Name = "LampFaderNF" 'NEEDS TO BE CHANGED IF THERE'S MULTIPLE OF THESE OBJECTS, OTHERWISE CALLBACKS WILL INTERFERE WITH EACH OTHER!! for x = 0 to uBound(OnOff) 'clear out empty obj if IsEmpty(obj(x) ) then Set Obj(x) = NullFader' : Loaded(x) = True Next End Sub Public Property Get Locked(idx) : Locked = Lock(idx) : End Property 'debug.print Lampz.Locked(100) 'debug Public Property Get state(idx) : state = OnOff(idx) : end Property Public Property Let Filter(String) : Set cFilter = GetRef(String) : UseFunction = True : End Property Public Function FilterOut(aInput) : if UseFunction Then FilterOut = cFilter(aInput) Else FilterOut = aInput End If : End Function 'Public Property Let Callback(idx, String) : cCallback(idx) = String : UseCallBack(idx) = True : End Property Public Property Let Callback(idx, String) UseCallBack(idx) = True 'cCallback(idx) = String 'old execute method 'New method: build wrapper subs using ExecuteGlobal, then call them cCallback(idx) = cCallback(idx) & "___" & String 'multiple strings dilineated by 3x _ dim tmp : tmp = Split(cCallback(idx), "___") dim str, x : for x = 0 to uBound(tmp) 'build proc contents 'If Not tmp(x)="" then str = str & " " & tmp(x) & " aLVL" & " '" & x & vbnewline 'more verbose If Not tmp(x)="" then str = str & tmp(x) & " aLVL:" Next 'msgbox "Sub " & name & idx & "(aLvl):" & str & "End Sub" dim out : out = "Sub " & name & idx & "(aLvl):" & str & "End Sub" 'if idx = 132 then msgbox out 'debug ExecuteGlobal Out End Property Public Property Let state(ByVal idx, input) 'Major update path if Input <> OnOff(idx) then 'discard redundant updates OnOff(idx) = input Lock(idx) = False Loaded(idx) = False End If End Property 'Mass assign, Builds arrays where necessary 'Sub MassAssign(aIdx, aInput) Public Property Let MassAssign(aIdx, aInput) If typename(obj(aIdx)) = "NullFadingObject" Then 'if empty, use Set if IsArray(aInput) then obj(aIdx) = aInput Else Set obj(aIdx) = aInput end if Else Obj(aIdx) = AppendArray(obj(aIdx), aInput) end if end Property Sub SetLamp(aIdx, aOn) : state(aIdx) = aOn : End Sub 'Solenoid Handler Public Sub TurnOnStates() 'If obj contains any light objects, set their states to 1 (Fading is our job!) dim debugstr dim idx : for idx = 0 to uBound(obj) if IsArray(obj(idx)) then 'debugstr = debugstr & "array found at " & idx & "..." dim x, tmp : tmp = obj(idx) 'set tmp to array in order to access it for x = 0 to uBound(tmp) if typename(tmp(x)) = "Light" then DisableState tmp(x)' : debugstr = debugstr & tmp(x).name & " state'd" & vbnewline tmp(x).intensityscale = 0.001 ' this can prevent init stuttering Next Else if typename(obj(idx)) = "Light" then DisableState obj(idx)' : debugstr = debugstr & obj(idx).name & " state'd (not array)" & vbnewline obj(idx).intensityscale = 0.001 ' this can prevent init stuttering end if Next 'debug.print debugstr End Sub Private Sub DisableState(ByRef aObj) : aObj.FadeSpeedUp = 1000 : aObj.State = 1 : End Sub 'turn state to 1 Public Sub Init() 'Just runs TurnOnStates right now TurnOnStates End Sub Public Property Let Modulate(aIdx, aCoef) : Mult(aIdx) = aCoef : Lock(aIdx) = False : Loaded(aIdx) = False: End Property Public Property Get Modulate(aIdx) : Modulate = Mult(aIdx) : End Property Public Sub Update1() 'Handle all boolean numeric fading. If done fading, Lock(x) = True. Update on a '1' interval Timer! dim x : for x = 0 to uBound(OnOff) if not Lock(x) then 'and not Loaded(x) then if OnOff(x) then 'Fade Up Lvl(x) = Lvl(x) + FadeSpeedUp(x) if Lvl(x) >= 1 then Lvl(x) = 1 : Lock(x) = True elseif Not OnOff(x) then 'fade down Lvl(x) = Lvl(x) - FadeSpeedDown(x) if Lvl(x) <= 0 then Lvl(x) = 0 : Lock(x) = True end if end if Next End Sub Public Sub Update2() 'Both updates on -1 timer (Lowest latency, but less accurate fading at 60fps vsync) FrameTime = gametime - InitFrame : InitFrame = GameTime 'Calculate frametime dim x : for x = 0 to uBound(OnOff) if not Lock(x) then 'and not Loaded(x) then if OnOff(x) then 'Fade Up Lvl(x) = Lvl(x) + FadeSpeedUp(x) * FrameTime if Lvl(x) >= 1 then Lvl(x) = 1 : Lock(x) = True elseif Not OnOff(x) then 'fade down Lvl(x) = Lvl(x) - FadeSpeedDown(x) * FrameTime if Lvl(x) <= 0 then Lvl(x) = 0 : Lock(x) = True end if end if Next Update End Sub Public Sub Update() 'Handle object updates. Update on a -1 Timer! If done fading, loaded(x) = True dim x,xx : for x = 0 to uBound(OnOff) if not Loaded(x) then if IsArray(obj(x) ) Then 'if array If UseFunction then for each xx in obj(x) : xx.IntensityScale = cFilter(Lvl(x)*Mult(x)) : Next Else for each xx in obj(x) : xx.IntensityScale = Lvl(x)*Mult(x) : Next End If else 'if single lamp or flasher If UseFunction then obj(x).Intensityscale = cFilter(Lvl(x)*Mult(x)) Else obj(x).Intensityscale = Lvl(x) End If end if if TypeName(lvl(x)) <> "Double" and typename(lvl(x)) <> "Integer" then msgbox "uhh " & 2 & " = " & lvl(x) 'If UseCallBack(x) then execute cCallback(x) & " " & (Lvl(x)) 'Callback If UseCallBack(x) then Proc name & x,Lvl(x)*mult(x) 'Proc If Lock(x) Then if Lvl(x) = 1 or Lvl(x) = 0 then Loaded(x) = True 'finished fading end if end if Next End Sub End Class 'Lamp Filter Function LampFilter(aLvl) LampFilter = aLvl^1.6 'exponential curve? End Function 'Helper functions Sub Proc(string, Callback) 'proc using a string and one argument 'On Error Resume Next dim p : Set P = GetRef(String) P Callback If err.number = 13 then msgbox "Proc error! No such procedure: " & vbnewline & string if err.number = 424 then msgbox "Proc error! No such Object" End Sub Function AppendArray(ByVal aArray, aInput) 'append one value, object, or Array onto the end of a 1 dimensional array if IsArray(aInput) then 'Input is an array... dim tmp : tmp = aArray If not IsArray(aArray) Then 'if not array, create an array tmp = aInput Else 'Append existing array with aInput array Redim Preserve tmp(uBound(aArray) + uBound(aInput)+1) 'If existing array, increase bounds by uBound of incoming array dim x : for x = 0 to uBound(aInput) if isObject(aInput(x)) then Set tmp(x+uBound(aArray)+1 ) = aInput(x) Else tmp(x+uBound(aArray)+1 ) = aInput(x) End If Next AppendArray = tmp 'return new array End If Else 'Input is NOT an array... If not IsArray(aArray) Then 'if not array, create an array aArray = Array(aArray, aInput) Else Redim Preserve aArray(uBound(aArray)+1) 'If array, increase bounds by 1 if isObject(aInput) then Set aArray(uBound(aArray)) = aInput Else aArray(uBound(aArray)) = aInput End If End If AppendArray = aArray 'return new array End If End Function ' ****************************** END Lampz from funhouse ' *************************************************************************************************** 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ' X  X X X  X X X X  X X X X X  X X X X X X  X X X X '/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ '  SCORBIT Interface ' To Use: ' 1) Define a timer tmrScorbit ' 2) Call DoInit at the end of PupInit or in Table Init if you are nto using pup with the appropriate parameters ' if Scorbit.DoInit(389, "PupOverlays", "1.0.0", "GRWvz-MP37P") then ' tmrScorbit.Interval=2000 ' tmrScorbit.UserValue = 0 ' tmrScorbit.Enabled=True ' End if ' 3) Customize helper functions below for different events if you want or make your own ' 4) Call ' StartSession - When a game starts ' StopSession - When the game is over ' SendUpdate - When Score Changes ' SetGameMode - When different game events happen like starting a mode, MB etc. (ScorbitBuildGameModes helper function shows you how) ' 5) Drop the binaries sQRCode.exe and sToken.exe in your Pup Root so we can create session kets and QRCodes. ' 6) Callbacks ' Scorbit_Paired - Called when machine is successfully paired. Hide QRCode and play a sound ' Scorbit_PlayerClaimed - Called when player is claimed. Hide QRCode, play a sound and display name ' ' '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ' TABLE CUSTOMIZATION START HERE Sub Scorbit_Paired() ' Scorbit callback when new machine is paired debug.print "Scorbit PAIRED" PlaySoundVol "scorbit_login", VolSfx PuPlayer.LabelSet pOverVid, "ScorbitQR", "PuPOverlays\\clear.png",0,"" PuPlayer.LabelSet pOverVid, "ScorbitQRIcon", "PuPOverlays\\clear.png",0,"" End Sub Sub Scorbit_PlayerClaimed(PlayerNum, PlayerName) ' Scorbit callback when QR Is Claimed debug.print "Scorbit LOGIN" PlaySoundVol "scorbit_login", VolSfx ScorbitClaimQR(False) puPlayer.LabelSet pDMDText,"Player", PlayerName ,1,"" 'Debug.print "Scorbit_PlayerClaimed:" & PlayerNum & " " & PlayerName End Sub Sub ScorbitClaimQR(bShow) ' Show QRCode on first ball for users to claim this position if Scorbit.bSessionActive=False then Exit Sub if ScorbitShowClaimQR=False then Exit Sub if Scorbit.bNeedsPairing then exit sub if bShow and balls=1 and bGameInPlay and Scorbit.GetName(CurrentPlayer+1)="" then if PupOption=0 or ScorbitClaimSmall=0 then ' Desktop Make it Larger PuPlayer.LabelSet pDMDText, "ScorbitQR", "PuPOverlays\\QRclaim.png",1,"{'mt':2,'width':20, 'height':40,'xalign':0,'yalign':0,'ypos':40,'xpos':5}" PuPlayer.LabelSet pDMDText, "ScorbitQRIcon", "PuPOverlays\\QRcodeB.png",1,"{'mt':2,'width':23, 'height':52,'xalign':0,'yalign':0,'ypos':38,'xpos':3.5,'zback':1}" else PuPlayer.LabelSet pDMDText, "ScorbitQR", "PuPOverlays\\QRclaim.png",1,"{'mt':2,'width':12, 'height':24,'xalign':0,'yalign':0,'ypos':60,'xpos':5}" PuPlayer.LabelSet pDMDText, "ScorbitQRIcon", "PuPOverlays\\QRcodeB.png",1,"{'mt':2,'width':14, 'height':32.5,'xalign':0,'yalign':0,'ypos':58,'xpos':4,'zback':1}" End if Else PuPlayer.LabelSet pDMDText, "ScorbitQR", "PuPOverlays\\clear.png",0,"" PuPlayer.LabelSet pDMDText, "ScorbitQRIcon", "PuPOverlays\\clear.png",0,"" End if End Sub Sub ScorbitBuildGameModes() ' Custom function to build the game modes for better stats dim GameModeStr if Scorbit.bSessionActive=False then Exit Sub GameModeStr="NA:" Select Case PlayerMode case -1:' No Mode Selected Case 0: ' Nebula - Pod Chase (10 shots) GameModeStr="NA{blue}:Pod Chase" Case 1: ' Ronan - Sanctuary (5 shots) GameModeStr="NA{yellow}:Sanctuary" Case 2: ' Yandu - Yaka Arrow (8 shots) GameModeStr="NA{blue}:Yaka Arrow" Case 3: ' Star Lord - Quills Quest (12 shots) GameModeStr="NA{yellow}:Quills Quest" Case 4: ' Drax - Knowhere (8 shots) GameModeStr="NA{red}:Knowhere" Case 5: ' Rocket - Escape Kyln (7 shots, Hadron Enforcer works on all except Rocket) GameModeStr="NA{orange}:Escape Kyln" Case 6: ' Gamora - Siblng Rvlry (8 shots) GameModeStr="NA{green}:Siblng" Case 7: ' Broker - Antique Shop (7 shots) GameModeStr="NA{blue}:Antique Shop" End Select if bPlayerModeSelect=False and bSecondMode then Select Case PlayerMode2 case -1:' No Mode Selected Case 0: ' Nebula - Pod Chase (10 shots) GameModeStr="NA{blue}:Pod Chase 2nd" Case 1: ' Ronan - Sanctuary (5 shots) GameModeStr="NA{yellow}:Sanctuary 2nd" Case 2: ' Yandu - Yaka Arrow (8 shots) GameModeStr="NA{blue}:Yaka Arrow 2nd" Case 3: ' Star Lord - Quills Quest (12 shots) GameModeStr="NA{yellow}:Quills Quest 2nd" Case 4: ' Drax - Knowhere (8 shots) GameModeStr="NA{red}:Knowhere 2nd" Case 5: ' Rocket - Escape Kyln (7 shots, Hadron Enforcer works on all except Rocket) GameModeStr="NA{orange}:Escape Kyln 2nd" Case 6: ' Gamora - Siblng Rvlry (8 shots) GameModeStr="NA{green}:Siblng 2nd" Case 7: ' Broker - Antique Shop (7 shots) GameModeStr="NA{blue}:Antique Shop 2nd" End Select End if if bGrootMultiball then if GameModeStr<>"" then GameModeStr=GameModeStr & ";" GameModeStr=GameModeStr&"MB{green}:Groot" End if if bOrbMultiBall then if GameModeStr<>"" then GameModeStr=GameModeStr & ";" GameModeStr=GameModeStr&"MB{purple}:Orb" End if if tmrCherryBomb.Enabled then if GameModeStr<>"" then GameModeStr=GameModeStr & ";" GameModeStr=GameModeStr&"WM{red}:Cherry Bomb" End if if tmrImmolation.Enabled then if GameModeStr<>"" then GameModeStr=GameModeStr & ";" GameModeStr=GameModeStr&"WM{purple}:Immolation Initiative" End if if tmrXandar.Enabled then if GameModeStr<>"" then GameModeStr=GameModeStr & ";" GameModeStr=GameModeStr&"WM{purple}:Save Xandar" End if Scorbit.SetGameMode(GameModeStr) End Sub Sub Scorbit_LOGUpload(state) ' Callback during the log creation process. 0=Creating Log, 1=Uploading Log, 2=Done Select Case state case 0: Debug.print "CREATING LOG" case 1: Debug.print "Uploading LOG" case 2: Debug.print "LOG Complete" End Select End Sub '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ' TABLE CUSTOMIZATION END HERE - NO NEED TO EDIT BELOW THIS LINE dim Scorbit : Set Scorbit = New ScorbitIF ' Workaround - Call get a reference to Member Function Sub tmrScorbit_Timer() ' Timer to send heartbeat Scorbit.DoTimer(tmrScorbit.UserValue) tmrScorbit.UserValue=tmrScorbit.UserValue+1 if tmrScorbit.UserValue>5 then tmrScorbit.UserValue=0 End Sub Function ScorbitIF_Callback() Scorbit.Callback() End Function Class ScorbitIF Public bSessionActive Public bNeedsPairing Private bUploadLog Private bActive Private LOGFILE(10000000) Private LogIdx Private bProduction Private TypeLib Private MyMac Private Serial Private MyUUID Private TableVersion Private SessionUUID Private SessionSeq Private SessionTimeStart Private bRunAsynch Private bWaitResp Private GameMode Private GameModeOrig ' Non escaped version for log Private VenueMachineID Private CachedPlayerNames(4) Private SaveCurrentPlayer Public bEnabled Private sToken Private machineID Private dirQRCode Private opdbID Private wsh Private objXmlHttpMain Private objXmlHttpMainAsync Private fso Private Domain Public Sub Class_Initialize() bActive="false" bSessionActive=False bEnabled=False End Sub Property Let UploadLog(bValue) bUploadLog = bValue End Property Sub DoTimer(bInterval) ' 2 second interval dim holdScores(4) dim i if bInterval=0 then SendHeartbeat() elseif bRunAsynch then ' Game in play Scorbit.SendUpdate Score(0), Score(1), Score(2), Score(3), Balls, CurrentPlayer+1, PlayersPlayingGame End if End Sub Function GetName(PlayerNum) ' Return Parsed Players name if PlayerNum<1 or PlayerNum>4 then GetName="" else GetName=CachedPlayerNames(PlayerNum-1) End if End Function Function DoInit(MyMachineID, Directory_PupQRCode, Version, opdb) dim Nad Dim EndPoint Dim resultStr Dim UUIDParts Dim UUIDFile bProduction=1 ' bProduction=0 SaveCurrentPlayer=0 VenueMachineID="" bWaitResp=False bRunAsynch=False DoInit=False opdbID=opdb dirQrCode=Directory_PupQRCode MachineID=MyMachineID TableVersion=version bNeedsPairing=False if bProduction then domain = "api.scorbit.io" else domain = "staging.scorbit.io" domain = "scorbit-api-staging.herokuapp.com" End if Set fso = CreateObject("Scripting.FileSystemObject") dim objLocator:Set objLocator = CreateObject("WbemScripting.SWbemLocator") Dim objService:Set objService = objLocator.ConnectServer(".", "root\cimv2") Set objXmlHttpMain = CreateObject("Msxml2.ServerXMLHTTP") Set objXmlHttpMainAsync = CreateObject("Microsoft.XMLHTTP") objXmlHttpMain.onreadystatechange = GetRef("ScorbitIF_Callback") Set wsh = CreateObject("WScript.Shell") ' Get Mac for Serial Number dim Nads: set Nads = objService.ExecQuery("Select * from Win32_NetworkAdapter where physicaladapter=true") for each Nad in Nads if not isnull(Nad.MACAddress) then Debug.print "Using MAC Addresses:" & Nad.MACAddress & " From Adapter:" & Nad.description MyMac=replace(Nad.MACAddress, ":", "") Exit For End if Next Serial=eval("&H" & mid(MyMac, 5)) ' Serial=123456 Debug.print "Serial:" & Serial ' Get System UUID set Nads = objService.ExecQuery("SELECT * FROM Win32_ComputerSystemProduct") for each Nad in Nads Debug.print "Using UUID:" & Nad.UUID MyUUID=Nad.UUID Exit For Next if MyUUID="" then MsgBox "SCORBIT - Can get UUID, Disabling." Exit Function elseif MyUUID="03000200-0400-0500-0006-000700080009" or ScorbitAlternateUUID then If fso.FolderExists(UserDirectory) then If fso.FileExists(UserDirectory & "ScorbitUUID.dat") then Set UUIDFile = fso.OpenTextFile(UserDirectory & "ScorbitUUID.dat",1) MyUUID = UUIDFile.ReadLine() UUIDFile.Close Set UUIDFile = Nothing Else MyUUID=GUID() Set UUIDFile=fso.CreateTextFile(UserDirectory & "ScorbitUUID.dat",True) UUIDFile.WriteLine MyUUID UUIDFile.Close Set UUIDFile=Nothing End if End if End if ' Clean UUID UUIDParts=split(MyUUID, "-") MyUUID=LCASE(Hex(eval("&h" & UUIDParts(0))+MyMachineID)) & UUIDParts(1) & UUIDParts(2) & UUIDParts(3) & UUIDParts(4) ' Add MachineID to UUID MyUUID=LPad(MyUUID, 32, "0") ' MyUUID=Replace(MyUUID, "-", "") ' Debug.print "MyUUID:" & MyUUID ' Debug ' myUUID="adc12b19a3504453a7414e722f58737f" ' Serial="123456778" ' Authenticate and get our token if getStoken() then bEnabled=True ' SendHeartbeat DoInit=True End if End Function Sub Callback() Dim ResponseStr Dim i Dim Parts Dim Parts2 Dim Parts3 if bEnabled=False then Exit Sub if bWaitResp and objXmlHttpMain.readystate=4 then ' Debug.print "CALLBACK: " & objXmlHttpMain.Status & " " & objXmlHttpMain.readystate if objXmlHttpMain.Status=200 and objXmlHttpMain.readystate = 4 then ResponseStr=objXmlHttpMain.responseText Debug.print "RESPONSE: " & ResponseStr ' Parse Name if CachedPlayerNames(SaveCurrentPlayer-1)="" then ' Player doesnt have a name if instr(1, ResponseStr, "cached_display_name") <> 0 Then ' There are names in the result Parts=Split(ResponseStr,",{") ' split it if ubound(Parts)>=SaveCurrentPlayer-1 then ' Make sure they are enough avail if instr(1, Parts(SaveCurrentPlayer-1), "cached_display_name")<>0 then ' See if mine has a name CachedPlayerNames(SaveCurrentPlayer-1)=GetJSONValue(Parts(SaveCurrentPlayer-1), "cached_display_name") ' Get my name CachedPlayerNames(SaveCurrentPlayer-1)=Replace(CachedPlayerNames(SaveCurrentPlayer-1), """", "") Scorbit_PlayerClaimed SaveCurrentPlayer, CachedPlayerNames(SaveCurrentPlayer-1) ' Debug.print "Player Claim:" & SaveCurrentPlayer & " " & CachedPlayerNames(SaveCurrentPlayer-1) End if End if End if else ' Check for unclaim if instr(1, ResponseStr, """player"":null")<>0 Then ' Someone doesnt have a name Parts=Split(ResponseStr,"[") ' split it 'Debug.print "Parts:" & Parts(1) Parts2=Split(Parts(1),"}") ' split it for i = 0 to Ubound(Parts2) 'Debug.print "Parts2:" & Parts2(i) if instr(1, Parts2(i), """player"":null")<>0 Then CachedPlayerNames(i)="" End if Next End if End if End if bWaitResp=False End if End Sub Public Sub StartSession() if bEnabled=False then Exit Sub Debug.print "Scorbit Start Session" CachedPlayerNames(0)="" CachedPlayerNames(1)="" CachedPlayerNames(2)="" CachedPlayerNames(3)="" bRunAsynch=True bActive="true" bSessionActive=True SessionSeq=0 SessionUUID=GUID() SessionTimeStart=GameTime LogIdx=0 SendUpdate 0, 0, 0, 0, 1, 1, 1 End Sub Public Sub StopSession(P1Score, P2Score, P3Score, P4Score, NumberPlayers) StopSession2 P1Score, P2Score, P3Score, P4Score, NumberPlayers, False End Sub Public Sub StopSession2(P1Score, P2Score, P3Score, P4Score, NumberPlayers, bCancel) Dim i dim objFile if bEnabled=False then Exit Sub if bSessionActive=False then Exit Sub Debug.print "Scorbit Stop Session" bRunAsynch=False bActive="false" bSessionActive=False SendUpdate P1Score, P2Score, P3Score, P4Score, -1, -1, NumberPlayers ' SendHeartbeat if bUploadLog and LogIdx<>0 and bCancel=False then Debug.print "Creating Scorbit Log: Size" & LogIdx Scorbit_LOGUpload(0) Set objFile = fso.CreateTextFile(puplayer.getroot&"\" & cGameName & "\sGameLog.csv") For i = 0 to LogIdx-1 objFile.Writeline LOGFILE(i) Next objFile.Close LogIdx=0 Scorbit_LOGUpload(1) pvPostFile "https://" & domain & "/api/session_log/", puplayer.getroot&"\" & cGameName & "\sGameLog.csv", False Scorbit_LOGUpload(2) on error resume next fso.DeleteFile(puplayer.getroot&"\" & cGameName & "\sGameLog.csv") on error goto 0 End if End Sub Public Sub SetGameMode(GameModeStr) GameModeOrig=GameModeStr GameMode=GameModeStr GameMode=Replace(GameMode, ":", "%3a") GameMode=Replace(GameMode, ";", "%3b") GameMode=Replace(GameMode, " ", "%20") GameMode=Replace(GameMode, "{", "%7B") GameMode=Replace(GameMode, "}", "%7D") End sub Public Sub SendUpdate(P1Score, P2Score, P3Score, P4Score, CurrentBall, CurrentPlayer, NumberPlayers) SendUpdateAsynch P1Score, P2Score, P3Score, P4Score, CurrentBall, CurrentPlayer, NumberPlayers, bRunAsynch End Sub Public Sub SendUpdateAsynch(P1Score, P2Score, P3Score, P4Score, CurrentBall, CurrentPlayer, NumberPlayers, bAsynch) dim i Dim PostData Dim resultStr dim LogScores(4) if bUploadLog then if NumberPlayers>=1 then LogScores(0)=P1Score if NumberPlayers>=2 then LogScores(1)=P2Score if NumberPlayers>=3 then LogScores(2)=P3Score if NumberPlayers>=4 then LogScores(3)=P4Score LOGFILE(LogIdx)=DateDiff("S", "1/1/1970", Now()) & "," & LogScores(0) & "," & LogScores(1) & "," & LogScores(2) & "," & LogScores(3) & ",,," & CurrentPlayer & "," & CurrentBall & ",""" & GameModeOrig & """" LogIdx=LogIdx+1 End if if bEnabled=False then Exit Sub if bWaitResp then exit sub ' Drop message until we get our next response SaveCurrentPlayer=CurrentPlayer ' PostData = "session_uuid=" & SessionUUID & "&session_time=" & DateDiff("S", "1/1/1970", Now()) & _ ' "&session_sequence=" & SessionSeq & "&active=" & bActive PostData = "session_uuid=" & SessionUUID & "&session_time=" & GameTime-SessionTimeStart+1 & _ "&session_sequence=" & SessionSeq & "&active=" & bActive SessionSeq=SessionSeq+1 if NumberPlayers > 0 then for i = 0 to NumberPlayers-1 PostData = PostData & "¤t_p" & i+1 & "_score=" if i <= NumberPlayers-1 then if i = 0 then PostData = PostData & P1Score if i = 1 then PostData = PostData & P2Score if i = 2 then PostData = PostData & P3Score if i = 3 then PostData = PostData & P4Score else PostData = PostData & "-1" End if Next PostData = PostData & "¤t_ball=" & CurrentBall & "¤t_player=" & CurrentPlayer if GameMode<>"" then PostData=PostData & "&game_modes=" & GameMode End if resultStr = PostMsg("https://" & domain, "/api/entry/", PostData, bAsynch) if resultStr<>"" then Debug.print "SendUpdate Resp:" & resultStr End Sub ' PRIVATE BELOW Private Function LPad(StringToPad, Length, CharacterToPad) Dim x : x = 0 If Length > Len(StringToPad) Then x = Length - len(StringToPad) LPad = String(x, CharacterToPad) & StringToPad End Function Private Function GUID() Dim TypeLib Set TypeLib = CreateObject("Scriptlet.TypeLib") GUID = Mid(TypeLib.Guid, 2, 36) ' Set wsh = CreateObject("WScript.Shell") ' Set fso = CreateObject("Scripting.FileSystemObject") ' ' dim rc ' dim result ' dim objFileToRead ' Dim sessionID:sessionID=puplayer.getroot&"\" & cGameName & "\sessionID.txt" ' ' on error resume next ' fso.DeleteFile(sessionID) ' On error goto 0 ' ' rc = wsh.Run("powershell -Command ""(New-Guid).Guid"" | out-file -encoding ascii " & sessionID, 0, True) ' if FileExists(sessionID) and rc=0 then ' Set objFileToRead = fso.OpenTextFile(sessionID,1) ' result = objFileToRead.ReadLine() ' objFileToRead.Close ' GUID=result ' else ' MsgBox "Cant Create SessionUUID through powershell. Disabling Scorbit" ' bEnabled=False ' End if End Function Private Function GetJSONValue(JSONStr, key) dim i Dim tmpStrs,tmpStrs2 if Instr(1, JSONStr, key)<>0 then tmpStrs=split(JSONStr,",") for i = 0 to ubound(tmpStrs) if instr(1, tmpStrs(i), key)<>0 then tmpStrs2=split(tmpStrs(i),":") GetJSONValue=tmpStrs2(1) exit for End if Next End if End Function Private Sub SendHeartbeat() Dim resultStr dim TmpStr Dim Command Dim rc Dim QRFile:QRFile=puplayer.getroot&"\" & cGameName & "\" & dirQrCode if bEnabled=False then Exit Sub resultStr = GetMsgHdr("https://" & domain, "/api/heartbeat/", "Authorization", "SToken " & sToken) Debug.print "Heartbeat Resp:" & resultStr If VenueMachineID="" then if resultStr<>"" and Instr(resultStr, """unpaired"":true")=0 then ' We Paired bNeedsPairing=False Debug.print "Paired" Scorbit_Paired() else bNeedsPairing=True End if TmpStr=GetJSONValue(resultStr, "venuemachine_id") if TmpStr<>"" then VenueMachineID=TmpStr 'Debug.print "VenueMachineID=" & VenueMachineID Command = puplayer.getroot&"\" & cGameName & "\sQRCode.exe " & VenueMachineID & " " & opdbID & " " & QRFile rc = wsh.Run(Command, 0, False) End if End if End Sub Private Function getStoken() Dim result Dim results ' dim wsh Dim tmpUUID:tmpUUID="adc12b19a3504453a7414e722f58736b" Dim tmpVendor:tmpVendor="vscorbitron" Dim tmpSerial:tmpSerial="999990104" Dim QRFile:QRFile=puplayer.getroot&"\" & cGameName & "\" & dirQrCode Dim sTokenFile:sTokenFile=puplayer.getroot&"\" & cGameName & "\sToken.dat" ' Set everything up tmpUUID=MyUUID tmpVendor="vpin" tmpSerial=Serial on error resume next fso.DeleteFile(sTokenFile) On error goto 0 ' get sToken and generate QRCode ' Set wsh = CreateObject("WScript.Shell") Dim waitOnReturn: waitOnReturn = True Dim windowStyle: windowStyle = 0 Dim Command Dim rc Dim objFileToRead Command = puplayer.getroot&"\" & cGameName & "\sToken.exe " & tmpUUID & " " & tmpVendor & " " & tmpSerial & " " & MachineID & " " & QRFile & " " & sTokenFile & " " & domain debug.print "RUNNING Command:" & Command rc = wsh.Run(Command, windowStyle, waitOnReturn) Debug.print "Return:" & rc if FileExists(puplayer.getroot&"\" & cGameName & "\sToken.dat") and rc=0 then Set objFileToRead = fso.OpenTextFile(puplayer.getroot&"\" & cGameName & "\sToken.dat",1) result = objFileToRead.ReadLine() objFileToRead.Close Set objFileToRead = Nothing 'Debug.print result if Instr(1, result, "Invalid timestamp")<> 0 then MsgBox "Scorbit Timestamp Error: Please make sure the time on your system is exact" getStoken=False elseif Instr(1, result, ":")<>0 then results=split(result, ":") sToken=results(1) sToken=mid(sToken, 3, len(sToken)-4) Debug.print "Got TOKEN:" & sToken getStoken=True Else Debug.print "ERROR:" & result getStoken=False End if else Debug.print "ERROR No File:" & rc End if End Function private Function FileExists(FilePath) If fso.FileExists(FilePath) Then FileExists=CBool(1) Else FileExists=CBool(0) End If End Function Private Function GetMsg(URLBase, endpoint) GetMsg = GetMsgHdr(URLBase, endpoint, "", "") End Function Private Function GetMsgHdr(URLBase, endpoint, Hdr1, Hdr1Val) Dim Url Url = URLBase + endpoint & "?session_active=" & bActive Debug.print "Url:" & Url & " Async=" & bRunAsynch objXmlHttpMain.open "GET", Url, bRunAsynch ' objXmlHttpMain.setRequestHeader "Content-Type", "text/xml" objXmlHttpMain.setRequestHeader "Cache-Control", "no-cache" if Hdr1<> "" then objXmlHttpMain.setRequestHeader Hdr1, Hdr1Val ' on error resume next err.clear objXmlHttpMain.send "" if err.number=-2147012867 then MsgBox "Multiplayer Server is down (" & err.number & ") " & Err.Description bEnabled=False elseif err.number <> 0 then debug.print "Server error: (" & err.number & ") " & Err.Description End if if bRunAsynch=False then Debug.print "Status: " & objXmlHttpMain.status If objXmlHttpMain.status = 200 Then GetMsgHdr = objXmlHttpMain.responseText Else GetMsgHdr="" End if Else bWaitResp=True GetMsgHdr="" End if ' On error goto 0 End Function Private Function PostMsg(URLBase, endpoint, PostData, bAsynch) Dim Url Url = URLBase + endpoint debug.print "PostMSg:" & Url & " " & PostData objXmlHttpMain.open "POST",Url, bAsynch objXmlHttpMain.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" objXmlHttpMain.setRequestHeader "Content-Length", Len(PostData) objXmlHttpMain.setRequestHeader "Cache-Control", "no-cache" objXmlHttpMain.setRequestHeader "Authorization", "SToken " & sToken if bAsynch then bWaitResp=True on error resume next objXmlHttpMain.send PostData if err.number=-2147012867 then MsgBox "Multiplayer Server is down (" & err.number & ") " & Err.Description bEnabled=False elseif err.number <> 0 then 'debug.print "Multiplayer Server error (" & err.number & ") " & Err.Description End if If objXmlHttpMain.status = 200 Then PostMsg = objXmlHttpMain.responseText else PostMsg="ERROR: " & objXmlHttpMain.status & " >" & objXmlHttpMain.responseText & "<" End if On error goto 0 End Function Private Function pvPostFile(sUrl, sFileName, bAsync) Debug.print "Posting File " & sUrl & " " & sFileName & " " & bAsync & " File:" & Mid(sFileName, InStrRev(sFileName, "\") + 1) Dim STR_BOUNDARY:STR_BOUNDARY = GUID() Dim nFile Dim baBuffer() Dim sPostData Dim Response '--- read file Set nFile = fso.GetFile(sFileName) With nFile.OpenAsTextStream() sPostData = .Read(nFile.Size) .Close End With ' fso.Open sFileName For Binary Access Read As nFile ' If LOF(nFile) > 0 Then ' ReDim baBuffer(0 To LOF(nFile) - 1) As Byte ' Get nFile, , baBuffer ' sPostData = StrConv(baBuffer, vbUnicode) ' End If ' Close nFile '--- prepare body sPostData = "--" & STR_BOUNDARY & vbCrLf & _ "Content-Disposition: form-data; name=""uuid""" & vbCrLf & vbCrLf & _ SessionUUID & vbcrlf & _ "--" & STR_BOUNDARY & vbCrLf & _ "Content-Disposition: form-data; name=""log_file""; filename=""" & SessionUUID & ".csv""" & vbCrLf & _ "Content-Type: application/octet-stream" & vbCrLf & vbCrLf & _ sPostData & vbCrLf & _ "--" & STR_BOUNDARY & "--" 'Debug.print "POSTDATA: " & sPostData & vbcrlf '--- post With objXmlHttpMain .Open "POST", sUrl, bAsync .SetRequestHeader "Content-Type", "multipart/form-data; boundary=" & STR_BOUNDARY .SetRequestHeader "Authorization", "SToken " & sToken .Send sPostData ' pvToByteArray(sPostData) If Not bAsync Then Response= .ResponseText pvPostFile = Response Debug.print "Upload Response: " & Response End If End With End Function Private Function pvToByteArray(sText) pvToByteArray = StrConv(sText, 128) ' vbFromUnicode End Function End Class '  END SCORBIT 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ' X  X X X  X X X X  X X X X X  X X X X X X  X X X X '/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ '  Orbital Scoreboard Code '\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ ' X  X X X  X X X X  X X X X X  X X X X X X  X X X X '**************************** ' POST SCORES '**************************** Dim osbtemp Dim osbtempscore:osbtempscore = 0 if osbactive = 1 or osbactive = 2 Then osbtemp = osbdefinit Sub SubmitOSBScore dim vers Dim ver vers=split(myVersion,".") ' Convert x.y.z to x.y ver=vers(0) & "." & vers(1) On Error Resume Next if osbactive = 1 or osbactive = 2 Then Dim objXmlHttpMain, Url, strJSONToSend Url = "https://hook.integromat.com/82bu988v9grj31vxjklh2e4s6h97rnu0" strJSONToSend = "{""auth"":""" & osbkey &""",""player id"": """ & osbid & """,""player initials"": """ & osbtemp &""",""score"": " & CStr(osbtempscore) & ",""table"":"""& TableNameOBS & """,""version"":""" & ver & """}" Set objXmlHttpMain = CreateObject("Msxml2.ServerXMLHTTP") objXmlHttpMain.open "PUT",Url, False objXmlHttpMain.setRequestHeader "Content-Type", "application/json" objXmlHttpMain.setRequestHeader "application", "application/json" objXmlHttpMain.send strJSONToSend 'debug.print "Submitted Score: " & strJSONToSend end if End Sub '**************************** ' GET SCORES '**************************** dim worldscores Sub GetScores() if osbactive =0 then exit sub if osbkey="" then exit sub On Error Resume Next Dim objXmlHttpMain, Url, strJSONToSend Url = "https://hook.integromat.com/kj765ojs42ac3w4915elqj5b870jrm5c" strJSONToSend = "{""auth"":"""& osbkey &""", ""table"":"""& TableNameOBS & """}" Set objXmlHttpMain = CreateObject("Msxml2.ServerXMLHTTP") objXmlHttpMain.open "PUT",Url, False objXmlHttpMain.setRequestHeader "Content-Type", "application/json" objXmlHttpMain.setRequestHeader "application", "application/json" objXmlHttpMain.send strJSONToSend worldscores = objXmlHttpMain.responseText vpmtimer.addtimer 3000, "showsuccess '" ' debug.print "Got OSB scores: " & strJSONToSend ' debug.print worldscores splitscores End Sub Dim scorevar(22) Dim dailyvar(22) Dim weeklyvar(22) Dim alltimevar(42) sub emptyscores dim i For i = 0 to 42 alltimevar(i) = "0" Next For i = 0 to 22 weeklyvar(i) = "0" dailyvar(i) = "0" Next End Sub emptyscores Sub splitscores On Error Resume Next dim a,scoreset,subset,subit,myNum,daily,weekly,alltime,x a = Split(worldscores,": {") subset = Split(a(1),"[") ' debug.print subset(1) ' debug.print subset(2) ' debug.print subset(3) ' daily scores myNum = 0 daily = Split(subset(1),": ") for each x in daily myNum = MyNum + 1 x = Replace(x, vbCr, "") x = Replace(x, vbLf, "") x = Replace(x, ",", "") x = Replace(x, """", "") x = Replace(x, "{", "") x = Replace(x, "}", "") x = Replace(x, "score", "") x = Replace(x, "initials", "") x = Replace(x, "weekly", "") x = Replace(x, "]", "") x = Replace(x, "alltime", "") dailyvar(MyNum) = x if dailyvar(MyNum) = "" Then if MyNum = 2 or 4 or 6 or 8 or 10 or 12 or 14 or 16 or 18 or 20 Then dailyvar(MyNum) = "OBS" Else dailyvar(MyNum) = 0 end if end if debug.print "dailyvar(" &MyNum & ")=" & x Next ' weekly scores myNum = 0 weekly = Split(subset(2),": ") for each x in weekly myNum = MyNum + 1 x = Replace(x, vbCr, "") x = Replace(x, vbLf, "") x = Replace(x, ",", "") x = Replace(x, """", "") x = Replace(x, "{", "") x = Replace(x, "}", "") x = Replace(x, "score", "") x = Replace(x, "initials", "") x = Replace(x, "weekly", "") x = Replace(x, "]", "") x = Replace(x, "alltime", "") weeklyvar(MyNum) = x if weeklyvar(MyNum) = "" Then if MyNum = 2 or 4 or 6 or 8 or 10 or 12 or 14 or 16 or 18 or 20 Then weeklyvar(MyNum) = "OBS" Else weeklyvar(MyNum) = 0 end if end if debug.print "weeklyvar(" &MyNum & ")=" & x Next ' alltime scores myNum = 0 alltime = Split(subset(3),": ") for each x in alltime myNum = MyNum + 1 x = Replace(x, vbCr, "") x = Replace(x, vbLf, "") x = Replace(x, ",", "") x = Replace(x, """", "") x = Replace(x, "{", "") x = Replace(x, "}", "") x = Replace(x, "score", "") x = Replace(x, "initials", "") x = Replace(x, "weekly", "") x = Replace(x, "]", "") x = Replace(x, "alltime", "") alltimevar(MyNum) = x if alltimevar(MyNum) = "" Then if MyNum = 2 or 4 or 6 or 8 or 10 or 12 or 14 or 16 or 18 or 20 or 22 or 24 or 26 or 28 or 30 or 32 or 34 or 36 or 38 or 40 Then alltimevar(MyNum) = "OBS" Else alltimevar(MyNum) = "0" end if end if debug.print "alltimevar(" &MyNum & ")=" & x Next end Sub sub showsuccess 'pNote "Scoreboard","Updated" pupDMDDisplay "-","Scoreboard^Updated","",3,0,10 end sub Class PinupNULL ' Dummy Pinup class so I dont have to keep adding if cases when people dont choose pinup Public Sub LabelShowPage(screen, pagenum, vis, Special) End Sub Public Sub LabelSet(screen, label, text, vis, Special) End Sub Public Sub playlistplayex(screen, dir, fname, volume, priority) End Sub End Class '********************* START OF PUPDMD FRAMEWORK v1.0 ************************* '******************** DO NOT MODIFY STUFF BELOW THIS LINE!!!! *************** '****************************************************************************** '***** Create a PUPPack within PUPPackEditor for layout config!!! ********** '****************************************************************************** ' ' ' Quick Steps: ' 1> create a folder in PUPVideos with Starter_PuPPack.zip and call the folder "yourgame" ' 2> above set global variable pGameName="yourgame" ' 3> copy paste the settings section above to top of table script for user changes. ' 4> on Table you need to create ONE timer only called pupDMDUpdate and set it to 250 ms enabled on startup. ' 5> go to your table1_init or table first startup function and call PUPINIT function ' 6> Go to bottom on framework here and setup game to call the appropriate events like pStartGame (call that in your game code where needed)...etc ' 7> attractmodenext at bottom is setup for you already, just go to each case and add/remove as many as you want and setup the messages to show. ' 8> Have fun and use pDMDDisplay(xxxx) sub all over where needed. remember its best to make a bunch of mp4 with text animations... looks the best for sure! ' ' 'Note: for *Future Pinball* "pupDMDupdate_Timer()" timer needs to be renamed to "pupDMDupdate_expired()" and then all is good. ' and for future pinball you need to add the follow lines near top 'Need to use BAM and have com idll enabled. ' Dim icom : Set icom = xBAM.Get("icom") ' "icom" is name of "icom.dll" in BAM\Plugins dir ' if icom is Nothing then MSGBOX "Error cannot run without icom.dll plugin" ' Function CreateObject(className) ' Set CreateObject = icom.CreateObject(className) ' End Function Const HasPuP = True 'dont set to false as it will break pup Const pTopper=0 Const pDMD=1 Const pPlayfield=3 Const pMusic=4 Const pDMDFull=5 Const pCallouts=6 Const pBackglass2=7 Const pDMDText=11 Const pBonusScreen = 12 Const pOverVid=13 Const pAudio=14 Const pUnderVid=15 Const pTransp=16 'pages Const pDMDBlank=0 Const pScores=1 Const pBigLine=2 Const pThreeLines=3 Const pTwoLines=4 Const pTargerLetters=5 'dmdType Const pDMDTypeLCD=0 Const pDMDTypeReal=1 Const pDMDTypeFULL=2 Dim PuPlayer dim PUPDMDObject 'for realtime mirroring. Dim pDMDlastchk: pDMDLastchk= -1 'performance of updates Dim pDMDCurPage: pDMDCurPage= 0 'default page is empty. Dim pInAttract : pInAttract=false 'pAttract mode '************* starts PUP system, must be called AFTER b2s/controller running so put in last line of table1_init Sub PuPInit Dim objFileToRead on error resume next Set PuPlayer = CreateObject("PinUpPlayer.PinDisplay") 'puPlayer.Init pBonusScreen, "" ' Check Version Stuff if FileExists(puplayer.getroot&"\" & PuPPack_folder & "\version.txt") then Set objFileToRead = fso.OpenTextFile(puplayer.getroot&"\" & PuPPack_folder & "\version.txt",1) PupPack_version = objFileToRead.ReadLine() objFileToRead.Close Set objFileToRead = Nothing 'use whatever command VPX uses to import external "version.txt" file (using the pup path above) to be used as vbs script if PupPack_version = PupPack_verified then if FileExists(puplayer.getroot&"\" & PuPPack_folder & "\Option Selected.txt") then Set objFileToRead = fso.OpenTextFile(puplayer.getroot&"\" & PuPPack_folder & "\Option Selected.txt",1) PupOption = objFileToRead.ReadLine() objFileToRead.Close Set objFileToRead = Nothing if PupOption = 0 or PupOption=2 then ' Desktop & 3 screen ScreenType=0 elseif PupOption = 3 then ' 5x4 ScreenType=3 Else ScreenType=1 End if 'use whatever command VPX uses to import external "Option Selected.txt" file (using the pup path above) to be used as vbs script 'make changes needed in script based on pup-pack option file found (like pupdmddrivertype,etc) end if ' PuPlayer.B2SInit "",PuPPack_folder 'start the Pup-Pack PUPStatus = true Else MsgBox "PupPack version mismatch. Please download the latest pupPack version " & PupPack_verified 'pup-pack is not found or is incorrect version PUPStatus = false PUPEnabled = false 'use FlexDMD or other option if supported on the table end if end if PuPlayer.B2SInit "", pGameName on error goto 0 if not IsObject(PuPlayer) then bUsePUPDMD=False if (PuPDMDDriverType=pDMDTypeReal) and (useRealDMDScale=1) Then PuPlayer.setScreenEx pDMD,0,0,128,32,0 'if hardware set the dmd to 128,32 End if PuPlayer.LabelInit pDMDFull PuPlayer.LabelInit pDMDText PuPlayer.LabelInit 8 'PuPlayer.LabelInit pDMD ' Uncomment to Enable the RealDMD if PuPDMDDriverType=pDMDTypeReal then Set PUPDMDObject = CreateObject("PUPDMDControl.DMD") PUPDMDObject.DMDOpen PUPDMDObject.DMDPuPMirror PUPDMDObject.DMDPuPTextMirror PuPlayer.SendMSG "{ ""mt"":301, ""SN"": 1, ""FN"":33 }" 'set pupdmd for mirror and hide behind other pups PuPlayer.SendMSG "{ ""mt"":301, ""SN"": 1, ""FN"":32, ""FQ"":3 }" 'set no antialias on font render if real 'Else ' PuPlayer.SendMSG "{ ""mt"":301, ""SN"": 2, ""FN"":33 }" 'set pupdmd for mirror and hide behind other pups END IF pSetPageLayouts pDMDSetPage(pDMDBlank) 'set blank text overlay page. pDMDStartUP ' firsttime running for like an startup video.. if Scorbitactive then ' if Scorbit.DoInit(2082, "PupOverlays", myVersion, "GRWvz-MP37P") then ' Staging if Scorbit.DoInit(2108, "PupOverlays", myVersion, "GRWvz-MP37P") then ' Prod tmrScorbit.Interval=2000 tmrScorbit.UserValue = 0 tmrScorbit.Enabled=True Scorbit.UploadLog = ScorbitUploadLog End if End if End Sub 'end PUPINIT 'PinUP Player DMD Helper Functions Sub pDMDLabelHide(labName) PuPlayer.LabelSet pDMD,labName,"",0,"" end sub Sub pDMDScrollBig(msgText,timeSec,mColor) PuPlayer.LabelShowPage pDMD,2,timeSec,"" PuPlayer.LabelSet pDMD,"Splash",msgText,0,"{'mt':1,'at':2,'xps':1,'xpe':-1,'len':" & (timeSec*1000000) & ",'mlen':" & (timeSec*1000) & ",'tt':0,'fc':" & mColor & "}" end sub Sub pDMDScrollBigV(msgText,timeSec,mColor) PuPlayer.LabelShowPage pDMD,2,timeSec,"" PuPlayer.LabelSet pDMD,"Splash",msgText,0,"{'mt':1,'at':2,'yps':1,'ype':-1,'len':" & (timeSec*1000000) & ",'mlen':" & (timeSec*1000) & ",'tt':0,'fc':" & mColor & "}" end sub Sub pDMDSplashScore(msgText,timeSec,mColor) PuPlayer.LabelSet pDMD,"MsgScore",msgText,0,"{'mt':1,'at':1,'fq':250,'len':"& (timeSec*1000) &",'fc':" & mColor & "}" end Sub Sub pDMDSplashScoreScroll(msgText,timeSec,mColor) PuPlayer.LabelSet pDMD,"MsgScore",msgText,0,"{'mt':1,'at':2,'xps':1,'xpe':-1,'len':"& (timeSec*1000) &", 'mlen':"& (timeSec*1000) &",'tt':0, 'fc':" & mColor & "}" end Sub Sub pDMDZoomBig(msgText,timeSec,mColor) 'new Zoom PuPlayer.LabelShowPage pDMD,2,timeSec,"" PuPlayer.LabelSet pDMD,"Splash",msgText,0,"{'mt':1,'at':3,'hstart':5,'hend':80,'len':" & (timeSec*1000) & ",'mlen':" & (timeSec*500) & ",'tt':5,'fc':" & mColor & "}" end sub Sub pDMDTargetLettersInfo(msgText,msgInfo, timeSec) 'msgInfo = '0211' 0= layer 1, 1=layer 2, 2=top layer3. 'this function is when you want to hilite spelled words. Like B O N U S but have O S hilited as already hit markers... see example. PuPlayer.LabelShowPage pDMD,5,timeSec,"" 'show page 5 Dim backText Dim middleText Dim flashText Dim curChar Dim i Dim offchars:offchars=0 Dim spaces:spaces=" " 'set this to 1 or more depends on font space width. only works with certain fonts 'if using a fixed font width then set spaces to just one space. For i=1 To Len(msgInfo) curChar="" & Mid(msgInfo,i,1) if curChar="0" Then backText=backText & Mid(msgText,i,1) middleText=middleText & spaces flashText=flashText & spaces offchars=offchars+1 End If if curChar="1" Then backText=backText & spaces middleText=middleText & Mid(msgText,i,1) flashText=flashText & spaces End If if curChar="2" Then backText=backText & spaces middleText=middleText & spaces flashText=flashText & Mid(msgText,i,1) End If Next if offchars=0 Then 'all litup!... flash entire string backText="" middleText="" FlashText=msgText end if PuPlayer.LabelSet pDMD,"Back5" ,backText ,1,"" PuPlayer.LabelSet pDMD,"Middle5",middleText,1,"" PuPlayer.LabelSet pDMD,"Flash5" ,flashText ,0,"{'mt':1,'at':1,'fq':150,'len':" & (timeSec*1000) & "}" end Sub Sub pDMDSetPage(pagenum) If (bUsePUPDMD) then Debug.print "Changing Page: " & pagenum PuPlayer.LabelShowPage pDMD,pagenum,0,"" 'set page to blank 0 page if want off PDMDCurPage=pagenum End if end Sub Sub pHideOverlayText(pDisp) PuPlayer.SendMSG "{ ""mt"":301, ""SN"": "& pDisp &", ""FN"": 34 }" 'hideoverlay text during next videoplay on DMD auto return end Sub Sub pDMDShowLines3(msgText,msgText2,msgText3,timeSec) Dim vis:vis=1 if pLine1Ani<>"" Then vis=0 PuPlayer.LabelShowPage pDMD,3,timeSec,"" PuPlayer.LabelSet pDMD,"Splash3a",msgText,vis,pLine1Ani PuPlayer.LabelSet pDMD,"Splash3b",msgText2,vis,pLine2Ani PuPlayer.LabelSet pDMD,"Splash3c",msgText3,vis,pLine3Ani end Sub Sub pDMDShowLines2(msgText,msgText2,timeSec) Dim vis:vis=1 if pLine1Ani<>"" Then vis=0 PuPlayer.LabelShowPage pDMD,4,timeSec,"" PuPlayer.LabelSet pDMD,"Splash4a",msgText,vis,pLine1Ani PuPlayer.LabelSet pDMD,"Splash4b",msgText2,vis,pLine2Ani end Sub Sub pDMDShowCounter(msgText,msgText2,msgText3,timeSec) Dim vis:vis=1 if pLine1Ani<>"" Then vis=0 PuPlayer.LabelShowPage pDMD,6,timeSec,"" PuPlayer.LabelSet pDMD,"Splash6a",msgText,vis, pLine1Ani PuPlayer.LabelSet pDMD,"Splash6b",msgText2,vis,pLine2Ani PuPlayer.LabelSet pDMD,"Splash6c",msgText3,vis,pLine3Ani end Sub Sub pDMDShowBig(msgText,timeSec, mColor) Dim vis:vis=1 if pLine1Ani<>"" Then vis=0 PuPlayer.LabelShowPage pDMD,2,timeSec,"" PuPlayer.LabelSet pDMD,"Splash",msgText,vis,pLine1Ani end sub Sub pDMDShowHS(msgText,msgText2,msgText3,timeSec) 'High Score Dim vis:vis=1 if pLine1Ani<>"" Then vis=0 PuPlayer.LabelShowPage pDMD,7,timeSec,"" PuPlayer.LabelSet pDMD,"Splash7a",msgText,vis,pLine1Ani PuPlayer.LabelSet pDMD,"Splash7b",msgText2,vis,pLine2Ani PuPlayer.LabelSet pDMD,"Splash7c",msgText3,vis,pLine3Ani end Sub Sub pDMDSetBackFrame(fname) PuPlayer.playlistplayex pDMD,"PUPFrames",fname,0,1 end Sub Sub pDMDStartBackLoop(fPlayList,fname) PuPlayer.playlistplayex pDMD,fPlayList,fname,0,1 PuPlayer.SetBackGround pDMD,1 end Sub Sub pDMDStopBackLoop PuPlayer.SetBackGround pDMD,0 PuPlayer.playstop pDMD end Sub Dim pNumLines 'Theme Colors for Text (not used currenlty, use the | in text labels for colouring. Dim SpecialInfo Dim pLine1Color : pLine1Color=8454143 Dim pLine2Color : pLine2Color=8454143 Dim pLine3Color : pLine3Color=8454143 Dim curLine1Color: curLine1Color=pLine1Color 'can change later Dim curLine2Color: curLine2Color=pLine2Color 'can change later Dim curLine3Color: curLine3Color=pLine3Color 'can change later Dim pDMDCurPriority: pDMDCurPriority =-1 Dim pDMDDefVolume: pDMDDefVolume = 0 'default no audio on pDMD Dim pLine1 Dim pLine2 Dim pLine3 Dim pLine1Ani Dim pLine2Ani Dim pLine3Ani Dim PriorityReset:PriorityReset=-1 DIM pAttractReset:pAttractReset=-1 DIM pAttractBetween: pAttractBetween=2000 '1 second between calls to next attract page DIM pDMDVideoPlaying: pDMDVideoPlaying=false '************************ where all the MAGIC goes, pretty much call this everywhere **************************************** '************************* see docs for examples ************************************************ '**************************************** DONT TOUCH THIS CODE ************************************************************ Sub pupDMDDisplay(pEventID, pText, VideoName,TimeSec, pAni,pPriority) ' pEventID = reference if application, ' pText = "text to show" separate lines by ^ in same string ' VideoName "gameover.mp4" will play in background "@gameover.mp4" will play and disable text during gameplay. ' also global variable useDMDVideos=true/false if user wishes only TEXT ' TimeSec how long to display msg in Seconds ' animation if any 0=none 1=Flasher ' also, now can specify color of each line (when no animation). "sometext|12345" will set label to "sometext" and set color to 12345 DIM curPos if pDMDCurPriority>pPriority then Exit Sub 'if something is being displayed that we don't want interrupted. same level will interrupt. Debug.print "DMD Skipping - Hi Pri" End If pDMDCurPriority=pPriority if timeSec=0 then timeSec=1 'don't allow page default page by accident pLine1="" pLine2="" pLine3="" pLine1Ani="" pLine2Ani="" pLine3Ani="" if pAni=1 Then 'we flashy now aren't we pLine1Ani="{'mt':1,'at':1,'fq':150,'len':" & (timeSec*1000) & "}" pLine2Ani="{'mt':1,'at':1,'fq':150,'len':" & (timeSec*1000) & "}" pLine3Ani="{'mt':1,'at':1,'fq':150,'len':" & (timeSec*1000) & "}" end If curPos=InStr(pText,"^") 'Lets break apart the string if needed if curPos>0 Then pLine1=Left(pText,curPos-1) pText=Right(pText,Len(pText) - curPos) curPos=InStr(pText,"^") 'Lets break apart the string if curPOS>0 Then pLine2=Left(pText,curPos-1) pText=Right(pText,Len(pText) - curPos) curPos=InStr(pText,"^") 'Lets break apart the string if curPos>0 Then pline3=Left(pText,curPos-1) Else if pText<>"" Then pline3=pText End if Else if pText<>"" Then pLine2=pText End if Else pLine1=pText 'just one line with no break End if 'lets see how many lines to Show pNumLines=0 if pLine1<>"" then pNumLines=pNumlines+1 if pLine2<>"" then pNumLines=pNumlines+1 if pLine3<>"" then pNumLines=pNumlines+1 if pDMDVideoPlaying Then PuPlayer.playstop pDMD pDMDVideoPlaying=False End if if (VideoName<>"") and (useDMDVideos) Then 'we are showing a splash video instead of the text. PuPlayer.playlistplayex pDMD,"DMDSplash",VideoName,pDMDDefVolume,pPriority 'should be an attract background (no text is displayed) pDMDVideoPlaying=true end if 'if showing a splash video with no text if StrComp(pEventID,"shownum",1)=0 Then 'check eventIDs pDMDShowCounter pLine1,pLine2,pLine3,timeSec Elseif StrComp(pEventID,"target",1)=0 Then 'check eventIDs pDMDTargetLettersInfo pLine1,pLine2,timeSec Elseif StrComp(pEventID,"highscore",1)=0 Then 'check eventIDs pDMDShowHS pLine1,pLine2,pline3,timeSec Elseif (pNumLines=3) Then 'depends on # of lines which one to use. pAni=1 will flash. pDMDShowLines3 pLine1,pLine2,pLine3,TimeSec Elseif (pNumLines=2) Then pDMDShowLines2 pLine1,pLine2,TimeSec Elseif (pNumLines=1) Then pDMDShowBig pLine1,timeSec, curLine1Color Else pDMDShowBig pLine1,timeSec, curLine1Color End if PriorityReset=TimeSec*1000 End Sub 'pupDMDDisplay message Sub pupDMDupdate_Timer() ' FIX2: Guard against firing LabelSet into PUP after teardown begins (Invalid pointer operation) if NOT bPupStarted then pupDMDUpdate.Enabled = False : Exit Sub ' FIX4+5: Skip this tick if screen 13 is busy (animation or VLC mid-transition from pDMDEvent) ' FIX9: Also skip if tmrAnimateScore is writing score overlays to screen 13 if tmrShotMultAnim.Enabled or tmrGuardiansAnim.Enabled or tmrAnimateScore.Enabled or bPupEventBusy then Exit Sub ' PuPlayer.SendMSG "{ ""mt"":301, ""SN"": " & pDMDText & ", ""FN"":6 }" ' Bring Text screen to the front (Not sure why I have to always do this) pUpdateScores if PriorityReset>0 Then 'for splashes we need to reset current prioirty on timer PriorityReset=PriorityReset-pupDMDUpdate.interval 'Debug.print "PriorityReset:" & PriorityReset if PriorityReset<=0 Then pDMDCurPriority=-1 if pInAttract then pAttractReset=pAttractBetween ' pAttractNext call attract next after 1 second pDMDVideoPlaying=false End if End if if pAttractReset>0 Then 'for splashes we need to reset current prioirty on timer pAttractReset=pAttractReset-pupDMDUpdate.interval 'Debug.print "pAttractReset:" & pAttractReset if pAttractReset<=0 Then pAttractReset=-1 if pInAttract then pAttractNext End if end if End Sub Sub PuPEvent(EventNum) if hasPUP=false then Exit Sub PuPlayer.B2SData "E"&EventNum,1 'send event to puppack driver End Sub '********************* END OF PUPDMD FRAMEWORK v1.0 ************************* '******************** DO NOT MODIFY STUFF ABOVE THIS LINE!!!! *************** '**************************************************************************** '***************************************************************** ' ********** PUPDMD MODIFY THIS SECTION!!! *************** 'PUPDMD Layout for each Table1 'Setup Pages. Note if you use fonts they must be in FONTS folder of the pupVideos\tablename\FONTS "case sensitive exact naming fonts!" '***************************************************************** Sub pSetPageLayouts DIM dmddef DIM dmdalt DIM dmdscr DIM dmdfixed DIM monoFont DIM hsFont DIM digitLCD DIM guardians DIM serviceFont Dim serviceFont2 Dim i 'labelNew , , ,,,,,,,,, '***********************************************************************' ', in standard weÂ’d set this to pDMD ( or 1) ', your name of the label. keep it short no spaces (like 8 chars) although you can call it anything really. When setting the label you will use this labelname to access the label. ' Windows font name, this must be exact match of OS front name. if you are using custom TTF fonts then double check the name of font names. ', Height as a percent of display height. 20=20% of screen height. ', integer value of windows color. ', degrees in tenths (900=90 degrees) ', 0= horizontal left align, 1 = center horizontal, 2= right horizontal ', 0 = top, 1 = center, 2=bottom vertical alignment ', this should be 0, but if you want to ‘forceÂ’ a position you can set this. it is a % of horizontal width. 20=20% of screen width. ' same as xpos. ' IMPORTANTÂ… this will assign this label to this ‘pageÂ’ or group. ' initial state of label. visible=1 show, 0 = off. ' Overlay 'puPlayer.LabelInit pOverlayFrame ' Backglass - this is basically the FullLCD-DMD ' --------------------------------Guardians2------------------------------ ' Prgrs | Player MessageT Ball ' | TimeLbl MTimer ' | Time ' | RampTimer/RampImg Guardians ' | MPx Message ' | Timer ' | Play1Score Play2Score CurScore Play3Score Play4Score ' ------------------------------------------------------------------------- ' monoFont="SternSystem Mono" 'main scorefont. Good FontTool: https://fontforge.org/docs/tutorial/editexample2.html#creating-the-letter-o-consistent-directions hsFont="Impact" 'main scorefont digitLCD="DIGIT LCD" dmdscr="Virgo 01" 'main scorefont guardians="Guardians" serviceFont2="Gas" serviceFont="DotMatrix" ' Scrn LblName Fnt Size Color R AxAy X Y pagenum Visible puPlayer.LabelInit pDMDText ' NOTE THE 2 LINES BELOW ENSURE the TEXT OVERLAPS the IMAGE (Thanks Nailbuster) - LabelNew: visible=0 puPlayer.LabelNew pDMDText,"ModeProgress",dmdscr, 10*FontScale,RGB(255, 255, 255) ,0,0,0 ,0,0 ,1,0 ' Mode Progress Image (NOT VISIBLE) puPlayer.LabelSet pDMDText,"ModeProgress", "PuPOverlays\\Progress5-0.png",0,"{'mt':2,'color':111111,'width':17, 'height':24,'yalign':0,'ypos':4.5,'xpos':0,'pagenum':1}" puPlayer.LabelNew pDMDText,"RampImg2",digitLCD, 4,RGB(255, 255, 255) ,0,0,0 ,0,38 ,1,0 ' Rampage Animation puPlayer.LabelNew pDMDText,"RampImg",digitLCD, 4,RGB(255, 255, 255) ,0,0,0 ,0,38 ,1,0 ' Rampage Countdown timer Image puPlayer.LabelSet pDMDText,"RampImg", "PuPOverlays\\Rampage.gif", 0,"{'mt':2,'color':111111,'width':15, 'height':24, 'anigif':100,'pagenum':1}" puPlayer.LabelNew pDMDText,"PopImg0",guardians, 4,RGB(255, 255, 255) ,0,0,0 ,0,38 ,1,0 ' PopBumper Image puPlayer.LabelSet pDMDText,"PopImg0", "PuPOverlays\\BumperPop.gif", 0,"{'mt':2,'color':111111,'ypos':40,'xpos':10,'width':15, 'height':24, 'anigif':100,'pagenum':1}" puPlayer.LabelNew pDMDText,"PopScore0",guardians, 7*FontScale,RGB(255, 255, 255) ,0,0,0 ,10,60 ,1,0 ' PopBumper Score puPlayer.LabelNew pDMDText,"PopImg1",guardians, 4,RGB(255, 255, 255) ,0,0,0 ,0,38 ,1,0 ' PopBumper Image puPlayer.LabelSet pDMDText,"PopImg1", "PuPOverlays\\BumperPop.gif", 0,"{'mt':2,'color':111111,'ypos':40,'xpos':10,'width':15, 'height':24, 'anigif':100,'pagenum':1}" puPlayer.LabelNew pDMDText,"PopScore1",guardians, 7*FontScale,RGB(255, 255, 255) ,0,0,0 ,20,50 ,1,0 ' PopBumper Score puPlayer.LabelNew pDMDText,"PopImg2",guardians, 4,RGB(255, 255, 255) ,0,0,0 ,0,38 ,1,0 ' PopBumper Image puPlayer.LabelSet pDMDText,"PopImg2", "PuPOverlays\\BumperPop.gif", 0,"{'mt':2,'color':111111,'ypos':40,'xpos':10,'width':15, 'height':24, 'anigif':100,'pagenum':1}" puPlayer.LabelNew pDMDText,"PopScore2",guardians, 7*FontScale,RGB(255, 255, 255) ,0,0,0 ,30,60 ,1,0 ' PopBumper Score puPlayer.LabelNew pDMDText,"PopImg3",guardians, 4,RGB(255, 255, 255) ,0,0,0 ,0,38 ,1,0 ' PopBumper Image puPlayer.LabelSet pDMDText,"PopImg3", "PuPOverlays\\BumperPop.gif", 0,"{'mt':2,'color':111111,'ypos':40,'xpos':10,'width':15, 'height':24, 'anigif':100,'pagenum':1}" puPlayer.LabelNew pDMDText,"PopScore3",guardians, 7*FontScale,RGB(255, 255, 255) ,0,0,0 ,40,50 ,1,0 ' PopBumper Score puPlayer.LabelNew pDMDText,"PopImg4",guardians, 4,RGB(255, 255, 255) ,0,0,0 ,0,38 ,1,0 ' PopBumper Image puPlayer.LabelSet pDMDText,"PopImg4", "PuPOverlays\\BumperPop.gif", 0,"{'mt':2,'color':111111,'ypos':40,'xpos':10,'width':15, 'height':24, 'anigif':100,'pagenum':1}" puPlayer.LabelNew pDMDText,"PopScore4",guardians, 7*FontScale,RGB(255, 255, 255) ,0,0,0 ,50,60 ,1,0 ' PopBumper Score puPlayer.LabelNew pDMDText,"PopImg5",guardians, 4,RGB(255, 255, 255) ,0,0,0 ,0,38 ,1,0 ' PopBumper Image puPlayer.LabelSet pDMDText,"PopImg5", "PuPOverlays\\BumperPop.gif", 0,"{'mt':2,'color':111111,'ypos':40,'xpos':10,'width':15, 'height':24, 'anigif':100,'pagenum':1}" puPlayer.LabelNew pDMDText,"PopScore5",guardians, 7*FontScale,RGB(255, 255, 255) ,0,0,0 ,60,50 ,1,0 ' PopBumper Score puPlayer.LabelNew pDMDText,"PopImg6",guardians, 4,RGB(255, 255, 255) ,0,0,0 ,0,38 ,1,0 ' PopBumper Image puPlayer.LabelSet pDMDText,"PopImg6", "PuPOverlays\\BumperPop.gif", 0,"{'mt':2,'color':111111,'ypos':40,'xpos':10,'width':15, 'height':24, 'anigif':100,'pagenum':1}" puPlayer.LabelNew pDMDText,"PopScore6",guardians, 7*FontScale,RGB(255, 255, 255) ,0,0,0 ,70,60 ,1,0 ' PopBumper Score puPlayer.LabelNew pDMDText,"PopImg7",guardians, 4,RGB(255, 255, 255) ,0,0,0 ,0,38 ,1,0 ' PopBumper Image puPlayer.LabelSet pDMDText,"PopImg7", "PuPOverlays\\BumperPop.gif", 0,"{'mt':2,'color':111111,'ypos':40,'xpos':10,'width':15, 'height':24, 'anigif':100,'pagenum':1}" puPlayer.LabelNew pDMDText,"PopScore7",guardians, 7*FontScale,RGB(255, 255, 255) ,0,0,0 ,80,50 ,1,0 ' PopBumper Score puPlayer.LabelNew pDMDText,"PopImg8",guardians, 4,RGB(255, 255, 255) ,0,0,0 ,0,38 ,1,0 ' PopBumper Image puPlayer.LabelSet pDMDText,"PopImg8", "PuPOverlays\\BumperPop.gif", 0,"{'mt':2,'color':111111,'ypos':40,'xpos':10,'width':15, 'height':24, 'anigif':100,'pagenum':1}" puPlayer.LabelNew pDMDText,"PopScore8",guardians, 7*FontScale,RGB(255, 255, 255) ,0,0,0 ,90,60 ,1,0 ' PopBumper Score puPlayer.LabelNew pDMDText,"AnimateShotMultBorder1",dmdscr, 7*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,0 ,1,1 puPlayer.LabelNew pDMDText,"AnimateShotMultBorder2",dmdscr, 7*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,0 ,1,1 puPlayer.LabelNew pDMDText,"AnimateShotMultBorder3",dmdscr, 7*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,0 ,1,1 puPlayer.LabelNew pDMDText,"AnimateShotMultL",dmdscr, 7*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,0 ,1,1 puPlayer.LabelNew pDMDText,"AnimateShotMultC",dmdscr, 7*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,0 ,1,1 puPlayer.LabelNew pDMDText,"AnimateShotMultR",dmdscr, 7*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,0 ,1,1 puPlayer.LabelNew pDMDText,"AnimateShotMultName",dmdscr, 7*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,0 ,1,1 puPlayer.LabelNew pDMDText,"Guardians2",dmdscr, 7*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,0 ,1,1 ' Image fills in Guardians as you spell it puPlayer.LabelNew pDMDText,"Guardians3a",dmdscr, 7*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,0 ,1,1 ' Image Border in Guardians as you spell it puPlayer.LabelNew pDMDText,"Guardians3b",dmdscr, 7*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,0 ,1,1 ' Image Border in Guardians as you spell it puPlayer.LabelNew pDMDText,"Guardians3c",dmdscr, 7*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,0 ,1,1 ' Image Border in Guardians as you spell it puPlayer.LabelNew pDMDText,"MessageT",dmdscr, 5*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,0 ,1,1 ' Top middle message for "Please select mission" puPlayer.LabelNew pDMDText,"Ball" ,dmdscr, 4*FontScale,RGB(255, 255, 255) ,0,2,0 ,0,0 ,1,1 puPlayer.LabelNew pDMDText,"Player" ,dmdscr, 4*FontScale,RGB(255, 255, 255) ,0,0,0 ,2,0 ,1,1 puPlayer.LabelNew pDMDText,"MTimer" ,dmdscr, 7*FontScale,RGB(255, 255, 255) ,0,2,0 ,75,13 ,1,1 ' Says 3/2X for XX Seconds puPlayer.LabelNew pDMDText,"Timer" ,guardians, 11*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,75 ,1,1 ' Used for the counddown on the hurry up puPlayer.LabelNew pDMDText,"Message" ,dmdscr, 18*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,65 ,1,1 ' Shows how many points we got on the hurry up timer puPlayer.LabelNew pDMDText,"Guardians",guardians, 20*FontScale,827358 ,0,1,0 ,0,45 ,1,1 ' Pops up letters when we spell GUARDIANS puPlayer.LabelNew pDMDText,"Rampage",guardians, 20*FontScale,255 ,0,1,0 ,0,45 ,1,1 ' Pops up letters when we spell RAMPAGE puPlayer.LabelNew pDMDText,"Popup1",guardians, 15*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,25 ,1,1 ' Pupup 3 Liner Messages puPlayer.LabelNew pDMDText,"Popup2",guardians, 18*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,40 ,1,1 ' Pupup 3 Liner Messages puPlayer.LabelNew pDMDText,"Popup3",guardians, 15*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,65 ,1,1 ' Pupup 3 Liner Messages puPlayer.LabelNew pDMDText,"CurScore",dmdscr, 15*FontScale,RGB(255, 255, 255) ,0,1,2 ,0,100 ,1,1 puPlayer.LabelNew pDMDText,"Play1score",dmdscr, 6*FontScale,RGB(255, 255, 255) ,0,1,2 ,0,100 ,1,1 ' Not using these yet since they move based on number of players puPlayer.LabelNew pDMDText,"Play2score",dmdscr, 6*FontScale,RGB(255, 255, 255) ,0,1,2 ,0,100 ,1,1 puPlayer.LabelNew pDMDText,"Play3score",dmdscr, 6*FontScale,RGB(255, 255, 255) ,0,1,2 ,0,100 ,1,1 puPlayer.LabelNew pDMDText,"Play4score",dmdscr, 6*FontScale,RGB(255, 255, 255) ,0,1,2 ,0,100 ,1,1 ' puPlayer.LabelNew pDMDText,"TimeLbl",dmdscr, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,5,5.2 ,1,1 ' Just has the word Timer puPlayer.LabelNew pDMDText,"Time",digitLCD, 8*FontScale,RGB(255, 255, 255) ,0,1,0 ,7,9.5 ,1,1 ' Shows remaining time puPlayer.LabelNew pDMDText,"MPx",guardians, 8*FontScale,111111 ,0,0,0 ,5,75 ,1,1 ' Shows show mulltipliers when it is > 1 puPlayer.LabelNew pDMDText,"RampTimer", dmdscr, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,3.5,46.5 ,1,1 ' Rampage Countdown timer ' ModeSelect Overlays 'puPlayer.LabelNew pDMDText,"PlayerSelect",dmdscr, 5*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,0 ,1,1 For i = 0 to 7 puPlayer.LabelNew pDMDText,"PlayerSelect" & i,dmdscr, 5*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,0 ,1,0 puPlayer.LabelSet pDMDText, "PlayerSelect" & i, "PuPOverlays\\Mode" & i & ".png", 0,"{'mt':2,'width':50, 'height':90,'xalign':1,'yalign':2,'ypos':100,'xpos':50,'zback':1}" Next puPlayer.LabelNew pDMDText,"ModeSelectLabel1",dmdscr, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,0,40 ,1,1 puPlayer.LabelNew pDMDText,"ModeSelectLabel2",dmdscr, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,0,45 ,1,1 puPlayer.LabelNew pDMDText,"ModeSelectLabel3",dmdscr, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,0,50 ,1,1 puPlayer.LabelNew pDMDText,"ModeSelectCir1",digitLCD, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,0,46 ,1,1 puPlayer.LabelNew pDMDText,"ModeSelectPic1",digitLCD, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,0,46 ,1,1 puPlayer.LabelNew pDMDText,"ModeSelectCir2",digitLCD, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,0,46 ,1,1 puPlayer.LabelNew pDMDText,"ModeSelectPic2",digitLCD, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,0,46 ,1,1 puPlayer.LabelNew pDMDText,"ModeSelectCir3",digitLCD, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,0,46 ,1,1 puPlayer.LabelNew pDMDText,"ModeSelectPic3",digitLCD, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,0,46 ,1,1 puPlayer.LabelNew pDMDText,"ModeSelectCir4",digitLCD, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,0,46 ,1,1 puPlayer.LabelNew pDMDText,"ModeSelectPic4",digitLCD, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,0,46 ,1,1 puPlayer.LabelNew pDMDText,"ModeSelectCir5",digitLCD, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,0,46 ,1,1 puPlayer.LabelNew pDMDText,"ModeSelectPic5",digitLCD, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,0,46 ,1,1 puPlayer.LabelNew pDMDText,"ModeSelectCir6",digitLCD, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,0,46 ,1,1 puPlayer.LabelNew pDMDText,"ModeSelectPic6",digitLCD, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,0,46 ,1,1 puPlayer.LabelNew pDMDText,"ModeSelectCir7",digitLCD, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,0,46 ,1,1 puPlayer.LabelNew pDMDText,"ModeSelectPic7",digitLCD, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,0,46 ,1,1 puPlayer.LabelNew pDMDText,"ModeSelectCir8",digitLCD, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,0,46 ,1,1 puPlayer.LabelNew pDMDText,"ModeSelectPic8",digitLCD, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,0,46 ,1,1 puPlayer.LabelNew pDMDText,"ScorbitQR", guardians, 1,RGB(247, 170, 51) ,0,2,0 ,0,0 ,1,1 puPlayer.LabelNew pDMDText,"ScorbitQRicon", guardians, 1,RGB(247, 170, 51) ,0,2,0 ,0,0 ,1,1 puPlayer.LabelSet pDMDText,"TimeLbl", "Timer" ,1,"" 'puPlayer.LabelSet pDMDText, "ModeProgress", "PuPOverlays\\Progress5-0.png",1,"{'mt':2,'color':111111,'width':17, 'height':24,'yalign':0,'ypos':4.5,'xpos':0,'pagenum':1}" puPlayer.LabelNew pDMDText,"ScoreText",dmdscr, 4,RGB(255, 255, 255) ,0,0,0 ,0,38 ,1,1 ' Animated Score Text puPlayer.LabelNew pDMDText,"ScoreTextT",dmdscr, 4,RGB(255, 255, 255) ,0,0,0 ,0,38 ,1,1 ' Animated Score Text puPlayer.LabelNew pDMDText,"ScoreText2",guardians, 4,RGB(255, 255, 255) ,0,0,0 ,0,38 ,1,1 ' Animated Score Text (Guardians Font) puPlayer.LabelNew pDMDText,"ScoreText2T",guardians, 4,RGB(255, 255, 255) ,0,0,0 ,0,38 ,1,1 ' Animated Score Text puPlayer.LabelNew pDMDText,"HighScore1",guardians, 15*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,25 ,2,1 ' Attract screen so when we show the Bonus we dont see all this info puPlayer.LabelNew pDMDText,"HighScore2",guardians, 15*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,45 ,2,1 ' Attract screen so when we show the Bonus we dont see all this info puPlayer.LabelNew pDMDText,"HighScore3",guardians, 15*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,75 ,2,1 ' Attract screen so when we show the Bonus we dont see all this info PuPlayer.LabelShowPage pDMDText, 2,0,"" ' PuPlayer.SendMSG "{ ""mt"":301, ""SN"": 8, ""FN"":6 }" ' Bring screen to the front PuPlayer.SendMSG "{ ""mt"":301, ""SN"": " & pDMDText & ", ""FN"":6 }" ' Bring screen to the front PuPlayer.LabelInit pTransp puPlayer.LabelNew pTransp,"ScoreAnimation",digitLCD, 4,RGB(255, 255, 255) ,0,0,0 ,0,38 ,1,1 ' Animated Score graphic PuPlayer.LabelShowPage pTransp,1,0,"" PuPlayer.SendMSG "{ ""mt"":301, ""SN"": " & pTransp &", ""FN"":22, ""AM"":1, ""AV"":80 }" ' Make Transparent 'PuPlayer.LabelShowPage pDMDText, 1,0,"" 'PuPlayer.LabelSet pDMDText, "Guardians2", "PuPOverlays\\GUARDIAN-1.png",1,"{'mt':2,'color':111111,'width':31, 'height':8,'yalign':0,'ypos':0.0,'xpos':50.4}" ' puPlayer.LabelNew pDMDText,"EnterHS1",guardians, 12*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,25 ,3,1 ' HS Entry ' puPlayer.LabelNew pDMDText,"EnterHS2",guardians, 15*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,45 ,3,1 ' HS Entry ' puPlayer.LabelNew pDMDText,"EnterHS3",guardians, 15*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,75 ,3,1 ' HS Entry puPlayer.LabelNew pDMDText,"EnterHS1",hsFont, 15*FontScale,RGB(237, 227, 46) ,0,1,1 ,0,20 ,3,1 ' HS Entry puPlayer.LabelNew pDMDText,"EnterHS2",hsFont, 16*FontScale,RGB(237, 227, 46) ,0,1,1 ,0,40 ,3,1 ' HS Entry for i = 1 to 11 puPlayer.LabelNew pDMDText,"EnterHS3" & i, monoFont,17*FontScale,RGB(119, 189, 14) ,0,0,1 ,20+(i*5),70 ,3,1 ' HS Entry puPlayer.LabelNew pDMDText,"EnterHSU3" & i, hsFont,17*FontScale,RGB(194, 194, 194) ,0,0,1 ,20+(i*5),70.1 ,3,1 ' HS Entry puPlayer.LabelSet pDMDText,"EnterHSU3" & i, " ", 1, "" Next puPlayer.LabelNew pDMDText,"EnterHS4",monoFont, 14*FontScale,RGB(119, 189, 14) ,0,0,1 ,0,88 ,3,1 ' HS Entry puPlayer.LabelNew pDMDText,"EnterHS4Sel",hsFont, 15*FontScale,RGB(194, 194, 194) ,0,1,1 ,0,88 ,3,1 ' HS Entry puPlayer.LabelSet pDMDText,"EnterHS4Sel", " ", 1, "" puPlayer.LabelNew pDMDText,"SceneMessage1",guardians, 15*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,25 ,1,1 ' puPlayer.LabelNew pDMDText,"SceneMessage2",guardians, 18*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,45 ,1,1 ' puPlayer.LabelNew pDMDText,"SceneMessage3",guardians, 15*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,65 ,1,1 ' ' Page 1 (UnderVideo) puPlayer.LabelInit pUnderVid puPlayer.LabelNew pUnderVid,"UnderMessage1",guardians, 15*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,25 ,1,1 ' puPlayer.LabelNew pUnderVid,"UnderMessage2",guardians, 18*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,45 ,1,1 ' puPlayer.LabelNew pUnderVid,"UnderMessage3",guardians, 15*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,65 ,1,1 ' ' Page 2 (UnderVideo - Immolation Progress) ' ------------------------------------------------------------------------- ' | ' | P0 P4 ' | P1 P5 ' | P2 PFace P6 ' | P3 P7 ' | pOrb PGroot ' | ' ------------------------------------------------------------------------- puPlayer.LabelNew pUnderVid,"P7",guardians, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,10,43 ,2,1 ' puPlayer.LabelNew pUnderVid,"P0",guardians, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,10,50 ,2,1 ' puPlayer.LabelNew pUnderVid,"P1",guardians, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,10,57 ,2,1 ' puPlayer.LabelNew pUnderVid,"P2",guardians, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,10,64 ,2,1 ' puPlayer.LabelNew pUnderVid,"POrb",guardians, 5*FontScale,RGB(255, 255, 255) ,0,0,0 ,10,71 ,2,1 ' puPlayer.LabelNew pUnderVid,"P6",guardians, 5*FontScale,RGB(255, 255, 255) ,0,2,0 ,90,43 ,2,1 ' puPlayer.LabelNew pUnderVid,"P5",guardians, 5*FontScale,RGB(255, 255, 255) ,0,2,0 ,90,50 ,2,1 ' puPlayer.LabelNew pUnderVid,"P4",guardians, 5*FontScale,RGB(255, 255, 255) ,0,2,0 ,90,57 ,2,1 ' puPlayer.LabelNew pUnderVid,"P3",guardians, 5*FontScale,RGB(255, 255, 255) ,0,2,0 ,90,64 ,2,1 ' puPlayer.LabelNew pUnderVid,"PGroot",guardians, 5*FontScale,RGB(255, 255, 255) ,0,2,0 ,90,71 ,2,1 ' puPlayer.LabelNew pUnderVid,"PFace",guardians, 5*FontScale,RGB(255, 255, 255) ,0,1,1 ,90,71 ,2,1 ' puPlayer.LabelNew pUnderVid,"PFaceCircle",guardians, 5*FontScale,RGB(255, 255, 255) ,0,1,1 ,90,71 ,2,1 ' ' Page 3 (OverVideo - Finish Mode) ' ------------------------------------------------------------------------- ' | ' | Scattered for Spinning finish ' | ' ------------------------------------------------------------------------- puPlayer.LabelNew pUnderVid,"F0",guardians, 5,RGB(255, 255, 255) ,0,0,0 ,0,0 ,3,1 ' puPlayer.LabelNew pUnderVid,"F1",guardians, 5,RGB(255, 255, 255) ,0,0,0 ,0,0 ,3,1 ' puPlayer.LabelNew pUnderVid,"F2",guardians, 5,RGB(255, 255, 255) ,0,0,0 ,0,0 ,3,1 ' puPlayer.LabelNew pUnderVid,"F3",guardians, 5,RGB(255, 255, 255) ,0,0,0 ,0,0 ,3,1 ' puPlayer.LabelNew pUnderVid,"F4",guardians, 5,RGB(255, 255, 255) ,0,0,0 ,0,0 ,3,1 ' puPlayer.LabelNew pUnderVid,"F5",guardians, 5,RGB(255, 255, 255) ,0,0,0 ,0,0 ,3,1 ' puPlayer.LabelNew pUnderVid,"F6",guardians, 5,RGB(255, 255, 255) ,0,0,0 ,0,0 ,3,1 ' puPlayer.LabelNew pUnderVid,"F7",guardians, 5,RGB(255, 255, 255) ,0,0,0 ,0,0 ,3,1 ' puPlayer.LabelNew pUnderVid,"F8",guardians, 5,RGB(255, 255, 255) ,0,0,0 ,0,0 ,3,1 ' puPlayer.LabelNew pUnderVid,"F9",guardians, 5,RGB(255, 255, 255) ,0,0,0 ,0,0 ,3,1 ' puPlayer.LabelNew pUnderVid,"txtMode",guardians, 5,RGB(255, 255, 255) ,0,0,0 ,0,0 ,3,1 ' puPlayer.LabelNew pUnderVid,"txtModeInfo1",guardians, 5,RGB(255, 255, 255) ,0,0,0 ,0,0 ,3,1 ' puPlayer.LabelNew pUnderVid,"txtModeInfo2",guardians, 5,RGB(255, 255, 255) ,0,0,0 ,0,0 ,3,1 ' puPlayer.LabelNew pUnderVid,"ModeBG1",guardians, 5,RGB(255, 255, 255) ,0,0,0 ,0,0 ,3,1 ' puPlayer.LabelNew pUnderVid,"ModeBG2",guardians, 5,RGB(255, 255, 255) ,0,0,0 ,0,0 ,3,1 ' ' Page 1 (OverVideo) puPlayer.LabelInit pOverVid puPlayer.LabelNew pOverVid,"OverMessage1",guardians, 15*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,25 ,1,1 ' puPlayer.LabelNew pOverVid,"OverMessage2",guardians, 18*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,45 ,1,1 ' puPlayer.LabelNew pOverVid,"OverMessage2a",guardians, 18*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,45 ,1,1 ' puPlayer.LabelNew pOverVid,"OverMessage3",guardians, 15*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,65 ,1,1 ' puPlayer.LabelNew pOverVid,"OverMessage4",guardians, 6*FontScale,RGB(255, 255, 255) ,0,2,2 ,0,0 ,1,1 ' puPlayer.LabelNew pOverVid,"Splash1", guardians, 10,RGB(255, 255, 255) ,0,1,1 ,0,0 ,1,1 puPlayer.LabelNew pOverVid,"Splash2", guardians, 10,RGB(255, 255, 255) ,0,1,1 ,0,0 ,1,1 puPlayer.LabelNew pOverVid,"Splash3", guardians, 10,RGB(255, 255, 255) ,0,1,1 ,0,0 ,1,1 puPlayer.LabelNew pOverVid,"Splash4", guardians, 10,RGB(255, 255, 255) ,0,1,1 ,0,0 ,1,1 puPlayer.LabelNew pOverVid,"SplashHS1", guardians, 10,RGB(255, 255, 255) ,0,1,1 ,0,0 ,1,1 puPlayer.LabelNew pOverVid,"SplashHS2", guardians, 10,RGB(255, 255, 255) ,0,1,1 ,0,0 ,1,1 puPlayer.LabelNew pOverVid,"SplashHS3", guardians, 10,RGB(255, 255, 255) ,0,1,1 ,0,0 ,1,1 puPlayer.LabelNew pOverVid,"SplashHS4", guardians, 10,RGB(255, 255, 255) ,0,1,1 ,0,0 ,1,1 puPlayer.LabelNew pOverVid,"SplashLogo",guardians, 10,RGB(255, 255, 255) ,0,1,1 ,0,0 ,1,1 puPlayer.LabelNew pOverVid,"ScorbitQR", guardians, 1,RGB(247, 170, 51) ,0,2,0 ,0,0 ,1,1 puPlayer.LabelNew pOverVid,"ScorbitQRIcon", guardians, 1,RGB(247, 170, 51) ,0,2,0 ,0,0 ,1,1 PuPlayer.LabelShowPage pOverVid, 1,0,"" ' Page 3 (Service) puPlayer.LabelNew pOverVid,"ServiceL1",serviceFont, 8*FontScale,RGB(252, 239, 3) ,0,1,0 ,0,1 ,3,1 puPlayer.LabelNew pOverVid,"ServiceL2",serviceFont, 8*FontScale,RGB(252, 239, 3) ,0,1,0 ,0,1 ,3,1 puPlayer.LabelNew pOverVid,"ServiceL3",serviceFont, 8*FontScale,RGB(252, 239, 3) ,0,1,0 ,0,1 ,3,1 puPlayer.LabelNew pOverVid,"ServiceL3B",serviceFont2, 20*FontScale,RGB(252, 239, 3) ,0,1,0 ,0,1 ,3,1 puPlayer.LabelNew pOverVid,"ServiceL3Img",serviceFont2, 1,RGB(252, 239, 3) ,0,1,0 ,0,1 ,3,1 puPlayer.LabelNew pOverVid,"ServiceL4",serviceFont, 8*FontScale,RGB(252, 239, 3) ,0,1,0 ,0,1 ,3,1 For i = 0 to 50 puPlayer.LabelNew pOverVid,"ServiceV"&i,serviceFont, 8*FontScale,RGB(252, 239, 3) ,0,1,0 ,0,1 ,3,1 Next ' Page 1 (Bonus) ' ------------------------------------------------------------------------- ' | MessageT ' | ' | ' | ' | Message1 ' | Message2 ' | ' ------------------------------------------------------------------------- ' puPlayer.LabelInit pBonusScreen ' puPlayer.LabelNew pBonusScreen,"Blade1" ,dmdscr, 18,RGB(255, 255, 255) ,0,0,0 ,0,0 ,1,1 ' Bonus Image ' puPlayer.LabelNew pBonusScreen,"Blade2" ,dmdscr, 18,RGB(255, 255, 255) ,0,2,0 ,0,0 ,1,1 ' Bonus Image puPlayer.LabelNew pBonusScreen,"Bonus1" ,dmdscr, 18,RGB(255, 255, 255) ,0,0,0 ,0,0 ,1,1 ' Bonus Image puPlayer.LabelNew pBonusScreen,"Bonus2" ,dmdscr, 18,RGB(255, 255, 255) ,0,0,0 ,0,0 ,1,1 ' Bonus Image puPlayer.LabelNew pBonusScreen,"Bonus3" ,dmdscr, 18,RGB(255, 255, 255) ,0,0,0 ,0,0 ,1,1 ' Bonus Image puPlayer.LabelNew pBonusScreen,"Bonus4" ,dmdscr, 18,RGB(255, 255, 255) ,0,0,0 ,0,0 ,1,1 ' Bonus Image puPlayer.LabelNew pBonusScreen,"Bonus5" ,dmdscr, 18,RGB(255, 255, 255) ,0,0,0 ,0,0 ,1,1 ' Bonus Image puPlayer.LabelNew pBonusScreen,"Bonus6" ,dmdscr, 18,RGB(255, 255, 255) ,0,0,0 ,0,0 ,1,1 ' Bonus Image puPlayer.LabelNew pBonusScreen,"Bonus7" ,dmdscr, 18,RGB(255, 255, 255) ,0,0,0 ,0,0 ,1,1 ' Bonus Image puPlayer.LabelNew pBonusScreen,"Bonus8" ,dmdscr, 18,RGB(255, 255, 255) ,0,0,0 ,0,0 ,1,1 ' Bonus Image puPlayer.LabelNew pBonusScreen,"Bonus9" ,dmdscr, 18,RGB(255, 255, 255) ,0,0,0 ,0,0 ,1,1 ' Bonus Image puPlayer.LabelNew pBonusScreen,"Message1" ,guardians, 14*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,65 ,1,1 ' Shows the Bonus puPlayer.LabelNew pBonusScreen,"Message2" ,guardians, 18*FontScale,RGB(255, 255, 255) ,0,1,0 ,0,79 ,1,1 ' Shows the bonus 2nd line PuPlayer.LabelShowPage pBonusScreen,1,0,"" ' Testing Blades: 'TBD: Trying to Animate these but cant seem to animate and resize ' pDMDEvent(kDMD_BonusBG) ' playmedia "Video-0x007A-2.mp4", "PupVideos", pBonusScreen, "", -1, "", 1, 1 ' PuPlayer.LabelSet pBonusScreen, "Blade1", "PuPOverlays\\BonusScreen-BW-Blade1.png",1,"{'mt':2,'color':111111,'width':99.5, 'height':95,'yalign':0,'ypos':50.5,'xpos':0}" ' PuPlayer.LabelSet pBonusScreen, "Blade1", "PuPOverlays\\BonusScreen-BW-Blade1.png",1,"{'mt':1,'at':2,'xps':-1,'xpe':0,'len':2000,'mlen':2000}" ' PuPlayer.LabelSet pBonusScreen, "Blade2", "PuPOverlays\\BonusScreen-BW-Blade2.png",1,"{'mt':2,'color':111111,'width':99.5, 'height':95,'yalign':0,'ypos':2.8,'xpos':0}" ' PuPlayer.LabelSet pBonusScreen, "Bonus1", "PuPOverlays\\Bonus1.png",1,"{'mt':2,'color':111111,'width':18.5, 'height':48.8,'yalign':0,'ypos':10.5,'xpos':3}" ' PuPlayer.LabelSet pBonusScreen, "Bonus2", "PuPOverlays\\Bonus2.png",1,"{'mt':2,'color':111111,'width':18.5, 'height':48.8,'yalign':0,'ypos':10.5,'xpos':13}" ' PuPlayer.LabelSet pBonusScreen, "Bonus3", "PuPOverlays\\Bonus3.png",1,"{'mt':2,'color':111111,'width':18.5, 'height':48.8,'yalign':0,'ypos':10.5,'xpos':22.5}" ' PuPlayer.LabelSet pBonusScreen, "Bonus4", "PuPOverlays\\Bonus4.png",1,"{'mt':2,'color':111111,'width':18.5, 'height':48.8,'yalign':0,'ypos':10.5,'xpos':31.5}" ' PuPlayer.LabelSet pBonusScreen, "Bonus5", "PuPOverlays\\Bonus5.png",1,"{'mt':2,'color':111111,'width':18.5, 'height':48.8,'yalign':0,'ypos':10.5,'xpos':40.5}" ' PuPlayer.LabelSet pBonusScreen, "Bonus6", "PuPOverlays\\Bonus6.png",1,"{'mt':2,'color':111111,'width':18.5, 'height':48.8,'yalign':0,'ypos':10.5,'xpos':50}" ' PuPlayer.LabelSet pBonusScreen, "Bonus7", "PuPOverlays\\Bonus7.png",1,"{'mt':2,'color':111111,'width':18.5, 'height':48.8,'yalign':0,'ypos':10.5,'xpos':59.5}" ' PuPlayer.LabelSet pBonusScreen, "Bonus8", "PuPOverlays\\Bonus8.png",1,"{'mt':2,'color':111111,'width':18.5, 'height':48.8,'yalign':0,'ypos':10.5,'xpos':68.2}" ' PuPlayer.LabelSet pBonusScreen, "Bonus9", "PuPOverlays\\Bonus9.png",1,"{'mt':2,'color':111111,'width':18.5, 'height':48.8,'yalign':0,'ypos':10.5,'xpos':78}" if PuPDMDDriverType=pDMDTypeReal Then 'using RealDMD Mirroring. ********** 128x32 Real Color DMD dmdalt="PKMN Pinball" dmdfixed="Instruction" dmdscr="Impact" 'main scorefont dmddef="Gameplay" ' Player Balls ' SCORE ' ' Switch Credits 'Page 1 (default score display) ' Scrn LblName Fnt Size Color R AxAy X Y pagenum Visible PuPlayer.LabelNew pDMD,"Player" ,dmddef,21*FontScaleDmd ,RGB(3, 57, 252) ,1,0,0, 0,0, 1, 0 PuPlayer.LabelNew pDMD,"Ball" ,dmddef,21*FontScaleDmd ,RGB(3, 57, 252) ,1,2,0, 0,0, 1, 0 PuPlayer.LabelNew pDMD,"CurScore",dmdscr,50*FontScaleDmd ,RGB(255, 255, 255),0,1,2, 0,68, 1, 0 PuPlayer.LabelNew pDMD,"Status" ,dmddef,30*FontScaleDmd ,RGB(255, 255, 255) ,0,0,2, 0,0, 1, 0 PuPlayer.LabelNew pDMD,"Credits" ,dmddef,21*FontScaleDmd ,RGB(3, 57, 252) ,0,2,2, 0,0, 1, 0 ' ' Scrn LblName Fnt Size Color R AxAy X Y pagenum Visible ' PuPlayer.LabelNew pDMD,"Credits" ,dmddef,20 ,33023 ,0,2,2,95,0, 1, 0 ' PuPlayer.LabelNew pDMD,"Play1" ,dmdalt,21 ,33023 ,1,0,0,15,0, 1, 0 ' PuPlayer.LabelNew pDMD,"Ball" ,dmdalt,21 ,33023 ,1,2,0,85,0, 1, 0 ' PuPlayer.LabelNew pDMD,"MsgScore",dmddef,45 ,33023 ,0,1,0, 0,40, 1, 0 ' PuPlayer.LabelNew pDMD,"CurScore",dmdscr,60 ,8454143,0,1,1, 0,0, 1, 0 'Page 2 (default Text Splash 1 Big Line) PuPlayer.LabelNew pDMD,"Splash" ,dmdalt,40*FontScaleDmd,33023,0,1,1,0,0,2,0 'Page 3 (default Text Splash 2 and 3 Lines) PuPlayer.LabelNew pDMD,"Splash3a",dmddef,30*FontScaleDmd,8454143,0,1,0,0,2,3,0 PuPlayer.LabelNew pDMD,"Splash3b",dmdalt,30*FontScaleDmd,33023,0,1,0,0,30,3,0 PuPlayer.LabelNew pDMD,"Splash3c",dmdalt,25*FontScaleDmd,33023,0,1,0,0,55,3,0 'Page 4 (2 Line Gameplay DMD) PuPlayer.LabelNew pDMD,"Splash4a",dmddef,40*FontScaleDmd,8454143,0,1,0,0,0,4,0 PuPlayer.LabelNew pDMD,"Splash4b",dmddef,30*FontScaleDmd,33023,0,1,2,0,75,4,0 'Page 5 (3 layer large text for overlay targets function, must you fixed width font! PuPlayer.LabelNew pDMD,"Back5" ,dmdfixed,80*FontScaleDmd,8421504,0,1,1,0,0,5,0 PuPlayer.LabelNew pDMD,"Middle5" ,dmdfixed,80*FontScaleDmd,65535 ,0,1,1,0,0,5,0 PuPlayer.LabelNew pDMD,"Flash5" ,dmdfixed,80*FontScaleDmd,65535 ,0,1,1,0,0,5,0 'Page 6 (3 Lines for big # with two lines, "19^Orbits^Count") PuPlayer.LabelNew pDMD,"Splash6a",dmddef,90*FontScaleDmd,65280,0,0,0,15,1,6,0 PuPlayer.LabelNew pDMD,"Splash6b",dmddef,50*FontScaleDmd,33023,0,1,0,60,0,6,0 PuPlayer.LabelNew pDMD,"Splash6c",dmddef,40*FontScaleDmd,33023,0,1,0,60,50,6,0 'Page 7 (Show High Scores Fixed Fonts) PuPlayer.LabelNew pDMD,"Splash7a",dmddef,20*FontScaleDmd,8454143,0,1,0,0,2,7,0 PuPlayer.LabelNew pDMD,"Splash7b",dmdfixed,40*FontScaleDmd,33023,0,1,0,0,20,7,0 PuPlayer.LabelNew pDMD,"Splash7c",dmdfixed,40*FontScaleDmd,33023,0,1,0,0,50,7,0 END IF ' use PuPDMDDriver if PuPDMDDriverType=pDMDTypeLCD THEN 'Using 4:1 Standard ratio LCD PuPDMD ************ lcd ************** 'dmddef="Impact" dmdalt="PKMN Pinball" dmdfixed="Instruction" dmdscr="Impact" 'main score font dmddef="Impact" 'Page 1 (default score display) ' Scrn LblName Fnt Size Color R AxAy X Y pagenum Visible PuPlayer.LabelNew pDMD,"Player" ,dmddef,21*FontScaleDmd ,RGB(3, 57, 252) ,1,0,0, 0,0, 1, 0 PuPlayer.LabelNew pDMD,"Ball" ,dmddef,21*FontScaleDmd ,RGB(3, 57, 252) ,1,2,0, 0,0, 1, 0 PuPlayer.LabelNew pDMD,"CurScore",dmdscr,50*FontScaleDmd ,RGB(255, 255, 255),0,1,2, 0,60, 1, 0 PuPlayer.LabelNew pDMD,"Status" ,dmddef,30*FontScaleDmd ,RGB(255, 255, 255) ,0,0,2, 0,0, 1, 0 PuPlayer.LabelNew pDMD,"Credits" ,dmddef,21*FontScaleDmd ,RGB(3, 57, 252) ,0,2,2, 0,0, 1, 0 'Page 2 (default Text Splash 1 Big Line) PuPlayer.LabelNew pDMD,"Splash" ,dmdalt,40*FontScaleDmd,33023,0,1,1,0,0,2,0 'Page 3 (default Text 3 Lines) PuPlayer.LabelNew pDMD,"Splash3a",dmddef,30*FontScaleDmd,8454143,0,1,0,0,2,3,0 PuPlayer.LabelNew pDMD,"Splash3b",dmdalt,30*FontScaleDmd,33023,0,1,0,0,30,3,0 PuPlayer.LabelNew pDMD,"Splash3c",dmdalt,25*FontScaleDmd,33023,0,1,0,0,57,3,0 'Page 4 (default Text 2 Line) PuPlayer.LabelNew pDMD,"Splash4a",dmddef,40*FontScaleDmd,8454143,0,1,0,0,0,4,0 PuPlayer.LabelNew pDMD,"Splash4b",dmddef,30*FontScaleDmd,33023,0,1,2,0,75,4,0 'Page 5 (3 layer large text for overlay targets function, must you fixed width font! PuPlayer.LabelNew pDMD,"Back5" ,dmdfixed,80*FontScaleDmd,8421504,0,1,1,0,0,5,0 PuPlayer.LabelNew pDMD,"Middle5" ,dmdfixed,80*FontScaleDmd,65535 ,0,1,1,0,0,5,0 PuPlayer.LabelNew pDMD,"Flash5" ,dmdfixed,80*FontScaleDmd,65535 ,0,1,1,0,0,5,0 'Page 6 (3 Lines for big # with two lines, "19^Orbits^Count") PuPlayer.LabelNew pDMD,"Splash6a",dmddef,90*FontScaleDmd,65280,0,0,0,15,1,6,0 PuPlayer.LabelNew pDMD,"Splash6b",dmddef,50*FontScaleDmd,33023,0,1,0,60,0,6,0 PuPlayer.LabelNew pDMD,"Splash6c",dmddef,40*FontScaleDmd,33023,0,1,0,60,50,6,0 'Page 7 (Show High Scores Fixed Fonts) PuPlayer.LabelNew pDMD,"Splash7a",dmddef,20*FontScaleDmd,8454143,0,1,0,0,2,7,0 PuPlayer.LabelNew pDMD,"Splash7b",dmdfixed,40*FontScaleDmd,33023,0,1,0,0,20,7,0 PuPlayer.LabelNew pDMD,"Splash7c",dmdfixed,40*FontScaleDmd,33023,0,1,0,0,50,7,0 END IF ' use PuPDMDDriver if PuPDMDDriverType=pDMDTypeFULL THEN 'Using FULL BIG LCD PuPDMD ************ lcd ************** 'dmddef="Impact" dmdalt="PKMN Pinball" dmdfixed="Instruction" dmdscr="Impact" 'main score font dmddef="Impact" 'Page 1 (default score display) ' Scrn LblName Fnt Size Color R AxAy X Y pagenum Visible PuPlayer.LabelNew pDMD,"Player" ,dmddef,21*FontScaleDmd ,RGB(3, 57, 252) ,1,0,0, 0,0, 1, 0 PuPlayer.LabelNew pDMD,"Ball" ,dmddef,21*FontScaleDmd ,RGB(3, 57, 252) ,1,2,0, 0,0, 1, 0 PuPlayer.LabelNew pDMD,"CurScore",dmdscr,50*FontScaleDmd ,RGB(255, 255, 255),0,1,2, 0,60, 1, 0 PuPlayer.LabelNew pDMD,"Status" ,dmddef,30*FontScaleDmd ,RGB(255, 255, 255) ,0,0,2, 0,0, 1, 0 PuPlayer.LabelNew pDMD,"Credits" ,dmddef,21*FontScaleDmd ,RGB(3, 57, 252) ,0,2,2, 0,0, 1, 0 'Page 2 (default Text Splash 1 Big Line) PuPlayer.LabelNew pDMD,"Splash" ,dmdalt,40*FontScaleDmd,33023,0,1,1,0,0,2,0 'Page 3 (default Text 3 Lines) PuPlayer.LabelNew pDMD,"Splash3a",dmddef,30*FontScaleDmd,8454143,0,1,0,0,2,3,0 PuPlayer.LabelNew pDMD,"Splash3b",dmdalt,30*FontScaleDmd,33023,0,1,0,0,30,3,0 PuPlayer.LabelNew pDMD,"Splash3c",dmdalt,25*FontScaleDmd,33023,0,1,0,0,57,3,0 'Page 4 (default Text 2 Line) PuPlayer.LabelNew pDMD,"Splash4a",dmddef,40*FontScaleDmd,8454143,0,1,0,0,0,4,0 PuPlayer.LabelNew pDMD,"Splash4b",dmddef,30*FontScaleDmd,33023,0,1,2,0,75,4,0 'Page 5 (3 layer large text for overlay targets function, must you fixed width font! PuPlayer.LabelNew pDMD,"Back5" ,dmdfixed,80*FontScaleDmd,8421504,0,1,1,0,0,5,0 PuPlayer.LabelNew pDMD,"Middle5" ,dmdfixed,80*FontScaleDmd,65535 ,0,1,1,0,0,5,0 PuPlayer.LabelNew pDMD,"Flash5" ,dmdfixed,80*FontScaleDmd,65535 ,0,1,1,0,0,5,0 'Page 6 (3 Lines for big # with two lines, "19^Orbits^Count") PuPlayer.LabelNew pDMD,"Splash6a",dmddef,90*FontScaleDmd,65280,0,0,0,15,1,6,0 PuPlayer.LabelNew pDMD,"Splash6b",dmddef,50*FontScaleDmd,33023,0,1,0,60,0,6,0 PuPlayer.LabelNew pDMD,"Splash6c",dmddef,40*FontScaleDmd,33023,0,1,0,60,50,6,0 'Page 7 (Show High Scores Fixed Fonts) PuPlayer.LabelNew pDMD,"Splash7a",dmddef,20*FontScaleDmd,8454143,0,1,0,0,2,7,0 PuPlayer.LabelNew pDMD,"Splash7b",dmdfixed,40*FontScaleDmd,33023,0,1,0,0,20,7,0 PuPlayer.LabelNew pDMD,"Splash7c",dmdfixed,40*FontScaleDmd,33023,0,1,0,0,50,7,0 END IF ' use PuPDMDDriver end Sub 'page Layouts '***************************************************************** ' PUPDMD Custom SUBS/Events for each Table1 ' ********** MODIFY THIS SECTION!!! *************** '***************************************************************** ' ' ' we need to somewhere in code if applicable ' ' call pDMDStartGame,pDMDStartBall,pGameOver,pAttractStart ' ' ' ' ' Background base const kDMD_Attract =454 const kDMD_PlayerSelect =455 const kDMD_PlayerMode =456 const kDMD_PlayerMode2 =457 const kDMD_BonusBG =460 ' Shows all the characters in Vertical bars and scrolls through their bonus const kDMD_Bonus1 =461 const kDMD_Bonus2 =462 const kDMD_Bonus3 =463 const kDMD_Bonus4 =464 const kDMD_Bonus5 =465 const kDMD_Bonus6 =466 const kDMD_Bonus7 =467 const kDMD_Bonus8 =468 const kDMD_Bonus9 =469 const kDMD_BonusClear =470 '' Background videos 'const kDMD_BGAntiquities =471 'const kDMD_BGSibling =472 '0x81 'const kDMD_BGEscapeKyln =473 'Video-0x0096 'const kDMD_BGKnowhere =474 'const kDMD_BGQuillsQuest =475 'const kDMD_BGYakaArrow =476 'const kDMD_BGSanctuary =477 'const kDMD_BGPodChase =478 'const kDMD_BGThanos =479 'const kDMD_BGCherryBomb =480 ' 'const kDMD_BGImmolation =481 ' 'const kDMD_BGXandar =482 ' Video-0x0059 '' Background video wait (Waiting for you to hit the Ball) 'const kDMD_WBGAntiquities =483 'const kDMD_WBGSibling =484 ' 'const kDMD_WBGEscapeKyln =485 'Video-0x000E.mp4 'const kDMD_WBGKnowhere =486 'const kDMD_WBGQuillsQuest =487 'const kDMD_WBGYakaArrow =488 'const kDMD_WBGSanctuary =489 'const kDMD_WBGPodChase =490 ' Multiball/Lost Ball const kDMD_BallLost =500 const kDMD_GrootBallLock1 =501 ' Video-0x0061 (3.00 seconds) const kDMD_GrootBallLock2 =502 ' Video-0x009E (3.17 seconds) const kDMD_GrootBallLock3 =503 ' Video-0x0006 (3.67 seconds) const kDMD_GrootBallLock4 =504 ' This really doesnt exist because it starts MB const kDMD_GrootMultiball =505 ' Long: Video-0x00B0 Short:Video-0x0084.mp4 const kDMD_OrbLock1 =506 const kDMD_OrbLock2 =507 const kDMD_OrbLock3 =508 const kDMD_OrbMultiball =509 '' Once you sart a level it shows the MODE_Start video 'const kDMD_StartAntiquities =510 'const kDMD_StartSibling =511 '0x81 'const kDMD_StartEscapeKyln =512 '0x96 'const kDMD_StartKnowhere =513 'const kDMD_StartQuillsQuest =514 'const kDMD_StartYakaArrow =515 'const kDMD_StartSanctuary =516 'const kDMD_StartPodChase =517 'const kDMD_StartThanos =518 ' Each Character slides onto the screen and stays there ' In Out Wait const kDMD_SelAntiquities =520 ' Video-0x0066 Video-0x0042 Video-0x0036 const kDMD_SelSibling =521 ' Video-0x0027 Video-0x0094 Video-0x0077 const kDMD_SelEscapeKyln =522 ' Video-0x001C Video-0x0014 Video-0x0025 const kDMD_SelKnowhere =523 ' Video-0x0041 Video-0x0056 Video-0x001A const kDMD_SelQuillsQuest =524 ' Video-0x000A Video-0x0097 Video-0x005D const kDMD_SelYakaArrow =525 ' Video-0x0068 Video-0x002C Video-0x0063 const kDMD_SelSanctuary =526 ' Video-0x0039 Video-0x0018 const kDMD_SelPodChase =527 ' Video-0x0013 Video-0x003F Video-0x0070 ' Special Modes const kDMD_SaveXandarFinal =530 ' Video-0x0091 (5.40 seconds) const kDMD_SaveXandar =531 ' Video-0x0034 (4.00 seconds) const kDMD_HadronIsQualified=532 const kDMD_Start2nd =533 const kDMD_StartCherryBomb =534 const kDMD_StartImmolation =535 ' Video-0x0079 <- I think + Video-0x0064 const kDMD_ImmProgress =536 ' Video-0x00A1 (8.04 seconds) const kDMD_2MoreToLightSave =540 const kDMD_ExtraBallIsLit =541 const kDMD_HadronIsLit =542 const kDMD_ExtraBall =543 ' 0x40 const kDMD_GrootLockIsLit =544 ' Video-0x0076 (3.03 seconds) const kDMD_BallSaveIsLit =545 ' Video-0x002F const kDMD_BallSave =546 ' 0x0C const kDMD_1MoreToLightLock =547 const kDMD_2MoreToLightLock =548 const kDMD_EndOfBall =549 ' 0x7A const kDMD_1MoreToLightOrb =550 ' Video-0x006D const kDMD_2MoreToLightOrb =551 ' Video-0x009C const kDMD_3MoreToLightOrb =552 ' Video-0x007E const kDMD_4MoreToLightOrb =553 ' Video-0x0050 const kDMD_5MoreToLightOrb =554 ' Video-0x0038 const kDMD_Orb1Collected =555 ' Video-0x00AF const kDMD_Orb2Collected =556 ' Video-0x002A const kDMD_Orb3Collected =557 ' Video-0x008F const kDMD_Orb4Collected =558 ' Video-0x0030 const kDMD_Orb5Collected =559 ' Video-0x0003 const kDMD_OrbOpened =560 ' Video-0x0083 const kDMD_OrbIsLit =561 ' Video-0x008D const kDMD_Special1 =565 const kDMD_Special2 =566 const kDMD_Token =567 const kDMD_Upgrade =568 const kDMD_Radio =569 const kDMD_UseHadron =570 ' Draws pink arrows across the screen ' Misc const kDMD_SkillShot1 =580 const kDMD_ShootAgain =581 ' Video-0x007F const kDMD_BallSaveAwarded =582 ' Video-0x0087.mp4 ' 2nd Modes const kDMD_2StartAntiquities=590 ' Video-0x0005.mp4 const kDMD_2StartSibling =591 const kDMD_2StartEscapeKyln =592 ' Video-0x003A.mp4 const kDMD_2StartKnowhere =593 const kDMD_2StartQuillsQuest=594 const kDMD_2StartYakaArrow =595 ' Video-0x00AA.mp4 const kDMD_2StartSanctuary =596 ' Video-0x00B2.mp4 const kDMD_2StartPodChase =597 ' Video-0x0043.mp4 const kDMD_2StartThanos =598 const kDMD_Myst_IsLit =599 ' Video-0x0032.mp4 const kDMD_Myst_MAX =624 '- Bonus Mysteries Dont Count const kDMD_Myst_Rampage =600 const kDMD_Myst_RampageA =601 const kDMD_Myst_RampageP =602 const kDMD_Myst_RampageM =603 const kDMD_Myst_AddABall =604 '0x00A9.mp4 const kDMD_Myst_10Million =605 const kDMD_Myst_SpecialLit =606 const kDMD_Myst_ShotMult =607 const kDMD_Myst_Orb1 =608 const kDMD_Myst_2Million =609 const kDMD_Myst_BonusHold =610 '0x003D.mp4 const kDMD_Myst_IncreasePopB=611 const kDMD_Myst_RampageR =612 const kDMD_Myst_BonusXHold =613 '0x006E.mp4 const kDMD_Myst_HadronLit =614 const kDMD_Myst_RampageG =615 const kDMD_Myst_RampageE =616 const kDMD_Myst_OrbIsLit =617 ' const kDMD_Myst_HPhoneHurry =618 '0x0021.mp4 const kDMD_Myst_20Million =619 '0x23 const kDMD_Myst_ExtraBallLit=620 '0x0058.mp4 const kDMD_Myst_BallSaveLit =621 '0x004C.mp4 const kDMD_Myst_BonusMultiplier=624 'Increments the bonus multiplier (KEEP THIS AT THE END) const kDMD_Myst_Bonus2x =625 '0x007D.mp4 const kDMD_Myst_Bonus3x =626 '0x0057.mp4 const kDMD_Myst_Bonus4x =627 '0x008B.mp4 const kDMD_Myst_Bonus5x =628 '0x0046.mp4 const kDMD_Myst_Bonus6x =629 '0x0089.mp4 const kDMD_Myst_Bonus7x =630 '0x00B4.mp4 const kDMD_Myst_Bonus8x =631 '0x0022.mp4 const kDMD_Myst_Bonus9x =632 '0x0055.mp4 const kDMD_Myst_Bonus10x =633 '0x0072.mp4 Sub pDMDStartGame Dim fsize fsize=10*FontScale if bUsePUPDMD then debug.print "STOP ATTRACT" pInAttract=false if pDMDVideoPlaying Then PuPlayer.playstop pDMD pDMDVideoPlaying=False End if ' Clear the overvideo just in case it is playing playclear pOverVid PuPlayer.LabelSet pOverVid, "ScorbitQR", "PuPOverlays\\clear.png",0,"" PuPlayer.LabelSet pOverVid, "ScorbitQRIcon", "PuPOverlays\\clear.png",0,"" PuPlayer.LabelSet pOverVid,"OverMessage1","",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2","",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2a","",1,"" PuPlayer.LabelSet pOverVid,"OverMessage3", "", 1, "{'mt':2,'color':"&RGB(255, 255, 255)&", 'size': "&fsize&",'ypos': 65}" PuPlayer.LabelSet pOverVid,"OverMessage4","",1,"" PuPlayer.LabelSet pOverVid,"SplashLogo","PupOverlays\\PinCredibles.png", 0,"" PuPlayer.LabelSet pOverVid, "Splash1", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "Splash2", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "Splash3", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" PuPlayer.LabelSet pOverVid, "Splash4", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" PuPlayer.LabelSet pOverVid, "SplashHS1", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "SplashHS2", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "SplashHS3", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" PuPlayer.LabelSet pOverVid, "SplashHS4", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" 'PuPlayer.LabelSet pDMDText,"HighScore3","",1,"" pDMDSetPage(pScores) 'set blank text overlay page. end If end Sub 'Dim bBGPlayingVideo:bBGPlayingVideo=False 'Sub pBGPlayVideo(VideoName, length) 'debug.print "Starting BG Video" ' PauseSong() ' bBGPlayingVideo=True ' dim pPriority:pPriority=1 ' PuPlayer.playlistplayex pDMDText,"PuPVideos",VideoName, 100, pPriority 'should be an attract background (no text is displayed) ' PuPlayer.SetBackGround pDMDText, 1 ' if length <> -1 then ' Mode video, we just play until the timer runs out and call stop (Visually looks better) ' tmrBGVideo.Interval = length ' tmrBGVideo.Enabled = True ' End If 'End sub ' 'Sub tmrBGVideo_Timer() ' tmrBGVideo.Enabled = False ' pBGPlayVideoDone() 'End Sub ' 'Sub pBGPauseVideo() ' 'End Sub ' 'Sub pBGPlayVideoDone() 'debug.print "Stopping BG Video" ' PuPlayer.SetBackGround pDMDText, 0 ' bBGPlayingVideo=False ' pDMDEvent(kDMD_PlayerMode) ' PlaySong "" 'End Sub ' Sub pBGPlayerSelect if bUsePUPDMD then ' Guard: prevent double-fire on audio screen 14 causing VLC invalid pointer crash if Not bAudioScreen14Busy then bAudioScreen14Busy = True vpmtimer.addtimer 1500, "bAudioScreen14Busy = False '" playclear pAudio playmedia "m_wait3.mp3", MusicDir, pAudio, "", -1, "", 1, 1 End If PuPlayer.LabelShowPage pDMDText,1,0,"" PuPlayer.LabelSet pDMDText, "Guardians2", "",0,"" puPlayer.LabelSet pDMDText,"TimeLbl", "Timer" ,1,"" puPlayer.LabelSet pDMDText,"Timer", "" ,1,"" ' Clear timer text since queues updating this can leave it hanging pDMDEvent(kDMD_PlayerSelect) 'bFlashing = True puPlayer.LabelSet pDMDText,"MessageT","SELECT YOUR MISSION" ,1,"{'mt':2,'shadowcolor':" & RGB(249,220,248) & ", 'shadowstate': 1, 'xoffset': 1, 'yoffset': 1, 'outline':1}" puPlayer.LabelSet pDMDText,"MessageT","SELECT YOUR MISSION" ,1,"{'mt':1,'at':1,'fq':250,'len':20000}" End If End Sub ' "c:\PinballX\ffmpeg.exe" -loop 1 -i BonusScreen-2.png -c:v libx264 -t 8 -pix_fmt yuv420p -vf scale=1920:1080 BonusScreen-2.mp4 ' ffmpeg -r 60 -f image2 -s 1920x1080 -i BonusScreen-2.png -vcodec libx264 -crf 25 -pix_fmt yuv420p -vf scale=1920:1080 BonusScreen-2.mp4 ' ffmpeg -r 60 -f image2 -s 1920x1080 -i BonusScreen-2.png -i clear.mp3 -vcodec libx264 -crf 25 -pix_fmt yuv420p -vf scale=1920:1080 -strict -1 -acodec copy BonusScreen-2.mp4 'ffmpeg -r 30 -f image2 -s 1920x1080 -i BonusScreen-2.png -i clear2.mp3 -vcodec libx264 -crf 25 -b 4M -pix_fmt yuv420p -vf scale=1920:1080 -acodec copy BonusScreen-2.mp4 ' Must have contrained baseline ' ffmpeg -r 30 -s 1920x1080 -i BonusScreen-2.png -i clear.mp3 -vcodec libx264 -crf 25 -b 4M -pix_fmt yuv420p -vf scale=1920:1080 -profile:v baseline -metadata:s:v:0 language=eng -metadata:s:a:0 language=eng -acodec copy BonusScreen-2.mp4 'GOOD MP4 ffmpeg -r 30 -s 1920x1080 -i BonusScreen-2.png -vcodec libx264 -crf 25 -b 4M -pix_fmt yuv420p -vf scale=1920:1080 -profile:v baseline BonusScreen-2.mp4 'GOOD WEBM ffmpeg -i BonusScreen-2.png -c:v libvpx -pix_fmt yuva420p -b:v 1M -auto-alt-ref 0 BonusScreen-2.webm ' NOTE: need transparency on the Screen to make this work Sub pBGGamePlay if bUsePUPDMD then 'bFlashing = False PuPlayer.LabelShowPage pDMDText,1,0,"" PuPlayer.LabelSet pDMDText, "Guardians2", "PuPOverlays\\GUARDIAN-"&SpellGuardians&".png",1,"{'mt':2,'color':111111,'width':31, 'height':8,'yalign':0,'ypos':0.0,'xpos':50.4}" puPlayer.LabelSet pDMDText,"TimeLbl", "Timer" ,1,"" pDMDEvent(kDMD_PlayerMode) puPlayer.LabelSet pDMDText,"MessageT","",1,"" End If End Sub Sub pBGCutScene if bUsePUPDMD then End If End Sub Sub pBgShowBonus(Message1, Message2) if bUsePUPDMD then debug.print "Showing Bonus: " & Message1 & " - " & Message2 PuPlayer.LabelSet pBonusScreen,"Message1", Message1 ,1,"" PuPlayer.LabelSet pBonusScreen,"Message2", Message2 ,1,"" End If End Sub Sub pDMDStartBall if bUsePUPDMD then End If end Sub Sub pDMDEvent(id) if bUsePUPDMD then debug.print "pDMDEvent " & id ' Guard: debounce rapid PUP events to prevent VLC invalid pointer crash on screen 13 ' State-change events always fire immediately; gameplay notification events are debounced Dim bIsStateCritical bIsStateCritical = (id = kDMD_PlayerMode) or (id = kDMD_PlayerMode2) or _ (id = kDMD_PlayerSelect) or (id = kDMD_Attract) or (id = kDMD_BonusBG) or _ (id = kDMD_BonusClear) or (id = kDMD_ExtraBall) or (id = kDMD_ShootAgain) if bIsStateCritical or Not bPupEventBusy then bPupEventBusy = True dScreen13LastActivity = Timer() vpmtimer.addtimer 8000, "bPupEventBusy = False '": vpmtimer.addtimer 8000, "dScreen13LastActivity = 0 '" PuPEvent(id) End If End If End Sub 'Sub pDMDBallLost ' if bUsePUPDMD then ' PuPEvent(500) ' Send an event to the pup pack the E500 trigger ' End If 'End Sub Sub pDMDGameOver debug.print "Game Over" StartAttractMode 1 if bUsePUPDMD then PuPlayer.PlayStop pOverVid PuPlayer.SetLoop pOverVid, 0 playclear pUnderVid playclear pDMDText playclear pMusic 'StopSound "m_wait" ' Just in case 'playclear pAudio PuPlayer.LabelShowPage pDMDText, 2,0,"" pDMDEvent(kDMD_Attract) if (bFirstStart=False) then ' Dont run this the 1st time through. It crashes Pup pAttractStartIdx pAttractGameOver ' Take too long to start and kills Game Over \ pAttractNext End if bFirstStart=False End If end Sub Sub pAttractStart pAttractStartIdx 0 end Sub Sub pAttractStartIdx(idx) if (pInAttract = False) then debug.print "STARTING ATTRACT" pDMDSetPage(pDMDBlank) 'set blank text overlay page. pCurAttractPos=idx pDMDStartUP end if end Sub Sub pDMDStartUP debug.print "STARTING ATTRACT2" pupDMDDisplay "attract","Welcome","@vidIntro.mp4",9,0,10 pInAttract=true end Sub DIM pCurAttractPos: pCurAttractPos=0 Const pAttractGameOver=3 Const pAttractInstantInfoIdx=18 Const pAttractEndIdx=23 '********************** gets called auto each page next and timed already in DMD_Timer. make sure you use pupDMDDisplay or it wont advance auto. Sub pAttractNext Dim i Dim cnt dim yPos pCurAttractPos=pCurAttractPos+1 debug.print "ATTRACT Next:" & pCurAttractPos & " " & bGameInPlayHidden & " " & bGameInPlay if bGameInPlayHidden and bGameInPlay=False then exit sub ' Special case when Cherry bomb is done we disable the game and let everything drain if bGameInPlay Then PriorityReset=2000 if bGameInPlay and pCurAttractPos=1 then pCurAttractPos=5 ' During InstantInfo skip Intro ' if bGameInPlay and pCurAttractPos=7 then pCurAttractPos=25 ' During InstantInfo skip credits 'debug.print "Check" Select Case pCurAttractPos ' Name Line1^Line2.. Video T Flash Priority Case 1: pupDMDDisplay "attract", "Insert Coin", "@vidIntro.mp4" ,9, 1, 10 PuPlayer.LabelShowPage pOverVid, 1,0,"" PuPlayer.playlistplayex pOverVid,"PupVideos","xattract1.mp4", 1, 1 PuPlayer.LabelSet pOverVid,"OverMessage1","",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2","",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2a","", 1, "" PuPlayer.LabelSet pOverVid,"OverMessage3",chr(78)&chr(79)&chr(84)&chr(32)&chr(70)&chr(79)&chr(82)&chr(32)&chr(82)&chr(69)&chr(83)&chr(65)&chr(76)&chr(69),1,"{'mt':2,'color':255, 'size': 4,'ypos': 90}" PuPlayer.LabelSet pOverVid,"OverMessage4","",1,"" ' PuPlayer.LabelSet pDMDText,"HighScore1","",1,"" ' PuPlayer.LabelSet pDMDText,"HighScore2","",1,"{'mt':2}" ' PuPlayer.LabelSet pDMDText,"HighScore3","",1,"" PuPlayer.LabelSet pOverVid, "Splash1", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "Splash2", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "Splash3", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" PuPlayer.LabelSet pOverVid, "Splash4", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" PuPlayer.LabelSet pOverVid, "SplashHS1", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "SplashHS2", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "SplashHS3", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" PuPlayer.LabelSet pOverVid, "SplashHS4", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" PuPlayer.LabelSet pOverVid,"SplashLogo","PupOverlays\\PinCredibles.png", 0,"" tmrGrowLabel.Enabled=False Case 2: ' CREDITS if (Scorbit.bNeedsPairing) then PuPlayer.LabelSet pOverVid, "ScorbitQR", "PuPOverlays\\QRcode.png",1,"{'mt':2,'width':32, 'height':64,'xalign':0,'yalign':0,'ypos':5,'xpos':5}" PuPlayer.LabelSet pOverVid, "ScorbitQRIcon", "PuPOverlays\\QRcodeS.png",1,"{'mt':2,'width':36, 'height':85,'xalign':0,'yalign':0,'ypos':3,'xpos':3,'zback':1}" End if if bGameInPlay=False Then pupDMDDisplay "attract", "Game Over", "@vidIntro2.mp4",3, 1, 10 PuPlayer.LabelSet pOverVid,"OverMessage3", "", 1, "{'mt':2,'color':"&RGB(255, 255, 255)&", 'size': 10,'ypos': 65}" End If PriorityReset=116000 if bFirstCredit then PuPlayer.playlistplayex pOverVid,"PupVideos","Credits.mp4", 100, 1 Else PuPlayer.playlistplayex pOverVid,"PupVideos","Credits.mp4", 0, 1 End if bFirstCredit=False PuPlayer.LabelSet pOverVid,"SplashLogo","PupOverlays\\PinCredibles.png", 0,"" PuPlayer.LabelSet pOverVid,"OverMessage1","",1,"{'mt':2, 'size':10}" PuPlayer.LabelSet pOverVid,"OverMessage2","",1,"{'mt':2, 'size':10}" PuPlayer.LabelSet pOverVid,"OverMessage3","",1,"{'mt':2, 'size':10}" Case 3: pupDMDDisplay "attract", "Insert Coin", "@vidIntro.mp4",3, 1, 10 PriorityReset=18000 PuPlayer.playlistplayex pOverVid,"PupVideos","Scorbit.mp4", 1, 1 PuPlayer.LabelSet pOverVid,"OverMessage1","",1,"{'mt':2, 'size':6}" PuPlayer.LabelSet pOverVid,"OverMessage2","",1,"{'mt':2}" PuPlayer.LabelSet pOverVid,"OverMessage3","",1,"" PuPlayer.LabelSet pOverVid, "SplashHS1", "" , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':20}" PuPlayer.LabelSet pOverVid, "SplashHS2", "" , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':30}" PuPlayer.LabelSet pOverVid, "SplashHS3", "" , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "SplashHS4", "" , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':75}" PuPlayer.LabelSet pOverVid,"SplashLogo","PupOverlays\\PinCredibles.png", 0,"" Case 4: ' GAME OVER if bGameInPlay=False Then pupDMDDisplay "attract", "Game Over", "@vidIntro2.mp4",3, 1, 10 PuPlayer.LabelSet pOverVid,"OverMessage3", "", 1, "{'mt':2,'color':"&RGB(255, 255, 255)&", 'size': 10,'ypos': 65}" End If PuPlayer.LabelSet pOverVid,"SplashLogo","PupOverlays\\PinCredibles.png", 0,"" PuPlayer.LabelSet pOverVid, "OverMessage4", "", 1, "" PuPlayer.LabelSet pOverVid, "Splash1", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "Splash2", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "Splash3", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" PuPlayer.LabelSet pOverVid, "Splash4", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" PuPlayer.LabelSet pOverVid, "SplashHS1", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "SplashHS2", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "SplashHS3", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" PuPlayer.LabelSet pOverVid, "SplashHS4", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" pupDMDDisplay "attract", "Insert Coin", "@vidIntro.mp4",3, 1, 10 PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x0065.mp4", 1, 1 PuPlayer.LabelSet pOverVid,"OverMessage1","GAME",1,"{'mt':2, 'size':10, 'color':" & pupColorWhite&"}" PuPlayer.LabelSet pOverVid,"OverMessage2","OVER",1,"{'mt':2, 'size':10, 'color':" & pupColorWhite&"}" PuPlayer.LabelSet pOverVid,"OverMessage3","",1,"{'mt':2, 'size':10, 'color':" & pupColorWhite&"}" case 5: ' LAST HIGH SCORE PriorityReset=3000 if bGameInPlay=False Then pupDMDDisplay "attract", "Game Over", "@vidIntro2.mp4",3, 1, 10 PuPlayer.LabelSet pOverVid,"OverMessage3", "", 1, "{'mt':2,'color':"&RGB(255, 255, 255)&", 'size': 10,'ypos': 65}" End If playclear pOverVid PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x0065.mp4", 1, 1 ' LastScore(0)=1300300000 ' LastScore(1)=1300300000 ' LastScore(2)=1300300000 ' LastScore(3)=1300300000 if LastScore(0)<>0 then PuPlayer.LabelSet pOverVid, "OverMessage1", "" , 1, "" PuPlayer.LabelSet pOverVid, "OverMessage2", "" , 1, "" PuPlayer.LabelSet pOverVid, "OverMessage3", "" , 1, "" cnt=0 for i = 0 to MaxPlayers-1 if LastScore(i)<> 0 then cnt=cnt+1 Next for i = 0 to MaxPlayers-1 If LastScore(i)<>0 then yPos=(i+1)*(100\(cnt+1))-10 PuPlayer.LabelSet pOverVid, "Splash" & i+1 ,"Player " & i+1 & " ", 1, "{'mt':2,'size':" & 8 - cnt & ",'xalign':1,'yalign':1,'ypos':" & yPos & ",'xpos':" & (i+1)*(50\(cnt+1)) + 25 & "}" PuPlayer.LabelSet pOverVid, "SplashHS"& i+1 ,FormatScore(LastScore(i)), 1, "{'mt':2,'size':" & 10 - cnt & ",'xalign':1,'yalign':1,'ypos':" & yPos +(13-cnt) & ",'xpos':" & (i+1)*(50\(cnt+1)) + 25 & "}" ' TBD Add trophy icons End if Next if bFreePlay then PuPlayer.LabelSet pOverVid, "OverMessage4", "FREE PLAY", 1, "" else pAttractNext 'No last high score End if Case 6: ' REPLAY AT PuPlayer.LabelSet pOverVid, "OverMessage4", "", 1, "" PuPlayer.LabelSet pOverVid, "Splash1", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "Splash2", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "Splash3", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" PuPlayer.LabelSet pOverVid, "Splash4", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" PuPlayer.LabelSet pOverVid, "SplashHS1", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "SplashHS2", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "SplashHS3", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" PuPlayer.LabelSet pOverVid, "SplashHS4", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" if bGameInPlay=False Then pupDMDDisplay "attract", "Game Over", "@vidIntro2.mp4",3, 1, 10 PuPlayer.LabelSet pOverVid,"OverMessage3", "", 1, "{'mt':2,'color':"&RGB(255, 255, 255)&", 'size': 10,'ypos': 65}" End If playclear pOverVid PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x0065.mp4", 1, 1 PuPlayer.LabelSet pOverVid,"OverMessage1","REPLAY AT",1,"{'mt':2, 'size':8}" PuPlayer.LabelSet pOverVid,"OverMessage2", FormatScore(ReplayValue) ,1,"{'mt':2, 'size':8}" PuPlayer.LabelSet pOverVid,"OverMessage3", "" ,1,"{'mt':2, 'size':8}" Case 7: if bGameInPlay=False Then pupDMDDisplay "attract", "Game Over", "@vidIntro2.mp4",3, 1, 10 PuPlayer.LabelSet pOverVid,"OverMessage3", "", 1, "{'mt':2,'color':"&RGB(255, 255, 255)&", 'size': 10,'ypos': 65}" End If playclear pOverVid PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x0065.mp4", 1, 1 if osbactive = 1 or osbactive = 2 Then PuPlayer.LabelSet pOverVid,"OverMessage1","OSB CHAMPION",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2",alltimevar(2),1,"{'mt':2}" PuPlayer.LabelSet pOverVid,"OverMessage3",FormatScore(alltimevar(3)),1,"" Else PuPlayer.LabelSet pOverVid,"OverMessage1","GRAND CHAMPION",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2",HighScoreName(0),1,"{'mt':2}" PuPlayer.LabelSet pOverVid,"OverMessage3",FormatScore(HighScore(0)),1,"" End If Case 8: if bGameInPlay=False Then pupDMDDisplay "attract", "Insert Coin", "@vidIntro.mp4" ,9, 1, 10 PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x0065.mp4", 1, 1 if osbactive = 1 or osbactive = 2 Then PuPlayer.LabelSet pOverVid,"OverMessage1","OSB HIGHSCORE #1",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2",alltimevar(4),1,"{'mt':2}" PuPlayer.LabelSet pOverVid,"OverMessage3",FormatScore(alltimevar(5)),1,"" Else PuPlayer.LabelSet pOverVid,"OverMessage1","HIGH SCORE #1",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2",HighScoreName(1),1,"{'mt':2}" PuPlayer.LabelSet pOverVid,"OverMessage3",FormatScore(HighScore(1)),1,"" End If Case 9: PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x0065.mp4", 1, 1 if bGameInPlay=False Then pupDMDDisplay "attract", "Game Over", "@vidIntro2.mp4",3, 1, 10 if osbactive = 1 or osbactive = 2 Then PuPlayer.LabelSet pOverVid,"OverMessage1","OSB HIGHSCORE #2",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2",alltimevar(6),1,"{'mt':2}" PuPlayer.LabelSet pOverVid,"OverMessage3",FormatScore(alltimevar(7)),1,"" Else PuPlayer.LabelSet pOverVid,"OverMessage1","HIGH SCORE #2",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2",HighScoreName(2),1,"{'mt':2}" PuPlayer.LabelSet pOverVid,"OverMessage3",FormatScore(HighScore(2)),1,"" End If Case 10: if bGameInPlay=False Then pupDMDDisplay "attract", "Insert Coin", "@vidIntro.mp4" ,9, 1, 10 PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x0065.mp4", 1, 1 if osbactive = 1 or osbactive = 2 Then PuPlayer.LabelSet pOverVid,"OverMessage1","OSB HIGHSCORE #3",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2",alltimevar(8),1,"{'mt':2}" PuPlayer.LabelSet pOverVid,"OverMessage3",FormatScore(alltimevar(9)),1,"" Else PuPlayer.LabelSet pOverVid,"OverMessage1","HIGH SCORE #3",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2",HighScoreName(3),1,"{'mt':2}" PuPlayer.LabelSet pOverVid,"OverMessage3",FormatScore(HighScore(3)),1,"" End If Case 11: if bGameInPlay=False Then pupDMDDisplay "attract", "Insert Coin", "@vidIntro.mp4" ,9, 1, 10 PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x0065.mp4", 1, 1 if osbactive = 1 or osbactive = 2 Then PuPlayer.LabelSet pOverVid,"OverMessage1","OSB HIGHSCORE #4",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2",alltimevar(8),1,"{'mt':2}" PuPlayer.LabelSet pOverVid,"OverMessage3",FormatScore(alltimevar(11)),1,"" Else PuPlayer.LabelSet pOverVid,"OverMessage1","HIGH SCORE #4",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2",HighScoreName(4),1,"{'mt':2}" PuPlayer.LabelSet pOverVid,"OverMessage3",FormatScore(HighScore(4)),1,"" End If Case 12: if bGameInPlay=False Then pupDMDDisplay "attract", "Game Over", "@vidIntro2.mp4",3, 1, 10 PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x0065.mp4", 1, 1 PuPlayer.LabelSet pOverVid,"OverMessage1","Games Played",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2",FormatScore(TotalGamesPlayed),1,"{'mt':2}" PuPlayer.LabelSet pOverVid,"OverMessage3"," ",1,"" Case 13: pupDMDDisplay "attract", "Insert Coin", "@vidIntro.mp4",3, 1, 10 PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x0065.mp4", 1, 1 PuPlayer.LabelSet pOverVid,"OverMessage1","COMBO CHAMPION:",1,"{'mt':2, 'size':8}" PuPlayer.LabelSet pOverVid,"OverMessage2", HighScoreAwardsName(0),1,"{'mt':2}" PuPlayer.LabelSet pOverVid,"OverMessage3", HighScoreAwards(0) ,1,"" PuPlayer.LabelSet pOverVid, "SplashHS1", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "SplashHS2", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "SplashHS3", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" PuPlayer.LabelSet pOverVid, "SplashHS4", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" Case 14: pupDMDDisplay "attract", "Insert Coin", "@vidIntro.mp4",3, 1, 10 PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x0092.mp4", 1, 1 PuPlayer.LabelSet pOverVid,"OverMessage1","",1,"{'mt':2, 'size':6}" PuPlayer.LabelSet pOverVid,"OverMessage2","",1,"{'mt':2}" PuPlayer.LabelSet pOverVid,"OverMessage3","",1,"" PuPlayer.LabelSet pOverVid, "SplashHS1", "CHERRY BOMB MULTIBALL" , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':20}" PuPlayer.LabelSet pOverVid, "SplashHS2", "CHAMPION" , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':30}" PuPlayer.LabelSet pOverVid, "SplashHS3", HighScoreAwardsName(1) , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "SplashHS4", FormatScore(HighScoreAwards(1)) , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':75}" Case 15: pupDMDDisplay "attract", "Insert Coin", "@vidIntro.mp4",3, 1, 10 PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x0060.mp4", 1, 1 PuPlayer.LabelSet pOverVid,"OverMessage1","",1,"{'mt':2, 'size':6}" PuPlayer.LabelSet pOverVid,"OverMessage2","",1,"{'mt':2}" PuPlayer.LabelSet pOverVid,"OverMessage3","",1,"" PuPlayer.LabelSet pOverVid, "SplashHS1", "IMMOLATION INITIATIVE" , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':20}" PuPlayer.LabelSet pOverVid, "SplashHS2", "CHAMPION" , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':30}" PuPlayer.LabelSet pOverVid, "SplashHS3", HighScoreAwardsName(2) , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "SplashHS4", FormatScore(HighScoreAwards(2)) , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':75}" Case 16: pupDMDDisplay "attract", "Insert Coin", "@vidIntro.mp4",3, 1, 10 PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x004B.mp4", 1, 1 PuPlayer.LabelSet pOverVid,"OverMessage1","",1,"{'mt':2, 'size':6}" PuPlayer.LabelSet pOverVid,"OverMessage2","",1,"{'mt':2}" PuPlayer.LabelSet pOverVid,"OverMessage3","",1,"" PuPlayer.LabelSet pOverVid, "SplashHS1", "SAVE XANDAR" , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':20}" PuPlayer.LabelSet pOverVid, "SplashHS2", "CHAMPION" , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':30}" PuPlayer.LabelSet pOverVid, "SplashHS3", HighScoreAwardsName(3) , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "SplashHS4", FormatScore(HighScoreAwards(3)) , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':75}" PuPlayer.LabelSet pOverVid,"SplashLogo","PupOverlays\\PinCredibles.png", 0,"" tmrGrowLabel.Enabled=False Case 17: pupDMDDisplay "attract", "Insert Coin", "@vidIntro.mp4",3, 1, 10 PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x0065.mp4", 1, 1 PuPlayer.LabelSet pOverVid,"OverMessage1","",1,"{'mt':2, 'size':6}" PuPlayer.LabelSet pOverVid,"OverMessage2","",1,"{'mt':2}" PuPlayer.LabelSet pOverVid,"OverMessage3","",1,"" PuPlayer.LabelSet pOverVid, "SplashHS1", "" , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':20}" PuPlayer.LabelSet pOverVid, "SplashHS2", "" , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':30}" PuPlayer.LabelSet pOverVid, "SplashHS3", "" , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "SplashHS4", "" , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':75}" PuPlayer.LabelSet pOverVid,"SplashLogo","PupOverlays\\PinCredibles.png", 0,"" tmrGrowLabel_size = 5 tmrGrowLabel_max = 50 tmrGrowLabel_inc =1 tmrGrowLabel_lbl="SplashLogo" tmrGrowLabel_image="PupOverlays\\PinCredibles.png" tmrGrowLabel.Interval=30 tmrGrowLabel.Enabled = True case 18: if bGameInPlay then PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x0065.mp4", 1, 1 PuPlayer.LabelSet pOverVid,"OverMessage1","INSTANT INFO",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2", "",1,"{'mt':2}" PuPlayer.LabelSet pOverVid,"OverMessage3","",1,"" PuPlayer.LabelSet pOverVid, "SplashHS1", "" , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':20}" PuPlayer.LabelSet pOverVid, "SplashHS2", "" , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':30}" PuPlayer.LabelSet pOverVid, "SplashHS3", "" , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "SplashHS4", "" , 1, "{'mt':2,'size':6, 'xalign':1, 'xpos':0, 'ypos':75}" PuPlayer.LabelSet pOverVid,"SplashLogo","PupOverlays\\PinCredibles.png", 0,"" tmrGrowLabel.Enabled=False else PuPlayer.LabelSet pOverVid,"SplashLogo","PupOverlays\\PinCredibles.png", 0,"" pCurAttractPos=0 pAttractNext 'reset to beginning End If case 19: if bGameInPlay then PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x0065.mp4", 1, 1 PuPlayer.LabelSet pOverVid,"OverMessage1","BALL " & Balls ,1,"" PuPlayer.LabelSet pOverVid,"OverMessage2", "",1,"{'mt':2}" if bFreePlay then PuPlayer.LabelSet pOverVid,"OverMessage3","FREE PLAY",1,"" Else PuPlayer.LabelSet pOverVid,"OverMessage3","",1,"" End if else pCurAttractPos=0 pAttractNext 'reset to beginning End If case 20: if bGameInPlay then PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x0065.mp4", 1, 1 If GrootMouth_IsDropped then PuPlayer.LabelSet pOverVid,"OverMessage1","LOCK LIT" ,1,"" Else PuPlayer.LabelSet pOverVid,"OverMessage1","" ,1,"" End if PuPlayer.LabelSet pOverVid,"OverMessage2", "",1,"{'mt':2}" if GrootMBLocks=1 then PuPlayer.LabelSet pOverVid,"OverMessage3", GrootMBLocks & " BALL LOCKED",1,"{'mt':2, 'size':5}" Else PuPlayer.LabelSet pOverVid,"OverMessage3", GrootMBLocks & " BALLS LOCKED",1,"{'mt':2, 'size':5}" End if else pCurAttractPos=0 pAttractNext 'reset to beginning End If case 21: if bGameInPlay then PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x0065.mp4", 1, 1 PuPlayer.LabelSet pOverVid,"OverMessage1","SPELL" ,1,"" if SpellRampage=0 then PuPlayer.LabelSet pOverVid,"OverMessage2", "RAM ",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2a", " PAGE",1,"{'mt':2,'color':" & RGB(0, 0, 0) & "}" Elseif SpellRampage=1 then PuPlayer.LabelSet pOverVid,"OverMessage2", "RAMP ",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2a", " AGE",1,"{'mt':2,'color':" & RGB(0, 0, 0) & "}" Elseif SpellRampage=2 then PuPlayer.LabelSet pOverVid,"OverMessage2", "RAMPA ",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2a", " GE",1,"{'mt':2,'color':" & RGB(0, 0, 0) & "}" Elseif SpellRampage=3 then PuPlayer.LabelSet pOverVid,"OverMessage2", "RAMPAG ",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2a", " E",1,"{'mt':2,'color':" & RGB(0, 0, 0) & "}" End if PuPlayer.LabelSet pOverVid,"OverMessage3", "FOR DOUBLE SCORING",1,"" else pCurAttractPos=0 pAttractNext 'reset to beginning End If case 22: PuPlayer.LabelSet pOverVid,"OverMessage3","", 1, "'{'mt':2,'size':10}" PuPlayer.LabelSet pOverVid,"OverMessage2a","", 1, "" if bGameInPlay then PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x0065.mp4", 1, 1 PuPlayer.LabelSet pOverVid,"OverMessage1", ModeScore(CurrentPlayer, 0) & " COMBOS",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2", "",1,"" PuPlayer.LabelSet pOverVid,"OverMessage3","",1,"JACKPOT=100,000" else pCurAttractPos=0 pAttractNext 'reset to beginning End If case 23: if bGameInPlay then PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x0065.mp4", 1, 1 PuPlayer.LabelSet pOverVid,"OverMessage1","Hadrons",1,"" PuPlayer.LabelSet pOverVid,"OverMessage2", HadronEnforcerCount,1,"" PuPlayer.LabelSet pOverVid,"OverMessage3","",1,"" else pCurAttractPos=0 pAttractNext 'reset to beginning End If case 24: if bGameInPlay then PuPlayer.playlistplayex pOverVid,"PupVideos","Video-0x0065.mp4", 1, 1 PuPlayer.LabelSet pOverVid,"OverMessage1", "Multipliers", 1,"" PuPlayer.LabelSet pOverVid,"OverMessage2", "Play: x" & (Multiplier3x * PlayMultiplier),1,"{'mt':2}" PuPlayer.LabelSet pOverVid,"OverMessage3", "Bonus: x" & BonusMultiplier,1,"" else pCurAttractPos=0 pAttractNext 'reset to beginning End If Case 99: if bGameInPlay=False then pCurAttractPos=0 pupDMDDisplay "attract", "Game Over", "@vidIntro2.mp4",3, 1, 10 PuPlayer.LabelSet pOverVid,"OverMessage3", "", 1, "{'mt':2,'color':"&RGB(255, 255, 255)&", 'size': 10,'ypos': 65}" PriorityReset=50688 playclear pOverVid playclear pAudio PuPlayer.playlistplayex pOverVid,"PupVideos","Vi" & chr(100) & "eo-0x00" & chr(69) & "E.mp4", 100, 1 PuPlayer.LabelSet pOverVid,"OverMessage1","",1,"{'mt':2, 'size':10}" PuPlayer.LabelSet pOverVid,"OverMessage2","",1,"{'mt':2, 'size':10}" PuPlayer.LabelSet pOverVid,"OverMessage3","",1,"{'mt':2, 'size':10}" PuPlayer.LabelSet pOverVid,"OverMessage2a","", 1, "" PuPlayer.LabelSet pOverVid,"OverMessage4","",1,"" PuPlayer.LabelSet pOverVid,"SplashLogo","PupOverlays\\PinCredibles.png", 0,"" PuPlayer.LabelSet pOverVid, "Splash1", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "Splash2", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "Splash3", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" PuPlayer.LabelSet pOverVid, "Splash4", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" PuPlayer.LabelSet pOverVid, "SplashHS1", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "SplashHS2", "" , 1, "{'mt':2,'size':14, 'xalign':1, 'xpos':0, 'ypos':50}" PuPlayer.LabelSet pOverVid, "SplashHS3", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" PuPlayer.LabelSet pOverVid, "SplashHS4", "" , 1, "{'mt':2,'size':10, 'xalign':1, 'xpos':0, 'ypos':70}" Else pCurAttractPos=0 pAttractNext 'reset to beginning End if Case Else pCurAttractPos=0 pAttractNext 'reset to beginning end Select end Sub Dim tmrGrowLabel_inc Dim tmrGrowLabel_lbl Dim tmrGrowLabel_image Dim tmrGrowLabel_size Dim tmrGrowLabel_max Sub tmrGrowLabel_Timer() tmrGrowLabel_size=tmrGrowLabel_size+tmrGrowLabel_inc if tmrGrowLabel_size>tmrGrowLabel_max then tmrGrowLabel.Enabled = False End if PuPlayer.LabelSet pOverVid, tmrGrowLabel_lbl, tmrGrowLabel_image, 1, "{'mt':2,'xpos':50,'ypos':50,'width':" & tmrGrowLabel_size & ",'height':" & tmrGrowLabel_size*1.78 & "}" End Sub Function Min(value, minVal) if value < minVal then Min=minVal Else Min=Value End If End Function Function Max(value, minVal) if value > minVal then Max=minVal Else Max=Value End If End Function '************************ called during gameplay to update Scores *************************** Sub pUpdateScores 'call this ONLY on timer 300ms is good enough Dim StatusStr Dim NameStr Dim Size(4) dim ScoreTag(4) if pDMDCurPage <> pScores then Exit Sub ScoreSize(CurrentPlayer) = DefScoreSize ScoreTag(0)="{'mt':2,'size':"& ScoreSize(0) &"}" ScoreTag(1)="{'mt':2,'size':"& ScoreSize(1) &"}" ScoreTag(2)="{'mt':2,'size':"& ScoreSize(2) &"}" ScoreTag(3)="{'mt':2,'size':"& ScoreSize(3) &"}" if tmrCherryBomb.Enabled then StatusStr = "Time:" & ModeCountdownTimer.UserValue & "(" & CherryBombCount & ")" elseif tmrImmolation.Enabled then StatusStr = "Hits:" & CINT((ImmolationCount / 18) * 100) & "% Sw:" & SwitchHitCount elseif tmrXandar.Enabled then StatusStr = "Hits:" & XandarCount elseif PlayerMode = -1 Then If bSecondMode then if PlayerMode2 = -1 then StatusStr = "Select Mode/2nd" Else if PlayerMode2 = 7 or PlayerMode2 = 2 Then ' SwitchHits StatusStr = Mode2Percent(PlayerMode2) & "% HITS:" & SwitchHitCount & " 2nd" else StatusStr = Mode2Percent(PlayerMode2) & "% 2nd" end If End if else StatusStr = "Select Mode" End If elseif PlayerMode = 7 Then ' SwitchHits StatusStr = "Time:" & ModeCountdownTimer.UserValue & " " & ModePercent(PlayerMode) & "% HITS:" & SwitchHitCount else StatusStr = "Time:" & ModeCountdownTimer.UserValue & " " & ModePercent(PlayerMode) & "%" end If 'PuPlayer.LabelSet pDMDText,"Play2","PLAYER 2",1,"{'mt':2}" if ScorbitActive then if Scorbit.bSessionActive then NameStr=Scorbit.GetName(CurrentPlayer+1) if NameStr<>"" then puPlayer.LabelSet pDMDText,"Player", NameStr ,1,"" Else puPlayer.LabelSet pDMDText,"Player", "Player " & CurrentPlayer+1 ,1,"" End if End if Else puPlayer.LabelSet pDMDText,"Player", "Player " & CurrentPlayer+1 ,1,"" End if puPlayer.LabelSet pDMDText,"Ball", "Ball " & Balls & " " ,1,"" Select case PlayersPlayingGame case 1: puPlayer.LabelSet pDMDText,"CurScore", FormatScore(Score(CurrentPlayer)) ,1,ScoreTag(0) case 2: PuPlayer.LabelSet pDMDText,"Play1score",FormatScore(Score(0)),1,ScoreTag(0) PuPlayer.LabelSet pDMDText,"Play2score",FormatScore(Score(1)),1,ScoreTag(1) case 3: PuPlayer.LabelSet pDMDText,"Play1score",FormatScore(Score(0)),1,ScoreTag(0) PuPlayer.LabelSet pDMDText,"Play2score",FormatScore(Score(1)),1,ScoreTag(1) PuPlayer.LabelSet pDMDText,"Play3score",FormatScore(Score(2)),1,ScoreTag(2) case 4: PuPlayer.LabelSet pDMDText,"Play1score",FormatScore(Score(0)),1,ScoreTag(0) PuPlayer.LabelSet pDMDText,"Play2score",FormatScore(Score(1)),1,ScoreTag(1) PuPlayer.LabelSet pDMDText,"Play3score",FormatScore(Score(2)),1,ScoreTag(2) PuPlayer.LabelSet pDMDText,"Play4score",FormatScore(Score(3)),1,ScoreTag(3) End Select puPlayer.LabelSet pDMD,"Player", "Player " & CurrentPlayer+1 ,1,"" puPlayer.LabelSet pDMD,"Ball", "Ball " & Balls ,1,"" puPlayer.LabelSet pDMD,"CurScore", FormatScore(Score(CurrentPlayer)) ,1,"" puPlayer.LabelSet pDMD,"Status", StatusStr ,1,"1" puPlayer.LabelSet pDMD,"Credits", "C " & Credits ,1,"" end Sub '***************************** ' AUTO TESTING ' by:NailBuster ' Global variable "AutoQA" below will switch all this on/off during testing. ' '***************************** ' NailBusters AutoQA Code and triggers.. ' this to do for ROM based: timeout on keydown. if 30 seconds, then assume game is over and you add coins/start game key. ' add a timer called AutoQAStartGame. you can run every 10000 interval. Dim AutoQA:AutoQa=False 'Main QA Testing FLAG setting to false will disable all this stuff. Dim QACoinStartSec:QACoinStartSec=30 'timeout seconds for AutoCoinStartSec Dim QANumberOfCoins:QANumberOfCoins=1 'number of coins to add for each start Dim QASecondsDiff Dim QALastFlipperTime:QALastFlipperTime=Now() Dim AutoFlipperLeft:AutoFlipperLeft=false Dim AutoFlipperRight:AutoFlipperRight=false if AutoQa then TriggerLeftAuto.Enabled = True if AutoQa then TriggerRightAuto.Enabled = True if AutoQa then AutoQAStartGame.Enabled = True ' Start it up if this is enabled Sub AutoQAStartGame_Timer() 'this is a timeout when sitting in attract with no flipper presses for 60 seconds, then add coins and start game. if AutoQA=false Then Exit Sub QASecondsDiff = DateDiff("s",QALastFlipperTime,NOW()) if QASecondsDiff>QACoinStartSec Then 'simulate quarters and start game keys Dim fx : fx=0 Dim keydelay : keydelay=100 Do While fx30 Then 'safety of stuck up flipers. AutoFlipperLeft=false AutoFlipperRight=false End if if bGameInPlay and QASecondsDiff>20 Then 'Press the magna vpmtimer.addtimer keydelay,"Table1_KeyDown(RightMagnaSave) '" vpmtimer.addtimer keydelay+200,"Table1_KeyUp(RightMagnaSave) '" End if End Sub Sub TriggerAutoPlunger_Hit() 'add a trigger in front of plunger. adjust the delay timings if needed. if AutoQA=false Then Exit Sub vpmtimer.addtimer 10,"Table1_KeyDown(PlungerKey) '" vpmtimer.addtimer 700+RND(400),"Table1_KeyUp(PlungerKey) '" End Sub Sub FlipperUP(which) 'which=1 left 2 right QALastFlipperTime=Now() if which=1 Then Table1_KeyDown(LeftFlipperKey) vpmtimer.addtimer 200+Rnd(200),"Table1_KeyUP(LeftFlipperKey):AutoFlipperLeft=false '" Else Table1_KeyDown(RightFlipperKey) vpmtimer.addtimer 200+Rnd(200),"Table1_KeyUP(RightFlipperKey):AutoFlipperRight=false '" end If End Sub Sub TriggerLeftAuto_Hit() if AutoQA And AutoFlipperLeft=false then vpmtimer.addtimer 20+Rnd(50),"FlipperUP(1) '" AutoFlipperLeft=true End Sub Sub TriggerRightAuto_Hit() if AutoQA and AutoFlipperRight=false then vpmtimer.addtimer 20+Rnd(20),"FlipperUP(2) '" AutoFlipperRight=true End Sub Sub TriggerLeftAuto2_Hit() TriggerLeftAuto_Hit() End Sub Sub TriggerRightAuto2_Hit() TriggerRightAuto_Hit() End Sub '***************************************************** 'PUPInit 'this should be called in table1_init at bottom after all else b2s/controller running. '******************** pretty much only use pupDMDDisplay all over ************************ ' Sub pupDMDDisplay(pEventID, pText, VideoName,TimeSec, pAni, pPriority) ' pEventID = reference if application, ' pText = "text to show" separate lines by ^ in same string ' VideoName = "gameover.mp4" will play in background "@gameover.mp4" will play and disable text during gameplay. ' also global variable useDMDVideos=true/false if user wishes only TEXT ' TimeSec how long to display msg in Seconds ' animation if any 0=none 1=Flasher ' also, now can specify color of each line (when no animation). "sometext|12345" will set label to "sometext" and set color to 12345 'Samples 'pupDMDDisplay "shoot", "SHOOT AGAIN!", ", 3, 1, 10 'pupDMDDisplay "default", "DATA GADGET LIT", "@DataGadgetLit.mp4", 3, 1, 10 'pupDMDDisplay "shoot", "SHOOT AGAIN!", "@shootagain.mp4", 3, 1, 10 'pupDMDDisplay "balllock", "Ball^Locked|16744448", "", 5, 1, 10 ' 5 seconds, 1=flash, 10=priority, ball is first line, locked on second and locked has custom color | 'pupDMDDisplay "balllock","Ball 2^is^Locked", "balllocked2.mp4",3, 1,10 ' 3 seconds, 1=flash, play balllocked2.mp4 from dmdsplash folder, 'pupDMDDisplay "balllock","Ball^is^Locked", "@balllocked.mp4",3, 1,10 ' 3 seconds, 1=flash, play @balllocked.mp4 from dmdsplash folder, because @ text by default is hidden unless useDmDvideos is disabled. 'pupDMDDisplay "shownum", "3^More To|616744448^GOOOO", "", 5, 1, 10 ' "shownum" is special. layout is line1=BIG NUMBER and line2,line3 are side two lines. "4^Ramps^Left" 'pupDMDDisplay "target", "POTTER^110120", "blank.mp4", 10, 0, 10 ' 'target'... first string is line, second is 0=off,1=already on, 2=flash on for each character in line (count must match) 'pupDMDDisplay "highscore", "High Score^AAA 2451654^BBB 2342342", "", 5, 0, 10 ' highscore is special line1=text title like highscore, line2, line3 are fixed fonts to show AAA 123,123,123 'pupDMDDisplay "highscore", "High Score^AAA 2451654|616744448^BBB 2342342", "", 5, 0, 10 ' sames as above but notice how we use a custom color for text |