Reload Function not working as I want it
by Alexander B · in Torque 3D Professional · 01/12/2010 (9:05 am) · 1 replies
I am using the univeral AI kit and GMK together. Anyway for the ai to load $Game::Running has to be set to 0 so $Game::Running = 0; However reloading doesn't do that and I really need a quick fix. Here is the reload function:
function reloadMission(%missionName)
{
if(%missionName $= "")
{
if($Server::MissionFile !$= "")
schedule( 0, 0, loadMission, $Server::MissionFile);
else
error("Wrong mission name");
return;
}
else
{
%missionName = expandFileName("~/data/missions/" @ %missionName);
%missionName = makeRelativePath(%missionName, getWorkingDirectory());
schedule( 0, 0, loadMission, %missionName);
}
}
So when the game reloads it keeps this $Game::Running = 1; while it
should be $Game::Running = 0; so how do i fix this?
function reloadMission(%missionName)
{
if(%missionName $= "")
{
if($Server::MissionFile !$= "")
schedule( 0, 0, loadMission, $Server::MissionFile);
else
error("Wrong mission name");
return;
}
else
{
%missionName = expandFileName("~/data/missions/" @ %missionName);
%missionName = makeRelativePath(%missionName, getWorkingDirectory());
schedule( 0, 0, loadMission, %missionName);
}
}
So when the game reloads it keeps this $Game::Running = 1; while it
should be $Game::Running = 0; so how do i fix this?
About the author
Torque Owner Alexander B