My first post here
I'm trying to write a command regulator for Live for Speed game, for measurement purpose. The regulator itself is not a problem, but I can't manage to script a working value lock.
I can successfully do it via the value list's lock command in the main window of MHS but the scripted locking doesn't work.
It works like the game refreshes the command current values (brakes and throttle pedals in my case) more often than the script can. The result is that the expected locked values are present for a very short amount of time, reverting back instantly to the real pedal input. But it can be a wrong interpretation
Here's a small rudimentary script I use to try to lock a value. 0 value represents a depressed pedal and 1 is full pressed:
- Code: Select all
// Test de modification de valeur
void On_HK_2(DWORD dw1, DWORD dw2){
Clear();
PrintF("Essai de modification de valeur");
// Déclaration des variables (retrancher 0x400000)
extern float throttle = {"LFS.exe", 0x51282C};
extern float brakes = {"LFS.exe", 0x512828};
// Forçage de valeur
while (throttle == 1){
brakes = 0.5;
//Sleep(1);
}
PrintF("Fin de modification de valeur");
}
The script should lock the brake pedal input to half-pressed. I tried to put the lock instructions in another thread but the results are similar. The sleep command doesn't make the thing to work either.