7 useful Simhub overlays

Discussion in 'Third Party Content' started by ThomasJohansen, Jan 26, 2020.

  1. addrum

    addrum Registered

    Joined:
    Mar 1, 2021
    Messages:
    6
    Likes Received:
    0
    upload_2021-3-1_19-45-50.png

    Relative overlay, not sure which field. The bottom 2 didn't wrap around in this instance for some reason but basically the 4 column from the left is always "#null" in the stock cars. In other cars like the paid GT3/E cars there's no issue.
     
  2. ThomasJohansen

    ThomasJohansen Registered

    Joined:
    Dec 27, 2019
    Messages:
    948
    Likes Received:
    2,171
    fixed the leaderboard relative section to hide fields when "#null"
    try this and tell me if it works.
    If it works I'll add it to the racedepartment resource
     

    Attached Files:

  3. addrum

    addrum Registered

    Joined:
    Mar 1, 2021
    Messages:
    6
    Likes Received:
    0
    upload_2021-3-2_21-7-24.png

    The nulls are no longer there which is great, however we've now lost the race position in the relative section.
     
  4. ThomasJohansen

    ThomasJohansen Registered

    Joined:
    Dec 27, 2019
    Messages:
    948
    Likes Received:
    2,171
    Which car is it? Because it's not showing correct place in position gab section too.
    Could there be something missing in the car mod?
    Well you can edit the leaderboard dash and remove the code function behind "visible" properties for the fields you want to be shown.
     
  5. addrum

    addrum Registered

    Joined:
    Mar 1, 2021
    Messages:
    6
    Likes Received:
    0
  6. ThomasJohansen

    ThomasJohansen Registered

    Joined:
    Dec 27, 2019
    Messages:
    948
    Likes Received:
    2,171
    I can try and test with the car tomorrow, but if it's too car specific it's hard to find a good solution. That's also why sometimes tyrecompound is blank, there are so many possibilities that's it's hard to code in.
     
  7. addrum

    addrum Registered

    Joined:
    Mar 1, 2021
    Messages:
    6
    Likes Received:
    0
    Yeah of course, no pressure! It's still super useful :)
     
  8. ThomasJohansen

    ThomasJohansen Registered

    Joined:
    Dec 27, 2019
    Messages:
    948
    Likes Received:
    2,171
    @addrum I suspect, it's the car mod which is missing information. Carnumber is not available in correct format in the api.
    But when looking in the veh file, the number is present. Quite weird.

    Unavngivet.png


    Unavngivet2.png
     
  9. addrum

    addrum Registered

    Joined:
    Mar 1, 2021
    Messages:
    6
    Likes Received:
    0
    How strange. I'll report to the mod author and see what they say.

    Was there a way to hide the "#null" but keep the race position in the relative (first column)? See my last screenshot; only my race position is shown.
     
  10. ThomasJohansen

    ThomasJohansen Registered

    Joined:
    Dec 27, 2019
    Messages:
    948
    Likes Received:
    2,171
    you can edit the leaderboard yourself. just edit those fields you want to be shown all the time and edit the green visible fx field, and remove the code in that.
    Unavngivet.png
     
  11. Pasquale Genchi

    Pasquale Genchi Registered

    Joined:
    Nov 5, 2017
    Messages:
    31
    Likes Received:
    6
    Can it show correct tyre info while using third party mods?
     
  12. ThomasJohansen

    ThomasJohansen Registered

    Joined:
    Dec 27, 2019
    Messages:
    948
    Likes Received:
    2,171
    I think so, have never experienced otherwise. But it has problem showing oil and water temps from most s397 cars because rf2 api dont expose those info from these cars.
     
    Pasquale Genchi likes this.
  13. Pasquale Genchi

    Pasquale Genchi Registered

    Joined:
    Nov 5, 2017
    Messages:
    31
    Likes Received:
    6
    So it should work in both the leaderboard (to show which tyres are my opponents using) and the main tyres widget right?

    I'll give it a try anyway
     
  14. ThomasJohansen

    ThomasJohansen Registered

    Joined:
    Dec 27, 2019
    Messages:
    948
    Likes Received:
    2,171
    oh I thought you talked about temps and wear info etc.

    If its about the compound, its a bit different.
    Because there is (to my knowledge) not a standard for what is soft, medium, hard etc.
    So I have only "hard programmed" the most used ones.
    I think the "main tire info" shows correct but in leaderboard where it only shows one letter, its more limited.

    you are welcome to gather a long list of possible tires from the api with each car but its not as simple of saying super soft, hyper soft etc.
    some are named s8m and likewise so the have to be identified and grouped.
     
  15. ThomasJohansen

    ThomasJohansen Registered

    Joined:
    Dec 27, 2019
    Messages:
    948
    Likes Received:
    2,171
    here is an example of the code from the leaderboard.
    Code:
    var CurrentPos = $prop('DataCorePlugin.GameData.NewData.Position');
    var compoundText = "";
    var CurrentName = drivername(1);
    
    
    if (CurrentPos <= 9){CurrentPos = '0' + CurrentPos}
    
    compoundText = $prop('GarySwallowDataPlugin.Leaderboard.Position' + CurrentPos + '.Telemetry.TyreCompound')
    
    if(compoundText == 'S7M (Soft)'){return 'S'};
    if(compoundText == 'Slick N2'){return 'S'};
    if(compoundText == 'SLICK CPM'){return 'S'};
    if(compoundText == 'S8M (Medium)'){return 'M'};
    if(compoundText == 'S9M (Hard)'){return 'H'};
    if(compoundText == 'H5M (Inter)'){return 'I'};
    if(compoundText == 'P2M (Rain)'){return 'W'};
    if(compoundText == 'P9M (Rain)'){return 'W'};
    if(compoundText == 'Rain N2'){return 'W'};
    
     
  16. ThomasJohansen

    ThomasJohansen Registered

    Joined:
    Dec 27, 2019
    Messages:
    948
    Likes Received:
    2,171
    Good news...
    Im not a coder....
    but found a way to check if part of the a word is in the name of the tirecompound. if it is then show the correct letter.

    @The Walker do you know any compounds on your mod cars that dont have one of these names below included?

    so the code for each "one letter" text in the leaderboard should be this:

    Code:
    var CurrentPos = $prop('DataCorePlugin.GameData.NewData.Position');
    var compoundText = "";
    var CurrentName = drivername(1);
    
    
    if (CurrentPos <= 9){CurrentPos = '0' + CurrentPos}
    
    compoundText = $prop('GarySwallowDataPlugin.Leaderboard.Position' + CurrentPos + '.Telemetry.TyreCompound')
    
    var compoundTextlow = lcase(compoundText);
    
    
    if(compoundTextlow.indexOf('qual') >= 0){return 'Q'};
    if(compoundTextlow.indexOf('slick') >= 0){return 'S'};
    if(compoundTextlow.indexOf('soft') >= 0){return 'S'};
    if(compoundTextlow.indexOf('race') >= 0){return 'R'};
    if(compoundTextlow.indexOf('road') >= 0){return 'R'};
    if(compoundTextlow.indexOf('medium') >= 0){return 'M'};
    if(compoundTextlow.indexOf('hard') >= 0){return 'H'};
    if(compoundTextlow.indexOf('inter') >= 0){return 'I'};
    if(compoundTextlow.indexOf('wet') >= 0){return 'W'};
    if(compoundTextlow.indexOf('rain') >= 0){return 'W'};
    
     
    Last edited: Mar 19, 2021
  17. ThomasJohansen

    ThomasJohansen Registered

    Joined:
    Dec 27, 2019
    Messages:
    948
    Likes Received:
    2,171
    any compounds you want included, that dont fit those words, and then what "one letter" should represent it?
     
  18. Dave^

    Dave^ Registered

    Joined:
    Oct 14, 2019
    Messages:
    263
    Likes Received:
    121
    I've pinched bits of these to make my own.... One thing I'm missing though....

    Is there a way to display theoretical best lap? I can't get the best sectors to add up.
     
  19. ThomasJohansen

    ThomasJohansen Registered

    Joined:
    Dec 27, 2019
    Messages:
    948
    Likes Received:
    2,171
    Just tried it...

    try this for theoretical best lap:
    Code:
    secondstotimespan(
    (
    timespantoseconds([DataCorePlugin.GameData.NewData.Sector1BestTime])+
    timespantoseconds([DataCorePlugin.GameData.NewData.Sector2BestTime])+
    timespantoseconds([DataCorePlugin.GameData.NewData.Sector3BestTime])
    )
    )
    

    This is for potentional lap based on current sector and best sector combined:

    Code:
    secondstotimespan(
    (
    timespantoseconds([Sector1Time])+
    timespantoseconds(isnull([Sector2Time],[DataCorePlugin.GameData.NewData.Sector2BestTime]))+
    timespantoseconds([DataCorePlugin.GameData.NewData.Sector3BestTime])
    )
    )
    
     
    Last edited: Apr 15, 2021
    Dave^ likes this.
  20. Dave^

    Dave^ Registered

    Joined:
    Oct 14, 2019
    Messages:
    263
    Likes Received:
    121
    Awesome, thanks.

    I'll try it over the weekend.
     

Share This Page