Transport Fever 2

Transport Fever 2

Better Terrain Layer
GordonDry 2023 年 2 月 10 日 上午 9:43
Fixed and obsolete: Crash with 35171 beta
最后由 GordonDry 编辑于; 2023 年 2 月 12 日 上午 8:45
< >
正在显示第 1 - 10 条,共 10 条留言
GordonDry 2023 年 2 月 10 日 上午 9:52 
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.
最后由 GordonDry 编辑于; 2023 年 2 月 10 日 上午 10:37
GordonDry 2023 年 2 月 10 日 上午 10:32 
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
最后由 GordonDry 编辑于; 2023 年 2 月 10 日 上午 10:40
GordonDry 2023 年 2 月 10 日 上午 10:42 
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  [开发者] 2023 年 2 月 11 日 上午 9:09 
thanks, I noticed, too. I implemented a switch so it's compatible for old and new version
sgup93 2023 年 2 月 12 日 上午 5:39 
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 2023 年 2 月 12 日 上午 8:44 
@sgup93 not needed anymore as the mod already was updated
76561197988559174 2023 年 2 月 26 日 上午 8:08 
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 2023 年 2 月 26 日 上午 8:56 
I got contour lines with 35210.
76561197988559174 2023 年 2 月 26 日 上午 10:44 
Found the issue - contour lines don't work with the "More Line colours" Mod from Lynx.
VacuumTube  [开发者] 2023 年 2 月 26 日 下午 12:57 
thanks for the hint, as far I know, that mod needs to be updated
< >
正在显示第 1 - 10 条,共 10 条留言
每页显示数: 1530 50