Game Development Community

Help, play level wont work

by Austin · in Torque Game Builder · 08/11/2008 (2:29 pm) · 15 replies

About the author

Recent Threads


#1
08/11/2008 (2:31 pm)
HI,
i downloaded the trail version of TGB and am doing the fish demo, but whenever i try to test it it opens the test window then says

GAME STARTUP ERROR
'initializeProject' function could not be found.
This could indicate a bad or corrupt common directory for your game.

The Game will now shutdown because it cannot properly function

please help
-austin
#2
08/11/2008 (3:17 pm)
Do you have a main.cs in the game folder and does it have an "initializeProject" function? Did this somehow get removed for you?
#3
08/11/2008 (4:36 pm)
Do you have a space in your project name or project folder? If so, remove them. There is a problem with spaces!
#4
08/11/2008 (4:48 pm)
There are no spaces its called MyFishDemo
and MyFishLevel

i will try checking the execution in main.cs

thanks for the sugestions
-austin
#5
08/11/2008 (4:50 pm)
Here is the main.cs

//---------------------------------------------------------------------------------------------
// Torque Game Builder
// Copyright (C) GarageGames.com, Inc.
//---------------------------------------------------------------------------------------------


/// Player Initialization Procedure
///
function onStart()
{
}

function onExit()
{
}

//---------------------------------------------------------------------------------------------
// Load the paths we need access to
//---------------------------------------------------------------------------------------------
function loadPath( %path )
{
setModPaths( getModPaths() @ ";" @ %path );
exec(%path @ "/main.cs");

}

//---------------------------------------------
// Do some bootstrap voodoo to get the game to
// the initializeProject phase of loading and
// pass off to the user
//---------------------------------------------

// Output a console log
setLogMode(6);

loadPath( "common" );

loadPath( "game" );

onStart();

// Initialized
echo("\nTorque Game Builder (" @ getT2DVersion() @ ") initialized...");

if( !isFunction( "initializeProject" ) || !isFunction( "_initializeProject" ) )
{
messageBox( "Game Startup Error", "'initializeProject' function could not be found." @
"\nThis could indicate a bad or corrupt common directory for your game." @
"\n\nThe Game will now shutdown because it cannot properly function", "Ok", "MIStop" );
quit();
}

_initializeProject();

// Startup the project
initializeProject();

it says part of the error message on the part up there, interesting
#6
08/11/2008 (4:50 pm)
I will delete that then try
#7
08/11/2008 (4:51 pm)
Nope wont work
#8
08/11/2008 (6:15 pm)
There are 2 files named main.cs - James is referring to the one in the Game folder. The one you've posted above is the other one.
#9
08/11/2008 (6:58 pm)
I've seen the same problem. It's only when I run the game after running "Build Project..." with only the compiled scripts being delivered. If I check the option to send the scripts, it works just fine.
#10
08/12/2008 (9:47 am)
Here is the proper one

//---------------------------------------------------------------------------------------------
// Torque Game Builder
// Copyright (C) GarageGames.com, Inc.
//---------------------------------------------------------------------------------------------

//---------------------------------------------------------------------------------------------
// initializeProject
// Perform game initialization here.
//---------------------------------------------------------------------------------------------
function initializeProject()
{
// Load up the in game gui.
exec("~/gui/mainScreen.gui");

// Exec game scripts.
exec("./gameScripts/game.cs");

// This is where the game starts. Right now, we are just starting the first level. You will
// want to expand this to load up a splash screen followed by a main menu depending on the
// specific needs of your game. Most likely, a menu button will start the actual game, which
// is where startGame should be called from.
startGame( expandFilename($Game::DefaultScene) );
}

//---------------------------------------------------------------------------------------------
// shutdownProject
// Clean up your game objects here.
//---------------------------------------------------------------------------------------------
function shutdownProject()
{
endGame();
}

//---------------------------------------------------------------------------------------------
// setupKeybinds
// Bind keys to actions here..
//---------------------------------------------------------------------------------------------
function setupKeybinds()
{
new ActionMap(moveMap);
//moveMap.bind("keyboard", "a", "doAction", "Action Description");
}



it all seems ok, iw ill try to buld the project
#11
08/13/2008 (10:31 am)
It works when i build the project so i will just do that to test it

but now i made a datablock but it wont show up,
i've triple checked the scripting but it just wont appear

any help please
-austin
#12
08/13/2008 (1:02 pm)
You mean a t2dSceneObjectDatablock? Did you put it in project/game/gamescripts/datablocks.cs?

When you say it won't show up, do you mean in the "config" dropdown in the editor?
#13
08/13/2008 (6:56 pm)
Ya it wont show up
i put it in game.cs like the tutoril said

i will put it there
#14
08/14/2008 (9:45 am)
I solved i just put it in datablocks.cs,
but then the fish wouldn't move so i just gave them all the same class
but it would only work for to fish at a time

aHHHHHHHHHH
#15
08/13/2011 (8:11 am)
THANK YOU, WILLIAM LEE SIMS!! I encountered this problem too, when building on a Mac running Snow Leopard, and I was looking for info. I tried marking the "Include Script Source" checkbox, and it worked! May all your games be bug-free!!