Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

reverse check


Nabx3n
 Share

Recommended Posts

is there a way to make a reverse check for the car?

i tried this one:

 

:REVERSE_19wait 0 if   Actor.Driving($PLAYER_ACTOR)else_jump @REVERSE_19 03C0: [email protected] = actor $PLAYER_ACTOR car 02E3: [email protected] = car [email protected] speedif and [email protected] > 1.000E1:   player 0 pressed_key 4 else_jump @REVERSE_11306A2: get_car [email protected] velocity_in_direction_XYZ [email protected] [email protected] [email protected] not [email protected] > -1.0jf @REVERSE_1130338: set_car [email protected] visibility 0jump @REVERSE_19 :REVERSE_1130338: set_car [email protected] visibility 1jump @REVERSE_19

 

 

but it seams like it only works when the car is heading to south as driving forward and backward.

 

is there a way to get that check to work properly? smile.gif

Link to comment
Share on other sites

Yeah, but it would be only CLEO 3 compatible. I don't think there is any other way to check if a car's reversing...

 

 

if   00DF:   actor $PLAYER_ACTOR drivingthen   03C0: [email protected] = actor $PLAYER_ACTOR car   0AB8: get_vehicle [email protected] current_gear_to [email protected]   if       [email protected] == 0	// reversing gear   then       02E3: [email protected] = car [email protected] speed       if           [email protected] > 1.0       then           // car is reversing       end   endend

 

Link to comment
Share on other sites

Sure, there is. Gas pedal float is located at CVehicle + 0x49C:

 

[...]if 00DF:  actor $PLAYER_ACTOR drivingthen 03C0: [email protected] = actor $PLAYER_ACTOR car 0A97: [email protected] = car [email protected] struct [email protected] += 0x49C  0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 // fGasPedal if   [email protected] < 0  then   // car is reversing endend[...]

 

You do not need to check if vehicle isn't stopped, since that value is speed dependant. Just add 0x4 to get brake pedal float.

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

thanks for the help guy but there is something i forgot to write there, is that i only use main.scm. cause i only mod the Xbox suicidal.gif

i'm sorry guys sad.gif

 

is there a way with main.scm?

Link to comment
Share on other sites

I modified @Deji's code to make it working correctly:

 

[...]if 00DF:  actor $PLAYER_ACTOR drivingthen 03C0: [email protected] = actor $PLAYER_ACTOR car 0AB8: get_vehicle [email protected] current_gear_to [email protected]  if    [email protected] == 0 // reversing gear then   if    00E1:  player 0 pressed_key 14    then     // car is reversing   end endend[...]

 

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

When I worked on backlights for SA, I used that method which Wesser posted.

I think it is also possible with animation-check. There's place where animID stored, but after anim setting for car, game restores that value, and you can't catch it in SCM.

Link to comment
Share on other sites

He was talking about using pure SCM opcodes because of different game's platform. My first solution works as desired, though. tounge.gif

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

I modified @Deji's code to make it working correctly:

 

[...]if 00DF:  actor $PLAYER_ACTOR drivingthen 03C0: [email protected] = actor $PLAYER_ACTOR car 0AB8: get_vehicle [email protected] current_gear_to [email protected]  if    [email protected] == 0 // reversing gear then   if    00E1:  player 0 pressed_key 14    then     // car is reversing   end endend[...]

 

 

 0AB8: get_vehicle [email protected] current_gear_to [email protected] 

 

 

notify.gif isn't that a cleo opcode? cause that could crash the game no?

 

 

When I worked on backlights for SA, I used that method which Wesser posted.

I think it is also possible with animation-check. There's place where animID stored, but after anim setting for car, game restores that value, and you can't catch it in SCM.

that's what im working on, backlights biggrin.gif

 

thought about the same thing, i checked it on the Banshee (test model) but i noticed the player doesn't do an animation while reversing. confused.gif

i dunno, maybe it depends on the driving skills or maybe cause he hada gun, but i was thinking about another method and i just can't write it correctly, something about storing coords from car for example 0.0 -8.0 0.0 and everytime the car gets a little closer to it lights turns on and there should be a check if the car got too close to it about radius 2.0 the coords will change position again, "0.0 -8.0 0.0" i feel like it's possible that way but i just kind get confused when i start on it barf8bd.gif

Link to comment
Share on other sites

 

But 0AB8 is a CLEO opcode...

Ops, I made a huge mistake, sorry. blush.gif

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

Sorry for double-posting but I found out a R*'s style solution.

 

I think it is also possible with animation-check. There's place where animID stored, but after anim setting for car, game restores that value, and you can't catch it in SCM.

This issue happens only for player walkstyle animations. Look at the following script:

 

[...]if 00DF:  actor $PLAYER_ACTOR drivingthen if and 8611:  not actor $PLAYER_ACTOR performing_animation 'CAR_LB'  8611:  not actor $PLAYER_ACTOR performing_animation 'CAR_LB_pro'  8611:  not actor $PLAYER_ACTOR performing_animation 'CAR_LB_weak'  8611:  not actor $PLAYER_ACTOR performing_animation 'QUAD_reverse'  // Quad then   goto @IsNotPlayerReversing  end if and 8611:  not actor $PLAYER_ACTOR performing_animation 'BIKEd_pushes'  // Motocross 8611:  not actor $PLAYER_ACTOR performing_animation 'BIKEh_pushes'  // Chopper 8611:  not actor $PLAYER_ACTOR performing_animation 'BIKEs_pushes'  // Motorbike 8611:  not actor $PLAYER_ACTOR performing_animation 'BIKEv_pushes'  // Moped 8611:  not actor $PLAYER_ACTOR performing_animation 'BMX_pushes'    // BMX 8611:  not actor $PLAYER_ACTOR performing_animation 'CHOPPA_pushes' // Crossbike 8611:  not actor $PLAYER_ACTOR performing_animation 'MTB_pushes'    // Mountainbike 8611:  not actor $PLAYER_ACTOR performing_animation 'WF_pushes'     // Scooter then   goto @IsNotPlayerReversing  end if  00E1:  player 0 pressed_key 14  then   // car is reversing end :IsNotPlayerReversingend[...]

 

P.S. Only 8 conditions can be used, else the game returns always false.

 

I don't know if XBOX version can handle DMA but give it a try:

 

{$CLEO}0000: NOPconst TYPE_BYTE  = 1  TYPE_SHORT = 2  TYPE_DWORD = 4 endwhile true wait 0  if  00DF:  actor $PLAYER_ACTOR driving then   [email protected] = 0xB6F3B8 // Player's CVehicle   [email protected] = TYPE_DWORD   gosub @ReadMemVal    [email protected] += 0x49C // fGasPedal   [email protected] = TYPE_DWORD   gosub @ReadMemVal    if      [email protected] < 0.0    then     // vehicle is reversing   end endend:[email protected] -= 0xA49960 [email protected] /= 0x4 008B: [email protected] = &0([email protected],1i)if and [email protected] == 1 // BYTE [email protected] > 0xFF then 0085: [email protected] = [email protected]  [email protected] -= 0xFF  0062: [email protected] -= [email protected] else if and   [email protected] == 2 // WORD   [email protected] > 0xFFFF  then   0085: [email protected] = [email protected]    [email protected] -= 0xFFFF    0062: [email protected] -= [email protected]  else   if      [email protected] <> 4 // DWORD   then     [email protected] = 0    end endendreturn 

 

Edited by Wesser

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

ok i tried the first idea and it's working well but it's just that for some cars that are set to "LOW" on their handling wich makes the player lower on the seat, he doesnt perform any animation, but its fixable smile.gif all i did is just change the car animation in vehicle.ide from null to kart.

 

and this is the script i used:

 

 

:REVERSELIGHTthread 'REVERSELIGHT' :REVERSELIGHT_19wait 0 if and  Actor.Driving($PLAYER_ACTOR)847A:   not actor $PLAYER_ACTOR driving_bike 84A7:   not actor $PLAYER_ACTOR driving_boat 84A9:   not actor $PLAYER_ACTOR driving_heli   not Actor.DrivingPlane($PLAYER_ACTOR)else_jump @REVERSELIGHT_19 03C0: [email protected] = actor $PLAYER_ACTOR car 02E3: [email protected] = car [email protected] speed if and  Actor.Driving($PLAYER_ACTOR) [email protected] > 0.1 00E1:   player 0 pressed_key 4 else_jump @REVERSELIGHT_205 if or  Actor.Animation($PLAYER_ACTOR) == "CAR_LB"  Actor.Animation($PLAYER_ACTOR) == "CAR_LB_PRO"  Actor.Animation($PLAYER_ACTOR) == "CAR_LB_WEAK"  Actor.Animation($PLAYER_ACTOR) == "DRIVE_TRUCK_BACK"else_jump @REVERSELIGHT_205 // lights turn onjump @REVERSELIGHT_19 :REVERSELIGHT_205// lights turn offjump @REVERSELIGHT_19

 

 

 

0000: NOP

 

const

TYPE_BYTE  = 1

TYPE_SHORT = 2

TYPE_DWORD = 4

end

 

while true

wait 0

if

00DF:  actor $PLAYER_ACTOR driving

then

   [email protected] = 0xB6F3B8 // Player's CVehicle

   [email protected] = TYPE_DWORD

   gosub @ReadMemVal

   [email protected] += 0x49C // fGasPedal

   [email protected] = TYPE_DWORD

   gosub @ReadMemVal

   if

     [email protected] < 0.0

   then

     // vehicle is reversing

   end

end

end

 

:ReadMemVal

[email protected] -= 0xA49960

[email protected] /= 0x4

008B: [email protected] = &0([email protected],1i)

if and

[email protected] == 1 // BYTE

[email protected] > 0xFF

then

0085: [email protected] = [email protected]

[email protected] -= 0xFF

0062: [email protected] -= [email protected]

else

if and

   [email protected] == 2 // WORD

   [email protected] > 0xFFFF

then

   0085: [email protected] = [email protected]

   [email protected] -= 0xFFFF

   0062: [email protected] -= [email protected]

else

   if

     [email protected] <> 4 // DWORD

   then

     [email protected] = 0

   end

end

end

return [/code]

 

and exactly how do you make main.scm read it? i don't even know from where the name should start notify.gif

 

should i add something above the code as for example

 

:test

thread 'test'

 

that? sorry i'm just not used to this kind of scripts blush.gif

 

edit:

ok i tried it in that way and when i compiled and tested it, nothing happend while reversing, and the code was translated to this

 

:TESTthread 'TEST' :TEST_11wait 0 if   Actor.Driving($PLAYER_ACTOR)jf @TEST_102 [email protected] = 11989944 [email protected] = 4 gosub @TEST_109 [email protected] += 1180 [email protected] = 4 gosub @TEST_109 if   not [email protected] >= 0.0 jf @TEST_102 Camera.Shake(100):TEST_102jump @TEST_11 :[email protected] -= 10787168 [email protected] /= 4 008B: [email protected] = &0([email protected],1i) // (int) if and [email protected] == 1  [email protected] > 255 jf @TEST_195 0085: [email protected] = [email protected] // (int) [email protected] -= 255 0062: [email protected] -= [email protected] // (int) jump @TEST_281 :TEST_195if and [email protected] == 2  [email protected] > 65535 jf @TEST_256 0085: [email protected] = [email protected] // (int) [email protected] -= 65535 0062: [email protected] -= [email protected] // (int) jump @TEST_281 :TEST_256if   not [email protected] == 4 jf @TEST_281 [email protected] = 0 :TEST_281return 

 

is that how it's supposed to be? dontgetit.gif

Edited by nabnabnabn
Link to comment
Share on other sites

Too bad, it works on Windows platform. Perhaps you have a different version than 1.0 or XBOX one is totally different.

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

Too bad, it works on Windows platform. Perhaps you have a different version than 1.0 or XBOX one is totally different.

dang confused.gif

ok then, atleast it works fine with the animation way. better than nothing colgate.gif

 

thanks guys smile.gif

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.