Invoke a web browser
by Jonathan Robinson · in General Discussion · 04/29/2007 (7:09 am) · 10 replies
I was just wondering if anyone knows if its possible to invoke a web browser to open up to a designated website. I am having to build a virtual tour and would like people to be able to open up a website by interacting with a computer dts object! If this is possible can someone give me some insite into this?
Thanks.
Jon.
Thanks.
Jon.
About the author
#3
Thanks.
@ David. Thanks i'll look into it.
Jon.
04/29/2007 (8:03 am)
Hi Aaron. Yeh i thought it was possible however had my reserves about using a dts object. Another quick question. Is it possible to have a menu pop up when a player enters a particular area. Something along the lines of like a sound emiter, but apart from playing the sound it opens a menu. I was hoping to maybe add "press 'F' to interact with object" So when F was pressed it would open up the web page!Thanks.
@ David. Thanks i'll look into it.
Jon.
#4
However, one big problem with it so far is that once a user clicks a web-page link from within the in-game browser gui, it gets focus and traps most keyboard keystrokes until the user switches to another app and then back to TGE. I'm sure it's an easy fix, but until resolved, it will cause problems with the in-game text chat system and the command console (among others.)
As to your other question, yes, you can set up a trigger to do exactly that. The codesampler website has some good info on triggers. There are other places to find trigger help as well.
[Edit: added some linkage]
04/29/2007 (8:17 am)
The resource David linked to is excellent. I'm currently using it in TGE and it works great. There are a few caveats to it though. Page content isn't updated automatically, so some flash animations and videos don't work the way they should -- animated Gifs work great, however. Javascript seems to work ok for me. You will probably want to install firefox on your system (if you haven't already) and install all of the plugins you use on a regular basis (like Flash, etc.) and then copy the contents of the plugins folder to the appropriate plugins folder in your browser-enabled TGE game.However, one big problem with it so far is that once a user clicks a web-page link from within the in-game browser gui, it gets focus and traps most keyboard keystrokes until the user switches to another app and then back to TGE. I'm sure it's an easy fix, but until resolved, it will cause problems with the in-game text chat system and the command console (among others.)
As to your other question, yes, you can set up a trigger to do exactly that. The codesampler website has some good info on triggers. There are other places to find trigger help as well.
[Edit: added some linkage]
#5
I am currently tyring to compile it and get it working. Looks a good feature. let me know if the bugs get sorted. I only have to implement the function and show it could work. So it will do for the time being.
Thanks alot for you help.
Jon.
04/29/2007 (8:56 am)
HI AaronI am currently tyring to compile it and get it working. Looks a good feature. let me know if the bugs get sorted. I only have to implement the function and show it could work. So it will do for the time being.
Thanks alot for you help.
Jon.
#6
Thanks.
Jon.
04/29/2007 (10:04 am)
Aaron sorry to keep nagging you. How did you go about adding this to the game engine? I am having problems with linking to llmozlib. Llmozlib is in C:\Torque\TGE_1_5_1\lib\llmozlib. I presume this is right.Thanks.
Jon.
#7
I'm still trying to figure everything out with the web browser resource, but I'll help however I can. If you get a chance, read up on some of Josh Ritter's blog posts to get some background on this excellent code.
Getting llmozlib in isn't too bad. In Visual Studio, just go to Project, Torque Demo Properties and at the dialog box, find the Linker folder and then the Input section. Once there, you should see a list of property options. At the top of that should be Additional Dependancies with several files listed. If you point to what appears to be the end of the list, look for an elipsis button (. . .) and click it to see the current input linker dependancy list. From there, you can just scroll down to the end of the list and type llmozlib.lib (in the first section, not the inherited values section). After you've done all that, hit OK. If you've done everything else in the instructions, be sure to clean everything and re-build the demo.
Hopefully you've followed all of Josh's instructions properly and (cross your fingers) it should work. :)
Good luck and have fun.
[Edit: fixed some typos]
04/29/2007 (4:05 pm)
Jonathan,I'm still trying to figure everything out with the web browser resource, but I'll help however I can. If you get a chance, read up on some of Josh Ritter's blog posts to get some background on this excellent code.
Getting llmozlib in isn't too bad. In Visual Studio, just go to Project, Torque Demo Properties and at the dialog box, find the Linker folder and then the Input section. Once there, you should see a list of property options. At the top of that should be Additional Dependancies with several files listed. If you point to what appears to be the end of the list, look for an elipsis button (. . .) and click it to see the current input linker dependancy list. From there, you can just scroll down to the end of the list and type llmozlib.lib (in the first section, not the inherited values section). After you've done all that, hit OK. If you've done everything else in the instructions, be sure to clean everything and re-build the demo.
Hopefully you've followed all of Josh's instructions properly and (cross your fingers) it should work. :)
Good luck and have fun.
[Edit: fixed some typos]
#8
Thanks for getting back to me. I am new to this and have never used Visual Studio but I am getting there. I followed the instructions from the website down to the T. However I am still having problems. I had already done the stages you suggested and have re-checked them all over and over again. But I am still having problems. It just doesn't want to compile!
ERROR MESSAGE
Where exactly are you palcing you files within the torque file structure? Its not exactly to the instructions is it? But it make scense to palce llmozlib in C:\Torque\TGE_1_5_1\lib.
And to palce browser in C:\Torque\TGE_1_5_1\engine\gui.
The to simply link to these folders when you are setting the folder paths in Visual C++2005EE.
I can't see why its not compiling properly.
BTW it does compiles just fails to link with this part at the end. But the GuiBrowser isn't present in Torque.
Sorry for long post.
Thanks.
Jon.
Can IM me Rob32298@hotmail.com
04/29/2007 (5:12 pm)
Hi AaronThanks for getting back to me. I am new to this and have never used Visual Studio but I am getting there. I followed the instructions from the website down to the T. However I am still having problems. I had already done the stages you suggested and have re-checked them all over and over again. But I am still having problems. It just doesn't want to compile!
ERROR MESSAGE
Where exactly are you palcing you files within the torque file structure? Its not exactly to the instructions is it? But it make scense to palce llmozlib in C:\Torque\TGE_1_5_1\lib.
And to palce browser in C:\Torque\TGE_1_5_1\engine\gui.
The to simply link to these folders when you are setting the folder paths in Visual C++2005EE.
I can't see why its not compiling properly.
BTW it does compiles just fails to link with this part at the end. But the GuiBrowser isn't present in Torque.
Sorry for long post.
Thanks.
Jon.
Can IM me Rob32298@hotmail.com
#9
I'm guessing everything should work fine with VS2005, but I have only tried this code add using VS2003. I may have to try it out on the other compiler, just to see what happens.
05/01/2007 (10:27 am)
Just getting back to this thread. Make sure you're adding the files themselves into the project. That's what I do, at least. I'm coding-challenged, however, so that might be bad advice. :)I'm guessing everything should work fine with VS2005, but I have only tried this code add using VS2003. I may have to try it out on the other compiler, just to see what happens.
#10
Jon.
05/01/2007 (12:36 pm)
Thanks Aaron for getting back to me. I have moved away from VS2005 and am now using VS.Net2003 so I will push ahead and see if it works with this. I wouldn't worry my coding skills aren't at all good in C++ or in these compilers. I'll give it ago and see how I get on.Jon.
Torque Owner Aaron E
Default Studio Name