Comments (6)
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.
Ahh, perfect. Thanks for that.
from simhub.
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.
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.
Okay, I thought I tried this one. I'll give is another try and get back with a comment. Thanks.
from simhub.
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)
- LMU TC/ABS HOT 1
- System.NullReferenceException: Object reference not set to an instance of an object. at SimHub.Plugins.DataPlugins.RGBDriver.LedResult.Merge(LedResult ledResult, Nullable`1 startPosition) HOT 1
- Minimum Car Speed Setting for wind and/or fan/speed curve
- ambiemt lights, ws2812b and matrix not working HOT 3
- Do you have a multilingual plan? HOT 1
- CLI batch configuration import HOT 1
- Controll Mapping Assistant not available if Dash Studio is disabled HOT 1
- Fanalab crashing after time when Simhub is running (ACC) HOT 1
- Sim Hub Auto Detect Issue HOT 5
- led brightness control not lightning up the leds HOT 1
- SimHub Shake-It Motor issue with Simagic HPR in iRacing HOT 2
- Control Mapper Streamdeck Plugin, multi action compatibility HOT 4
- The SLI Plugin window does not work from version 9.02.9 onwards HOT 2
- Control Mapper Stream Deck HOT 2
- Replay gain level different to live driving (shake it) HOT 1
- [Feature request] Retrieve Mode setting in custom effect
- InstantConsumption doesnt report HOT 1
- global control system volume stopped working HOT 5
- PLS Update map for ATS (American Truck Simulator) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simhub.