Hello all at GTAforums!
Ok, let me explain my overall goal. I want to have rockets shoot out from a car (the LineRunner in particular) when the player presses a certain key (A for example). If the player presses another key before key A (B for example) then the little targetting reticle will come up and begin locking onto a car or something (like a Hydra would) and then with key B still held they press key A and the rocket will "attack" the target. I want what happens when you use missles on a hydra to happen with a car, to put it simplisticly.
Ok, now here in lies my problem. I know how to do all the checks for presses of buttons, if and false checks, car checks, etc. But I have zero idea how to mod memory address which is the only way to do this, modding the rocket pool.
Rockets The rocket pool contains info on launched rockets (for example, Hydra rockets). 0xC891A8 - Rocket pool start. Each slot has 36 bytes of data. There are 32 elements in the pool. +0 = [dword] Rocket type: 16 = none 17 = tear gas 19 = normal 20 = heatseeking 39 = remote explosives 58 = flare +4 = [dword] Pointer to launching entity +8 = [dword] Pointer to target vehicle (when heatseeking), 0 otherwise +16 = [byte] Does rocket exist? 0 = exploded/does not exist 1 = travelling +20 = [float] X-axis position +24 = [float] Y-axis position +28 = [float] Z-axis position
I have no idea how to modify anything to do with memory addresses, other then true or false values (ie 1 and 0). I looked up some memory coding tutorials and a general idea of what I might do, I am not sure though. I don't understand if I have to load a rocket model, or actors with weapons, etc before touching those values, or how to tell where the rocket should fire in respect to the car's position (offsets).
Here is my general idea in code, I don't have SannyBuilder on this computer, so bear with me as there is a lot missing and probably wrong.
:Begin 1@ = 0xC891A8 1@ += 0 0A8D: 2@ = read_memory 1@ size 1 virtual_protect 0 if and 2@ == 20 0AB0: key_pressed B // I don't remember the number for it jf @Begin 0A8C: write_memory 1@ size 4 value 1 virtual_protect 0 1@ += 8 jump @Mid :Mid 1@ = 0xC891A8 1@ += 8 0A8D: 2@ = read_memory 1@ size 1 virtual_protect 0 if 2@ == 1 jf @Begin 0A8C: write_memory 1@ size 4 value 1 virtual_protect 0 1@ += 16 jump @End :End 1@ = 0xC891A8 1@ += 8 0A8D: 2@ = read_memory 1@ size 1 virtual_protect 0 if 2@ == 1 jf @Begin jump @Begin
That is the general code I came up with, but I don't know if I need to load models or how to specify where the rocket should start from in respect to the car. Any help would be deeply appreciated!