madrussian 347 Posted May 21, 2023 I've got a pretty simple idea. I'd like to wake up dead units that are done ragdolling and send them flying on new ragdoll with each new shot. Seems possible with a combination of setConscious, addForce, awake, isAwake, lifeState, incapacitatedState commands, etc. Especially reading though the notes on awake. But I'm also facing some unique constraints. Basically, I likely need to keep all AI units alive (as ‘alive _unit’ reports) all the time, including the "dead" ones. What on Earth am I up to? If interested, please read on: Spoiler I’ve been creating an extension-based C++/SQF hybrid AI system that uses automatically generated nav-meshes and forced movement for the AI (think playAction), which move units over complex outdoor terrain and effortlessly in and out of buildings (i.e. capable path-finder) into good cover, etc. It’s undergone multiple re-rewrites, each time moving more and more from SQF to C++. With the latest iteration, I can move 100 units simultaneously at 85+ fps, so it’s finally getting there performance-wise. The way I’m doing all this is quite bonkers (you’ll see all the details upon release provided I actually get finished before A4 comes out, maybe best not to hold breath), but suffice to say I’m now facing tradeoffs when it comes to AI death. Even without any special re-awaking of AI’s ragdoll (yet), to avoid visual glitch when my moving AI units die, I’m having to treat this specially via a “HandleDamage” EH which capture the moment of his “death”, then ragdoll him myself via setUnconsious, and then ‘enableSimulation false’, to prevent him from automatically rolling over to his backside (presumably to await revive, which btw I’m not doing anything related to, because well respectfully I’m not personally a huge fan of revive-based gameplay, for players or AI). So currently AIs “die” (by getting shot, etc), I keep them alive and ragdoll them, then once their ragdoll settles, I “disable simulation” on them (via ‘enableSimulation false’), and then I discretely kill them ‘via setDamage 1’. And then they are actually dead. Again I’m doing this only because I have to… for the death from forced movement to look correct. (Btw – This special death comes with a caveat already: His rifle never separates from his body as he ragdolls and settles, because he’s technically alive during that part.) My hope is now, once they are ragdolled and settled, to re-enable ragdoll on them when they are hit with bullets, explosions, etc. Because of course that would be mega-cool! Unfortunately, because they died this way (using my special method), nothing I’m trying (to achieve re-ragdolling) is working. In most permutations (combinations of relevant commands), when I addForce to the dead body, it (the body) ends up teleported into the ground (still moving, at a seemingly random depth). My alternate idea (to achieve re-ragdolling) is to simply never let AI unit actually die (as in never use ‘via setDamage 1’ and allow ‘alive _unit’ to return true forever), and again simply ‘enableSimulation false’ him upon ragdoll settling, and flag him (with a variable) as "dead". Unfortunately, having big problems making this (re-ragdolling with unit always alive) work too (him teleporting still into the ground, etc). I’ve spent a couple days solid on this now and I’m about to give up and just leave the dead bodies in ‘enableSimulation false’ state indefinitely, and give up on rag-doll re-animation (at least for now). My question for you guys: Has anyone created a working system of any kind that re-ragdolls a unit (dead or alive) -and- manages to also completely disable all revive-related animations? And does this while remaining completely visually glitch free (like no animation snapping like with switchMove)? I know, it’s a tall order. Also, for those that have tried and failed (or succeeded at something similar), I’d love to hear about lessons learned, etc. 🙂 2 Share this post Link to post Share on other sites
pierremgi 4866 Posted May 22, 2023 Perhaps a part of answer in KK's blog, here: http://killzonekid.com/arma-scripting-tutorials-forced-ragdoll/ The animation states or gestures EHs could help... Not tested. 1 Share this post Link to post Share on other sites
madrussian 347 Posted May 22, 2023 8 hours ago, pierremgi said: Perhaps a part of answer in KK's blog, here: http://killzonekid.com/arma-scripting-tutorials-forced-ragdoll/ The animation states or gestures EHs could help... Not tested. Nice, the ole "can in the belly" trick. This could indeed be part of the solution, thanks. Still working to get the various transitions (moment of unit killed, live ragdoll to dead ragdoll, etc) looking smooth. Struggling with "HandleDamage" EH atm, but found a couple handy links. I've been using that EH for ages, but apparently not quite correctly (and in some cases, no where near correctly). Share this post Link to post Share on other sites
mikey74 173 Posted May 22, 2023 This works as good as KK's scripts. bob addForce [bob vectorModelToWorld [0,0,0.7], [(random 1),(random 1),-2]]; Share this post Link to post Share on other sites