Quantcast

Jump to content

» «
Photo

[CLEO] Engage Reverse Gear

5 replies to this topic
LINK/2012
  • LINK/2012

    LIVIN' IN CODE

  • Feroci
  • Joined: 30 Jan 2011
  • Brazil

#1

Posted 11 November 2012 - 04:55 PM

Engage Reverse Gear
Keeping the game spirit, this is not a gear mod!


The Grand Theft Auto games have, for me, a problem when you press the brake, sometimes it engage the reverse gear when you don't want this (normally this happen during a sudden brake), I damage my car because of this stupid brake key!
This CLEO mod fix this issue, now to engage the reverse gear after a sudden brake you should release the brake key and press it again.



Download

The topic title still ugly...


Silent
  • Silent

    Moderating Cookie Monster

  • Feroci
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [GTA] 2013
    Most Helpful [Modding] 2013
    Most Talented [Modding] 2013
    Best Map 2013 "ViceCityStories PC Edition"
    Best Vehicle 2013 "III Aircraft"
    Most Helpful [Modding] 2012
    Modder of the Year 2012

#2

Posted 11 November 2012 - 04:59 PM

Awesome. Luv ya for this.

You could update it with doing the opposite, ie. you have to release -> press the brake pedal to drive forwards. Would be useful for parking.

ThirteenAG
  • ThirteenAG

    Soldier

  • Feroci
  • Joined: 29 Dec 2008
  • None

#3

Posted 14 November 2012 - 06:34 AM

I'm not sure, it's probably could be a cleo 3 thing, but surprisingly i have a crash with this mod, when CJ enters in car. However, i fixed it by adding a loop to the script:
CODE
// CLEO 3 compatible
{$CLEO}
0000:
0A9F: 0@ = current_thread_pointer
0@ += 0x10
0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0
0@ -= @HOOK     // get @HOOK offset
0@ -= 0x6ADB85  // get relative offset from 0x6ADB85

0A8C: write_memory 0x6ADB80 size 1 value 0xE8 virtual_protect 1     // call
0A8C: write_memory 0x6ADB81 size 4 value 0@ virtual_protect 1       //      @HOOK
0A8C: write_memory 0x6ADB85 size 1 value 0x90 virtual_protect 1     // nop
0A8C: write_memory 0x6ADB87 size 4 value 0x8D virtual_protect 1     // 0x6ADC18 for jmp

while true
  wait 0
end

:HOOK
hex
   50                    // push eax
   D9 86 9C040000        // fld dword ptr [esi+0000049C]  ; CVehicle.GasPedal
   D8 1D 508B8500        // fcomp dword ptr [00858B50]    ; 0.0
   DFE0                  // fnstsw ax
   F6 C4 44              // test ah,44
   7A 0C                 // jp do_stuff                   ; jump if != 0.0
   66 8B 05 A434B700     // mov ax,[00B734A4]             ; pad[0].prevState.Brake
   66 85 C0              // test ax,ax
   75 12                 // jne dont_do_stuff             ; jump if not just pressing
   
// do_stuff:
   C7 86 A0040000 00000000// mov [esi+000004A0],00000000  ; CVehicle.BrakePedal
   58                    // pop eax
   89 86 9C040000        // mov [esi+0000049C],eax        ; CVehicle.GasPedal
   C3                    // ret

// dont_do_stuff:
   58                    // pop eax
   C3                    // ret
end



BTW, how about 3/VC version?

juarez
  • juarez

    Memory Hacking

  • Members
  • Joined: 11 Jun 2011
  • Poland

#4

Posted 14 November 2012 - 12:08 PM

Maybe, better to create an .asi plugin ?

Silent
  • Silent

    Moderating Cookie Monster

  • Feroci
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [GTA] 2013
    Most Helpful [Modding] 2013
    Most Talented [Modding] 2013
    Best Map 2013 "ViceCityStories PC Edition"
    Best Vehicle 2013 "III Aircraft"
    Most Helpful [Modding] 2012
    Modder of the Year 2012

#5

Posted 14 November 2012 - 02:09 PM

QUOTE (ThirteenAG @ Wednesday, Nov 14 2012, 07:34)
I'm not sure, it's probably could be a cleo 3 thing, but surprisingly i have a crash with this mod, when CJ enters in car. However, i fixed it by adding a loop to the script:

BTW, how about 3/VC version?

Some CLEO versions deallocate the script when 0A93 is reached and some don't. That's a weird thing.

LINK/2012
  • LINK/2012

    LIVIN' IN CODE

  • Feroci
  • Joined: 30 Jan 2011
  • Brazil

#6

Posted 14 November 2012 - 03:26 PM

QUOTE
You could update it with doing the opposite, ie. you have to release -> press the brake pedal to drive forwards. Would be useful for parking.

Analzed it and was... strange

QUOTE
I'm not sure, it's probably could be a cleo 3 thing, but surprisingly i have a crash with this mod, when CJ enters in car. However, i fixed it by adding a loop to the script:

Good to know, I always come to the doubt, "Should I kill the script or just keep it running in a loop that does nothing?", As Silent said some CLEO versions deallocate the code, In CLEO 4.2a Source code I see that the CCustomScript destructor deallocates the script content, but mine CLEO version (CLEO 4.1) don't do this, so I don't notice and don't know the way to go...
By the way, fixed.

QUOTE
BTW, how about 3/VC version?

Well, too lazy to do, should be easy (as the Cars don't burn when flipped) since the routines don't change much, if you want to do go ahead, you already know how to do tounge.gif


QUOTE
Maybe, better to create an .asi plugin ?

Nah, too simple for a ASI plugin (that takes a couple of kbytes while a cleo like that takes minus than 1kbyte), I only go to the ASI when I want to rewrite one (or more) complex routine (or even the entire system).




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users