Posted August 3, 20204 yr Some NPCs cant be targetted (e.g. the kids in saint denis, gang members, etc.) - is there a way do circumvent that?
August 3, 20204 yr 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
August 4, 20204 yr Author Thanks, but I would like to know how to do it in code, so I dont have to rely on other mods.
August 4, 20204 yr Author On 8/4/2020 at 6:41 AM, Terry13143 said: Maybe you can try this 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?
August 9, 20204 yr 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.
August 10, 20204 yr Author 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. 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?
August 10, 20204 yr You need to change their actual relationship group or change the relationship between groups.
August 12, 20204 yr Author @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.
August 12, 20204 yr 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?
August 14, 20204 yr Author 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? 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?
August 14, 20204 yr 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.
August 21, 20204 yr Author 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 August 21, 20204 yr by HughJanus
June 22, 20213 yr Author On 6/17/2021 at 10:49 AM, Aztec2012 said: Any news about this? 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).
June 22, 20213 yr 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). 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 June 22, 20213 yr by Aztec2012
June 22, 20213 yr 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.
June 24, 20213 yr Author 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. I dont know, you would have to try.
November 30, 20213 yr Im not good with coding and stuff so is their like a tutorial i can use or is there steps someone can tell me?
November 30, 20213 yr Author 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? 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
February 24, 20223 yr 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
November 25, 2024Nov 25 can anyone here help me with doing this, i only want it for the van der linde gang
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.