Closed xantari closed 4 years ago
Update: I do see that there are different events we can add in DOF (will need to figure out how to add the RGB Undercab complex upon program load I guess).
What I could not find is a PBYProgramExit event to fire the light show upon shutdown or program close of PinballY?
I do see that there are different events we can add in DOF
Right. In case you haven't found it yet, there's a section in the Help called "DOF Events" with details on how to customize the events.
will need to figure out how to add the RGB Undercab complex upon program load
There's not currently a separate event for the initial program load - it'll just go into $PBYWheel state initially. I could add a program load event easily enough.
What I could not find is a PBYProgramExit event to fire the light show upon shutdown or program close of PinballY?
That one is probably going to be impossible to handle this way, unfortunately, because DOF automatically resets everything when a program exits. Even if I did add a "program exit" event, you'd probably only see the first couple of flashes from it before DOF shuts down, so it would be kind of useless.
I can think of two alternative approaches that might work:
Javascript. There's no current js access to DOF events, but it's on my list of things to add at some point. When I do, you could write a script that carries out a pre-exit light show, and prevents PinballY from actually terminating until the light show finishes. That would solve the DOF reset problem by delaying the exit until the DOF show was over.
Run an external program (such as LEDBlinky) to execute the light show. This is something you could do now (you wouldn't have to wait for a new Javascript feature). If you look in the Help under Javascript scripting > Worked Examples > Running a Program, you'll find sample code showing how to launch an external .EXE program from Javascript. If you can figure out how to get the light show you want out of LEDBlinky or some other program with a command-line launch, you could intercept the "exit program" command to launch the light show:
mainWindow.on("command", ev => {
if (ev.id == command.Quit) {
// carry out the light show launch here as in the Worked Example section
}
});
Thanks! I'll give the javascript method a shot when I get more time (hopefully in a couple weeks).
The Beta 20 release has new Javascript features that will let you do everything you want here, I think. See Activating a DOF light show in Javascript scripting > Worked Examples > Play a Video on Quit in the help.
Closing, since I think this is best handled through the Javascript approach.
Is your feature request related to a problem? Please describe. DOF works out of the box in PinballY and even has the same left/right navigation lightbar functions as PinballX.
What is missing is the shutdown light show. How can that be added? Is it possible to add via the Scripting function? I didn't see any DOF javascript scripting examples.
Describe the solution you'd like Built in light show on exit. Additionally, undercab dynamic lighting would also be awesome.