ScoringInfo: best lap's sectors versus best sector

Discussion in 'Plugins' started by Tygernoot, Oct 20, 2015.

  1. Tygernoot

    Tygernoot Registered

    Joined:
    Feb 26, 2012
    Messages:
    114
    Likes Received:
    64
    Hi guys,

    I'm pretty sure this question has already been asked before, but I couldn't manage to find it.

    I want to know the sectors that were set on the driver's best lap.

    The plugin provides these fields:
    Code:
     double mBestSector1;           // best sector 1
      double mBestSector2;           // best sector 2 (plus sector 1)
      double mBestLapTime;           // best lap time
      double mLastSector1;           // last sector 1
      double mLastSector2;           // last sector 2 (plus sector 1)
      double mLastLapTime;           // last lap time
      double mCurSector1;            // current sector 1 if valid
      double mCurSector2;            // current sector 2 (plus sector 1) if valid
    My issue is that the mBestSector1/2 represent the best sector overall - of all laps done by the driver, and not the sectors of the best lap. And it's the latter I want to know.

    The only way I figured to keep track of the best lap's sectors, is by storing the mLastSector1/2 manually whenever a new mBestLapTime is made.

    The downside of this is that when joining a server that's already in progress, you don't have access to these sector times (as the plugin wasn't active at that time to store them).

    The game obviously knows these sector times, as when you do a first timed lap, you can see the difference between your sector and the best lap's sector in the in-game HUD.

    Other than pulling them out of memory, am I missing something? Any other way to get to know these?

    Hope my question is clear ;)

    Thanks and best regards,
    Ed.
     
  2. Terence Groening

    Terence Groening Registered

    Joined:
    Oct 13, 2010
    Messages:
    169
    Likes Received:
    0
    I'll add a couple floats at the end of the structure (replacing some mExpansion area) with this data. I'm not currently 100% sure that the info is available in multiplayer all the time, but if you tested it you are probably right.
     
  3. Tygernoot

    Tygernoot Registered

    Joined:
    Feb 26, 2012
    Messages:
    114
    Likes Received:
    64
    Thanks a lot. That's really great!

    I could imagine the best splits not being available during the race or other certain circumstances, I am not totally sure. But during practice/qualifying I'm pretty sure they are. The game's HUD always displays the split time compared to your own best lap and the leader's best lap (and not the overall best split), regardless of whether or not this lap was set before the player (re)joined the server.

    Thanks again, this would really help me out :)
     

Share This Page