GTA2 memory addresses
Re: GTA2 memory addresses
Nobody not is found a method to create an object/car/character? Or call spawn like in GTA3/VC/SA
Re: GTA2 memory addresses
I don't know how to create objects, I can only move them around.
Here are the stats shown at the end of the level:
vehicles_hijacked: 0x5E3CC4, 0x50C;
auto_damage_cost: 0x5E3CC4, 0x52C;
civilians_run_down: 0x5E3CC4, 0x510;
civilians_murdered: 0x5E3CC4, 0x514;
lawmen_killed: 0x5E3CC4, 0x518;
gang_members_killed: 0x5E3CC4, 0x51C;
fugitive_factor: 0x5E3CC4, 0x530;
I thought it would be interesting to display them in realtime. Useful if you wanted to try a pacifist speedrun.
Here are the stats shown at the end of the level:
vehicles_hijacked: 0x5E3CC4, 0x50C;
auto_damage_cost: 0x5E3CC4, 0x52C;
civilians_run_down: 0x5E3CC4, 0x510;
civilians_murdered: 0x5E3CC4, 0x514;
lawmen_killed: 0x5E3CC4, 0x518;
gang_members_killed: 0x5E3CC4, 0x51C;
fugitive_factor: 0x5E3CC4, 0x530;
I thought it would be interesting to display them in realtime. Useful if you wanted to try a pacifist speedrun.
Re: GTA2 memory addresses
Does anyone know a pointer in the name car?
ped struct + 0x16C = car pointer = car struct + ? = name car
Added:
I found a way to turn on/off the lights and open/close the doors in the car.
ped struct + 0x16C = car pointer = car struct + ? = name car
Added:
I found a way to turn on/off the lights and open/close the doors in the car.
Code: Select all
ped struct + 0x16C = car struct
car struct + 0x8 = [byte] front left light (set 64/0 on/off light, car struct + 0x8 = +4 left light crash decal)
car struct + 0xA = [byte] front right light (set 128/0 on/off light, car struct + 0x8 = +8 right light crash decal)
Last edited by Logofero on 23 Feb 2018, 00:59, edited 3 times in total.
Re: GTA2 memory addresses
Sector, you have set an example in the subject http://gtamp.com/forum/viewtopic.php?f=4&t=815#p10212 you know the pointer on the arrows or offset (all arrow data)?
Re: GTA2 memory addresses
Thank you. References are useful.Sektor wrote:http://gtamp.com/GTA2/gta2arrows.ct
And do you know the address objective type (folowing at point) for ped?
Re: GTA2 memory addresses
No, I haven't found the arrows pointing location. I looked for it since it would be useful in GTA2 Radar but no luck.
Re: GTA2 memory addresses
I meant it. http://projectcerbera.com/gta/2/tutorials/character-aiSektor wrote:No, I haven't found the arrows pointing location. I looked for it since it would be useful in GTA2 Radar but no luck.
Code: Select all
SET_CHAR_OBJECTIVE (name, OBJECTIVE_TYPE)
SET_CHAR_OBJECTIVE (name, OBJECTIVE_TYPE, X, Y, Z)
Re: GTA2 memory addresses
I found some useful addresses for cars. Changes the status of the engine, light, door locks and car acceleration.
Can anyone know the address for changing the color and speed of car?
Edited: found car model.
Code: Select all
car struct + 0x9C = [byte] engine state: 0 disabled, 1 off (set 2 engine and light off), 3 on (set 4 on engine and light)
car struct + 0x98 = [byte] door lock: 1 locked, 2 unlocked
car struct + 0x84 = [byte] car model: 0-86, 77 no moved (load handling from nyc.gci)
Edited: found car model.
Last edited by Logofero on 24 Feb 2018, 15:13, edited 1 time in total.
Re: GTA2 memory addresses
I know the color of the car address for cheat engine.
"GTA2.EXE"+0027C274 (2 bytes)
Offset #1 = 0x24
Offset #2 = 0x50
Tell me if it works or not.
"GTA2.EXE"+0027C274 (2 bytes)
Offset #1 = 0x24
Offset #2 = 0x50
Tell me if it works or not.
Re: GTA2 memory addresses
Сrash game and color is not displayed.BeepBoop wrote:I know the color of the car address for cheat engine.
"GTA2.EXE"+0027C274 (2 bytes)
Offset #1 = 0x24
Offset #2 = 0x50
Tell me if it works or not.
I thought the color should be somewhere in the structure of the car or in the structure of its sprite, but I did not find it there. Maybe someone can find (full example get car, sprite struct):
Code: Select all
0x5EB4FC = ped offset = ped offset + 0x4 = array ped pointer + 0xC4 = ped pointer = ped struct
ped struct + 0x16C = car pointer = car struct
car struct + 0x58 = sprite pointer = car sprite struct
Re: GTA2 memory addresses
Found car emergy siren, simulation button horn and enable signalisation sound:
Code: Select all
car struct + 0xA4 = [byte] emergy siren: 4 on, 2 off (in emergy cars)
car struct + 0xA7 = [byte] simulation button horn: 248 press (set 255), 0 up
car struct + 0x8E = [byte] signalisation sound: 1 on, 0 off
Re: GTA2 memory addresses
Can you use multiple offsets?
For Example: car struct + 0x24 + 0x50 = Current car color.
For Example: car struct + 0x24 + 0x50 = Current car color.
Re: GTA2 memory addresses
address + offset, but this is when the offset is needed. When do I need to get the pointer I'm using. method ofBeepBoop wrote:Can you use multiple offsets?
For Example: car struct + 0x24 + 0x50 = Current car color.
example get scripts/struct.txt
Code: Select all
while(true)
if (IsKeyDown(13)) then -- For write in MISI.log ped_struct and car_struct down key ENTER.
local address = tonumber("0x5EB4FC") -- Ped offset found by Sector
local offset = 0x4
local ped_ptr = ReadProcessMemory(address, 4)
ped_ptr = ped_ptr + offset
ped_ptr = ReadProcessMemory(ped_ptr, 4)
local ped_struct = ReadProcessMemory(ped_ptr + 0xC4, 4) -- Get struct ped ID 1 (it player 1)
if (ped_struct ~= 0) then -- Check player 1 exists
local car_struct = ReadProcessMemory(ped_struct + 0x16C, 4)
WriteInLog(string.format("Get ped struct %X car struct %X\n", ped_struct, car_struct))
end
end
wait(200)
end
Last edited by Logofero on 25 Feb 2018, 12:41, edited 1 time in total.
Re: GTA2 memory addresses
The car color works. Thanks BeepBoop http://gtamp.com/forum/viewtopic.php?f= ... =60#p10567
get car color scripts/carcolor.txt
Now need to get the name and speed of the car.
get car color scripts/carcolor.txt
Code: Select all
while(true)
if (IsKeyDown(13)) then -- Get color down key ENTER.
local address = tonumber("0x5EB4FC") -- Ped offset found by Sector
local offset = 0x4
local ped_ptr = ReadProcessMemory(address, 4)
ped_ptr = ped_ptr + offset
ped_ptr = ReadProcessMemory(ped_ptr, 4)
local ped_struct = ReadProcessMemory(ped_ptr + 0xC4, 4) -- Get struct ped ID 1 (it player 1)
if (ped_struct ~= 0) then -- Check player 1 exists
local car_struct = ReadProcessMemory(ped_struct + 0x16C, 4)
if (car_struct ~= 0) then -- Check car exists
local car_ptr = ReadProcessMemory(car_struct + 0x50, 4) -- Car color found by BeepBoop
local car_color = ReadProcessMemory(car_ptr + 0x24, 2)
WriteInLog(string.format("Get ped struct %X car struct %X car color %d\n", ped_struct, car_struct, car_color))
end
end
end
wait(200)
end
Re: GTA2 memory addresses
Does anyone have addresses for setting the volume of effects and music? Or C/C++ interfaces to configure the sound device GTA2.
This is necessary to turn off the radio in the car.
This is necessary to turn off the radio in the car.
Re: GTA2 memory addresses
I've found the music and effects volume addresses, but changing them doesn't do anything. You can change the radio/effects volume in the GTA 2 manager while in-game without having to restart.
Re: GTA2 memory addresses
A pro manager can not be a speech that only works for manual tuning.BeepBoop wrote:I've found the music and effects volume addresses, but changing them doesn't do anything. You can change the radio/effects volume in the GTA 2 manager while in-game without having to restart.
I just need a rewritable memory address. I found it but it was in a heap of other addresses and it was not possible to weed out. Need a pointer for device Music/SFX (in RegEdit it GTA2/Sound keys: CDVol and SFXVol). Or can anyone know the sound API for controlling the current sound device GTA2.
Re: GTA2 memory addresses
I tried to change the position/angle of the object only z changes. The x, y coordinates are read-only? Sector, do you have an address for changing x, y, z (to write) the object?
I used:
I used:
Code: Select all
-- Since: v0.2.1b
function SetObjPos(obj, x, y, z)
local obj_ptr = ReadProcessMemory(obj + 0x4, 4)
WriteProcessMemory(obj_ptr + 0x14, x * 16384, 4)
WriteProcessMemory(obj_ptr + 0x18, y * 16384, 4)
WriteProcessMemory(obj_ptr + 0x1C, z * 16384, 4)
end
while (true) do
if (IsKeyDown(0x4)) then -- Down key middle mouse wheel
-- Here code create object or get obj struct
SetObjPos(obj, 10.0, 30.0, 5.0) -- Changed only z
end
end
Re: GTA2 memory addresses
They're not read only but maybe something else has to change to trigger the game to redraw. If you try with an animated object like a rocket, it should update instantly.