SRL Archive - Help

How can I do this?


peetu

2012-05-04 12:57:13

So when I do FindDTM or something similar the script will search from top left to bottom right. How can I reverse it so that it searches from bottom right to top left?

Rich

2012-05-04 13:00:49

Just reverse the search coordinates (I think), so like this
FindDTM(DTM, X, Y, MSX2, MSY2, MSX1, MSY1)

Narcle

2012-05-04 13:26:15

From: Rich
Just reverse the search coordinates (I think), so like this
FindDTM(DTM, X, Y, MSX2, MSY2, MSX1, MSY1)


Last I knew that gave an error. Search pattern is internal and can't be changed unless you use a different function or there's a way to change it via another method globally.

Rich

2012-05-04 13:49:53

Ah fair enough. In that case I guess you could do multiple searches working upwards.
Eg.
FindDTM(DTM, X, Y MSX2-100, MSY2-100, MSX2, MSY2)
And increase that 100 in intervals until you find what you want. Could be done easier in an for to do loop or a while do.

litoris

2012-05-04 15:15:17

Or, is there a way to skip the found DTMs until the last one is reached?

Rich

2012-05-04 15:45:01

function FindLowDTM(DTM : LongInt, var X : LongInt, var Y : LongInt, XS, YS, XE, YE : LongInt) : Boolean;
var
sX, sY : Integer;

begin
sX:= XS;
sY:= YS;
repeat
if FindDTM(DTM, X, Y, sX, sY, XE, YE) then
begin
Result:= True;
sX:= X;
sY:= Y;
end;
until(not(FindDTM(DTM, X, Y, sX, sY, XE, YE)))
end;
?

Something I just whipped up quickly. Haven't tested it but hopefully it'll work if I've thought it through properly…

bg5

2012-05-04 16:19:27

From: peetu
So when I do FindDTM or something similar the script will search from top left to bottom right. How can I reverse it so that it searches from bottom right to top left?


It's propably impossible ,but why you want to do this? You can simple use
FindDTMs(); to get coords of all DTMs.

Rich

2012-05-04 16:25:04

Wow…Didn't even know about FindDTMs.