SRL Archive - SRL Archives

Independant Compass Radial Walk.


Nava2

2008-05-22 20:27:30

Now, firstly, I haven't tested this. It was merely an idea, and I ran with it.

The concept is this:

If you set up ALL of your scripts with your radial walks at north then your script must always be facing north which could lead to detectability while walking. With this version of RadialWalk, it SHOULD right your compass for the script, but not on RS. This being said, it should walk as if the compass is north while it is at any degrees that the writer has made it be.

After that shpiel, here is the function:


*Edit: Changed CompassAngle to CA; and changed the rs_GetCompassAngle to add Degrees. Thanks Bob.
{Edited from RadialWalk, by Nava2 to include Independent Compass!}

function RadialWalkIC(TheColor: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
var CA, NewStart, NewEnd: integer;
tpa: TPointArray;
i: Integer
begin
Result := False;
CA := Round(rs_GetCompassAngleDegrees);
if not (InRange(CA, 0, 5) or InRange(CA, 355, 360)) then
begin
NewStart := StartRadial - CA;
NewEnd := EndRadial - CA;
end else
begin
NewStart := StartRadial;
NewEnd := EndRadial;
end;
if RadialWalkEx(tpa, MMCX, MMCY, TheColor, 0, NewStart, NewEnd, Radius) then
for i := 0 to High(tpa) do
if MFNF(tpa[i].x, tpa[i].y, Xmod, Ymod) then
begin
FFlag(10);
Result := True;
Break;
end;
end;

I know this compiles but please let me know if it works ;)

Nava2

Bobarkinator

2008-05-23 03:00:48

Ya it works, CompassAngle is already taken, use CA or something.

it's not rs_GetCompassAngle, it's rs_GetCompassAngleDegrees. Other than that, it works fine.

Camaro'

2008-05-23 07:11:27

From: Bobarkinator
Ya it works, CompassAngle is already taken, use CA or something.

it's not rs_GetCompassAngle, it's rs_GetCompassAngleDegrees. Other than that, it works fine.


function RadialWalkIC(TheColor: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
var CA, NewStart, NewEnd: integer;
tpa: TPointArray;
i: Integer
begin
Result := False;
CA := Round(rs_GetCompassAngleDegrees);
if not (InRange(CA, 0, 5) or InRange(CA, 355, 360)) then
begin
NewStart := StartRadial - CA;
NewEnd := EndRadial - CA;
end else
begin
NewStart := StartRadial;
NewEnd := EndRadial;
end;
if RadialWalkEx(tpa, MMCX, MMCY, TheColor, 0, NewStart, NewEnd, Radius) then
for i := 0 to High(tpa) do
if MFNF(tpa[i].x, tpa[i].y, Xmod, Ymod) then
begin
FFlag(10);
Result := True;
Break;
end;
end;

Should work :spot:

gerauchert

2008-05-23 07:55:06

This is a great idea… im gonna try this with my Newt[er]. Some great anti-ban dude

Nava2

2008-05-23 08:12:38

Thanks, and I edited the function; forgot to say I did :D.

Nava2

Gu3st...

2008-05-23 09:27:03

N1ke! already made this.. and its shorter =/

nielsie95

2008-05-23 10:48:59


x := Round(rs_GetCompassAngleDegrees);
UpdateColor('RoadColor');
if (not LinearRoadWalk(RoadColor, 310 + x, 50, 1, 1)) then
Deactivate('Lost while walking to trees using LRW.', 'Lost 1 - Trees');

I used this in omDac (also seen in my 3k thread), it's a lot shorter and also compass independent ;)

Nava2

2008-05-23 15:20:21

From: nielsie95

x := Round(rs_GetCompassAngleDegrees);
UpdateColor('RoadColor');
if (not LinearRoadWalk(RoadColor, 310 + x, 50, 1, 1)) then
Deactivate('Lost while walking to trees using LRW.', 'Lost 1 - Trees');

I used this in omDac (also seen in my 3k thread), it's a lot shorter and also compass independent ;)


Hmm, What are some of those other procedures you used though. And LinearRoadWalk, Is that in MapWalking.scar?

Also, I was unaware that N1ke! made this. Sorry; Either way both of our functions work. Might as well leave it here, and if anyone wants to use it they can. Advantage of mine; it's all in one procedure. Thats the only difference really.

Nava2

XcanadamanX

2008-05-23 21:23:03

From: Nava2
Hmm, What are some of those other procedures you used though. And LinearRoadWalk, Is that in MapWalking.scar?


the other procs are ones he made in his script. yes LRW is in mapwalk.scar

Nava2

2008-05-24 12:36:33

From: XcanadamanX
the other procs are ones he made in his script. yes LRW is in mapwalk.scar


Cool; thanks :)

Nava2