Jump to content

Ped Damage Overhaul


HughJanus
 Share

Recommended Posts

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
Link to comment
Share on other sites

  • 4 weeks later...

I like the concept of this mod even though I tweaked it without the knowing that the mod was for gunfights. So, I was tweaking to try to make the fist fights harder and longer including the bleeding effects during a fight. With that said, Is there any mod available for fist fights and do what this mod is doing for gunfights?

Link to comment
Share on other sites

4 hours ago, Shawnmars86 said:

I like the concept of this mod even though I tweaked it without the knowing that the mod was for gunfights. So, I was tweaking to try to make the fist fights harder and longer including the bleeding effects during a fight. With that said, Is there any mod available for fist fights and do what this mod is doing for gunfights?

 

Not that I know of.

But what should it do?

I suppose you want to be able to configure melee damage for both the player and NPCs and also the health. What else? Maybe we can implement some ideas into this mod, if it doesnt drift off too far from the current scope.

Link to comment
Share on other sites

  • 3 weeks later...

I love the concept of this mod and can't wait to try it out, but the required scripthook by Alex Blade doesn't look like it's available,  you get a 404 error when getting on the page. Is it possible to use this mod without the scripthook or use it with a different scripthook?

Link to comment
Share on other sites

11 hours ago, Badcat007 said:

I love the concept of this mod and can't wait to try it out, but the required scripthook by Alex Blade doesn't look like it's available,  you get a 404 error when getting on the page. Is it possible to use this mod without the scripthook or use it with a different scripthook?

 

Someone in the nexus forum apparently uploaded the files on mediafire: http://www.mediafire.com/file/uwa7nsoxxs6akbl/ScriptHookRDR2_1.0.1232.17.zip/file

Have not downloaded and checked it, though. So be careful.

 

And no, unfortunately there is no way around scripthook.

Edited by HughJanus
Link to comment
Share on other sites

  • 4 weeks later...

So, to start thank you so much for such an amazing mod. however I have a few questions. Is there a way to make it so when you trigger the bleedout animation(dark red x when they get shot) so they lay there for a while like when this mod is off? In vanilla they writhe around on the bround for like 30 seconds. With your mod they fall down and die immediately.

 

Second question is can I get rid of the seizuring/rolling around on the ground by deleting skmethjng in the ini?

Link to comment
Share on other sites

@BearDad The animation on the ground is has not been removed - its just that when you trigger the artery shot when health is already not at the highest, it can happen (when using the realistic version) that the bleeding effect from the mod (= when under a certain health threshold, every millisecond a chance is computed to remove health from the injured NPC) will kill the NPC before it can go down into the wrtihe mode. This only happens with the realistic version, because the health is still vanilla, but the mods bleeding is still applied to circumvent NPCs living forever when downed, so in the artery shot cases it may be contraproductive (depending on when the player lands the artery shot).

So if you alter the bleedingchance and bleedingvalue to be lower, the bleedout for all NPCs will take longer and your artery shot NPCs will have the time to writhe. (or turn off the bleeding completely, but then you will have to finish off everyone in a dying state manually)

 

If I understood you correctly, you want NPCs to behave like in vanilla (stand until they are dead or receive an artery shot), you have to set DyingStateChance in the ini to 0.

If you just want to skip DyingState 1 and 2 (the ones where they are moving) and want them to lay still and still be alive, you have to set the values like this:

DyingMovementThreshold = x + 2

DyingMovementThreshold2 = x + 1

DyingThreshold = x

 

x would be the health threshold under which they would just lie on the ground.

Due to the way the script is written, those variables have to have values in that order, otherwise the script cant transition the NPCs properly from one state to the next and bugs may occur. But since there are only 2 health points difference, the chance of the NPC entering dying state 1 or 2 are practically 0 (at least I have never managed to witness movement when I set values this way for testing).

Edited by HughJanus
Link to comment
Share on other sites

  • 1 month later...

Love the mod, really cool stuff, disarms can be a little annoying in story mode (and in my advice should be disabled for story mode to avoid quests bugging due to fleeing enemies), but other than that, its just brilliant how it works to function.

 

In regards to the issue with how bodies glitch when in slow mo menus, would it be possible to disable the time slow effect in menus? Like how it works in multiplayer in realtime? 

 

Other than that I would like to request more variables options if possible;

 

  • A disarm % chance, a variable that randomises the success rate of a disarm.
  • An accuracy % chance, a variable that randomises each enemies accuracy.
  • Controls over Health/stamina/deadeye restore rate (not the cores, the outside ring).
  • Controls over Health/stamina/deadeye core specific drain rates (instead of the one for all).
  • A variable that controls how often an enemy runs away or attacks with melee after disarmed.

 

And a couple of other suggestions that may not be as easy;

 

  • Misfire chance; (for player too if possible) bullets not firing, guns jamming etc, could be based on weapon type/damage.
  • Controls over stamina drain rates, options for drain while crouch walking/running, options for drain while aiming with all weapons, control over bow draw drain etc.
  • Zombie mode; when enabled enemies get back up from the dead once after some delay (after death states).
  • Controls over animal NPCs, like how common they spawn if possible, but also things like how fast they are, how sensitive to noise etc.

 

I know that all sounds like a lot, but even if you just manage one i'd be so happy, currently not using this mod specifically while I test others, but this was by far one of my all time favourites with how much control it gives, with other options and more variables it would be even more perfect. Thanks so much for all of your work here, it really is awesome to see in action, I ran most of the story with it, my first experience was hipfiring into a guy a few times with a revolver, he fell into a bush screaming and wiggling, sold me immediately.

Edited by Adman
Clarity etc
Link to comment
Share on other sites

  • 3 months later...

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

Link to comment
Share on other sites

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
  • Thanks 1
Link to comment
Share on other sites

Whoa, that's very helpful. It's working for me. I wanted to ask about your nice checker in code if it's a story npc. The problem is when you tweak AI_WEAPON_DAMAGE it somehow affects melee damage etc. But that's not the problem. I wanted to do the same thing but not with the health like in your mod but with the weapon damage: While Enemy,other npc's damage scaling increases, this value for your allies(story characters) remains the same. How can i express it in the code? Thanks
Edit:
Introducing this value makes everyone immortal including mc

ENTITY::SET_ENTITY_HEALTH(peds[i], ENTITY::GET_ENTITY_MAX_HEALTH(peds[i], 0), 0); <-where does this line lead and what values should i enter here? The last zero should remain zero if i got it right from db
Edited by Wengu4
Link to comment
Share on other sites

5 hours ago, Wengu4 said:

Whoa, that's very helpful. It's working for me. I wanted to ask about your nice checker in code if it's a story npc. The problem is when you tweak AI_WEAPON_DAMAGE it somehow affects melee damage etc. But that's not the problem. I wanted to do the same thing but not with the health like in your mod but with the weapon damage: While Enemy,other npc's damage scaling increases, this value for your allies(story characters) remains the same. How can i express it in the code? Thanks
Edit:
Introducing this value makes everyone immortal including mc


ENTITY::SET_ENTITY_HEALTH(peds[i], ENTITY::GET_ENTITY_MAX_HEALTH(peds[i], 0), 0); <-where does this line lead and what values should i enter here? The last zero should remain zero if i got it right from db

 

As stated above, you have to check if the ped is human and if its not the player.

Also if you set the health each loop, every NPC will get their health set all the time.

Solution (dont just copy the code, please read it and try to understand the problem and the solution):

//before loop
int health = 100;

//in loop
if (ENTITY::GET_ENTITY_MAX_HEALTH(peds[i], 0) != health)
{
	ENTITY::SET_ENTITY_MAX_HEALTH(peds[i], health, 0);
	ENTITY::SET_ENTITY_HEALTH(peds[i], ENTITY::GET_ENTITY_MAX_HEALTH(peds[i], 0), 0);
}

 

For figuring out if the current ped is a story character, I check the ped model with IS_PED_MODEL.

For example, if you want to check if the current ped you have in peds is John Marston, you would use the native like this:

PED::IS_PED_MODEL(peds[i], GAMEPLAY::GET_HASH_KEY("CS_johnmarston"));

And it would return true if this model is being used by the ped and false if its not.

Edited by HughJanus
Link to comment
Share on other sites

  • 4 months later...
  • 1 year later...
On 4/27/2021 at 9:50 PM, Wicker said:

If your cores are draining much faster with this mod, and so you have to eat far more often, wouldn't that inevitably make Arthur overweight? Is there any way to stop that?  

I'm just now trying it and yes he's fat af now. You ever hear of a fix for that?

Link to comment
Share on other sites

  • 4 months later...

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.

 Share

×
×
  • Create New...