SRL Archive - General

FindDTMRotated


WT-Fakawi

2006-02-21 16:15:33

Anybody know how to work with FindDTMRotated? If I can master it, I will make some nice Bank findingroutines. My DTM3Flag works flawless, but I think it is rather clumbsy. It could be done so much better with findDTMRotated….

Sdcit

2006-02-21 19:02:59

Abby made a tutorial on it. I'm sure star could retrieve it for you, but i'll take a look too

driger1592

2006-02-21 20:04:26

Nobody has access to the archives anymore. I'm not sure what you need to know, but here's what I have to offer on the subject:

Function FindDTMRotated(DTM:LongInt; var x,y: LongInt; x1,y1,x2,y2: LongInt; StartAngle: Extended; EndAngle: Extened; AngleStep: Extended; var Angle: Extended): Boolean;

The param DTM is obvious (declare which DTM to use).
Var x and y should also be obvious for you (the variables where the coordinates will be stored).
X1,y1,x2,y2 are, probably also obvious to you, the coordinates to look for the DTM in.
The StartAngle param is simply the angle that the DTM starts at (I'd use 0.0).
The EndAngle is the final angle to stop looking for the DTM at (360 degrees = 6.28318530717959, 180 degrees = 3.14159265358979).
The AngleStep param is how many degrees to go up to search for the rotated DTM each time (ie. AngleStep is .1, it will look at 0.0, then 0.1, then 0.2).
The Angle variable stores the first angle at which the DTM is found.

I hope this has helped :D

PS. I used one of BenLand's math plugins to convert the degrees to the appropriate radian (those long decimals). The formula Pi divided by 180 times times the degree (or angle).

masquerader

2006-02-21 21:12:45

/scripts/test/testrotateddtms.scar shows acceptable parameters

i always wondered if i could get this hooked up with findrs2minimapcompass angle so it would be quicker, but then i remembered i dont like dtms very much

Krazy_Meerkat

2006-02-21 22:37:58

*Tries to understand*

WT-Fakawi

2006-02-22 01:24:04

From: driger1592
Nobody has access to the archives anymore. I'm not sure what you need to know, but here's what I have to offer on the subject:

Function FindDTMRotated(DTM:LongInt; var x,y: LongInt; x1,y1,x2,y2: LongInt; StartAngle: Extended; EndAngle: Extened; AngleStep: Extended; var Angle: Extended): Boolean;

The param DTM is obvious (declare which DTM to use).
Var x and y should also be obvious for you (the variables where the coordinates will be stored).
X1,y1,x2,y2 are, probably also obvious to you, the coordinates to look for the DTM in.
The StartAngle param is simply the angle that the DTM starts at (I'd use 0.0).
The EndAngle is the final angle to stop looking for the DTM at (360 degrees = 6.28318530717959, 180 degrees = 3.14159265358979).
The AngleStep param is how many degrees to go up to search for the rotated DTM each time (ie. AngleStep is .1, it will look at 0.0, then 0.1, then 0.2).
The Angle variable stores the first angle at which the DTM is found.

I hope this has helped :D

PS. I used one of BenLand's math plugins to convert the degrees to the appropriate radian (those long decimals). The formula Pi divided by 180 times times the degree (or angle).

! ty
I have consulted Kait, hopefully I will get the functionlist….

Liquid

2006-02-23 16:06:12

Radians are not supposed to be in decimals unless you actualy do the math you are not really supposed to do. :)

Avaphi

2006-06-19 03:21:38

Driger Get on MSN ASAP ! Pl0x ? sorry for the 1337 speak everyone :o

XxKanexX

2006-06-19 03:23:44

How did you not know how to use it Fakawi? It's quite simple. =S

Starblaster100

2006-06-19 05:29:33

yea, ive used them quite a few times, if you need any help just talk to me

XxKanexX

2006-06-19 05:39:59

I just realised this was asked in February, rofl.

Junior

2007-04-13 16:27:49

Ok sorry for bumbing an old thread but I wanted to know how this works. Im using it like this.
if (FindDTMRotated(DoorDTM, MSx1, MSy1, MSx2, MSy2, - 45, 45, .5, Angle) then
Can someone answer me a couple of questions?
Where it says - 45, can I use negative radians or do they have to be decimals? I want it to start from lets say 10 o'clock clockwise to 2 o'clock. It looks like I got angle step down, but im not quite understanding the Angle found in the end of function. If someone can help me that would be great.

Sumilion

2007-04-13 16:37:01

Im not exactly sure what terms to use, but my guess is that what your using is called degrees and that the function is using radians. You should see it like this, 360 degrees is (approx.) 3.14 radians. Does that number look familiar? Well it should, its pi ;). Other than that its linear to degrees. The half of pi is equal to 180 degrees. (Correct me if im wrong pl0x, havent used this function in a loooong time)

tarajunky

2007-04-13 17:16:58

You never have to use negative degrees. Instead of -45 and +45 you can use 315 and 405. Same for radians. Instead of -1 and 1 you can use 5.28 to 7.28. (360 degrees = 2*pi, Sumilion)

I don't think you need to do anything with the Angle variable. I just make a local extended var and stick it in there.

Sumilion

2007-04-14 05:03:43

Oh yeh! doh! 360 was 2*pi, do i feel stupid now :)

Oh well, as i said, havent used it in a while :p