Transport Fever 2

Transport Fever 2

Hide Freestyle Station Platform Assets
Code suggestions
Heya, so as mentioned in the Comments section, the mod is modifying vanilla game models to hide them, which affects the entire map not just Freestyle Stations. We want to avoid that so we don't upset thousands of players, or cause conflicts/crashes with other mods that use those models.

Since I already worked on this same mod idea, I have some suggestions if you're interested. You probably have more coding knowledge than me (I have almost none lol!), but I'm really familiar with how the code works in TpF2 stations (it's soooo messy lol).

So Freestyle Station has to follow the same rules as all constructions: the construction's updateFn creates a result.models table with all of the models in the station. So you can use an addModifier for constructions (not models) to find Freestyle Station's .con tables, then search its result.models tables to find the asset models you want to hide. For example you can replace the model id ref with your own invisible "empty.mdl" file (just make sure it has a filename unique to your mod to prevent possible conflicts, like "bw_freestyle_asset_hide.mdl" or something).

You can also add a mod param to control this setting individually for each station. Toggling the setting in the station's Configure menu can show/hide the asset models. This way the user controls which stations show the models and which don't. (Again make sure the param names are unique to prevent conflicts.)

Check out the code in my Entropy II mod for an example of this flow:
https://mod.io/g/transportfever2/m/entropy-for-rail-stations-ii

Cheers!