HughJanus 244 Posted January 7, 2020 Share Posted January 7, 2020 (edited) Hey dear RDR 2 community, introduction: over the weekend I set up a development environment for RDR 2 and have played around with C++ scripts (asi) a bit. When I was studying years ago, I learned programming in Java and scripting in Python, so I am not completely new to coding. I managed to make NPCs take more bullets by playing around with their health values, but have not come very far in what I actually wanted to do. goal: my goal is to make NPC behavior more dynamic and also realistic. If I shoot NPCs in the legs, they shouldnt be able to sprint for cover (just as an example). I have yet to find out how to trigger a certain behavior (e.g. limping, lying on the floor, bleeding, etc.). In GTA 5 there was a "writhe mode" -> NPCs which had a certain amount of health entered that state in which they squirmed on the ground and could be killed by 1 shot. It seems that in RDR 2 it is the same thing. I dont want that. I want them, for example, to go down and still be able to take some bullets (so e.g. if I shoot their legs multiple times, so they have to go down, their friends should still be able to help them). problem: I would like to know how to trigger certain states (wounded, limping, etc.) and how I can circumvent the "writhe mode" (but still have NPCs play that animation, but without dying after taking 1 hit). Is this knowledge already available? I would really love to get into modding RDR 2! 🙂 Any help is much appreciated. BR HJ Edited January 7, 2020 by HughJanus 1 Quote Link to comment Share on other sites More sharing options...
LMS 673 Posted January 8, 2020 Share Posted January 8, 2020 I would assume it is easiest to override the movement clipset for the peds to achieve a limping effect (it worked reasonably well for V), but I am not sure what has been discovered in that area. As for writhe, perhaps try to use and then make them invincible? Not sure if that works or if the dying is hardcoded afterwards, but might be worth a shot. Quote Link to comment Share on other sites More sharing options...
HughJanus 244 Posted January 9, 2020 Author Share Posted January 9, 2020 Thanks for the response! I have already tried setting their entity_health to something as high as 5000, but unfortunately they still died with one shot. I will try invincibility on the weekend, thanks! As for overriding the movement clipset: I have searched the native database already for a lot of keywords (like "limp", "injured", "wound", etc.) but to no avail. Where would I find those movement sets (do they have names like "set_movement_for_ped(int movementID, ped pedID)")? Or does it mean that they have not been discovered, if I havent found them by those words? Quote Link to comment Share on other sites More sharing options...
LMS 673 Posted January 9, 2020 Share Posted January 9, 2020 That is the name for V more or less (SET_PED_MOVEMENT_CLIPSET), so it probably got renamed/reworked a bit in RDR2. I don't know if such a native has been discovered already unfortunately. Quote Link to comment Share on other sites More sharing options...
HughJanus 244 Posted January 10, 2020 Author Share Posted January 10, 2020 (edited) Ah, I see. I found SET_PED_COMBAT_MOVEMENT in the nativeDB and I suppose the movement IDs will be known as soon as we have a working version of OpenIV? Thanks for all your help! Edit: I now tried the following Player player = PLAYER::PLAYER_ID(); Ped playerPed = PLAYER::PLAYER_PED_ID(); const int x = 1024; Ped peds[x]; int count = worldGetAllPeds(peds, x); for (int i = 0; i < count; i++) { if (peds[i] != playerPed) { if (PED::IS_PED_HUMAN(peds[i]) && (PED::GET_PED_MAX_HEALTH(peds[i]) != pedhealth)) { PED::SET_PED_MAX_HEALTH(peds[i], pedhealth); ENTITY::SET_ENTITY_HEALTH(peds[i], pedhealth, 0); } if (AI::IS_PED_IN_WRITHE(peds[i])) ENTITY::SET_ENTITY_INVINCIBLE(peds[i], true); } } I inserted the first "if" to check if any of this is working - and it does (peds can take more bullets). But unfortuanely writhers still die (from bleeding out or one shot). I guess I'll have to wait until the movement IDs get figured out and then override the usual behavior when peds are hit in certain bones. Edited January 10, 2020 by HughJanus new information Quote Link to comment Share on other sites More sharing options...
Sam 298 Posted January 10, 2020 Share Posted January 10, 2020 7 hours ago, HughJanus said: Ah, I see. I found SET_PED_COMBAT_MOVEMENT in the nativeDB and I suppose the movement IDs will be known as soon as we have a working version of OpenIV? If it is the same as GTA V, SET_PED_COMBAT_MOVEMENT doesn't have anything to do with animations and instead determines how much the ped moves around while in combat. If you set this to 0, for example, they will generally stand still while shooting. I think setting it to 1 or 2 increases the amount that they'll move, flank, etc. Quote Link to comment Share on other sites More sharing options...
HughJanus 244 Posted January 10, 2020 Author Share Posted January 10, 2020 Thank you. Is there any database for GTA V from which we could draw the SET_PED_MOVEMENT_CLIPSET method idea and some values for clipsets? Quote Link to comment Share on other sites More sharing options...
LMS 673 Posted January 13, 2020 Share Posted January 13, 2020 On 1/10/2020 at 9:24 PM, HughJanus said: Thank you. Is there any database for GTA V from which we could draw the SET_PED_MOVEMENT_CLIPSET method idea and some values for clipsets? I think googling for the native is probably the easiest to find some GTA V snippets for it. Quote Link to comment Share on other sites More sharing options...
HughJanus 244 Posted January 13, 2020 Author Share Posted January 13, 2020 Hm, ok thanks. Quote Link to comment Share on other sites More sharing options...
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.