garrysmod icon indicating copy to clipboard operation
garrysmod copied to clipboard

Animations update

Open Kefta opened this issue 6 years ago • 9 comments

Changes:

  • Added ToggleNoClipAnim hook for updating the noclip layer
  • Added CalcPlaybackRate hook for overriding the player's playback rate
  • Added GM:HandlePlayerAirWalking for airwalking
  • Added GM:HandlePlayerMoving for run/walk animations
  • Added Player:AnimResetGestureSlots
  • GM:DoAnimationEvent now support all PLAYERANIMEVENT enums (except PLAYERANIMEVENT_SNAP_YAW) - this now means addons can call Player:DoCustomAnimEvent with PLAYERANIMEVENT_CUSTOM(_SEQUENCE) to override the player's current animation.
  • Moved GM:GrabEarAnimation to shared
  • GM:HandlePlayerDriving now sets the driving activity and sequence for proper layering
  • Added ACT_MP_SWIM_IDLE activity support
  • Changed the velocity function used for vehicle pose params - fixes incorrect driving velocity on a moving platform
  • GM:MouthMoveAnimation and GM:GrabEarAnimation are now called on the passed gamemode table instead of GAMEMODE
  • Changed holdtype table generation to use ACT enums instead of offsets
  • Added sitting activities, idle swimming, and more ACT_MP enum translations to the holdtype table
  • Various optimisations, the greatest being caching player __index calls where the same function was called multiple times in a row

This PR is contingent upon https://github.com/Facepunch/garrysmod-requests/issues/704, https://github.com/Facepunch/garrysmod-requests/issues/1069, https://github.com/Facepunch/garrysmod-requests/issues/1090, and https://github.com/Facepunch/garrysmod-issues/issues/3075 being completed. https://github.com/Facepunch/garrysmod-requests/issues/1034 would allow GM:MouthMoveAnimation to be made shared.

This PR also merges part of https://github.com/Facepunch/garrysmod/pull/1173; and supersedes https://github.com/Facepunch/garrysmod/pull/1191, https://github.com/Facepunch/garrysmod/pull/1230, https://github.com/Facepunch/garrysmod/pull/1231, and https://github.com/Facepunch/garrysmod/pull/1399.

Player:AnimResetGestureSlots could also be binded in the engine.

Kefta avatar Jan 31 '18 07:01 Kefta

I love you kefta.

mcNuggets1 avatar Jan 31 '18 07:01 mcNuggets1

Conflicts resolved and added PLAYERANIMEVENT_CANCEL_RELOAD support, so the dev branch is the best place to test the PR (but it'll still work on live).

Kefta avatar Mar 14 '18 20:03 Kefta

Devs, please merge this.

mcNuggets1 avatar Mar 23 '18 11:03 mcNuggets1

👍 for merge if backwards compatible.

kurozael avatar Apr 12 '18 06:04 kurozael

Still merge this, please.

mcNuggets1 avatar Jan 27 '19 23:01 mcNuggets1

At least fulfilling the requests would make testing this PR properly possible.

Kefta avatar Jan 28 '19 05:01 Kefta

animations.lua, specifically MouthMoveAnimation is still the biggest abuser of __index calls of any addon or gamemode I've profiled. It's being called more than 10,000 times a second in default code, and that's just with one player.

Kefta avatar Mar 09 '19 03:03 Kefta

The problem is you put so much into one pr that none of them wanna review it

thegrb93 avatar Mar 09 '19 05:03 thegrb93

@thegrb93 https://github.com/Facepunch/garrysmod/pull/1191 hasn't been merged either.

Kefta avatar Mar 09 '19 07:03 Kefta