SRL Archive - Research & Development Lounge

The revolution of map walking! / RadialWalk


Naike

2008-05-24 12:55:24

Don't you hate minimap when it wont go north ?
When MakeCompass(N) only make it go 330 not 360 degrees and it messes up everything!

Well that long gone!

RadialWalkDegrees & GetMMDegrees is the way to go!!

GetMMDegrees gets the degree of the minimap angle! If minimap is set to
a little bit more then north it will result somewhere around 0 - 20 etc…
True or False?
True counts the degree clockwise ->
False counts from the other way <-

RadialWalkDegrees works like this, Start by setting the degrees/angle while minimap is set to north! when done rotate minimap however you want it and try the function.. Only smart people understand this.

{*************************************************************************************************
Function GetMMDegrees(GetAngleFrom : Boolean): Integer;
By: N1ke!
Description: Gets the minimap angle in degrees. True = Clockwise , False = Not Clockwise
*************************************************************************************************}
Function GetMMDegrees(Clockwise : boolean): Integer;
Var MMDegrees : extended;
Begin
If(Not(LoggedIn))Then Exit;
MMDegrees := (rs_GetCompassAngleDegrees);
If ClockWise then Angle := MMDegrees - Angle;
Result := Round(MMDegrees);
End;

{*************************************************************************************************
Function RadialWalkDegrees(Color: Integer; StartRadial, EndRadial: Integer; Radius: Integer): Boolean;
By: N1ke!
Description:
*************************************************************************************************}
Function RadialWalkDegrees(Color: Integer; StartRadial, EndRadial: Integer; Radius: Integer): Boolean;
Var
M1n, M4x, D3grees: Integer;
begin
If(Not(LoggedIn))Then Exit;
D3grees := GetMMDegrees(True);
M1n := StartRadial - D3grees;
M4x := EndRadial - D3grees;
If M1n < 0 then
begin
M1n := M1n + 360;
M4x := M4x + 360;
StartRadial := StartRadial + 360;
EndRadial := EndRadial + 360;
end;
Result := RadialWalk(Color, M1n, M4x, Radius, 0, 0);
End;

If you don't understand how to use the functions dont even bother to post!

Dusk412

2008-05-24 13:52:51

If this works, you are godly :D. I'll try it out in a few.

mixster

2008-05-24 14:02:43

You could just not have a separate function for GetMMDegrees as it's so short and just have it included into RadialWalkDegrees. Also, you can just have it do if angle < 0 then angle := angle + 360; instead of making it only do it based on a boolean.
Otherwise, it's been done before in scripts, but not posted out loud, so it's nice :)

sirlaughsalot

2008-05-24 14:09:38

OMG so radialwalkdegrees clicks where you want it to no matter how the screen is?

Naike

2008-05-24 15:25:29

Mixter ; If you try making it into 1 function it will be a pain ( Extended to Integer ) much easier this way :) + I needed GetMMdegrees to another function i got.
Also stupid xD, Angle cant be less then 0 if you think about it ;)

Siralot ; Yep, When setting the StartRadial, EndRadial do it with Compass north
and it will work like a dream =]

mixster

2008-05-24 15:34:05

From: N1ke!
Also stupid xD, Angle cant be less then 0 if you think about it ;)

You obviously haven't visited the 12th Dimension much… and my name is mixster with an s in it stupid :p

Naike

2008-05-24 16:10:09

Stupid you talk about Angle? all i can see is degrees xD Stop the weed!

Harry

2008-05-24 18:31:10

From: N1ke!
Stupid you talk about Angle? all i can see is degrees xD Stop the weed!


Agree'd :)


Looks nice! Good work.

mixster

2008-05-25 06:44:50

Don't get involved Hy, your clown face was not included in this conversation, see:

{.include srl/person/mixster.scar}
{.include srl/person/N1ke!.scar}
:p

Anyway, I can see Angle in the one line I gave you and in your GetMMDegrees function (not to mention I meant do that check after applying the - StartDegrees and - EndDegrees) :)
Edit:

function RadialWalk2(TheColor: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
var
offset: Integer;
begin
offset := Round(rs_GetCompassAngleDegrees);
IncEx(StartRadial, offset);
IncEx(EndRadial, offset);
if (StartRadial > 720) or (EndRadial > 720) then
begin
DecEx(StartRadial, 360);
DecEx(EndRadial, 360);
end;
Result := RadialWalk(TheColor, StartRadial, EndRadial, Radius, XMod, YMod)
end;

That's what I mean by it, though I prefer adding on rather than minusing because I'm cool. No extra function needed, just Round(rs_GetCompassAngleDegrees);
Also, in your first function, Angle doesn't actually do anything, yet it's randomly in there (I don't even think it has been declared) and it will just return rs_GetCompassAngleDegrees anyway.

Macrosoft

2008-05-25 18:55:53

I had just started working on the EXACT same idea like 5 minutes ago! U probably did it better than I would have so nice job!

Naike

2008-05-26 02:06:22

mixster : Your idea is waste of time xD ;)

Macrosoft : You kinda helped me scripting when i only was a leecher :o
Student beats the teacher ftw !

Macrosoft

2008-05-26 07:14:27

Student beats teacher because teacher hasn't gone to school in many years. (I haven't scripted for a long time). But don't you worry, ill be polished up and owning you in no time :)

Naike

2008-05-26 13:11:01

We see about that ;)