-- Debug Ausgabe: local nepdebug = false local newSettings = { geometryQualityOptions = { { viewNearFar = { 4.0, 30000.0 }, fogStartEndFarPerc = { 0, 1.0 }, lodDistanceScaling = 1.0 }, -- Low1 { viewNearFar = { 4.0, 30000.0 }, fogStartEndFarPerc = { 0, 1.0 }, lodDistanceScaling = 1.0 }, -- Medium { viewNearFar = { 4.0, 30000.0 }, fogStartEndFarPerc = { 0, 1.0 }, lodDistanceScaling = 1.0 }, -- High { viewNearFar = { 4.0, 50000.0 }, fogStartEndFarPerc = { 0, 1.0 }, lodDistanceScaling = 10 }, -- Camera tool { viewNearFar = { 0.5, 30000.0 }, fogStartEndFarPerc = { 0, 1.0 }, lodDistanceScaling = 1.0 }, -- Cockpit view } } local newGui = { landValueColors = { { { 0.341, 0.709, 0.231, 1.0 }, { 0.109, 0.223, 0.074, 1.0 }, }, { { 0.235, 0.580, 0.764, 1.0 }, { 0.078, 0.184, 0.243, 1.0 }, }, { { 0.764, 0.725, 0.235, 1.0 }, { 0.254, 0.243, 0.082, 1.0 }, } }, badGoodColors = { { 0.941, 0.168, 0.156, 1.0}, { 0.941, 0.815, 0.156, 1.0 }, { 0.149, 0.756, 0.062, 1.0 }, }, neutralGoodColors = { { .6, .8, 1.0, 1.0 }, { .6, 1.0, 1.0, 1.0 }, { .6, 1.0, .6, 1.0 }, }, contourLinesConfig = { numLevels = 6, baseColor = { .7, .7, .7, 1.0 }, terrainMinColor = { .82, .82, .82, 1.0 }, terrainMaxColor = { .235, .54, .25, 1.0 }, waterColor = { .47, .64, .76, 1.0 }, contours = { { 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 } } }, defaultChartColors = { { .6, .8, 1.0, 1.0 }, { 1.0, .6, .6, 1.0}, { .525, .847, .345, 1.0 }, { .369, .839, .906, 1.0 }, { .875, .875, .384, 1.0 } }, incomeCostsChartColors = { { .6, .8, 1.0, 1.0 }, { 1.0, .6, .6, 1.0} }, loadedUnloadedChartColors = { { .6, .8, 1.0, 1.0 }, { 1.0, .6, .6, 1.0} }, landUseChartColors = { { .525, .847, .345, 1.0 }, { .369, .839, .906, 1.0 }, { .875, .875, .384, 1.0 } }, lineColors = { { 94/255, 47/255, 0/255 }, { 84/255, 0/255, 0/255 }, { 84/255, 0/255, 84/255 }, { 0/255, 0/255, 84/255 }, { 0/255, 47/255, 84/255 }, { 0/255, 84/255, 84/255 }, { 0/255, 84/255, 0/255 }, { 0/255, 51/255, 18/255 }, { 84/255, 84/255, 0/255 }, { 62/255, 41/255, 35/255 }, { 153/255, 76/255, 0/255 }, { 153/255, 0/255, 0/255 }, { 153/255, 0/255, 153/255 }, { 0/255, 0/255, 153/255 }, { 0/255, 84/255, 153/255 }, { 0/255, 153/255, 153/255 }, { 0/255, 153/255, 0/255 }, { 0/255, 89/255, 31/255 }, { 153/255, 153/255, 0/255 }, { 89/255, 65/255, 55/255 }, { 255/255, 127/255, 0/255 }, { 255/255, 0/255, 0/255 }, { 255/255, 0/255, 255/255 }, { 0/255, 0/255, 255/255 }, { 0/255, 150/255, 255/255 }, { 0/255, 255/255, 255/255 }, { 0/255, 255/255, 0/255 }, { 0/255, 150/255, 53/255 }, { 255/255, 255/255, 0/255 }, { 124/255, 99/255, 85/255 }, { 255/255, 178/255, 102/255 }, { 255/255, 102/255, 102/255 }, { 255/255, 102/255, 255/255 }, { 102/255, 102/255, 255/255 }, { 121/255, 186/255, 255/255 }, { 127/255, 255/255, 255/255 }, { 115/255, 255/255, 115/255 }, { 82/255, 177/255, 105/255 }, { 255/255, 255/255, 115/255 }, { 164/255, 141/255, 121/255 }, { 255/255, 208/255, 161/255 }, { 255/255, 171/255, 171/255 }, { 255/255, 171/255, 255/255 }, { 171/255, 171/255, 255/255 }, { 180/255, 216/255, 225/255 }, { 184/255, 255/255, 255/255 }, { 171/255, 255/255, 171/255 }, { 143/255, 199/255, 148/255 }, { 255/255, 255/255, 171/255 }, { 212/255, 197/255, 174/255 }, }, modifierColors = { { 1.0, .0, .0, .3 }, { 1.0, .0, .0, .4 }, -- tunnel edges { 1.0, .0, .0, .6 }, -- proposal { 1.0, .0, .0, .75 }, -- proposal: tunnel edges { .0, .4, 1.0, .4 }, { .0, .4, 1.0, .5 }, -- tunnel edges { .0, .4, 1.0, .6 }, -- proposal { .0, .4, 1.0, .75 } -- proposal: tunnel edges } } local newtrainBrakeDeceleration = 1.25 function data() return { info = { minorVersion = 0, severityAdd = "NONE", severityRemove = "NONE", name = _("Natural Environment Professional"), description = _("NEP Beschreibung"), tags = { "Europe", "Shader" }, authors = { { name = 'UnixRoot', role = 'CREATOR', text = 'Texturen, Idee', },{ name = 'Grimes', role = 'CREATOR', text = '3D, Texturen, Idee', },{ name = 'Yoshi', role = 'CREATOR', text = 'Script', },{ name = 'eis_os', role = 'CREATOR', text = 'Script', }, }, params = { { key = "renderDistance", name = _("Render Distance"), uiType = "SLIDER", values = { _("10km"), _("20km"), _("30km"), _("40km"), _("50km"),}, tooltip = _("Choose the render distance."), defaultIndex = 2, },{ key = "environment", name = _("Environment"), uiType = "COMBOBOX", values = { _("standard_nep"),_("less_blue_nep"),_("nep_um_6") }, tooltip = _("skybox_tooltip"), defaultIndex = 0, },{ key = "tracktypes", name = _("Select tracktypes"), uiType = "COMBOBOX", values = { _("Rusty tracks only"),_("Rusty tracks only with speedlimmits"),_("New tracks only"),_("New tracks only with speedlimmits"),_("New and rusty tracks"),_("New and rusty tracks with speedlimmits") }, tooltip = _("tracks_tooltip"), defaultIndex = 0, },{ key="nep_makeWhitePolesGreen", name=_("Replace white catenary poles with green"), -- Weiße Masten durch grüne Masten ersetzen uiType="CHECKBOX", defaultIndex=0, },{ key="nep_makeLzbBetonPolesWhite", name=_("Replace concrete catenary poles with white(green) \n(for LZB with sleepers)"), -- Betonmasten durch weiße(grüne) Masten ersetzen (bei LZB außer Feste Fahrbahn) tooltip=_("Replace concrete catenary poles with white(green) \n(for LZB with sleepers)"), -- wird abgeschnitten in GUI... uiType="CHECKBOX", defaultIndex=0, } } }, runFn = function (settings, modParams) local environments = { [0] = "nep_temperate.lua", [1] = "nep_temperate_less_blue.lua", [2] = "nep_um_6.lua", } if modParams[getCurrentModId()] ~= nil then local params = modParams[getCurrentModId()] local distanceFactor = 3 if params["renderDistance"] ~= nil then distanceFactor = params["renderDistance"] / 4 end --local distanceFactor = params["renderDistance"] / 4 game.config.settings = { geometryQualityOptions = { { viewNearFar = { 4.0, 10000.0 + distanceFactor * 40000 }, fogStartEndFarPerc = { 0, 1.0 }, lodDistanceScaling = 1.0 }, -- Low { viewNearFar = { 4.0, 10000.0 + distanceFactor * 40000 }, fogStartEndFarPerc = { 0, 1.0 }, lodDistanceScaling = 1.0 }, -- Medium { viewNearFar = { 4.0, 10000.0 + distanceFactor * 40000 }, fogStartEndFarPerc = { 0, 1.0 }, lodDistanceScaling = 1.0 }, -- High { viewNearFar = { 4.0, 50000.0 }, fogStartEndFarPerc = { 0, 1.0 }, lodDistanceScaling = 10 }, -- Camera tool { viewNearFar = { 0.5, 10000.0 + distanceFactor * 40000 }, fogStartEndFarPerc = { 0, 1.0 }, lodDistanceScaling = 1.0 }, -- Cockpit view } } game.config.environment = environments[params["environment"]] if params["nep_makeLzbBetonPolesWhite"]==1 then addModifier("loadTrack", function(fileName, data) if not fileName:find("block") then -- nur bei LZB mit Schwellen, nicht bei Feste Fahrbahn if data.catenaryPoleModel == "railroad/nep_power_pole_2_beton.mdl" then data.catenaryPoleModel = "railroad/nep_power_pole_2_grau.mdl" end if data.catenaryMultiPoleModel == "railroad/nep_power_pole_1_beton.mdl" then data.catenaryMultiPoleModel = "railroad/nep_power_pole_1_grau.mdl" end if data.catenaryMultiInnerPoleModel == "railroad/nep_power_pole_1b_beton.mdl" then data.catenaryMultiInnerPoleModel = "railroad/nep_power_pole_1b_grau.mdl" -- wird erst mit grau ersetzt - wenn nep_makeWhitePolesGreen aktiv ist, werden diese anschließend noch durch grün ersetzt end end return data end) end if params["nep_makeWhitePolesGreen"]==1 then addModifier("loadTrack", function(fileName, data) if data.catenaryPoleModel == "railroad/nep_power_pole_2_grau.mdl" then data.catenaryPoleModel = "railroad/nep_power_pole_2.mdl" end if data.catenaryMultiPoleModel == "railroad/nep_power_pole_1_grau.mdl" then data.catenaryMultiPoleModel = "railroad/nep_power_pole_1.mdl" end if data.catenaryMultiInnerPoleModel == "railroad/nep_power_pole_1b_grau.mdl" then data.catenaryMultiInnerPoleModel = "railroad/nep_power_pole_1b.mdl" end return data end) end else game.config.settings = newSettings game.config.environment = "nep_temperate.lua" end game.config.trainBrakeDeceleration = newtrainBrakeDeceleration game.config.gui = newGui end, postRunFn = function (settings, modParams) -- Fuegt alternative hinzu fuer neue Gleise local makeAlternativ = function(list) local result = {} for k, item in ipairs(list) do result[k] = "alternativ/"..item end return result end -- Erstellt eine Modul Liste aus Basisnamen local buildPlattformModuleList = function(names) local result = {} for _, name in ipairs(names) do result[#result+1] = "platform_"..name..".module" result[#result+1] = "platform_"..name.."_catenary.module" end return result end -- Erstellt eine Modul Liste aus Basisnamen und Geschwindigkeitsliste local buildPlattformModuleSpeedList = function(names, moduleSpeeds) local result = {} for _, name in ipairs(names) do for _, speed in ipairs(moduleSpeeds[name]) do result[#result+1] = "platform_"..name.."_"..speed..".module" result[#result+1] = "platform_"..name.."_catenary_"..speed..".module" end end return result end -- Tracktype filter: local disableRusty = { "high_speed.lua", "high_speed_block_lzb.lua", "high_speed_gedreht.lua", "high_speed_lzb.lua", "high_speed_lzb_gedreht.lua", "low_speed.lua", "low_speed_gedreht.lua", "standard.lua", "standard_gedreht.lua", } local disableRusty_speedlimmits = { "standard_10.lua", "standard_20.lua", "standard_30.lua", "standard_40.lua", "standard_50.lua", "standard_60.lua", "standard_70.lua", "standard_80.lua", "standard_90.lua", "standard_100.lua", "standard_110.lua", "low_speed_10.lua", "low_speed_20.lua", "low_speed_30.lua", "low_speed_40.lua", "low_speed_50.lua", "low_speed_60.lua", "low_speed_70.lua", "low_speed_80.lua", "low_speed_90.lua", "low_speed_100.lua", "low_speed_110.lua", "low_speed_120.lua", "high_speed_10.lua", "high_speed_20.lua", "high_speed_30.lua", "high_speed_40.lua", "high_speed_50.lua", "high_speed_60.lua", "high_speed_70.lua", "high_speed_80.lua", "high_speed_90.lua", "high_speed_100.lua", "high_speed_110.lua", "high_speed_120.lua", "high_speed_140.lua", "high_speed_lzb_10.lua", "high_speed_lzb_20.lua", "high_speed_lzb_30.lua", "high_speed_lzb_40.lua", "high_speed_lzb_50.lua", "high_speed_lzb_60.lua", "high_speed_lzb_80.lua", "high_speed_lzb_90.lua", "high_speed_lzb_100.lua", "high_speed_lzb_110.lua", "high_speed_lzb_120.lua", "high_speed_lzb_140.lua", "high_speed_lzb_160.lua", "high_speed_lzb_180.lua", "high_speed_lzb_200.lua", "high_speed_lzb_250.lua", "high_speed_block_lzb_120.lua", "high_speed_block_lzb_140.lua", "high_speed_block_lzb_160.lua", "high_speed_block_lzb_180.lua", "high_speed_block_lzb_200.lua", "high_speed_block_lzb_250.lua", "high_speed_block_lzb_300.lua", "standard_gedreht_10.lua", "standard_gedreht_20.lua", "standard_gedreht_30.lua", "standard_gedreht_40.lua", "standard_gedreht_60.lua", "low_speed_gedreht_10.lua", "low_speed_gedreht_20.lua", "low_speed_gedreht_30.lua", "low_speed_gedreht_40.lua", "low_speed_gedreht_60.lua", "low_speed_gedreht_120.lua", "high_speed_gedreht_10.lua", "high_speed_gedreht_20.lua", "high_speed_gedreht_30.lua", "high_speed_gedreht_40.lua", "high_speed_gedreht_60.lua", "high_speed_gedreht_120.lua", "high_speed_gedreht_140.lua", "high_speed_lzb_gedreht_10.lua", "high_speed_lzb_gedreht_20.lua", "high_speed_lzb_gedreht_30.lua", "high_speed_lzb_gedreht_40.lua", "high_speed_lzb_gedreht_60.lua", "high_speed_lzb_gedreht_120.lua", "high_speed_lzb_gedreht_140.lua", "high_speed_lzb_gedreht_160.lua", } local generelldisable_speedlimmits = { "high_speed_lzb_10.lua", "high_speed_lzb_20.lua", "high_speed_lzb_30.lua", "high_speed_lzb_40.lua", "high_speed_lzb_50.lua", "high_speed_lzb_60.lua", } local disableNew = makeAlternativ(disableRusty) local disableNew_speedlimmits = makeAlternativ(disableRusty_speedlimmits) -- Eigene Module und Geschwindigkeiten local moduleBaseNames = {"track", "low_speed_track", "high_speed_track", "high_speed_track_lzb" } local moduleSpeeds = { ["track"] = { 10,20,30,40,60 }, ["low_speed_track"] = { 10,20,30,40,60,120 }, ["high_speed_track"] = { 10,20,30,40,60,120,140 }, ["high_speed_track_lzb"] = { 10,20,30,40,60,120,140,160 }, } local modulesRusty = buildPlattformModuleList(moduleBaseNames) local modulesRusty_speedlimmits = buildPlattformModuleSpeedList(moduleBaseNames, moduleSpeeds) local moduleNew = makeAlternativ(modulesRusty) local moduleNew_speedlimmits = makeAlternativ(modulesRusty_speedlimmits) -- Alle UG Module dieser Gleise abschalten: local filterUGModules = { disableRusty, disableRusty_speedlimmits, disableNew, disableNew_speedlimmits } -- trackTypeSetting zu Filterlisten local trackTypeSetting2filterlists = { { disableNew, disableNew_speedlimmits, disableRusty_speedlimmits, generelldisable_speedlimmits }, { disableNew, disableNew_speedlimmits, generelldisable_speedlimmits }, { disableRusty, disableNew_speedlimmits, disableRusty_speedlimmits, generelldisable_speedlimmits }, { disableRusty, disableRusty_speedlimmits, generelldisable_speedlimmits }, { disableNew_speedlimmits, disableRusty_speedlimmits, generelldisable_speedlimmits }, { } } -- trackTypeSetting zu Module Filterlisten local trackTypeSetting2ModuleFilterlists = { { moduleNew, moduleNew_speedlimmits, modulesRusty_speedlimmits }, { moduleNew, moduleNew_speedlimmits }, { modulesRusty, moduleNew_speedlimmits, modulesRusty_speedlimmits }, { modulesRusty, modulesRusty_speedlimmits }, { moduleNew_speedlimmits, modulesRusty_speedlimmits }, { } } local trackTypeSetting = 0 --default aus params tracktypes defaultIndex von oben -- Gibt es eine valide Nutzer Einstellung zurück if modParams[getCurrentModId()] ~= nil then local params = modParams[getCurrentModId()] if (params.tracktypes ~= nil) then if (params.tracktypes < #trackTypeSetting2filterlists) then trackTypeSetting = params.tracktypes else print("Error tracktype setting for NEP") end end end -- Wende die Einstellung fuer tracktype filter an: local filterlists = trackTypeSetting2filterlists[trackTypeSetting + 1] for key, filterlist in ipairs(filterlists) do for _, trackFileName in ipairs(filterlist) do local trackIndex = api.res.trackTypeRep.find(trackFileName) if (nepdebug) then print("NEP Filtering: "..trackFileName) end if (trackIndex > -1) then api.res.trackTypeRep.setVisible(trackIndex, false) end end end -- Schalte alle UG Gleis Module ab: for key, filterlist in ipairs(filterUGModules) do for _, trackFileName in ipairs(filterlist) do local moduleName = "trainstation_"..trackFileName local moduleIndex = api.res.moduleRep.find(moduleName) if (moduleIndex > -1) then if (nepdebug) then print("NEP Filtering UG Module: "..moduleName) end api.res.moduleRep.setVisible(moduleIndex, false) local moduleIndexCat = api.res.moduleRep.find(moduleName.."catenary") if (moduleIndexCat > -1) then if (nepdebug) then print("NEP Filtering UG Module: "..moduleName.."catenary") end api.res.moduleRep.setVisible(moduleIndexCat, false) end end end end local filterlistsModule = trackTypeSetting2ModuleFilterlists[trackTypeSetting + 1] for key, filterlist in ipairs(filterlistsModule) do local path = "station/rail/modular_station/" for _, moduleName in ipairs(filterlist) do if (nepdebug) then print("NEP Try filtering module: "..path..moduleName) end local moduleIndex = api.res.moduleRep.find(path..moduleName) if (moduleIndex > -1) then if (nepdebug) then print("NEP Filtering Module: "..moduleName) end api.res.moduleRep.setVisible(moduleIndex, false) end end end end } end