Transport Fever 2

Transport Fever 2

Not enough ratings
Cargo visibility fix for Expanded production chains mod
   
Award
Favorite
Favorited
Unfavorite
Vehicle: Wagon
Building: Industry
Misc: Script Mod
File Size
Posted
Updated
3.415 MB
15 Feb @ 5:29pm
23 Feb @ 10:43pm
2 Change Notes ( view )

Subscribe to download
Cargo visibility fix for Expanded production chains mod

Description
Expanded production chains mod adds many interesting cargo types to the base game, but many of the wagons that come from other mods can't display that cargo properly, resulting in wagons travelling empty. This is mod attempts to fix this issue.

There are 3 categories of wagons:

1. Container wagons - all of these wagons should work automatically for all cargo types once the mod is loaded.
2. Flat wagons with stakes - these should work automatically, but if you encounter a mod that doesn't - please let me know in the comments.
3. Open wagons (gondola-like) - these require mod-specific fixes, due to the way cargo is displayed in them. If you have a mod that you'd like to add - please let me know in the comments.

The following open wagons are currently supported by this mod (Steam mod id in brackets):

- Faals 150 (2319829899)
- Facs 124 (2823382419)
- Faals 151 and the Falrrs 153/152 (2324339494)
- Falns 121 (2139705738)
- Generic British Freight Wagons v4 - 1840-1910 (3236981041)
- Máv Tadgs (2181973903)
- Open Freight Cars DB/DR (2911321060)
- ZSSK Cargo Es / Eas / Eaos / Eanos (3041246286)


This mod doesn't overwrite any of the existing mod files, but modifies their definitions when they get loaded. For that reason this mod must be loaded after the Expanded production chains mod and before any other wagon mods. This mod can be safely added and removed from existing saves, as it doesn't store any state.

Asphalt fix - the defintion of asphalt (as a cargo) in the Expanded production chains mod doesn't allow it to be correctly displayed inside the gondola-like wagons. This mod overrides that definition so asphalt is displayed correctly.

15 Comments
RadiKyle 5 Mar @ 5:10pm 
Thanks @peteraklnz ! I came to similar conclusion, add the cargo models and types into the wagon mod for the various industry mods. But I wasn't sure if the fix mods (this one plus @doug 's) would fight it in some way if they are active too. For example the latter's code seems to add custom cargo types to wagons without first checking whether they already support them. But I did a quick test and it appears that altho it's redundant it doesn't mess up the wagon mod (at least for the Industry Expanded cargo that I tested). So hoping similar holds true in general for both fix mods and all industry mods. 🤞
peteraklnz  [author] 5 Mar @ 11:36am 
@RadiKyle,

No, I'm not on that Discord. But looking through the code of that mod I can see that that mod doesn't provide a gondola-type wagon (in terms of types of cargo it carries (like iron ore or coal), not the actual shape). So it should work fine with Expanded production chains mod too.

The only proper way of providing for mods that add more cargo types is to actually code for those types. I have seen that provided in some mods, for example Facs 124 https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2823382419 can carry "oil sand", "silver ore", and "slag" out of the box, with no modifications required (my mod discovers these conditions and doesn't add its own version for those cargo types).
RadiKyle 4 Mar @ 3:42pm 
@peteraklnz are you on the NA Discord? Author of this flatbed mod is reviewing options for supporting the custom cargo types from industry mods. Since you've been active in this very recently maybe you can offer some insight. The wrinkle is the mod has a wagon livery randomizer which itself is defined as a custom load type, so every loadout includes the wagon itself, plus whatever cargo it carries.
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3437541991
peteraklnz  [author] 25 Feb @ 11:09pm 
@Uporczywa_cisza

This mod doesn't modify anything beyond the way cargo is displayed and definitely shouldn't affect the town demand systems. Are you able to post a full stdout.txt somewhere. I suspect is some interaction with other mods here.
Uporczywa cisza 25 Feb @ 3:18pm 
After your update my game crash every time on load screen and throw error:
Assertion Failure: Assertion `town.customCargoNeeds || town_util::CargoNeedsValidForNonCustom(town.cargoNeeds)' failed.
In file: urban_games/train_fever/src/Game/ecs/TownSystem.cpp:41
peteraklnz  [author] 23 Feb @ 10:48pm 
@Blue_Bob-Omb

I've published a new version that includes that mod. The modification fixes visibility for: asphalt, copper ore, gold ore, oil sand, sand, silver ore, slag and sugar.

As it turns out there was yet another way of displaying custom cargo :-D
RadiKyle 22 Feb @ 6:59am 
@peteraklnz ah ok I got it, thanks! I see now that @doug says their mod is a generic fix for empty wagons rather than a custom tailored one for all cases.
Blue Bob-Omb 21 Feb @ 5:38pm 
I'm not sure if they would actually need it or not but can you do this for Gr1m's generic UK goods wagons V4? (I think it's V4 that's the latest one)
peteraklnz  [author] 16 Feb @ 1:04pm 
There are two different ways the wagons display cargo. If they use the 'default' method (the same one as the in-game wagons) - the additional cargo is displayed fine. On the other hand if they use 'customCargoModel' property (which provides more control and flexibility) - they need some extra work. If the wagons display something generic (like containers) for each type of cargo - re-using of the existing slot definition is sufficient. If they display something cargo-specific - new slots must be created for those types of cargo and new model definitions created for those slots. The gondola mods I listed in the description all use that second approach.
RadiKyle 16 Feb @ 11:13am 
There's so many it's hard to find / keep track of them all. I've duped some mods/features too lol.

Ah ok. I've generally had the correct cargo showing, but maybe the wagons and/or industry mods I used already had them supported natively. I only vaguely recall one wagon that was empty or had the wrong cargo but it was so long ago I don't remember which one.