Thread: Decent way to handle object interaction distance

Results 1 to 8 of 8
  1. #1 Decent way to handle object interaction distance 
    Registered Member
    I hate Guns's Avatar
    Join Date
    Mar 2009
    Posts
    7,009
    Thanks given
    2,012
    Thanks received
    2,792
    Rep Power
    5000
    So, I'm not actually sure if this is exactly the proper way to do this.

    So let me explain.

    When you click on an object, the client is going to generate a walkable path to the object, which you read on the server and use for the players walk path.

    You should somewhere in your walking packet have a snippet of code that resembles something like
    Code:
    		for (int i = 0; i < steps; i++) {
    			path[i][0] += firstX;
    			path[i][1] += firstY;
    			player.getWalkingQueue().addStep(path[i][0], path[i][1]);
    		}
    The last point of the generated path, is the closest you can get to an object from the direction you're walking from

    I'm not actually sure if thats how its done on RuneScape, but it's currently the best method I have of doing it.


    Reply With Quote  
     

  2. #2  
    Respected Member


    Luke132's Avatar
    Join Date
    Dec 2007
    Age
    32
    Posts
    12,520
    Thanks given
    164
    Thanks received
    5,303
    Rep Power
    5000
    jagex have serversided walking to verify that your path is legit, if u delete all objects clientside u can still only walk where u normally could

    btw this thread makes no sense im not even sure what ur talking about

    Reply With Quote  
     

  3. Thankful users:


  4. #3  
    Registered Member

    Join Date
    Feb 2015
    Posts
    799
    Thanks given
    6
    Thanks received
    179
    Rep Power
    111
    I don't think this really means anything unless the rest of the validation etc is shown from your server side? If you shared that, then it would make a bit more sense.
    Reply With Quote  
     

  5. #4  
    Im an albatraoz

    Nand0's Avatar
    Join Date
    Feb 2010
    Age
    27
    Posts
    824
    Thanks given
    199
    Thanks received
    113
    Rep Power
    117
    uuhm i dont get it
    [Only registered and activated users can see links. ]







    [
    Reply With Quote  
     

  6. #5  
    Registered Member
    Chivvon's Avatar
    Join Date
    May 2016
    Posts
    451
    Thanks given
    55
    Thanks received
    110
    Rep Power
    174
    This is not a proper way of doing it. Horrible on many different points of analysis. Great that you're aware of it, just a warning for others.

    Thanks for the snippet. On the up note it is an interesting solution
    Reply With Quote  
     

  7. #6  
    Extreme Donator

    Women's Avatar
    Join Date
    Mar 2010
    Posts
    1,691
    Thanks given
    439
    Thanks received
    709
    Rep Power
    563
    100 errors

    help
    Reply With Quote  
     

  8. #7  
    Registered Member
    Join Date
    Apr 2020
    Posts
    32
    Thanks given
    1
    Thanks received
    4
    Rep Power
    42
    You'll run into issues when the path is blocked if you do this.
    Reply With Quote  
     

  9. #8  
    Registered MrClassic
    MrClassic's Avatar
    Join Date
    Oct 2008
    Posts
    1,909
    Thanks given
    15,213
    Thanks received
    355
    Rep Power
    5000
    Quote Originally Posted by Luke132 View Post
    jagex have serversided walking to verify that your path is legit, if u delete all objects clientside u can still only walk where u normally could

    btw this thread makes no sense im not even sure what ur talking about
    true.

    I think this thread is made to determine when to call an action to a specific world object. I remember in some servers you could cut wood from 5 tiles away lol.

    OT:
    Good snippet. The only thing I don't understand is why this logic isn't already implemented in any base

    EDIT:

    Or are you implying with this part of code when to call an action?
    Thanks, MrClassic.

    [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ]
    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. Better way to handle objects
    By TheRedArmy in forum Snippets
    Replies: 6
    Last Post: 03-29-2014, 07:14 AM
  2. What's the best way to handle dialogue?
    By Paketa in forum Help
    Replies: 3
    Last Post: 04-11-2009, 02:37 AM
  3. Adding a nice way to handle objects (emulous)
    By Livinglife in forum Tutorials
    Replies: 15
    Last Post: 03-23-2009, 10:15 PM
  4. Fastest way to load objects ?
    By supra s in forum Help
    Replies: 2
    Last Post: 03-07-2009, 08:34 PM
  5. An easier way to fix object (too far to get)
    By Ultimate in forum Tutorials
    Replies: 3
    Last Post: 12-11-2008, 12:35 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •