SRL Archive - Reflection Help

MeInBox, TileInBox problems.


kitchenrange

2011-02-03 16:33:25

After posting a thread and speaking with Markus in IRC, I believe there is a
problem with both of these functions.

Here is the link to the thread. Maybe I made a mistake noone has found yet.
http://villavu.com/forum/showthread.php?t=62024

I have also tried using

if MeinBox(MSBox) then ...

never returns positive.

Feroc1ty

2011-02-03 17:01:59

Yeah, I figured it doesn't work QUITE a while ago, here is what I use.

PointInBox(GetMyPos(), TBox)

mormonman

2011-02-03 17:37:08

I think it might be hook issues. I read through both threads and that is the only problem I could think of.

kitchenrange

2011-02-03 18:50:48

Thx Ferocity for your answer, and thank you mormonman for looking through the problem as always. It seems that Reflection developing needs MAJOR attention.

I've replaced with your workaround and it seems to be working. Not sure if its 100% yet.

I also used a workaround for TileInBox. In case someone comes here to find solutions its:

PointInBox(TileToPoint(Tile), TBox)

mormonman

2011-02-03 20:02:27

{*******************************************************************************
function TileInBox(Bounds: TBox; Tile: TTile): boolean;
By: mormonman
Description: Results true if the tile is in the box.
*******************************************************************************}
function TileInBox(Bounds: TBox; T: TTile): boolean;
var
tx, ty, maxx, maxy, minx, miny: integer;
begin
maxx := Max(Bounds.X1, Bounds.X2); maxy := Max(Bounds.Y1, Bounds.Y2);
minx := Min(Bounds.X1, Bounds.X2); miny := Min(Bounds.Y1, Bounds.Y2);
tx := T.X; ty := T.Y;
Result := ((tx >= minx) and (tx <= maxx) and (ty <= maxy) and (ty >= miny));
end;

{*******************************************************************************
function MeInBox(Bounds: TBox): boolean;
By: mormonman
Description: Results true if your char is in the box of tiles.
*******************************************************************************}
function MeInBox(Bounds: TBox): boolean;
var
T: TTile;
begin
T := GetMyPos;
Result := TileInBox(Bounds, T);
end;

TomTuff

2011-02-20 16:04:43

From: mormonman
{snip}


Was this ever commited? I am still having problems with MeInBox.

Bad Boy JH

2011-02-26 04:55:27

Isn't MSBox the coordinates of the MSbox on the screen, which basically means there is only a small section, of the entire runescape world, which would return that as positive…

Feroc1ty

2011-02-26 13:56:06

Use PointInBox(pt,box), that one works perfectly, no clue what's wrong with the tile functions.

Wanted

2011-02-26 14:34:56

Remember…

the tile coordinate plane works differently than the normal X, Y pixel coordinate plane.

Train

2011-02-26 15:21:39

Protip: Create your boxes in IntToBox(South West X, South West Y, North East X, North East Y), then use point in box.

Bad Boy JH

2011-02-27 05:48:57

That has been chaged so it doesn't matter any more…