Quantcast
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 Cayo Perico Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

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

    1. Red Dead Redemption 2

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

    1. Grand Theft Auto Series

    2. GTA VI

      1. St. Andrews Cathedral
    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. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. Help & Support
    8. Portable Games

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

      1. GTA Advance
      2. GTA 2
      3. GTA
    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
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions


Staunton Assassin

Recommended Posts

Staunton Assassin

AI Weapon Walkstyles

by @Staunton Assassin

 

About:

Spoiler

When the player character holds a weapon, the player character's walkstyle is changed to the proper one-handed or two-handed one that is appropriate to the weapon.
But when a ped holds a weapon, the ped's walkstyle remains the same. Regardless of what weapon they're holding, all peds just stand, walk, run, sprint and "begin-to-walk" as if they're not holding anything.
AI Weapon Walkstyles implements a proper weapon-based walkstyle system for the peds in III, VC and SA which works just like the one designed for the player character.
Not only it changes the peds' walkstyles to the one-handed or two-handed ones, but it also restores the walkstyles back to the default ones when the one-handed or two-handed weapon is no longer being held.

 

Screenshots:

Spoiler

oGA5GES.png

 

Credits:

Spoiler

A few coding snippets - @Junior_Djjr
Camera position coordinate memory addresses for VC - @spaceeinstein
Camera position coordinate memory addresses for III - @ThirteenAG
The rest of the mod - @Staunton Assassin

 

Download:

Edited by Staunton Assassin
  • Like 27
  • KEKW 2
Link to post
Share on other sites
Staunton Assassin
11 minutes ago, reCAPTCHA said:

Archive is corrupt(?)

Hmm, the mod is working flawlessly on my end. Try downloading again.

Edited by The Eddo
Link to post
Share on other sites
Junior_Djjr

Finally someone did it...

 

Just a little problem: The mod doesn't recognize added weapons without replacing because it uses IDs. The most correct way is to check the animation set for that weapon, but I don't have any snippet here (you will need to use some memory stuffs).

  • Like 1
Link to post
Share on other sites
Staunton Assassin
15 hours ago, Junior_Djjr said:

Finally someone did it...

 

Just a little problem: The mod doesn't recognize added weapons without replacing because it uses IDs. The most correct way is to check the animation set for that weapon, but I don't have any snippet here (you will need to use some memory stuffs).

Thank you, Junior. I really appreciate you commenting on this mod, it's a real pleasure:).

 

The added weapons? Hmm. Well, I don't know anything about memory hacking except for applying values to memory addresses. But I guess we can work together to find out.

 

And wow, I just can't believe that one of my mods actually made it to MixMods! Thank you so much for your cooperation, my friend.

 

P.S: Can you make a screenshot of the mod being tested on III? I don't have III and I really doubt if it actually works there.

  • Like 1
Link to post
Share on other sites
Junior_Djjr
7 hours ago, The Eddo said:

And wow, I just can't believe that one of my mods actually made it to MixMods! Thank you so much for your cooperation, my friend.

Thanks :)

 

7 hours ago, The Eddo said:

P.S: Can you make a screenshot of the mod being tested on III? I don't have III and I really doubt if it actually works there.

Hm, It isn't working.

I tested a lot of IDs (until they walk backwards, lol) and using "2" they walk like this:

0.jpg

Looks nice, I didn't find the player-like animation.

Using your "4" they walk like gangs I think.

Edited by Junior_Djjr
Link to post
Share on other sites
Staunton Assassin
19 hours ago, Junior_Djjr said:

Hm, It isn't working.

I tested a lot of IDs (until they walk backwards, lol) and using "2" they walk like this:

0.jpg

Looks nice, I didn't find the player-like animation.

Using your "4" they walk like gangs I think.

Strange, I had set the right walkstyle IDs. Maybe, perhaps a video would help me understand it better:).

Link to post
Share on other sites
Junior_Djjr
5 hours ago, The Eddo said:

Maybe, perhaps a video would help me understand it better

The animation of this image?
Anyway, if this ID is wrong the others are too, for some reason the list you consulted is wrong. With a quick search I found no other list.

Link to post
Share on other sites
  • 2 months later...
Staunton Assassin

@Junior_Djjr: So, it seems that I broke something when I counted the animation groups in "animgrp_iii.dat" to "consider" the correct walkstyle IDs for the III version.
As a consequence, Gangster Walk Fix gets it's first (minor) update!:

 

* Fixed the wrong walkstyle IDs that were being used in the III version, hopefully.

Link to post
Share on other sites
  • 2 weeks later...
Staunton Assassin

So here's another update! I've totally fixed the III version's animation group IDs now. OP is updated, so go get it!

 

@Junior_Djjr: You haven't updated my mod over at MixMods, please update it.

Edited by The Eddo
  • Like 1
Link to post
Share on other sites
  • 2 months later...
Staunton Assassin

"Ah, shoot. Here we go again..." - CJ

 

So, after finally getting around to working on this mod again, here's a rather major update for Gangster Walk Fix! Go and grab the new version from the OP now!

 

* Camera position coordinates are now used instead of the player position coordinates when the three scripts check for peds (because we SEE the peds, y'know?).
* Any dead peds are now ignored by the scripts, which means that the walkstyles won't be applied on the dead peds and the script is more likely to apply walkstyles on living peds.
* SA version's thread name changed from "WALKSTYL" to "WALKSTL" to match III and VC versions and prevent any possible issues.

 

* VC and SA versions now use the opcode 02D8 to check for weapons like in the III version.
* All three scripts now check for weapons and set walkstyles in the same order in which the walkstyles are internally defined in III, VC and SA.
* VC version is now slightly more compact.

 

The next version will feature support for added weapons, new idle stance for the Molotov, "1armed" walkstyle support for SA and a lot more! Stay tuned.

  • Like 5
Link to post
Share on other sites
Wakka387

at first there was the Gangster Sit Fix

 

now there is a new fix in town. The Gangster Walk Fix!

  • Like 1
Link to post
Share on other sites
Staunton Assassin
19 minutes ago, firedihm said:

Waiting for Gangster Run Fix that would make peds compatible with "Running with heavy weapons" mod

Gangster Run Fix was accidentally created and auto-integrated into Gangster Walk Fix during this mod's crafting, don't worry.

  • Like 1
Link to post
Share on other sites
Staunton Assassin

Okay, this here is that latest update for Gangster Walk Fix!

 

* III and VC versions lose "all-EXE-friendliness".
* III and VC versions now really use camera coordinates to check for peds (the previous update was released early).
* Increased the ped-checking radius to check for peds in the entire map.

 

The "new idle stance for the SA Molotov" idea got flopped and the added weapons support was requiring WAY TOO MANY variables. So now, I suppose that this is the final update...

  • Like 1
Link to post
Share on other sites
AshGamer007
1 hour ago, The Eddo said:

* III and VC versions lose "all-EXE-friendliness".

Wait does it mean it will only work on v1.0?

Edited by PiashGamer007
Link to post
Share on other sites
Staunton Assassin
1 hour ago, PiashGamer007 said:

Wait does it mean it will only work on v1.0?

Yes. And besides, why would you want any other EXE than US v1.00 for III and VC anyway? Most of the modding researches and finds in this great modding community were done using the US v1.00 EXEs:).

Link to post
Share on other sites
AshGamer007
10 minutes ago, The Eddo said:

Yes. And besides, why would you want any other EXE than US v1.00 for III and VC anyway? Most of the modding researches and finds in this great modding community were done using the US v1.00 EXEs:).

I was just asking.Anyway in the beginning of mission rub out Lance Vance can be seen sprinting with M4 in one hand can you fix it?

Edited by PiashGamer007
Link to post
Share on other sites
Staunton Assassin
2 minutes ago, PiashGamer007 said:

I was just asking.Anyway in the beginning of mission rub out Lance Vance can be seen sprinting with M4 in one hand can you fix it?

That's a bug in the game's core, unfortunately. It seems rather extremely difficult to fix.

Edited by The Eddo
Link to post
Share on other sites

After pedestrian run out of ammo/change into knife or fist, the holding-weapon animation still stay.

Edited by Irsis
Link to post
Share on other sites
Staunton Assassin
8 hours ago, Irsis said:

After pedestrian run out of ammo/change into knife or fist, the holding-weapon animation still stay.

This bug can (probably) be fixed but the problem is that it would affect other peds' walkstyles too. What this mod intends to do is to make peds use two-handed walkstyles only when wielding the appropriate two-handed weapons, so they still use their default walkstyles when wielding one-handed weapons.

Link to post
Share on other sites
thalilmythos

A "fix" could be giving them an animation based on their pedtype, but that leaves out "oldamales" "fatmales" and "oldladys"
Despite that it could work.

Link to post
Share on other sites
Staunton Assassin

I do have an idea, but I have doubts if it'll actually work. The idea is that when a ped loses a weapon that caused his/her walkstyle to change, the ped's old walkstyle is restored (whichever it was). But this would require somewhat really clever memory-editing stuff, which makes me want to look up to Junior_Djjr for it.

  • Like 1
Link to post
Share on other sites
Junior_Djjr

GTA SA:

{$cleo}
0000:

while true
    wait 0
    0AB5: store_closest_entities $PLAYER_ACTOR vehicle_to [email protected] ped_to [email protected]
    if [email protected] > 0
    then
        0665: get_char_model [email protected] store_to [email protected]
        0AA7: call_function_return 0x00403DA0 num_params 1 pop 1 [email protected] store_to [email protected]
        [email protected] += 0x24 //CPedModelInfo.m_nAnimType
        0A8D: [email protected] = read_memory [email protected] size 4 vp false
        0AD1: print_formatted_now "model %d is %d" time 1 [email protected] [email protected]
    end
end

 

GTA VC:

Instead of 0x00403DA0, is 0x00591AA0

Instead of 0x24, is 0x30

edit: 0AB5: doesn't exist in VC, but, well...

 

GTA III:

{$cleo}
0000:

while true
    wait 0
    0A8D: [email protected] = read_memory 0x6FAD2C size 4 virtual_protect 1
    0A8D: [email protected] = read_memory 0x6FAD30 size 4 virtual_protect 1
    0A8D: [email protected] = read_memory 0x6FAD34 size 4 virtual_protect 1
    if 0AE1: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 5.0 find_next 0 pass_deads 0 // find just one near
    then
        0A96: [email protected] = actor [email protected] struct
        [email protected] += 0x5C //CEntity.m_nModelIndex
        0A8D: [email protected] = read_memory [email protected] size 2 virtual_protect 0
        0A8D: [email protected] = read_memory 0x004010E3 size 4 vp true //CModelInfo::ms_modelInfoPtrs[]
        0085: [email protected] = [email protected]
        [email protected] *= 4
        0058: [email protected] += [email protected]     
        0A8D: [email protected] = read_memory [email protected] size 4 vp false
        [email protected] += 0x34 //CPedModelInfo.m_nAnimType
        0A8D: [email protected] = read_memory [email protected] size 4 vp false
        0AD1: print_formatted_now "model %d is %d" time 1 [email protected] [email protected]
    end
end

 

Edited by Junior_Djjr
  • Like 1
Link to post
Share on other sites
Staunton Assassin
On 8/14/2019 at 3:38 PM, Junior_Djjr said:

(insert really helpful code here)

Oooh, that seems really helpful! Thank you so much, Junior.:^::cookie: Gangster Walk Fix shall continue! But what about the support for added weapons? Can you help me out with that? I tried to add the added weapons support like this:

[RocketLauncher] ; Weapons defined under this section will use the "rocket launcher" walkstyle.
FirstCustomWeaponID=70
LastCustomWeaponID=71

[2Armed] ; Weapons defined under this section will use the "two-handed weapon" walkstyle.
FirstCustomWeaponID=72
LastCustomWeaponID=73

[BBBat] ; Weapons defined under this section will use the "baseball bat" walkstyle.
FirstCustomWeaponID=74
LastCustomWeaponID=75

[CSaw] ; Weapons defined under this section will use the "chainsaw" walkstyle.
FirstCustomWeaponID=76
LastCustomWeaponID=77

[1Armed] ; Weapons defined under this section will use the "one-handed weapon" walkstyle.
FirstCustomWeaponID=78
LastCustomWeaponID=79

But when I realized it's requiring too many local variables, I kind-of failed at it. What I'm thinking about is some SilentPatch-like INI file where you just enter the weapon IDs (one per line) under the appropriate "RocketLauncher", "2Armed" etc. sections and you're good to go.

Edited by The Eddo
Link to post
Share on other sites
  • 3 months later...
  • 3 weeks later...
Staunton Assassin
On 11/25/2019 at 9:15 PM, MatthewFarrell said:

Some news?

I'm considering an update, it will hopefully arrive by the start of next year. Stay tuned.;)

  • Like 1
Link to post
Share on other sites
  • 1 month later...
Staunton Assassin

Happy birthday, Gangster Walk Fix!

 

In case if you were unfortunate enough to not know, today is the day when Gangster Walk Fix was first released last year. That's right, on the 15th of February in 2019!
Anyway, on the event of this honorable day, I've decided to make, announce and release a new update.
First of all, I would like to give many, MANY thanks to @Junior_Djjr. If it wasn't for his great assistance and cooperation, this modification might have never existed...

 

* Finally playtested the III version.
* If a pedestrian stops wielding a weapon that caused his or her walkstyle to change, the script will now obtain the pedestrian's default walkstyle and restore it.
* The modification now checks for the pedestrians' current walkstyle first before it applies any new ones.

 

* As a result, the scripts will apply the new walkstyle only once on each pedestrian instead of applying the same walkstyle to the same pedestrian over and over.
* Moreover, there is also quite much of a probability that the scripts will move onto other pedestrians due to this.
* Made overall minor improvements in all three scripts' codes and shortened them all quite a lot.

 

* The SA version of the script is now compatible with the US v1.00 EXE only.
* The entire ReadMe file has completely remade, redone, rebranded, reworked, and remastered.
* And what-not.

 

Well, why are you still here? What are you waiting for? The modification has been released! Go get the latest update from the OP!

Edited by The Eddo
  • Like 4
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
  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

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