Transport Fever 2

Transport Fever 2

North American Bridges
RadiKyle 3 Apr, 2023 @ 9:41am
Purple boxes still in station menu
Hi, I just noticed the latest update fixed the purple boxes in the track menu (thanks!!). But the purple boxes still exist in the station menu (when configuring a modular train station). Screenshot:
https://imgur.com/a/JDDxlyY
Cheers
< >
Showing 1-3 of 3 comments
themeatballhero  [developer] 12 May, 2023 @ 11:14am 
Ah yes, a lot of mods do that. I'll take a look at how to fix that. Drives me nut too, though to be fair, not sure why youd want these in a station haha

I appreciate the bug report!
RadiKyle 2 Feb, 2024 @ 2:50pm 
Hi, back after "being away" for almost a year... Saw the station config menu still has all these purple box icons so just checking in... I agree, no desire for them in the station at all, just wish could make the purple boxes go away.

I went down rabbit hole today checking other mods for similar issues. You're right, I found a bunch that have the purple icons in the station configure menu, another group that have working icons, and then interestingly, a couple that don't have their mod tracks in the station configure menu at all -- maybe that would be an option here?

I tried reviewing the mod files to spot differences and possible fixes but I'm an infant on how TpF2 mods work. And there were quite a few differences between the mods (some have certain files / file structure that others don't). I wonder if the game is supposed to auto-magically add the icons to the station configure menu and, if so, does the modder have to do something specific for that function to work automagically.

Anyhow if you felt like poking at it, the mods that add track types but don't show up at all in the station configure menu are:
- Light Rail 1435 (WernerK) https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3100629069
- Freestyle Station (lollus) https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2363493916

And the mods that add tracks and have working icons in the station configure menu (but I agree that's maybe not what you want for NAB):
- Switch Kit DE/AT (WernerK) - these 2 have same track set
- Track Builder (WernerK) - these 2 have same track set
- Paintable Industrial Station Modules (Uzurpatorex) - appears on industrial tab rather than tracks tab
- Early Rail #1 (SteveM4)

I'm going to keep poking too..., maybe one day I'll learn how to "fix" some of these things too.
RadiKyle 18 May, 2024 @ 2:35pm 
(Wow I don't even remember writing the above post... 🥴)

Hey again, so I got a solution for this now if you'd like to fix it. You can either add icons for the station track modules that the game automatically generates, or otherwise make these station track modules unavailable so they don't show up at all.

The default way to add the icons is to duplicate all of your existing icon .tga files in textures/ui/tracks, adding "_module" and "_module_catenary" to the end of the filenames. Since you have 22 track types in this mod, you need to add another 44 .tga files, for 66 total. For example:

mh_check_rail_10mph_deck.tga (existing)
mh_check_rail_10mph_deck_module.tga (new)
mh_check_rail_10mph_deck_module_catenary.tga (new)

Do that for every icon. That will fix the 44 purple boxes currently stuffing the station configure menu 🐡🐡🐡🐡

Orrrr...

Alternatively if you don't want these in the station configure menu at all, as you hinted earlier (I agree), just make these track modules completely unavailable by using a postRunFn script in your mod.lua file to hide them. I've seen other mods simply set the year availability range so the user is unlikely to ever encounter them.

As a learning exercise (and a local fix) I went ahead and did this and it works, no more purple boxes! 🥳 To save you the effort, just paste this code into your mod.lua before the last " } end "

postRunFn = function(settings, params) local allModules = api.res.moduleRep.getAll() for _, moduleName in pairs( allModules ) do local moduleID = api.res.moduleRep.find( moduleName ) local module = api.res.moduleRep.get( moduleID ) if string.match( module.fileName, "trainstation_mh_check_rail_" ) ~= nil then module.availability.yearFrom = 1 module.availability.yearTo = 1 end end end,

That should fix it. You can test easily by loading this mod with any map and configuring a station to confirm that none of the check rail tracks appear in the menu.

Hope that helps!
< >
Showing 1-3 of 3 comments
Per page: 1530 50