Results 1 to 5 of 5

Thread: Radialwalk by Direction

  1. #1
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Radialwalk by Direction

    Well so many people have trouble with walking, so I decided to make this procedure. If you don't understand directions, then look it up on Wikipedia or something but I assume most should (Since the are in Runescape, North, South, East and West). Anyways, most people do not understand radialwalk and the radians, so this little procedure will walk for you by direction.

    How to use the directions

    this procedure is designed to find the Middle of the area you are going to search. It will then find the d (adjustment) from a 90 degree (*pure*) angle, and then divide that how many directions you give, thus decreasing the search size for every direction you give. So 'NNNN' would be more accurate than just 'N'.


    Hope fully you will like. Credits go to Nielsie for helping me fix a little problem with the east (he added mod 360);

    SCAR Code:
    function Testwalk(Dir: string; Color, rx, ry: integer): boolean;
    var
      i, degree, d, sRadial, eRadial: integer;
    begin
      for i:= 1 to Length(Dir) do
      begin
        case Lowercase(Dir[i]) of
          'n': degree:= degree+ 360;
          'e': degree:= (degree+ 90) mod 360;
          's': degree:= degree+ 180;
          'w': degree:= degree+ 270;
          else
            Writeln('Invalid Direction: '+Dir[i]);
        end;
      end;
      Writeln('Degree = '+IntToStr(degree div Length(Dir)));
      d:= 90 div Length(Dir); // 90 = pure angle
      sRadial:= (degree - d) mod 360;
      eRadial:= (degree + d) mod 360;
      Writeln('sRadial = '+IntToStr(sRadial));
      Writeln('eRadial = '+IntToStr(eRadial));
      result:= RadialWalk(Color, sRadial, eRadial, 60, rx, ry);
    end;

    Join the fastest growing merchanting clan on the the net!

  2. #2
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Dude.. thats awesome


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  3. #3
    Join Date
    Nov 2007
    Location
    Nowhereville
    Posts
    1,155
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    I like it. Radial walk was really hard to understand. I barely understand it right now. I will use this in my next upgrade of my script!.

    Edit: I think my next challenge if I were you would be to make the color into an array.

    Cut em2 it
    Formerly known as Cut em2 it

  4. #4
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thank you

    Join the fastest growing merchanting clan on the the net!

  5. #5
    Join Date
    Apr 2007
    Location
    Texas
    Posts
    1,668
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hmm, i read over it a little bit, so this may be a noobish post if I am wrong, however. Doesn't this kinda take away from some of the power of radial walking? Being about to choose whether to search from left to right, or right to left, and being abvle to manbuly enter in the exact angles you will want it to scan are the two features that made it invaluable to me...

    also, i dont think your "mod 360" fix is going to work correctly. Im not sure what error you were trying to fix, but it seems like a "360 - (x)" would be more correct than "x mod 360"

    other than that, it does show a good indepth understanding of how radial walk works, and a clever way to throw it into a for loop, very impresive.

    Edit: ok, i double chekced my math, and "x mod 360" is BETTER than 360 - x, by far.
    and you should add that on to the end of any direction tht you do not want to go above 360, not just the east.
    [IMG]http://farm3.static.flickr.com/2120/2052732965_348f3629d0_o.jpg[/IMG]

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Run direction question
    By HarryJames in forum OSR Help
    Replies: 3
    Last Post: 11-11-2008, 12:20 AM
  2. Change angle and direction of camera
    By Bobzilla69 in forum OSR Help
    Replies: 7
    Last Post: 07-03-2007, 08:20 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
  •