Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      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

[SA] Struct checks, how?


In45do
 Share

Recommended Posts

I'm learning memory adresses few days ago. I know how to get the struct and write the value (byte). But I'm confuse on how to check the current value of the struct. For example :

:Get_Car04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.00AE2: [email protected] = random_vehicle_near_point [email protected] [email protected] [email protected] in_radius 2.0 find_next 0 pass_wrecked 1    :Struct_Examplewait 0 ms 0A97: [email protected] = car [email protected] [email protected] += 12720A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00A8C: write_memory [email protected] size 4 value 1 virtual_protect 0

That struct is used to lock and unlock a car. But I want to know how to check the current value of that struct. A help would be aprreciated. :)

(Sorry for my grammar mistakes)

Link to comment
Share on other sites

Just check the value of a variable you read things to? In this case, [email protected].

Edited by Silent
Link to comment
Share on other sites

Thanks it works! :D

I have another question, is there a possibilities to check "rebuild player" command through memory adresses? At GTAModding.com , they don't have it. (it's not documented or something?)

Link to comment
Share on other sites

Thanks it works! :D

I have another question, is there a possibilities to check "rebuild player" command through memory adresses? At GTAModding.com , they don't have it. (it's not documented or something?)

 

Memory addresses only store values. What is the value of "rebuild player"? There is none!

 

You'd have to hook into the function which rebuilds the player check that. What would be the point, anyway?

Link to comment
Share on other sites

NTAuthority

Memory addresses only store values. What is the value of "rebuild player"? There is none!

important: don't sacrifice accuracy in attempting to make less-informed people understand

 

the value is a perfectly fine set of x86 opcodes someplace in the code memory section

SsZgxdL.png

Inactive in GTA/R* title modification indefinitely pursuant to a court order obtained by TTWO. Good job acting against modding!

Link to comment
Share on other sites

 

Memory addresses only store values. What is the value of "rebuild player"? There is none!

important: don't sacrifice accuracy in attempting to make less-informed people understand

 

the value is a perfectly fine set of x86 opcodes someplace in the code memory section

 

Heh, I did hesitate in posting that, but I felt it was still accurate enough. Memory addresses in the code section don't alone represent values, but they provide a way to know where the temporary values might be stored. It's all utter garbage until the CPU executes it, which is where the hook comes in.

 

Unfortunately, CLEO scripts don't run asynchronously and there's no way to simply check when the EIP hits the 'rebuild_player' handler, so excessive interruption of that function is the only option left :p

Link to comment
Share on other sites

You'd have to hook into the function which rebuilds the player check that. What would be the point, anyway?

If player using skin model and wasted or busted, the player become an alien physic. Look's buggy.

 

important: don't sacrifice accuracy in attempting to make less-informed people understand

 

the value is a perfectly fine set of x86 opcodes someplace in the code memory section

Thanks, I will try.

 

Heh, I did hesitate in posting that, but I felt it was still accurate enough. Memory addresses in the code section don't alone represent values, but they provide a way to know where the temporary values might be stored. It's all utter garbage until the CPU executes it, which is where the hook comes in.

Unfortunately, CLEO scripts don't run asynchronously and there's no way to simply check when the EIP hits the 'rebuild_player' handler, so excessive interruption of that function is the only option left :p

What about doing some checks while player is wasted or busted? I know it wouldn't be easy.

Link to comment
Share on other sites

NTAuthority

 

You'd have to hook into the function which rebuilds the player check that. What would be the point, anyway?

If player using skin model and wasted or busted, the player become an alien physic. Look's buggy.

 

you'd probably be able to use in-line script assembly 'abuse' to hook this somehow, but it's fairly complex, especially with Sanny as it doesn't include an inline assembler :)

SsZgxdL.png

Inactive in GTA/R* title modification indefinitely pursuant to a court order obtained by TTWO. Good job acting against modding!

Link to comment
Share on other sites

If player using skin model and wasted or busted, the player become an alien physic. Look's buggy.

Then you don't need to check for rebuild_player at all, you need to use it and check for something else :p

 

Also, I wonder if this would work well enough:

 

0665: get_char_model $PLAYER_ACTOR store_to [email protected]
Assuming the returned value isn't 0 (#NULL), the player has a changed model. This at least lets you know when rebuild_player isn't completely useless, but still you'd really only want to trigger a rebuild once when the bug occurs. Though with SA now feeling as old as DOS games were when SA was released, surely running the rebuild_player every frame won't be too disturbing.

 

I forget the specifics of the bug, but I think I already wrote a similar cheap loop to fix it at one time. However I think it consisted of checking the players current model and re-applying it afterwards as the model would reset on use... or something like that. I only remember it happening after physical stat changes, though (they could be triggered on wasted/busted regeneration too - in that case, you can simply run rebuild_player whenever the stats change and then re-apply the old model).

Link to comment
Share on other sites

@NTAuthority Could you teach me how?

 

@Deji What a coincidence, I was going to use opcode 0665. :D
That's the same technique I did in switching mod.

I got another question (out of topic), what's the difference function of these opcode other than its words :

0811: [email protected] = actor $PLAYER_ACTOR used_car03C0: [email protected] = actor $PLAYER_ACTOR car
Link to comment
Share on other sites

@NTAuthority Could you teach me how?

 

@Deji What a coincidence, I was going to use opcode 0665. :D

That's the same technique I did in switching mod.

 

I got another question (out of topic), what's the difference function of these opcode other than its words :

0811: [email protected] = actor $PLAYER_ACTOR used_car03C0: [email protected] = actor $PLAYER_ACTOR car

 

STORE_CAR_CHAR_IS_IN_NO_SAVE = 0x03C0

GET_CAR_CHAR_IS_USING = 0x0811

 

Both commands are no_save actually.

But from what I have seen in the game executable, the GET_CAR_CHAR_IS_USING command will also return a vehicle from task with ID 700 or 701.

That seems to be a car a ped is going to enter (when you press F or enter).

I haven't tested it in game with CLEO script, only analyzed the game code.

 

Test it if you have time.

Check when 0811 returns non-zero value by printing it with 0AD1 command.

Edited by fastman92
Link to comment
Share on other sites

@fastman92 I will check it. :^: (sorry for long response)

@Deji Thanks, I like your website btw.

Edit : I saw your thread on GTAGaming few days ago about HUD addresses. Is it possible to change GTA IV HUD money, vehicle text, black blip, etch. back to their original colour? Their original colour should be green.

Edited by In45do
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.