@Raymond-Smits wrote:
...
And can you please add the m_carPosition so that we can translate it into the correct Player name?
I normally don't answer, when people seem to not have 1) put effort on understanding/research or 2) not to be willing to understand or both.
I will try once more answer your question, which 3 people have tried to answer with hope that this issue is not raised again.
There are the "multicar data packets", i.e. like PacketLapData, PacketCarTelmetryData and also thePacketParticipant data, which has the NAMES. In all these packets the "order of drivers" is always the same. So if e.g. player data is at index (i.e. idx) 6, then it is at that index in all these multicar packets. Also if driver's data is at index (idx) 1, then you can find the data for that driver in all the arrays in the same position, i.e. at index 1. Please note that typically the index values in arrays in programming start from 0, not from 1.
In the past in TimeTrial, player data was always at index 0 (i.e.m_idx == 0) and player personal best was at index 2 and the the rival/ghost was somewhere between 3 and 21. In the older games you had to detect from data, which car was actually the "rival", but now Codemasters has kindly helped the noobs and provides the data in the UDP feed, which I also appreciate.
To get back to the PacketTimeTrial data and your question:
There is data for only 3 cars: player, player_best and rival. If you want to get the Rival's name, you can use the m_carIdx from the m_rivalDataSet and take the PacketParticipantData.m_participants[m_caridx from m_rivalDataSet].m_name. If you had worked on the data from previous games, you would know, you can get he same rival m_carIdx from PacketLapData.m_timeTrialRivalCarIdex. I use the latter in my Tool.
Cheers.