Minimum Game Connection, Singleplayer
by Andreas Jung · in Torque Game Engine · 08/31/2002 (1:43 pm) · 2 replies
Hi,
I started making a pure singleplayer-game from ground-up without using the the example-scripts (except editors and msgboxes). It works quite fine until now, I've got some UI and the UI-Editor running.
Now I want to load a mission. Now when I get to "lightScene", it tells me "no game connection".
So I guess I need some kind of game-connection. But if possible, I wouldn't want to get involved into the Client-Server architecture.
Could you tell me how to achive a minimum Game-connection? Or could you point me some code-pieces in the example app?
Another question: Is there any AI-"movemefrompointatopointb" function implemented in the engine, or do I have to do that on my own? Anything in the dev-pipeline?
Andy
I started making a pure singleplayer-game from ground-up without using the the example-scripts (except editors and msgboxes). It works quite fine until now, I've got some UI and the UI-Editor running.
Now I want to load a mission. Now when I get to "lightScene", it tells me "no game connection".
So I guess I need some kind of game-connection. But if possible, I wouldn't want to get involved into the Client-Server architecture.
Could you tell me how to achive a minimum Game-connection? Or could you point me some code-pieces in the example app?
Another question: Is there any AI-"movemefrompointatopointb" function implemented in the engine, or do I have to do that on my own? Anything in the dev-pipeline?
Andy
About the author
#2
function opoLoadMission( %MissionName )
{
echohr();
echo( "Loading mission <" @ %MissionName @ ">" );
// Create correct file-names
%MissionFile = %MissionName @ ".mis";
%MissionScript = %MissionName @ "_Scripts.cs";
// TODO
localConnect( "test" );
// Load mission-file if available, or error-out
if( !isFile( %MissionFile ))
{
error( "Unable to find mission-file <" @ %MissionFile @ ">" );
return;
}
exec( %MissionFile );
// Load extra-script if available (optional)
if( isFile( %MissionScript ))
{
exec( %MissionScript );
}
// Light mission area
if( !lightScene( "opoLoadMissionComplete", "" ) )
{
error( "An error occured while lighting mission!" );
return;
}
echo( "Mission loaded!" );
Canvas.repaint();
$lightingMission = true;
$missionRunning = true;
}
function opoLoadMissionComplete()
{
echo( "Mission lighting done!" );
}
But mission-lighting fails. After hunting the error in the debugger, I got to this line:
SimSet * lightSet = Sim::getLightSet();
And there is no single light when he wants to go through the light-list.
Does the sun count as light and if yes, why isn't it known by the engine?
BTW, nothing of the scene is displayed, when I disable the lightScene()-call, it's black (also if a sky-sox is listed in the mission-file). Is there anything I have to take care to get the scene rendered? (it's also not visible in the build-in mission-editor).
09/01/2002 (1:04 pm)
Well, here is my simple, incomplete, minimum mission-load-function:function opoLoadMission( %MissionName )
{
echohr();
echo( "Loading mission <" @ %MissionName @ ">" );
// Create correct file-names
%MissionFile = %MissionName @ ".mis";
%MissionScript = %MissionName @ "_Scripts.cs";
// TODO
localConnect( "test" );
// Load mission-file if available, or error-out
if( !isFile( %MissionFile ))
{
error( "Unable to find mission-file <" @ %MissionFile @ ">" );
return;
}
exec( %MissionFile );
// Load extra-script if available (optional)
if( isFile( %MissionScript ))
{
exec( %MissionScript );
}
// Light mission area
if( !lightScene( "opoLoadMissionComplete", "" ) )
{
error( "An error occured while lighting mission!" );
return;
}
echo( "Mission loaded!" );
Canvas.repaint();
$lightingMission = true;
$missionRunning = true;
}
function opoLoadMissionComplete()
{
echo( "Mission lighting done!" );
}
But mission-lighting fails. After hunting the error in the debugger, I got to this line:
SimSet * lightSet = Sim::getLightSet();
And there is no single light when he wants to go through the light-list.
Does the sun count as light and if yes, why isn't it known by the engine?
BTW, nothing of the scene is displayed, when I disable the lightScene()-call, it's black (also if a sky-sox is listed in the mission-file). Is there anything I have to take care to get the scene rendered? (it's also not visible in the build-in mission-editor).
Torque Owner Matt W
This means, it will only be a straight line.
I can't tell which you were asking for, but take a look at the couple of files prefixed with "AI" in the engine. They should help you understand exactly what is there, and what is missing.