New functions for ped animations (getPedAnimationLength, getPedAnimationSpeed, etc) #3731
Closed
1 task done
Labels
enhancement
New feature or request
Is your feature request related to a problem? Please describe.
Unable to get the length of ped animations trough scripting, nor the current state of ped animation speed/progress.
That is the normal length of ingame animations and custom .ifp animations. It would also be good to have a method of getting the animations in a .ifp sort of like engineGetModelTextures or engineGetModelTextureNames.
Describe the solution you'd like
Some functions like getAnimationLength(string block, string anim), getPedAnimationSpeed(ped/player ped, string anim), getPedAnimationProgress(ped/player ped, string anim) and getAnimationsInBlock(string block) would
Describe alternatives you've considered
Using external programs to get length of gta animation.
Manually calculating the progress of an animation on preRender
Using debugString to monitor setPedAnimationSpeed
These methods however are either flawed or prone to conditional inaccuracies.
Additional context
It is currently possible to check if a ped is doing an animation by calling setPedAnimationSpeed or setPedAnimationProgress So perhaps an isPedDoingAnimation(ped/player ped, string anim) could be added as well.
From what I know:
It is also important to note gta seems to have a cap on how much an anim can progress in a single frame, that cap is by 50ms.
This means that a client with 15FPS, will have his animation on average progress at 75% speed. This cap also applies to gamespeed, that is to say that a client with 2x gamespeed, and a framerate of 40FPS will have his animations progress at 200% per frame, while a client with 30FPS will have his animations progress at 150% per frame.
Do note that this behavior carries across to game physics calculations and the conclusions drawn here are based purely on my personal research so please feel free to fact check them.
Security Policy
The text was updated successfully, but these errors were encountered: