SRL Archive - SRL Archives

[New] RadialRoadWalkOffNorth


benjaa

2008-12-10 18:42:14

function RadialRoadWalkOffNorth(TheColor: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: Integer) : boolean;
var
Angle : extended;
NewStart, NewEnd : integer;
begin
Angle := rs_GetCompassAngleDegrees;
NewStart := Trunc(StartRadial + Angle);
while ((NewStart) > 360) do
NewStart := NewStart - 360;

NewEnd := Trunc(EndRadial + Angle);
while ((NewEnd) > 360) do
NewEnd := NewEnd - 360;

Result := RadialRoadWalk(TheColor, NewStart, NewEnd, Radius, Xmod, Ymod);
end;

Instead of changing the compass to suit the angle you input, angle is in relation to north. It takes the current angle of the compass, and adds it on then walks it.

For example, if you want to walk East, while facing North the angle will be 90. But if you're facing South, the angle will be 270.

While facing south, your compass angle is 180.
90 + 180 = 270;
Taa daa!

Please tell me what you think

Uploaded A Test
Start in Varrock East Bank. Compass in any direction. If you want, you can change the compass ONLY when a red flag is in minimap.

Tester is not 100% effective.

Nava2

2008-12-11 08:13:32

Nice work, It has been done before though.

benjaa

2008-12-11 08:29:43

..Serious?

Bummer - thought I was onto something here

Is it already in includes? I couldn't find

Magiic

2008-12-11 12:09:34

it's not in the includes it's just been done before ;)

TViYH

2008-12-11 16:12:19

Wow. Looks really nice.

It'd be REALLY nice if you could give me a small tutorial, though :)

benjaa

2008-12-11 18:04:44

Do you mean tutorial on how this differs from RadialRoadWalk? or how to radial road walk??

EDit:Uploaded a Tester, if you still would like tut ill do too

TViYH

2008-12-11 19:40:38

I mean a tutorial on how to use it.

benjaa

2008-12-11 20:03:41

ok, ill make later

Naike

2008-12-12 10:22:57

I did one when i started out scripting ^^

Looks good, nice work.