Jump to content

Recommended Posts

Posted

Some NPCs cant be targetted (e.g. the kids in saint denis, gang members, etc.) - is there a way do circumvent that?

Posted

use the fight club mod and just fight like micah or someone that ur not supposed to kill and afterwards you should be able to kill alout of unkillable npcs, works for me atleast

  • Thanks 1
Posted
  On 8/4/2020 at 6:41 AM, Terry13143 said:

Maybe you can try this

 

Expand  

 

I already tried this:

ENTITY::SET_ENTITY_CAN_BE_DAMAGED_BY_RELATIONSHIP_GROUP(ped, true, PED::GET_RELATIONSHIP_BETWEEN_PEDS(playerPed, ped));

 

But it didnt work. Do you know which int to put as the last parameter?

Posted

It depends on the NPC. For most of them, changing yours or their relationship group or the relationship between groups is enough. For some, such as kids, it requires (at least according to my testing) some binary patching.

Posted
  On 8/9/2020 at 11:29 PM, LMS said:

It depends on the NPC. For most of them, changing yours or their relationship group or the relationship between groups is enough. For some, such as kids, it requires (at least according to my testing) some binary patching.

Expand  

 

Thats what I tried with ENTITY::SET_ENTITY_CAN_BE_DAMAGED_BY_RELATIONSHIP_GROUP(ped, true, PED::GET_RELATIONSHIP_BETWEEN_PEDS(playerPed, ped));

How is it supposed to be done?

Posted

You need to change their actual relationship group or change the relationship between groups.

Posted

@LMS But how? I have tried these already:

 

if (PED::GET_RELATIONSHIP_BETWEEN_PEDS(playerPed, peds[i]) == 0) PED::SET_RELATIONSHIP_BETWEEN_GROUPS(255, PED::GET_PED_RELATIONSHIP_GROUP_HASH(playerPed), PED::GET_PED_RELATIONSHIP_GROUP_HASH(peds[i]));
if (PED::GET_RELATIONSHIP_BETWEEN_PEDS(playerPed, peds[i]) == 0)
{
	PED::CLEAR_RELATIONSHIP_BETWEEN_GROUPS(0, PED::GET_PED_RELATIONSHIP_GROUP_HASH(playerPed), PED::GET_PED_RELATIONSHIP_GROUP_HASH(peds[i]));
	PED::SET_RELATIONSHIP_BETWEEN_GROUPS(255, PED::GET_PED_RELATIONSHIP_GROUP_HASH(playerPed), PED::GET_PED_RELATIONSHIP_GROUP_HASH(peds[i]));
}
if (PED::GET_RELATIONSHIP_BETWEEN_PEDS(playerPed, peds[i]) == 0)
{
	PED::CLEAR_RELATIONSHIP_BETWEEN_GROUPS(0, PED::GET_PED_RELATIONSHIP_GROUP_HASH(playerPed), PED::GET_PED_RELATIONSHIP_GROUP_HASH(peds[i]));
	PED::SET_RELATIONSHIP_BETWEEN_GROUPS(255, PED::GET_PED_RELATIONSHIP_GROUP_HASH(playerPed), PED::GET_PED_RELATIONSHIP_GROUP_HASH(peds[i]));
	ENTITY::SET_ENTITY_CAN_BE_DAMAGED_BY_RELATIONSHIP_GROUP(peds[i], true, PED::GET_RELATIONSHIP_BETWEEN_PEDS(peds[i], playerPed));
}

 

I have done testing on what the relationships are. They seem to have stayed the same as in the GTA 5 documentation:

0 = Companion

1 = Respect

2 = Like

3 = Neutral

4 = Dislike

5 = Hate

255 = Pedestrians

 

None of my above solutions allowed me to hurt gang members.

Posted

I have not messed with gang members, but to be able to shoot cops it worked when changing relationship between REL_PLAYER and REL_COP or by changing the player relationship group or the cop relationship group via SET_PED_RELATIONSHIP_GROUP_HASH. Have you tried that one?

Posted
  On 8/12/2020 at 9:36 PM, LMS said:

I have not messed with gang members, but to be able to shoot cops it worked when changing relationship between REL_PLAYER and REL_COP or by changing the player relationship group or the cop relationship group via SET_PED_RELATIONSHIP_GROUP_HASH. Have you tried that one?

Expand  

 

No, havent tried this one yet. I hoped to achieve that only the player can harm certain NPCs and change no other relationships. I dont know what it would do if I e.g. put the player in a different group or the gang in a different group. I suppose that would cause a high risk for behavioral bugs.

How do you know the names REL_PLAYER and REL_COP and where do you put them? They dont count as group hashes, I suppose?

Do you have any other group names?

Posted

You can find all the default information in update/common/data/relationships.meta including all groups and their relationships. Since you set the relationship group per ped, it is definitely worth trying to work with it. We did it for RDRFR and it seems fine for the most part.

  • Like 1
Posted (edited)

So, I have given it another try. The relationship stuff seems to work. I set the relationship between the player and the van der linde gang to respected (in both ways).

Now if I aim at a gang member, they become aggressive and start shooting after a while. Yet I still cant pull the trigger when aiming at them. There seems to be something else blocking me from targetting them. I can hurt them with dynamite if I throw it close enough, but I can never aim at them and pull the trigger.

More testing will be required to solve this. I will keep you updated.

 

Edit: all the natives with "target" in them didnt work. I searched the GTA 5 natives for clues and found "SET_CAN_ATTACK_FRIENDLY" (https://runtime.fivem.net/doc/natives/?_0xB3B1CB349FF9C75D). Maybe this is the method to use? We havent found that one in RDR2 yet, unfortunately.

 

Edited by HughJanus
  • 9 months later...
Posted
  On 6/17/2021 at 10:49 AM, Aztec2012 said:

Any news about this?

Expand  

 

This is how we did it (only for Van Der Linde gang):

if (friendlyfirebool)
{
	if (PED::GET_RELATIONSHIP_BETWEEN_GROUPS(GAMEPLAY::GET_HASH_KEY("PLAYER"), GAMEPLAY::GET_HASH_KEY("REL_GANG_DUTCHS")) == 2)
	{
		PED::SET_RELATIONSHIP_BETWEEN_GROUPS(0, GAMEPLAY::GET_HASH_KEY("PLAYER"), GAMEPLAY::GET_HASH_KEY("REL_GANG_DUTCHS"));
		PED::SET_RELATIONSHIP_BETWEEN_GROUPS(0, GAMEPLAY::GET_HASH_KEY("REL_GANG_DUTCHS"), GAMEPLAY::GET_HASH_KEY("PLAYER"));
	}
}
else if (!ffchangeexecuted)
{
	if (PED::GET_RELATIONSHIP_BETWEEN_GROUPS(GAMEPLAY::GET_HASH_KEY("PLAYER"), GAMEPLAY::GET_HASH_KEY("REL_GANG_DUTCHS")) != 2)
	{
		PED::SET_RELATIONSHIP_BETWEEN_GROUPS(2, GAMEPLAY::GET_HASH_KEY("PLAYER"), GAMEPLAY::GET_HASH_KEY("REL_GANG_DUTCHS"));
		PED::SET_RELATIONSHIP_BETWEEN_GROUPS(2, GAMEPLAY::GET_HASH_KEY("REL_GANG_DUTCHS"), GAMEPLAY::GET_HASH_KEY("PLAYER"));
	}
	ffchangeexecuted = true;
}

 

friendlyfirebool is the bool for indicating the features activation.

Since we have a toggle key for the feature, the key press affects a bool called ffchangeexecuted, so if friendly fire is disabled, you only set the setting back to standard once (and not each script iteration).

Posted (edited)
  On 6/22/2021 at 8:48 AM, HughJanus said:

 

This is how we did it (only for Van Der Linde gang):

if (friendlyfirebool)
{
	if (PED::GET_RELATIONSHIP_BETWEEN_GROUPS(GAMEPLAY::GET_HASH_KEY("PLAYER"), GAMEPLAY::GET_HASH_KEY("REL_GANG_DUTCHS")) == 2)
	{
		PED::SET_RELATIONSHIP_BETWEEN_GROUPS(0, GAMEPLAY::GET_HASH_KEY("PLAYER"), GAMEPLAY::GET_HASH_KEY("REL_GANG_DUTCHS"));
		PED::SET_RELATIONSHIP_BETWEEN_GROUPS(0, GAMEPLAY::GET_HASH_KEY("REL_GANG_DUTCHS"), GAMEPLAY::GET_HASH_KEY("PLAYER"));
	}
}
else if (!ffchangeexecuted)
{
	if (PED::GET_RELATIONSHIP_BETWEEN_GROUPS(GAMEPLAY::GET_HASH_KEY("PLAYER"), GAMEPLAY::GET_HASH_KEY("REL_GANG_DUTCHS")) != 2)
	{
		PED::SET_RELATIONSHIP_BETWEEN_GROUPS(2, GAMEPLAY::GET_HASH_KEY("PLAYER"), GAMEPLAY::GET_HASH_KEY("REL_GANG_DUTCHS"));
		PED::SET_RELATIONSHIP_BETWEEN_GROUPS(2, GAMEPLAY::GET_HASH_KEY("REL_GANG_DUTCHS"), GAMEPLAY::GET_HASH_KEY("PLAYER"));
	}
	ffchangeexecuted = true;
}

 

friendlyfirebool is the bool for indicating the features activation.

Since we have a toggle key for the feature, the key press affects a bool called ffchangeexecuted, so if friendly fire is disabled, you only set the setting back to standard once (and not each script iteration).

Expand  

 

I see. May be by adding some lines with other REL groups like REL_PLAYER_ALLY, REL_COMPANION_GROUP and some others we can make it working for all npcs? But i dont know how to implemet this script in to game.

Edited by Aztec2012
Posted

And i found file metapeds.ymt This file contains rel group for every npc in game. We can swap a hash walyes of this gropus between story and regular character if it works in game.

Posted
  On 6/22/2021 at 10:09 AM, Aztec2012 said:

And i found file metapeds.ymt This file contains rel group for every npc in game. We can swap a hash walyes of this gropus between story and regular character if it works in game.

Expand  

 

I dont know, you would have to try.

  • 5 months later...
Posted
  On 11/30/2021 at 2:58 AM, JustGotRdr2 said:

Im not good with coding and stuff so is their like a tutorial i can use or is there steps someone can tell me?

Expand  

 

There are a few good GTA 5 modding tutorials on youtube. They apply to RDR2 as well.

Here are some videos I started with almost two years ago:

https://www.youtube.com/watch?v=Oc16GjTfztQ

https://www.youtube.com/watch?v=pCIfZh0Lni4

 

  • 2 months later...
Posted

you can not kill children in this game how ever im pretty shure there is a mod that lets you kill kids but to kill gang member use the PDO mod and turn on friendly fire or if you cant mod very well get  dynamite or molotavs and throw it next to someone in your gang

 

  • 2 years later...
  • 3 weeks 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.

×
×
  • Create New...