kingharvest Posted March 6, 2015 Share Posted March 6, 2015 Hi I'm curious if anyone else has experimented with the (actor) OnHitWith block and/or with weapon effects, and what happens when a hit dismembers an actor. From what I've seen a dismemberment always seems to cause these guys to run twice, which makes particular kinds of behaviors really hard to implement. A concrete example of what happens here is trying to implement simple thrown melee weapon retrieval-- you of course add an effect to the thrown weapon that runs a script to add a copy of the weapon to a hit actor's inventory. If you do this then most of the time it works just like you'd expect, you hit someone with your modified weapon and look in their inventory and there's a copy in there (even works when they are dead). If your modified weapon dismembers the actor, however, you'll find two copies of the weapon on the actor (100% repro, not a race or anything like that). Furthermore, if you put a printc in your weapon effect script you can clearly see it's getting run once on a normal hit and twice on a dismemberment. Now, what happens if you modify your throwing weapon to explode instead of dismember? Your script only gets run once on an explode. This behavior is maybe not totally shocking, but when I searched online I couldn't find any discussion of this at all. I can't be the first person to have noticed, can I? This also means, by the way, that the coin shot effect gives double denarius on a dismemberment (not that you'd ever notice in that particular scenario). I can think of a rather complicated way to keep track of when an item was double-added, but it's pretty ridiculous to set up so much state just to apply a simple weapon effect. Link to comment Share on other sites More sharing options...
Recommended Posts