GotoWeb(); Relative URL NOT Absolute?
by Mark Grob · in Torque Game Engine · 04/20/2005 (6:48 pm) · 8 replies
I am trying to release a project onto CD, I would like to have it load the HTML off the CD instead of having togo online... is this possiable within Torque?
I know I can use gotoweb("http://absolutesite.com");
But I want to target a subdirectry instead. If I enter in any string value it automatically sets it to: http:// instead of say... file:/// or localhost?
Advise on how to make this work?
I know I can use gotoweb("http://absolutesite.com");
But I want to target a subdirectry instead. If I enter in any string value it automatically sets it to: http:// instead of say... file:/// or localhost?
Advise on how to make this work?
#2
I use file:// and I have to use two different paths for the PC and Mac/Linux.
Currently I have two version files of the game.cs.. one for PC and one for Mac/Linux. I would like to consolidate it to one file or use relative paths to the .exe or .app file.
Suggestions?
04/24/2005 (8:34 am)
The issues I am having with my project currently. I use file:// and I have to use two different paths for the PC and Mac/Linux.
Currently I have two version files of the game.cs.. one for PC and one for Mac/Linux. I would like to consolidate it to one file or use relative paths to the .exe or .app file.
Suggestions?
#3
04/24/2005 (8:58 am)
Note that different browsers will also interpret file: links differently, even on Win32. Test with at least IE, Mozilla, and Opera on Win32. The choices are even wider on Linux, but they're less likely to vary on interpretation since they don't have to worry about drive letters.
#4
Kind of check OS function->then change a global variable based on OS and browser->then substitute the string value into the function?
Forgive me if the question has a simple answer.. but it's my first time scripting instead of coding C/C++.
04/24/2005 (9:04 am)
Kenneth any suggestions on scripting a solution of if statements in Torque that can detect and then change the gotoweb(); depending on what OS and what browser is being used?Kind of check OS function->then change a global variable based on OS and browser->then substitute the string value into the function?
Forgive me if the question has a simple answer.. but it's my first time scripting instead of coding C/C++.
#5
The nasty thing is that it might have to evolve over time to accomodate new browsers. So the rule might want to be in script so the user can easily extend it, at least on Win32.
I'd suggest first trying it on different browsers on Win32 to see how much variation there is, and if the different browser suppliers have any suggestions on how to come up with a consistent value, if it's not.
You'd mentioned CD for Linux. In that case you need to know the mount point of the CD. How do you determine that?
04/24/2005 (9:26 am)
It's probably something that belongs in the engine instead of script, in the platform handler for gotowebpage.The nasty thing is that it might have to evolve over time to accomodate new browsers. So the rule might want to be in script so the user can easily extend it, at least on Win32.
I'd suggest first trying it on different browsers on Win32 to see how much variation there is, and if the different browser suppliers have any suggestions on how to come up with a consistent value, if it's not.
You'd mentioned CD for Linux. In that case you need to know the mount point of the CD. How do you determine that?
#6
Mozilla based browsers and Safari all call it from either the /dev/ directory or from MacOS 10.x it mounts them from the /Volumes/ directory.
The issues I find is typically win32... since it like to use IE as the filemanagement system as well... so it's not consistant with the syntax of MacOS or Linux.
That ever annoying D:// or E:// so this is were the issue is... Most user have one drive so the D: is a safe bet... but how to determine that in a script... would be very nice.
04/24/2005 (9:47 am)
For Mac and Linux:Mozilla based browsers and Safari all call it from either the /dev/ directory or from MacOS 10.x it mounts them from the /Volumes/ directory.
The issues I find is typically win32... since it like to use IE as the filemanagement system as well... so it's not consistant with the syntax of MacOS or Linux.
That ever annoying D:// or E:// so this is were the issue is... Most user have one drive so the D: is a safe bet... but how to determine that in a script... would be very nice.
#7
Can you write the location during installation to a prefs file? You could write a second prefs value of the file: prefix to use.
04/24/2005 (10:07 am)
I've got many partitions on many hard disks, some USB (and so not always there), and both a CD writer and DVD writer, plus another DVD writer via USB. Then you have to worry about USB memory sticks. But I guess I'm not the usual user. ;)Can you write the location during installation to a prefs file? You could write a second prefs value of the file: prefix to use.
#8
here is how i made a dynamic webpage link. (I am using the RTS kit for this.)
Now if only i could get my hands on that hard to find embeded web browser! I tried using the one from TGB but am having all sorts of problems compiling and modifying for TGE 1.5.2 so if anyone hase the files for the outdated and now dead "embeded web browser" resource i would love to get my hands on that thanks.
03/24/2008 (9:05 am)
Sorry to dig up a very very old thread but i was trying to make a dynamic webpage link. So I found a solution and felt i should share. I know alot of people in this comunity wish there was more information about how to do things so i am going to start contributing as much as i can. here is how i made a dynamic webpage link. (I am using the RTS kit for this.)
function ButtonUse(%pt)
{
%activeBuilding = ServerConnection.resolveGhostID(%building);
switch$(%pt)
{
case "1" :
//I am setting the sid (sid is a simulated id... custom variable) because this building doesent have one.
//Need to connect this to the api assinment window and functions i made.
%activeBuilding.sid = 13;
//nsid means new sid
%nsid = %activeBuilding.sid;
echo(%nsid); //make sure it has a nsid for the next part
//I am glad i spent time learning asp. this allows me to make dynamic links into dynamic websites. HOW COOL!!
gotoWebPage("http://localhost/Test/Test.aspx?api=" @ %nsid @ "");
case "2" :
//lets see what the sid is for this building...
%nsid = %activeBuilding.sid;
echo(%nsid);
}
}and there you have it, a function that gets an objects ID (in my case a building) and allows you to use that id to launch a dynamic webpage. this ID could be replaced by any objects value. I currently have mine hooked into a huge database and use the .net to do things with the database.Now if only i could get my hands on that hard to find embeded web browser! I tried using the one from TGB but am having all sorts of problems compiling and modifying for TGE 1.5.2 so if anyone hase the files for the outdated and now dead "embeded web browser" resource i would love to get my hands on that thanks.
Torque 3D Owner Tom Bampton