Log in

View Full Version : Reflection won't walk to a tile.. :(



zeeky111
02-12-2011, 03:43 AM
Here's my procedure:
procedure WalkToRange;
var
RangeTile : TTile;
Me : TMe;
begin
Me := GetMe;
RangeTile := Tile(Rx, Ry);
if (Me.Tile = RangeTile) then Exit;
WalkToTile(RangeTile, 0, 1);
Writeln('Walked to range.');
end;

It (in context with the rest of the script) logs in, and sets the compass and angle as per requested..
But then it just writes the debug 'Walked to range.' and exits.

(Rx and Ry are global constants, set to the respective x and y of the tile next to the range in Al Kharid.)

What's with this stuff? (This is my first time using this particular part of Reflection.)
Thanks.

i luffs yeww
02-12-2011, 04:16 AM
Most likely you have the tile wrong. Try..


procedure WalkToRange;
var
RangeTile : TTile;
Me : TMe;
begin
Me := GetMe;
RangeTile := Tile(Me.x + 5, Me.y + 5);
//if (Me.Tile = RangeTile) then Exit;
WalkToTile(RangeTile, 0, 1);
Writeln('Walked to range.');
end;


Just to see if it will click tiles. If that's the case then your tile's wrong.

RISK
02-12-2011, 04:21 AM
If you used PathMaker to get the tile, are your offsets set correctly? They should be "2044" and "4168" accordingly.

Also, instead of using Me.Tile, why not just use "if TileOnMS(TTile, 0) then"? It works pretty much exactly as you are trying to do and it won't require your character to be exactly on the tile specified.

And "if TileOnMM(TTile) then" to check if you are near the tile on the minimap to click it or not if you are not near it on the main screen.

KingKong
02-12-2011, 04:35 AM
How close were you to the range when that procedure was called? Because sometime reflection doesn't walk you to a tile if you're too close to it.

Coh3n
02-12-2011, 09:35 AM
How close were you to the range when that procedure was called? Because sometime reflection doesn't walk you to a tile if you're too close to it.
I think it won't walk if you're within 6 tiles of the one you're trying to walk to.