Quick mission transition
by Shayne Gelo · in Torque Game Engine · 01/25/2006 (9:55 am) · 1 replies
I'm trying to get a quick transition between a fly-down to a globe object and the terrain-based scene where action will take place. I figure it's easiest to simply have two separate missions and jump between them at the appropriate time. This seems to work well enough, but only when there is a bit of a delay between ending the first mission and loading the second. Here's the code that works:
However, if loadDefaultMission is called directly rather than being scheduled slightly in the future, the new mission will load, but also include the globe object from the previous one.
Am I doing something wrong here, or is this behavior expected?
function loadDefaultMission(%mission)
{
Canvas.setCursor("DefaultCursor");
createServer( "SinglePlayer", %mission $= "" ? $pref::mission : %mission);
%conn = new GameConnection(ServerConnection);
RootGroup.add(ServerConnection);
%conn.setConnectArgs($pref::Player::Name);
%conn.setJoinPassword($Client::Password);
%conn.connectLocal();
}
function switchToTerrain() {
Canvas.setContent( LoadingGui );
endMission();
schedule(100, 0, "loadDefaultMission", "disaster/data/missions/simple.mis");
}However, if loadDefaultMission is called directly rather than being scheduled slightly in the future, the new mission will load, but also include the globe object from the previous one.
Am I doing something wrong here, or is this behavior expected?
Torque Owner Chris Labombard
Premium Preferred
I believe, if you set your schedule time to 0 it would work just as well, but check out that link to be sure.