Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Contract
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    2. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    3. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    4. Bugs*

    1. Grand Theft Auto Series

      1. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

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

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    6. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

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

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

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

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

      1. GTANet 20th Anniversary
    2. Support

    3. Suggestions

How to make CJ to shoot with handgun like npcs?


h3ckphy
 Share

Recommended Posts

Hello.

As you may noticed pedestrians behave themselves a little bit different when they fire with handguns like colt, uzi, mac (see screen below).

They can't just run and shoot simultaneously. (Only in some missions, for example, Jizzy's first mission).

And I want CJ to have this style of shooting, but I really don't know how to do it.

 

qZXW0LF.png

 

I couldn't find answer to this issue and decided to look in game's memory. I'm not reverse engineer at all, but I wanted to try something.

You know what I have got so far?

I've spawned a ped and made him to shoot and run at the same time via script (there's a special opcode).

I opened CheatEngine, copied this ped's CPed structure from memory and saved it in txt.

Then I made this ped to shoot in his regular mode like on screen above and again I saved his CPed structure from game memory in txt file (I did this step 4 times).

So I had these files: running.txt, default1.txt, default2.txt, default3.txt, default4.txt.

Then I compared these 4 default txt files to running.txt file to find those bytes that changes to the same value when ped switches his shooting style.

I thought that there might be some flag in ped's memory and by doing this comparisons I would find it, but I didn't.

I want someone to solve this problem, because I'm not the only one who wanted to implement it.

Edited by h3ckphy
  • KEKW 1
Link to comment
Share on other sites

On 2/10/2021 at 6:08 AM, Pootispowse said:

How did you figure it out?

 

I think I did it wrong way or at least not completely. Look:

I opened weapon.dat file and changed for example TEC's hex flags from 3013 to 3011 (thus I removed AIMWITHARM flag).

You can do the same thing with UZI like on screens above or colt.

weapondat.png

 

Now we go to the game and see how CJ shoots:

arm.png

 

He can't run, but his arm is not straight.

Then I found this memory addresses:

address.png

 

CPed + 0x50C is the begining of CPedIK class. IK stands for inverse kinematics. I don't know what is this, but it has something to do with animation.

CPed + 0x528 are some flags.

I forced flag PEDIK_USE_ARM to be always 1 (I did it with CheatEngine) and now CJ's hand is straight:

move.png

 

But the problem is that his idle animation is not correct:

stand.png

 

Why I think I did it wrong way? Because other peds use the same configs from weapon.dat and their AIMWITHARM flag is not removed.

But I came to the conclusion that when I unset AIMWITHARM flag in this file I enable some game's script that makes CJ shoot this way.

If I were reverse-engineer I would find this script and do something.

I think I'd finish this mod if I go on discovering game's internals, but I don't have time for it and I'm tired. I hope someone will continue it.

Edited by h3ckphy
Link to comment
Share on other sites

Very interesting work. Hopefully other modders can learn from what you've done here. 

 

One thing I've always wanted to know is whether it's possible to have CJ aim the pistol, Uzi, tec-9 etc. straight like in Vice City, as opposed to sideways. For some reason I've never seen anyone make an ifp or other mod which does that. 

Link to comment
Share on other sites

LeatherJacketSoldier
38 minutes ago, Pootispowse said:

One thing I've always wanted to know is whether it's possible to have CJ aim the pistol, Uzi, tec-9 etc. straight like in Vice City, as opposed to sideways. For some reason I've never seen anyone make an ifp or other mod which does that. 

I was thinking of doing that a few hours ago, but my idea was to directly replace the San Andreas colt45.ifp with the Vice City colt45.ifp. Since you came with that idea, I must assume direct replacement won't work at all (maybe crashing the game when I try to draw the 9mm or other single-handed gun), but still I'm going to try (it may work by pure chance) unless you confirm this statement.

Link to comment
Share on other sites

1 hour ago, LeatherJacketSoldier said:

I was thinking of doing that a few hours ago, but my idea was to directly replace the San Andreas colt45.ifp with the Vice City colt45.ifp. Since you came with that idea, I must assume direct replacement won't work at all (maybe crashing the game when I try to draw the 9mm or other single-handed gun), but still I'm going to try (it may work by pure chance) unless you confirm this statement.

By all means, please try! I was just saying there seems to be no existing ifp or mod which allows CJ to shoot Vice City style. It may well not be possible simply by replacing the ifps, but I'm not sure. 

 

Let us know how it goes 

Link to comment
Share on other sites

LeatherJacketSoldier
55 minutes ago, Pootispowse said:

Let us know how it goes

Direct replacement won't work, it crashes the game. So sad. I'm answering now because I had to install GTA Vice City in order to get the .ifp, and then when I restored a very skinned version of gta3.img, I spent some time restoring some models with their skins (not original ones, modded ones) that weren't backed up on the .img I was using when I tried to replace the .ifp. Guess we'll have to wait for someone who knows how to edit .ifp files (I'm already waiting for that in the mod requests topic), or learn how to edit them ourselves.

Link to comment
Share on other sites

  • 2 months later...
On 2/11/2021 at 6:21 PM, LeatherJacketSoldier said:

Direct replacement won't work, it crashes the game. So sad. I'm answering now because I had to install GTA Vice City in order to get the .ifp, and then when I restored a very skinned version of gta3.img, I spent some time restoring some models with their skins (not original ones, modded ones) that weren't backed up on the .img I was using when I tried to replace the .ifp. Guess we'll have to wait for someone who knows how to edit .ifp files (I'm already waiting for that in the mod requests topic), or learn how to edit them ourselves.

 

Hola amigo / Hello friend:

 

Proba esto / try it :

http://aap.papnet.eu/gta/utils/librw_bin/convifp.exe

Link to comment
Share on other sites

  • 2 weeks later...
On 2/11/2021 at 6:11 PM, Pootispowse said:

Very interesting work. Hopefully other modders can learn from what you've done here. 

 

One thing I've always wanted to know is whether it's possible to have CJ aim the pistol, Uzi, tec-9 etc. straight like in Vice City, as opposed to sideways. For some reason I've never seen anyone make an ifp or other mod which does that. 

That's possible with the gta sa ultimate editor

Link to comment
Share on other sites

HalanoSiblee

if you mean the animation you can download walkstyle Cleo
if you mean shooting idle You Need to figure Memory Address of entire  CJ Skeleton and writing it as gang member Cped

Link to comment
Share on other sites

  • 2 weeks later...
  • 5 months later...
On 2/5/2021 at 9:24 AM, h3ckphy said:

Hello.

As you may noticed pedestrians behave themselves a little bit different when they fire with handguns like colt, uzi, mac (see screen below).

They can't just run and shoot simultaneously. (Only in some missions, for example, Jizzy's first mission).

And I want CJ to have this style of shooting, but I really don't know how to do it.

 

qZXW0LF.png

 

I couldn't find answer to this issue and decided to look in game's memory. I'm not reverse engineer at all, but I wanted to try something.

You know what I have got so far?

I've spawned a ped and made him to shoot and run at the same time via script (there's a special opcode).

I opened CheatEngine, copied this ped's CPed structure from memory and saved it in txt.

Then I made this ped to shoot in his regular mode like on screen above and again I saved his CPed structure from game memory in txt file (I did this step 4 times).

So I had these files: running.txt, default1.txt, default2.txt, default3.txt, default4.txt.

Then I compared these 4 default txt files to running.txt file to find those bytes that changes to the same value when ped switches his shooting style.

I thought that there might be some flag in ped's memory and by doing this comparisons I would find it, but I didn't.

I want someone to solve this problem, because I'm not the only one who wanted to implement it.

I FOUND THE PROBLEM!!!THE PED NO HAVE HIS ANIMATION TO SHOOT...IT IS AN ERROR WITH PEDESTRIANS USING ONE HAND WEAPONS, THEY WILL SEE WHEN FIGHTING WITH A CLEAN FIST AND AWAY THEY USE A SPECIFIC ANIMATION WITHIN PED.IFP

 

FightSh_BWD

 

I DISCOVERED IT BY CASUALITY USING THE 1ST PERSON MOD OF MIXMODS, DOWNLOAD IT, PUT THE 1st PERSON AND FIRE A GUN OR TEC, AND WHILE AIMING IT BACKS UP AND IF YOU LOOK DOWN YOU WILL SEE HOW YOU RAISE YOUR HAND LIKE THE PEDESTRIANS, SO IT WILL BE A PEDESTRIAN GAME ERROR SINCE CJ HAS THE ABILITY TO USE 2 WEAPONS AT THE SAME TIME, IT INTERFERS WITH THE FIGHT ANIMATIONS CAUSING THAT CURIOUS HAND RAISING EFFECT SO IT IS NOT ANY SPECIAL CODE, JUST A BUG OR ERROR SINCE ATTEMPTING WITH THE 3RD PERSON CJ WILL ONLY TURN A HALF TURN AND SHOOT INTO THE AIR, SO MAYBE TO AVOID THIS WITH THE PEDESTRIANS, THESE 2 ANIMATIONS ARE MIXED

 

PED.IFP: FightSh_BWD

 

COLT45.IFP: colt45_fire

 

COPS HAVE A SIMILAR ANIMATION, WITH THIS

 

colt45_fire_2hands

 

I HOPE IT HAS BEEN OF HELP, GREETINGS FROM MEXICO

 

I MADE A FAST EXAMPLE IN MY GTA (VIDEO IN THE LINK)

 

https://drive.google.com/drive/folders/1HfLdkfPa7opmzB_04KhTksGtL3qeXlkP?usp=sharing

Edited by Pytex_Wolf
Link to comment
Share on other sites

  • 3 weeks later...
On 2/11/2021 at 3:01 PM, h3ckphy said:

 

I think I did it wrong way or at least not completely. Look:

I opened weapon.dat file and changed for example TEC's hex flags from 3013 to 3011 (thus I removed AIMWITHARM flag).

You can do the same thing with UZI like on screens above or colt.

weapondat.png

 

Now we go to the game and see how CJ shoots:

arm.png

 

He can't run, but his arm is not straight.

Then I found this memory addresses:

address.png

 

CPed + 0x50C is the begining of CPedIK class. IK stands for inverse kinematics. I don't know what is this, but it has something to do with animation.

CPed + 0x528 are some flags.

I forced flag PEDIK_USE_ARM to be always 1 (I did it with CheatEngine) and now CJ's hand is straight:

move.png

 

But the problem is that his idle animation is not correct:

stand.png

 

Why I think I did it wrong way? Because other peds use the same configs from weapon.dat and their AIMWITHARM flag is not removed.

But I came to the conclusion that when I unset AIMWITHARM flag in this file I enable some game's script that makes CJ shoot this way.

If I were reverse-engineer I would find this script and do something.

I think I'd finish this mod if I go on discovering game's internals, but I don't have time for it and I'm tired. I hope someone will continue it.

please tell me are you finished working on this mod?
Link to comment
Share on other sites

On 2/11/2021 at 3:01 PM, h3ckphy said:

 

I think I did it wrong way or at least not completely. Look:

I opened weapon.dat file and changed for example TEC's hex flags from 3013 to 3011 (thus I removed AIMWITHARM flag).

You can do the same thing with UZI like on screens above or colt.

weapondat.png

 

Now we go to the game and see how CJ shoots:

arm.png

 

He can't run, but his arm is not straight.

Then I found this memory addresses:

address.png

 

CPed + 0x50C is the begining of CPedIK class. IK stands for inverse kinematics. I don't know what is this, but it has something to do with animation.

CPed + 0x528 are some flags.

I forced flag PEDIK_USE_ARM to be always 1 (I did it with CheatEngine) and now CJ's hand is straight:

move.png

 

But the problem is that his idle animation is not correct:

stand.png

 

Why I think I did it wrong way? Because other peds use the same configs from weapon.dat and their AIMWITHARM flag is not removed.

But I came to the conclusion that when I unset AIMWITHARM flag in this file I enable some game's script that makes CJ shoot this way.

If I were reverse-engineer I would find this script and do something.

I think I'd finish this mod if I go on discovering game's internals, but I don't have time for it and I'm tired. I hope someone will continue it.

please tell me are you finished working on this mod?
Link to comment
Share on other sites

On 11/21/2021 at 5:51 PM, Gamer857 said:

I've always wanted this shooting style too. Did you manage to do it?

I tried to change the values in the Vepon file, the date partially worked out but not correct, the CJ's hand is not straight up, and I also realized that it’s not enough just to change the style and change the rack like that of a gangster, in other words, it’s not easy, it’s strange that the mods did not create this mod, because the style is like a police officer, but not like a ganster.
Edited by Vladimir9422
Link to comment
Share on other sites

4 minutes ago, Gamer857 said:

Do you know how to do this shooting style?

I tried to change the values in the Vepon file, the date partially worked out but not correct, the CJ's hand is not straight up, and I also realized that it’s not enough just to change the style and change the rack like that of a gangster, in other words, it’s not easy, it’s strange that the mods did not create this mod, because the style is like a police officer, but not like a ganster.
Link to comment
Share on other sites

i dunno if guys found right stuff here when I see this topic it bothers me if you still want it I know exact flag and value for this what you looking for

  • excuseme 1
Link to comment
Share on other sites

3 hours ago, Strs said:

i dunno if guys found right stuff here when I see this topic it bothers me if you still want it I know exact flag and value for this what you looking for

Please tell me if you know how to do it.

Link to comment
Share on other sites

On 11/26/2021 at 2:56 PM, Strs said:

i dunno if guys found right stuff here when I see this topic it bothers me if you still want it I know exact flag and value for this what you looking for

Please tell me how to do it, or you can throw this modification
Link to comment
Share on other sites

person who Dunno please don't ask anything  

 

 

 

Edited by Strs
its head ache to reply same stuff
Link to comment
Share on other sites

28 minutes ago, Strs said:

Works all weapons but use "micro uzzi" what you see in this screenshot

Untitled.png

 

copy paste in sanny builder and compile it 

 

{$Cleo}
0000: //f*ck
while true
01F5: [email protected] = get_player_actor 0
0470: [email protected] = actor [email protected] current_weapon
      [email protected] += 0x24 //f*ck 1
      [email protected] *= 0x70 //f*ck 2
      [email protected] += 0xC8AAD0 //f*ck 3
0A8C: [email protected] += 2 = 0xB 0 //f*ck Last time
wait  5
end 

 

 

tell me and sled builder is a mod right?

 

32 minutes ago, Strs said:

Works all weapons but use "micro uzzi" what you see in this screenshot

Untitled.png

 

copy paste in sanny builder and compile it 

 

{$Cleo}
0000: //f*ck
while true
01F5: [email protected] = get_player_actor 0
0470: [email protected] = actor [email protected] current_weapon
      [email protected] += 0x24 //f*ck 1
      [email protected] *= 0x70 //f*ck 2
      [email protected] += 0xC8AAD0 //f*ck 3
0A8C: [email protected] += 2 = 0xB 0 //f*ck Last time
wait  5
end 

 

 

I just don't know how to use it

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
 Share

  • 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.