Open weavejester opened 2 years ago
Could you give more elaborate details on your usecase here? The reason to not have walk animations be affected by animation speed VT is that it will mean that creatures will invariably skip/skid when moving. E.g. if you wanted to have creatures animate slower when under the effect of the slow spell, you would both slow their animations and apply a movement decrease effect - but this already slows down the movement animation, so you would be slowing it down twice (and the creature will appear as skidding).
But it warrants discussion if there's compelling reasons to prefer this.
In our case its to allow walk animations with longer cycles. The default walk animation completes a cycle for a fixed distance, governed by the WALKDIST
column in appearance.2da. So for a human model, the walk animation will repeat every 1.6m, regardless of the actual length of the animation on the model.
We have a couple of walk animations with a longer cycle distance (9m). These are movement animations like rolling or leaping, which cover more ground before repeating. Previously we applied a visual transform to slow the walk animation speed down proportionally, but that no longer works, so now these animations appear too fast.
As the animation cycle distance is now tied to the creature appearance, using a walk animation with a different cycle distance requires changing the creature's appearance type. In our case, we have a crude workaround where every PC appearance is duplicated with a longer WALKDIST
field. Changing between appearances, however, results in a noticeable visual stutter, as NWN will always reload the model when a creature's appearance type is changed, even if the model itself is identical to the previous appearance type. Compiling the model helps, but doesn't entirely eliminate the problem. The engine also can't generate inbetween frames when the appearance changes, so there's no animation blending as the model transitions.
I can certainly see why you might want to adjust the walk animation separately to other animations, but this also prevents walk animations with longer cycle distances from being used. If we could change the WALKDIST
field dynamically, that would also solve the issue, or if there was some way of adjusting the walk animation speed separately to other animation speeds.
One possible solution would be a native function to set the creature walk animation and (optionally) the associated walk distance:
void SetWalkAnimation(oCreature, int nAnimation, float fWalkDist=-1.0);
This would allow walk animations of different cycle lengths to be used.
To Reproduce
Specifics
If needed, describe the bug
In .20, the animation speed visual transform affected a character's run and walk animations. Since .21, the run/walk animations are not affected.