Transport Fever 2

Transport Fever 2

Better Terrain Layer
GordonDry 10 Feb, 2023 @ 9:43am
Fixed and obsolete: Crash with 35171 beta
Last edited by GordonDry; 12 Feb, 2023 @ 8:45am
< >
Showing 1-10 of 10 comments
GordonDry 10 Feb, 2023 @ 9:52am 
I just checked Transport Fever 2\res\config\base_config.lua and what do I see?
It's renamed from
game.config.gui.contourLinesConfig
to
game.config.gui.layers.contourLines

So it's a simple fix - somehow.
You need a double check to make it compatible to the old and the new syntax.
Last edited by GordonDry; 10 Feb, 2023 @ 10:37am
GordonDry 10 Feb, 2023 @ 10:32am 
if (game.config.gui.contourLinesConfig) then game.config.gui.contourLinesConfig.baseColor = { 0.8, 0.8, 0.8, 0 } game.config.gui.contourLinesConfig.contours = { -- baseconfig { id = "majorContour", name = _("Major contour (100 m)"), color = { .05, .05, .05, .5 }, level = 100.0, width = 1.5, fadeDist = -1.0 }, { id = "minorContour", name = _("Minor contour (50 m)"), color = { .05, .05, .05, .5 }, level = 50.0, width = .75, fadeDist = -1.0 }, { id = "intermediateContour", name = _("Intermediate contour (10 m)"), color = { .2, .125, .0, .5 }, level = 10.0, width = .75, fadeDist = 4000.0 }, { id = "detailContour", name = _("Detail contour (2 m)"), color = { .2, .125, .0, .5 * 0.3 }, level = 2.0, width = .75, fadeDist = 500.0 } } game.config.gui.contourLinesConfig.contours[1].width=2.5 game.config.gui.contourLinesConfig.contours[2].width=1 game.config.gui.contourLinesConfig.contours[3].fadeDist=6000 game.config.gui.contourLinesConfig.contours[4].fadeDist=1500 game.config.gui.contourLinesConfig.contours[3].color= { .1, .075, .0, .5 } game.config.gui.contourLinesConfig.contours[4].color= { .1, .075, .0, .25 } elseif (game.config.gui.layers.contourLines) then game.config.gui.layers.contourLines.baseColor = { 0.8, 0.8, 0.8, 0 } game.config.gui.layers.contourLines.contours = { -- baseconfig { id = "majorContour", name = _("Major contour (100 m)"), color = { .05, .05, .05, .5 }, level = 100.0, width = 1.5, fadeDist = -1.0 }, { id = "minorContour", name = _("Minor contour (50 m)"), color = { .05, .05, .05, .5 }, level = 50.0, width = .75, fadeDist = -1.0 }, { id = "intermediateContour", name = _("Intermediate contour (10 m)"), color = { .2, .125, .0, .5 }, level = 10.0, width = .75, fadeDist = 4000.0 }, { id = "detailContour", name = _("Detail contour (2 m)"), color = { .2, .125, .0, .5 * 0.3 }, level = 2.0, width = .75, fadeDist = 500.0 } } game.config.gui.layers.contourLines.contours[1].width=2.5 game.config.gui.layers.contourLines.contours[2].width=1 game.config.gui.layers.contourLines.contours[3].fadeDist=6000 game.config.gui.layers.contourLines.contours[4].fadeDist=1500 game.config.gui.layers.contourLines.contours[3].color= { .1, .075, .0, .5 } game.config.gui.layers.contourLines.contours[4].color= { .1, .075, .0, .25 } end
Last edited by GordonDry; 10 Feb, 2023 @ 10:40am
GordonDry 10 Feb, 2023 @ 10:42am 
There was a weird copy and paste error, apologies.

The above fix works, just replace the according part inside the mod.lua (lines 20 - 32).



btw I edited the mod to these values for my convenience:
numLevels = 20 baseColor = { 0.7, 0.7, 0.7, 0 }
VacuumTube  [developer] 11 Feb, 2023 @ 9:09am 
thanks, I noticed, too. I implemented a switch so it's compatible for old and new version
sgup93 12 Feb, 2023 @ 5:39am 
can someone explain a little more what needs to be replaced? I tried reinstalling the mod which didn't work for me...here is the relevant portion of my LUA...it seems like it was updated from my basic understanding of the code

local contourLinesConfig = game.config.gui.contourLinesConfig if tonumber(getBuildVersion())>35170 then contourLinesConfig = game.config.gui.layers.contourLines end contourLinesConfig.baseColor = { 0.8, 0.8, 0.8, 0 } contourLinesConfig.contours = { -- base_config original values { id = "majorContour", name = _("Major contour (100 m)"), color = { .05, .05, .05, .5 }, level = 100.0, width = 1.5, fadeDist = -1.0 }, { id = "minorContour", name = _("Minor contour (50 m)"), color = { .05, .05, .05, .5 }, level = 50.0, width = .75, fadeDist = -1.0 }, { id = "intermediateContour", name = _("Intermediate contour (10 m)"), color = { .2, .125, .0, .5 }, level = 10.0, width = .75, fadeDist = 4000.0 }, { id = "detailContour", name = _("Detail contour (2 m)"), color = { .2, .125, .0, .5 * 0.3 }, level = 2.0, width = .75, fadeDist = 500.0 } } contourLinesConfig.contours[1].width=2.5 contourLinesConfig.contours[2].width=1.75 contourLinesConfig.contours[3].width=1 contourLinesConfig.contours[3].fadeDist=12000 contourLinesConfig.contours[3].color= { .15, .1, .0, .5 } contourLinesConfig.contours[4].width=.5 contourLinesConfig.contours[4].fadeDist=4000 contourLinesConfig.contours[4].color= { .1, .075, .0, .3 } contourLinesConfig.contours[4].name = _("Detail contour (1 m)") contourLinesConfig.contours[4].level = 1.0 end
GordonDry 12 Feb, 2023 @ 8:44am 
@sgup93 not needed anymore as the mod already was updated
=]Maverick[= 26 Feb, 2023 @ 8:08am 
I guess with 35210 it does not work again? On activating the mod i get a ctd with an error in line 22. But maybe it is a general problem with 35210, as there are no contour lines visible at all?
GordonDry 26 Feb, 2023 @ 8:56am 
I got contour lines with 35210.
=]Maverick[= 26 Feb, 2023 @ 10:44am 
Found the issue - contour lines don't work with the "More Line colours" Mod from Lynx.
VacuumTube  [developer] 26 Feb, 2023 @ 12:57pm 
thanks for the hint, as far I know, that mod needs to be updated
< >
Showing 1-10 of 10 comments
Per page: 1530 50