Author Topic: Loading a Mission  (Read 911 times)

Like in the Tutorial, it automatically starts a single player game, at a certain map with specific scripts loaded.
How can I do that except for a different projected?

loadMission(filePath);

Oh wait, you mean completely from scratch/main menu, not just force a map change from a server.
I made something like this once, I'll try to find it.

loadMission(filePath);
OH I SEE HOW IT IS MISTER
YO' GONNA COME IN AND TEACH ME
WHY DANK U!

Run a trace and start the tutorial. You should be able to tell what it spits out.

When you start a mission, it execs the .mis file. The tutorial's .mis file has all the scripts in it after all the mission stuff.

Run a trace and start the tutorial. You should be able to tell what it spits out.
K

I made something like this once, I'll try to find it.

I can't really find it, but I tried remaking it. I didn't test this, though.
Code: [Select]
function clientStartMission( %name )
{
startMissionGui.onWake();

%count = SM_missionList.rowCount();
%found = false;

for ( %i = 0 ; %i < %count ; %i++ )
{
%row = SM_missionList.getRowText( %i );

if ( getField( %row, 0 ) $= %name )
{
%found = true;
SM_missionList.setSelectedRow( %i );

break;
}
}

if ( !%found )
{
return false;
}

// Change server preferences ($Pref::Server::Preference = value)
// Change add-ons enabled ($AddOn__FolderName = troolean)
// Change music enabled ($Music__FileName = troolean)

SM_missionList.select();
startMissionGUI.clickSinglePlayer();
SM_StartMission();
}

When you start a mission, it execs the .mis file. The tutorial's .mis file has all the scripts in it after all the mission stuff.
This is the correct way to do it.