Value locking issue

Ask for Help on Using the Language With Memory Hacking Software

Moderators: g3nuin3, SpeedWing, WhiteHat, mezzo

Value locking issue

Postby Bogey Jammer » Tue Aug 25, 2009 1:26 am

Hi all,

My first post here 8)

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.
Super signature
User avatar
Bogey Jammer
I Have A Few Questions
 
Posts: 3
Joined: Tue Aug 25, 2009 1:00 am
Location: France

Postby L. Spiro » Tue Aug 25, 2009 8:47 am

There is nothing wrong with the script.

Ensure that throttle actually equals 1 for a long period of time.
Ensure you are not overwriting the lock from the main window.
Ensure that your addresses are correct. You probably meant 0x11282C instead of 0x51282C.

Disable the check against throttle and ensure that the lock works.


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3121
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Postby Bogey Jammer » Wed Aug 26, 2009 12:18 am

Thanks for reply, I confirm everything is fine, but the locks both from main window and script take effect when the game does not have the focus only. Since I'm playing with game controller input values, it seems to have a higher priority than common locked game values.

I'll try next to work with the processed input values by the game (with dead-zone and saturation applied) It may work better.
Super signature
User avatar
Bogey Jammer
I Have A Few Questions
 
Posts: 3
Joined: Tue Aug 25, 2009 1:00 am
Location: France

Postby L. Spiro » Wed Aug 26, 2009 6:58 am

Then overwrite the code that applies the values when the game is active (NOP it) so that only your script is modifying that value.

Restore the code when the throttle should no longer be locked.


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3121
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Postby Bogey Jammer » Wed Aug 26, 2009 4:03 pm

I double-posted yesterday, but the forum system have probably rejected it. I tried to tell that I successfully locked the alternate value, and my regulator works fine. Maybe NOPing the code would have worked too but my previous experience with this command made the game very unstable.
Anyway thanks for the support and MHS rocks!
Super signature
User avatar
Bogey Jammer
I Have A Few Questions
 
Posts: 3
Joined: Tue Aug 25, 2009 1:00 am
Location: France

Re: Value locking issue

Postby Macros » Mon Apr 03, 2017 3:27 pm

Then overwrite the code that applies the values when the game is active (NOP it) so that only your script is modifying that value.
สูตรแทงบาคาร่า
Macros
I Have A Few Questions
 
Posts: 7
Joined: Tue Mar 14, 2017 4:42 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron