Why Doesn't GUI Start Button Work?
by Jay Jennings · in Torque Game Builder · 09/27/2009 (6:01 pm) · 3 replies
I created a button on a GUI and in Command put this:
When the button shows up in the game and I click it the GUI vanishes but the game doesn't start.
However, if I put this in Command:
...and then put this in game/main.cs...
...pressing the button works the way it should.
But the command that's happening is the same in both cases -- why does it work inside a function but not as the Command for the button?
Jay Jennings
startGame(expandFilename($Game::DefaultScene));
When the button shows up in the game and I click it the GUI vanishes but the game doesn't start.
However, if I put this in Command:
startGameHere();
...and then put this in game/main.cs...
function startGameHere()
{
startGame(expandFilename($Game::DefaultScene));
}...pressing the button works the way it should.
But the command that's happening is the same in both cases -- why does it work inside a function but not as the Command for the button?
Jay Jennings
About the author
Make my living writing and selling ecommerce tools -- but I'd rather be writing games (of course). My family of four lives in 208 square feet and we may be in YOUR town next week.
#2
I'm just so new at TGB that I'm trying to figure out why things work they way they do -- thanks for the info.
Jay Jennings
09/27/2009 (8:23 pm)
Thanks, Phillip. Since it works by calling the function I'll just keep doing that -- I'd kind of rather do that than insert "real code" into the button command, anyway.I'm just so new at TGB that I'm trying to figure out why things work they way they do -- thanks for the info.
Jay Jennings
#3
09/28/2009 (10:46 am)
I can confirm this Jay. Identical issue that I worked around using the same solution as you, but I think it may have to do with the string needing some escape characters but I haven't done any testing on that theory.
Associate Phillip O'Shea
Violent Tulip