Game Development Community

TGB 1.5 - how to open console

by baylor wetzel · in Torque Game Builder · 07/24/2007 (9:44 am) · 3 replies

Either my keyboard is broken or the ~ key no longer opens the console in the level editor in TGB 1.5. It does open it in the running game but does not close it. i did a search on the GG site but didn't find anything about a new keymap or command line option or that sort of thing. Anyone know how i get access to the console?

i also noticed that the play/pause/stop menu doesn't show up on running games anymore

i suppose i should ask this - when i run a game in 1.5, does it always use the latest code? i have scripts i run from the level editor to reload changed files - maybe i don't need those anymore. It would still be nice, though, to be able to see all my traces and debug statements and unit test statements and such, although i could probably do that inside the game itself if i could find a way to pause the game

#1
07/24/2007 (10:05 am)
Try CTRL ~.
It opens and closes the console.
#2
07/24/2007 (10:10 am)
1.5 uses the latest saved changes to your code when you hit the play button/run the game.
#3
07/24/2007 (10:54 am)
You should be able to pause your game like i demonstrate below, straight from the sceneWindow2D named window by getting the scenegraph and pausing it manually.

Pause the game while "F6" is held down
// Pause the game while "F6" is held down
GlobalActionMap.bind(keyboard, "F6", toggleGamePause);

function toggleGamePause( %val )
{
   if( %val )
      sceneWindow2D.getSceneGraph().setScenePause(true);
   else
      sceneWindow2D.getSceneGraph().setScenePause(false);
}

That code will pause the game while you hold down the F6 key. You could also write it with a toggle such that when hit the key it would pause until you hit the key again. That would look like this.

Pause the game when "F6" is pressed and unpause it when it's pressed again
// Pause the game when "F6" is pressed and unpause it when it's pressed again
GlobalActionMap.bind(keyboard, "F6", toggleGamePause);
$gamePauseToggle = false;
function toggleGamePause( %val )
{
   if( %val )
      $gamePauseToggle = !$gamePauseToggle;
      
   sceneWindow2D.getSceneGraph().setScenePause($gamePauseToggle);
}

Hope this helps,
-Justin