JANorton
Chieftain
Came across this bug when trying to add a new Tech to the game, basically the tech tree wouldn't connect some pipes correctly when they spanned more than 1 space along the x axis (see first screenshot).
I searched through the TechTree.lua file for the tech tree and found it was due to a typo by the original author, basically he forgot to add the xOffset to downward turning pipes when they were in conjuntion with upward or straight pipes.
To fix the pipe connection issue the following changes need to be made to the TechTree.lua file found in the Assets/InGame/UI/TechTree folder, first, find the section of the code in the below quote, its a fair way down (the file is too long to quote the entire thing) and add the changes highlighted in blue. The result of this Fix can be seen in the second screenshot.
I searched through the TechTree.lua file for the tech tree and found it was due to a typo by the original author, basically he forgot to add the xOffset to downward turning pipes when they were in conjuntion with upward or straight pipes.
To fix the pipe connection issue the following changes need to be made to the TechTree.lua file found in the Assets/InGame/UI/TechTree folder, first, find the section of the code in the below quote, its a fair way down (the file is too long to quote the entire thing) and add the changes highlighted in blue. The result of this Fix can be seen in the second screenshot.
for pipeIndex, thisPipe in pairs(techPipes) do
local tech = GameInfo.Technologies[thisPipe.techType];
local yOffset = (tech.GridY-5)*blockSpacingY + 12 + extraYOffset;
if thisPipe.rightConnectionType >= 1 then
local startPipe = g_PipeManager:GetInstance();
startPipe.TechPipeIcon:SetOffsetVal( tech.GridX*blockSpacingX + blockSizeX + 64, yOffset );
startPipe.TechPipeIcon:SetTexture(right1Texture);
startPipe.TechPipeIcon:SetSize(connectorSize);
local pipe = g_PipeManager:GetInstance();
if thisPipe.rightConnectionType == 1 then
pipe.TechPipeIcon:SetOffsetVal( (tech.GridX)*blockSpacingX + blockSizeX + 96, yOffset ); --original
pipe.TechPipeIcon:SetTexture(right1Texture);
elseif thisPipe.rightConnectionType == 2 then
pipe.TechPipeIcon:SetOffsetVal( (tech.GridX+thisPipe.xOffset)*blockSpacingX + blockSizeX + 96 - 12, yOffset - 15 );
pipe.TechPipeIcon:SetTexture(bottomRightTexture);
pipe.TechPipeIcon:SetTextureOffset(Vector2(72,72));
elseif thisPipe.rightConnectionType == 3 then
--pipe.TechPipeIcon:SetOffsetVal( (tech.GridX+thisPipe.xOffset)*blockSpacingX + blockSizeX + 96 - 6, yOffset - 15 );
--pipe.TechPipeIcon:SetTexture(right2BTexture);
--pipe.TechPipeIcon:SetTextureOffset(Vector2(36,72));
pipe.TechPipeIcon:SetOffsetVal( (tech.GridX)*blockSpacingX + blockSizeX + 96, yOffset );
pipe.TechPipeIcon:SetTexture(right1Texture);
pipe = g_PipeManager:GetInstance();
pipe.TechPipeIcon:SetOffsetVal( (tech.GridX+thisPipe.xOffset)*blockSpacingX + blockSizeX + 96 - 12, yOffset - 15 );
pipe.TechPipeIcon:SetTexture(bottomRightTexture);
pipe.TechPipeIcon:SetTextureOffset(Vector2(72,72));
elseif thisPipe.rightConnectionType == 4 then
pipe.TechPipeIcon:SetOffsetVal( (tech.GridX+thisPipe.xOffset)*blockSpacingX + blockSizeX + 96 - 12, yOffset );
pipe.TechPipeIcon:SetTexture(topRightTexture);
pipe.TechPipeIcon:SetTextureOffset(Vector2(72,0));
elseif thisPipe.rightConnectionType == 5 then
--pipe.TechPipeIcon:SetOffsetVal( (tech.GridX)*blockSpacingX + blockSizeX + 96 - 6, yOffset );
--pipe.TechPipeIcon:SetTexture(right2TTexture);
--pipe.TechPipeIcon:SetTextureOffset(Vector2(36,0));
pipe.TechPipeIcon:SetOffsetVal( (tech.GridX)*blockSpacingX + blockSizeX + 96, yOffset );
pipe.TechPipeIcon:SetTexture(right1Texture);
pipe = g_PipeManager:GetInstance();
-- Modified by Jeremy Norton 05/10/10
--pipe.TechPipeIcon:SetOffsetVal( (tech.GridX)*blockSpacingX + blockSizeX + 96 - 12, yOffset );
--pipe.TechPipeIcon:SetTexture(topRightTexture);
--pipe.TechPipeIcon:SetTextureOffset(Vector2(72,0));
pipe.TechPipeIcon:SetOffsetVal( (tech.GridX+thisPipe.xOffset)*blockSpacingX + blockSizeX + 96 - 12, yOffset );
pipe.TechPipeIcon:SetTexture(topRightTexture);
pipe.TechPipeIcon:SetTextureOffset(Vector2(72,0));
-- End of Changes
elseif thisPipe.rightConnectionType == 6 then
--pipe.TechPipeIcon:SetOffsetVal( (tech.GridX+thisPipe.xOffset)*blockSpacingX + blockSizeX + 96 - 12, yOffset - 6 );
--pipe.TechPipeIcon:SetTexture(right2Texture);
--pipe.TechPipeIcon:SetTextureOffset(Vector2(72,36));
-- Modified by Jeremy Norton 05/10/10
--pipe.TechPipeIcon:SetOffsetVal( (tech.GridX)*blockSpacingX + blockSizeX + 96 - 12, yOffset );
--pipe.TechPipeIcon:SetTexture(topRightTexture);
--pipe.TechPipeIcon:SetTextureOffset(Vector2(72,0));
pipe.TechPipeIcon:SetOffsetVal( (tech.GridX+thisPipe.xOffset)*blockSpacingX + blockSizeX + 96 - 12, yOffset );
pipe.TechPipeIcon:SetTexture(topRightTexture);
pipe.TechPipeIcon:SetTextureOffset(Vector2(72,0));
-- End of Changes
pipe = g_PipeManager:GetInstance();
pipe.TechPipeIcon:SetOffsetVal( (tech.GridX+thisPipe.xOffset)*blockSpacingX + blockSizeX + 96 - 12, yOffset - 15 );
pipe.TechPipeIcon:SetTexture(bottomRightTexture);
pipe.TechPipeIcon:SetTextureOffset(Vector2(72,72));
else-- thisPipe.rightConnectionType == 7 then
--pipe.TechPipeIcon:SetOffsetVal( (tech.GridX)*blockSpacingX + blockSizeX + 96 - 6, yOffset - 6 );
--pipe.TechPipeIcon:SetTexture(right3Texture);
--pipe.TechPipeIcon:SetTextureOffset(Vector2(36,36));
--pipe.TechPipeIcon:SetOffsetVal( (tech.GridX)*blockSpacingX + blockSizeX + 96, yOffset );
--pipe.TechPipeIcon:SetTexture(right1Texture);
--pipe = g_PipeManager:GetInstance();
-- Modified by Jeremy Norton 05/10/10
--pipe.TechPipeIcon:SetOffsetVal( (tech.GridX)*blockSpacingX + blockSizeX + 96 - 12, yOffset );
--pipe.TechPipeIcon:SetTexture(topRightTexture);
--pipe.TechPipeIcon:SetTextureOffset(Vector2(72,0));
pipe.TechPipeIcon:SetOffsetVal( (tech.GridX+thisPipe.xOffset)*blockSpacingX + blockSizeX + 96 - 12, yOffset );
pipe.TechPipeIcon:SetTexture(topRightTexture);
pipe.TechPipeIcon:SetTextureOffset(Vector2(72,0));
-- End of Changes
pipe = g_PipeManager:GetInstance();
pipe.TechPipeIcon:SetOffsetVal( (tech.GridX+thisPipe.xOffset)*blockSpacingX + blockSizeX + 96 - 12, yOffset - 15 );
pipe.TechPipeIcon:SetTexture(bottomRightTexture);
pipe.TechPipeIcon:SetTextureOffset(Vector2(72,72));
end
end