Game Development Community

gui gui gui

by hamed · in Game Design and Creative Issues · 03/07/2012 (6:01 am) · 4 replies

hi, please please please answer my question im really tired of searching and searching and arriving nowhere....witch function should i change when i wanna load my mainmeny gui in the beginiing of the game
there are two main.cs file one of them is
//---------------------------------------------------------------------------------------------
// 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." @
               "nnThe Game will now shutdown because it cannot properly function", "Ok", "MIStop" );
   quit();
}

_initializeProject();

// Startup the project
initializeProject();
and the other one is in the game folder
//---------------------------------------------------------------------------------------------
// 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." @
               "nnThe Game will now shutdown because it cannot properly function", "Ok", "MIStop" );
   quit();
}

_initializeProject();

// Startup the project
initializeProject();
please please please tell me which functions should change ? has anyone got any project source even a simple source i just wanna know how it happens..must we add anything in the function onStart() or ....
please please if read this thread and knew the answers ,reply me

About the author

the great costly games, but the only purpose is killing, and the only amuse but why we just should kill to be satisfied,why the games should not change ? great drama in the games ? maybe today , is the time to change from bullets to flowers


#1
03/07/2012 (7:16 am)
not familiar with tgb.but those script looks like same to t3d.wait for someone's proper answer.or try this:

what actually u want to change:
way to load main menu?
or the place when main menu will be loaded?
or the main menu itself?

01.
for first one:
u need
function MainMenuGui::onWake(%this)
{ }
you have to search in which file this function is.

02.
for next one u have to search for this line:
Canvas.setContent( MainMenuGui );
or
Canvas.pushDialog(MainMenuGui);

03.
for last one u have to edit file named mainMenu.gui

not sure any of them.but u can try them until someone from tgb answer you.

#2
03/07/2012 (8:53 am)
thanks it was very useful, actually when you are thirsty even a drop of a water can make you alive
#3
03/07/2012 (9:00 am)
glad to hear that it helps you.

Quote:
when you are thirsty even a drop of a water can make you alive
nice line.
true for me about t3d.
and there is nothing to fill that.


#4
03/14/2012 (1:18 am)
there are two main.cs file in the tgb progect, one of them got a blank function onstart and another one got initializeProject that sets the content and etc, whats the differences between these two cs file,and when we use function onstart and what should we write into its blank bracets, in the phantasia,larva,startegy and whole the source code i have downloaded theres a function
start_game that the main menu push.dialogue starts from there but i dont know where the start_game function get called and also they use a function
view plainprint?
Canvas.setContent(loadGarageGamesGui());

but theresnt any gui or any function with this name in the source, does anybody know anything about it
im really wate for even a short answer