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

Happy Holidays from the GTANet team!

How to obtain the subaddresses of a vehicle to edit its values?


Shiro Naomi
 Share

Recommended Posts

Shiro Naomi

I am trying to access the address of these values, but it does not enter these addresses and leaves me in the same address sequence given by opcode 0A97

I want access to this:

 

 spacer.png

 

I did this:

0A97: $CarStruct = vehicle [email protected] struct
CarStruct += 0x40
CarStruct += 0x0

But it doesn't work, it leaves me at the same address

What exactly do I have to do to access and edit these values?

I also made a post asking how I can access other addresses of vehicles

Edited by Shiro Naomi
Strs, if you're going to say something stupid and that doesn't contribute anything to my question, better not to comment.
Link to comment
Share on other sites

OrionSR

Yeah, that should be right so far. From there you need to use bit operations to test, set or clear the individual bit flags.

08B4:   test $390 bit 1
08BA: set $377[0] bit 1
08C0: clear $391 bit 31

The are similar opcodes for local vars and whatnot; "bit" is a good search term.

 

Do you have the 010 Editor? I've got a developing binary template that can wrap itself around the vehicle structure in game memory that's based on DK22Pac's plugin information. Been wondering how I might turn it onto a set of constants for use in cleo.

 

Added: Note that the SCM bit opcodes work as... LSB0(?), I think is the proper term. The first bit is bit 0, which is contrary to a lot of documentation, like above, and needs to be translated.

 

Edited by OrionSR
Link to comment
Share on other sites

Shiro Naomi
14 hours ago, OrionSR said:

Been wondering how I might turn it onto a set of constants for use in cleo.

You can create a separate script with the following

{$CLEO}
0000:
:Data
wait 0
const
_CVehicle__Pool = 0xB74494 //CVehicle::PoolInfo
...
end

hex
FF
end

terminate_this_script //to prevent a bucle

Then with an opcode that I don't remember, you extract those constants as if it were JS

const constants = new constants();
constants._CVehicle__Pool

 

Or what you can do, is to have to copy in every script you make, all your list of constants that you have created

...

While I was writing all this, I started to look for the file that I told you to edit to have the constants predefined by you

Go to "C:\Program Files\Sanny Builder 3\data\sa" and edit the constants.txt
There you will find the default constants "TIMERA" and "TIMERB", there you can add all your constants and the compiler will read your constants from that file, enjoy

Although it is a double-edged sword, the others that do not have it configured with the constants that you created in that file.txt, the compiler will give them error since those constants that are in your code do not recognize them, for that, they must have your constants in that script or in that file
Obviously, already compiled, there is no problem, but when opening the file in Sanny Builder, they will not be able to recompile it because they do not have your constants in constant.txt or in the script

Well, back to my current problem, I don't know how to use bits, I only know how to use (carstruct)

I have to use the cheat engine to find the address of the coordinates of the car itself as an object
By the way, thanks to it, I could find many things that are not documented in the wiki of address memory

I will be posting them soon.

Link to comment
Share on other sites

OrionSR
4 hours ago, Shiro Naomi said:

Sanny Builder 3\data\sa" and edit the constants.txt

Oh, yes. Thanks, but I am familiar with the various options for defining constants in Sanny. One strategy you missed, btw, is to use the $INCLUDE directive to add large lists of constants or allocations to the script. This strategy bloats the script considerably when SCM Info is added to the compiled script. And custom constants.txt isn't the best option as it's difficult to share. Anyway, the problem isn't so much constants for myself, but finding a good way to share the info. The format is considerably different from the mem wiki, and it doesn't seem right to unilaterally replace the rather inadequate historical document. Also, I'm not very familiar with "class" base structures. I did my best to represent the class structure using the struct based templates of 010 but I'd feel a lot better if I could find someone with more expertise in the matter to make sure I didn't completely misrepresent something.

 

4 hours ago, Shiro Naomi said:

I don't know how to use bits

Well, read up on bits then. It's not too difficult, and forms the basis for how everything works on a digital computer, so it's worth learning. However, I might be able to make things a little easier on you. Bitflags are much easier to work with when assigned as constants. Also, instead of reading these bytes one at a time, they are much easier to work with when defined as a dword of 32 bits.

 

const
  PhysicalFlags_b01=0
  PhysicalFlags_bApplyGravity=1
  PhysicalFlags_bDisableCollisionForce=2
  PhysicalFlags_bCollidable=3
  PhysicalFlags_bDisableTurnForce=4
  PhysicalFlags_bDisableMoveForce=5
  PhysicalFlags_bInfiniteMass=6
  PhysicalFlags_bDisableZ=7

  PhysicalFlags_bSubmergedInWater=8
  PhysicalFlags_bOnSolidSurface=9
  PhysicalFlags_bBroken=10
  PhysicalFlags_b12=11
  PhysicalFlags_b13=12
  PhysicalFlags_bDontApplySpeed=13
  PhysicalFlags_b15=14
  PhysicalFlags_b16=15

  PhysicalFlags_b17=16
  PhysicalFlags_b18=17
  PhysicalFlags_bBulletProof=18
  PhysicalFlags_bFireProof=19
  PhysicalFlags_bCollisionProof=20
  PhysicalFlags_bMeeleProof=21
  PhysicalFlags_bInvulnerable=22
  PhysicalFlags_bExplosionProof=23

  PhysicalFlags_b25=24
  PhysicalFlags_bAttachedToEntity=25
  PhysicalFlags_b27=26
  PhysicalFlags_bTouchingWater=27
  PhysicalFlags_bCanBeCollidedWith=28
  PhysicalFlags_bDestroyed=29
  PhysicalFlags_b31=30
  PhysicalFlags_b32=31
end

const
  CPhysical__m_nPhysicalFlags=0x40 // int32, size 4
end

0A97: [email protected] = vehicle $MyCar struct
[email protected] += CPhysical__m_nPhysicalFlags
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
if
  08B7:   test [email protected] bit PhysicalFlags_bCollisionProof
then
  08C3: clear [email protected] bit PhysicalFlags_bBulletProof
else 
  08BF: set [email protected] bit PhysicalFlags_bExplosionProof
end

 

Edited by OrionSR
Link to comment
Share on other sites

Shiro Naomi
Posted (edited)
2 hours ago, OrionSR said:

but I'd feel a lot better if I could find someone with more expertise in the matter to make sure I didn't completely misrepresent something.

Well, you can make a topic exposing what you have done so far
Currently there are almost no people with good knowledge to make mods for gta sa and even less that handle in depth the reverse engineering of the game
Create a topic and try your luck if someone responds to you, maybe I could help you, who know
I think I have a topic where I never got an answer

2 hours ago, OrionSR said:

One strategy you missed, btw, is to use the $INCLUDE directive to add large lists of constants or allocations to the script. This strategy bloats the script considerably when SCM Info is added to the compiled script.

Yes, I know and I am aware, but I only gave you a basic example since I know you have a lot of knowledge about programming a mod
Besides that you have been here for years

2 hours ago, OrionSR said:

And custom constants.txt isn't the best option as it's difficult to share.

At least you start with something, if you try it and it works, you can keep on doing it
You can make a topic explaining what they have to do to add your constants already created to that file, explain the location of the file and so on

-------------------------------------------------------------------------------------------------------------------------------------------------

I just realized that it is badly structured

 

Captura.PNG

 

This is how it used to be and how the format should have remained

In the old version the slot 0x41 is missing, but for now, the error about the format is understood

 

ScreenShot_20220513021421.png

 

In the current one, they should fix it, as it is understood as if it were an address like the "wanted level

 

unknown.png

 

Also for that mistake, I was wrong, since what I was trying to explain and ask, is how to access those sub addresses as the "wanted level"

 

spacer.png

 

For example, I want to access the CarPos address of the car itself to edit its coordinates

Like this

 

unknown.png

How would you do it?

 

Edited by Shiro Naomi
I realized that the wiki formatting is wrong.
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.