Game Development Community

T3D 1.1 BETA 2 - GotoWebPage command on GUI button crashes game - NOT A BUG

by Jules · in Torque 3D Professional · 08/25/2010 (1:54 pm) · 13 replies

Using; (example domain)
gotowebpage("http://www.torquepowered.com");";

Within a GUI button, adding the above code to the command field of the button crashes the game after pressing it more than once when running the game executable.

o/s: Windows Vista

#1
08/25/2010 (8:26 pm)
gotowebpage("http://www.torquepowered.com");"; Notice a missing quote? " .
#2
08/25/2010 (9:03 pm)
@Julian
You've got an extra quotation mark and semicolon at the end of your line. Remove that and it'll work.

gotowebpage("http://www.torquepowered.com");

Removed bug tag.
#3
08/26/2010 (7:04 am)
thanks guys :) should have looked up the syntax. One of my dumass days!
#4
08/26/2010 (1:12 pm)
Still getting the crashing. The syntax is correct, it was my post that wasn't - can you guys test it for me to make sure it's not at my end.

Cheers

Using in GUI editor under command:

gotowebpage("http://www.something2play.com");

Cut from the MainMenuGui file itself:

command = "gotowebpage(\"http://www.something2play.com\");";

I'll try calling a function at the bottom of the gui file instead, see if that is any better.
#5
08/26/2010 (1:16 pm)
Also another thing - try typing in the command line in the GUI editor with your caps lock on (it defaults to lowercase), but with caps off and pressing shift you get uppercase.
#6
08/26/2010 (1:18 pm)
Ok adding a function call in the command for example: gotoWebsite();

adding at the bottom of the MainMenu gui file:

function gotoWebsite(){
gotowebpage("http://www.something2play.com");
}

Fixes the problem...

Definately has something to do with the slashes that the GUI editor adds to the command line for gotowebpage that is causing the crash. So I do believe this is a bug :) correct me if I am wrong. Thanks.
#7
08/26/2010 (1:42 pm)
Following on from this with the fix to create a function, after testing.. button works fine. The little issue is that when you lose focus to the browser window from your game, clicking back onto the game giving it focus again opens up another web browser window as the button is still highlighted.

edit: is there a way in script to lose focus from the gui buttons after pressing them?

#8
08/26/2010 (2:20 pm)
Ok, figured out what the problem was with #7 - Dual monitors!! Game on the left and Web browser on the right, caused the issue with multiple browser windows. Keeping the game and web browser in the same window didn't have this problem.

edit: tested to see if the button problem was related to dual monitors, and it's not, same crash applies.
#9
08/26/2010 (3:40 pm)
Ah, looks like there is actually a minor bug here but it's not what you think.

What you saw in the MainMenuGui file is the correct syntax for the script. Commands have to be strings and the slashes that are added are escape sequences, without those you can't have a string within a string. In previous Gui Editors this was how you had to input your command. Now you can input the command as normal and it's converted to necessary string form. If you try putting your command in Gui Editor using that syntax then adds a lot of extra escape sequences and causes a syntax error.

Just to recap in case my rambling got confusing:
The correct syntax in the GUI Editor
gotowebpage("http://www.something2play.com");

The correct syntax in the script file
command = "gotowebpage(\"http://www.something2play.com\");";


I don't get any crashes though using either syntax. Only it working with one and syntax errors with the other. Is there any other errors in your console log?
#10
08/26/2010 (3:56 pm)
Hmmm... Nothing in the console log reporting just before or after the crash. I'll stick with the function call version for now, which works. I'll compare it with stock and see if it happends there. I seem to be having a sense of Deja Vu from TGE/A days when working with gotowebpage. I've only just started using it again in T3D as I'm nearing BETA and working on the Gui stuff. Did you see #5 about the case sensitive issue? Not sure if this applies to all fields though in the editor, only tested command.
#11
01/06/2020 (1:18 pm)
i've been working with tge and have run into the problem with the gotowebpage function, not so much of a problem as it will only open internet explorer, and when i uninstall internet explorer, the button just refuses to work anymore.

TGEEval('gotoWebPage(\"insert.com");Py::OnUltimateQuit();')

I wonder is there a way to code it for a particular browser... just wondering why i can't seem to access any other browser that's set to default....
#12
01/07/2020 (4:18 pm)
@Tim - Try asking here: Torque 3D forums. You'll have better luck getting an answer, as that is the active developer forum for the engines now.
#13
01/12/2020 (5:23 pm)
it won't let me log in, it is telling my my email is already registered, then when i click on retrieve password, it says it sends me an email, then nothing shows up... 'sigh'