Crazy simple script question
by Jesse P · in General Discussion · 01/05/2009 (11:19 pm) · 3 replies
Ok this is driving me nuts, and it's so simple, how do you quit to the main menu with a command.
AND avoid errors when loading another mission.
Right now I've tried a number of ways and it goes to the main menu but then when you click on load new mission it will either crash or load real funkily.
I need the syntax to quit the current game entirely, and quit to main menu like you just started up. It's weird because when I hit escape and then click the exit game button it goes to the main menu exactly like I want it to. And new missions load up fine, but I can't for the life of me figure out what command that exit button gave it or how it quit the current mission, etc. Please help. Thanks
AND avoid errors when loading another mission.
Right now I've tried a number of ways and it goes to the main menu but then when you click on load new mission it will either crash or load real funkily.
I need the syntax to quit the current game entirely, and quit to main menu like you just started up. It's weird because when I hit escape and then click the exit game button it goes to the main menu exactly like I want it to. And new missions load up fine, but I can't for the life of me figure out what command that exit button gave it or how it quit the current mission, etc. Please help. Thanks
#2
/example/starter.fps/client/scripts/default.bind.cs .
In particular the function escapeFromGame() is called upon hitting Esc key.
If you're wondering why is it that function is only ever called when hitting Esc key while only in game is because the key bind is using the moveMap ActionMap object. ActionMaps are event action mapping objects that can be activated and deactived anytime. There's another ActionMap object named GlobalActionMap that suggests it is globally binding meaning those key bindings should work in or out of game, but I haven't tested to ensure it does in fact do that.
I would reference a TDN (Torque Developer Network) wiki entry on the subject of ActionMaps, but there doesn't appear to be a dedicated article about them. But here is a console/script reference about it though: tdn.garagegames.com/wiki/Torque_Console_Objects#ActionMap
Anyway, hopefully that'll get you started in the right direction and have fun! :)
01/05/2009 (11:48 pm)
You are indeed correct. The keybinding for Esc while in game and what it does can be found in file In particular the function escapeFromGame() is called upon hitting Esc key.
If you're wondering why is it that function is only ever called when hitting Esc key while only in game is because the key bind is using the moveMap ActionMap object. ActionMaps are event action mapping objects that can be activated and deactived anytime. There's another ActionMap object named GlobalActionMap that suggests it is globally binding meaning those key bindings should work in or out of game, but I haven't tested to ensure it does in fact do that.
I would reference a TDN (Torque Developer Network) wiki entry on the subject of ActionMaps, but there doesn't appear to be a dedicated article about them. But here is a console/script reference about it though: tdn.garagegames.com/wiki/Torque_Console_Objects#ActionMap
Anyway, hopefully that'll get you started in the right direction and have fun! :)
#3
01/05/2009 (11:57 pm)
...and to quit the game entirely: quit();
Torque Owner Jesse P
disconnect();
Man was that bugging me for the past few hours.