I saw the following animation code at [Present]
on every mod that has animations:
[Present] if $auxTime % $speed == 0 if $swapvar < $frameEnd $swapvar = $swapvar + 1 else $swapvar = $frameStart endif endif post $auxTime=$auxTime+1
Where $frameStart = 0
and $frameEnd
is index of last animation.
It works, but if your ingame fps changes and is not fixed value then the animation changes its speed. Not a modder myself but after a quick investigation I wrote the solution which removes dependency on user's fps.
Add the following under [Constants]
:
global $animFps = 74 ; This is desired animation speed (in animation's frames per second) feel free to change it
Replace previous animation code under [Present]
with this single line of code:
$swapvar = ( time // (1 / $animFps) ) % ($frameEnd + 1)
FPS_independent_animation.zip
Key Authors
Dafy
Random dude