Skip to content
View in the app

A better way to browse. Learn more.

RDR2Mods.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Ped Damage Overhaul

You're viewing a summary of the most helpful posts in this topic — about 3 minutes of reading instead of 29 minutes for all 24 posts.

Featured Replies

Find the mod download page here:

 

 

 

 

And the source code of v1.48 here (I tried to comment most of the code understandably - please be kind, I know the code isnt the most sophisticated or efficient):

 

v1.48_src.txt

 

Edited by HughJanus
revamped the page

  • 3 months later...
  • Author
Just now, Wengu4 said:

Hello. I saw on nexus that this mod tweaks npc health. Can you tell me which natives correspond to the ai' health?

 

We use SET_ENTITY_HEALTH and SET_ENTITY_MAX_HEALTH.

  • Author
9 hours ago, Wengu4 said:

Thank you for reply. For example if i want to increase humanoid enemies health in the game i go with SET_ENTITY_HEALTH( entity?, int); ? How do i group them in the entity field? AIwepdmg and playerweapondmg are pretty easy to tweak

 

I dont think there is a way of grouping them, you have to iterate through all the NPCs.

We do it like this:

//how many peds you want to be affected
const int size = 1024;

//container for the peds
Ped peds[size];

//filling the ped container and counting how many are in it (the method "worldGetAllPeds" tries to put 'size' amount of peds into 'peds' and returns the actual amount it was able to assign
int count = worldGetAllPeds(peds, size);

//looping though the peds
for (int i = 0; i < count; i++)
{
	//do something with peds[i]
  
  	//example for health
  	ENTITY::SET_ENTITY_MAX_HEALTH(peds[i], HEALTHVALUE);
  	ENTITY::SET_ENTITY_HEALTH(peds[i], ENTITY::GET_ENTITY_MAX_HEALTH(peds[i], 0), 0);
}

 

Dont forget to check if the current ped is not the player and if its human.

The player and animals are also peds.

Edited by HughJanus

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.