SRL Archive - Help and Support

Ignoring Colors while using a DDTM?


Special Ed

2007-07-28 17:00:14

Hey I was wondering on if there was a way, when using a DDTM to make it ignore certain colors. For example you are making a DDTM of a T in the road but you want it to ignore the Player Colors, so if on of the subpoints where to end up landing on a Player dot or something it would still find the DTM. See the problem I am having is when I try to make certain DDTM's people always end up walking where one of the Sub Points need to be then it either "a" lags and rotates the DDTM a bunch creating substantial hang, or "b" it doesn't find the DDTM. Yes I've tried recreating the DDTM many many times, and I've found one DDTM that has worked perfectly so far except the spot where one of the Sub Points are is a spot where people walk a lot so it tends to not find the DDTM. If I increase the area of where the Sub Point should be in it finds a different spot somewhere else, so basically what I'm asking is, is there a way to make it look for the Normal Sub Points but if it find the Color of a player / monster dot / item dot at the location it will ignore it and still consider the spot correct? Or at least is there a way to make SCAR disregard "Seeing" certain DTM's like, make it ignore player dots, and item dots, ect. So if anyone can answer my question or give me an example or some help it would be much appreciated.

- Special Ed

P.S. if you need the DDTM I'm using I'd be more than glad to post it, the current one I'm having some issues with isn't necissarily a "T" but its kind of a squiggle in the road, just let me know if you need to see the DDTM.

Bobarkinator

2007-07-28 17:51:17

Can't you just leave that subpoint off and make a different one? Or just have that Subpoint not search for color (I'm not sure if that's possible, I haven't experimented with DDTM's much, or at all)

Santa_Clause

2007-08-01 03:01:24

I thought you could give the subpoints a tolerance of 255…

NewToAutoing

2007-08-01 03:16:15

Santa, you can but then that'd return any spot practically :p The thing that would solve it, would be a way of making each subpoint work for RoadColor or WhiteDotColor. Not sure how to do that though.

Santa_Clause

2007-08-01 03:42:15

Right. Didn't think of that…stupid me. How about an array of colors?

NewToAutoing

2007-08-01 03:47:32

Dunno what you mean? You can only set a subpoint to a single color.

Santa_Clause

2007-08-01 07:06:38

Colours[0] := White;
Colours[1] := RoadColor;

for Colours := 0 to 1 do
SubPoint[1].Color := Colours;

Not sure how colours are declared in a DDTM but I don't see why you couldn't do that?

Special Ed

2007-08-01 12:07:58

Hey apparently that works, sweet! I hope this actually works when it uses the DDTM to search, I have gotten a chance to try it in game but I guess it should work.


Color[0]:= RoadColor;
Color[1]:= White;

for i:= 0 to 1 do
SubPoints[0].Color:= Color[i];

Works, but I haven't tested actually using the DDTM, I hope it works because that would be kind of awesome, XD.

NewToAutoing

2007-08-01 18:15:48

It'd work, but it'd only search for the last one then. Meaning, if you did that and then AddDTM, or whatever it is (i haven't messed around with DDTMs in a while :p) Then it'd add the last color you set the subpoint to. So, if you searched for that DDTM then it'd just be like searching for a DDTM where you set the subpoint in question to the last color.

In otherwords, it's like saying
x:= 10;
x:= 5;
Writeln(IntToStr(x+5));

It doesn't matter what you set it to first, since the last one is the one that gets used.

If you mean, like this though
x:= 10;
Writeln(IntToStr(x+5));
x:= 5;
Writeln(IntToStr(x+5));

Except instead of that example, it'd be like Subpoint.Color := RoadColor, then DTM1 := AddDTM(Blah) then Subpoint.Color := WhiteDotColor, then DTM2 := AddDTM(Blah). Kinda like that if that makes any sense.

In theory, you might be able to try something like making a DDTM with the first subpoint as roadcolor, then have another made with the first subpoint as WhiteDotColor, and so on. It'd be awfully annoying to make though, i think. Dunno if it'd even work.

Infantry001

2007-08-01 20:43:23

Just make it a larger area. That's why that function is there o_0

Dark_Sniper

2007-08-01 22:07:35

ya most my dtm & DDTMs have a area size of 2-5…

Santa_Clause

2007-08-01 22:59:34

Lmao…I thought the maximum you could have was 1…I really should look into DDTM's…

Fizzi

2007-08-02 14:59:39

Couldn't you just make two DDTM's? One with the white subpoint where there is a lot of people, and the other with the roadcolor. Then have it check for the DDTM with the roadcolor, and then if it doesn't find it have it search for the DDTM with the white subpoint. Also, I would add extra tolerance to the white subpoint, because player dots are not purely white.

Dan Cardin

2007-08-02 15:36:05

no, you dont really need tolerance on the white dot, cuz they're all the same. could you do

procedure WhateverDDTM;
begin
case done of
1:Color:=453435
coordx:=53
Coordy:=534
2:Color:=453435
coordx:=53
Coordy:=534
3:Color:=453435
coordx:=53
Coordy:=534
end;
end;

procedure DDTM;
begin
MainPoint .x:=625;
MainPoint .y:=34;
MainPoint .areasize:=1
MainPoint .areashape:=0;
MainPoint .color:=6843241;
MainPoint .tolerance:=10;

SubPoints[0].x:=Coordsx; //this is ur thing
SubPoints[0].y:=Coordsy;
SubPoints[0].areasize:=1;
SubPoints[0].areashape:=0;
SubPoints[0].color:=Color;
SubPoints[0].tolerance:=10;

SubPoints[1].x:=623;
SubPoints[1].y:=30;
SubPoints[1].areasize:=1;
SubPoints[1].areashape:=0;
SubPoints[1].color:=6843241;
SubPoints[1].tolerance:=10;

MasterTDTM.MainPoint := MainPoint;
MasterTDTM.SubPoints := SubPoints;
TheDTM:= AddDTM(MasterTDTM);
end;

repeat
WhateverDDTM;
DDTM;
done:=done+1
until done >=3

basic outline maybe?

Fizzi

2007-08-02 15:41:40

From: dan cardin
no, you dont really need tolerance on the white dot, cuz they're all the same.


Right, I was just thinking since the white player dots has some white pixels and some grey pixels that tolerance would work to see both of those colors, but I guess if you set the areasize to 1 it'll find a white pixel somewhere, so you're right :).

Infantry001

2007-08-03 00:49:13

actually, Santy, the maximum area for the MainPoint is 1. THe rest can be as big as you want them.

Miitchyy

2007-08-03 02:16:40

erm…Couldn't you just do
repeat
Wait(500 + Random(250));
until(FindMyDTMHere);
People move, it would just wait til they are gone, and if it doesnt find after a certain amount of times you could get it to change player

Santa_Clause

2007-08-06 07:56:19

It probaby would…but the script would be slowed down a little.

[Offtopic] I love how everyone calls me Santy now :p [/Offtopic]

Dan Cardin

2007-08-06 08:47:26

no one commmented on my idea…would it work?

SET - Santy's Elf Talker
SMF - Santy's Monster Fighter
that plus santy sounds cool

Special Ed

2007-08-06 17:28:46

I was just wondering if you could ignore pixels, I know you could use two different DDTM's but I was just wondering if there was a way around it.

Santa_Clause

2007-08-06 20:01:55

I still reckon my way should work, even though NewToAutoing says it won't :p

Dan Cardin

2007-08-06 20:32:04

mine is the same thing as yours but in a case and in a different procedure which might get rid of the problem the NewToAutoing says ull have

Dark_Sniper

2007-08-06 21:01:02

lol area size should answer your problem..

just make your main point…. a place where players and NPc cannot go (like a rock)

Bobarkinator

2007-08-06 21:33:45

[OffTopic]I've always wondered what exactly area size does?[/OffTopic]

Santa_Clause

2007-08-07 07:03:08

Erm…it's the size of the point…in pixels I think…

Rikje

2007-08-07 10:32:37

iam not sure but i thinks is like:

with area size 0 he only search on the exact pleace. when you set area size to 1. he will give 1 tol to the point of the dtm. (he gives 1 pixel tol). in case like when the compass is changed a bit.

Bobarkinator

2007-08-07 10:39:12

I thought it might be something like that. Thanks.

Fizzi

2007-08-08 12:36:02

I was thinking about this.. And if you're using this in a radial walking loop, I think the following would be the best way (uses 1 DDTM). SubPoint[3] would be the subpoint which might have a lot of people.

repeat
RadialWalk(Whatever);
FFlag(4);
for i := 0 to 1 do
begin
case i of
0: SubPoint[3].Color := White;
1: SubPoint[3].Color := RoadColor;
end;
if(DTMRotated(YourDDTM, x, y...)) then DTMFound := True;
end;
until(DTMFound);

With failsafes and more stuff added obviously.

Special Ed

2007-08-08 14:40:27

Yea thats what I tried but I think that searches for both, or just the second one I think. Oh and the reason I keep area low, is because if its any higher It will find a different spot lower down than I want.

R0b0t1

2007-08-08 21:24:39

Rofl…

Ever think of just searching for it without white, and then changing it dynamicly to search for it white?

like:


If not (FindDTM(someDTM, stuff...) Then
DTMSUBPOINT.color.....

something along those lines…

Fizzi

2007-08-09 18:40:47

From: Special Ed
Yea thats what I tried but I think that searches for both, or just the second one I think. Oh and the reason I keep area low, is because if its any higher It will find a different spot lower down than I want.


Ah, yeah, you're right, the way I had it wouldn't work. This way would though:


SubPoint[3].Color := PointColor; //Put this wherever you initialized the DDTM
repeat
RadialWalk(Whatever);
FFlag(4);
for i := 0 to 1 do
begin
case i of
0: PointColor := White;
1: PointColor := RoadColor;
end;
if(DTMRotated(YourDDTM, x, y...)) then
begin
DTMFound := True;
Break;
end;
end;
until(DTMFound);
MouseFindNoFlag(x, y, 2, 2);
FFlag(0);
Writeln('We are now at the fork');

This will quickly look for the fork with the white player dot and then if it doesn't find it, it will look for it with the roadcolor dot, then if it still doesn't find it…. it's not there ;). I'd use areasize 3ish i think would be good?

Special Ed

2007-08-12 00:43:13

So you can't make scar ignore colors you just have to make it search for both… hmm, oh well, kinda lame but it still works, thanks everyone for your help.