Combat with water creatures do not end upon exiting water
In vanilla morrowind when enganging combat with water creatures, combat ends immediately when you exit the water. In OpenMW, combat continues when exiting the water. So unless you kill them you
have to exit the cell the water creatures is in for cobat to end.
#4 Updated by Thomas Staudinger about 2 years ago
So, I just tested this and the actual behavior seems to be the following in vanilla Morrowind: Combat with a water creature stops immediately when exiting the water as long as it hasn't actually hit you, as soon as it has it will continue the combat and try to get to your location even after you exit the water. Here's a video showing this behavior: https://www.youtube.com/watch?v=yVvi95kR3-M&feature=youtu.be
I've given this some pretty thorough testing, and I think I understand the vanilla behavior.
Creature behavior in this case is determined by their movement flag. Biped creatures and NPCs will follow the player between water and land. Flying and walking creatures won't follow the player into water, and swimming creatures won't follow to land.
Combat continues even after the player leaves or enters the water if the player attacked the creature (whether they hit the creature or missed), or, I believe, if the creature completed an attack animation at least once, whether they hit the player or missed (maybe the check on the player is also if the animation completed, although I don't think the player can interrupt an attack animation). When in combat between water and land like this, the creature will turn to face the player if they have line of sight and will attack if they are within range, but they won't move to follow the player.
#8 Updated by Miroslav Remák 10 months ago
It seems that if canFight() evaluates to false while the "hit flag" is active, the actor will disengage from combat instead of fleeing.
For example: execute "fargoth->startcombat player", jump over Fargoth's head and he will no longer be in combat with you (unless you let him hit or attempt to hit you). If you had started combat by hitting him, he would have fleed.
Also, leaving the actor's cell appears to reset this flag.
Yes, that does seem to be the case. It wasn't quite how I expected, though. With a slaughterfish that had set the flag by attacking the player, when I left the water and went into and out of an interior to reset the flag, I expected combat to end, but instead the combat music still played and it still had the player as a target. When I then went in the water and left before it could attack me, though, it ended combat due to the reset flag. Maybe rather than being done constantly the canFight check was only done when the target (the player in this case) changed context between land and water or something. Not sure how that would work with levitating or jumping out of range, though...
In my PR for this I implemented this as an actorID, not a flag. I didn't notice your comment and didn't implement resetting for AI actors during cell changes, but I think I'm going to leave it as it is for now unless there's a problem with it.