fitfondue
Members-
Posts
74 -
Joined
-
Last visited
-
Days Won
6
Content Type
Profiles
Forums
Gallery
Downloads
News Articles
Modding Wiki
RDR2 Native Database
RDR2 Native Parameters
RDR2 Player Clothes Database
RDR2 Ped Voices Database
RDR2 Ped Speech Lines
RDR2 Modding Tutorials
RDR2 Ped Model Database
RDR2 Animations Database
RDRFR Changelog
RDRFR Installation Guide
RDRFR Features
RDRFR Settings
LML User Contributions
Everything posted by fitfondue
-
-
-
@HughJanus You did it! Knockdowns are disabled on disarm now. One last thing that may be worth fixing, because only now do I realize it's a serious exploit (if compared to the vanilla game): Disarming every lawman makes it much easier to escape the law, because the game decides to spawn new lawmen depending on how many "police" radar blips are still in your vicinity. If you disarm every lawman or leave them in a dying state, they'll still show up as lawmen on the radar. So no new lawmen will show up until those radar blips disappear, giving the player a lot of time to escape the wanted area. I found a native that may or may not be helpful here: voidSET_POLICE_RADAR_BLIPS( BOOL toggle ) //0x6FD7DD6B63F2820E This may determine whether the ped reads as a lawman on the radar. If this status is disabled once the lawman is fleeing or enters the dying state, it may fix the exploit. I think Rockstar uses this native for that very purpose. Did you ever notice that, when a lawman is shot in the artery, they disappear as a radar blip? Because their death is certain, the game doesn't count them as a threat anymore so more lawmen can spawn in. Mind you, the game isn't realistic at all in this sense. The rate at which new lawmen spawn in to attack you is downright ludicrous. But since this mod isn't supposed to fix the law and order system, we should probably try to keep it intact. Disarming is already advantageous because it only increases your bounty by $5 (whereas killing the lawman increases it by $20). So to summarize: - Incapacitated lawmen (whether fleeing or dying) still count as police blips and thus prevent new lawmen from spawning in Another thing I noticed is that some lawmen aren't despawning after fleeing, and in fact they tend to come back to attack you with a knife. They revert to hostility, just like in the lasso disarm. The reason for this is probably that they don't flee far enough to despawn, so yeah, apparently this is an issue with bullet disarms too (and it's been an issue since the beginning; it just didn't show up clearly while I was testing, but looking back, it's apparently been here from the start). Some lawmen despawn, others come back to attack you. Can the peds be set to flee farther? The radar blip problem is the main issue here, though. If that's fixed, then the fleeing bug will be a very minor issue perhaps not worth fixing. So I suggest you look into the radar blip thing first to see if it's even possible. Also, we can leave these bugs to be fixed in 1.4, if you prefer. We can leave them as "known issues" in the description of 1.3.
-
@HughJanus I'll test 1.3b1 now! As for what you said: Do you think we should add the hands up, cower and aggressive behaviors for disarming via gun or should we leave them out? I think the aggressive behaviours were left in, weren't they? Enemies may still attack you after being disarmed via gun? As for the hands up and the cower, I think we should leave them out for now, because they look odd without better A.I. Enemies just stay with their hands up forever (which is weird and also affects lawman spawns) and I still don't know what the cower behaviour even looks like. I haven't seen anything that looks discernibly like cowering, so perhaps that behaviour just doesn't trigger for lawmen. I suggest we leave those behaviours out for now.
-
@HughJanus Fall damage: seems to be working! I tested it by setting NPC health to 1000 and throwing someone off the cliff near Valentine. At 1000 health it would normally be a survivable fall, but they died just like they would in vanilla, so it's working. Disarm Knockdown: seems to be rarer, but it's still happening frequently enough to be a problem. So it's not disabled yet. Invisible gun bug: happened only once in a ten-minute long gunfight. So it still happens. Whether or not it's really rarer now or whether I just got lucky remains to be seen 😄 Lasso disarms: fleeing seems to work properly now, lawmen spawn indefinitely. Only problem is, it may take multiple lasso throws to fully disarm a lawman. Sometimes they're not disarmed fully, sometimes they're not disarmed at all. I think being on a horse or in cover affects that. Normal NPCs may also attack the player instead of fleeing, but that's rarer than fleeing. Honestly? I'd call this feature "good enough" for now. No one's gonna go around lassoing lawmen during a firefight, and I'm more than okay with one NPC deciding to fight instead of flee every once in a while. As for player health, yeah, there's probably something special about it. It probably has to do with the health core, which I think acts as a multiplier of sorts over the player's health value. It may not be as simple as a single value. My suggestion: if you manage to disable the knockdown for disarms, I say we release this as version 1.3 and move all incomplete features to version 1.4. We've already made great progress: the staggering feature (force push), the disarming of any and all NPCs with lasso or bullet, fall damage being the same at any health value, damage-dependent stumbling, bleed-out timer, etc. etc. And it's all pretty stable and functional.
-
-
@HughJanusJust popping in to say that the new patch doesn't break Scripthook, and the mod continues to function normally. So if you or anyone here is worried about downloading the new update, don't be, it's fine (I don't know about .NET mods, though, but this isn't one of them). It does require downloading the new Nvidia driver plus the hotfix (without the hotfix, the game is likely to crash).
-
@HughJanus I tested a bug someone else pointed out on Nexus, and yep, it exists. PlayerHealth makes the player invincible at any value except 0. At 0, you can make the player take damage normally, but you can't make the player die with less damage. It's either vanilla health or invincibility. This is true for negative values also. Another thing about the lasso disarm: you could also consider it a very minor bug, because it occurs with lawmen, and there's very few reasons to lasso a lawman, especially during a firefight with the law. In order to make the bug happen, I had to lasso several lawmen during a firefight and let them flee. If a player is playing without invincibility on, lassoing lawmen during a firefight will get you killed in seconds. So it's an edge case. If you don't find an easy fix, I'd say it's not worth spending too much effort on it right now.
-
@HughJanus The lasso fleeing behavior is weird, because I use exactly the same native to make them flee Yeah, it's weird, for some reason the fleeing state just cancels out after a while and the NPC reverts to hostility. I will try your version of fall damage in the next version, but I dont know if it already counts as falling if an NPC is being shot and falling to the ground (thats why I chose the approach of decreasing health). The game seems to draw a distinction. The situation is tipically this: I set DyingThreshold so high the enemy dies in one shot. Let's say I shoot an enemy who's on a rooftop, and they stagger off the edge and fall. They're under the DyingThreshold, so after falling, they shouldn't be able to stand up again. But they do stand up. And this seems to be because the game goes "oh, he's straight up falling now, let's switch to the proper ragdoll behaviour". And this jolts the NPC out of your mod's ragdoll behaviour, much like grappling them on the ground does. They have to ragdoll again in order to stay down. Making fall damage the same regardless of health is a very good tweak to the code overall, but that "dying state cancel" bug (as I call it) may require a different solution to counteract it. Falls would have to be accounted for so your code can enforce the ragdoll after the dying state. But honestly, this is a very minor bug, and not worth dealing with right now in my opinion (unless it's an easy fix). Concerning the z-coords - I guess we just let it the way it is now (before the last two updates) and look at that topic again later. I agree. Actually, on 1.3a7 the force push was fine, so only the last update introduced problems. For making it impossible for disarming to trigger the knockback, I will have to do some work. I'll see how fast I can come up with that. No worries, take your time 🙂 For the next version I will also remove the hands up behavior for testing (but I dont suppose this is gonna solve it). I have an idea why this bug occurs: lawmen are usually hard to disarm when holding rifles and impossible to disarm when holding guns. When I force the disarming of a rifle, although it would not normally disarm, maybe the NPC still "thinks" it is holding a weapon..? (because maybe when disarmed with rifle, it automatically gets the gun) But thats just a guess into the blue^^ I don't think removing "hands up" is gonna solve it either, but it's worth checking, and at the very least it'll make it easier to test the problem. And hey, your suggestion makes a lot of sense: what if it's the BONE that leads to the disarm? I think your code is more "generous" with how many bones lead to a disarm, so the problem may be caused by a specific bone being hit. I'll test that possibility on the next version. There's a complicating factor, which is that the NPC DOES draw a revolver when they get to cover. In that situation, the game goes "whoops, NPC isn't holding a gun". But it doesn't realize that until the NPC goes into cover.
-
@HughJanus Correction: lasso disarms have new problems and aren't quite equivalent to bullet disarms yet. The most serious problem: - Fleeing lawmen don't despawn like in the bullet disarms. In fact, they seem to stop fleeing and turn back to hostility, however by the time they do it, they're so far from the player that they just stay still and prevent more lawmen from spawning in. If you open up the map, you'll see the lawmen standing still. If you go up to them, they'll attack you bare-fisted once they see you. And the minor bugs: - NPCs don't seem to pull out knives. They do sometimes attack bare-fisted. - There was one case in which a lawman did not let go of his revolver. But that seems quite rare.
-
@HughJanus removed chance for cowering in the disarming logic (replaced it with hands up, just for testing) -> so you can see if the invisible guns bug disappears The bug is still there, but now I understand it better. It only happens if the NPC is disarmed while still having a revolver in the holster. Here's what happens: 1 - The NPC is disarmed. 2 - The NPC decides to keep attacking. 3 - Instead of drawing their revolver, they "fire" an invisible gun. 4 - If that NPC makes it to cover, they'll draw their actual revolver and start firing real bullets. 5 - If there's no cover nearby, NPC will indefinitely "fire" an invisible gun. If you shoot them again, they're likely to flee. This doesn't happen in every occasion. Many times, an NPC will draw their actual revolver right away. But sometimes they'll do what I described above. It doesn't seem related to the knockback ragdoll. I disabled it entirely as a test and the bug kept happening. The hands-up animation also appeared normally every now and then, but it may be contributing to the bug somehow. My recommendation? We should debug the hands-up animation, just to be safe. If you remove it from the next build, I'll test to see if the bug is gone. If it's still there, we'll know for sure the conflict is somewhere else. z-coord of head: altered the check to this: the z-coord of the left and right calf are checked against the z-coord of the head bone minus the value of the ini parameter. If the calves are lower than the z-coord of the head bone minus the ini parameter, dyingpush is triggered. In code: if ((vec_calf_left.z < (vec_head.z - ini_zvaluehead)) && (vec_calf_right.z < (vec_head.z - ini_zvaluehead))) then do stuff ----> has to be tweaked, i havent done nothing in the ini yet Not working, in fact it's actually worse than before. ZValueForHeadBone somehow disables forcepush entirely, regardless of value. Positive, negative, 0, it's just fully disabled no matter what the value is. So yeah, in this version of the mod, there's just no force push. 😄 At this point I feel I should reiterate that the force push "twitching" is a fairly minor issue (most times it's not even noticeable), so if this is too much of a headache for now, I'm okay with not fixing it yet. We can temporarily ignore it. tried to reduce the knockbackchance when disarming (dont know if I can do it further without having to touch the normal knockback feature) This one's hard to judge. It SEEMS to be happening less frequently, but it's still happening quite frequently. For gameplay and pacing purposes, I think it would be best if knockback never happened when disarming, so in my opinion it's worth reworking the logic to make that happen. But you're the one doing the actual coding, so of course, it's up to you 🙂 if disarming-lasso is enabled, the disarmed NPCs should now also show the same behavior as when disarmed by gunshot Can confirm, it's working. disabled the stumbling when NPC is on mount Can confirm, it's working. for the falling I have added an ini parameter -> falldamage -> the value which is set, will be deducted from the NPCs health for every script loop (every ~millisecond) while the NPC is falling - maybe this way we can let them take proper fall damage The trigger is working, but may I suggest a different approach? Because this incremental damage while falling is likely to kill the NPC before they even hit the ground. So how about this: if NPC health > 100 when they fall, lower it to 100. And if it is already 100 or less, do nothing. That way you always ensure that the fall damage will behave like in vanilla, regardless of how high the player sets NPC health.
-
-
@HughJanusAddressing your points: Would it be better if disarmed enemies dont drop their guns, but they just disappear? Honestly, I prefer the guns still existing, even if they're missing parts. It makes the disarming more satisfying if the player sees something being shot out of the enemies' hands, and also it provides visual feedback. Makes it easier to tell that the enemy has been disarmed. Melee damage wasnt altered, but of course if their health is higher, they take longer to knock out with the same damage done by punches Oh! I thought melee damage was a separate thing. The disclaimer in this mod's description reads "DISCLAIMER: melee damage has not been altered, since fistfights will otherwise turn into an odyssey". That's why I mentioned it; I thought it wasn't intentional. Invisible guns dont come from cowering - I have tested the disarming feature before doing anything with the disarming behavior and they were partly invisible from the beginning (I think it has something to do with the guns parts - the ones you can modify seem to be invisible). Oh, what I call the "invisible gun bug" isn't the same as the guns missing parts: it's the NPCs behaving as if they have a gun without having a gun. Like, you disarm them and they keep acting as if they have a gun and are firing it at you, but there's no gun. That's what I think may be caused by a malfunction of the "cower" behaviour. Setting the running threshold to 30 at bothlegs hurts my heart, but I guess there wont be another option Yeah, I'd love it if the stumbling worked at walking speed, but more often than not it just causes glitches because there isn't enough momentum. The amount of force necessary to tip over an NPC who isn't running looks very unnatural. I think we might have to extend our excel so we can write down all the bugs and tackle them one by one. I did actually start listing the bugs for each feature on my comments today, but there are a few recurring bugs not mentioned there. I'll start a "Known Issues" column
-
@HughJanus Three additional bugs I encountered: 1 - Don't know if this is a bug or an intended feature, but melee damage is definitely altered. If NPCs have high health, melee fights will take very long, unless you pull the NPC into a low grapple and punch them repeatedly. The low grapple punch is hardcoded to knock out the enemy after a few punches, regardless of health. Otherwise, melee takes very long now. If the NPC health is set to vanilla 100, it works normally. 2 - The game doesn't deal very well with having a lot of NPCs in dying states, since they're in active ragdoll so the game has to keep running physics simulations on everyone. It also leads to the interaction bug I mentioned above: the dying NPCs are still hostile to you but incapable of moving, so the game keeps you in "hostile" mode until those NPCs die. In that mode, interactions are disabled. Since the enemies never die, the problem doesn't go away. For the sake of performance, it might be a good idea to have bleed-out activated by default, at a value that takes 30 seconds to 2 minutes to kill an NPC. That way it ensures that NPCs will, at some point, despawn, avoiding bugs and framerate dips. The .ini could still have the option to disable bleed-out, but with a warning that it might kill performance and cause bugs in large firefights. 3 - Minor bugs: some NPCs in knockdown/dying states will keep cocking their revolvers repeatedly, and will taunt you with the typical combat dialogue as if they're still up and shooting at you. Those bugs are not new nor do I consider them a priority, but they're worth mentioning.
-
@HughJanus I am very, very glad to report that you did it. Disarming works great now. Lawmen flee indefinitely and are appropriately despawned, so that new lawmen keep coming in naturally. And if a lawman decides to keep attacking you, disarming them again will often make them flee. The only outstanding bugs I've seen are the incomplete-looking guns that lawmen drop and (rarely) lawmen aiming invisible guns at you. Suggestions: - Removing cower behaviour to see if it fixes the invisible gun problem. It may be a result of the "cower" behaviour not being compatible with lawmen, so it malfunctions. I have yet to see a lawman cower (but they do put their hands up every now and then, so that is working properly). - Making dropped guns despawn after a minute or so, otherwise the minimap gets littered with gun icons, and they probably hurt the framerate over time. - Disabling knockdown states for the right arm and the gun. Right now, enemies will often go into the knockdown state and fall over after being disarmed. Not only does that look overdramatic given the wound, but it also makes the player wait in order to find out whether the enemy is going to flee or attack. Without the knockdown behaviour, the enemy instantly makes the decision, so you can disarm someone, instantly know whether or not they're still a threat, and move on to other enemies. As for the tackling bug: also fixed. You can tackle someone who's been shot in both legs now. Not always: if you screw up the timing, you can end up kicking them instead. But if you press F while they're not ragdolling, you'll tackle them with no problems. The only bugs: NPCs still "stumble" on horseback (yep, even with the checks in place. Apparently the game counts this as "running or sprinting") and RunningThresholdBothLegs=20 is still too low for gunfights. Somehow, enemies are still susceptible to that glitch I mentioned, the one where the force push makes them "twitch" (without ragdolling) while they're shuffling around firing at you. So my suggestions for this: - Checking to see if NPC is on horse and disabling stumbling entirely in that case - Maintaining a minimum of 30 for running thresholds to avoid the glitching. And finally, ZValueForHeadBone: still not working. At 0, it disables force push completely. At any positive OR negative value, it enables it completely. I tried a high range of values, from 1 to 350000 (both negative and positive). At no point was force push disabled. So that one's still a mystery. Regardless, amazing work! You pulled off an incredible feature that makes shootouts more complex and varied. 🙂 EDIT: By the way, I accidentally discovered a really cool feature: you can grapple someone who's in a knockdown or dying state. If you holster your weapon, lock on to the NPC and press E, Arthur will grab them in the low grapple position, and he can pull them up into the standing grapple and perform all the usual interactions. If they ragdoll again, they'll stay down, but until they ragdoll, they'll behave normally. It works surprisingly smoothly.
-
-
-
@HughJanusI just tested a bit more, and turns out the fleeing bug is more complicated than that. So a few additions to the video above (and then I'm done for the day 😄) - The fleeing bug apparently has to do with pathfinding as well. Just now I managed to pursue three lawmen who were running away from me (without stumbling). All three stopped dead when they came across an obstacle, such as a rock, a tree or the edge of a cliff. They were apparently incapable of running around stuff, they could only run in a straight line. Grabbing them and letting them go wouldn't cause them to resume fleeing. However, shooting them (i.e. causing them to ragdoll) made them flee again in a different direction (until they came across another obstacle). This explains why lawmen can apparently flee forever while stumbling: the ragdoll reorients them for some reason, making them pick a new direction free of obstacles. - I pursued two other lawmen who, for some godforsaken reason, DID flee around obstacles (without stumbling), and kept fleeing until they were unreachable. They did not stop more lawmen from spawning in. Those two lawmen behaved exactly the way the mod wants them to behave. No idea why. I didn't disarm them in a different way from the other ones, yet they knew how to run around obstacles, and they never stopped running until they disappeared from the minimap. So your code DOES work as intended sometimes, but I don't know what the trigger is. - I now know why that bug occurred at 01:31 in the video above. RunningThresholdBothLegs is interacting poorly with the tackle mechanic. During the tackle itself, the NPC speed is apparently higher than 20 and even 30, so the stumble mechanic kicks in mid-tackle. If RunningThresholdBothLegs is set to 50, it makes this much rarer (you can tackle the NPC if they're just about to start running again). So unless you can disable the stumble mechanic during a tackle, we may be unable to keep the RunningThresholdBothLegs under 50, unfortunately. Not without sacrificing the player's ability to tackle. As for the other things you said: - shooting without weapon in hand - no idea how I can circumvent that, I dont even know how that can happen^^ And I can't find a consistent trigger for it, so I guess for now we just live with it 😄 - headshots not killing - headshots do kill everytime if you hit the actual brain. If not, and the health is set high, it will only do more damage, not kill Oh! I get it now. I hadn't accounted for the higher health. - stumbling although not shot in leg - the mod checks for a damaged leg, so if an NPC falls down and hurts its leg, that counts too That's what I figured. I think I like that feature. 😄 - not fleeing after aggressive behavior and then being shot - that is the way it is now, the aggressive behavior is the standard behavior (which hits if the randomizer spits out a number above 74) - everything that happens here has nothing to do with the mod (except for the NPC being disarmed, which is not possible in vanilla) I mentioned it because of the health check you've coded, the one that compares the ped's current health with their health before being disarmed. "*check if any NPCs health you wrote down is now less* if so *make NPC flee*" I take it this doesn't work if the randomizer hits the aggressive (vanilla) behaviour, then? NPC not being disarmed despite having been shot in the hand - I dont know the IDs of all hand bones yet - I only have two finger bones of the right hand and the forearm - I currently dont have more - if you hit one of the unknown bones, nothing will happen Ah, I see. That makes sense.
-
@HughJanusI made another video, this time with text commentary, to better showcase and document the existing bugs with disarming (and some other bugs I happened to catch in the recording). There are timestamps in the description to make it easier to revisit different parts, and the title makes it clear which version is being tested.
-
@HughJanus I tested it. I've written the feedback below. My immediate recommendation is to disable everything EXCEPT fleeing when an NPC is disarmed, because the fleeing is indeed buggy and right now I can't test it properly because most times lawmen don't flee. They attack you or put their hands up. So in order to figure out what's causing this, it's best to force lawmen to always flee. I'll test the fleeing in a variety of circumstances to see if it's a distance problem or a pathfinding problem. Anyway, my feedback: - ZValueForHeadBone stops force push entirely if it's set to 0 or a negative value. If it's set to 1, force push continues regardless of where the NPC's head is. The value IS affecting the force push, but it seems that even 1 is too high, so the force push continues. - The force push method is working GREAT with knockdowns and dying state. Only problems: the twitching on the ground (which most times is REALLY hard to notice, so it's not a serious issue for now), NPCs are pushed mostly to their right (nothing new there, I showed this on video before) and they can get knockdowns from having their gun shot out of their hand, which is hilarious because that doesn't wound them, so it seems like they're falling over from sheer disbelief. You can almost hear them overdramatically say "OH MY GOODNESS ME". Still, enemy reactions look much, much better than they did in 1.2. They interact with scenery way more and tend to fall off edges, so shootouts are more cinematic. - Disarming in and of itself is working great, but everything around it is still buggy: 1 - Enemies do indeed stop fleeing. As mentioned above, I'll need to test the fleeing in different circumstances to figure out why that is. 2 - Disarmed NPCs do not necessarily disengage if their health keeps taking hits. I've seen many keep coming at me with a knife (and drawing multiple knives) despite me shooting them several times. Similarly, NPCs will keep their hands up forever, even after being shot. They'll get up again and raise their hands instead of fleeing. 3 - Sometimes they'll draw a knife and THEN put their hands up and stay still, while holding the knife. There's some weird overlap there. 4 - Enemies will keep moving as if they're holding a gun, shuffling around, "firing" at you, but without a gun in their hand. - Stumbling is great. My only suggestion is to make RunningThresholdBothLegs into 30 instead of 20, because 20 affects enemies who are firing at you, so they'll often glitch repeatedly as the force pushes them forward. A value of 30 ensures that doesn't happen, while keeping the stumbling just as frequent otherwise. Aside from that, it's pretty much as perfect as it can be right now. - Two related bugs. They're not new, so don't worry, your new code isn't causing this: enemies who are in cover are not affected by knockdowns or dying states. They're immune to ragdoll while in cover. Also, if an enemy falls from a certain height after entering the dying state, they'll get back up despite being under the DyingThreshold, because (I think) the fall jolts them out of your code's ragdoll. If they're shot again, they'll stay down. The latter bug can be seen at 1:18 on the video I posted. I shoot a guy on a roof, he falls, gets up again. But he shouldn't, because that shot put him under the DyingThreshold. As I said, those bugs are not new: I've been keeping an eye on them since 1.11, and I personally do not consider them a priority. I'm mentioning them just to establish that they're not caused by the code you've added in 1.2 and 1.3. - The interaction bug I described above is very inconsistent and apparently rare, and it might have been caused by the Never Wanted cheat that I use to test stuff without being attacked by lawmen. It seemingly has to do with non-lawmen enemies (who show up as a small red dot on the map) who keep shooting at you regardless of whether you're wanted or not. Even if you're far from them, the game reads your situation as dangerous so it disables interactions in favour of aggressive actions. If this bug shows up again, I'll try to document it better.
-
@HughJanus I agree wholeheartedly. Making lawmen disarmable is already a huge step forward. I think that, for 1.3, just making them flee or attack after being disarmed is enough. If I understand correctly, your code forces NPCs to flee if a certain health threshold is met? I'll go into the game now to test this more thoroughly, as well as finding out why the hell the interaction bug is happening.
-
@Maro Thanks for the video! I ran into that bug myself. @HughJanus I found time for a quick test run (I'll still do a more thorough test tomorrow). Amazing work on the disarming feature! It doesn't always work (depends on how you hit the arm) but mostly it does. I think the hitboxes could be more generous (basically, anywhere on the right arm should cause the gun to drop, from fingers to almost the shoulder) and reactions need some work (it looks weird for a lawman to remain indefinitely in the hands-up animation in the middle of a firefight). Here's what I have in mind. I don't know how viable this is, but here goes: THE FEATURE: - Disarmed ped (from now on called DP) enters hands-up animation UNLESS there's a firefight going on, at which point they may either flee or attack you (with bare fists, a knife or a second gun). CHECKS: - Check how many peds are around in a 20-meter radius - Check how many of those peds are hostile to player. If that's not possible, check how many have their guns out (because that usually happens when the player provokes it). - Check how close the player is to DP - Check whether player is aiming at DP - Probably fourteen other checks I'm not thinking of because I'm atrocious at coding. LOGIC: - After being disarmed, the DP will enter the hands-up animation, and they'll only flee once the player leaves the area or uses the "defuse" interaction prompt. - However, if there are more than 5 peds in a 20-meter-radius, the DP will only keep their hands up if you keep aiming at them. If you stop aiming at them for more than, say, 4 seconds, they'll lower their hands and flee. The reason for this is that they're in a populated area with plenty of eyewitnesses, so they feel safer. - If there are more than two peds in the 20-meter radius who are hostile to the player, you'll need to be aiming your gun at DP to keep them in hands-up position. As soon as you stop aiming at them, the DP will either flee or try to attack you, because you're distracted by the peds who are hostile to you. - If the player happens to be very close to the DP after disarming them, there's a very high likelihood that DP will attack, because it's very easy for a ped to punch the gun out of the player's hand. So the player is encouraged to keep their distance. - Whether the NPC flees or attacks is determined by distance to the player. If all they need to do is take a few steps toward you, they're likely to attack. If they're distant, they're more likely to flee. This should ensure that the hands-up behaviour will make sense depending on the situation. Alone in the woods? DP prefers to play it safe and stay still no matter what. In populated areas? DP will flee a few seconds after you stop aiming at them. During a firefight? As soon as your attention is not on them, they'll either flee or attack. If this is all too complicated for now, I suggest not using the hands-up animation yet and just tweaking the chances: - If player disarmed DP by shooting their right arm, DP flees every time. They can't shoot or fight with a wounded right arm. - If player disarmed DP by shooting their gun, DP can still fight, so they flee 80% of the time, or attack 20% of the time (with fists, knife or a second gun). The reason for attacks being rare is that bare-fisted NPCs are VERY difficult to deal with. They just punch the gun out of your hand. So the player isn't actually rewarded for disarming them unless the DP flees. Incidentally, I did encounter a potential bug, which is that interaction prompts with other NPCs disappear, and the actions are no longer possible. If you press the antagonize button, you'll just punch the NPC you're locked onto. I'll test more tomorrow to see if I can isolate what's triggering that bug. It can be fixed by disabling and re-enabling the mod (either with F9 or by unloading and reloading Scripthook with CTRL+R) and in my case it seemed to happen after firefights, but I'm still not sure what the exact trigger is. By the way, for anybody here who doesn't know this: you can easily test .ini values by just unloading and reloading the scripts after changing the .ini. No need to restart the game. You do this by enabling file name extensions, and creating a notepad file in the RDR2 main directory called ScriptHookRDR2. If you have file name extensions enabled, it will appear as ScriptHookRDR2.txt. Then you rename the .txt to .dev, so that the file is now named ScriptHookRDR2.dev. You'll know you did it right because the icon will change and the file type will appear as "DEV file". Then, in-game, you just press CTRL+R to unload scripts, and you press it again to reload. You'll know it's working because the game briefly lags when scripts are reloaded (but not when they're unloaded). Quickest way to test the difference between .ini values for those of you who want to find the sweet spot faster.
-
Thank you all for reporting! @HughJanusI'll do a thorough test of all the new features and fixes tomorrow, as today I am utterly out of time. The Z-coord thing may be due to Z-coord 0 being way below ground level at a fixed point, so there would be no sweet spot that would work in every case (all the NPC has to do is climb a small hill and all of a sudden the method stops working). Perhaps the best method would be to compare the non-relative Z coords of two limbs, for instance, the head and the pelvis. If they're almost level with each other, force push would stop working, and resume working once the head was a certain distance above the pelvis. There would have to be a range (to allow for inclination and weird poses) but I believe that with the right values, it would work. EDIT: I just realized that enemies can sometimes end up on a sitting position, so comparing head to pelvis wouldn't work as smoothly as necessary. Maybe comparing it with both feet is a safer method. Meaning if at least one foot is in the Z-range of the head, the force push stops working. The reason for using both feet is because every once in a while one foot ends up in a weird position that might be out of the z-range, so the other foot acts as a failsafe (because it's rare for both feet to end up in a weird position at the same time).
-
I did some further testing on the force push thing. I set the DyingThreshold so high that NPCs die in one shot and recorded video of the anti-stagger ragdoll behaviour. As it turns out, the behaviour is more predictable than it first seems: at DyingForcePushX=15 they'll pull to their right. DyingForcePushY will have them move forward. Negative values result in them flying away, so with the .ini I can't set them to move backwards or to the left. Non-relative values can be used, of course, but that means that NPCs will always move in the same world direction, and that may be worse. IsDyingForceRelative, if enabled, causes NPCs to just fly away at positive values and has no effect at negative values. A solution may be to randomize the y and x of the force push (with negative values as well as positive) and sustain the push in that consistent direction until they're on the ground. This system really works best with a constant force being applied, hence DyingPushChance being set to 999 in my tests. Here's a video recorded at the following .ini settings: DyingPushChance=999 DyingForcePushX=15 DyingForcePushY=0 DyingForcePushZ=0 UseAdvancedDyingPush=0 DyingForceBone=53675 DyingForceOffsetX=1 DyingForceOffsetY=1 DyingForceOffsetZ=1 IgnoreUpVector=1 IsDyingForceRelative=0 IsDyingDirectionRelative=1
-
@HughJanusHere's my feedback: the most realistic, varied values I found were: DyingPushChance=999 DyingForcePushX=12 DyingForcePushY=0 DyingForcePushZ=0 UseAdvancedDyingPush=0 IgnoreUpVector=1 IsDyingForceRelative=0 IsDyingDirectionRelative=1 What this does is ensure that, during the anti-stagger reaction, enemies will walk around as if drunk, clutching their wounds, and fall over. If they come across scenery, they'll brace themselves against it. If their feet run into something, they'll fall. On uneven terrain, they'll also tend to fall. The direction in which they move varies to the point that it's fairly unpredictable, so it looks good. The problems: - The anti-stagger animation looks a bit goofy when forced to walk, but that can't be helped. It's kind of like a combination of being drunk and holding in diarrhea. - Enemies will noticeably twitch on the ground as the force continues to be applied to them. Sometimes it will be enough to make them turn around, but in a way that looks weird. I tried bone-specific pushes to see if better results could be achieved, but not only was the difference negligible, it also led to more noticeable twitching because all the force was going into a single bone. It's a good workaround for the anti-stagger behaviour problem, but it does lead to the ground twitching problem. My suggestion: make the force push last only for 4 seconds, or until a certain condition has been met. The force push should stop being applied once the NPC is on the ground. Perhaps a way to check for this would be to compare the Z position of different limbs, or relative to the ground? I don't know if this is possible. But if it is, the NPC's head being at a certain distance from the ground would be an indication that they are lying down, at which point the force push would be inactive. Once their head rises, the force push would be once again active for ragdoll situations. I also suggest applying this force push behaviour to knockdowns, because those could also benefit from the same "walk around drunk" behaviour. As for the stumbling and the lasso disarming, they're both working! The disarming works for lawmen too, and as you described, they walk toward you and attack you bare-fisted. A possible workaround for this would be to enforce fleeing or putting hands up. There are natives for that: void_TASK_FLEE_FROM_PED( Any p0, Any p1, Any p2, Any p3, Any p4, Any p5, Any p6, Any p7, Any p8, Any p9 ) //0x7B74D8EEDE9B5727 voidTASK_HANDS_UP( Ped ped, int duration, Ped facingPed, int p3, BOOL p4 ) //0xF2EAB31979A7F910 voidUPDATE_TASK_HANDS_UP_DURATION( Ped ped, int duration ) //0xA98FCAFD7893C834 You can also look for "cower" on the native database, as there are some natives related to that behaviour as well. Did you try any of those with the lawmen?