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 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.
  2. Afaik the compatibility issue is between ABs script hook and RPH. To solve it for this mod would mean to completely rewrite the mod in C# and make use of RPH instead of ABs script hook (which would be a whole load of work^^).
  3. We use SET_ENTITY_HEALTH and SET_ENTITY_MAX_HEALTH.
  4. OK, thank you. I hope I will have enough time tomorrow to properly take a look at the problem. Edit: Another try for a quick fix (see attached). PedDamageOverhaul.asi
  5. Thank you for always reporting back! PlayerInvincibility only affects the player. This bug has something to do with the NPC tasks. I hope we found it now^^ PedDamageOverhaul.asi
  6. I only tested for about 5mins, so there is a high chance I have missed something. Dont they go into dying states anymore? Because they did for me. Edit: Thanks to some more testing by the mod team, we were able to fix the bug. Please further test this version (see attached). PedDamageOverhaul.asi
  7. Yes, in principle. But there are certain named NPC enemies which also get this higher amount of health (because they are not supposed to die during gameplay and if they do, the mission fails).
  8. The NPCs who survive 4 to 5 shots, are those friendly NPCs or do you mean enemies? StoryNPCHealth is mostly for friendly NPCs (and some others, so no missions are bugged).
  9. I dont know what vanilla health is for story NPCs, but I guess 450 would be around 4.5x more health, yes. It is for making story NPCs not die so soon from increased NPC weapon damage. The Weapon Modifiers have been reduced, so NPCs dont go into dying states from one shot of a badly maintained revolver (NPCs do have more health, but there is also the dying states which effectively make NPCs have less health). The depletion added by the mod is not calculated into those values from the character screen. Here is a version in which no knockout should ever lead to death (see attachment) - please test. PedDamageOverhaul.asi
  10. Here is one without the NPC tasks visualized (see attachment). You can already adjust the horse health in the ini. CoreDepletionAmount and CoreDepletionTime have no vanilla value, they occur in addition to the vanilla core depletion (so vanilla would be to turn them off). PedDamageOverhaul.asi
  11. Here is the latest testing build. Please share any bugs or other findings in this thread, so we can address them. @KentangBayangan Since we cant reproduce the fps issues, it is hard to nail this down. Reworking everything would take so much time that we could release v1.50 maybe in April of next year (since I am the only active programmer working on the mod and we only have one active tester and we both dont have a lot of time). Ill put it on our to do list, but dont count on it coming any time soon :/ PedDamageOverhaul.ini PedDamageOverhaul.asi
  12. Lower ModEffectRange in the ini. If you only want the accuracy feature, just disable the rest in the ini.
  13. Thats unfortunate :/
  14. 582 and 594 seem to be fleeing tasks. When someone is drawing his weapon and fighting me, there are tasks in this order: 343, 355, 364 and 428 (I think the 428 is the fighting one, the others are for drawing guns or going into some stance, I suppose). When NPCs are walking around and I shoot them, tasks I get are 47 and 320 (I guess 320 is the walking one and 47 is being hit or so?). Have not found the bleeding one yet 😕 Edit: 603 seems to be writhing on the ground. 121 is in a chain of multiple tasks when someone is dying. 608 seems to be the last task in a chain when dying on the ground while writhing. When someone is burning, its 39 then 588. I suppose bleeding out (at least some versions of them) is one of those: 56, 57, 243 (more tests necessary, though - cant say anything right now) Here is the code for drawing the tasks on screen, in case anyone wants to try stuff (draws a list of tasks on the screen, the ped you are aiming at is doing): char c[40]; std::string text = "NPC Task ID: "; Player player = PLAYER::PLAYER_ID(); Ped playerPed = PLAYER::PLAYER_PED_ID(); strcpy(c, text.c_str()); DrawText(0.15, 0.15, c); if (WEAPON::IS_PED_WEAPON_READY_TO_SHOOT(playerPed)) { Entity playerTarget; if (PLAYER::GET_ENTITY_PLAYER_IS_FREE_AIMING_AT(player, &playerTarget)) { for (int g = 0; g < 999; g++) { if (g != 582 && g != 594 && AI::GET_IS_TASK_ACTIVE(playerTarget, g)) { if (text.find("," + std::to_string(g) + ",") == string::npos) { if (text == "NPC Task ID: ") text += std::to_string(g); else text += "," + std::to_string(g); strcpy(c, text.c_str()); DrawText(0.15, 0.15, c); } } } } } Edit 2: Could it be that there is no task for the artery shot behavior? It seems to me that every time I think I have the right task id, it turns out not being it^^
  15. We wanted to release v1.50 on the coming weekend, but cant find the time to test it. Currently only one guy (our nexus uploader) is testing it and he cant do it all by himself, so its not looking like we can release it on the weekend. However, here is our latest testing build, for those of you who dont mind little bugs or untweaked settings. PedDamageOverhaul.ini PedDamageOverhaul.asi
  16. Do we know what the task for the arterial bleeding stumbling is? (I want to check if a ped is in this bleeding mode) What does this mean: CTaskPersistentCharacter
  17. Hello Peter, welcome. Looking forward to trying out your future creations :)
  18. Thanks for clarifying. @lininop Are you using this trainer?
  19. Thats weird. Maybe because the task id for being hogtied changed. I will try to fix it in the next version (cant reproduce it though, so I dont know if its really fixed).
  20. OK, so I tested it (didnt have much time, though) and I think it works. I used the voice and the line you gave me and tried it in Blackwater with the 7 seconds delay. Only very few NPCs spoke the line (I suppose those who have this voice). Thanks for clearing things up! Unfortunately, this non-generic version does not help me. Maybe I can find some workaround, since it seems the voices have similar names to the NPC models? Edit: @Lambda LMS wrote a few posts back, that they implemented a method in the RagePluginHook where they dont pass a voice name and the native still works (with the respective voice of the ped passed to the function). Do you know how this could work in C++? Edit 2: Soooo, I tried a few things and this seems to work struct ScriptedSpeechParams { const char* speechName; const Any* 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; }; void PedFearTest(Ped ped) { string speechline = "LAW_HAIL"; ScriptedSpeechParams params{ speechline.c_str(), 0, 1, 0x67F3AB43, 0, true, 1, 1 }; AUDIO::x_PLAY_AMBIENT_SPEECH1(ped, (Any*)&params); } I picked the line "LAW_HAIL" because a lot of NPCs seem to have it and also there are two versions of it (LAW_HAIL_01, LAW_HAIL_02). What's curious is, that only very few NPCs actually play that line (although I try to trigger it for each NPC) and they seem to repeat the same line over and over, so no switching between the two versions. If I use "LAW_HAIL_01" or the other one, nothing happens. I will try a bit more in the coming weeks and see if can get every NPC to speak. If you have more wisdom to drop on me, please do so. Thanks for all the help until now, guys! Edit 3: Had a faulty code part in my loop. Now everything works as intended (except for the thing where NPCs only speak one version of the line over and over again - so still no way to trigger LAW_HAIL_02). Thank you 🙂
  21. Sorry, friend. But the time we can spare, we use to implement the features for v1.50. I can put your wish on our to do list, but I cant say when we will be able to implement it (so you will get it faster if you do it yourself, either by configuring the ini or making your own asi).
  22. @Lambda I didnt have much time yesterday, so I just quickly adjusted the helper file and didnt fiddle with the main script at all (and apparently overlooked that I forgot to change the bool to void. The main script I posted here, was not copied and pasted, but I typed the stuff in here. The timer checkings are done before the ped loop, I dont know why I typed it that way yesterday, I just wanted to demonstrate what I do with your code. I will try to optimize the thing on the weekend and get back with the results. Please keep in mind, that I am a noob and do not code professionally. Thanks for responding so quickly! Edit: Is there a way to make NPCs speak each with their own voice (so a generic value for the voice parameter)?
  23. @Lambda OK, so I tried it now and my code looks as follows; Helper file: 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; }; void PlayAmbientSpeech(Ped ped, std::string speechline, std::string voice) { ScriptedSpeechParams params{ speechline.c_str(), voice.c_str(), 1, 0x67F3AB43, 0, true, 1, 1 }; AUDIO::x_PLAY_AMBIENT_SPEECH1(ped, (Any*)&params); } bool PedFearTest(Ped ped) { PlayAmbientSpeech(ped, "FAREWELL_NO_SALE", "0078_U_M_M_BLWTRAINSTATIONWORKER_01"); } Adapted native function wrapper: static BOOL _PLAY_AMBIENT_SPEECH1(Ped ped, char* speechName) { return invoke<BOOL>(0x8E04FEDD28D42462, ped, speechName); } static BOOL x_PLAY_AMBIENT_SPEECH1(Ped ped, Any* p1) { return invoke<BOOL>(0x8E04FEDD28D42462, ped, p1); } Main method (the relevant parts): int yolo = 0; while (true) { const int ARR_SIZE = 1024; Ped peds[ARR_SIZE]; int count = worldGetAllPeds(peds, ARR_SIZE); for (int i = 0; i < count; i++) { if (yolo < GAMEPLAY::GET_GAME_TIMER() && peds[i] != PLAYER::PLAYER_PED_ID()) { PedFearTest(peds[i]); yolo = GAMEPLAY::GET_GAME_TIMER() + 7000; } } } So what it should do is make the NPCs say the speech line every 7 seconds, but unfortunately it isnt working. Does the line only work for the ped model belonging to the voice? I tried setting the voice to 0, but that crashes script hook.
  24. The modding team does not have the time at the moment to implement special requests. However, if you want to look at the source code, you can find the part which is in charge of the burning stuff pretty easily (its all commented) - just delete all the rest and compile it. You might need to do some error catching, if you delete all the rest, but it wont take you more than one or two hours I would guess (if youre not familiar with the source code already, that is).
  25. First off, thanks for responding! Which entity plays the speech if none is passed to the function? Edit: Oh, the one which is passed to the native function?

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.