SRL Archive - Reflection Help

Finding if im in the right place for reflection?


Troll

2010-10-17 14:52:39

Hi again anouther nooby question here :P
Right im trying to to find if im in the right area where the cows are
so far i have

Function CheckInArea:Boolean;
Var Loc :TTile;
Begin
Result := False
Loc := GetMyPos;
If (Loc.x > 3205) And (Loc.x < 3153) And (Loc.Y > 3153) And (Loc.Y < 3354) Then
Begin
Result := True
writeln('yay');
End;
End;

Procedure MainLoop;
Begin
If CheckInArea Then
writeln('in area works');

writeln('not working');
End;

it never returns ya or in area works and yes i already know it always returns not working but i would know if it working because of the bits before.
so how do i get it working?

Thanks again for the help

Naike

2010-10-17 15:06:20

From: Troll Man


Function CheckInArea:Boolean;
Var Loc :TTile;
Begin
Result := False
Loc := GetMyPos;
If (Loc.x > 3205) And (Loc.x < 3153) And (Loc.Y > 3153) And (Loc.Y < 3354) Then
Begin
Result := True
writeln('yay');
End;
End;

Procedure MainLoop;
Begin
If CheckInArea Then
writeln('in area works');

writeln('not working');
End;


Try to use IntInBox(0, 0, IntToBox(0, 0, 0, 0)) instead
the 0's would be your numbers, instead of just 0!

Shuttleu

2010-10-17 15:06:33

try this

Function CheckInArea:Boolean;
Var Loc :TTile;
Begin
Result := False
Loc := GetMyPos;
If MeInBox(IntToBox(3153, 3354, 3205, 3153)) Then
Begin
Result := True
writeln('yay');
End;
End;

Procedure MainLoop;
Begin
If CheckInArea Then
writeln('in area works');

writeln('not working');
End;

~shut