Game Development Community

initializeProject function not found

by Andrew H · in Torque Game Builder · 08/18/2011 (8:33 pm) · 13 replies

When I try to start up my game, it says it couldn't find the initializeProject function. I searched it and tried the whole 'administrator permission' thing. No results. What's going on?

#1
08/19/2011 (1:42 am)
Hi !

I found a few threads that seem related to your issue :

www.garagegames.com/community/forums/viewthread/71914
www.garagegames.com/community/forums/viewthread/78199

it seems most problems are caused by spaces in project names.

Have a look and check if any of that helps :-?
#2
08/19/2011 (5:55 am)
Just tried that. Here's the path to my project:

C:\Hidden_Button_Games\Games\Lux_Lucis

I checked the files as well - the ones that weren't T2D generated. Those would be compatible, of course.

So I try it again - and it still won't work.
#3
08/19/2011 (7:21 am)
Try deleting your DSO's and having the engine recompile them. I've seen this happen if they are corrupted during loading and cannot initialize.
#4
08/19/2011 (7:27 am)
@David, Nothing happened. It still does the same thing.
#5
08/19/2011 (12:55 pm)
@Laura - Are all the CS files in the final version? Someone in IRC was mentioning something about the packaging process from the editor removing a critical file. Let me try to find out who discovered it.
#6
08/19/2011 (12:58 pm)
From TRON in IRC:

Quote:When you export from the editor, compile with source. The guy ran into that problem when he did the option without source.
#7
08/19/2011 (2:55 pm)
InitializeProject() is defined within common/gameScripts/projectManagement.cs . If there is no .cs nor .cs.dso file in your built project you can copy them from your working directory.
#8
08/20/2011 (7:11 pm)
Oh, I forgot to mention. I actually haven't built (if you mean like - exporting so you can distribute it) my game yet.
#9
08/22/2011 (2:01 pm)
Please? I can't test my game!!!
#10
08/22/2011 (7:28 pm)
Okay I tracked down where it's killing your game, but not why yet:

<Game>/main.cs
/*Line 45*/
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." @
               "nnThe Game will now shutdown because it cannot properly function", "Ok", "MIStop" );
   quit();
}

So this means that one of the those two functions are not being defined before this script is executed.

"initializeProject" is defined in <game>/game/main.cs

"_initializeProject" is defined in <game>/common/gameScripts/ProjectManagement.cs

If I may make a suggestion, try deleting the .dso files for the both of those (leave the .cs files), then restarting your game. If that doesn't work, check to see if both the files compiled (check if .dso's are there), if not, then that file is the problem.
#11
08/23/2011 (12:36 pm)
Well, this is odd. I don't have a <game>/common/gameScripts folder at all! All I have in my common folder is data/fonts.
#12
08/24/2011 (2:22 pm)
That is odd indeed. Hmmm.

Okay, if you haven't tried this already, try creating a new project and seeing if it will play without errors. If so, locate <game>/common folder and copy its contents into your games common folder.

Also, to make sure we're on the same page, when I say "<game>", I am referring to the name of your project. So if your project is called "Lux_Lucis", the path would be "Lux_Lucis/common/gameScripts", NOT "Lux_Lucis/game/common/gameScripts".

Anyways, I hope that whatever the cause, this will get your game working again so you aren't locked out of your own game anymore.
#13
08/24/2011 (3:41 pm)
YES! That did it! Thanks a LOT. REALLY. To ALL of you. But especially Justin, for finally delivering the winning solution. You guys all rock!