Assuming the 'dir' value represents direction, it's always 1. Is it possible there is a value to represent the direction you're support to be going?
|
Hey there,
Does anyone know why this is happening? It works fine from the other side.
First time fucking around with the forcemovement mask.
Code:int x = player.getX() <= 2970 ? + 4 : -4; int dir = 1; int[] forceMovement = { 0, 0, x, 0, 33, 60, dir, 2 }; Agility.forceMovement(player, new Animation(844), forceMovement, 1, true);Code:public static void forceMovement(final Player player, final Animation animation, final int[] forceMovement, int ticks, final boolean removeAttribute) { Server.getTaskScheduler().submit(new Task(ticks) { @Override public void execute() { player.playAnimation(animation); player.setForceWalk(forceMovement, removeAttribute); player.getUpdateFlags().flag(UpdateFlag.FORCE_MOVEMENT); this.stop(); } }); }Kind regards,Code:/** * Sets the force walk data * @param forceWalk * @param removeAttribute */ public void setForceWalk(final int[] forceWalk, final boolean removeAttribute) { this.forceWalk = forceWalk; if (forceWalk.length > 0) { World.getWorld().schedule(new Task(forceWalk[7]) { @Override public void execute() { setTeleportTarget(getLocation().transform(forceWalk[2], forceWalk[3], 0)); if (removeAttribute) { removeAttribute("busy"); } this.stop(); } }); } }
Patrick
Assuming the 'dir' value represents direction, it's always 1. Is it possible there is a value to represent the direction you're support to be going?
Can always try and see if it changes something:
int dir = player.getX() <= 2970 ? 1 : 3;
In the last byte of the payload chunk for force movement the direction is sent, are you sure it's being sent properly? Can you also show any code that relates to force movement being sent over the network, should look something like;
Code:if (update.contains(FORCE_MOVEMENT)) { // }
You should write yourself a method for these cases, force movement is often used and in most cases you always need to face the direction in which the movement is going in. I suggest you write a method that automatically calculates the direction (0-16384) based on the current coordinates & the coordinates to which the movement is directed to. Saves a lot of hassle there
(Didn't bother giving any assistance as it appears like the issue itself is solved already..)
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |