Quickstart your game for debugging
by Martin Schultz · 11/12/2007 (2:01 pm) · 14 comments
This little how-to shows you how to modify your startup.gui and startmission.gui to have your game not show the startup screen, but immediately after startup load your default mission which you use for debugging. It saves a lof of time not clicking the intro screen, the main menu's "start mission" button, selecting a mission and finally start it. This time can be saved by applying this little patch and next time you start your game you immediately end up in your mission instead of your main menu gui.
Let's start right away with the changes. There's not much to change, so don't worry, we'll be quickly through it. I assume that we have fresh TGE 1.5.2 version (but works also with TGEA) and starter.fps is your default game in main.cs.
Please open up starter.fps/client/ui/StartupGui.gui and and replace the function checkStartupDone() by the one below:
This tells the startup gui to be done immediately and instead of loading the main menu it's going start the function "SM_StartMissionQuick();" which we add now. This new function is going to load our default mission we use for debugging.
Please open starter.fps/client/ui/StartMissionGui.gui and find the function "SM_StartMission()".
Right after this function add this new function:
In the "%mission = " line you can select which mission you want to load by putting in the appropriate name for it. As you can see, the function does the same as selecting a mission in the StartMissionGui and the emulating the click on the "Start Mission" button by doing this all in one function.
That's it. Done. :-)
Hope you find this little helper useful too for your game debugging.
Martin
Let's start right away with the changes. There's not much to change, so don't worry, we'll be quickly through it. I assume that we have fresh TGE 1.5.2 version (but works also with TGEA) and starter.fps is your default game in main.cs.
Please open up starter.fps/client/ui/StartupGui.gui and and replace the function checkStartupDone() by the one below:
function checkStartupDone()
{
[b]StartupGui.done = true;[/b]
if (StartupGui.done)
{
echo ("*** Load Main Menu");
[b]//loadMainMenu();
SM_StartMissionQuick();[/b]
}
else
schedule(100, 0, checkStartupDone );
}This tells the startup gui to be done immediately and instead of loading the main menu it's going start the function "SM_StartMissionQuick();" which we add now. This new function is going to load our default mission we use for debugging.
Please open starter.fps/client/ui/StartMissionGui.gui and find the function "SM_StartMission()".
Right after this function add this new function:
// Quickloading a mission for debugging/testing.
function SM_StartMissionQuick()
{
%mission = "starter.fps/data/missions/barebones.mis";
%serverType = "MultiPlayer";
createServer(%serverType, %mission);
%conn = new GameConnection(ServerConnection);
RootGroup.add(ServerConnection);
%conn.setConnectArgs($pref::Player::Name);
%conn.setJoinPassword($Client::Password);
%conn.connectLocal();
}In the "%mission = " line you can select which mission you want to load by putting in the appropriate name for it. As you can see, the function does the same as selecting a mission in the StartMissionGui and the emulating the click on the "Start Mission" button by doing this all in one function.
That's it. Done. :-)
Hope you find this little helper useful too for your game debugging.
Martin
#2
11/30/2007 (3:20 pm)
Ive done something like this (added a button) in the RTS Kit a long time ago, tired of following the normal path... Good idea to release it as a resource, maybe I will do something like this for the RTS-SK
#3
12/04/2007 (12:31 am)
Any chance we can get a description of how to do this using TGEA? I don't see starter.fps anywhere...
#4
12/04/2007 (12:32 am)
@Warp Zone: Works for single player too. Just replace the "MultiPlayer" by "SinglePlayer" and voila!
#5
Tried sticking it just before the line StartMissionGuiCheck.performClick(); It skipped the title screen and brought up the loading screen, but it just shows an empty loading bar that says "WAITING FOR SERVER." I think maybe the demo that shipped with TEGA uses completely different scripts.
12/04/2007 (12:45 am)
I can't figure out where to put the function. There is no function called SM_StartMission() in C:\Torque\example\demo\client\ui\StartMissionGui.gui, just a bunch of what look like some sort of click handlers...Tried sticking it just before the line StartMissionGuiCheck.performClick(); It skipped the title screen and brought up the loading screen, but it just shows an empty loading bar that says "WAITING FOR SERVER." I think maybe the demo that shipped with TEGA uses completely different scripts.
#6
12/04/2007 (12:49 am)
Ah, don't use the demo example! That is a stripped down version and does not include everything. Take a fresh starter.fps mod and modify that one.
#7
12/04/2007 (12:51 am)
Where do I get starter.fps? I don't see any files or folders with that name...
#8
12/04/2007 (1:08 am)
Do you have a license for TGE or TGEA? Or do you play with the demo? If demo, then you don't have those file unfortunately.
#9
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=12251
And a description of how to port the TGE version to TGEA:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=13534
I suppose I can work out for myself how to convert the alpha version to something nice that uses shaders on my own.
12/04/2007 (1:09 am)
Hmmm... Found a rough alpha version of a port here: http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=12251
And a description of how to port the TGE version to TGEA:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=13534
I suppose I can work out for myself how to convert the alpha version to something nice that uses shaders on my own.
#10
12/04/2007 (1:09 am)
I have the indie liscence for TEGA.
#11
12/04/2007 (1:11 am)
Ah, right, yes, TGEA. Yes, use the starter.fps port and go from there.
#12
12/04/2007 (1:21 am)
Better than nothing. Thanks for the help, Martin. :)
#13
I goes right to a black screen and in the log, I can see it saying that player is not READY ... like it still waiting for me to hit READY. (which seems a bit redundant anyhow)
Ideas?
01/19/2010 (12:04 am)
Hey guys - Any idea how to get this to work with the RTS Kit add-on ?I goes right to a black screen and in the log, I can see it saying that player is not READY ... like it still waiting for me to hit READY. (which seems a bit redundant anyhow)
Ideas?
#14
http://www.torquepowered.com/community/resources/view/14155
01/19/2010 (12:11 am)
Nevermind - I found the correct post for the RTS kit;http://www.torquepowered.com/community/resources/view/14155

Torque Owner Andy Rollins
ZDay Game