Conobject problem
by Dennis Trevillyan · in Torque Game Builder · 04/23/2010 (3:22 pm) · 5 replies
Running into a problem where a conobject isn't being recognized in script. It's defined in the C++ code using both DECLARE_CONOBJECT and IMPLEMENT_CONOBJECT, the class is fully defined etc...
Here is the error in the log:
In script the missing class is being called from a dialog that is pushed from main.cs at startup. However it doesn't matter if you push the dialog or not. You get the same error even if you remove the pushDialog command line. Evidently the class hasn't been exported to script.
Anybody have any ideas?
Here is the error in the log:
game/gui/flash.gui (31): Unable to instantiate non-conobject class GuiFlash. Loading compiled script C:/TGB_Flash/games/TutorialBase/game/gameScripts/game.cs.
In script the missing class is being called from a dialog that is pushed from main.cs at startup. However it doesn't matter if you push the dialog or not. You get the same error even if you remove the pushDialog command line. Evidently the class hasn't been exported to script.
%guiContent = new GuiControl(NewGui) {
canSaveDynamicFields = "0";
isContainer = "1";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "0 0";
Extent = "800 600";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
new GuiFlash(flashWin) {
canSaveDynamicFields = "0";
isContainer = "1";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "0 0";
Extent = "800 600";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
movieName = "car_smash.swf";
backgroundAlpha = "1";
loopMovie = "0";
};
};
//--- OBJECT WRITE END ---
function NewGui::onWake( %this )
{
%this.play( %this );
}Anybody have any ideas?
#2
I will post the code for your review and comment.
04/23/2010 (5:25 pm)
Samantha, yes I did add the new source files to the project and have verified that the new source was compiled and linked into the executable. Instead of copying the executable I redirected the linker to write the executable into the proper directory. I then used that executable as the game environment to test the new code.I will post the code for your review and comment.
#3
As a test vehicle I'm using the tutorial base code with the following additions:
in main.cs:
the dialog NewGui is:
Here is the important part of the log file:
04/23/2010 (5:33 pm)
The effort is to implement flash player into TGB using this resource www.torquepowered.com/community/resource/view/7119/. The code download is located at: www.codejar.com/tge_flash/torque_gameswf.zipAs a test vehicle I'm using the tutorial base code with the following additions:
in main.cs:
function startGame(%level)
{
Canvas.setContent(mainScreenGui);
Canvas.setCursor(DefaultCursor);
new ActionMap(moveMap);
moveMap.push();
$enableDirectInput = true;
activateDirectInput();
enableJoystick();
sceneWindow2D.loadLevel(%level);
Canvas.pushDialog(NewGui); <== new line
}the dialog NewGui is:
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(NewGui) {
canSaveDynamicFields = "0";
isContainer = "1";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "0 0";
Extent = "800 600";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
new GuiFlash(flashWin) {
canSaveDynamicFields = "0";
isContainer = "1";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "0 0";
Extent = "800 600";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
movieName = "car_smash.swf";
backgroundAlpha = "1";
loopMovie = "0";
};
};
//--- OBJECT WRITE END ---
function NewGui::onWake( %this )
{
%this.play( ... );
}Here is the important part of the log file:
Torque Game Builder (v1.7.4) initialized... Loading compiled script C:/TGB_Flash/games/TutorialBase/resources/starterArt/resourceDatabase.cs. % Game Resources : Loaded Resource starterArt Loading compiled script C:/TGB_Flash/games/TutorialBase/game/managed/datablocks.cs. Loading compiled script C:/TGB_Flash/games/TutorialBase/game/managed/persistent.cs. Loading compiled script C:/TGB_Flash/games/TutorialBase/game/managed/brushes.cs. Loading compiled script C:/TGB_Flash/games/TutorialBase/game/gameScripts/datablocks.cs. Loading compiled script C:/TGB_Flash/games/TutorialBase/game/gameScripts/guiProfiles.cs. Loading compiled script C:/TGB_Flash/games/TutorialBase/game/gui/mainScreen.gui. Compiling C:/TGB_Flash/games/TutorialBase/game/gui/flash.gui... Loading compiled script C:/TGB_Flash/games/TutorialBase/game/gui/flash.gui. game/gui/flash.gui (31): Unable to instantiate non-conobject class GuiFlash. Loading compiled script C:/TGB_Flash/games/TutorialBase/game/gameScripts/game.cs. Activating DirectInput... DirectInput joystick failed to enable! Loading compiled script C:/TGB_Flash/games/TutorialBase/game/data/levels/level.t2d.
#4
04/23/2010 (6:44 pm)
Heh, 666 errors when attempting to build that into TGBGame on OS X, so I'll check it out when I get around to fixing my Windows machine.
#5
One thing I didn't mention was that this build has the Adventure Kit in it. I hope that isn't the cause but I think I'll try a clean install and see if I get a different result.
04/24/2010 (1:39 pm)
Samantha, sorry to hear that. I had hoped to do a "quick" build on OSX after finishing the game on Windows. Doesn't sound like that's in the cards. However, thanks for looking into this for me. I love my Mac Mini but with this activity on Torque I've pretty much stopped using it. My loss, no doubt.One thing I didn't mention was that this build has the Adventure Kit in it. I hope that isn't the cause but I think I'll try a clean install and see if I get a different result.
Torque Owner Cassy Brink
Minalien.com
If you are, do you mind giving us a copy of your code so that we can check it for errors?