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

HughJanus

Recognized Creator
  • Joined

  • Last visited

Everything posted by HughJanus

  1. I tried the following (adapted the construct to the parameters you posted further above): struct ScriptedSpeechParams { const char* speechName; const char* voiceName; alignas(8) int v3; alignas(8) Hash speechParamHash; alignas(8) Entity entity; alignas(8) BOOL v6; alignas(8) BOOL v7; }; static_assert(sizeof(ScriptedSpeechParams) == 0x38, "incorrect ScriptedSpeechParams size"); //declaring the line (taken out of a container) char* speechline = speechl_it->second; ScriptedSpeechParams params{speechline, 0, 0, 291934926, ped, NETWORK::NETWORK_IS_GAME_IN_PROGRESS(), 1}; AUDIO::x_PLAY_AMBIENT_SPEECH1(ped, &params); But unfortunately it didnt work. Then I tried it with the exact same construct, but different parameters: struct ScriptedSpeechParams { const char* speechName; const char* voiceName; alignas(8) int v3; alignas(8) Hash speechParamHash; alignas(8) Entity entity; alignas(8) BOOL v6; alignas(8) int v7; alignas(8) int v8; }; static_assert(sizeof(ScriptedSpeechParams) == 0x40, "incorrect ScriptedSpeechParams size"); //declaring the line (taken out of a container) char* speechline = speechl_it->second; ScriptedSpeechParams params{ speechline, 0, 1, 0x67F3AB43, 0, true, 1, 1 }; AUDIO::x_PLAY_AMBIENT_SPEECH1(ped, &params); Still threw an error. Then I used the exact same thing: struct ScriptedSpeechParams { const char* speechName; const char* voiceName; alignas(8) int v3; alignas(8) Hash speechParamHash; alignas(8) Entity entity; alignas(8) BOOL v6; alignas(8) int v7; alignas(8) int v8; }; static_assert(sizeof(ScriptedSpeechParams) == 0x40, "incorrect ScriptedSpeechParams size"); //declaring the line (taken out of a container) char* speechline = speechl_it->second; ScriptedSpeechParams params{ "RE_PH_RHD_V3_AGGRO", "0405_U_M_M_RhdSheriff_01", 1, 0x67F3AB43, 0, true, 1, 1 }; AUDIO::x_PLAY_AMBIENT_SPEECH1(ped, &params); Still didnt work. Then also tried this, but didnt work either: struct ScriptedSpeechParams { const char* speechName; const char* voiceName; alignas(8) Any a; alignas(8) Any b; alignas(8) Any c; alignas(8) Any d; alignas(8) Any e; }; static_assert(sizeof(ScriptedSpeechParams) == 0x38, "incorrect ScriptedSpeechParams size"); //declaring line (taken out of a container) char* speechline = speechl_it->second; ScriptedSpeechParams params{ speechline, 0, 0, 291934926, ped, NETWORK::NETWORK_IS_GAME_IN_PROGRESS(), 1 }; AUDIO::x_PLAY_AMBIENT_SPEECH1(ped, &params); I also tried it with the player Ped, but to no avail 😕 Edit: went through the decompiled scripts and found the following construct being filled this way (like you posted it): Param0 = uParam0 //ped ? struct<7> Var0; Var0.f_5 = 1; Var0.f_6 = 1; Var0 = sParam1; //speechline "RE_PH_RHD_V3_AGGRO" Var0.f_1 = sParam5; //voice "0405_U_M_M_RhdSheriff_01" Var0.f_2 = iParam6; //int 1 Var0.f_3 = iParam2; //int 1744022339 Var0.f_4 = uParam3; //ped ? Var0.f_5 = iParam4; //int 1 Var0.f_6 = iParam7; //int 1 PLAY_AMBIENT_SPEECH(Param0, &Var0); Havent used it successfully yet, though. Edit 2: using it like this and its not crashing anymore, but it doesnt happen anything either^^ (no speaking of peds): char* speechline = speechl_it->second; struct SpeechParams { char* speechline; char* voice; int i1; int i2; Ped p3; int i4; int i5; }; SpeechParams params{ "RE_PH_RHD_V3_AGGRO", "0405_U_M_M_RhdSheriff_01", 1, 291934926, ped, 1, 1 }; AUDIO::x_PLAY_AMBIENT_SPEECH1(ped, params);
  2. I wouldnt know how to do it. Someone here already said they tried to spawn different Arthur Peds after chapter 4, but he always has TB. Maybe we can find something when OpenIV releases a version with all files unhashed and modable.
  3. Thank you, I will try it and share the solution.
  4. Thanks, LMS! Gonna try it out soon. Edit: Just tried it and it didnt work the way I did it. Short summary: I use the script hook natives and the wrapper for the function looks as follows static BOOL _PLAY_AMBIENT_SPEECH1(Ped ped, char* speechName) { return invoke<BOOL>(0x8E04FEDD28D42462, ped, speechName); } I copied that and adjusted it static BOOL x_PLAY_AMBIENT_SPEECH1(Ped ped, boost::any p1) { return invoke<BOOL>(0x8E04FEDD28D42462, ped, p1); } I used the type "any" from the boost-library, so I didnt have to make my own^^ The code in my helper function looks as follows: void PedFear(Ped ped) { //container for speechlines std::map<int, char*> speech; speech[1] = "PANIC_HELP"; speech[2] = "GENERIC_FRIGHTENED_HIGH"; speech[3] = "GUN"; speech[4] = "GUN_RUN"; speech[5] = "INTIMIDATED_GEN"; speech[6] = "INTIMIDATED_AGAIN_GEN"; speech[7] = "PLEAD"; speech[8] = "SCARED_HELP"; //iterator for the container std::map<int, char*>::iterator speechl_it = speech.begin(); //numbers for randomizing the speech lines int linerand = 1 + (std::rand() % (speech.size() - 1 + 1)); int linecounter = 1; while (speechl_it != speech.end()) { if (linerand == linecounter) { char* speechline = speechl_it->second; boost::any var[7]; var[0] = speechline; // speechline var[1] = 0; // voice - Can be 0 var[2] = 0; // uparam5 var[3] = 291934926; // iparam11 var[4] = ped; // Ped target var[5] = NETWORK::NETWORK_IS_GAME_IN_PROGRESS(); // network is game in progress var[6] = 1; // bool at the end? AUDIO::_PLAY_AMBIENT_SPEECH1(ped, var); return; } linecounter++; speechl_it++; } } But in game the game throws a script hook error as soon as I activate the mod. Am I not allowed to use the "any" type from the boost library?
  5. It can be done with OpenIV quite easily, as soon as a proper version is out. For now you would have to catch the method trying to get the values and return them yourself (or find out where they are stored and replace them), I guess?
  6. Thanks a lot. I'll try that. What is the second argument? If the first is the container including the speech line and the ped, what is the second one? Also which container are you using? In C++ an array of type Any cant hold e.g. char*.
  7. 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?
  8. Those are the GTA V relationship integers, which seem to have stayed the same: 0 = Companion 1 = Respect 2 = Like 3 = Neutral 4 = Dislike 5 = Hate 255 = Pedestrians
  9. Nice to see youre starting to script stuff too!
  10. I was wondering if anybody knew how to make NPCs talk. I have been searching the game files with OpenIV and have found some speech samples I would like to use, but have no idea how. Under "x64\audio\sfx" there are multiple PED_XX.rpf files which hold awc files (for each NPC type like "white townfolk", there is a file) which again hold a lot of speech files. Those speech files have the same hashes/names throughout the different NPC types, so there must be a generic option of calling them (like the PLAY_PAIN - which automatically plays the pain sound fitting the NPC). Does anybody know which natives to use and how to use them to get NPCs to speak (like saying "Piss off!" or some other generic lines)?
  11. @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.
  12. 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?
  13. @Adman The stumbling when shot thing is describing the behavior when the health of an NPC is under the dying movement threshold, but it is still standing. If the chance for euphoria stumbling is 0, they will just more or less drop (within one or two steps) - if euphoria stumbling is at 100, they will receive a slight push every millisecond, so they stumble for a longer time (doing more steps), but that stumbling is based on the euphoria behavior when pushed (they will grab their wound and stumble around). The leg injury stumbling is a totally different mechanic. The cower and hands up reactions remain until their health has been decreased by some points (= they get shot) - then they will flee. If you dont hurt them in cowering or hands up, they should stay that way.
  14. @Adman Thanks for sharing your findings! The mod does not affect animals at all (no matter what you set) - there is a check if you are currently aiming at an animal and if you do, all damage settings are temporarily undone. Also the body part specific damage only applies to NPCs. As for the regeneration rate - I will take a look into it.
  15. Please share your findings. I would guess its the number of NPCs affected, but thats only a guess. There is no proper documentation, so I dont know :/
  16. I really dont know. Since I dont have performance problems, I cant say what works. I would start with a low number like 10 or so, then check if it even brings any fps. If it does, work your way up until you get the fps you are willing to sacrifice. And please share your findings. Since none of our testers have performance problems, we couldnt really test this parameter.
  17. @joshmcdanie1s I would set it to 10 or so. Since there is no proper documentation for these methods, one can only guess what they do. I would guess, since I have to pass a container and an integer to the method, that the integer is the number of NPCs the method puts into the container. So the "ModEffectRange" would be the number of affected NPCs by the mod.
  18. 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?
  19. @Barnaby@joshmcdanie1s Attached you can find a testing build with the parameter "ModEffectRange" in the ini. Could you try lowering this and check if it helps? Could be that its still buggy, though. Havent had much time to test it. PDO_v1.48b17.zip
  20. Thanks, but I would like to know how to do it in code, so I dont have to rely on other mods.
  21. Some NPCs cant be targetted (e.g. the kids in saint denis, gang members, etc.) - is there a way do circumvent that?
  22. I checked the "lasso of healing" mod and it says that it needs scripthook .net. So the problem is pretty obvious - you need scripthook .net and not script hook or rph. As far as I can see, the .net has not been updated.
  23. There is a simple "display_text" method in the script hook devkit, but I dont know about the .net script hook.
  24. I never had a scripts folder for ScriptHook. I know it from GTA 5, but that was ScriptHook .NET.

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.