"SchoolMe" flash player, is it vgui, possible to use in lua?!
49 replies, posted
That flash player when you press F1 in sandbox/SchoolMe in console, how did Garry make that, is it possible to use it within LUA? I've found no reference to it anywhere, and since it works outside of game, it's definitely engine based, but is it a vgui component, or something we could potentially use within LUA?
It'd be far better than setting html panels to + 1 - h height and raping FPS.
its an html panel with a flash video
[QUOTE=Bang Train;15751097]its an html panel with a flash video[/QUOTE]
Except it's not. I highly doubt Garry would use the hacky +1-1 height stuff, and there's the fact it doesn't lag, whereas setting height stuff does.
There's no way it's HMTL, or at least the normal way.
[editline]05:30PM[/editline]
[QUOTE=Dave_Parker;15751623]GCF -> Help -> resources -> movies[/QUOTE]
Not helpful.
It's most likely in one of the dlls if not in sandbox's files. And it is done with html.
[QUOTE=Nevec;15752229]It's most likely in one of the dlls if not in sandbox's files. And it is done with html.[/QUOTE]
Well, it's definitely not LUA/Sandbox, since it works out of game, and anywhere, it's an engine command. But damn, which dll, and there must be a way to tap into that using LUA and maybe a custom module.
We need Garry :(
....all he did was make a vgui screen with a dll....
it just works better (the dll version)
[QUOTE=Bang Train;15752781]....all he did was make a vgui screen with a dll....
it just works better (the dll version)[/QUOTE]
Yes, I know that. I'm asking HOW and if it's possible to make a module to use this in LUA, or directly use it within LUA. Am I that hard to understand?
[QUOTE='-[ Fizzadar ]-;15752801']Yes, I know that. I'm asking HOW and if it's possible to make a module to use this in LUA, or directly use it within LUA. Am I that hard to understand?[/QUOTE]
It works just like the motd, it's not a real site it's just a .html file. Which means your directly reading the file and not waiting for a site explaining the lag.
[B]Edit:[/B]
Although I do wonder about how he does it. There doesn't seem to be any code on it other than the command "SchoolMe" run on "GM:ShowHelp"
But you can do it just the same with an html panel.
[QUOTE=find me;15752955]It works just like the motd, it's not a real site it's just a .html file. Which means your directly reading the file and not waiting for a site explaining the lag.
[B]Edit:[/B]
Although I do wonder about how he does it. There doesn't seem to be any code on it other than the command "SchoolMe" run on "GM:ShowHelp"
But you can do it just the same with an html panel.[/QUOTE]
hardcoded into the game.dll with a console command binded to open it
No, I mean no playing lag. The HTML vgui does not auto-update, and thus videos do not work normally, without the hacky changing height "fix". Try it, open up a youtube video in a HTML vgui, it won't "play" visually unless you clock, or use the hacky method, which lags massively (160fps to 10 for me)
Garry's doesn't, so I assume he's either using some form of "working" HTML vgui or another thing entirely.
[QUOTE=Dave_Parker;15753275]Actually, there should have been more to my post, but what I meant was that because it doesn't get the files from a real webpage it just uses http.Get() to retrieve contents from the gcf, which contains a CSS file, javascript files, a html file and the flash movies. If you look in there you'll also see the background (I thought that was done with RoundedBox :| )
EDIT:
The Javascript interacts with lua?[/QUOTE]
Unlikely Garry has build a secret rendering engine into gmod.
[QUOTE=Dave_Parker;15753275]Actually, there should have been more to my post, but what I meant was that because it doesn't get the files from a real webpage it just uses http.Get() to retrieve contents from the gcf, which contains a CSS file, javascript files, a html file and the flash movies. If you look in there you'll also see the background (I thought that was done with RoundedBox :| )
EDIT:
The Javascript interacts with lua?[/QUOTE]
You do not need to repeat exactly what I said with more words ;). If he does not want to pay attention to my previous post then let him. Like I said, you are reading the stuff straight from a file every player has by default and not retrieving it from some random website out of nowhere.
[B]Edit:[/B]
Ex. You click on a video file you have on your desktop, instant play. You stream a video from youtube, buffering needed.
[QUOTE='-[ Fizzadar ]-;15751811']Except it's not. I highly doubt Garry would use the hacky +1-1 height stuff, and there's the fact it doesn't lag, whereas setting height stuff does.
There's no way it's HMTL, or at least the normal way.
[editline]05:30PM[/editline]
Not helpful.[/QUOTE]
Clearly you know very little then, check out "garrysmod\garrysmod\help\index.html"
This has been asked a million times in the past month, how haven't you seen ANY of the threads?
[QUOTE=Dave_Parker;15753275]Actually, there should have been more to my post, but what I meant was that because it doesn't get the files from a real webpage it just uses http.Get() to retrieve contents from the gcf, which contains a CSS file, javascript files, a html file and the flash movies. If you look in there you'll also see the background (I thought that was done with RoundedBox :| )
EDIT:
The Javascript interacts with lua?[/QUOTE]
What?
I have seen the posts, I know of that file. Please explain how you can have flash play in a HTML frame in derma with it moving, without ANY extra (or just a small amount) of lag on the FPS. Seriously, load fucking youtube up, it DOESNT run the flash, unless you change height, which RAPES FPS.
Jesus fucking christ, am I THIS hard to understand??!
/rage
[QUOTE='-[ Fizzadar ]-;15755562']Seriously, load fucking youtube up, it DOESNT run the flash, unless you change height, which RAPES FPS.[/QUOTE]
Loads fine for me? Install flash?
Try making one with regular VGUI instead of derma. derma is pretty fatty for panel drawing. I don't think garry uses derma in that menu which may be why it runs a little better.
[QUOTE=TehBigA;15755725]Loads fine for me? Install flash?
Try making one with regular VGUI instead of derma. derma is pretty fatty for panel drawing. I don't think garry uses derma in that menu which may be why it runs a little better.[/QUOTE]
Oops, ignore the derma. When I create a standard HTML vgui on my screen and stick it anywhere, youtube videos go black with the loading thing, sound starts and the html frame does nothing unless I click on it, try it, I swear the wiki even states this.
Either its bugged and garry is using something else or I'm bugged :(
The whole problem stemmed from me drawing the html vgui in 3D, and I thought it was just 3D which didn't "animate" but it turns out, for me, 2D doesn't work either.
[QUOTE='-[ Fizzadar ]-;15755760']Oops, ignore the derma. When I create a standard HTML vgui on my screen and stick it anywhere, youtube videos go black with the loading thing, sound starts and the html frame does nothing unless I click on it, try it, I swear the wiki even states this.
Either its bugged and garry is using something else or I'm bugged :(
The whole problem stemmed from me drawing the html vgui in 3D, and I thought it was just 3D which didn't "animate" but it turns out, for me, 2D doesn't work either.[/QUOTE]
You have answered your own question "the html frame does nothing unless I click on it"
You are only going to get the video to work if you keep clicking on the frame a hundred times or you put it in think/huddraw.
Now this explains the lag, it's lagging because your getting a bunch of shit from youtube every frame or click.
And now on to the "SchoolMe" the reason that does not lag first off is because every client has these videos already downloaded so instead of it streaming to them like with youtube it is just playing. I'm sure the reason he didn't just do the video stuff in lua is because he didn't want people trying to copy it since it wouldn't work unless you stream the video which is a bad idea and maybe just doing it the way he did produces even less lag.
I'm probably wrong on some of this but the point is you can't stream videos with lua. The only way would be to send the videos and play them while uploading the screen(I'm pretty sure you can't send those types of files to clients) this is what garry does but since we already have these videos its all good.
No, it's NOTHING to do with downloading lag, that's bollocks, because it plays anyway. Load up a youtube vid, try it, it'll play sound, but without video. Each click brings it up to the latest moment.
Now, the hack to force it to re-draw every frame is to set tall -1 and back, redrawing it, but this rapes FPS.
Clearly Garry has not done this, because it doesn't rape FPS, so how does he get his html to play the video rather than freeze it with sound. And you don't have to spam click to keep it running.
[editline]12:34AM[/editline]
Well I emailed Garry:
[quote]
The HTML control has a function that sets how many times a second it should redraw. I don't remember what the function is called.
garry
[/quote]
Now to go find it :P
Try: HTML:AnimationThinkInternal(0.001)
You eyes can only see roughly around 24fps, varies from person to person, I think 100 times per second (If that function is it) would work.
Strange, the function does exsist, but it still doesn't update, any ideas? Where did you find that anyway?
lua_run_cl for k, v in pairs(_R["Panel"]) do Msg( k.." = "..tostring(v).."\n" ) end
Now that I think of it, I might have done Player by accident lol
[QUOTE=TehBigA;15763626]You eyes can only see roughly around 24fps, varies from person to person, I think 100 times per second (If that function is it) would work.[/QUOTE]
Might only be able to [i]clearly[/i] see 24FPS, but one can definitely see a difference between that and 60+. I think it's around 60 or 70+ that you can't really detect any difference. Anyway, 29.97 (or 30) FPS is a decent standard for movies, that would be a good refresh rate.
Looks like all those animation things are just moving the panels around:
[url]http://luabin.foszor.com/code/lua/includes/extensions/panel_animation.lua[/url]
Damn, I've asked Garry via email for the name of the function, with no reply yet. And because the SchoolMe command isn't written directly in any lua files, we can't find out ourselves.
I've also tried a load of other commands on the list which sounded like they might work, with no luck. We need Garry.
Fizzadar, SchoolMe is just a HMTL panel.
Flash works in the html implementation of source, I've seen it work.
[QUOTE=slayer3032;15771659]Fizzadar, SchoolMe is just a HMTL panel.
Flash works in the html implementation of source, I've seen it work.[/QUOTE]
We've been through this above. Open youtube or even Garrys page in a HTML vgui and watch it NOT animate or do anything except sound.
Garry even told me he used a specific function to update it, but couldn't remember the name offhand. All we need now is this name and it's sorted.
Interesting, I always thought the flash would update it's self and stuff like youtube videos just didn't.
I just tried opening a page with help stuff in it and it didn't work.
Nevermind then.
Anyone?
[QUOTE='-[ Fizzadar ]-;15751811']Except it's not. I highly doubt Garry would use the hacky +1-1 height stuff, and there's the fact it doesn't lag, whereas setting height stuff does.
There's no way it's HMTL, or at least the normal way.
[editline]05:30PM[/editline]
Not helpful.[/QUOTE]
Wow don't be so stupid, that path was actually helpful because IT IS HTML.
[img]http://i42.tinypic.com/2wekv1u.jpg[/img]
And this
[cpp]//-----------------------------------------------------------------------------
// Purpose: Causes the HTML window to repaint itself every 100ms, to allow animaited gifs and the like
//-----------------------------------------------------------------------------
void HTML::StartAnimate(int time)
{
// a tick signal to let the web page re-render itself, in case of animated images
//ivgui()->AddTickSignal(GetVPanel());
m_iAnimTime=time;
}
//-----------------------------------------------------------------------------
// Purpose: stops the repainting
//-----------------------------------------------------------------------------
void HTML::StopAnimate()
{
m_iNextFrameTime=0xffffffff; // next update is at infinity :)
m_iAnimTime=0;
}
// ... truncated some stuff
//-----------------------------------------------------------------------------
// Purpose: get called when IE wants us to redraw
//-----------------------------------------------------------------------------
void HTML::OnUpdate()
{
// only let it redraw every m_iAnimTime milliseconds, so stop it sucking up all the CPU time
if (m_iAnimTime && system()->GetTimeMillis() >= m_iNextFrameTime)
{
m_iNextFrameTime = system()->GetTimeMillis() + m_iAnimTime;
m_bRegenerateHTMLBitmap = true;
if ( !surface()->SupportsFeature( ISurface::DIRECT_HWND_RENDER ) )
{
Repaint();
}
}
int w, h;
GetSize(w, h);
CalcScrollBars(w, h);
BrowserResize();
}
[/cpp]
If StartAnimate or Repaint doesn't work, there's no chance of animating it.
[QUOTE=SteveUK;15798996]Wow don't be so stupid, that path was actually helpful because IT IS HTML.
[img]http://i42.tinypic.com/2wekv1u.jpg[/img][/QUOTE]
Did you not read the whole thread?
[QUOTE=TehBigA;15754050]Clearly you know very little then, check out "garrysmod\garrysmod\help\index.html"
This has been asked a million times in the past month, how haven't you seen ANY of the threads?
What?[/QUOTE]
Sorry, you need to Log In to post a reply to this thread.