Giter Club home page Giter Club logo

Comments (6)

SHWotever avatar SHWotever commented on July 30, 2024

Hi ! All those properties have been deprecated in favour of a set of functions giving access to all the existing data no matter if it's in a "ahead behind" format or the more conventional leaderboard format :
https://github.com/SHWotever/SimHub/releases/tag/9.1.0

To avoid breaking existing creations the properties are still working but are not listed anymore I'm favour of the more feature rich functions set.

from simhub.

sdhengsoft avatar sdhengsoft commented on July 30, 2024

Ahh, perfect. Thanks for that.

from simhub.

sdhengsoft avatar sdhengsoft commented on July 30, 2024

I tried the new function methods, but I'm having trouble getting driver gap information. I'm just trying to get the time gap of the car directly ahead and behind my position on track. I tried this:

var driverPos = getopponentleaderboardposition_aheadbehind( -1); var tGap = drivergaptoplayer( driverPos);

This works great during a "Race" session type. However, no data is returned for "Practice" or "Qualifying" session types.

Whereas:

var tGap = $prop( 'PersistantTrackerPlugin.DriverAhead_00_Gap');

returns valid data in all session types.

Any thoughts? I also tried the function driverrelativegaptoplayer( driverPos). Not sure what the intended difference is between these two calls (they are different values), but both only have data during a race. The 1st function matches the gaps reported in R3E leaderboard exactly.

from simhub.

SHWotever avatar SHWotever commented on July 30, 2024

Hello ! Apparently you were close :

driverrelativegaptoplayer(getopponentleaderboardposition_aheadbehind(-1))

should give the same result as before, the only difference is that the lack of data is clearly available now returning null instead of 0 when nobody is in front (front being up to 50% of the lap in front)

from simhub.

sdhengsoft avatar sdhengsoft commented on July 30, 2024

Okay, I thought I tried this one. I'll give is another try and get back with a comment. Thanks.

from simhub.

sdhengsoft avatar sdhengsoft commented on July 30, 2024

Ha! Thanks for that. I can see the subtle error now. This is the code I had:

var driverPos = getopponentleaderboardposition_aheadbehind( -1);
var tGap = drivergaptoplayer( driverPos);
if ( tGap == null) {
  tGap = driverrelativegaptoplayer( driverPos);
}
return tGap;

Just had to change the tGap == null to tGap == 0. I was expecting the null return. Whoops!

Also, it looks like I may not need the IF section at all and just use:

return driverrelativegaptoplayer( getopponentleaderboardposition_aheadbehind( -1));

But I'll check the time gap matches the R3E values when I race next.

Thanks again.

from simhub.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.