Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

FPS independent animation

- A Config Script for Genshin Impact.

primary preview sec preview img sec preview img

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)

Login or Sign up to access this!
Login or Sign up to access this!

Files

Alternate File Sources

Credits

Key Authors

Dafy

Random dude

Submitter

DafyCreator
Login or Sign up to access this!
Login or Sign up to access this!
Login or Sign up to access this!

Game

Login or Sign up to access this!

Category

Sub-category
category img Other/Misc

Details

License

Share

  • 4
  • 2
  • 847
Login or Sign up to access this!

More from Submitter

preview img
248 24.1k 13
arrow_back