Shiro Naomi Posted August 8 Share Posted August 8 (edited) 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: 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 August 8 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 More sharing options...
OrionSR Posted August 8 Share Posted August 8 (edited) 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 August 8 by OrionSR Link to comment Share on other sites More sharing options...
Shiro Naomi Posted August 8 Author Share Posted August 8 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 More sharing options...
OrionSR Posted August 9 Share Posted August 9 (edited) 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 August 9 by OrionSR Link to comment Share on other sites More sharing options...
Shiro Naomi Posted August 9 Author Share Posted August 9 (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 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 In the current one, they should fix it, as it is understood as if it were an address like the "wanted level 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" For example, I want to access the CarPos address of the car itself to edit its coordinates Like this How would you do it? Edited August 9 by Shiro Naomi I realized that the wiki formatting is wrong. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now