The pic doesnt show...
by Mie · in General Discussion · 10/28/2008 (10:36 pm) · 8 replies
Im a newbie... im making the tutorial about GUI here... i follow all the orders... but why my programs doesnt work well... the first splash screen of garage games.. it doesnt show... it just fade in with white screen...
im confused... im useing codeweaver to debug it.. it also can't find the problems... this is my code :
Main.cs
// Load up common script base
loadDir("common");
//-----------------------------------------------------------------------------
// Load up the shell and game GUIs
exec("./client/gui/GGSplash.gui");
exec("./client/gui/MainMenu.gui");
exec("./client/gui/TGESplash.gui");
// Load up default console values.
exec("./client/defaults.cs");
exec("./server/defaults.cs");
// Preferences (overide defaults)
// TO-DO
package superTag {
function onStart()
{
// Initialize the client and the server
Parent::onStart();
initServer();
initClient();
$Editor::newMissionOverride = "demo/data/missions/flat.mis";
}
function onExit()
{
// Save off our current preferences for next time
echo("Exporting prefs");
export("$Pref::*", "./prefs.cs", False);
Parent::onExit();
}
}; // Client package
activatePackage(superTag);
function initServer()
{
echo("\n--------- Initializing Super Tag: Server ---------");
// The common module provides the basic server functionality
// This function is located in common\main.cs
initBaseServer();
// Load up game server support scripts
// TO-DO
// exec("./server/");
}
//-----------------------------------------------------------------------------
// Init Client
//
// Initializes client scripts and info
function initClient()
{
echo("\n--------- Initializing Super Tag: Client ---------");
// The common module provides basic client functionality
// This function is located in common\main.cs
initBaseClient();
// InitCanvas starts up the graphics system.
// The canvas needs to be constructed before the gui scripts are
// run because many of the controls assume the canvas exists at
// load time.
// !!! SUPER TAG !!! string will show up in title bar of window
initCanvas("!!! SUPER TAG !!!");
// Load client-side data
// TO-DO
// exec("./client/");
// Load up the shell and game GUIs
// TO-DO
// exec("./client/");
// Client scripts
// TO-DO
// exec("./client/");
// Default player key bindings
// TO-DO
// exec("./client/");
// Default gui key bindings
// TO-DO
// exec("./client/");
// Copy saved script prefs into C++ code.
// TO-DO
// Start up the main menu...
Canvas.setCursor("DefaultCursor");
loadFrontEnd();
}
//-----------------------------------------------------------------------------
// Load Mission
//
// %mission - File path of mission to load
function loadMission(%mission)
{
// make sure we are not connected to a server already
disconnect();
// Create the server and load the mission
createServer("SinglePlayer", %mission);
// Make a local connection
%conn = new GameConnection(ServerConnection);
RootGroup.add(ServerConnection);
%conn.setConnectArgs("Player");
%conn.setJoinPassword("None");
%conn.connectLocal();
}
can somebody help me through this?
im confused... im useing codeweaver to debug it.. it also can't find the problems... this is my code :
Main.cs
// Load up common script base
loadDir("common");
//-----------------------------------------------------------------------------
// Load up the shell and game GUIs
exec("./client/gui/GGSplash.gui");
exec("./client/gui/MainMenu.gui");
exec("./client/gui/TGESplash.gui");
// Load up default console values.
exec("./client/defaults.cs");
exec("./server/defaults.cs");
// Preferences (overide defaults)
// TO-DO
package superTag {
function onStart()
{
// Initialize the client and the server
Parent::onStart();
initServer();
initClient();
$Editor::newMissionOverride = "demo/data/missions/flat.mis";
}
function onExit()
{
// Save off our current preferences for next time
echo("Exporting prefs");
export("$Pref::*", "./prefs.cs", False);
Parent::onExit();
}
}; // Client package
activatePackage(superTag);
function initServer()
{
echo("\n--------- Initializing Super Tag: Server ---------");
// The common module provides the basic server functionality
// This function is located in common\main.cs
initBaseServer();
// Load up game server support scripts
// TO-DO
// exec("./server/");
}
//-----------------------------------------------------------------------------
// Init Client
//
// Initializes client scripts and info
function initClient()
{
echo("\n--------- Initializing Super Tag: Client ---------");
// The common module provides basic client functionality
// This function is located in common\main.cs
initBaseClient();
// InitCanvas starts up the graphics system.
// The canvas needs to be constructed before the gui scripts are
// run because many of the controls assume the canvas exists at
// load time.
// !!! SUPER TAG !!! string will show up in title bar of window
initCanvas("!!! SUPER TAG !!!");
// Load client-side data
// TO-DO
// exec("./client/");
// Load up the shell and game GUIs
// TO-DO
// exec("./client/");
// Client scripts
// TO-DO
// exec("./client/");
// Default player key bindings
// TO-DO
// exec("./client/");
// Default gui key bindings
// TO-DO
// exec("./client/");
// Copy saved script prefs into C++ code.
// TO-DO
// Start up the main menu...
Canvas.setCursor("DefaultCursor");
loadFrontEnd();
}
//-----------------------------------------------------------------------------
// Load Mission
//
// %mission - File path of mission to load
function loadMission(%mission)
{
// make sure we are not connected to a server already
disconnect();
// Create the server and load the mission
createServer("SinglePlayer", %mission);
// Make a local connection
%conn = new GameConnection(ServerConnection);
RootGroup.add(ServerConnection);
%conn.setConnectArgs("Player");
%conn.setJoinPassword("None");
%conn.connectLocal();
}
can somebody help me through this?
About the author
#2
//--- OBJECT WRITE BEGIN ---
new GuiControl(TGESplash) {
canSaveDynamicFields = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "0 0";
Extent = "640 480";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
new GuiFadeinBitmapCtrl(TGE_FadeInCtrl) {
canSaveDynamicFields = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "relative";
VertSizing = "relative";
position = "0 0";
Extent = "640 480";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
bitmap = "./images/Background.jpg";
wrap = "0";
fadeinTime = "1000";
waitTime = "2000";
fadeoutTime = "1000";
done = "1";
};
};
//--- OBJECT WRITE END ---
//-----------------------------------------------------------------------------
// Load TGE Splash Screen
//
// Initializes the second splash screen transition
function loadTGESplash ()
{
// We just loaded, so let's reset the fade in control
TGE_FadeInCtrl.done = false;
// Paint the main canvas with our splash screen
Canvas.setContent(TGESplash);
// Start the scheduled routine of checking for completion of
// splash screen in 0.1 seconds.
schedule(100, 0, checkTGESplashDone );
}
//-----------------------------------------------------------------------------
// TGE_FadeInCtrl Click
//
// New member function for TGE_FadeInCtrl
// If the user clicks anywhere on screen,
// this function lets the splash screen no it's time to fade
function TGE_FadeInCtrl::click()
{
// User was impatient and clicked, we are done here
TGE_FadeInCtrl.done = true;
}
//-----------------------------------------------------------------------------
// Check TGE Splash Done
//
// Checks to see if the duration of screen (in TGE_FadeInCtrl)
// has elapsed, in which case we move on to the next screen.
function checkTGESplashDone ()
{
// Check the Boolean value held by TGE_FadeInCtrl
// if it is done (true), move on.
// Otherwise, schedule to call this function and check again
// in 0.1 seconds
if (TGE_FadeInCtrl.done)
{
loadMainMenu();
}
else
schedule(100, 0, checkTGESplashDone);
}
//-----------------------------------------------------------------------------
// Load Main Menu
//
// Load up our Main Menu
function loadMainMenu ()
{
Canvas.setContent(MainMenu);
}
10/28/2008 (10:37 pm)
TGESplash.gui//--- OBJECT WRITE BEGIN ---
new GuiControl(TGESplash) {
canSaveDynamicFields = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "0 0";
Extent = "640 480";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
new GuiFadeinBitmapCtrl(TGE_FadeInCtrl) {
canSaveDynamicFields = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "relative";
VertSizing = "relative";
position = "0 0";
Extent = "640 480";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
bitmap = "./images/Background.jpg";
wrap = "0";
fadeinTime = "1000";
waitTime = "2000";
fadeoutTime = "1000";
done = "1";
};
};
//--- OBJECT WRITE END ---
//-----------------------------------------------------------------------------
// Load TGE Splash Screen
//
// Initializes the second splash screen transition
function loadTGESplash ()
{
// We just loaded, so let's reset the fade in control
TGE_FadeInCtrl.done = false;
// Paint the main canvas with our splash screen
Canvas.setContent(TGESplash);
// Start the scheduled routine of checking for completion of
// splash screen in 0.1 seconds.
schedule(100, 0, checkTGESplashDone );
}
//-----------------------------------------------------------------------------
// TGE_FadeInCtrl Click
//
// New member function for TGE_FadeInCtrl
// If the user clicks anywhere on screen,
// this function lets the splash screen no it's time to fade
function TGE_FadeInCtrl::click()
{
// User was impatient and clicked, we are done here
TGE_FadeInCtrl.done = true;
}
//-----------------------------------------------------------------------------
// Check TGE Splash Done
//
// Checks to see if the duration of screen (in TGE_FadeInCtrl)
// has elapsed, in which case we move on to the next screen.
function checkTGESplashDone ()
{
// Check the Boolean value held by TGE_FadeInCtrl
// if it is done (true), move on.
// Otherwise, schedule to call this function and check again
// in 0.1 seconds
if (TGE_FadeInCtrl.done)
{
loadMainMenu();
}
else
schedule(100, 0, checkTGESplashDone);
}
//-----------------------------------------------------------------------------
// Load Main Menu
//
// Load up our Main Menu
function loadMainMenu ()
{
Canvas.setContent(MainMenu);
}
#3
10/29/2008 (8:43 am)
Try removing the file extension from the logo in the script. So take of the .jpg.
#4
10/29/2008 (6:02 pm)
It still white blank fade in... GGSplash.gui,TGESplash.gui... and the weird is MainMenu.gui pict is show...
#5
[url=www.kitaupload.com/download.php?file=845print screen.doc]print screen[/url]
10/29/2008 (6:10 pm)
Here is the link of print screen...[url=www.kitaupload.com/download.php?file=845print screen.doc]print screen[/url]
#6
I believe I do see a problem though, but I've never used that SuperTag starter, it could be that it does things in a very different manner than what I would expect - maybe the author could help you better.
I think your exec's are in the wrong place.
Move these three execs:
I say again that I've never used the Super.Tag HowTo, so I could be wrong. But in a standard client/server package setup you need to activate the package and have it started before you begin loading and creating GUIs.
10/29/2008 (7:31 pm)
Usually when you see a white screen it means that a texture/image is missing. Double check your filename and filepath. I believe I do see a problem though, but I've never used that SuperTag starter, it could be that it does things in a very different manner than what I would expect - maybe the author could help you better.
I think your exec's are in the wrong place.
Move these three execs:
// Load up the shell and game GUIs
exec("./client/gui/GGSplash.gui");
exec("./client/gui/MainMenu.gui");
exec("./client/gui/TGESplash.gui");to down inside function initClient() maybe where it says// Load up the shell and game GUIs // TO-DO
I say again that I've never used the Super.Tag HowTo, so I could be wrong. But in a standard client/server package setup you need to activate the package and have it started before you begin loading and creating GUIs.
#7
10/29/2008 (9:04 pm)
ALRIGHTTTTT............................................... its ok now... i think i miss at that section... ^^ my bad eyes.... thx for all who help me... :D
#8
Things seem pretty squared away now, though. Nice work.
10/30/2008 (12:49 am)
Guess I saw this thread a little late...ah well. You had it right silentMike. Contrary to what I wrote in the tutorial, he seems to have placed the exec(...) lines for the GUIs outside of the initClient.Things seem pretty squared away now, though. Nice work.
Mie
//--- OBJECT WRITE BEGIN ---
new GuiControl(GGSplash) {
canSaveDynamicFields = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "0 0";
Extent = "640 480";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
new GuiFadeinBitmapCtrl(GG_FadeInCtrl) {
canSaveDynamicFields = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "relative";
VertSizing = "relative";
position = "0 0";
Extent = "640 480";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
bitmap = "./images/GarageGames.jpg";
wrap = "0";
fadeinTime = "125";
waitTime = "2000";
fadeoutTime = "125";
done = "1";
};
};
//--- OBJECT WRITE END ---
//-----------------------------------------------------------------------------
// Load Front End
//
// Kick starts our into screens
function loadFrontEnd()
{
// We just loaded, so let's reset the fade in control
GG_FadeInCtrl.done = false;
// Paint the main canvas with our splash screen
Canvas.setContent(GGSplash );
// Start the scheduled routine of checking for completion of
// splash screen in 0.1 seconds.
schedule(100, 0, checkStartupDone );
}
//-----------------------------------------------------------------------------
// GG_FadeInCtrl Click
//
// New member function for GG_FadeInCtrl
// If the user clicks anywhere on screen,
// this function lets the splash screen no it's time to fade
function GG_FadeInCtrl::click()
{
// User was impatient and clicked, we are done here
GG_FadeInCtrl.done = true;
}
//-----------------------------------------------------------------------------
// Check startup done
//
// Checks to see if the duration of screen (in GG_FadeInCtrl)
// has elapsed, in which case we move on to the next screen.
function checkStartupDone()
{
// Check the Boolean value held by GG_FadeInCtrl
// if it is done (true), move on.
// Otherwise, schedule to call this function and check again
// in 0.1 seconds
if (GG_FadeInCtrl.done)
{
loadTGESplash();
}
else
schedule(100, 0, checkStartupDone );
}