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. The Diamond Casino Heist
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. 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

Sign in to follow this  
uNiverselEgacy

How do you increase the health of most Peds?

Recommended Posts

uNiverselEgacy

I'm trying to increase the health of bodyguards and enemies so that they don't die too quickly. I've tried SET_PED_MAX_HEALTH, SET_ENTITY_HEALTH, SET_PED_ARMOUR, etc...but none would work as intended. Most characters would suffer to death with just one shot. I know that these functions work on the three story characters (Michael, Trevor, and Franklin) but I want to make them work on all characters. I also know that SET_ENTITY_INVINCIBLE does work but I still want them to take damage and be killed eventually.

 

Share this post


Link to post
Share on other sites
whorse
if (!ENTITY::HAS_ENTITY_BEEN_DAMAGED_BY_ANY_PED(ped) && !ENTITY::HAS_ENTITY_BEEN_DAMAGED_BY_ANY_VEHICLE(ped)){	if ((int(PED::GET_PED_MAX_HEALTH(ped)) < pedMinHealth))	{		PED::SET_PED_MAX_HEALTH(ped, pedMinHealth);		ENTITY::SET_ENTITY_HEALTH(ped, pedMinHealth);	}	if (PED::GET_PED_ARMOUR(ped) < pedArmor)	{		PED::SET_PED_ARMOUR(ped, pedArmor);	}}

With pedMinHealth being the minimum health you want the ped to have, and pedArmor being the minimum armor you want the ped to have. If they do not have any armor, peds who are openly carrying guns can bleed to death from a single bullet even if they have 10,000 health. But peds who are in melee combat and have 10,000 health can be shot hundreds of times and will keep getting up. I think that if a ped is fleeing, they are also much more likely to die in one shot. You can use

PED::SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, true);

to make easily-scared peds not run away all the time.

 

Even with really high armor, peds carrying guns still seem to have a small chance of just losing all of it in one shot and writhing on the ground and bleeding to death. I don't know how to get around that.

 

There is also:

PED::ADD_ARMOR_TO_PED(ped, pedArmor);

if PED::SET_PED_ARMOR doesn't work (IIRC it wouldn't work for me when I first tried this, but now it does)

 

Sorry if you wanted C#, but I don't know it

Edited by whorse

Share this post


Link to post
Share on other sites
maurojunior2011

The rockstar uses bones on characters (ped) to evaluate the shot, for example, shot in the knee on a real person, would not make up no more than shoot from the ground, and that's what happens on game if u take the test. A solution that including'm searching too, would know which "bone" hit the shot and fix or undo the damage of this shot. It may seem strange, but it's a start.

Edited by maurojunior2011

Share this post


Link to post
Share on other sites
uNiverselEgacy
if (!ENTITY::HAS_ENTITY_BEEN_DAMAGED_BY_ANY_PED(ped) && !ENTITY::HAS_ENTITY_BEEN_DAMAGED_BY_ANY_VEHICLE(ped)){	if ((int(PED::GET_PED_MAX_HEALTH(ped)) < pedMinHealth))	{		PED::SET_PED_MAX_HEALTH(ped, pedMinHealth);		ENTITY::SET_ENTITY_HEALTH(ped, pedMinHealth);	}	if (PED::GET_PED_ARMOUR(ped) < pedArmor)	{		PED::SET_PED_ARMOUR(ped, pedArmor);	}}

With pedMinHealth being the minimum health you want the ped to have, and pedArmor being the minimum armor you want the ped to have. If they do not have any armor, peds who are openly carrying guns can bleed to death from a single bullet even if they have 10,000 health. But peds who are in melee combat and have 10,000 health can be shot hundreds of times and will keep getting up. I think that if a ped is fleeing, they are also much more likely to die in one shot. You can use

PED::SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, true);

to make easily-scared peds not run away all the time.

 

Even with really high armor, peds carrying guns still seem to have a small chance of just losing all of it in one shot and writhing on the ground and bleeding to death. I don't know how to get around that.

 

There is also:

PED::ADD_ARMOR_TO_PED(ped, pedArmor);

if PED::SET_PED_ARMOR doesn't work (IIRC it wouldn't work for me when I first tried this, but now it does)

 

Sorry if you wanted C#, but I don't know it

 

Thanks for the code, but it doesn't really work. I even tried calling SET_ENTITY_HEALTH and SET_PED_ARMOUR every frame but it didn't seem to change anything.

Share this post


Link to post
Share on other sites
maurojunior2011
functions:


PED :: GET_PED_LAST_DAMAGE_BONE


Hashes: 0xD75960F6BD9EA49C 0xAB933841

BOOL GET_PED_LAST_DAMAGE_BONE (Ped ped, Any * outBone)

// 0xD75960F6BD9EA49C 0xAB933841



PED :: CLEAR_PED_LAST_DAMAGE_BONE


Hashes: 0x8EF6B7AC68E2F01B 0x56CB715E

void CLEAR_PED_LAST_DAMAGE_BONE (Ped ped) // 0x8EF6B7AC68E2F01B 0x56CB715E


-You can use them for example to the "ped" die with one shot to the head.


GET_PED_LAST_DAMAGE_BONE = Returns where the shot hit


compare if it's in the head (not at the time the list of IDs)


CLEAR_PED_LAST_DAMAGE_BONE = Remove the damage shot.


So, depending on where the shot hit, you will not be bleeding to death. You'll adjusting as you play, but the knee would be a critical point....

Share this post


Link to post
Share on other sites
whorse

What are you having the peds that you are trying to increase their health do? That code works perfectly for me; you can see the puffs of dust if you shoot them while they have armor (as opposed to puffs of blood when shot without armor)

 

Have you tried that bone code out, maurojunior? I didn't know you could subtract damage from a killing shot after it had already been done, not without resurrecting the ped and all that

 

Also, shots to the knees are devastating to most peds because there is no crawl animation so rockstar just has them bleed out (to keep people from complaining about cops still running/fighting after you blow their kneecaps off)

Share this post


Link to post
Share on other sites
uNiverselEgacy

What are you having the peds that you are trying to increase their health do? That code works perfectly for me; you can see the puffs of dust if you shoot them while they have armor (as opposed to puffs of blood when shot without armor)

 

Have you tried that bone code out, maurojunior? I didn't know you could subtract damage from a killing shot after it had already been done, not without resurrecting the ped and all that

 

Also, shots to the knees are devastating to most peds because there is no crawl animation so rockstar just has them bleed out (to keep people from complaining about cops still running/fighting after you blow their kneecaps off)

I simply ask enemies to attack the player using AI::TASK_COMBAT_PED(ped, playerPed, 0, 16) and bodyguards to "protect" the player using PED::SET_PED_AS_GROUP_MEMBER(ped, groupId);PED::SET_PED_RELATIONSHIP_GROUP_HASH(ped, GAMEPLAY::GET_HASH_KEY("PLAYER")).

SET_PED_ARMOUR and SET_ENTITY_HEALTH do nothing whatsoever. They die/bleed to death anyway.

Those functions work perfectly fine as their names suggest on the three main characters but nothing else so I wonder if there's some special attributes associated with them.

Share this post


Link to post
Share on other sites
adv0cate

I see a difference when i use ENTITY::SET_ENTITY_HEALTH(spawnedPed, 400); not a big difference but they last alittle longer when they are enemies to me at lease.

Share this post


Link to post
Share on other sites
uNiverselEgacy

CLEAR_PED_LAST_DAMAGE_BONE also doesn't seem to remove any damage to the ped?

However I have found out that the problem is probably with ragdoll. If I disable it like SET_PED_CAN_RAGDOLL(ped, FALSE) then they won't fall to the ground and die with one shot. They would behave similar to the player.

But it just makes it less interesting and realistic. Any idea on how to prevent them from dying too quickly with few shots while enabling ragdoll as well?

Share this post


Link to post
Share on other sites
uNiverselEgacy

CLEAR_PED_LAST_DAMAGE_BONE also doesn't seem to remove any damage to the ped?

However I have found out that the problem is probably with ragdoll. If I disable it like SET_PED_CAN_RAGDOLL(ped, FALSE) then they won't fall to the ground and die with one shot. They would behave similar to the player.

But it just makes it less interesting and realistic. Any idea on how to prevent them from dying too quickly with few shots while enabling ragdoll as well?

Well this doesn't work all the time. Although they tend to be less likely to be killed by disabling ragdoll they sometimes do die with few shots even though they have 500+ health and armor and they are not shot in the head.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

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