Thread: [Help] forcemovement mask

Results 1 to 10 of 10
  1. #1 [Help] forcemovement mask 
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    Hey there,

    Does anyone know why this is happening? It works fine from the other side.

    Attached image

    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();
    			}
    		});
    	}
    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();
    				}
    			});
    		}
    	}
    Kind regards,

    Patrick
    Reply With Quote  
     

  2. #2  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    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?
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    Quote Originally Posted by Jason View Post
    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?
    Not quite sure because i tried 0/5 on the other side and it still did the moonwalk
    Reply With Quote  
     

  5. #4  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    Quote Originally Posted by _Patrick_ View Post
    Not quite sure because i tried 0/5 on the other side and it still did the moonwalk
    Mind posting the Agility#forceMovement funtion and all functions referenced in it. Is it possible the movement direction is being overwritten after this call?
    Reply With Quote  
     

  6. Thankful user:


  7. #5  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    Quote Originally Posted by Jason View Post
    Mind posting the Agility#forceMovement funtion and all functions referenced in it. Is it possible the movement direction is being overwritten after this call?
    Done: You must spread some Reputation around before giving it to Jason again.
    Reply With Quote  
     

  8. #6  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Can always try and see if it changes something:
    int dir = player.getX() <= 2970 ? 1 : 3;


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  9. Thankful user:


  10. #7  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    Quote Originally Posted by arch337 View Post
    Can always try and see if it changes something:
    int dir = player.getX() <= 2970 ? 1 : 3;
    Thanks man!
    Reply With Quote  
     

  11. #8  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    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)) { 
      //
    }
    Reply With Quote  
     

  12. #9  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    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..)
    Attached image
    Reply With Quote  
     

  13. Thankful user:


  14. #10  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    Quote Originally Posted by Jason View Post
    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)) { 
      //
    }
    Quote Originally Posted by Kris View Post
    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..)
    Thank you for your input guys and the help is much appreciated. The initial problem has been solved, thank you everyone!
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Forcemovement mask..
    By mige5 in forum Help
    Replies: 14
    Last Post: 10-01-2013, 08:23 PM
  2. help me masked hits 317 pi
    By _Patrick_ in forum Help
    Replies: 7
    Last Post: 09-06-2013, 12:00 PM
  3. [317][PI] Help with masks.
    By thedon69 in forum Help
    Replies: 3
    Last Post: 01-23-2013, 04:31 PM
  4. [REQ/HELP]Deku Mask[Req/Help]
    By haze012 in forum Models
    Replies: 2
    Last Post: 04-27-2012, 01:25 AM
  5. forcemovement mask issue (0x400)
    By Mr Reece in forum Help
    Replies: 6
    Last Post: 12-18-2011, 10:10 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •