Results 1 to 13 of 13

Thread: How To Detect Player Below Line..

  1. #1
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default How To Detect Player Below Line..

    K so how do I detect if my character is below a line on the minimap?

    I've tried getting all the points on a line segment then checking if my character's X & Y is less than any of the corresponding values for the points.. but that takes forever!! AND it doesn't always work.. My math might have a bug :S

    I'm basically trying to use the minimap as a graph/Cartesian plane to check if a player is out of bounds..

    Simba Code:
    Function CrossedTheLine: Boolean;
    var
      LineSeg, AllPoints: TPointArray;
      Slope, Len: Extended;
      I, NumPoints, Dist, StepX, StepY, PX, PY: Integer;
    begin
      LineSeg:= [Point(54, 105), Point(49, 123)];

      //Slope:= (LineSeg[1].Y - LineSeg[0].Y) div (LineSeg[1].X - LineSeg[0].X);
      //B:= LineSeg[0].Y - (Slope * LineSeg[0].X);
      //Y:= (Slope * X) + B;

      Len:= Hypot(((LineSeg[0].X - LineSeg[1].X) * 1.0), ((LineSeg[0].Y - LineSeg[1].Y) * 1.0));   //Length Of Segment.
      Dist:= Distance(LineSeg[0].X, LineSeg[0].Y, LineSeg[1].X, LineSeg[1].Y);
      NumPoints:= Floor(Len div Dist);

      if (NumPoints = 0) then
        NumPoints:= 1;            //Prevent Division By 0.

      StepX:= Floor((LineSeg[1].X - LineSeg[0].X)/NumPoints);
      StepY:= Floor((LineSeg[1].Y - LineSeg[0].Y)/NumPoints);

      PX:= StepX + LineSeg[0].X;
      PY:= StepY + LineSeg[0].Y;

      For I:= 0 To NumPoints do
      begin
        SetLength(AllPoints, Length(AllPoints) + 1);
        AllPoints[I]:= Point(PX, PY);
        PX := PX + StepX;
        PY := PY + StepY;
      end;
      writeln(AllPoints);
    end;
    I am Ggzz..
    Hackintosher

  2. #2
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Add a picture or two. I'm thinking if those points are constant, you could just create a box and do TPAFromBox and check to see if MMCX, MMCY is in the tpa.

  3. #3
    Join Date
    Jan 2012
    Location
    Texas
    Posts
    241
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    If you are trying to recognize when a player goes "out of bounds" use the symbol finding method (if there's a symbol nearby). Then, have it logout out if symbol ______ is not found.

    Good Luck

  4. #4
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default



    In the above, that little circle is a pillar.. the grey area is walls.. P1 and P2 form a line using SPS points if the player crosses the line into the orange then I'm out of bounds.. I just can't figure it out.. Oh and there is a symbol at P2..

    I didn't think about the tpa in box.. I'll go try that when I get home. Thanks
    I am Ggzz..
    Hackintosher

  5. #5
    Join Date
    Nov 2011
    Posts
    1,268
    Mentioned
    17 Post(s)
    Quoted
    217 Post(s)

    Default

    DTM anchor

  6. #6
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    GetTPAFromBox(minimap)
    FilterPointsPie from Symbol/SPS point (from that pictures looks like from 30/40 degrees to 210/220)
    if TPA not in TPAarray then
    your out of bounds or w/e

    Unless that Point isn't always on minimap.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  7. #7
    Join Date
    Nov 2011
    Posts
    1,268
    Mentioned
    17 Post(s)
    Quoted
    217 Post(s)

    Default

    To be honest, make it so that if you go too far south, it runs back. I would detect the green color on the Green Brutal Dragons or on the FireBlast

    if see any of those too, SPS walk to a safe spot.

    Check for those colors on the screen, if seen, run back, you will also get "you are terribly burnt" if you get too far south.

  8. #8
    Join Date
    Oct 2007
    Location
    The deep web
    Posts
    2,496
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    //offtopic, in your sig, try the mm to ms
    Did someone say GDK?

  9. #9
    Join Date
    Nov 2011
    Posts
    1,268
    Mentioned
    17 Post(s)
    Quoted
    217 Post(s)

    Default

    No, its a WaterFiend bot and if he passes that line, he gets killed by Brutal Green Dragons, so thats the whole point of this thread, how to avoid running over to the Dragons in the Ancient Cavern Dungeon

  10. #10
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    ^That.. I have all the fighting and code written.. it currently gets to the waterfiends and fights them.. it's just I thought the best idea would be to detect if I'm below the line.. Anything below those points gets destroyed by those brutals..

    I'll try all the suggestions.
    I am Ggzz..
    Hackintosher

  11. #11
    Join Date
    Oct 2007
    Location
    The deep web
    Posts
    2,496
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by DemiseScythe View Post
    No, its a WaterFiend bot and if he passes that line, he gets killed by Brutal Green Dragons, so thats the whole point of this thread, how to avoid running over to the Dragons in the Ancient Cavern Dungeon
    1. Thats why i said //offtopic....

    2. I was talking about his sig, sorry, wasnt sure how to make it any clearer
    Did someone say GDK?

  12. #12
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Using TPA's or DTM's you can easily find out where you are(using the wall)
    Stolen from tip.it:



    Quote Originally Posted by jakeyboy29 View Post
    1. Thats why i said //offtopic....

    2. I was talking about his sig, sorry, wasnt sure how to make it any clearer
    My suggestion is to use MM to MS conversion to get a MS point then do a spiral color search from that point. Only spiral out about 50 pixels or so. That'd be a pretty fast item detection system
    Last edited by footballjds; 01-31-2012 at 03:37 PM.

  13. #13
    Join Date
    Nov 2011
    Posts
    1,268
    Mentioned
    17 Post(s)
    Quoted
    217 Post(s)

    Default

    Quote Originally Posted by jakeyboy29 View Post
    1. Thats why i said //offtopic....

    2. I was talking about his sig, sorry, wasnt sure how to make it any clearer
    Sorry, I taught your Signature was part of your post and you were asking if this was a GDK.

    Offtopic Nice picture ggzz, I like it

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •