HughJanus 244 Posted August 3, 2020 Posted August 3, 2020 Some NPCs cant be targetted (e.g. the kids in saint denis, gang members, etc.) - is there a way do circumvent that? Quote
demoxe 1 Posted August 3, 2020 Posted August 3, 2020 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 1 Quote
HughJanus 244 Posted August 4, 2020 Author Posted August 4, 2020 Thanks, but I would like to know how to do it in code, so I dont have to rely on other mods. Quote
HughJanus 244 Posted August 4, 2020 Author Posted August 4, 2020 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? Quote
LMS 681 Posted August 9, 2020 Posted August 9, 2020 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. Quote
HughJanus 244 Posted August 10, 2020 Author Posted August 10, 2020 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? Quote
LMS 681 Posted August 10, 2020 Posted August 10, 2020 You need to change their actual relationship group or change the relationship between groups. Quote
HughJanus 244 Posted August 12, 2020 Author Posted August 12, 2020 @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. Quote
LMS 681 Posted August 12, 2020 Posted August 12, 2020 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? Quote
HughJanus 244 Posted August 14, 2020 Author Posted August 14, 2020 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? Quote
LMS 681 Posted August 14, 2020 Posted August 14, 2020 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. 1 Quote
HughJanus 244 Posted August 15, 2020 Author Posted August 15, 2020 Thank you, I will try it and share the solution. Quote
HughJanus 244 Posted August 21, 2020 Author Posted August 21, 2020 (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 August 21, 2020 by HughJanus Quote
HughJanus 244 Posted June 22, 2021 Author Posted June 22, 2021 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). Quote
Aztec2012 0 Posted June 22, 2021 Posted June 22, 2021 (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 June 22, 2021 by Aztec2012 Quote
Aztec2012 0 Posted June 22, 2021 Posted June 22, 2021 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. Quote
HughJanus 244 Posted June 24, 2021 Author Posted June 24, 2021 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. Quote
JustGotRdr2 0 Posted November 30, 2021 Posted November 30, 2021 Im not good with coding and stuff so is their like a tutorial i can use or is there steps someone can tell me? Quote
HughJanus 244 Posted November 30, 2021 Author Posted November 30, 2021 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 Quote
ptilson11alt 0 Posted February 24, 2022 Posted February 24, 2022 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 Quote
Zenzy 0 Posted November 25, 2024 Posted November 25, 2024 can anyone here help me with doing this, i only want it for the van der linde gang Quote
Aztec2012 0 Posted December 17, 2024 Posted December 17, 2024 From what file is SET_ENTITY_CAN_BE_DAMAGED_BY_RELATIONSHIP_GROUP? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.