Page 2 of 2 FirstFirst 12
Results 26 to 47 of 47

Thread: MS Grid system

  1. #26
    Join Date
    Oct 2007
    Posts
    111
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Guise, holy shit, reflection features without reflection?!?

  2. #27
    Join Date
    Jun 2008
    Location
    United States
    Posts
    818
    Mentioned
    60 Post(s)
    Quoted
    90 Post(s)

    Default

    Quote Originally Posted by dweg View Post
    Guise, holy shit, reflection features without reflection?!?
    I mean, it's math. So, much cooler than Reflection.
    [10/14/13:19:03] <BenLand100> this is special relatively, just cleverly disguised with yachts

  3. #28
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Quote Originally Posted by euphemism View Post
    I mean, it's math. So, much cooler than Reflection.
    Lol'd, this is really good stuff!
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  4. #29
    Join Date
    Dec 2009
    Location
    R_GetPlayerLoc;
    Posts
    2,235
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    I'd love if we could get this into the includes somehow.
    "Logic never changes, just the syntax" - Kyle Undefined?

    Remember, The Edit Button Is There For A Reason!!!

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

    Default

    Quote Originally Posted by Yago View Post
    I'd love if we could get this into the includes somehow.
    I plan on adding it to math.simba. Also I'm really debating on using this for our MMtoMS instead (its way more accurate I think).

    Simba Code:
    Function MMtoMS2(MM: TPoint): TPoint;
    var
      Yh, yMod, X, Y: Extended;
    begin
      X := MM.x-627.0;
      Y := MM.y-85.0;
      yMod := 36.0;
      Yh := Abs(Y + yMod);
      Result.x := Round(263.5 + (X*9.75/(12.8-(Yh/yMod*3.15))) * 9.75);
      Result.y := Round(182.0 + Y * (6.3 + ((Yh/yMod)*2.4)));
      if not PointInBox(Result, MSBox) then
        Result := Point(-1, -1);
    end;
    (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.

  6. #31
    Join Date
    Dec 2009
    Location
    R_GetPlayerLoc;
    Posts
    2,235
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by Narcle View Post
    I plan on adding it to math.simba. Also I'm really debating on using this for our MMtoMS instead (its way more accurate I think).

    Simba Code:
    Function MMtoMS2(MM: TPoint): TPoint;
    var
      Yh, yMod, X, Y: Extended;
    begin
      X := MM.x-627.0;
      Y := MM.y-85.0;
      yMod := 36.0;
      Yh := Abs(Y + yMod);
      Result.x := Round(263.5 + (X*9.75/(12.8-(Yh/yMod*3.15))) * 9.75);
      Result.y := Round(182.0 + Y * (6.3 + ((Yh/yMod)*2.4)));
      if not PointInBox(Result, MSBox) then
        Result := Point(-1, -1);
    end;
    Thank-you. I personally like the looks of the Grid16. But we would need someway to get the tile area.
    "Logic never changes, just the syntax" - Kyle Undefined?

    Remember, The Edit Button Is There For A Reason!!!

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

    Default

    Quote Originally Posted by Yago View Post
    Thank-you. I personally like the looks of the Grid16. But we would need someway to get the tile area.
    Like this?

    Simba Code:
    Function GridCoords16(Grid16: TPoint): TPoint;
    var
      Yh, yMod: Extended;
    begin
      yMod := 36.0;
      Yh := Abs((Grid16.y+0.0) + yMod);
      Result.x := Round(263.5 + ((Grid16.x)*9.75/(12.8-(Yh/yMod*3.15))) * 9.75);
      Result.y := Round(182.0 + (Grid16.y+0.0) * (6.3 + ((Yh/yMod)*2.4)));
      if not PointInBox(Result, MSBox) then
        Result := Point(-1, -1);
    end;    

    Function GetAbstractGridBoxCords(Grid: TPoint): TPointArray;//Length = 4 always
    var
      T: TPoint;
      i: integer;
    begin
      T := Point(Grid.x*4, Grid.y*4);
      Result := [GridCoords16(Point(T.x-2, T.y-2)), GridCoords16(Point(T.x+1, T.y-2)),
              GridCoords16(Point(T.x+1, T.y+1)), GridCoords16(Point(T.x-2, T.y+1))];
      for i := 0 to 3 do
        if Result[i].x = -1 then
        begin
          Result := [Point(-1,-1), Point(-1,-1), Point(-1,-1), Point(-1,-1)];
          Exit;
        end;
    end;


    Function GetGridPos(PT: TPoint): TPoint;
    var
      x, y: integer;
      TPA: TPointArray;
    begin
      Result := Point(-100, -100); //fail point
      for x := -8 to 8 do
       for y := -8 to 5 do
       begin
         TPA := GetAbstractGridBoxCords(Point(x,y));
         if TPA[0].x = -1 then
           Continue;
         if InAbstractBox(TPA[0].x, TPA[0].y, TPA[1].x, TPA[1].y, TPA[2].x, TPA[2].y, TPA[3].x, TPA[3].y, PT.x, PT.y) then
         begin
           Result := Point(x, y);
           Exit;
         end;
       end;
    end;

    Still working on it, like adding Height or just using X/Y mods.
    (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.

  8. #33
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by Narcle View Post
    I plan on adding it to math.simba. Also I'm really debating on using this for our MMtoMS instead (its way more accurate I think).
    Seems more accurate, works better on opening doors then the old one. Good Job

  9. #34
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Narcle, I wrote these while rewriting the randoms. Very useful for just creating a standard grid for the inventory, or bank, for example. I'll be using it to create boxes to check for items in Mordaut and Quiz, probably some others as well (and it can probably be used for inventory/bank, for later versions of SRL).

    I was probably going to add them to math.simba, so if you want to add them when you add yours, feel free.
    Simba Code:
    (*
    GridBox
    ~~~~~~~

    .. code-block:: pascal

        function GridBox(slot, columns, rows, w, h, diffX, diffY: integer; startPoint: TPoint): TBox;

    Returns a TBox of the slot 'slot' in a grid created by the other parameters.
    Slots start with 1 being the top left of the grid, and counting accross.
        * columns: number of columns in the grid
        * rows: number of rows in the grid
        * w: the width of each box in the grid
        * h: the height of each box in the grid
        * diffX: pixels from center to center (x)
        * diffY: pixels from center to center (y)
        * startPoint: the center point of the top left box in the grid

    .. note::

        Author: Coh3n
        Last Modified: Jan. 25th, 2012 by Coh3n

    Example:

    .. code-block:: pascal

        Result := GridBox(Slot, 4, 2, 95, 80, 0, 150, Point(110, 100));
    *)

    function GridBox(slot, columns, rows, w, h, diffX, diffY: integer; startPoint: TPoint): TBox;
    begin
      if (slot > (columns * rows)) then
      begin
        writeln('GridBox: Invalid slot: '+toStr(slot));
        exit;
      end;

      result.x1 := (startPoint.x + (((slot - 1) mod columns) * diffX) - (w / 2));
      result.y1 := (startPoint.y + (((slot - 1) div columns) * diffY) - (h / 2));
      result.x2 := (result.x1 + w);
      result.y2 := (result.y1 + h);
    end;

    (*
    Grid
    ~~~~

    .. code-block:: pascal

        function Grid(columns, rows, w, h, diffX, diffY: integer; startPoint: TPoint): TBoxArray;

    Returns a grid of TBoxes (see GridBox for parameters).

    .. note::

        Author: Coh3n
        Last Modified: Jan. 25th, 2012 by Coh3n

    Example:

    .. code-block:: pascal

        SMART_DrawBoxes(false, Grid(5, 10, 20, 20, 25, 25, point(30, 30)), clYellow);
    *)

    function Grid(columns, rows, w, h, diffX, diffY: integer; startPoint: TPoint): TBoxArray;
    var
      i: integer;
    begin
      setLength(result, (columns * rows));

      for i := 0 to high(result) do
        result[i] := GridBox(i + 1, columns, rows, w, h, diffX, diffY, startPoint);
    end;
    Used like:
    Simba Code:
    (**
     * Author: Coh3n
     * Description: Returns a TBox of the small puzzle item slot 'Slot'. Top right
     * is slot 1, botton right is slot 8.
     *)

    function MD_SmallBox(Slot: Integer): TBox;
    begin
      Result := GridBox(Slot, 4, 2, 95, 80, 95, 150, Point(110, 100));
    end;
    Doesn't really have much to do with this thread, other than they're a different kind of grid function. You can test by calling
    Simba Code:
    SMART_DrawBoxesEx(false, Grid(4, 2, 95, 80, 95, 150, Point(110, 100)), clGreen);

  10. #35
    Join Date
    Dec 2009
    Location
    R_GetPlayerLoc;
    Posts
    2,235
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    I was facing north at highest angle.

    Now i ran the grid 16 box code to draw all the tiles, and I noticed that the lower left tiles on screen are bit(maybe more) off
    "Logic never changes, just the syntax" - Kyle Undefined?

    Remember, The Edit Button Is There For A Reason!!!

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

    Default

    Quote Originally Posted by Yago View Post
    I was facing north at highest angle.

    Now i ran the grid 16 box code to draw all the tiles, and I noticed that the lower left tiles on screen are bit(maybe more) off
    The height of the tiles will mess it up even if they're flat.
    (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.

  12. #37
    Join Date
    Dec 2009
    Location
    R_GetPlayerLoc;
    Posts
    2,235
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by Narcle View Post
    The height of the tiles will mess it up even if they're flat.
    OK I get it.
    "Logic never changes, just the syntax" - Kyle Undefined?

    Remember, The Edit Button Is There For A Reason!!!

  13. #38
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Seeing as, would this work for random's like evil twin? considering the Camera move's out from a fixed point?

  14. #39
    Join Date
    Jul 2007
    Location
    Finland
    Posts
    304
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by pur3b100d View Post
    Seeing as, would this work for random's like evil twin? considering the Camera move's out from a fixed point?
    No, because minimap is blacked out

  15. #40
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by nokkasiili View Post
    No, because minimap is blacked out
    Shouldn't make a difference unless you're looking for a color on the minimap, then calling MMToMS.

  16. #41
    Join Date
    Nov 2010
    Posts
    86
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Is this still alive? Looked very promising!

    Luke

  17. #42
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    It's already been added to SRL.

  18. #43
    Join Date
    Sep 2007
    Location
    Australia, NSW
    Posts
    934
    Mentioned
    6 Post(s)
    Quoted
    145 Post(s)

    Default

    I'm playing around with these functions at the moment, and it seems as though it only works when you are fully zoomed in (in RS visual settings). I thought that it was standard to have it zoomed all the way out? I would try and fix it, but I have no idea of the maths involved! So yeah - just wanted to give you guys the heads up on this, and if anyone knows the maths for how to make it compatible with the zoomed out.

    Also, the boxes left-hand side are weird, and some boxes are incomplete :/ I've had a look at the code, and it seems all good - Narcle is pretty beast... I wanted to use those boxes to search in and stuff

    I'm using this:
    Simba Code:
    program new;
    {$DEFINE SMART8}
    {$I SRL/SRL.Simba}
    {$I SRL/SRL/Misc/SmartGraphics.Simba}

    Function GridCoords16(Grid16: TPoint): TPoint;
    var
      Yh, yMod: Extended;
    begin
      yMod := 36.0;
      Yh := Abs((Grid16.y+0.0) + yMod);
      Result.x := Round(263.5 + ((Grid16.x)*9.75/(12.8-(Yh/yMod*3.15))) * 9.75);
      Result.y := Round(182.0 + (Grid16.y+0.0) * (6.3 + ((Yh/yMod)*2.4)));
      if not PointInBox(Result, MSBox) then
        Result := Point(-1, -1);
    end;

    Function MMtoMSG16(x, y: integer): TPoint;
    begin
      Result := GridCoords16(Point(x-627, y-85));
    end;

    procedure DrawGridBox(PT: TPoint; Color: integer);
    var
      T: TPoint;
      i: integer;
      ATPA: T2DPointArray;
    begin
      T := Point(PT.x*4, PT.y*4);
      SetLength(ATPA, 4);
      ATPA[0] := [GridCoords16(Point(T.x-2, T.y-2)), GridCoords16(Point(T.x+1, T.y-2))];
      ATPA[1] := [GridCoords16(Point(T.x-2, T.y+1)), GridCoords16(Point(T.x+1, T.y+1))];
      ATPA[2] := [GridCoords16(Point(T.x-2, T.y-2)), GridCoords16(Point(T.x-2, T.y+1))];
      ATPA[3] := [GridCoords16(Point(T.x+1, T.y-2)), GridCoords16(Point(T.x+1, T.y+1))];

      for i := 0 to 3 do
      begin
        if (ATPA[i][0].x = -1) or (ATPA[i][1].x = -1) then
          Continue;
        SMART_DrawLine(False, ATPA[i][0], ATPA[i][1], Color);
      End;
    end;

    var
      x, y, i: integer;
      T: TPoint;
      npc: TPointArray;
    begin
      SRL_SixHourFix := True;
      Smart_FixSpeed := True;
      SetupSRL;
      //SaveScreenshot(AppPath+'Grid shit 3.bmp');

      SMART_ClearCanvas;

      for x := -36 to 36 do
        for y := -30 to 14 do
        begin
          T := GridCoords16(Point(x, y));
          if (T.x = -1) then
            Continue;
          //SMART_DrawBoxEx(False, GridBox(Point(x, y)), clRed);
          if (x = 0) and (y = 0) then
            SMART_DrawDotsEx(false, [GridCoords16(Point(x, y))], clRed)
          else
            SMART_DrawDotsEx(false, [GridCoords16(Point(x, y))], clBlue);

        end;

      for x := -8 to 8 do
        for y := -8 to 5 do
         DrawGridBox(Point(x,y), clGreen);

      npc := GetMiniMapDots('npc');

      for i := 0 to high(NPC) do
      Begin
        T := MMtoMSG16(NPC[i].x, NPC[i].y);
        if not PointInBox(T, MSBox) then
          Continue;
        SMART_DrawDotsEx(false, [T], clRed);
        SMART_DrawBoxEx(False, False, IntToBox(T.x-2, T.y-2, T.x+2, T.y+2), clYellow);
        SMART_DrawBoxEx(False, False, IntToBox(T.x-10, T.y-30, T.x+10, T.y+10), clBlue);
      end;
    end.


    INACTIVE
    How-to: Make S.M.A.R.T. less laggy

    Sell me your Maple Shieldbows (u)! Up to 95gp ea!

    My Scripts:
    Ivy Chopper Ultra [RS3] | Fantastic Fletcher [RS3]
    99 x78 | 99 x10 | 99 x2 | 99 x12


    Use the REPORT tags when posting progress reports to make life easier (:
    [REPORT]Put progress report in here![/REPORT]

    Super Savvy Smither V1.06Cool Classy Cooker V1.02 [EoC]

  19. #44
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    @-daazndagger-

    Yeah this is the main problem, MMtoMS functions were designed back when that was the zoom setting, but semi recently jagex released custom zoom-able and for obvious reasons the furthest zoom is the best/most used. Im sure its an easy fix if you created it (hey @Narcle ) or if you understand the math, must be something like adding more tiles or something.

  20. #45
    Join Date
    Jul 2015
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Is this still used/viable?

  21. #46
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    Quote Originally Posted by The Livid Farmer View Post
    Is this still used/viable?
    http://docs.villavu.com/srl-6/minima...nttomainscreen
    https://villavu.com/forum/showthread.php?t=113092

  22. #47
    Join Date
    Jul 2015
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

Page 2 of 2 FirstFirst 12

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
  •