-
Notifications
You must be signed in to change notification settings - Fork 933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not interrupt scripted animations #1749
Conversation
Can't say, sorry. My usual blunt approach (>_>) didn't work for such a nuanced situation and the mannequins played death animation in result when they shouldn't. |
Some additional changes:
Now we should create a list of cases to test. |
About mannequins in Castle Hestatur: OpenMW for now does not check if death animation is finished before delete the corpse. Also isDeathAnimationFinished() returns true for any actor with Health = 0 at start. |
For now I do not update animation state for dead actors. |
It seems PlayGroup in vanilla has higher priority than SkipAnim. |
That and changelog entries, you're on fire! ;) |
Is not blocker since PlayGroup is bugged for NPCs in vanilla. We need a forum discussion to determine desired behaviour. |
Is that for another PR then? |
Yes, it is. Another quirks to reproduce:
|
About Abot's Silt Striders: I encountered a lot of twitching during scenic travel due to "walkforward" animation in both vanilla and OpenMW (a bit more noticable). EDIT: looks like it is not only my problem - on some videos there is a twitching too. |
Highly likely that the cause of twitching is movement in the WalkForward animation.
I'l try to investigate and check if the issue is on my side. |
I think this PR is ready for review now. About Silt Striders issue: runAnimation() returns a forward movement for WalkForward animation (a quite expected behaviour). |
|
||
mAnimation->disable(mCurrentIdle); | ||
mCurrentIdle.clear(); | ||
|
||
mIdleState = CharState_SpecialIdle; | ||
bool loopfallback = (entry.mGroup.compare(0,4,"idle") == 0); | ||
mAnimation->play(groupname, Priority_Default, | ||
mAnimation->play(groupname, persist && groupname != "idle" ? Priority_Persistent : Priority_Default, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the sake of readability/maintainability, can we do assignment outside of a function call and just pass the resulting variable through?
A four in one bug squasher! Aside from one comment, I see no deal breakers. @zinnschlag, @kcat or @AnyOldName3 : any thoughts |
I don't know enough about this part of the engine to have thoughts. |
This Now, I've never been very happy with the animation state code, even as I was writing it (I didn't/couldn't put in the necessary effort to making something that made sense as a system, versus something that just worked vaguely like vanilla), so maybe this is the best option with what's there. But the animation state handling can do with some serious cleaning and refactoring. |
This PR is aimed to fix bug #3486, bug #4286, bug #4307 and bug #4291 since all these problems are related.
Tested with NPC_Commands_V8b.esp, Abot's Silt Striders, and Castle Hestatur mannequins.
Main changes:
Scripted animations have higher priority than common ones, so common animations should not interrupt them.
Allows such mods as Abot Silt Striders and NPC_Commands to work better.
Cell cleanup checks if death animation is finished before remove the corpse 72 hours after death.
If an actor has Health = 0 in editor, but does not have the Persistent flag, play death animation.
These two allows mannequins from Castle Hestatur work properly.
Scripted animations ignore SkipAnim console command.
"PlayGroup idle" removes scripted animations from actor and resumes a common NPC behaviour.
These two should fix other mannequin mods, which use scripted anims on dead actors.
Should work now, but I suppose that this PR has some side effects.