Auto-load missions in 1.4?
by Rodney (OldRod) Burns · in Torque Game Engine · 12/01/2005 (11:05 am) · 3 replies
I had my project set so that when I clicked a button, it skipped the mission selection list and went straight into a mission that I wanted it to.
I had this in mainMenuGui.gui:
Then at the bottom of the same file, I had:
In 1.3 this worked fine. In 1.4 I click the button and get a loading screen, but without any mission information and it just hangs there. Did something change that prevents this from working? Or is there a better way to do this?
I had this in mainMenuGui.gui:
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "top";
position = "36 237";
extent = "110 20";
minExtent = "8 8";
visible = "1";
//command = "Canvas.setContent(StartMissionGUI);"; <-- original line
command = "SM_StartMission();"; <-- changed it to this
text = "Enter World...";
groupNum = "-1";
buttonType = "PushButton";
helpTag = "0";
};Then at the bottom of the same file, I had:
function SM_StartMission()
{
if ($pref::HostMultiPlayer)
%serverType = "MultiPlayer";
else
%serverType = "SinglePlayer";
createServer(%serverType, "kwm/data/missions/arlenhills.mis");
%conn = new GameConnection(ServerConnection);
RootGroup.add(ServerConnection);
%conn.setConnectArgs($pref::Player::Name);
%conn.setJoinPassword($Client::Password);
%conn.connectLocal();
}In 1.3 this worked fine. In 1.4 I click the button and get a loading screen, but without any mission information and it just hangs there. Did something change that prevents this from working? Or is there a better way to do this?
#2
Putting the original button code back works and I can load the mission that way, so the mission file itself is ok.
*edit* I just looked in the console.log and I see:
"createServer: mission name unspecified"
12/01/2005 (11:35 am)
No, I can hit the cancel button and return to the menu. It's like it's not finding the mission file, but the path is correct. I even tried explicitly putting the full path in and that didn't change it.Putting the original button code back works and I can load the mission that way, so the mission file itself is ok.
*edit* I just looked in the console.log and I see:
"createServer: mission name unspecified"
#3
I had moved the SM_StartMission() function to mainMenuGUI.gui, but forgot to remove startMissionGUI.gui from the project - it was still trying to run from there.
Just ignore me :)
12/01/2005 (12:27 pm)
Bah, never mind. It was a stupid mistake on my part :(I had moved the SM_StartMission() function to mainMenuGUI.gui, but forgot to remove startMissionGUI.gui from the project - it was still trying to run from there.
Just ignore me :)
Associate Kyle Carter
Make sure you have a debug build, it will give much more informative error messages.