Community Forum

Check if implement is attached via 3 point Linkage or trailerLow

Forum Overview >> Scripting

CategoryScripting
Created12.03.2017 15:07


Eanna Wood (Eanan5) 12.03.2017 15:09
My new mod has two attachers. One on the drawbar and one 3 point linkage. How can I check which one it is attached by?
I plan to use some code like this https://gdn.giants-software.com/documentation_scripting.php?version=script&category=70&class=2583#getIsInputAttacherActive35544

But how do I make reference to "inputAttacherJoint"? Is it by Node?

Eanna Wood (Eanan5) 12.03.2017 16:56
Hi,
I figured it out and did it like so

Visnode = self.node
local jointDesc = attacherVehicle.attacherJoints[jointDescIndex];
if jointDesc.jointType == AttacherJoints.JOINTTYPE_IMPLEMENT then
for _, tool in pairs(self.movingTools) do
if tool.disableInTrailerMode then
tool.isActive = true;
end;
end;
setVisibility(Visnode, true);
else
self:playAnimation("drawbarSetup", -1, nil, true);
for _, tool in pairs(self.movingTools) do
if tool.disableInTrailerMode then
tool.isActive = false;
end;
end;
setVisibility(Visnode, false);
end;
end;


Note: Log in to post. Create a new account here.