Trying to make a timer

Discussion in 'Mod Discussions' started by Dementiurge, October 4, 2013.

  1. Dementiurge

    Dementiurge Post Master General

    Messages:
    1,094
    Likes Received:
    693
    Specifically, I'm trying to make an elapsed time counter using the same variables used by the chronocam to determine the time elapsed and what time you're reviewing. Those seem to be the only proper time variables stored by the game.

    Code:
    <span class='match_timer' data-bind='text: currentTimeString'></span>
    It works well, save for one small problem: It doesn't update unless the Chronocam UI is active. Not good. And that's where I'm stuck. With only about 2 minutes of javascript under my belt (but at least the Knockout tutorials were easy), I can't be sure if I'm missing something important.

    I also couldn't find any info on what the 'handlers' functions are, such as "handlers.time".
  2. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    handlers are callbacks from the game. So they are methods called whenever something happens in the game tthat you want to observe. It seems the timecallback is only called when the chronocam is active.
    Maybe you can work aroound this by activating the chronocam for a ms only. But it's likely that could have negative effects.
    Dementiurge likes this.

Share This Page