Log in to reply
 

Create new loadout and health stats for new AI ped



  • Hi, so i've added 3 new ped meshes into mpheists folder, copied the data from original cop peds into the mpheists/dlc.rpf/common/data/peds.meta.
    Peds are properly dispatched in game.

    Now i'd like to make them as resistant as SWAT, so i tried messing with update/update.rpf/x64/data/metadata/pedpersonality.ymt. Copied the original POLICE personality, and changed the <HealthConfigHash> from Strong to Armour.
    Nothing has changed in-game.
    (I tried creating a new loadout for these new peds, nothing changed in-game neither.)

    Either i'm missing something here, but this thread https://forums.gta5-mods.com/topic/24453/loadouts-meta-help/2 seems to be totally logical.

    Is it actually possible to edit the health and loadout configuration of added AI peds ?



  • Update : Changing the <Pedtype> from "cop" to "swat" give the ped the swat armour.

    Creating/editing the loadout actually works,

    ! BUT !

    When dispatched, ALL the peds who are driving will have some edited weapon (from loadout.meta) and ALL the peds who are passengers (even from the fbi2 sides) WILL spawn with a shotgun. Always the same weapon : shotgun.

    Someone has a idea from where it could be linked to ?



  • This post is deleted!


  • @epoqx
    Regarding the 'COP_LOADOUT_SHOTGUN', I'll just reply to that in your other thread, but I just wanted to join some dots on the 'pedpersonality.ymt' '<HealthConfigHash>' (for future reference etc):

    'pedpersonality.ymt':

    <HealthConfigHash>Strong</HealthConfigHash>
    

    That line relates to a section in 'pedhealth.meta':

    ...\mods\common.rpf\data\pedhealth.meta (default location, check there's not one in 'update.rpf' before editing though)

    'pedhealth.meta':

    <?xml version="1.0" encoding="UTF-8"?>
    <CHealthConfigInfoManager>
      <aHealthConfig>
        <Item>
          <Name>Strong</Name>
          <DefaultHealth value="200.000000" />
          <DefaultArmour value="0.000000" />
          <FatiguedHealthThreshold value="150.000000" />
          <InjuredHealthThreshold value="100.000000" />
          <DyingHealthThreshold value="100.000000" />
          <HurtHealthThreshold value="150.000000" />
          <DogTakedownThreshold value="150.000000" />
          <MeleeCardinalFatalAttackCheck value="false" />
        </Item>
    

    I reckon, if required, it should be possible to create your own 'aHealthConfig' (Strong/Average/Weak etc) in 'pedhealth.meta'. Call it 'Superstrong' etc

    <?xml version="1.0" encoding="UTF-8"?>
    <CHealthConfigInfoManager>
      <aHealthConfig>
        <Item>
          <Name>Superstrong</Name>
          <DefaultHealth value="500.000000" />
          <DefaultArmour value="300.000000" />
          <FatiguedHealthThreshold value="250.000000" />
          <InjuredHealthThreshold value="200.000000" />
          <DyingHealthThreshold value="200.000000" />
          <HurtHealthThreshold value="250.000000" />
          <DogTakedownThreshold value="250.000000" />
          <MeleeCardinalFatalAttackCheck value="false" />
        </Item>
    

    & then point 'pedpersonality.ymt' to it:

    <HealthConfigHash>Superstrong</HealthConfigHash>
    

    Haven't tested this, but to me 'pedhealth.meta' looks like the kind of file you can add whatever you want to & as long as everything else is in the right place, it should work (no promises (yeah, I'm talking about you Rockstar :unamused:), but good chance :thumbsup:



  • @a63nt-5m1th Before creating a new 'aHealthConfig', i've simply tried to put the 'HealthConfigHash' from 'Strong' to 'Armour' on that specific ped. It didn't worked. So i've messed with the personalities and pedtypes, and it's when I changed the 'Pedtype' from 'cop' to 'swat', that the ped had the swat health (Armour).

    So I couldn't simply change de 'HealthConfigHash' to create a cop ped with armour health. I needed to change the cop ped to swat 'pedtype' to have an effect.

    Meaning that it is no longer dispatch-able the same way (cops and swat not interacting the same way/dispatch ghost bug/vehicles not interacting the same way from 'dispatch.meta').

    Btw, how do you copy the config lines on the forum without them to take a whole page ?

    Thanks,
    Again.



  • @epoqx said in Create new loadout and health stats for new AI ped:

    Btw, how do you copy the config lines on the forum without them to take a whole page ?

    You mean the blue, green & red codeblock text I posted above? (& the 3 examples below)

    How to post a codeblock:

    ```xml
    Copy these three lines to txt file etc, overwrite only this line with meta data, copy all & post into forum post.
    ```

    Cops Health:
    Jacking up the cops health using 'Superstrong' etc, as mentioned above, certainly works :thumbsup:

    Example:

    pedpersonality.ymt:

        <Item>
          <PersonalityName>POLICE</PersonalityName>
          <DefaultWeaponLoadout>LOADOUT_COP</DefaultWeaponLoadout>
          <Bravery>swat</Bravery>
          <AgitatedPersonality>Confront</AgitatedPersonality>
          <Criminality>Law_Abiding</Criminality>
          <AgitationTriggers>LawEnforcement</AgitationTriggers>
          <HealthConfigHash>Superstrong</HealthConfigHash> <!-- This is the only line that matters -->
          <WeaponAnimations>
            <Item>default</Item>
          </WeaponAnimations>
          <AmbientAudio>LawEnforcement</AmbientAudio>
          <WitnessPersonality>default</WitnessPersonality>
          <Agility>
            <Flags>AF_CAN_DIVE</Flags>
            <MovementCostModifier value="1.00000000"/>
          </Agility>
          <IsMale value="true"/>
          <IsHuman value="true"/>
          <ShouldRewardMoneyOnDeath value="true"/>
          <IsGang value="false"/>
          <IsSecurity value="false"/>
          <IsWeird value="false"/>
          <IsDangerousAnimal value="false"/>
          <CausesRumbleWhenCollidesWithPlayer value="false"/>
          <AllowSlowCruisingWithMusic value="false"/>
          <AllowRoadCrossHurryOnLightChange value="false"/>
          <VehicleTypes/>
          <AttackStrengthMin value="1.00000000"/>
          <AttackStrengthMax value="1.20000000"/>
          <StaminaEfficiency value="1.00000000"/>
          <ArmourEfficiency value="1.00000000"/>
          <HealthRegenEfficiency value="1.00000000"/>
          <ExplosiveDamageMod value="1.00000000"/>
          <HandGunDamageMod value="1.00000000"/>
          <RifleDamageMod value="1.00000000"/>
          <SmgDamageMod value="1.00000000"/>
          <PopulationFleeMod value="1.00000000"/>
          <HotwireRate value="1.00000000"/>
          <MotivationMin value="0"/>
          <MotivationMax value="10"/>
          <DrivingAbilityMin value="8"/>
          <DrivingAbilityMax value="10"/>
          <DrivingAggressivenessMin value="8"/>
          <DrivingAggressivenessMax value="10"/>
          <Affluence>AFF_AVERAGE</Affluence>
          <TechSavvy>TS_HIGH</TechSavvy>
          <MovementModes>DEFAULT_ACTION</MovementModes>
          <WeaponAnimsFPSIdle>FirstPerson</WeaponAnimsFPSIdle>
          <WeaponAnimsFPSRNG>FirstPersonRNG</WeaponAnimsFPSRNG>
          <WeaponAnimsFPSLT>FirstPersonAiming</WeaponAnimsFPSLT>
          <WeaponAnimsFPSScope>FirstPersonScope</WeaponAnimsFPSScope>
        </Item>
    

    pedhealth.meta:

    <?xml version="1.0" encoding="UTF-8"?>
    <CHealthConfigInfoManager>
      <aHealthConfig>
        <Item>
          <Name>Superstrong</Name> <!-- from 'pedpersonality.ymt' obvs -->
          <DefaultHealth value="220000.000000" />
          <DefaultArmour value="200000.000000" />
          <FatiguedHealthThreshold value="150.000000" />
          <InjuredHealthThreshold value="100.000000" />
          <DyingHealthThreshold value="100.000000" />
          <HurtHealthThreshold value="150.000000" />
          <DogTakedownThreshold value="150.000000" />
          <MeleeCardinalFatalAttackCheck value="false" />
        </Item>
    

    For me, those 'pedhealth.meta' values above make the cops able to withstand ~5>6 Headshots & about 20>30 bodyshots on average, from a gun with 32 damage.

        <Item>
          <Name>Superstrong</Name>
          <DefaultHealth value="220000.000000" />
          <DefaultArmour value="200000.000000" />
          <FatiguedHealthThreshold value="15.000000" />
          <InjuredHealthThreshold value="10.000000" />
          <DyingHealthThreshold value="10.000000" />
          <HurtHealthThreshold value="15.000000" />
          <DogTakedownThreshold value="15.000000" />
          <MeleeCardinalFatalAttackCheck value="false" />
        </Item>
    

    These values above make the cops ever tougher. ~11 shots to the head & ~30>50 to the body to kill them on average (32 damage per shot in 'weapons.meta', but other variables will influence the final shot count (falloff for one)).
    So yeah, as you can see from the values I had to use (~200,000 lol), I think the reason you didn't see any difference testing 'Armour' was that the values where just too low & too close to normal.

    There's still a known issue with bleedout I need to look at. Basically, if the cops go down, sometimes something else kicks in & makes them bleedout no matter how much health they have. Other times I have a near indestructable crawling T1000 to deal with. lol

    Bleedout Fix:
    For the bleedout issue, I managed to get rid of that (& all the crawling about animations) by using Don't Writhe!. Thorough testing needed, but initial impressions are good, it's a lot better having cops get back up off the ground & continue the fight rather than lying down on the job etc. I'll be keeping the 'Don't Writhe!' script me thinks. :slight_smile: :thumbsup:

    Have a play around with all that :point_up: anyway & let me know how you get on :thumbsup:



  • @a63nt-5m1th You are amazing.

    I'll start messing more in-depth with 'pedhealth.meta'.
    You are talking about headshots, and I was looking at some point to specifically upgrade that part of their body (headshot) to resist from 0 to 1 shot for specific units, mostly to make peds with helmets more realist.
    I'm just not sure what threshold values refers to.

    for example :

    <Item>
          <Name>Strong</Name>
          <DefaultHealth value="271.999999" />
          <DefaultArmour value="21.999999" />
          <FatiguedHealthThreshold value="151.999999" />
          <InjuredHealthThreshold value="100.000000" />
          <DyingHealthThreshold value="100.000000" />
          <HurtHealthThreshold value="151.999999" />
    	  <DogTakedownThreshold value="151.999999" />
    	  <MeleeCardinalFatalAttackCheck value="false" />
        </Item>
    

    The threshold values are way higher than yours, and from my mindset, it means that it needs more damage before hitting that treshold.

    e.g. My DyingHealthThreshold value="100.000000" ; It needs 100.000 damage before the ped can possibly die.
    Your DyingHealthThreshold value="10.000000" ; They seem much more resistant from your sayings. Is that value reversed ?

    !!! IMPORTANT EDIT !!!

    You where right. The values where too low. I tried again with much higher values, and it worked, BUT only when I put the Pedtype, from 'peds.meta' as swat. When it is as COP, even with the HealthConfigHash as Armour, the peds got no armor, and die as fast as cops without armor.

    For information, these peds i've made the tests with are addons I've added in 'mpheist' folder. So I added their informations in the 'peds.meta' from that folder. The rest is in the main 'update.rpf' folders. So I was thinking about messing up with S_M_Y_Cop_01 values in update.rpf/x64/data/ peds.ymt... But whenever I do something in that file, even if i change a value to an existing one, or try to put back the original value, the game crashes. I'm forced to replace the file with the original for me to make GTA work again.

    'Don't Writhe!' actually helped a LOT to find out the number of bullets needed before the armor gets off and let place to health. It fixed the bleedout issue, that was probably the reason why I did bad tests at first, totally confusing me and making the bullet count kinda random.

    Thank you.



  • @epoqx
    Thresholds:
    Yeah, for me lowering the thresholds defo made the peds tougher :thumbsup:
    There are a few things like that in GTAV, where you have to do the opposite of what common sense dictates.
    It may well mean, that once the peds health gets below that amount, they are able to die, but not before.
    If that's the case, setting thresholds to zero (or '-1.0') might make peds immortal.

    pedhealth.meta 'aHealthConfig':
    There may be certain hidden flags associated with the rockstar defaults (Strong, Armour etc).
    Do what I did & create your own (Superstrong etc) & it should work :thumbsup:

    peds.ymt:
    Are you editing within openIV (right-click > 'Edit' ('Ctrl+Enter')) or using the 'Export to META/XML (.xml)' functionality & editing in Notepad etc?
    Generally, editing '.ymt' files from within openIV is a lot more stable & less likely to cause issues.
    Another way to do it is to grab a decrypted 'peds.ymt' & then you can just drag & drop it in & out of openIV as is, no need to use the 'Export to META/XML (.xml)' functionality. It will remain editable in all text editing programs forever after that.

    Decrypted 'peds.ymt' Instructions:

    • Download my one from the link above
    • Open openIV & go to your 'peds.ymt', open it & copy everything in it ('Ctrl+A' > 'Ctrl+C' etc)
    • Paste it into my decrypted 'peds.ymt' overwriting everything ('Ctrl+A' > 'Ctrl+V' etc)
    • Save, & drag the decrypted 'peds.ymt' into openIV over the original

    If you still get a crash after that, you either have an error in 'peds.ymt' or you're looking at some other rare funky weird issue that shouldn't be happening. That file should defo work without issue. :thumbsup:
    Use my downloaded 'peds.ymt' in your game to find out if you have an error in your version etc :thumbsup:

    Don't Writhe!:
    Aye, that was a damn good find, I'm keeping that :thumbsup:



  • @a63nt-5m1th I'm gonna try your 'peds.ymt' tip !

    I'm creating my 'aHealthConfig', but I still need to edit them as 'swat' Pedtype, and i'll stick with it, because it is working and doesn't seem to impact the way they are dispatched ;)

    • I'm trying to actually find a way to make peds with visual helmets resistant to one shot in the head. Messing the things with the thresholds but I can't seem to find what i'm searching for !

    EDIT :
    Yeah i'm editing only from openIV.
    Your decrypted peds.ymt copy/paste worked.

    I'll stop saying thanks after some point, jsut keep in mind that I am really gratefull, i've struggled quite some time on all these questions, and you got most of the answers.
    With all of these changes, i'm scared about a Rockstar update now. RAGE Plugin hook keep the files how they are ?

    EDIT 2 :
    Ok i'm gettin tired, i've just reminded myself why the 'mods' folder is actually usefull for... Nevermind !



  • @epoqx said in Create new loadout and health stats for new AI ped:

    make peds with visual helmets resistant to one shot in the head

    Use this below (if you haven't done something similar already) to see if the helmets on your peds are flagged as 'armour' in the game:

          <DefaultHealth value="200.000000" />
          <DefaultArmour value="500000.000000" />
          <FatiguedHealthThreshold value="120.000000" />
          <InjuredHealthThreshold value="100.000000" />
          <DyingHealthThreshold value="100.000000" />
          <HurtHealthThreshold value="150.000000" />
          <DogTakedownThreshold value="150.000000" />
          <MeleeCardinalFatalAttackCheck value="false" />
    

    If not, it's going to be hard to separate 'armour' from 'health' & make them resistant to bullets only on parts that have armour etc.

    Edit:
    As a rule, I don't update, did it once but game felt different after & I don't like that lol. Enough variables as it is. GTA V is in full lockdown, doesn't even know the Internet exists anymore.
    I've no idea about Rage Plugin Hook, sorry.



  • @a63nt-5m1th So i've made my tests using <DefaultArmour value="500000.000000" />.

    • With that much armor value, peds with helmets couldn't die by headshots, except from sniper headshots it seems like.
      So there is probably something to tweak somewhere to activate/desactivate instant headshot kill for a weapon.

    • With that much armor value, peds without helmets couldn't die by headshots neither. Meaning armor is considered as part of the whole body of the ped.

    Now the interesting thing is to tweak the values to find the good on to avoid headshot instakill !



  • @epoqx
    Yeah, discovered that too. Seems like Rockstar, in all their wisdom, made skin armoured :rolling_eyes:.
    The only thing I know of to alter that in some way is Locational Damage & Deadly Headshots.



  • @a63nt-5m1th For future reference, my sweat spot to one headshot protection with DefaultArmour seems to be between 14100.0 and 14900.0.

    I'll try using Locational Damage & Deadly Headshots after it !

    EDIT :
    Locational Damage & Deadly Headshots didn't seem to have an effect with so much armor. I'll seek more into it.

    I've realised there is some headshot damage modifiers in weapons.meta, but the base damage and multipliers do not seem to match with my health/armor values.

    EDIT 2 :

    ---- FIXED HEALTH and ONE HEADSHOT HELMET PROTECTION ----

    Because having '14000.0' points of armor seems far from being realistic for me

    • I've changed the weapons.meta/ HeadShotDamageModifierAI value= of each weapons, from '1000.0' to '10.0',
    • And scaled the pedhealth.meta/ DefaultArmour value= with the same multiplier : from ~'14000.0' to '140.0'.

    All of this making them still resist to one headshot bullet, and at the same time killable without headshots. Fits better a more realistic damage.


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.