Skip to content
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

New functions for ped animations (getPedAnimationLength, getPedAnimationSpeed, etc) #3731

Closed
1 task done
ChemicalCreations opened this issue Sep 17, 2024 · 0 comments · Fixed by #3734
Closed
1 task done
Labels
enhancement New feature or request

Comments

@ChemicalCreations
Copy link

ChemicalCreations commented Sep 17, 2024

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

  • I have read and understood the Security Policy and this issue is not about a cheat or security vulnerability.
@ChemicalCreations ChemicalCreations added the enhancement New feature or request label Sep 17, 2024
@ChemicalCreations ChemicalCreations changed the title Missing Functions for Ped Animations (and .ifp containers) New functions for ped animations (getPedAnimationLength, getPedAnimationSpeed, etc) Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant