SRL Archive - SRL Positioning System

Any way to increse accuracy?


iCURiP

2012-01-05 19:44:34

Basically, in my soul wars script sometimes it will get stuck inside buildings such as the graveyards, because i detect if I'm inside them by getting the players tile and checking if its inside the area, but its odd, because it thinks its outside the building then i decrease or increase the tile by 1 and then it thinks its inside when its outside.


Here is an example of how i detect it…

{*******************************************************************************
Function InArea(T1:TPoint; T2:TPoint):Boolean;
T1 = North-west point of area
T2 = South-eats point of area
Description: Returns true if player is in the area
*******************************************************************************}
Function InArea(T1:TPoint; T2:TPoint):Boolean;
var
P:TPoint;
X1, Y1, X2, Y2 :Integer;
begin
P := SPS_GetMyPos;
X1 := T1.x;
Y1 := T1.y;
X2 := T2.x;
Y2 := T2.y;

Result := (p.x <= X2) and (p.x >= X1) and (p.y <= Y2) and (p.y >= Y1);
Exit;
end;

Function inEastGrave : Boolean;
begin
Result := InArea(Point(850, 4965), Point(860, 4975));
end;

Any help would be greatly appreciated.

iCURiP.

Brandon

2012-01-05 20:10:46


Function AtObelisk: Boolean;
var
OBJ: TBox;
begin
OBJ:= PointToBox(Point(611, 4987), Point(721, 5062));
Result:= PointInBox(SPS_GetMyPos, OBJ);
end;

iCURiP

2012-01-05 20:35:26

From: ggzz

Function AtObelisk: Boolean;
var
OBJ: TBox;
begin
OBJ:= PointToBox(Point(611, 4987), Point(721, 5062));
Result:= PointInBox(SPS_GetMyPos, OBJ);
end;


I will try it, thanks.

iCURiP

2012-01-05 20:41:22

From: iCURiP
I will try it, thanks.


Seems to be working a bit better and slightly faster, thanks :)