Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!   (84,864 visits to this link)

    2. News

    1. GTA Online

      1. Find Lobbies & Players
      2. Guides & Strategies
      3. Vehicles
      4. Content Creator
      5. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    4. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption 2

    2. Red Dead Redemption

    3. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Forum Support

    2. Site Suggestions

343 guilty spark

SA: Getting OBJECTS in pool

Recommended Posts

343 guilty spark

i cant find any memory addresses for objects, i mean there are for cars and peds, but not for Objects? :cry:

 

ex:

CARS:

0xB74494 - Contains a pointer to main struct

This struct:

+0 = Contains a pointer to the first element in the pool

+4 = Contains a pointer to a byte map indicating which elements are in use

+8 = [dword] Is the maximum number of elements in the pool

+12 = [dword] Is the current number of elements in the pool

Each vehicle object is 2584 (0xA18) bytes. It starts at 0xC502AA0.

 

can you please post the memory addressess for Objects (objects like #MISSILE, not something else)

 

GAME: SA

Edited by 343 guilty spark

Share this post


Link to post
Share on other sites
Silent

Objects pool pointer is located at 0xB7449C, each entry is 0x19C bytes big.

Share this post


Link to post
Share on other sites
Wesser

Your question is a bit vague. Are you trying to get the memory addresses of all spawned missiles? If so, take this CLEO3-friendly code (untested):

 

0AB1: call_scm_func @loopThroughPool 2 pool_ptr 0x00B7449C gosub_loop @ObjectIter[...]:ObjectIter// [email protected] - Entity's SCM handle// [email protected]@ - Free local variablesif 09CC:  object [email protected] model_is #MISSILEthen    0A98: [email protected] = object [email protected] structendreturn:loopThroughPool{    Parameters:        Passed:            [email protected] - pool pointer            [email protected] - gosub label offset        Result:            none    Example:        0AB1: call_scm_func @loopThroughPool 2 pool_ptr 0x00000000 gosub_loop @label}0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 // CPool<T> *pclTPool = (CPool<T> *)uiOpcodeArgs[0];[email protected] += 0x08 // CPool.m_iSize0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 // int iSize = pclTPool->m_iSize;if     [email protected] > 0 // if(iSize > 0)then    [email protected] -= 0x04 // CPool.m_paucFlags    0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 // unsigned char *paucFlags = pclTPool->m_paucFlags;    [email protected] -= 1     005A: [email protected] += [email protected] // paucFlags += --iSize;    [email protected] *= 0x0100     for [email protected] = [email protected] downto 0 step 0x0100 // for(int i = iSize << 8; i >= 0; i -= 0x0100)        0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0 // unsigned char ucFlag = *paucFlags--;        [email protected] -= 1         if         88B7:  not test [email protected] bit 7 // if(ucFlag >= 0x00)        then            005A: [email protected] += [email protected] // unsigned int uiHandle = i + ucFlag;            gosub [email protected] // SCM handle is [email protected] (28 free locals)        end    endend0AB2: ret 0

Share this post


Link to post
Share on other sites
343 guilty spark

{not working} BUT Thanks :colgate:

That is what i wanted, i want to get all objects in game. check if the object is a missile then find it in the missiles, locate the target. then boost the speed!

Last time I fired a missile after locking on a moving car i missed because it was too slow, not even faster than bikes ([email protected]#t). I WILL WRITE AN ASI mod in c (for speed).

i just could not find first element and entry, now i do.

Edited by 343 guilty spark

Share this post


Link to post
Share on other sites
Wesser

I have just tested the script, it works like expected. It's likely you did something wrong. :p

Share this post


Link to post
Share on other sites
343 guilty spark

This one works! i am not good in cleo scripts, witch is why i use c/c++

 

{$CLEO .cs}

wait 0

while true

wait 0

//0xB7449C pool

//0x19C element size

//[email protected] first object

//[email protected] max objects

0A8D: [email protected] = read_memory 0xB7449C size 4 virtual_protect 0

[email protected] += 8

0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0

[email protected] -= 8

0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0

[email protected] -= 1

for [email protected] = 0 to [email protected] // step 1

0AEC: [email protected] = object_struct [email protected] handle

IF

03CA: object [email protected] exists

then

if

09CC: object [email protected] model_is #MISSILE

then

Object.Throw([email protected] , 0.0, 0.0, 0.0); // freeze! Slowsh*t!

end

end

[email protected] += 0x19C

end // for

end

Edited by 343 guilty spark

Share this post


Link to post
Share on other sites
343 guilty spark

I have just tested the script, it works like expected. It's likely you did something wrong. :p

maybe, i dont know. cleo scripting aint my thing man!

btw, do you know how can i get the object model, and set its velocity form memory? offsets are not Available in the documentation.

Edited by 343 guilty spark

Share this post


Link to post
Share on other sites
Wesser

This one works!

Be careful the entity's index must be 0-based (do not forget to subtract a unit from the pool size).

 

 

btw, do you know how can i get the object model, and set its velocity form memory? offsets are Available in the documentation.

The model index is at CEntity + 0x22, while the object velocity is at CPhysical + 0x44. Edited by Wesser

Share this post


Link to post
Share on other sites
343 guilty spark

thank you!

Share this post


Link to post
Share on other sites
DK22Pac

All projectile objects are stored in this array.

 

0xC89110 ; CObject *CProjectileInfo::ms_apProjectile[32]

Share this post


Link to post
Share on other sites
343 guilty spark

All projectile objects are stored in this array.

0xC89110 ; CObject *CProjectileInfo::ms_apProjectile[32]

that' s cool. can you tell me where did you get this address?

this one is like Big Smoke! (full of [email protected]#t)

http://www.gtamodding.com/?title=Memory_Addresses_%28SA%29

 

i don't have enough info to use this

Edited by 343 guilty spark

Share this post


Link to post
Share on other sites
343 guilty spark
Be careful the entity's index must be 0-based (do not forget to subtract a unit from the pool size).

C++ / java for(int i = 0; i < PoolSize; i++) {}

Old School carp for i = 0 to PoolSize - 1 step 1

 

The model index is at CEntity + 0x22, while the object velocity is at CPhysical + 0x44.

 

how can i get the pointer of CEntity and CPhysical??!!?? :panic:

 

do you have THE SOURCE OF GTA SA or some sh*t like that? (i know what you are thinking: is he crazy? well let me ask you this: are you a doctor?)

Edited by 343 guilty spark

Share this post


Link to post
Share on other sites
343 guilty spark

so this is the basic idea

i need memory addresses so i can convert it to C (not sea! i mean the programing language!). (dll -> asi)

 

{$CLEO .cs}
wait 0
while true
wait 0
//0xB7449C pool
//0x19C element size
//[email protected] first object
//[email protected] max objects
0A8D: [email protected] = read_memory 0xB7449C size 4 virtual_protect 0
[email protected] += 8
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
[email protected] -= 8
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
[email protected] -= 1
for [email protected] = 0 to [email protected] // step 1
0AEC: [email protected] = object_struct [email protected] handle
if
03CA: object [email protected] exists
then
if
09CC: object 4@ model_is #MISSILE
then
059F: get_object [email protected] velocity_in_direction [email protected] [email protected] [email protected]
[email protected] = 0.0
[email protected] = 1.0
006B: [email protected] *= [email protected] // (float)
006B: [email protected] *= [email protected] // (float)
005B: [email protected] += [email protected] // (float)
[email protected] = 1.0
006B: [email protected] *= [email protected] // (float)
006B: [email protected] *= [email protected] // (float)
005B: [email protected] += [email protected] // (float)
[email protected] = 1.0
006B: [email protected] *= [email protected] // (float)
006B: [email protected] *= [email protected] // (float)
005B: [email protected] += [email protected] // (float)
if
[email protected] < 10000.0 // maxSpeed^2
then
[email protected] *= 2.0
[email protected] *= 2.0
[email protected] *= 2.0
Object.Throw([email protected] , [email protected], [email protected], [email protected]); // Boost sh*t!!
end
end
end
[email protected] += 0x19C
end // for
end

 

this is a 30 sec code, it all raggedy and sh*t! but it gets the job done!

Edited by 343 guilty spark

Share this post


Link to post
Share on other sites
lima2k07

how do i get the second ped in the ped pool?

Share this post


Link to post
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

×

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.