Mtasa-blue: setPedAnimationSpeed should accept parameters above 1.0

Created on 22 Apr 2019  路  5Comments  路  Source: multitheftauto/mtasa-blue

Description
Currently setPedAnimationSpeed can only decrease animation speeds. It would be useful to be able to increase animation speeds with parameters above 1.
There is not more to say.

Additional info
Related to #275

enhancement

Most helpful comment

The limit is now 10. We should:

put a warning on wiki that says "Numbers higher than 1 can cause issues with some animations"

All 5 comments

This is definitely on the cards. We picked 0-1 as we were certain this was stable.

Upper limit

With my brief testing:

  • Up to a certain point, "large" numbers (e.g. 50) work fine on initial run
  • If you then update the speed from 50 to 51 the animation locks up (you must stop and start the animation for future animation speeds to work)
  • 51 as a speed will work as long as the initial speed is default

These numbers increase depending on the length of the anim (50 for paulnmac/wank_loop, 100 for benchpress/gym_bp_celebrate).

We could investigate whether we can fix the animation locking up for such large numbers, but I think it's generally a waste of effort, unless someone really needs those "huge" numbers.

What do you think would be an appropriate upper limit? What number specifically are you fishing for?

Lower limit

Negative numbers hilariously break the animation system, but it would still be nice to see CJ walking backwards. It could maybe be fixed later, separate to the upper limit.

50 is pretty much overkill, unless you want to script Son-Goku running around the world in 1 second but if you say 50 is a limit where it starts to bug then we can use 40-50 as the limit for the function, i guess no one will ever complain about that.

Actually, I've reliably reproduced this happening at lower speeds (above 1):

  1. anim fat fatsprint
  2. crun me:setAnimationSpeed("FatSprint", 0)
  3. crun me:setAnimationSpeed("FatSprint", 20)

works fine with 10 though

We could easily use ~40 as limit and put a warning on Wiki that "Numbers higher than 1 can cause issues with some animations"

The limit is now 10. We should:

put a warning on wiki that says "Numbers higher than 1 can cause issues with some animations"

Was this page helpful?
0 / 5 - 0 ratings