GTAMP.com

Grand Theft Auto Media Press
It is currently Sat Aug 18, 2018 9:56 pm

All times are UTC




Post new topic Reply to topic  [ 92 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
PostPosted: Sun Jan 14, 2018 1:33 pm 
Offline
Hitman

Joined: Wed Dec 09, 2015 2:18 pm
Posts: 165
Nobody not is found a method to create an object/car/character? Or call spawn like in GTA3/VC/SA

_________________
Map F-Industry-Live
MISI Library

Twitter channel @TheNonameGames


Top
 Profile  
 
PostPosted: Sun Feb 11, 2018 2:04 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1334
Location: GTAMP.com
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.


Top
 Profile  
 
PostPosted: Thu Feb 22, 2018 12:12 am 
Offline
Hitman

Joined: Wed Dec 09, 2015 2:18 pm
Posts: 165
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.
Code:
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)

_________________
Map F-Industry-Live
MISI Library

Twitter channel @TheNonameGames


Last edited by Logofero on Fri Feb 23, 2018 12:59 am, edited 3 times in total.

Top
 Profile  
 
PostPosted: Fri Feb 23, 2018 12:44 am 
Offline
Hitman

Joined: Wed Dec 09, 2015 2:18 pm
Posts: 165
Sector, you have set an example in the subject viewtopic.php?f=4&t=815#p10212 you know the pointer on the arrows or offset (all arrow data)?

_________________
Map F-Industry-Live
MISI Library

Twitter channel @TheNonameGames


Top
 Profile  
 
PostPosted: Fri Feb 23, 2018 2:25 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1334
Location: GTAMP.com
http://gtamp.com/GTA2/gta2arrows.ct


Top
 Profile  
 
PostPosted: Fri Feb 23, 2018 2:47 am 
Offline
Hitman

Joined: Wed Dec 09, 2015 2:18 pm
Posts: 165
Sektor wrote:
http://gtamp.com/GTA2/gta2arrows.ct

Thank you. References are useful.

And do you know the address objective type (folowing at point) for ped?

_________________
Map F-Industry-Live
MISI Library

Twitter channel @TheNonameGames


Top
 Profile  
 
PostPosted: Fri Feb 23, 2018 2:53 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1334
Location: GTAMP.com
No, I haven't found the arrows pointing location. I looked for it since it would be useful in GTA2 Radar but no luck.


Top
 Profile  
 
PostPosted: Fri Feb 23, 2018 3:05 am 
Offline
Hitman

Joined: Wed Dec 09, 2015 2:18 pm
Posts: 165
Sektor 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.

I meant it. http://projectcerbera.com/gta/2/tutorials/character-ai
Code:
SET_CHAR_OBJECTIVE (name, OBJECTIVE_TYPE)
SET_CHAR_OBJECTIVE (name, OBJECTIVE_TYPE, X, Y, Z)

_________________
Map F-Industry-Live
MISI Library

Twitter channel @TheNonameGames


Top
 Profile  
 
PostPosted: Sat Feb 24, 2018 1:51 am 
Offline
Hitman

Joined: Wed Dec 09, 2015 2:18 pm
Posts: 165
I found some useful addresses for cars. Changes the status of the engine, light, door locks and car acceleration.
Code:
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)

Can anyone know the address for changing the color and speed of car?

Edited: found car model.

_________________
Map F-Industry-Live
MISI Library

Twitter channel @TheNonameGames


Last edited by Logofero on Sat Feb 24, 2018 3:13 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sat Feb 24, 2018 5:16 am 
Offline
Car Jacker

Joined: Fri Oct 14, 2016 1:32 am
Posts: 41
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.


Top
 Profile  
 
PostPosted: Sat Feb 24, 2018 12:18 pm 
Offline
Hitman

Joined: Wed Dec 09, 2015 2:18 pm
Posts: 165
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.

Сrash game and color is not displayed.

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:
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

_________________
Map F-Industry-Live
MISI Library

Twitter channel @TheNonameGames


Top
 Profile  
 
PostPosted: Sat Feb 24, 2018 3:18 pm 
Offline
Hitman

Joined: Wed Dec 09, 2015 2:18 pm
Posts: 165
Found car emergy siren, simulation button horn and enable signalisation sound:
Code:
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

_________________
Map F-Industry-Live
MISI Library

Twitter channel @TheNonameGames


Top
 Profile  
 
PostPosted: Sat Feb 24, 2018 8:25 pm 
Offline
Car Jacker

Joined: Fri Oct 14, 2016 1:32 am
Posts: 41
Can you use multiple offsets?


For Example: car struct + 0x24 + 0x50 = Current car color.


Top
 Profile  
 
PostPosted: Sun Feb 25, 2018 2:49 am 
Offline
Hitman

Joined: Wed Dec 09, 2015 2:18 pm
Posts: 165
BeepBoop wrote:
Can you use multiple offsets?


For Example: car struct + 0x24 + 0x50 = Current car color.

address + offset, but this is when the offset is needed. When do I need to get the pointer I'm using. method of

example get scripts/struct.txt
Code:
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

The presented syntax example is used in MISI

_________________
Map F-Industry-Live
MISI Library

Twitter channel @TheNonameGames


Last edited by Logofero on Sun Feb 25, 2018 12:41 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sun Feb 25, 2018 12:38 pm 
Offline
Hitman

Joined: Wed Dec 09, 2015 2:18 pm
Posts: 165
The car color works. Thanks BeepBoop viewtopic.php?f=4&t=700&start=60#p10567

get car color scripts/carcolor.txt
Code:
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

Now need to get the name and speed of the car.

_________________
Map F-Industry-Live
MISI Library

Twitter channel @TheNonameGames


Top
 Profile  
 
PostPosted: Sat Mar 10, 2018 5:39 pm 
Offline
Hitman

Joined: Wed Dec 09, 2015 2:18 pm
Posts: 165
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.

_________________
Map F-Industry-Live
MISI Library

Twitter channel @TheNonameGames


Top
 Profile  
 
PostPosted: Sun Mar 11, 2018 3:00 am 
Offline
Car Jacker

Joined: Fri Oct 14, 2016 1:32 am
Posts: 41
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.


Top
 Profile  
 
PostPosted: Sun Mar 11, 2018 10:54 am 
Offline
Hitman

Joined: Wed Dec 09, 2015 2:18 pm
Posts: 165
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.

A pro manager can not be a speech that only works for manual tuning.

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.

_________________
Map F-Industry-Live
MISI Library

Twitter channel @TheNonameGames


Top
 Profile  
 
PostPosted: Fri Mar 16, 2018 9:44 pm 
Offline
Hitman

Joined: Wed Dec 09, 2015 2:18 pm
Posts: 165
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:
Code:
-- 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

_________________
Map F-Industry-Live
MISI Library

Twitter channel @TheNonameGames


Top
 Profile  
 
PostPosted: Fri Mar 16, 2018 10:00 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1334
Location: GTAMP.com
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 92 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group