SRL Archive - OSR Help

FindDTMRotated


Nebula

2011-12-28 12:15:32

Hey so I'm trying to use DTMs to walk from the Falador west bank to the low wall agility shortcut. I know I'm doing something wrong since my script doesn't do anything, could someone please help me? The code below is just the part of my script that I need help with. Iv'e cut out everything else.

program NebulaFireOrbs;
{$I SRL/SRL.scar}
var
x, y: integer;
aFound: extended;

Procedure WalkToDungeon;
var
Wall: integer;

begin
Wall := DTMFromString('mWAAAAHicY2FgYPBmYmAIAGJ/Jgi7DSjWAsSdQNwMxCoKMgyf33yCY3TAiIZBAABidgwv');
if (FindDTMRotated(Wall, x, y, MMX1, MMY1, MMX2, MMY2, -Pi, Pi, Pi/360, aFound)) then
begin
Mouse(x, y, 0, 0, true);
FreeDTM(Wall);
end;
end;
begin
SetupSRL;
ActivateClient;
WalkToDungeon;
end.

Brandon

2011-12-28 12:45:15

FindDTMRotated(Wall, X, Y, MMX1, MMY1, MMX2, MMY2, 0, 359, 1, aFound)


This will search every angle between 0 to 360.. incrementing the angle by 1 every time until it finds the DTM.. the way you have it, it searches only twice.. 0 to 180.. then 180 to 360. Which is incredibly inaccurate.

DemiseScythe

2011-12-28 12:52:52

Make angle step Pi/30, you don't need such a high number.

ggzz for FindDTMRotated, measurements need to be in radians, no degress work =s

PS. Whenever you walk or do anything with DTMs you need to have your camera facing the same direction. Say always North or always East.

Then you can call

SetAngle(True);
MakeCompass('n');

and you would only need to look from -Pi/4 to Pi/4 speeding up your procedure.

Brandon

2011-12-28 13:42:47

From: DemiseScythe
Make angle step Pi/30, you don't need such a high number.

ggzz for FindDTMRotated, measurements need to be in radians, no degress work =s

PS. Whenever you walk or do anything with DTMs you need to have your camera facing the same direction. Say always North or always East.

Then you can call

SetAngle(True);
MakeCompass('n');

and you would only need to look from -Pi/4 to Pi/4 speeding up your procedure.



You might be right on that radians thing but I've seen it in degrees before :S And it worked in degrees for my summoning walking.. Iunno but I guess ur right.. all the definition of the function says is Angle :Extended;

DemiseScythe

2011-12-28 13:51:39

I think DTMRotatedSE and those kinds are in degrees, if you look for Rotated in simba, FindDTMRotated without the SE is in a different section.


Top uses radians, bottom ones use degrees, possibly radians too

Nebula

2011-12-28 15:46:24

Thanks guys, now I understand walking with DTMs. +repped

Most of the scripting guides here are really good but the walking ones aren't too great.

remember me

2013-03-04 12:29:10

can i do that facing north, east, south, west in private servers and can i use FindDTMRotated

Sjoe

2013-03-04 12:33:44

From: remember me
can i do that facing north, east, south, west in private servers and can i use FindDTMRotated


Yeah of course, that's the point of Find DTM rotated.