Game Development Community

Load Mission

by Martin Edmaier · in Torque Game Engine · 07/24/2002 (2:03 am) · 9 replies

I want to load a new mission if the player collide with the Trigger, but it won't work. If my player collide with the Trigger my game crashed and in the console file at the last lines I get this message "*** ENDING MISSION
*** LOADING MISSION: f:/torque/fps/data/mission/waterWorld.mis
*** Stage 1 load
*** Stage 2 load"
Could not find mission f:/torque/fps/data/mission/waterWorld.mis#

I don't know why the mission could not load.
I hope someone can help me.

Thankx,

PS: This is my script at the bottom!

function StartMission()
{
%mission = "f:/torque/fps/data/mission/waterWorld.mis";
loadMission(%mission, true);
localConnect($pref::Player::Name);
}

#1
07/24/2002 (3:14 pm)
Why are u using an absolute path??? Shouldn't it just be "fps/data/missions/..."?
#2
07/24/2002 (3:59 pm)
It works with this script, but my game also crashed:

%file = findFirstFile("*/waterworld.mis");
loadMission( %file, true ) ;
localConnect($pref::Player::Name);

I don't understand that it finds the file, but the crashed my console look like that at the bottom:

*** ENDING MISSION
*** LOADING MISSION: fps/data/missions/waterWorld.mis
*** Stage 1 load
*** Stage 2 load
Executing fps/data/missions/waterWorld.mis.
*** Mission loaded
*** Sending mission load to client: fps/data/missions/waterWorld.mis
CADD: 1426 local

Can anybody test that maybe it is a problem of my game and my script files.
#3
03/30/2004 (2:34 am)
Were there any solutions to this. I want to do exactly the same, but get this error also.
#4
03/30/2004 (4:22 am)
Did you end the previous mission before loading the new one? Dont know if that would cause it...
#5
03/30/2004 (11:36 am)
Also, you may need to insert a delay between loading the mission and connecting to the server. I'd put in a few second delay after the loadMission call.
#6
03/31/2004 (5:37 am)
You need to schedule the load. This worked for me.

Here is the code for my onEnterTrigger. I have 2 dynamic fields defined in my trigger. One for the map name and one for the name of the spawn sphere to use to spawn the player in the map. This will require a slight change to your loadmission routine.
%client = %obj.client;
   if(!%client)
   {
     // return if not a client
     return;
   }
   
   %ZoneName = %trigger.ZoneName;
   %SpawnPoint = %trigger.SpawnPoint;
   
   echo("Zone client:" SPC %client SPC "to" SPC %ZoneName SPC "at" SPC %SpawnPoint);
   schedule( 0, 0, loadMission, "script/data/missions/" @ %ZoneName,false,%SpawnPoint);
#7
08/25/2006 (6:06 pm)
Hey,
Did anyone find a solution to this problem?
I have been trying 2 do the same thing in 1.4 and get the same error. it is driving me crazy.

%ZoneName = %trigger.MissionName;
%SpawnPoint = %trigger.SpawnPoint;

echo("Zone client:" SPC %client SPC "to" SPC %ZoneName SPC "at" SPC %SpawnPoint);
schedule( 0, 0, loadMission, "~/data/missions/" @ %ZoneName,false,%SpawnPoint);

with the 2 dynamic fields defined in my trigger "MissionName" , "SpawnPoint".


I have tryed this as well.

%ZoneName = "carpark.mis";
%SpawnPoint = "1";
echo("Zone client:" SPC %client SPC "to" SPC %ZoneName SPC "at" SPC %SpawnPoint);
schedule( 0, 0, loadMission, "~/data/missions/" @ %ZoneName,false,%SpawnPoint);\

and i get the same error
#8
08/25/2006 (6:28 pm)
If anyone is having this same problem, this worked for me. Simple problem but it took me a long time to find

schedule( 0, 0, loadMission, "starter.fps/data/missions/" @ %ZoneName,false,%SpawnPoint);

not

schedule( 0, 0, loadMission, "~/data/missions/" @ %ZoneName,false,%SpawnPoint);
#9
04/21/2009 (1:10 pm)
Espero que me pueda servir el codigo que proponen, muchas gracias