Scripting sectors and fastest lap

Posts: 8
Good morning everyone, first of all Merry Christmas.

I am trying to make a script to try to control the times of the sectors of a driver and compare it with the fast lap of the session. The first problem I have is for example, in a session that I have entered for a test at Motegi, I don't understand why but it tells me that the track only has 2 sectors so if I look for the third index I get an error and on the other hand in another session I have tried to pass as binding the times of the sectors of the driver that I want to focus and I get an error but in the log I can't find the reason for the failure.

I leave attached two screenshots and the crash log.

Greetings and thanks :)




Download logfile
Error: 12/28/2020 11:56:01 AM (UTC)
ATVO version: 1.34.3.0
Themes SDK version: 1.33.0.0
Theme version: none

Unhandled exception
System.NullReferenceException: Object reference not set to an instance of an object.
at ATVO.Data.Updater.DataUpdater.Update(Simulation sim, DataSnapshot data) in D:\Users\Nick\Documents\Programming\ATVO\Appgineer.in-TV-Overlay-for-iRacing\ATVO.Data\Updater\DataUpdater.cs:line 162
at ATVO.Data.Updater.DataUpdater.Update(iRacingSDK sdk, Simulation sim) in D:\Users\Nick\Documents\Programming\ATVO\Appgineer.in-TV-Overlay-for-iRacing\ATVO.Data\Updater\DataUpdater.cs:line 111
at ATVO.Data.Updater.DataUpdater.UpdateData(iRacingSDK& sdk, Simulation sim) in D:\Users\Nick\Documents\Programming\ATVO\Appgineer.in-TV-Overlay-for-iRacing\ATVO.Data\Updater\DataUpdater.cs:line 85
at ATVO.Data.Simulation.UpdateData() in D:\Users\Nick\Documents\Programming\ATVO\Appgineer.in-TV-Overlay-for-iRacing\ATVO.Data\Simulation.cs:line 294
Edited (2 times)
Posts: 785
I'm not sure exactly what's going wrong here. Do you know where in the script it fails - eg which line is still logged to the Log output?

I believe we allow you to disable sectors so perhaps you removed a sector and that could explain why there are only 2?
Posts: 8
Nick Thissen wrote:
I'm not sure exactly what's going wrong here. Do you know where in the script it fails - eg which line is still logged to the Log output?

I believe we allow you to disable sectors so perhaps you removed a sector and that could explain why there are only 2?

I've noticed it by doing a test, putting the biddings that I put in the photo the application directly launches an alert continuously and doesn't let me do anything else than close the program because when I accept the alert a new alert comes out.

On the other hand, I have only tried to pass the object of the session in Spa and in this case it returns 3 sectors, as you can see in the photo. I don't know why, because with the same data as in Motegi here, it does return 3 sectors.

The error I don't know exactly how to see the line where the script fails, that's why I sent the complete log that the program generates.

Greetings.


Posts: 785
There are currently two problems with sectors which I am trying to fix for a next update:

1. There used to be a way for you to select which sectors are being used via the track map in the Timing Screen. That went missing a while back due to an update, I will try to bring it back. This allows you to select how many and which of the official sector crossings to use as the lap sectors.

2. The default sector assignment logic is flawed and in some tracks it will only assign up to 2 sectors, even if the real track has many more. This is problably the issue you are seeing. I will try to let it come up with at least 3 sectors by default. Maybe even just assign all sectors for simplicity even if there are more than 3.
Posts: 100
While you're digging through sector stuff - is it possible to set up a databinding for drivers who are fastest in each sector, or save fastest sector times? Seems like something common enough that it'd be worth having that over scripting.
Posts: 785
I can look into that. What exactly do you need the bindings to return? Fastest sector times for each driver?
Posts: 100
Nick Thissen wrote:
I can look into that. What exactly do you need the bindings to return? Fastest sector times for each driver?


Yes - and perhaps a way to order people by fastest sector in each sector - so we can know in a live context who is on a fast lap (thinking Formula 1 qualifying where purple sectors shows a driver is fastest on the current lap, before they put in a full laptime).

I think what we really need is something like IsFastestSector1, IsFastestSector2, so we can color the sector bindings purple when a driver is quickest in a particular sector.

Edited (1 time)
Posts: 8
That's what i was trying to do, with the binding get the fastest time of the current driver and with the session object the get fastest sectors.