[REL] Headlight controls

Seven Smiles

Registered
rF2headlights-1.8.71.jpg
For more detail go to the wiki

______________________________________________________________________________________________

Prompted by https://forum.studio-397.com/index.php?threads/flashing-lights.63774/ here is a program that adds various controls of the headlights.
  • Flashing to warn a slower car
  • Flashing in the pits
  • Turning on the headlights automatically
To get it go to the Releases page, click on Assets for the latest version, download the the .exe file and save it wherever you want.

May 2020: Virus check https://www.virustotal.com/gui/url/...0450b30ebab099c4a6839accf26563992c5/detection
V1.8.71 Virus check https://www.virustotal.com/gui/url/120a6b937a68bedf9dbec08b966f7467421ce63b7bb5aa8c79b5be28e260fbfb/detection
V1.9.75 Virus check
https://www.virustotal.com/gui/url/c13d32ffe8b25e9e5e8d27edbd92609f566a707b014b96cc48840c2027533a3f/detection

V1.9.79 Virus check
https://www.virustotal.com/gui/url/...567215a14e4258d6db312820ab93f7e44d7/detection

Run rF2headlights.exe and set it up the way you want

On the left are the buttons or keys that you use
  • You don't have to use all of the controls
  • Toggle headlights is the same as the present control
  • Flash headlights will flash them a number of times
  • Headlights on and off switch the headlights no matter whether they are on or off (like the switch in a real car)
Below that is the key that is sent to rFactor to control the headlights, the Left Ctrl key in this case.

In the middle are the Headlight Options
  • Flash when pit limiter on will flash them when the pit limiter is on (wherever you are)
  • Flash when in pit lane will flash them automatically when you enter the pit lane and stop them when you leave
  • Headlights on at start will turn the headlights on when you get in the car, you can turn them off if you want
  • You can set the durations (in milliseconds) of the flashes
  • Automatic headlights will turn the headlights on for you when other drivers do. The slider selects when they turn on:
    • Driver turns them on (i.e. not automatic)
    • At least one other driver has them on
    • More than one other driver has them on
    • At least half of the other drivers have them on
    • All the other drivers have them on
On the right is a Status window which shows what rFactor is up to.

When you change something and press Save configuration you have to close the program down and restart it before the changes will take effect.

Based on the work of @The Iron Wolf https://forum.studio-397.com/index.php?threads/rf2-shared-memory-tools-for-developers.54282/

______________________________________________________________________________________________

If you have trouble
rf2headlightsDEBUG.exe is the same program but with installer debug turned on. Open up a command window and run it like this
Code:
rf2headlightsDEBUG.exe >rpt.txt 2>&1
If rf2headlights doesn't run then post the file rpt.txt here.
 
Last edited:
Great job, this will help stop people getting DQ'd because the track makers can't think to not have forced headlights in the GDB when they create tracks :( and some one doesn't have their headlights on when exiting the pits like in the new Le Mans track ;) .
 
i mapped the buttons. but no flashing in the game.
The output is checked when the track is loaded, on track etc. Also when i press the flash button it says "overtake flash" etc. But in the game i don't see the light flashing (oreca 07).
 
Last edited:
i mapped the buttons. but no flashing in the game.
The output is checked when the track is loaded, on track etc. Also when i press the flash button it says "overtake flash" etc. But in the game i don't see the light flashing (oreca 07).
Start rfactor first see how you go.
 
It took a little while for me to figure out how to map the buttons. Just clicking and then hitting the button wasn't working initially. Had to hit the button i wanted a few times. But once I got that set, it works great!

For the duration time, is that milliseconds?
 
fuxixmgg_jpg.htm
So I do not understand that. With me that's just not great. synonymous with me nothing flashes the headlights. The console says, rf2 is running, but I can push what I want, it does not matter.
The exe file and the ini file are in the BIN64 directory of rf2.
The buttons for flashing are occupied, but nothing is happening.



4sj5hth8.jpg

 
Last edited:
Updated the first post with a new version. Main visible change is more infomation about rFactor2SharedMemoryMapPlugin but I also found why configuring the controls was a bit hit and miss so it is more responsive now.

I also spent an hour trying to track down a really weird bug that appeared from nowhere - I eventually spotted that I had two copies of the program running and they were both sending H to rFactor :mad:
 
Last edited:
addendum:
If you are using an older version of SimHub then you must know that when using rf2, simHub overwrites the new rFactor2SharedMemoryMapPlugin64.dll and headlight controls stop working.

SimHub needs to be updated or manually referenced to the new .dll.
 
Back
Top