SRL Archive - MSI Suggestions

Read BEFORE writing any color walking code


marpis

2009-11-30 17:19:54

The "official" tutorial thread can be found here. Please post any comments/suggestions on that thread.

Thanks,
The MSI Team

Nava2

2009-11-30 23:08:20

Radial walks should be made to be independent of the angle of the compass :D

marpis

2009-12-01 01:17:49

From: Nava2
Radial walks should be made to be independent of the angle of the compass :D


You mean RadialWalk(FindVarrockRoadColor, GetCompassAngleDegrees + 30, GetCompassAngleDegrees + 50, 72);
??

Hmm true, don't know if it works that way. We should have a function for that..

Nava2

2009-12-01 09:22:19

From: marpis
You mean RadialWalk(FindVarrockRoadColor, GetCompassAngleDegrees + 30, GetCompassAngleDegrees + 50, 72);
??

Hmm true, don't know if it works that way. We should have a function for that..


There was one.. I have one or two lying around.

marpis

2009-12-01 15:06:47

From: Nava2
There was one.. I have one or two lying around.


Feel free to commit. ;)

E: Or paste it here if you don't have commit privileges.

Coh3n

2009-12-01 15:50:44

I'm interested to know how that would work actually, if you don't mind explaining. ;)

lordsaturn

2009-12-01 16:06:01

Isn't there a RadialWalkNorth function?

Markus

2009-12-01 16:49:21

Not that I have anything to do with this (or MSI for the matter), but I felt like posting =)

Back in 2007 when SKy Scripter and I joined a scripting competition (Freddy: you still owe me a script encryption and Bobarkinator still owes me a mill), we modified radialwalk to take the compass-angle into account itself. Basically before it did anything it added the compass angle to the begin/end angle.
Small quick RRW hack which does this too:


{*******************************************************************************
function RadialWalkCInd(TheColor, StartRadial, EndRadial, Radius, Xmod, Ymod: Integer): Boolean;
By: Nielsie95, mod by Markus
Description: Walks TheColor from StartRadial to EndRadial for Radius Distance, Compass Independent
Valid Arguments:
TheColor: Any Color, but Road- or WaterColor will do fine :)
StartRadial/EndRadial: Any number between 0-720. 0=N,90=E,180=S,270=W.
Radius: Distance from the centre of minimap, i.e. how far away the mouse clicks. Use numbers 20-72
XMod, YMod: deviation from MouseFindFlag. -2 to 2.
*******************************************************************************}
function RadialWalk(TheColor, StartRadial, EndRadial, Radius, Xmod, Ymod: Integer): Boolean;
var
TPA: TPointArray;
I: Integer;
C: Integer;
begin
Result := False;
C := GetCompassAngle;
if (C < 0) then
Exit;
StartRadial := StartRadial + C;
EndRadial := EndRadial + C;
if RadialWalkEx(tpa, MMCX, MMCY, TheColor, 0, StartRadial, EndRadial, 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;
Exit;
end;
end;

Got no idea of this compiles or not but it should work just fine.

*leaves these forums quietly without anyone noticing*

Wizzup?

2009-12-01 16:54:10

From: Markus
Not that I have anything to do with this (or MSI for the matter), but I felt like posting =)

Back in 2007 when SKy Scripter and I joined a scripting competition (Freddy: you still owe me a script encryption and Bobarkinator still owes me a mill), we modified radialwalk to take the compass-angle into account itself. Basically before it did anything it added the compass angle to the begin/end angle.
Small quick RRW hack which does this too:


{*******************************************************************************
function RadialWalkCInd(TheColor, StartRadial, EndRadial, Radius, Xmod, Ymod: Integer): Boolean;
By: Nielsie95, mod by Markus
Description: Walks TheColor from StartRadial to EndRadial for Radius Distance, Compass Independent
Valid Arguments:
TheColor: Any Color, but Road- or WaterColor will do fine :)
StartRadial/EndRadial: Any number between 0-720. 0=N,90=E,180=S,270=W.
Radius: Distance from the centre of minimap, i.e. how far away the mouse clicks. Use numbers 20-72
XMod, YMod: deviation from MouseFindFlag. -2 to 2.
*******************************************************************************}
function RadialWalk(TheColor, StartRadial, EndRadial, Radius, Xmod, Ymod: Integer): Boolean;
var
TPA: TPointArray;
I: Integer;
C: Integer;
begin
Result := False;
C := GetCompassAngle;
if (C < 0) then
Exit;
StartRadial := StartRadial + C;
EndRadial := EndRadial + C;
if RadialWalkEx(tpa, MMCX, MMCY, TheColor, 0, StartRadial, EndRadial, 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;
Exit;
end;
end;

Got no idea of this compiles or not but it should work just fine.

*leaves these forums quietly without anyone noticing*


I just did this in my scripts, rather than in the core function. Just as easy. :)