SRL Archive - OSR Help

FindDTMRotated


westkevin12

2013-04-27 08:21:09

i'm missing numbers in finddtmrotaded function and when i look up online what it should look like the parts i have i don't understand so i can't fill them in because idk what to fill them in with. if i could see an example of what it looked like i would know how to write it correctly.

if FindDTMRotatedAlternating(gate, x, y, 560, 12, 720, 156, -30, 45, 1); then


[Error] C:\Simba\Scripts\yanill iron miner banker.simba(70:74): Invalid number of parameters at line 69
Compiling failed.
also if you could tell me how to free all my DTMs when the scripts ends that would be cool. i read a guide on it but forgot i think it was something like freeDTMsonterminate; but it was forever ago when i read that guide

EngageTheRage

2013-04-27 08:33:14

to free you just use

FreeDTM(name);

and make sure you call it before you terminate :)

unfortunately i have no idea about DTM rotated.

westkevin12

2013-04-27 08:34:24

well thanks for the freeDTM command anyways.

westkevin12

2013-04-27 08:41:13

function FindDTMRotatedAlternating( DTM: Integer; out x, y: Integer; x1, y1, x2, y2: Integer; sAngle, eAngle, aStep: Extended; out aFound: Extended): Boolean;

this is the example for the code and I can fill in the beginging but the rest that's missing idk what to put in

Sjoe

2013-04-27 08:53:43

Use FindDTMRotated

function FindDTMRotated(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer; sAngle, eAngle, aStep: Extended; out aFound: Extended): Boolean;


procedure FindDTmr;
var
MahSupahDTM, x, y: Integer;
aFound: Extended;

begin
FindDTMRotated(MahSupahDTM, x, y,MMx1, MMy1, MMx2, MMy2, StartingAngle, EndAngle, aStep, aFound);

//Starting Angle to look for example: 5
//End Anglet to stop looking for example: 180
//aStep, example 2: it will look for the DTM in steps of 2 degrees. (Sorry can't explain it better)
//aFound: stores the angle it was found at. (this is an output!)

EngageTheRage

2013-04-27 08:53:45

EDIT: Sjoe beat me to it :p

westkevin12

2013-04-27 08:55:18

thankyou sjoe!

Sjoe

2013-04-27 09:00:02

From: EngageTheRage
EDIT: Sjoe beat me to it :p


I'm the ninja master :)

From: westkevin12
thankyou sjoe!


Anytime :)

westkevin12

2013-04-27 09:05:21

if FindDTMRotatedAlternating(gate, x, y, 560, 12, 720, 156, -15, 30, 2, aFound)then

had to take the 'out' out of the code before aFound to get it to work but just tested it and it's working now thanks so much sjoe

Sjoe

2013-04-27 09:20:57

From: westkevin12
if FindDTMRotatedAlternating(gate, x, y, 560, 12, 720, 156, -15, 30, 2, aFound)then

had to take the 'out' out of the code before aFound to get it to work but just tested it and it's working now thanks so much sjoe


Yes left the out in mistake :) (editted my post when I saw that)

Glad you got it :p

westkevin12

2013-04-27 09:21:18

ooh guys btw found the guide i was thinking of to free all your dtms
Addonterminate('');
guide on it is here
http://villavu.com/forum/showthread.php?t=78418