RenCloud / scs-sdk-plugin

ETS2 (Euro Truck Simulator 2) & ATS (American Truck Simulator) SDK plug-in. Telemetry data is shared via SharedMemory/Memory Mapped Files.
MIT License
201 stars 40 forks source link

Status of hazard light #85

Closed RainOrigami closed 3 years ago

RainOrigami commented 3 years ago

Is there any way to get the status of the hazard lights? I can't find a value pertaining to enabling hazards and I would have expected Blinker Left Active and Blinker Right Active both to be 1 when hazards are enabled, but they are 0.

killerjoey55 commented 3 years ago

Could you use Blinker Left On and Blinker Right On instead? Only issue is I imagine it'll be a toggle between 1 and 0 with the lights, rather than a constant 1.

RainOrigami commented 3 years ago

That would be my workaround, however I wanted to use this to light up the hazard button on my button box while the hazards are active so I would have rather had a value for this.

I think I can check whether Blinker Left On and Blinker Right On are both 1 at the same time, then light up the LED and set a timeout similar to the blinker interval to check whether the lights are off to disable the LED again. Or maybe even easier I'll set the hazard LED directly when both blinkers are enabled and then I'll just let the hazard LED blink also.

If there is no official way to get the hazard light status then I will use a workaround and this issue can be closed.

RenCloud commented 3 years ago

The state of the Hazard Light is available with version 1.41 of the game and will be supported of this project in the future. Current dev-branch already supports the value based on the sdk 1.13 version, however, it is still in testing stage also because 1.41 is still in public beta.