how do you script a GUI control to use as a splash screen
by hbomega · in Torque 2D Beginner · 08/12/2013 (1:19 pm) · 48 replies
having problems creating some splash screens, i tried Yahya,s solution and ended up with a problem " SimObject::deleteObject: Object is being deleted whilst performing a script callback " i know what this means but i have no clue how to fix it, so i decided to go with Steve Acaster solution except its outdated and i have no idea how to create the .gui files without the GUI Editor. i know it can be done by script i would like an example of how you would go about creating Gui Controls that can be used for splash Screens from script thanks
i keep getting
pushDialog(): Invalid control: Custom_StartupGui_Background
pushDialog(): Invalid control: Custom_StartupGui_Game
popDialog(): Invalid control: Custom_StartupGui_Game
pushDialog(): Invalid control: Custom_StartupGui_Developer
popDialog(): Invalid control: Custom_StartupGui_Developer
pushDialog(): Invalid control: Custom_StartupGui_Torque
popDialog(): Invalid control: Custom_StartupGui_Torque
popDialog(): Invalid control: Custom_StartupGui_Background
help please someone :(
i keep getting
pushDialog(): Invalid control: Custom_StartupGui_Background
pushDialog(): Invalid control: Custom_StartupGui_Game
popDialog(): Invalid control: Custom_StartupGui_Game
pushDialog(): Invalid control: Custom_StartupGui_Developer
popDialog(): Invalid control: Custom_StartupGui_Developer
pushDialog(): Invalid control: Custom_StartupGui_Torque
popDialog(): Invalid control: Custom_StartupGui_Torque
popDialog(): Invalid control: Custom_StartupGui_Background
help please someone :(
#2
08/13/2013 (7:34 am)
As for creating GUI controls, I usually do this by hand. I will create a new GUI file in XML format and use TAML to load it. The log "pushDialog(): Invalid control: Custom_StartupGui_Background" means your object has not been registered or you are using the wrong name. Can you post the code that pushes the GUI?
#3
/-----------------------------------------------------------------------------
// StartupGui is the splash screen that initially shows when the game is loaded
//-----------------------------------------------------------------------------
function loadStartup()
{
//called from init.cs
Canvas.pushDialog(Custom_StartupGui_Background);//load the background
schedule(1000, 0, "Load_Startup_Back_Done");//schedule the game screen
}
function Load_Startup_Back_Done()
{
Canvas.pushDialog(Custom_StartupGui_Game);//display the Game screen
schedule(3000, 0, "Load_Startup_Game_Done");//schedule the Developer/company screen
}
function Load_Startup_Game_Done()
{
Canvas.popDialog(Custom_StartupGui_Game);//unload the Game screen
Canvas.pushDialog(Custom_StartupGui_Developer);//display the Developer/Company screen
schedule(2000, 0, "Load_Startup_Developer_Done");//schedule the Torque screen
}
function Load_Startup_Developer_Done()
{
Canvas.popDialog(Custom_StartupGui_Developer);//unload the Developer/Company screen
Canvas.pushDialog(Custom_StartupGui_Torque);//display the Torque logo
schedule(5500, 0, "StartupGui_onDone");//schedule the end of startup and display the main menu
//if you're using the stock fade gui element +1500 on 4 seconds for last screen to fade out
//it takes a little longer for this one or Main Menu kicks in a bit fast
//and the result it visually jarring - just a word of warning ...
}
function StartupGui_onDone(%this)
{
Canvas.popDialog(Custom_StartupGui_Torque);//unload the Torque logo
Canvas.popDialog(Custom_StartupGui_Background);//unload the background
loadMainMenu();//load the main menu and lets play games!
}
and this is my pethetic attempt at trying to create a gui control
function createCustomStartupguiDeveloper()
{
// Create the sprite.
%startupguiDeveloper = new GuiBitmapCtrl();
// Set the sprite as "static" so it is not affected by gravity.
%startupguiDeveloper.setBodyType( static );
// Set the object's center to coordinates 0 0 which corresponds to the center of the Scene
// Remember that our camera is set to point to coordinates 0 0 as well
%startupguiDeveloper.Position = "0 0";
// Set the object's size. Notice that this corresponds to the size of our camera, which was created in
// scenewindow.cs. The StartupguiDeveloper will thus cover the entirety of our scenewindow.
%startupguiDeveloper.Size = "100 75";
// Set to the furthest StartupguiDeveloper layer.
%startupguiDeveloper.SceneLayer = 31;
// Sets the image to use for our StartupguiDeveloper
%startupguiDeveloper.Image = "MyModule:sky1Background";
}
in the spaceship an asteroids tutorial it was very clear how to deal with the sprite class, but there seems to be very little info on gui controls i would like to learn how to create gui controls by hand i seem to prefer this method over Yahya method (thanks Yahya) only one good example shoud be enough.
1 how to structure and what gui control to use for what (in my case which gui Class would you use for a splash screen, cause im guessing, that guimenuctrl would be used to create your menu etc)
2 an example of an XML file and how to load it, though i'm pretty sure Simon showed me how to load TAML
thanks Michael i know you guy are busy thank for taking the time
08/13/2013 (8:38 am)
this is the function that makes the call/-----------------------------------------------------------------------------
// StartupGui is the splash screen that initially shows when the game is loaded
//-----------------------------------------------------------------------------
function loadStartup()
{
//called from init.cs
Canvas.pushDialog(Custom_StartupGui_Background);//load the background
schedule(1000, 0, "Load_Startup_Back_Done");//schedule the game screen
}
function Load_Startup_Back_Done()
{
Canvas.pushDialog(Custom_StartupGui_Game);//display the Game screen
schedule(3000, 0, "Load_Startup_Game_Done");//schedule the Developer/company screen
}
function Load_Startup_Game_Done()
{
Canvas.popDialog(Custom_StartupGui_Game);//unload the Game screen
Canvas.pushDialog(Custom_StartupGui_Developer);//display the Developer/Company screen
schedule(2000, 0, "Load_Startup_Developer_Done");//schedule the Torque screen
}
function Load_Startup_Developer_Done()
{
Canvas.popDialog(Custom_StartupGui_Developer);//unload the Developer/Company screen
Canvas.pushDialog(Custom_StartupGui_Torque);//display the Torque logo
schedule(5500, 0, "StartupGui_onDone");//schedule the end of startup and display the main menu
//if you're using the stock fade gui element +1500 on 4 seconds for last screen to fade out
//it takes a little longer for this one or Main Menu kicks in a bit fast
//and the result it visually jarring - just a word of warning ...
}
function StartupGui_onDone(%this)
{
Canvas.popDialog(Custom_StartupGui_Torque);//unload the Torque logo
Canvas.popDialog(Custom_StartupGui_Background);//unload the background
loadMainMenu();//load the main menu and lets play games!
}
and this is my pethetic attempt at trying to create a gui control
function createCustomStartupguiDeveloper()
{
// Create the sprite.
%startupguiDeveloper = new GuiBitmapCtrl();
// Set the sprite as "static" so it is not affected by gravity.
%startupguiDeveloper.setBodyType( static );
// Set the object's center to coordinates 0 0 which corresponds to the center of the Scene
// Remember that our camera is set to point to coordinates 0 0 as well
%startupguiDeveloper.Position = "0 0";
// Set the object's size. Notice that this corresponds to the size of our camera, which was created in
// scenewindow.cs. The StartupguiDeveloper will thus cover the entirety of our scenewindow.
%startupguiDeveloper.Size = "100 75";
// Set to the furthest StartupguiDeveloper layer.
%startupguiDeveloper.SceneLayer = 31;
// Sets the image to use for our StartupguiDeveloper
%startupguiDeveloper.Image = "MyModule:sky1Background";
}
in the spaceship an asteroids tutorial it was very clear how to deal with the sprite class, but there seems to be very little info on gui controls i would like to learn how to create gui controls by hand i seem to prefer this method over Yahya method (thanks Yahya) only one good example shoud be enough.
1 how to structure and what gui control to use for what (in my case which gui Class would you use for a splash screen, cause im guessing, that guimenuctrl would be used to create your menu etc)
2 an example of an XML file and how to load it, though i'm pretty sure Simon showed me how to load TAML
thanks Michael i know you guy are busy thank for taking the time
#4
modules/MyModule/scripts/splash.cs (41): Unable to find object: 'myScene' attempting to call function 'add'
modules/MyModule/scripts/splash.cs (91): Unable to find function safeDelete
08/13/2013 (9:20 am)
this is the new error i'm getting when trying splash.cs with changesmodules/MyModule/scripts/splash.cs (41): Unable to find object: 'myScene' attempting to call function 'add'
modules/MyModule/scripts/splash.cs (91): Unable to find function safeDelete
#5
2. Same as above. You can find examples of GUI controls in XML inside the Sandbox module.
The error you are getting basically says there is no such control as Custom_StartupGui_Background. From your script, I cannot see a GUI control that is named. Are you loading Custom_StartupGui_Background from file?
08/13/2013 (9:20 am)
1. This is entirely up to you. There are several ways to structure your GUIs. You can create all of the controls in the file, then leave all the logic in script. Alternatively, you can use the GUI controls in your file to act as containers and use script to build its contents. If you look at the TAML files in the Sandbox module, you will see a mixture of these approaches.2. Same as above. You can find examples of GUI controls in XML inside the Sandbox module.
The error you are getting basically says there is no such control as Custom_StartupGui_Background. From your script, I cannot see a GUI control that is named. Are you loading Custom_StartupGui_Background from file?
#6
file name: Custom_StartupGui_Background.gui.taml
file contents:
<GuiSpriteCtrl
Name="CustomStartupGuiBackground"
Profile="GuiDefaultProfile"
HorizSizing="width"
VertSizing="height"
Position="0 0"
Extent="1024 768"
MinExtent="8 8"
Visible="1"
HelpTag="0"
Image="MyModule:logo1">
</GuiSpriteCtrl>
08/13/2013 (1:24 pm)
Is this a gui controlfile name: Custom_StartupGui_Background.gui.taml
file contents:
<GuiSpriteCtrl
Name="CustomStartupGuiBackground"
Profile="GuiDefaultProfile"
HorizSizing="width"
VertSizing="height"
Position="0 0"
Extent="1024 768"
MinExtent="8 8"
Visible="1"
HelpTag="0"
Image="MyModule:logo1">
</GuiSpriteCtrl>
#7
08/13/2013 (1:29 pm)
Yes. That's a GUI control. How are you loading that file?
#8
exec("./gui/custom_guis/Custom_StartupGui_Background.gui.taml");
then i exec this cs file
exec("./scripts/gui/startupGui.cs");
which allows me to call this function
function loadStartup()
{
//called from init.cs
Canvas.pushDialog(Custom_StartupGui_Background);//load the background
schedule(1000, 0, "Load_Startup_Back_Done");//schedule the game screen
}
i thought that
exec("./gui/custom_guis/Custom_StartupGui_Background.gui.taml");
was loading it, guess i was wrong, how am i suppose to load it. thanks Micheal i really want to understand how guis work.
08/13/2013 (4:55 pm)
i think you found my problem, after i exec it in my main.cs with all the other execsexec("./gui/custom_guis/Custom_StartupGui_Background.gui.taml");
then i exec this cs file
exec("./scripts/gui/startupGui.cs");
which allows me to call this function
function loadStartup()
{
//called from init.cs
Canvas.pushDialog(Custom_StartupGui_Background);//load the background
schedule(1000, 0, "Load_Startup_Back_Done");//schedule the game screen
}
i thought that
exec("./gui/custom_guis/Custom_StartupGui_Background.gui.taml");
was loading it, guess i was wrong, how am i suppose to load it. thanks Micheal i really want to understand how guis work.
#9
The exec() function is dedicated to executing TorqueScript files (*.cs). If your file contains an object or collection of objects, you should be reading them using TAML. The %loadedGUI = part of the code is optional. That's only necessary if you plan to do something with %loadedGUI immediately. Otherwise, you can just use:
There are more options available, but that should get you going with loading your GUI files.
08/13/2013 (5:35 pm)
To load a TAML file, use the following:%loadedGUI = TamlRead("./gui/custom_guis/Custom_StartupGui_Background.gui.taml");The exec() function is dedicated to executing TorqueScript files (*.cs). If your file contains an object or collection of objects, you should be reading them using TAML. The %loadedGUI = part of the code is optional. That's only necessary if you plan to do something with %loadedGUI immediately. Otherwise, you can just use:
TamlRead("./gui/custom_guis/Custom_StartupGui_Background.gui.taml");There are more options available, but that should get you going with loading your GUI files.
#10
08/13/2013 (8:27 pm)
thanks does it matter where, do i put it in the same place as the execs, or is up to my preference. just for knowledge purposes
#11
Again, that's just my standard approach. It can change based on when you need your GUIs, how long they should exist, and what functionality is tied to them.
08/13/2013 (8:32 pm)
If you are making use of the module system and you know you will be using the GUIs early, try to read them in during your module startup. I typically execute my scripts, then read in my TAML files (GUI, scenes, etc). You should also know that every module has a scopeset. You can load files and create objects, then add them to the scope set. This means they will be automatically cleaned up when the module is destroyed. This may not always be what you want, but it's a nice to have feature. The basic idea is this:function MyModule::onCreate(%this)
{
// Load scripts
exec("./scripts/myScript.cs");
// Load GUIs
%myGui = TamlRead("./gui/myGui.gui.taml");
// Optionally add loaded GUI to scopeset for automatic cleanup
%this.add(%myGui);
// Initialization
$MyGlobalVariable = 0;
}Again, that's just my standard approach. It can change based on when you need your GUIs, how long they should exist, and what functionality is tied to them.
#12
08/13/2013 (8:53 pm)
i tried your solution and it worked in the sense of not generating any errors in the console log however it still does not produce the desired outcome, my program runs no different from when i didn't add the Gui Controls which were suppose to create some splash screens, but it's good to know my code ran with out the errors, i'll go again tomorrow i shall be victorious :) Thanks for all the help Micheal
#13
08/13/2013 (9:37 pm)
Progress! That's definitely a good thing. Debug one step at a time. Glad my answers are helping. I'll wait for your next reply to see what's happening next.
#14
08/14/2013 (6:14 am)
i dont even know where to start debugging, i went over the code so many times i could recite it, i'm going to go through the sandbox code to see if i missed something any recommendations is eagerly awaited
#15
2. Are there any other messages in the console log, even if they are not errors?
3. Are all your assets and modules properly loaded?
08/14/2013 (6:41 am)
1. Can you confirm this code is actually executing?function loadStartup()
{
//called from init.cs
Canvas.pushDialog(Custom_StartupGui_Background);//load the background
schedule(1000, 0, "Load_Startup_Back_Done");//schedule the game screen
}2. Are there any other messages in the console log, even if they are not errors?
3. Are all your assets and modules properly loaded?
#16
here is my console log
Adding path expando of 'AppCore' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/AppCore/1'.
--------------------------------------------------------------------------------
Video Initialization:
--------------------------------------------------------------------------------
Video initialization:
Accelerated OpenGL display device detected.
Activating the OpenGL display device...
Activating the OpenGL display device...
Setting screen mode to 1024x768x32 (w)...
Creating a new window...
Acquiring a new device context...
Pixel format set:
32 color bits, 24 depth bits, 8 stencil bits
Creating a new rendering context...
Making the new rendering context current...
OpenGL driver information:
Vendor: ATI Technologies Inc.
Renderer: ATI Radeon HD 5450
Version: 4.2.12002 Compatibility Profile Context 9.12.0.0
OpenGL Init: Enabled Extensions
ARB_multitexture (Max Texture Units: 8)
EXT_blend_color
EXT_blend_minmax
EXT_compiled_vertex_array
EXT_texture_env_combine
EXT_packed_pixels
EXT_fog_coord
ARB_texture_compression
EXT_texture_compression_s3tc
(ARB|EXT)_texture_env_add
EXT_texture_filter_anisotropic (Max anisotropy: 16)
WGL_EXT_swap_control
OpenGL Init: Disabled Extensions
EXT_paletted_texture
NV_vertex_array_range
3DFX_texture_compression_FXT1
Max Texture Size reported as: 16384
OpenAL Driver Init
OpenAL Driver Init Success
Adding path expando of 'ToyAssets' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/ToyAssets/1'.
Adding path expando of 'MyModule' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/MyModule'.
Removing path expando of 'AppCore' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/AppCore/1'.
Removing path expando of 'MyModule' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/MyModule'.
Removing path expando of 'ToyAssets' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/ToyAssets/1'.
Shutting down the OpenGL display device...
Making the GL rendering context not current...
Deleting the GL rendering context...
Releasing the device context...
i believe all my assets are properly loaded because i can set each of them as my scene background and it displays.
08/14/2013 (6:52 am)
i believe it does cause if i misspell it it generates an error in the console log does that mean it executing or should i try another way tp find out for sure.here is my console log
Adding path expando of 'AppCore' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/AppCore/1'.
--------------------------------------------------------------------------------
Video Initialization:
--------------------------------------------------------------------------------
Video initialization:
Accelerated OpenGL display device detected.
Activating the OpenGL display device...
Activating the OpenGL display device...
Setting screen mode to 1024x768x32 (w)...
Creating a new window...
Acquiring a new device context...
Pixel format set:
32 color bits, 24 depth bits, 8 stencil bits
Creating a new rendering context...
Making the new rendering context current...
OpenGL driver information:
Vendor: ATI Technologies Inc.
Renderer: ATI Radeon HD 5450
Version: 4.2.12002 Compatibility Profile Context 9.12.0.0
OpenGL Init: Enabled Extensions
ARB_multitexture (Max Texture Units: 8)
EXT_blend_color
EXT_blend_minmax
EXT_compiled_vertex_array
EXT_texture_env_combine
EXT_packed_pixels
EXT_fog_coord
ARB_texture_compression
EXT_texture_compression_s3tc
(ARB|EXT)_texture_env_add
EXT_texture_filter_anisotropic (Max anisotropy: 16)
WGL_EXT_swap_control
OpenGL Init: Disabled Extensions
EXT_paletted_texture
NV_vertex_array_range
3DFX_texture_compression_FXT1
Max Texture Size reported as: 16384
OpenAL Driver Init
OpenAL Driver Init Success
Adding path expando of 'ToyAssets' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/ToyAssets/1'.
Adding path expando of 'MyModule' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/MyModule'.
Removing path expando of 'AppCore' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/AppCore/1'.
Removing path expando of 'MyModule' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/MyModule'.
Removing path expando of 'ToyAssets' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/ToyAssets/1'.
Shutting down the OpenGL display device...
Making the GL rendering context not current...
Deleting the GL rendering context...
Releasing the device context...
i believe all my assets are properly loaded because i can set each of them as my scene background and it displays.
#17
//-------------------------- 8/14/2013 -- 09:48:01 -----
Console trace is off.
Adding path expando of 'AppCore' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/AppCore/1'.
--------------------------------------------------------------------------------
Video Initialization:
--------------------------------------------------------------------------------
Video initialization:
Accelerated OpenGL display device detected.
Activating the OpenGL display device...
Activating the OpenGL display device...
Setting screen mode to 1024x768x32 (w)...
Creating a new window...
Acquiring a new device context...
Pixel format set:
32 color bits, 24 depth bits, 8 stencil bits
Creating a new rendering context...
Making the new rendering context current...
OpenGL driver information:
Vendor: ATI Technologies Inc.
Renderer: ATI Radeon HD 5450
Version: 4.2.12002 Compatibility Profile Context 9.12.0.0
OpenGL Init: Enabled Extensions
ARB_multitexture (Max Texture Units: 8)
EXT_blend_color
EXT_blend_minmax
EXT_compiled_vertex_array
EXT_texture_env_combine
EXT_packed_pixels
EXT_fog_coord
ARB_texture_compression
EXT_texture_compression_s3tc
(ARB|EXT)_texture_env_add
EXT_texture_filter_anisotropic (Max anisotropy: 16)
WGL_EXT_swap_control
OpenGL Init: Disabled Extensions
EXT_paletted_texture
NV_vertex_array_range
3DFX_texture_compression_FXT1
Max Texture Size reported as: 16384
OpenAL Driver Init
OpenAL Driver Init Success
Adding path expando of 'ToyAssets' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/ToyAssets/1'.
Adding path expando of 'MyModule' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/MyModule'.
pushDialog(): Invalid control: Custom_StartupGui_Backgrounds
Removing path expando of 'AppCore' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/AppCore/1'.
Removing path expando of 'MyModule' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/MyModule'.
Removing path expando of 'ToyAssets' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/ToyAssets/1'.
Shutting down the OpenGL display device...
Making the GL rendering context not current...
Deleting the GL rendering context...
Releasing the device context...
08/14/2013 (6:55 am)
here is the console log with misspelled gui call//-------------------------- 8/14/2013 -- 09:48:01 -----
Console trace is off.
Adding path expando of 'AppCore' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/AppCore/1'.
--------------------------------------------------------------------------------
Video Initialization:
--------------------------------------------------------------------------------
Video initialization:
Accelerated OpenGL display device detected.
Activating the OpenGL display device...
Activating the OpenGL display device...
Setting screen mode to 1024x768x32 (w)...
Creating a new window...
Acquiring a new device context...
Pixel format set:
32 color bits, 24 depth bits, 8 stencil bits
Creating a new rendering context...
Making the new rendering context current...
OpenGL driver information:
Vendor: ATI Technologies Inc.
Renderer: ATI Radeon HD 5450
Version: 4.2.12002 Compatibility Profile Context 9.12.0.0
OpenGL Init: Enabled Extensions
ARB_multitexture (Max Texture Units: 8)
EXT_blend_color
EXT_blend_minmax
EXT_compiled_vertex_array
EXT_texture_env_combine
EXT_packed_pixels
EXT_fog_coord
ARB_texture_compression
EXT_texture_compression_s3tc
(ARB|EXT)_texture_env_add
EXT_texture_filter_anisotropic (Max anisotropy: 16)
WGL_EXT_swap_control
OpenGL Init: Disabled Extensions
EXT_paletted_texture
NV_vertex_array_range
3DFX_texture_compression_FXT1
Max Texture Size reported as: 16384
OpenAL Driver Init
OpenAL Driver Init Success
Adding path expando of 'ToyAssets' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/ToyAssets/1'.
Adding path expando of 'MyModule' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/MyModule'.
pushDialog(): Invalid control: Custom_StartupGui_Backgrounds
Removing path expando of 'AppCore' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/AppCore/1'.
Removing path expando of 'MyModule' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/MyModule'.
Removing path expando of 'ToyAssets' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/ToyAssets/1'.
Shutting down the OpenGL display device...
Making the GL rendering context not current...
Deleting the GL rendering context...
Releasing the device context...
#18
The line with Image="MyModule:logo1" appears to be wrong. Try replacing it with this:
Notice the @asset= part.
08/14/2013 (7:01 am)
I just looked at your GUI again:<GuiSpriteCtrl Name="CustomStartupGuiBackground" Profile="GuiDefaultProfile" HorizSizing="width" VertSizing="height" Position="0 0" Extent="1024 768" MinExtent="8 8" Visible="1" HelpTag="0" Image="MyModule:logo1"> </GuiSpriteCtrl>
The line with Image="MyModule:logo1" appears to be wrong. Try replacing it with this:
<GuiSpriteCtrl Name="CustomStartupGuiBackground" Profile="GuiDefaultProfile" HorizSizing="width" VertSizing="height" Position="0 0" Extent="1024 768" MinExtent="8 8" Visible="1" HelpTag="0" Image="@asset=MyModule:logo1"> </GuiSpriteCtrl>
Notice the @asset= part.
#19
//-------------------------- 8/14/2013 -- 10:01:37 -----
Console trace is off.
Adding path expando of 'AppCore' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/AppCore/1'.
--------------------------------------------------------------------------------
Video Initialization:
--------------------------------------------------------------------------------
Video initialization:
Accelerated OpenGL display device detected.
Activating the OpenGL display device...
Activating the OpenGL display device...
Setting screen mode to 1024x768x32 (w)...
Creating a new window...
Acquiring a new device context...
Pixel format set:
32 color bits, 24 depth bits, 8 stencil bits
Creating a new rendering context...
Making the new rendering context current...
OpenGL driver information:
Vendor: ATI Technologies Inc.
Renderer: ATI Radeon HD 5450
Version: 4.2.12002 Compatibility Profile Context 9.12.0.0
OpenGL Init: Enabled Extensions
ARB_multitexture (Max Texture Units: 8)
EXT_blend_color
EXT_blend_minmax
EXT_compiled_vertex_array
EXT_texture_env_combine
EXT_packed_pixels
EXT_fog_coord
ARB_texture_compression
EXT_texture_compression_s3tc
(ARB|EXT)_texture_env_add
EXT_texture_filter_anisotropic (Max anisotropy: 16)
WGL_EXT_swap_control
OpenGL Init: Disabled Extensions
EXT_paletted_texture
NV_vertex_array_range
3DFX_texture_compression_FXT1
Max Texture Size reported as: 16384
OpenAL Driver Init
OpenAL Driver Init Success
Adding path expando of 'ToyAssets' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/ToyAssets/1'.
Adding path expando of 'MyModule' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/MyModule'.
Asset Manager: Failed to acquire asset Id '@asset = MyModule:logo1' as it does not exist.
Removing path expando of 'AppCore' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/AppCore/1'.
Removing path expando of 'MyModule' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/MyModule'.
Removing path expando of 'ToyAssets' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/ToyAssets/1'.
Shutting down the OpenGL display device...
Making the GL rendering context not current...
Deleting the GL rendering context...
Releasing the device context...
08/14/2013 (7:08 am)
this is the error i get in the console log now//-------------------------- 8/14/2013 -- 10:01:37 -----
Console trace is off.
Adding path expando of 'AppCore' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/AppCore/1'.
--------------------------------------------------------------------------------
Video Initialization:
--------------------------------------------------------------------------------
Video initialization:
Accelerated OpenGL display device detected.
Activating the OpenGL display device...
Activating the OpenGL display device...
Setting screen mode to 1024x768x32 (w)...
Creating a new window...
Acquiring a new device context...
Pixel format set:
32 color bits, 24 depth bits, 8 stencil bits
Creating a new rendering context...
Making the new rendering context current...
OpenGL driver information:
Vendor: ATI Technologies Inc.
Renderer: ATI Radeon HD 5450
Version: 4.2.12002 Compatibility Profile Context 9.12.0.0
OpenGL Init: Enabled Extensions
ARB_multitexture (Max Texture Units: 8)
EXT_blend_color
EXT_blend_minmax
EXT_compiled_vertex_array
EXT_texture_env_combine
EXT_packed_pixels
EXT_fog_coord
ARB_texture_compression
EXT_texture_compression_s3tc
(ARB|EXT)_texture_env_add
EXT_texture_filter_anisotropic (Max anisotropy: 16)
WGL_EXT_swap_control
OpenGL Init: Disabled Extensions
EXT_paletted_texture
NV_vertex_array_range
3DFX_texture_compression_FXT1
Max Texture Size reported as: 16384
OpenAL Driver Init
OpenAL Driver Init Success
Adding path expando of 'ToyAssets' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/ToyAssets/1'.
Adding path expando of 'MyModule' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/MyModule'.
Asset Manager: Failed to acquire asset Id '@asset = MyModule:logo1' as it does not exist.
Removing path expando of 'AppCore' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/AppCore/1'.
Removing path expando of 'MyModule' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/MyModule'.
Removing path expando of 'ToyAssets' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/ToyAssets/1'.
Shutting down the OpenGL display device...
Making the GL rendering context not current...
Deleting the GL rendering context...
Releasing the device context...
#20
--------------------------------------------------------------------------------
Video Initialization:
--------------------------------------------------------------------------------
Video initialization:
Accelerated OpenGL display device detected.
Activating the OpenGL display device...
Activating the OpenGL display device...
Setting screen mode to 1024x768x32 (w)...
Creating a new window...
Acquiring a new device context...
Pixel format set:
32 color bits, 24 depth bits, 8 stencil bits
Creating a new rendering context...
Making the new rendering context current...
OpenGL driver information:
Vendor: ATI Technologies Inc.
Renderer: ATI Radeon HD 5450
Version: 4.2.12002 Compatibility Profile Context 9.12.0.0
OpenGL Init: Enabled Extensions
ARB_multitexture (Max Texture Units: 8)
EXT_blend_color
EXT_blend_minmax
EXT_compiled_vertex_array
EXT_texture_env_combine
EXT_packed_pixels
EXT_fog_coord
ARB_texture_compression
EXT_texture_compression_s3tc
(ARB|EXT)_texture_env_add
EXT_texture_filter_anisotropic (Max anisotropy: 16)
WGL_EXT_swap_control
OpenGL Init: Disabled Extensions
EXT_paletted_texture
NV_vertex_array_range
3DFX_texture_compression_FXT1
Max Texture Size reported as: 16384
OpenAL Driver Init
OpenAL Driver Init Success
Adding path expando of 'ToyAssets' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/ToyAssets/1'.
Adding path expando of 'MyModule' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/MyModule'.
Removing path expando of 'AppCore' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/AppCore/1'.
Removing path expando of 'MyModule' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/MyModule'.
Removing path expando of 'ToyAssets' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/ToyAssets/1'.
Shutting down the OpenGL display device...
Making the GL rendering context not current...
Deleting the GL rendering context...
Releasing the device context...
08/14/2013 (7:11 am)
Adding path expando of 'AppCore' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/AppCore/1'.--------------------------------------------------------------------------------
Video Initialization:
--------------------------------------------------------------------------------
Video initialization:
Accelerated OpenGL display device detected.
Activating the OpenGL display device...
Activating the OpenGL display device...
Setting screen mode to 1024x768x32 (w)...
Creating a new window...
Acquiring a new device context...
Pixel format set:
32 color bits, 24 depth bits, 8 stencil bits
Creating a new rendering context...
Making the new rendering context current...
OpenGL driver information:
Vendor: ATI Technologies Inc.
Renderer: ATI Radeon HD 5450
Version: 4.2.12002 Compatibility Profile Context 9.12.0.0
OpenGL Init: Enabled Extensions
ARB_multitexture (Max Texture Units: 8)
EXT_blend_color
EXT_blend_minmax
EXT_compiled_vertex_array
EXT_texture_env_combine
EXT_packed_pixels
EXT_fog_coord
ARB_texture_compression
EXT_texture_compression_s3tc
(ARB|EXT)_texture_env_add
EXT_texture_filter_anisotropic (Max anisotropy: 16)
WGL_EXT_swap_control
OpenGL Init: Disabled Extensions
EXT_paletted_texture
NV_vertex_array_range
3DFX_texture_compression_FXT1
Max Texture Size reported as: 16384
OpenAL Driver Init
OpenAL Driver Init Success
Adding path expando of 'ToyAssets' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/ToyAssets/1'.
Adding path expando of 'MyModule' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/MyModule'.
Removing path expando of 'AppCore' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/AppCore/1'.
Removing path expando of 'MyModule' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/MyModule'.
Removing path expando of 'ToyAssets' as 'C:/Users/HBOMEGA/Documents/Torque 2D/Alien Blast v1/modules/ToyAssets/1'.
Shutting down the OpenGL display device...
Making the GL rendering context not current...
Deleting the GL rendering context...
Releasing the device context...
Employee Michael Perry
ZombieShortbus
I'm guessing this is happening in this function:
function unloadSplashImages() { splashBackgroundObj.safeDelete(); // unload splash image assets from memory for (%i=1; %i<=$splashScreenCount; %i++) { if (AssetDatabase.isDeclaredAsset($assetId[%i])) AssetDatabase.removeDeclaredAsset( $assetId[%i] ); } // load your next scene or do what ever you want here }If you like that solution and just want to resolve the error, try to schedule the delete: