kutu / pyirsdk

Python 3 implementation of iRacing SDK
MIT License
317 stars 48 forks source link

loss of control #30

Closed AndiSenior closed 1 year ago

AndiSenior commented 1 year ago

Hi kutu Many thanks for the great SDK, it works like a charm:-) Regarding incidents: there is only the incidents counter in the "DriverInfo" available right? So, the way to detect the type of incident ist to store the old incident count and subtract the new. So you get x1, x2 and x4 incidents, right? Is there another approach to detect the incidents? The off track can be detected reading the CarIdxTrackSurface, but how can I detect "loss of control" and "light contact with another driver" (0x0)? Hope you can give me a direction, thanks in advance, Andi

kutu commented 1 year ago

Is there another approach to detect the incidents?

ir['PlayerCarDriverIncidentCount'] DriverInfo incidents only available after the session ends in race, in practice incidents maybe available immediately

The off track can be detected reading the CarIdxTrackSurface

not reliable

but how can I detect "loss of control"

maybe 2x and car slowed down a lot

"light contact with another driver" (0x0)?

you can't