Makar 0 Posted December 4, 2019 Report Share Posted December 4, 2019 Now I'm sure tons of you have seen ganodermic beasts, new chickens, and grotworms sliding around in a T-Pose when they should be animating while walking. I am sure some of you have seen this wonky hardcode fix going around (this example is from Matrix 3's polypore npc code) @Override public void processMovement() { super.processMovement(); if (realId == 14696 && getNextWalkDirection() != -1) { this.setNextAnimation(new Animation(15465)); this.setNextForceMovement(new NewForceMovement(this, 1, null, 0, Utils.getAngle(Utils.DIRECTION_DELTA_X[getNextWalkDirection()], Utils.DIRECTION_DELTA_Y[getNextWalkDirection()]))); } } Basically forcing a movement animation using forcemovement. Well the render animation definitions of the monster hold animations for a third movement type. Not walking, not running.It seems to be used for monsters that move either half speed of normal monsters, or monsters that move 2 squares in one direction at a time such as ganodermic beasts. The correct way to trigger this animation to be used directly from the render animation of the npc is to just have an exception inside where it updates an npc to be "running". As you can see in This is the hidden content, please Sign In or Sign Up where the client determines which render animation to use, there is a "teleport" animation type. I only call it teleport because it's the same movement type id that players use in player update as a teleport movement. Should probably rename it to SPECIAL or something instead. Here is where the client determines if the NPC uses this specific type of movement so you can update your NPC update methods accordingly: This is the hidden content, please Sign In or Sign Up If you're using Matrix's crazy ass control flow for NPC updating, here's where you'd make the change: if (n.getNextRunDirection() == -1) { if (n.getDefinitions().walksSpecial()) { stream.writeBits(2, 2); stream.writeBits(1, 0); stream.writeBits(3, Utils.getNpcMoveDirection(n.getNextWalkDirection())); } else { stream.writeBits(2, 1); stream.writeBits(3, Utils.getNpcMoveDirection(n.getNextWalkDirection())); } } else { stream.writeBits(2, 2); stream.writeBits(1, 1); stream.writeBits(3, Utils.getNpcMoveDirection(n.getNextWalkDirection())); stream.writeBits(3, Utils.getNpcMoveDirection(n.getNextRunDirection())); } Link to comment Share on other sites More sharing options...
OSPK 0 Posted December 7, 2021 Report Share Posted December 7, 2021 interesting, not sure if ive seen this happen but thank you for this contribution. Link to comment Share on other sites More sharing options...
Oldfriend 0 Posted March 24, 2022 Report Share Posted March 24, 2022 i guess so Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now