Directly launching into a mission.
by Markus Nuebel · in Torque Game Engine · 12/16/2003 (11:22 am) · 2 replies
When testing things I would like to jump directly into a mission, without going over the mission selection screen, that shows up, when you start a torque example (e.g. starter.fps or tutorial.base)
This saves some time, since all I have to do on the first screen is click the "start mission" button.
I tried to launch torque_demo with the command line option -mission e.g.
torqueDemo_DEBUG.exe -mission tutorial.base/data/missions/test1.mis
with torque/examples being the current working directory, but without success.
All the time the application starts with the "Mission selection" screen.
Am I doing something wrong here, or isn't it possible to directly launch a mission, using the command line arguments?
Best regards
Markus
This saves some time, since all I have to do on the first screen is click the "start mission" button.
I tried to launch torque_demo with the command line option -mission e.g.
torqueDemo_DEBUG.exe -mission tutorial.base/data/missions/test1.mis
with torque/examples being the current working directory, but without success.
All the time the application starts with the "Mission selection" screen.
Am I doing something wrong here, or isn't it possible to directly launch a mission, using the command line arguments?
Best regards
Markus
About the author
Associate James Urquhart
I believe the mission commandline option is intended for the dedicated server.
However, it should be possible to use the mission parameter to load your own mission in regular torque.
It stores the mission arg in "$missionArg".
And the tutorial.base uses this code to load a mission :
function loadTestMission() { // Create the server and load the mission createServer("SinglePlayer",expandFilename("./data/missions/test1.mis")); // Make a local connection %conn = new GameConnection(ServerConnection); RootGroup.add(ServerConnection); %conn.setConnectArgs("Player"); %conn.setJoinPassword("None"); %conn.connectLocal(); }So i would change the tutorial.base main.cs to have a check on the mission parameter (in initClient()) :
if ($missionArg !$= "") { createServer("SinglePlayer", $missionArg); // Make a local connection %conn = new GameConnection(ServerConnection); RootGroup.add(ServerConnection); %conn.setConnectArgs("Player"); %conn.setJoinPassword("None"); %conn.connectLocal(); } else { // Otherwise go to the splash screen. Canvas.setContent(MainMenuGui); }If you want it to be a Multiplayer mission, change it to "MultiPlayer". Don't forget to turn on the networking (if your using tutorial.base) though =)
You can use similar code to make it connect to a server using -connect.