Executing the metrics(fps)- command in game
by Holger · in Torque Game Engine · 12/14/2006 (12:50 pm) · 8 replies
I would like to execute the metrics(fps) - command by pressing a key in the game.
I know that I need to bind a key for that command, but how (and where) do I call that
metrics command?
thanks for any help!
I know that I need to bind a key for that command, but how (and where) do I call that
metrics command?
thanks for any help!
#2
but i'd recommend going in to default.bind.cs
and adding a line similar to:
and then elsewhere in that file add something like this:
12/14/2006 (1:42 pm)
Not sure what Badguy's referring to,but i'd recommend going in to default.bind.cs
and adding a line similar to:
moveMap.bindCmd(keyboard, "m", "toggleMetrics(fps);", "");
and then elsewhere in that file add something like this:
$metricsOn = false;
function toggleMetrics(%whichMetric)
{
$metricsOn = !$metricsOn;
if (!$metricsOn)
%whichMetric = "";
metrics(%whichMetric);
}
#3
well my example is showing how to implement your own Server command.
I did not realize (duh) this is a client command.
but there is a good way to learn how to implement server commands :)
which he might want to do next :)
Badguy was referring to scanning the codebase for a server command example.
which is not necessary for this. (will prolly work tho no?)
12/14/2006 (1:49 pm)
Right,well my example is showing how to implement your own Server command.
I did not realize (duh) this is a client command.
but there is a good way to learn how to implement server commands :)
which he might want to do next :)
Badguy was referring to scanning the codebase for a server command example.
which is not necessary for this. (will prolly work tho no?)
#4
In short don't delete the .dso and the game never will see your changes.
12/14/2006 (2:06 pm)
Don't forget to delete the default.bind.dso file after you make your change and before you launch your game. The engine looks for and pre-compiled .cs files and uses them when found skipping over the compilation process.In short don't delete the .dso and the game never will see your changes.
#5
actually,
the files you need to delete is "config.cs" and "config.cs.dso".
default.bind.cs will recompile automatically.
- afaik !
12/14/2006 (2:10 pm)
Oh yah.actually,
the files you need to delete is "config.cs" and "config.cs.dso".
default.bind.cs will recompile automatically.
- afaik !
#6
12/14/2006 (2:23 pm)
Doesnt it use filestamp changes to detect the need for a recompile?
#7
the trick is that "config.cs" is *generated* when the app quits,
and the next time you run it, config.cs is loaded after default.bind.cs.
thus,
if you change default.bind.cs you need to blow away config.cs and config.cs.dso.
12/14/2006 (2:37 pm)
Yep.the trick is that "config.cs" is *generated* when the app quits,
and the next time you run it, config.cs is loaded after default.bind.cs.
thus,
if you change default.bind.cs you need to blow away config.cs and config.cs.dso.
#8
12/14/2006 (11:52 pm)
Thanks for all the help!
Torque Owner Badguy
and search the script for it.
for example, search for : serverCmdToggleCamera, reduce it to ToggleCamera because the serverCmd section is only used once to define the command.
this should present to you the script's that defines the function.
as well as the hooks to implement it as well.