Jump to content



Photo
* * * * * 5 votes

Call for testing


  • Please log in to reply
1630 replies to this topic

#1101 Thalamus

Thalamus

    VPF Veteran

  • Platinum Supporter
  • 5,007 posts

  • Flag: Norway

  • Favorite Pinball: GOT, Alien Star, LOTR, TOM

Posted 19 March 2020 - 04:28 AM

Ok.


From now on. I won't help anyone here at VPF. Please ask Noah why that is.


#1102 djlunchbox

djlunchbox

    Enthusiast

  • Members
  • PipPipPip
  • 157 posts

  • Flag: El Salvador

  • Favorite Pinball: WCS 94, Theatre of Magic, TOTAN

Posted 20 March 2020 - 06:47 AM

Has anyone successfully javascripted for loading videos to fire in place of the wheel logo? I have less than zero understanding about coding and scripting so I would not know where tf to begin. 



#1103 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,346 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 20 March 2020 - 06:21 PM

Has anyone successfully javascripted for loading videos to fire in place of the wheel logo? I have less than zero understanding about coding and scripting so I would not know where tf to begin. 

 

That sounds like a fairly big job.  I think it's probably doable, though, so if someone wants to take a crack at it, let me know if you get something working - it would be a great addition to the worked examples if you want to contribute it.

 

However, if what you want is basically animated logos, have you considered trying animated GIFs?  Those can be transparent, and they should work anywhere a regular still image can be used, so you should be able to drop an animated GIF in for any wheel icon using the existing mechanism, no coding required.


And by the way, ffmpeg should be able to convert "real" video formats to animated GIFs for you, if you can find the right magic command line. There's lot of help for ffmpeg on the web for this sort of thing.



#1104 djlunchbox

djlunchbox

    Enthusiast

  • Members
  • PipPipPip
  • 157 posts

  • Flag: El Salvador

  • Favorite Pinball: WCS 94, Theatre of Magic, TOTAN

Posted 21 March 2020 - 09:14 PM

well I mean I'm not sure how it's done in PBX or popper to have a loading video play once you select a table. in your help guide you talk about the launch events

 

http://mjrnet.org/pi...erlayEvent.html

 

This class represents events that occur during the game launch process related to updating the "Launch Overlay", which is a graphics layer in the UI where the system displays status messages about the progress of the launch. You can use these events to customize the appearance of the overlay.

This class includes the following subtypes:

  • launchoverlayshow: Fired when the system initially shows the launch overlay. By default, the system fills the playfield screen with a dark background. You can intercept this event to display your own alternative graphics, using the mainWindow.launchOverlay object, which lets you access the overlay to draw custom graphics or load your own videos or images. See the section on the launchOverlay object for details.

the part in bold is what I mean. 

 

And since this in the javascript portion it's something that has to be coded in. 


Edited by djlunchbox, 21 March 2020 - 09:15 PM.


#1105 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,346 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 21 March 2020 - 09:29 PM

well I mean I'm not sure how it's done in PBX or popper to have a loading video play once you select a table.

 

Oh, I might have misunderstood what you were talking about earlier - I was thinking you were talking about the wheel icons.  Maybe you're really thinking about this?:

 

http://mjrnet.org/pi...ingExample.html

 

Scroll down to "Playing an animated overlay".



#1106 djlunchbox

djlunchbox

    Enthusiast

  • Members
  • PipPipPip
  • 157 posts

  • Flag: El Salvador

  • Favorite Pinball: WCS 94, Theatre of Magic, TOTAN

Posted 21 March 2020 - 09:56 PM

OK that's cool but where do I enter that? 

 

Do I just open the SystemClasses.js and paste that anywhere? Like I said less than zero knowledge about javascripting or coding. 



#1107 djlunchbox

djlunchbox

    Enthusiast

  • Members
  • PipPipPip
  • 157 posts

  • Flag: El Salvador

  • Favorite Pinball: WCS 94, Theatre of Magic, TOTAN

Posted 21 March 2020 - 10:26 PM

Ok so i get it now reading is fundamental. Created a text file renamed it main.js dropped it in the scripts folder.

 

Here's what's in it:

 

mainWindow.on("launchoverlayshow", ev => {
    let animation = gameList.resolveMedia("Images", "launch.mp4");
    mainWindow.launchOverlay.bg.loadVideo(animation);
});
mainWindow.on("gamestarted", ev => {
    mainWindow.launchOverlay.bg.clear(0xff404040);
});
 
 
am i missing something?
 
******EDIT*******

Ok getting closer haha

 

added this 

 

ev.preventDefault();

 

so now the video plays but the text/wheel icon play over it.

 

Will continue to experiment. 

 

eventually I'll see if its possible to randomize.

 

Thanks MJR! I'm getting there


Edited by djlunchbox, 21 March 2020 - 10:26 PM.


#1108 djlunchbox

djlunchbox

    Enthusiast

  • Members
  • PipPipPip
  • 157 posts

  • Flag: El Salvador

  • Favorite Pinball: WCS 94, Theatre of Magic, TOTAN

Posted 21 March 2020 - 10:59 PM

ok so here's the complete JS i'm using 

 

mainWindow.on("launchoverlaymessage", ev => {
    ev.preventDefault();
});
mainWindow.on("launchoverlayshow", ev => {
    mainWindow.showWheel(false);
    mainWindow.setUnderlay("");
    ev.preventDefault()
let animation = gameList.resolveMedia("Videos", "launch.mp4");
    mainWindow.launchOverlay.bg.loadVideo(animation);
});
mainWindow.on("gamestarted", ev => {
     mainWindow.showWheel(true);
mainWindow.launchOverlay.bg.clear(0xff404040);
});
 
and it works great!
 
Now I need to figure out how to randomize it.


#1109 djlunchbox

djlunchbox

    Enthusiast

  • Members
  • PipPipPip
  • 157 posts

  • Flag: El Salvador

  • Favorite Pinball: WCS 94, Theatre of Magic, TOTAN

Posted 21 March 2020 - 11:10 PM

Also I've lost the "Exiting Table message" so i need to figure how to add that back as well lol



#1110 djlunchbox

djlunchbox

    Enthusiast

  • Members
  • PipPipPip
  • 157 posts

  • Flag: El Salvador

  • Favorite Pinball: WCS 94, Theatre of Magic, TOTAN

Posted 21 March 2020 - 11:32 PM

Ok now I got it. So since i'm blocking the default event from showing on the main playfield via overlaymessage I moved it to the DMd, which is cool I'll get dual loading messages but I get the exiting table back.

 

complete code:

 

let dmdLaunchMessageLayer = dmdWindow.createDrawingLayer(1000);
mainWindow.on("launchoverlaymessage", ev => {
     dmdLaunchMessageLayer.drawDMDText(ev.message || "", {
        font: "12px"
    });
ev.preventDefault();
});
mainWindow.on("launchoverlayshow", ev => {
    mainWindow.showWheel(false);
    mainWindow.setUnderlay("");
    ev.preventDefault()
let animation = gameList.resolveMedia("Videos", "loading2.mp4");
    mainWindow.launchOverlay.bg.loadVideo(animation);
});
mainWindow.on("gamestarted", ev => {
    mainWindow.showWheel(true);
mainWindow.launchOverlay.bg.clear(0xff404040);
});
mainWindow.on("launchoverlayhide", ev => {
 
dmdLaunchMessageOverlay.clear(0x00000000);
});

 

Now to randomize the videos, so it's not just one it's a different one is the new venture, then proceed with making it launch per table if there's a custom loading video per table. 

 

The only thing is the videos seem to have to be in a landscape setting not portrait which is no biggie I guess it's easy to rotate videos.


Edited by djlunchbox, 22 March 2020 - 05:34 AM.


#1111 starwyvern

starwyvern

    Hobbyist

  • Members
  • PipPip
  • 18 posts

  • Flag: ---------

  • Favorite Pinball: Space Cadet

Posted 22 March 2020 - 01:10 PM

mjr,

 

Is there a way to install PinballY on an external drive? When doing the intial install I couldn't choose my external drive so I just did it to C:\ am I able to copy and paste? I'd like to have all my pinball stuff running off an external if possible. Thanks!



#1112 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,346 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 22 March 2020 - 06:06 PM

Is there a way to install PinballY on an external drive? When doing the intial install I couldn't choose my external drive so I just did it to C:\ am I able to copy and paste? I'd like to have all my pinball stuff running off an external if possible. Thanks!

 

You should be able to just move the whole folder over from the Windows desktop.  It's all self-contained to whatever folder it's in - there aren't any registry entries to fix up or anything like that.  I guess the Windows Setup installer must have a built-in rule against external drives, which makes sense for about 99% of programs, but in this case an external drive is just fine.



#1113 djlunchbox

djlunchbox

    Enthusiast

  • Members
  • PipPipPip
  • 157 posts

  • Flag: El Salvador

  • Favorite Pinball: WCS 94, Theatre of Magic, TOTAN

Posted 22 March 2020 - 09:08 PM

Ok finally i got a workable script. Moving the overlay message to the dmd how i had done it not only kept the dmd hidden on return to PBY main page it also never triggered the loading video again only one time so i went with completely hiding the overlaymessage then adding a fg and bg layer:

mainWindow.on("launchoverlaymessage", ev => {
ev.preventDefault();
});
mainWindow.on("launchoverlayshow", ev => {
mainWindow.showWheel(false);
mainWindow.setUnderlay("");
ev.preventDefault()
let animation = gameList.resolveMedia("Videos", "loading.mp4");
mainWindow.launchOverlay.bg.loadVideo(animation);
});
mainWindow.on("gamestarted", ev => {
mainWindow.showWheel(true);
let image = gameList.resolveMedia("Images", "exit.png");
mainWindow.launchOverlay.bg.clear(0xff40404);
mainWindow.launchOverlay.fg.loadImage(image)
}};

Heres the result

https://youtu.be/odX_ailQg2A


Edited by djlunchbox, 01 April 2020 - 09:42 PM.


#1114 licwip

licwip

    Enthusiast

  • Platinum Supporter
  • 203 posts

  • Flag: United States of America

  • Favorite Pinball: Space Cadet

Posted 01 April 2020 - 07:28 PM

Is there a way to have two toppers, both turned 90 degrees and placed in two different parts of the backglass? My cabinet is a two-screen set-up, with a Plasma TV positioned landscape as my backglass. I'd like to find something to put in the dead spaces on the sides, and rotated topper images could "complete the look."



#1115 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,346 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 01 April 2020 - 08:35 PM

Is there a way to have two toppers, both turned 90 degrees and placed in two different parts of the backglass? My cabinet is a two-screen set-up, with a Plasma TV positioned landscape as my backglass. I'd like to find something to put in the dead spaces on the sides, and rotated topper images could "complete the look."

 

I can't think of any way to do that right now.  The only thing I can come up with would be to maybe try positioning the topper window behind the backglass window, and arranging your topper window graphics so that they just happen to fill the side areas of the window (with the middle part hidden behind the backglass window).  Another possibility might be to use Javascript drawing layers to draw the graphics yourself inside the backglass window.

 

Javascript does let you go right down to the Win32 APIs directly, so you could open your own custom windows and handle it that way.  But that would be getting pretty elaborate.



#1116 djlunchbox

djlunchbox

    Enthusiast

  • Members
  • PipPipPip
  • 157 posts

  • Flag: El Salvador

  • Favorite Pinball: WCS 94, Theatre of Magic, TOTAN

Posted 01 April 2020 - 09:43 PM

Is there a way to have two toppers, both turned 90 degrees and placed in two different parts of the backglass? My cabinet is a two-screen set-up, with a Plasma TV positioned landscape as my backglass. I'd like to find something to put in the dead spaces on the sides, and rotated topper images could "complete the look."

 

 

Why do you have dead space on the sides? 



#1117 BPICKINPAUGH

BPICKINPAUGH

    Hobbyist

  • Platinum Supporter
  • 21 posts

  • Flag: United States of America

  • Favorite Pinball: Many different types and era's

Posted 08 April 2020 - 10:24 PM

Just curious if anyone has tried this and got it to work,  I am setting up a three monitor system I am using the supplied pinballY dmd and do not plan on using any external "real" dmd at this point.  My goal was to show a "Loading" gif on the DMD and  I can do that with the code in "launchoverlaymessage" and it works just fine, the problems I have is when that is complete it does not get rid of the layer on the DMD so what I did next was add the clear() in "gamestarted" that works fine sets the opacity on that layer and essentially makes it disappear and that is great. The last part I cannot get to work, when I exit the game the "launchoverlaymessage" fires runs the "Loading" gif but in the "launchoverlayhide" it does not set the opacity because it does not have a reference to the dmdLaunchVideo variable anymore it is null I.E. "undefined" so the clear() does not work there and I am unsure what other handlers I can put the clear() in.

FYI if I move the code in "launchoverlaymessage" to "launchoverlayshow" it works just fine the reason I don't want to keep it like that is because it is much slower at rendering the gif when I have it in "launchoverlaymessage" it is instant.

 

var dmdLaunchVideo = dmdWindow.createDrawingLayer(1000);
mainWindow.on("launchoverlaymessage", ev => {
    let animation1 = gameList.resolveMedia("Videos", "loading1.gif");
    dmdLaunchVideo.loadVideo(animation1);
    ev.preventDefault();
});
mainWindow.on("launchoverlayshow", ev => {
    mainWindow.showWheel(false);
    mainWindow.setUnderlay("");
    ev.preventDefault();
});
mainWindow.on("launchoverlayhide", ev => {
    dmdLaunchVideo.clear(0x00000000);
    mainWindow.showWheel(true);
});
mainWindow.on("gamestarted", ev => {
    dmdLaunchVideo.clear(0x00000000);
});



#1118 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,346 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 09 April 2020 - 06:27 PM

BPICKINPAUGH - some ideas for you...
 
> but in the "launchoverlayhide" it does not set the opacity because it does not
> have a reference to the dmdLaunchVideo variable anymore it is null I.E.
> "undefined" so the clear() does not work there
 
Out of curiosity, what makes you think that dmdLaunchVideo is null/undefined there?   
 
(I don't think that's actually what's going on, but if you've actually verified that it's null/undefined there, that might be worth looking into, because that shouldn't happen, unless there's some other code you're leaving out.  In the code you posted, that's a global variable, and you're not changing it anywhere after it's initialized, so it should always be the same.  It would be seriously surprising if it's randomly flitting between null and non-null values at different times.)
 
Here's my theory about what's really happening.  Your "launchoverlaymessage" event handler is re-showing the video every time a launch overlay message is updated.  When you do a launch, that message gets updated repeatedly - "Launching", "Running", "Exiting", and blank messages at the start and end of the process.  So you're starting the video perhaps five times for each game launch.  And this is, in fact, part 1 of where "I can't make the video go away!!!" is coming from.  Since you're launching the video repeatedly, it keeps coming back - and in particular, it comes back after you attempt to get rid of it in "launchoverlayhide".  
 
Part 2 of the problem is even more subtle, and I think it's also where your "this thing loads slowly if I do it from 'launchoverlayshow'" issue is coming from.  I know this is ridiculously confusing, but an animated GIF is actually an image, not a video.  I knew people were going to find that confusing (even though I tried to point it out in a few places in the help), so I set up loadVideo() so that it falls back on the image loader if you try to load an animated GIF through it.  However, videos being videos, there are some different timing properties for video playback, so things get a little weird with the sequencing with videos.  The upshot is that the fallback to the image loader happens on a slight delay.
 
So if you make the following two changes, I think it'll start working a lot more smoothly for you:
 
1.  Change the call to loadVideo() to loadImage() instead
 
2.  Move the video startup to "launchoverlayshow" after all
 


#1119 BPICKINPAUGH

BPICKINPAUGH

    Hobbyist

  • Platinum Supporter
  • 21 posts

  • Flag: United States of America

  • Favorite Pinball: Many different types and era's

Posted 09 April 2020 - 08:54 PM

 

> Out of curiosity, what makes you think that dmdLaunchVideo is null/undefined there?   
 
When I was first testing this and not being able to get it to work I put an alert(dmdLaunchVideo) just to see if it would give me an object and it threw the error in the log.  I just tried it again and I could not reproduce it.
 
>Here's my theory about what's really happening.  Your "launchoverlaymessage" event handler is re-showing the video every time a launch overlay message is updated.  When you do a launch, that message gets updated repeatedly - >"Launching", "Running", "Exiting", and blank messages at the start and end of the process.  So you're starting the video perhaps five times for each game launch.  And this is, in fact, part 1 of where "I can't make the video go away!!!" is >coming from.  Since you're launching the video repeatedly, it keeps coming back - and in particular, it comes back after you attempt to get rid of it in "launchoverlayhide".  
 
That makes perfect sense
 
 
>1.  Change the call to loadVideo() to loadImage() instead
 
I did this initially but only tested it in the launchoverlaymessage, why I didn't try it in launchoverlayshow I will never know  :facepalm:
 
>2.  Move the video startup to "launchoverlayshow" after all
 
I moved it here it performs like it should with the loadImage()  :otvclap:  I still have some work to do but I am almost there
 
Thanks for the guidance!!

 

 

 



#1120 mjr

mjr

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 3,346 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Posted 09 April 2020 - 11:10 PM

 

> Out of curiosity, what makes you think that dmdLaunchVideo is null/undefined there?   

 
When I was first testing this and not being able to get it to work I put an alert(dmdLaunchVideo) just to see if it would give me an object and it threw the error in the log.  I just tried it again and I could not reproduce it.

 

Okay - if it comes back, let me know, since there be something else going on that bears looking into!  We can probably chalk it up for now to some other changes you were making at the time.

 

 

 

I moved it here it performs like it should with the loadImage()  :otvclap:  I still have some work to do but I am almost there

 

Great!