Jump to content

Remove molotov fire for Vice City with CLEO


bibidibabidibu

Recommended Posts

bibidibabidibu

Hi,

 

I want to remove fire effect with cleo. I tried, 

031A: remove_all_fires

 

but it removes only fires which created by cleo script.

 

is there any way to get fire handle which created by molotov explosion and remove it?

Link to comment
Share on other sites

@bibidibabidibu 

Loop through a fire pool to get the handle of any fire:

while true
    wait 0
    0A8D: 0@ = read_memory 0x4559B1 size 4 virtual_protect 0    //  CFireManager
    0A8E: 1@ = 0@ + 0x754   
    for 15@ = 0@ to 1@ step 0x30    //  CFirePool   0@ start;   1@ end; 0x30 fireSize  
        0085: 14@ = 15@
        14@ += 4
        0A8D: 14@ = read_memory 14@ size 4 virtual_protect 0  //  CFire  
        if 14@ <> 0               
        then
            0085: 13@ = 15@
            13@ += 4
            13@ += 0x14 
            0A8D: 13@ = read_memory 13@ size 4 virtual_protect 0    //  CFire *var13->m_pEntityCreator; 
            0A96: 12@ = ped $PLAYER_ACTOR struct
            if 0039: 12@ == 13@ //  was the fire created by the player?
            then
                02D1: destroy_fire 14@
            end
        end  
    end
    //  You can use those variables again but after the for-end loop only
end

Other then that if you want to make an actor or a vehicle stop burning use this:

0A96: 0@ = ped $PLAYER_ACTOR struct
0@ += 0x524
0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0    //  CFire *fire = playa->m_pFire; 
if 0@ <> 0  //  fire 0@ exists ?
then
    02D1: destroy_fire 0@
end

0A97: 0@ = vehicle 1@ struct    //  CVehicle *var1;
0@ += 0x1E8
0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0    //  CFire *fire = var1->m_pFire; 
if 0@ <> 0  //  fire 0@ exists ?
then
    02D1: destroy_fire 0@
end


 

Link to comment
Share on other sites

bibidibabidibu
4 hours ago, Jack said:

@bibidibabidibu 

Loop through a fire pool to get the handle of any fire:

while true
    wait 0
    0A8D: 0@ = read_memory 0x4559B1 size 4 virtual_protect 0    //  CFireManager
    0A8E: 1@ = 0@ + 0x754   
    for 15@ = 0@ to 1@ step 0x30    //  CFirePool   0@ start;   1@ end; 0x30 fireSize  
        0085: 14@ = 15@
        14@ += 4
        0A8D: 14@ = read_memory 14@ size 4 virtual_protect 0  //  CFire  
        if 14@ <> 0               
        then
            0085: 13@ = 15@
            13@ += 4
            13@ += 0x14 
            0A8D: 13@ = read_memory 13@ size 4 virtual_protect 0    //  CFire *var13->m_pEntityCreator; 
            0A96: 12@ = ped $PLAYER_ACTOR struct
            if 0039: 12@ == 13@ //  was the fire created by the player?
            then
                02D1: destroy_fire 14@
            end
        end  
    end
    //  You can use those variables again but after the for-end loop only
end

Other then that if you want to make an actor or a vehicle stop burning use this:

0A96: 0@ = ped $PLAYER_ACTOR struct
0@ += 0x524
0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0    //  CFire *fire = playa->m_pFire; 
if 0@ <> 0  //  fire 0@ exists ?
then
    02D1: destroy_fire 0@
end

0A97: 0@ = vehicle 1@ struct    //  CVehicle *var1;
0@ += 0x1E8
0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0    //  CFire *fire = var1->m_pFire; 
if 0@ <> 0  //  fire 0@ exists ?
then
    02D1: destroy_fire 0@
end


 

hi Jack,

 

That is great, many many many thanks!!!!! can I request one last thing, how can I retrieve the x y z position of the fire?

Link to comment
Share on other sites

@bibidibabidibu 

Here's the CFire class structure for the VC taken from the plugin-sdk:

//  CFire   struc ; (sizeof=0x30)
0x00 //   m_bActive;
0x01 //   m_bCreatedByScript;   //  1--->game; 2--->script
0x02 //   m_bMoves;
0x03 //   m_bMakesNoise;
0x04 //   CVector m_vecPosition;
0x10 //   CEntity* m_pEntityTarget;
0x14 //   CEntity* m_pEntityCreator;
0x18 //   unsigned int m_nTimeToBurn;
0x1C //   unsigned int m_uShadowTimer;
0x20 //   unsigned int m_uPeriodTimer;
0x24 //   float m_fParticleSize; 
0x28 //   float m_fStrength;
0x2C //   m_bBeingExtinguished;
0x2D //   char pad[3];
//  0x30 CFire           ends

CVector has a size of 0x0C which means 3 floats (3*4=0x0C) X, Y and Z - 3D pos:
So fire position should be like this (not tested):

0085: 11@ = 15@ //  CFireManager
11@ += 4    //  CFire *fire;    (fire structure)
11@ += 4     
0A8D: 11@ = read_memory 11@ size 4 virtual_protect 0    //  float fireX = fire->m_vecPosition.x; 

0085: 12@ = 15@ //  CFireManager
12@ += 4    //  CFire *fire;    (fire structure)
12@ += 8     
0A8D: 12@ = read_memory 12@ size 4 virtual_protect 0    //  float fireY = fire->m_vecPosition.y; 

0085: 13@ = 15@ //  CFireManager
13@ += 4    //  CFire *fire;    (fire structure)
13@ += 0x0C     
0A8D: 13@ = read_memory 13@ size 4 virtual_protect 0    //  float fireZ = fire->m_vecPosition.z;

Maybe you should start using IDA and the public gta database - it has a lot of usefull info.

Edited by Jack
Link to comment
Share on other sites

bibidibabidibu
14 hours ago, Jack said:

@bibidibabidibu 

Here's the CFire class structure for the VC taken from the plugin-sdk:

//  CFire   struc ; (sizeof=0x30)
0x00 //   m_bActive;
0x01 //   m_bCreatedByScript;   //  1--->game; 2--->script
0x02 //   m_bMoves;
0x03 //   m_bMakesNoise;
0x04 //   CVector m_vecPosition;
0x10 //   CEntity* m_pEntityTarget;
0x14 //   CEntity* m_pEntityCreator;
0x18 //   unsigned int m_nTimeToBurn;
0x1C //   unsigned int m_uShadowTimer;
0x20 //   unsigned int m_uPeriodTimer;
0x24 //   float m_fParticleSize; 
0x28 //   float m_fStrength;
0x2C //   m_bBeingExtinguished;
0x2D //   char pad[3];
//  0x30 CFire           ends

CVector has a size of 0x0C which means 3 floats (3*4=0x0C) X, Y and Z - 3D pos:
So fire position should be like this (not tested):

0085: 11@ = 15@ //  CFireManager
11@ += 4    //  CFire *fire;    (fire structure)
11@ += 4     
0A8D: 11@ = read_memory 11@ size 4 virtual_protect 0    //  float fireX = fire->m_vecPosition.x; 

0085: 12@ = 15@ //  CFireManager
12@ += 4    //  CFire *fire;    (fire structure)
12@ += 8     
0A8D: 12@ = read_memory 12@ size 4 virtual_protect 0    //  float fireY = fire->m_vecPosition.y; 

0085: 13@ = 15@ //  CFireManager
13@ += 4    //  CFire *fire;    (fire structure)
13@ += 0x0C     
0A8D: 13@ = read_memory 13@ size 4 virtual_protect 0    //  float fireZ = fire->m_vecPosition.z;

Maybe you should start using IDA and the public gta database - it has a lot of usefull info.

many thanks for your support Jack, I am still making investigation with plugin-sdk. there are many many memory addresses and very helpful hope I can also improve myself. and here is what I have done with you support, fire extinguisher :)

 

gta-vc-2023-05-24-23-16-28-19.jpg

gta-vc-2023-05-24-23-16-28-97.jpg

Link to comment
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
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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