Game Development Community

PushDialog: Invalid Control

by David Taylor · in Torque Game Builder · 04/10/2007 (8:24 pm) · 3 replies

In my main.cs file, I have the following gui files being executed...

// Execute gui files.
   exec("~/gui/mainScreen.gui");

   exec("~/gui/RLMMainMenu800x600.gui");
   exec("~/gui/RLMQuitWindow800x600.gui");

   exec("~/gui/RLMTeamSelectNRL800x600.gui");
   exec("~/gui/RLMDrawGenerationNRL800x600.gui");

   exec("~/gui/RLMMainBuilding800x600.gui");

   exec("~/gui/RLMManagerOffice800x600.gui");
   exec("~/gui/RLMLeagueTable800x600.gui");
   exec("~/gui/RLMTeamStatistics800x600.gui");

   exec("~/gui/RLMCEOOffice800x600.gui");

   exec("~/gui/RLMTrainingRoom800x600.gui");
   exec("~/gui/RLMTeamLineup800x600.gui");

   exec("~/gui/RLMMedicalTreatmentRoom800x600.gui");

   exec("~/gui/RLMBankManagerOffice800x600.gui");

   exec("~/gui/RLMMatchDay800x600.gui");
   exec("~/gui/RLMMatchOver800x600.gui");
   exec("~/gui/RLMPostMatchPoints800x600.gui");
   exec("~/gui/RLMPostMatchStatistics800x600.gui");
   exec("~/gui/RLMInterview800x600.gui");

   // Exec game scripts.
   exec("./gameScripts/game.cs");

But when the command on one of my buttons is "canvas.pushDialog(RLMMainBuilding800x600);", it returns a "pushDialog: Invalid Control: RLMMainBuilding800x600". The thing is, it used to load it fine, but now that gui doesn't turn up in the gui editor, either, even though all of the other guis in that list do. And the actual .gui file is still in the gui folder. Any ideas?

#1
04/11/2007 (9:36 am)
Do you get any errors in the console when the exec()'s process? Have you examined the contents of the RLMMainBuilder800x600 GUI file to see if it does in fact contain the GUI your looking for ... have you verified that the GUI contained within the file is named "RLMMainBuilder800x600" ?
#2
04/13/2007 (5:02 pm)
Heh, don't I feel silly! It was definitely calling the right file, but when I opened up that file, the gui within had a different name to the filename. I think I must have done a 'save as' at some point, hence the error. Thanks, David! :)
#3
04/13/2007 (5:18 pm)
Don't fret ... happens to the best of us ;)