Jump to content

Oblivion seconds & milliseconds timer?


DarkSpyda04

Recommended Posts

SOLVED

 

I want to create a series of moving platforms for a platformer mod and I would like to find out how long it takes to jump from one platform to another where the distance between platforms has already been predetermined. I tried playing a stopwatch while in windowed mode but this results in very rough estimates. Is there any way to make a timer that shows up on the screen in-game, can be started & paused with the press of a key, and uses a seconds & milliseconds time count?

Edited by DarkSpyda04
Link to comment
Share on other sites

Create a quest and add this script to it.

 

In game, press "y" to start and end the timer. A message will be printed to the console.

(if you want to change the key, the list is here)

 

scn aaqqxxTimer
float fQuestDelayTime
float tTimer 


begin gamemode
Let fQuestDelayTime := .001
if OnKeyDown  21   ;  y
  if tTimer == 0
    ;=== Start a new cycle ===
    let tTimer += GetSecondsPassed
    printc "Starting a new interval"
  else
    printc "Interval = %0.1f seconds"  tTimer  
    let tTimer := 0
  endif
else
  if tTimer > 0
    let tTimer += GetSecondsPassed
  endif
endif

end
Link to comment
Share on other sites

I see how it works. You press 'Y' to start an invisible timer and press 'Y' to end it and you can check the console by pressing '~' to view the recorded time. Then you can do it all over again. It is an effective stopwatch and does exactly what I wanted it to do. I found out that a jump up one crate and over a chasm of three crates records a time of 1.8sec when the crate is set to a scale of 1.6. The more chasms I jump over subsequently, the more accurate my number becomes. For instance, after jumping across 7 chasms, my time becomes 10.0sec and thus it's only 1.4 sec per chasm. If I wanted to make things easy for the player, I could give more room for error and make the platforms disappear a good 2.0sec later.

 

Did you make the timer yourself? It's really cool. "Let" and "printc" were things I never even knew about. "Let" seems to redefine variables and "printc" prints a message to the console window.

 

Honestly I'm not really an ideal programmer and I'm beginning to value what other people can do. I guess this is why those visions of Nehrim-scale projects require team members rather than just one guy whose a jack-of-all-trades. One person is the designer, one guy's the artist, one guy's the sound, then you got your programmer. It's a lot less work and a lot less stress instead of one person working alone. Not only that, but the combined efforts of many can produce some really cool things that would otherwise never see the light of day.

Edited by DarkSpyda04
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...