SRL Archive - OSR Help

DDTM's in Simba?


weequ

2011-11-21 10:13:29

I found some tutorials but they were all made for scar.

I get this error:
Unknown type 'TDTMPointDef'

Sir R. M8gic1an

2011-11-21 10:20:09

Simba has a different type for DTMs, looking for it but can't find it ATM.

Try using the DTM editor and see if that pastes code rather than a string? It'd allow you to use it as a DDTM

And also by looking at https://github.com/MerlijnWajer/Simba/blob/master/Extensions/dtm_editor.sex you can figure out how to make a DDTM

-RM

weequ

2011-11-21 11:08:53

Thanks. I figured I could declare them like this:

function SetDDTM: Integer;
var
TempTDTM: TSDTM;
begin
with TempTDTM do
begin
MainPoint.x := 743;
MainPoint.y := 284;
MainPoint.AreaSize := 0;
MainPoint.AreaShape := 0;
MainPoint.Color := 7568507;
MainPoint.Tolerance := 0;

SetLength(SubPoints, 2);
SubPoints[0].x := 743;
SubPoints[0].y := 284;
SubPoints[0].AreaSize := 0;
SubPoints[0].AreaShape := 0;
SubPoints[0].Color := 7568507;
SubPoints[0].Tolerance := 0;

SubPoints[1].x := 743;
SubPoints[1].y := 284;
SubPoints[1].AreaSize := 0;
SubPoints[1].AreaShape := 0;
SubPoints[1].Color := 7568507;
SubPoints[1].Tolerance := 0;
end;
Result := AddSDTM(TempTDTM);
end;

Wizzup?

2011-11-21 11:31:31

I suppose http://docs.villavu.com/simba/scriptref/dtm.html lacks some information… :)

WT-Fakawi

2011-11-21 11:43:37

This is my "generic" DDTM code:

Procedure AssembleDDTM;                                                     
var
DTMSubPoints: array[0..2] of TDTMPointDef;
DTMMainPoint: TDTMPointDef;
TempTDTM: TDTM;

begin
DTMMainPoint.x:=MMCx;
DTMMainPoint.y:=MMCy;
DTMMainPoint.areasize:=1;
DTMMainPoint.areashape:=0;
DTMMainPoint.color:=0;
DTMMainPoint.tolerance:=255;

DTMSubPoints[0].x:=625;
DTMSubPoints[0].y:=56;
DTMSubPoints[0].areasize:=1;
DTMSubPoints[0].areashape:=0;
DTMSubPoints[0].color:=TheColor;
DTMSubPoints[0].tolerance:=0;

DTMSubPoints[1].x:=628;
DTMSubPoints[1].y:=56;
DTMSubPoints[1].areasize:=1;
DTMSubPoints[1].areashape:=0;
DTMSubPoints[1].color:=TheColor;
DTMSubPoints[1].tolerance:=0;

DTMSubPoints[2].x:=632;
DTMSubPoints[2].y:=56;
DTMSubPoints[2].areasize:=1;
DTMSubPoints[2].areashape:=0;
DTMSubPoints[2].color:=TheColor;
DTMSubPoints[2].tolerance:=0;

TempTDTM.MainPoint := DTMMainPoint;
TempTDTM.SubPoints := DTMSubPoints;
MyDDTM := AddDTM(TempTDTM);
end;

This is my Anchor DDTM. The Mainpoint (in this case centre of mm) has tol 255, so any color will do. This is anchorpoint. The other three points can be positioned anywhere expecting TheColor as input. I use this DDTM-model almost always.

Sir R. M8gic1an

2011-11-21 11:44:56

From: Wizzup?
I suppose http://docs.villavu.com/simba/scriptref/dtm.html lacks some information… :)


It probably lacks a DDTM example ;)

And I just realised I did a bad job searching as I didn't stumble on that although I did look through the documentation and my eye just missed that… :redface: Shameful really.

-RM

weequ

2011-11-21 12:12:16

From: Wizzup?
I suppose http://docs.villavu.com/simba/scriptref/dtm.html lacks some information… :)

MDTM and TDTM part was quite confusing because they didn't work like that I think. I had to use TSDTM instead.

Edit: TDTM doesn't even exist right?


From: WT-Fakawi
This is my "generic" DDTM code:
[Error] (4:32): Unknown type 'TDTMPointDef' at line 3
[Error] (4:32): Unknown identifier '' at line 3
Compiling failed.

WT-Fakawi

2011-11-21 13:06:36

From: weequ
[Error] (4:32): Unknown type 'TDTMPointDef' at line 3
[Error] (4:32): Unknown identifier '' at line 3
Compiling failed.
Hm? I cupasted it from SimplYews and HLR. Works for me.

weequ

2011-11-21 13:50:02

From: WT-Fakawi
Hm? I cupasted it from SimplYews and HLR. Works for me.
Weird. I completely re-installed simba as admin (win 7). Every time I open simba I get this error:
The ordinal 4540 could not be located in the dynamic link library LIBEAY32.dll

Could that error have something to do with your code not working?


Edit: Nvm it works with SRL.

nielsie95

2011-11-21 14:12:51

TDTM is defined in Simba.scar in SRL for Simba. Else you've got to use the Simba alternative (TMDTM).


type
TDTMPointDef = TSDTMPointDef;
TDTMPointDefArray = TSDTMPointDefArray;
TDTM = TSDTM;
function AddDTM(DTM : TDTM) : integer;
begin
result := AddSDTM(dtm);
end;

Wizzup?

2011-11-21 19:14:46

From: Sir R. M8gic1an
It probably lacks a DDTM example ;)

And I just realised I did a bad job searching as I didn't stumble on that although I did look through the documentation and my eye just missed that… :redface: Shameful really.

-RM


Indeed it does. Some example using TMDTM would be nice… :)