SRL Archive - Help and Support

DDTM Editing


Infantry001

2007-08-03 00:50:13

I have tested this, and It has not worked, but I am just asking for a confirmation/more knowledge :P

If you have set a color on the DDTM as a variable, can you change the color during runtime after compiling them, or do you have to recompile the DDTMs again?

Bobarkinator

2007-08-03 01:51:28

I haven't done anything with DDTM's but it would make since for you to have to reload them.

Miitchyy

2007-08-03 02:03:48

I'm 99% Sure you need to remake the DDTM if you change the colour for the points, I've only used DDTM's once though

R0b0t1

2007-08-08 21:32:00

Yep. You do. I just read this 5 minutes ago.

http://www.villavu.com/forum/showthread.php?t=12584

Infantry001

2007-08-08 22:14:14

Doesn't the tut say that you can edit the variables without having to recompile the dtms?

R0b0t1

2007-08-08 22:40:59

Yes, but for the changes to work, you need to re-compile it.

Infantry001

2007-08-09 11:14:48

Alright, thanks.

Fizzi

2007-08-09 18:35:28

This is in the tut and Yohojo does not reinitialize the DDTM.

Procedure FindIt;
Begin
For Z:=1 To 5 Do
Begin
RDTMTol:=RDTMTol+5; // Adds 5 Tolerance
RDTMArea:=RDTMArea+1 // Adds 1 Area
if (FindDTM(YRoadDTM,x, y,MMX1,MMY1,MMX2,MMY2)) Then
begin
Writeln('Found DTM at a tolerance of '+IntToStr(RDTMTol)+
'and an area of '+IntToStr(RDTMArea))
Exit;
End
End
Writeln('DTM Not Found')
End;

I have changed the color of my DDTMs without recompiling them before… You don't have to. As long as the color is saved to a variable, and then you change the variable's value.

DDTMSP[0].Color := Color;

If you change the value of color, it'll change the value of the color of the DTM…

I'm 75% sure I'm right… don't hold me to it though :).

Infantry001

2007-08-10 02:00:10

Lol, alright. Ill experiment a bit more, and see.

R0b0t1

2007-08-10 02:07:42

Hmmm… I thought you did…

Oh well.

Fizzi

2007-10-02 17:48:24

I know that this topic is old, but I would just like to clarify that you do have to recompile the DDTM for it to work, I was wrong before. YoHoJo's tut is a little misleading.

This is what I did:

I call this procedure at script startup, these are the DDTM values that don't change.

procedure SetupClayFarmer;
begin
//Walking DDTM's
FFMP.x := 654;
FFMP.y := 115;
FFMP.AreaSize := 0;
FFMP.AreaShape := 0;
FFMP.Tolerance := 0;

FFSP[0].x := 647;
FFSP[0].y := 95;
FFSP[0].AreaSize := 2;
FFSP[0].AreaShape := 0;
FFSP[0].Tolerance := 0;

FFSP[1].x := 635;
FFSP[1].y := 84;
FFSP[1].AreaSize := 2;
FFSP[1].AreaShape := 0;
FFSP[1].Tolerance := 0;

FFSP[2].x := 617;
FFSP[2].y := 122;
FFSP[2].AreaSize := 2;
FFSP[2].AreaShape := 0;
FFSP[2].Tolerance := 0;

FFSP[3].x := 632;
FFSP[3].y := 117;
FFSP[3].AreaSize := 2;
FFSP[3].AreaShape := 0;
FFSP[3].Tolerance := 0;

FFSP[4].x := 676;
FFSP[4].y := 122;
FFSP[4].AreaSize := 2;
FFSP[4].AreaShape := 0;
FFSP[4].Tolerance := 10;

FFSP[5].x := 683;
FFSP[5].y := 126;
FFSP[5].AreaSize := 2;
FFSP[5].AreaShape := 0;
FFSP[5].Color := MMRoadCol;
FFSP[5].Tolerance := 10;

FMMP.x := 622;
FMMP.y := 83;
FMMP.AreaSize := 0;
FMMP.AreaShape := 0;
FMMP.Tolerance := 0;

FMSP[0].x := 607;
FMSP[0].y := 75;
FMSP[0].AreaSize := 2;
FMSP[0].AreaShape := 0;
FMSP[0].Tolerance := 0;

FMSP[1].x := 599;
FMSP[1].y := 60;
FMSP[1].AreaSize := 2;
FMSP[1].AreaShape := 0;
FMSP[1].Tolerance := 0;

FMSP[2].x := 612;
FMSP[2].y := 94;
FMSP[2].AreaSize := 2;
FMSP[2].AreaShape := 0;
FMSP[2].Tolerance := 0;

FMSP[3].x := 606;
FMSP[3].y := 101;
FMSP[3].AreaSize := 2;
FMSP[3].AreaShape := 0;
FMSP[3].Tolerance := 0;

FMSP[4].x := 640;
FMSP[4].y := 84;
FMSP[4].AreaSize := 2;
FMSP[4].AreaShape := 0;
FMSP[4].Tolerance := 0;

FMSP[5].x := 656;
FMSP[5].y := 79;
FMSP[5].AreaSize := 2;
FMSP[5].AreaShape := 0;
FMSP[5].Tolerance := 0;
end;

Then I have procedures like the ones below. MMRoadCol is a variable that is changing to the color of the road throughout the script.

function MakeFFDDTM : Integer;
var
FFSkel : TDTM;
i : integer;
begin
FFMP.Color := MMRoadCol;
for i := 0 to 5 do FFSP[i].Color := MMRoadCol;
FFSkel.MainPoint := FFMP;
FFSkel.SubPoints := FFSP;
Result := AddDTM(FFSkel);
end;

function MakeFMDDTM : Integer;
var
FMSkel : TDTM;
i : integer;
begin
FMMP.Color := MMRoadCol;
for i := 0 to 5 do FMSP[i].Color := MMRoadCol;
FMSkel.MainPoint := FMMP;
FMSkel.SubPoints := FMSP;
Result := AddDTM(FMSkel);
end;

Now, when I want to search for one of these DDTMs, I do this.

DTMRotated(MakeFFDDTM, x, y, MMX1, MMCY-30, MMX2, MMY2)

This will work to change values.