Game Development Community

Whack a mole problem GuiFormManager::BroadcastContentMessage??

by David froberg · in Torque Game Builder · 08/21/2011 (10:16 pm) · 3 replies

I'm working through the tutorials and almost finished the whack a mole. I got the VS2008 installed and got the game running, but when I added the hammer, ONLY the standalone version (built version) won't pop up moles and I get the following in both built and TGB console logs:

Torque Game Builder (v1.7.5) initialized...
Loading compiled script C:/Users/Froberg/Documents/Whack a matt/resources/moleArt/resourceDatabase.cs.
resources/moleArt/resourceDatabase.cs (16): Unable to find function GuiFormManager::BroadcastContentMessage
% Game Resources : Loaded Resource moleArt
Loading compiled script C:/Users/Froberg/Documents/Whack a matt/game/managed/datablocks.cs.
Loading compiled script C:/Users/Froberg/Documents/Whack a matt/game/managed/persistent.cs.
Loading compiled script C:/Users/Froberg/Documents/Whack a matt/game/managed/brushes.cs.
Loading compiled script C:/Users/Froberg/Documents/Whack a matt/game/gui/mainScreen.gui.
Loading compiled script C:/Users/Froberg/Documents/Whack a matt/game/gameScripts/game.cs.
Loading compiled script C:/Users/Froberg/Documents/Whack a matt/game/gameScripts/mole.cs.
Loading compiled script C:/Users/Froberg/Documents/Whack a matt/game/gameScripts/respawnPoint.cs.
Loading compiled script C:/Users/Froberg/Documents/Whack a matt/game/gameScripts/moleLevel.cs.
Activating DirectInput...
DirectInput joystick failed to enable!
Loading compiled script C:/Users/Froberg/Documents/Whack a matt/game/data/levels/Level1.t2d.
DirectInput deactivated.
Shutting down the OpenGL display device...
Making the GL rendering context not current...
Deleting the GL rendering context...
Releasing the device context...


I can't find the method
GuiFormManager::BroadcastContentMessage in the documentation but ResourceDatabase.cs does use it:



// Load Resource Function - Hooks into game
function moleArt::LoadResource( %this )
{
// Update Object library once datablocks are loaded.
GuiFormManager::BroadcastContentMessage( "LevelBuilderSidebarCreate", 0, "refresh" );


}


I'mm assuming this is why the moles don't appear.

any ideas?

#1
08/22/2011 (3:40 am)
BroadcastContentMessage() is called to update level builder when new resources are added I believe, it shouldn't be even called when you launch your game.
According to the log resources are loaded normally and your game makes it all the way to the actual gameplay, so I assume there is something wrong with your scripts. There is possibility that something is wrong with resources, but as you say it was working before you added a hammer, so you should probably check your hammer scripts first.
#2
08/22/2011 (7:30 pm)
ok.. but it is, in a script file I never touched. But I guess TGB did when I added the hammer.
Why does it work through TGB but not through the stand alone engine?

thanks
#3
08/22/2011 (7:45 pm)
I found the Problem! But I don't understand why it works....

When I "built" the project in TGB at some point I unchecked "include script source". I checked it and now the game plays. But I don't understand why, I was trying to only use the "compilied" DSO files like I would if I was distributing the game. Why do the .CS files have to be there in the "built" directories?

Thanks again