TGE Browser Plugin Online
by Neil Marshall · 07/19/2006 (1:49 pm) · 51 comments
It's TGE Browser Plugin time again...

* TDN Resource Page
* The code itself
* A Live example
Even though I haven't written a plan/blog in a while, I've still been working on the code. I finally got most of it working today and put it online for people to try out/download and mess around with. It would be great if people could test out, not only the live example, but the source code as well. I'm interested in knowing if all the steps on the wiki actually work for other people. I'm sure I've missed SOMETHING.
Known Bugs:
The plugin will crash when you close the tab/window which houses it in Firefox. If someone could help me with this one it would be fantastic. :)
Thats it!
- NeilM

* TDN Resource Page
* The code itself
* A Live example
Even though I haven't written a plan/blog in a while, I've still been working on the code. I finally got most of it working today and put it online for people to try out/download and mess around with. It would be great if people could test out, not only the live example, but the source code as well. I'm interested in knowing if all the steps on the wiki actually work for other people. I'm sure I've missed SOMETHING.
Known Bugs:
The plugin will crash when you close the tab/window which houses it in Firefox. If someone could help me with this one it would be fantastic. :)
Thats it!
- NeilM
About the author
#22
The plugin mainly makes changes in winWindow.cc so if you haven't changed those low level files any, then that shouldn't be a problem. The .vcproj files are new, so they shouldn't be a problem but you will have to add your files to that project file. In MSVC++ you should be able to right click on your project and import the existing .vcproj file.
The plugin project makes quite a few changes to the project settings but those SHOULD only be in the .vcproj file, but double check before you do anything. And remember, the plugin code is based on v1.4 not the latest 1.5.
12/09/2006 (7:10 am)
What I would suggest doing is grabbing a program called Beyond Compare. What it allows you to do is compare one directory structure to another, and then open the text files and copy line by line the changes. It makes merging 2 projects simple.The plugin mainly makes changes in winWindow.cc so if you haven't changed those low level files any, then that shouldn't be a problem. The .vcproj files are new, so they shouldn't be a problem but you will have to add your files to that project file. In MSVC++ you should be able to right click on your project and import the existing .vcproj file.
The plugin project makes quite a few changes to the project settings but those SHOULD only be in the .vcproj file, but double check before you do anything. And remember, the plugin code is based on v1.4 not the latest 1.5.
#24
If there are other issues, I guess to get anywhere with this I'll need to upgrade to VC/VS 2005 Standard to get the ATL support in any case. Then fix up the other issues.
Gordon
12/12/2006 (12:09 pm)
Neil, when you say the plugin doesn't compile in VS2005 - is this actually a problem only for VC++2005 Express which doesn't have ATL support?If there are other issues, I guess to get anywhere with this I'll need to upgrade to VC/VS 2005 Standard to get the ATL support in any case. Then fix up the other issues.
Gordon
#25
12/12/2006 (3:13 pm)
I've never actually tried to compile it in 2005. The .vcproj and .sln files are 2003.net format.
#26
I followed your advice using Beyond Compare. Some files were a little tricky but generally painless. My next issue is, as I said above, that VC++ 2005 Express edition doesn't include the ATL libraries (you can include them but they are out of date). I'm going to have to get a copy of VS2005 Standard Edition and crack on from there.
12/12/2006 (3:17 pm)
Ah, OK, it's just there's a comment in the resource about "Broken in VS2005" unless I misread it.I followed your advice using Beyond Compare. Some files were a little tricky but generally painless. My next issue is, as I said above, that VC++ 2005 Express edition doesn't include the ATL libraries (you can include them but they are out of date). I'm going to have to get a copy of VS2005 Standard Edition and crack on from there.
#27
I've got the plugin working in VS2005 btw. For anyone else trying to use the plugin in an existing project with 2005 here are some pointers:
1) Get a copy of VS2005 Standard, Express is no good as it doesn't have the proper ATL libraries.
2) As Neil suggested, extract the files and use Beyond Compare to integrate them into your project.
3) Add the np3DPlugin project to your Solution.
4) Copy into the np3DPlugin project any extra files your game may be using that you have added to the engine (otherwise, like me, you'll get loads of linker errors!)
5) A number of the functions have changed 2003 -> 2005. Generally these relate to UTF16 being replaced by wchar_t. I found that castings in the relevant places sorted this out.
Thanks for a great resource Neil, it really does open up some great possibilities!
12/22/2006 (4:04 pm)
Hi Neil, just a quick query about the html/javascript example files you included. My HTML/Javascript knowledge is poor. Is what is happening here basically (1) the HTML calls the Javascript file (2) Javascript file contains a load of parameters for the plugin and then launches it?I've got the plugin working in VS2005 btw. For anyone else trying to use the plugin in an existing project with 2005 here are some pointers:
1) Get a copy of VS2005 Standard, Express is no good as it doesn't have the proper ATL libraries.
2) As Neil suggested, extract the files and use Beyond Compare to integrate them into your project.
3) Add the np3DPlugin project to your Solution.
4) Copy into the np3DPlugin project any extra files your game may be using that you have added to the engine (otherwise, like me, you'll get loads of linker errors!)
5) A number of the functions have changed 2003 -> 2005. Generally these relate to UTF16 being replaced by wchar_t. I found that castings in the relevant places sorted this out.
Thanks for a great resource Neil, it really does open up some great possibilities!
#28
Yes. The HTML calls the JavaScript, which then writes the plugin to the html page and then it runs. You need to have the Javascript write the object tag to the html on the fly to work around the Eolas patent "feature." Microsoft had to add it to the two latest versions of IE because they lost the court case. ( http://www.eweek.com/article2/0,1895,1932304,00.asp )
Also, IE doesn't support a standards compliant object tag call so that is why Firefox requires a different one.
12/22/2006 (8:28 pm)
Awesome to hear that it works in 2005! Feel free to update the TDN article with these notes on 2005.Yes. The HTML calls the JavaScript, which then writes the plugin to the html page and then it runs. You need to have the Javascript write the object tag to the html on the fly to work around the Eolas patent "feature." Microsoft had to add it to the two latest versions of IE because they lost the court case. ( http://www.eweek.com/article2/0,1895,1932304,00.asp )
Also, IE doesn't support a standards compliant object tag call so that is why Firefox requires a different one.
#29
I want to help port this to TGEA too. I even want to pay someone to help me do it.
Please see:
www.garagegames.com/index.php?sec=mg&mod=project&page=view.job&qid=5841
If you know of anyone who can help or anyone who need the same thing, then please let me know.
01/15/2007 (2:14 am)
Thanks Neil and co. it's a great project. I want to help port this to TGEA too. I even want to pay someone to help me do it.
Please see:
www.garagegames.com/index.php?sec=mg&mod=project&page=view.job&qid=5841
If you know of anyone who can help or anyone who need the same thing, then please let me know.
#30
The only problem I have is that I am also using the MMOKit with TGEA, which obviously affects my build.
Edit>> Now realise TGEA is TGE Advanced and not TGE + Arcane FX!!
01/15/2007 (6:01 am)
Thomas - I was about to see what happened to this and TGEA (I assume this acronym is now for TGE + Arcane FX?) I haven't started yet, but would be very interested in helping or testing. Have you tried? What are the problems?The only problem I have is that I am also using the MMOKit with TGEA, which obviously affects my build.
Edit>> Now realise TGEA is TGE Advanced and not TGE + Arcane FX!!
#31
I'm trying to get this to work with TGE 1.5 (and AFX). It all seems to compile fine, but what I'm seeing is nothing (white) where the plugin should appear. However, as I resize the browser window, the mainmenu.gui flickers into view. As soon as I stop resizing, it's back to white again.
Any idea in your code where I should start to look to try and fix this? Its as though the picture is being deleted immediately after being rendered.
Thanks,
Gords
01/21/2007 (4:25 pm)
Neil,I'm trying to get this to work with TGE 1.5 (and AFX). It all seems to compile fine, but what I'm seeing is nothing (white) where the plugin should appear. However, as I resize the browser window, the mainmenu.gui flickers into view. As soon as I stop resizing, it's back to white again.
Any idea in your code where I should start to look to try and fix this? Its as though the picture is being deleted immediately after being rendered.
Thanks,
Gords
#32
01/21/2007 (7:14 pm)
I haven't really touched this in a long time, but the problem area is either in the WM_RESIZE event or WM_PAINT events. As for which files those are processed in, look in winWindow.cc and winD3DVideo.cc. You'll see some of the TORQUE_PLUGIN ifdef's in there and then you should compare the differences between 1.4 and 1.5 to see what has changed.
#33
TGE1.5 or AFX changes the gameInterface.cc file a fair bit. By re-entering "processEvent(&event);" at the end of the postEvent function, this seems to solve the plugin-flickering problem I was previously having.
Hope this helps somone out!
Neil - was this designed to be used for standalone games or with a dedicated server? I get an odd error when the game itself tries to load (invalid packet) but I'm not sure if I've got the server build right yet.
Gords
01/22/2007 (10:06 am)
I **think** I've just cracked this one for anyone interested. But I'm not sure if this opens up a whole other barrel of problems...TGE1.5 or AFX changes the gameInterface.cc file a fair bit. By re-entering "processEvent(&event);" at the end of the postEvent function, this seems to solve the plugin-flickering problem I was previously having.
Hope this helps somone out!
Neil - was this designed to be used for standalone games or with a dedicated server? I get an odd error when the game itself tries to load (invalid packet) but I'm not sure if I've got the server build right yet.
Gords
#34
Gords
01/30/2007 (6:31 pm)
If anyone is trying to use the plugin with a dedicated server and hit mission loading problems, I started a thread here that may be useful... www.garagegames.com/mg/forums/result.thread.php?qt=57059#427974Gords
#35
I have no idea why this works, but it seems to do the job. Without the #ifdefs the game goes into super-fast-motion if you do a non-plugin standalone build!
Neil - I'm just going through the download/code-signing stuff. Do I take it that the cab file that is downloaded expects the stub_setup.exe to copy the plugin into the relevant Firefox and IE directories?
For anyone's interest Paquet Builder seems to be a great tool for installs, although its code signing facilty is a bit poor. Better to do that on the command line!
Gords
02/03/2007 (5:15 pm)
A qualification to one of my previous posts. If you are using TGE1.5 (+ AFX?) add the following code to the bottom of the gameInterface.cc postEvent function.#ifdef TORQUE_PLUGIN
processEvent(&event);
#endifI have no idea why this works, but it seems to do the job. Without the #ifdefs the game goes into super-fast-motion if you do a non-plugin standalone build!
Neil - I'm just going through the download/code-signing stuff. Do I take it that the cab file that is downloaded expects the stub_setup.exe to copy the plugin into the relevant Firefox and IE directories?
For anyone's interest Paquet Builder seems to be a great tool for installs, although its code signing facilty is a bit poor. Better to do that on the command line!
Gords
#36
02/05/2007 (8:03 am)
Yes, the stub_setup.exe is just an install file which downloads the full installer which may be large in size. You could make the cab file install the full piece of software if you like, but some users may not think the plugin is downloading and hit reload.
#37
tdn.garagegames.com/wiki/TGE/Code/How_to_make_torque_a_plugin
02/08/2007 (12:33 pm)
I've integrated this with TGE 1.5 and updated the TDN page with the new version. I've left the 1.4 version there for people who haven't updated yet.tdn.garagegames.com/wiki/TGE/Code/How_to_make_torque_a_plugin
#39
06/30/2007 (7:26 pm)
I haven't worked on it for a long time. Whatever is up on the TDN is all there is.
#40
There are two plugins for TGE 1.4 and TGE 1.5, but TGE 1.4 is old and TGE 1.5 can't be downloaded at all.
I tried to patch plugin to TGE 1.5.2, but failed.
Anyway, Thank you for your good resource.
Andy
06/30/2007 (10:04 pm)
To Neil M.There are two plugins for TGE 1.4 and TGE 1.5, but TGE 1.4 is old and TGE 1.5 can't be downloaded at all.
I tried to patch plugin to TGE 1.5.2, but failed.
Anyway, Thank you for your good resource.
Andy
Torque Owner Gordon Marsh
This looks like a great resource.
Although I understand the resource notes you've written, could you give a few pointers to integrating this into an existing Torque project?
I have my current game with its own .SLN file in VC++ 2005. To make it into a plugin, if I do the following do you think it would work?
1. Extract your files over (a copy of!) my existing Torque folder.
2. Load up my existing solution file.
3. Add your new plugin-related project files
4. Compile the np3Dplugin project.
Hey presto my game is now a plugin?
Any pointers appreciated...
Gords