Jump to content

Pyrogenesis, show time played.


Recommended Posts

Is there some command that would show me how long I have been playing? When you win/lose you will see how much time elapsed but I want to check while playing.

I'm not sure that you mean the same under 'command', but following command typed in game's console should display time from match start in milliseconds:


Engine.GuiInterfaceCall("GetExtendedSimulationState").timeElapsed

The same value is used on summary screen, but it formatted with this function:


/**
* @param time Time period in milliseconds (integer)
* @return String representing time period
*/
function timeToString(time)
{
var hours = Math.floor(time / 1000 / 60 / 60);
var minutes = Math.floor(time / 1000 / 60) % 60;
var seconds = Math.floor(time / 1000) % 60;
return hours + ':' + (minutes < 10 ? '0' + minutes : minutes) + ':' + (seconds < 10 ? '0' + seconds : seconds);
}

You can perform some formating in console too, for example this should return time in minutes:


var timeElapsed = Engine.GuiInterfaceCall("GetExtendedSimulationState").timeElapsed; Math.floor(timeElapsed / 60000);

Link to comment
Share on other sites

Alexander, would it be easy for you to add the possibility to display the time in hours, minutes, and seconds in the game view? Say in the top right corner, and say when you press the F11 key? (And hidden when you press F11 again.) Would be hugely appreciated :) Perhaps we should add it as a "simple" task though so someone can have something relatively easy to start with :unsure:

Link to comment
Share on other sites

I'm not sure that you mean the same under 'command', but following command typed in game's console should display time from match start in milliseconds:


Engine.GuiInterfaceCall("GetExtendedSimulationState").timeElapsed

The same value is used on summary screen, but it formatted with this function:


/**
* @param time Time period in milliseconds (integer)
* @return String representing time period
*/
function timeToString(time)
{
var hours = Math.floor(time / 1000 / 60 / 60);
var minutes = Math.floor(time / 1000 / 60) % 60;
var seconds = Math.floor(time / 1000) % 60;
return hours + ':' + (minutes < 10 ? '0' + minutes : minutes) + ':' + (seconds < 10 ? '0' + seconds : seconds);
}

You can perform some formating in console too, for example this should return time in minutes:


var timeElapsed = Engine.GuiInterfaceCall("GetExtendedSimulationState").timeElapsed; Math.floor(timeElapsed / 60000);

Yeah I meant console commands. Dividing by 1000 (ty quantum) shows in seconds so its enough for me.

Edited by Linux_Eki
Link to comment
Share on other sites

Alexander, would it be easy for you to add the possibility to display the time in hours, minutes, and seconds in the game view? Say in the top right corner, and say when you press the F11 key? (And hidden when you press F11 again.) Would be hugely appreciated :) Perhaps we should add it as a "simple" task though so someone can have something relatively easy to start with :unsure:

It would indeed be a welcome feature (F11 is already used for the console).

Link to comment
Share on other sites

It would indeed be a welcome feature (F11 is already used for the console).

Hmm, no, F9 is used for the console =) But you're right, it is used for something else: the profiler :) So yeah, I forgot it is already being used. I only suggested it because in the games I remember the shortcut for this feature it is indeed F11. Not sure what's best to put on another shortcut though, the profiler or the time, the profiler has been used for quite some time on that key, but as I said I do remember F11 being the key for displaying time in other games :unsure: Either way, the main thing is that it would be nice to have :) The key is easy to change.

Link to comment
Share on other sites

Framerates and Elapsed Time should each get a function key, imho.

Is a function key more intuitive than Shift+F for framerate? Not saying that should be the only consideration, but if nothing else there might be other things we might want to put on the function keys :) (Like save, load, etc)

Link to comment
Share on other sites

Is a function key more intuitive than Shift+F for framerate? Not saying that should be the only consideration, but if nothing else there might be other things we might want to put on the function keys :) (Like save, load, etc)

Well, there are 12 function keys for a PC keyboard (10 for Mac? Not sure).

Help

Screenshot

Quicksave

Frame Rate

Game Timer

Player Scores

Anything else?

Link to comment
Share on other sites

Well, there are 12 function keys for a PC keyboard (10 for Mac? Not sure).

Help

Screenshot

Quicksave

Frame Rate

Game Timer

Player Scores

Anything else?

F10 for menu

And F9 is currently used for the console, not saying that should necessary be the one, but I think it's good to have it on one of the function keys to allow for easy access for us not using US keyboards :) But yeah, perhaps there are enough :)

Link to comment
Share on other sites

Alexander, would it be easy for you to add the possibility to display the time in hours, minutes, and seconds in the game view? Say in the top right corner, and say when you press the F11 key? (And hidden when you press F11 again.) Would be hugely appreciated :) Perhaps we should add it as a "simple" task though so someone can have something relatively easy to start with :unsure:

I decided that it is easier/better to implement this myself, rather than create ticket, describe details and wait when someone will implement it (because this task required only few lines of code/markup written in right place, and it is probably don't make sense to not describe what and where to write when we know, and if we describe it like 'to implement this task, write line <...> in file <...>' it is not make sense to create such tasks).

See r10402. I set it to F12, which looks unused.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...