-
-
Notifications
You must be signed in to change notification settings - Fork 968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support NewGRF cargoes with default vehicles #9148
Conversation
@2TallTyler Andy said, you also had plans for this? |
No plans, just ideas. I was thinking in NML terms of how to allow cargo labels while disallowing other vanilla cargos of the same class, for example the coal hopper would carry CC_BULK but be disallowed from carrying IORE and GRAI. But your solution is better. Possibly out of scope, but since your solution is aware of if NewGRF cargos are loaded, it might be possible to change vehicle names in the same manner as OpenGFX+ Trains — the coal hopper becomes the Bulk Wagon, for example. Then we'd truly have full support for NewGRF cargos with default vehicles. |
I have changed the refittability of train MUs again:
For ships I stick with changing the tropic oil tanker to transport water and rubber. This looks way cooler than the generic cargo ship. Toyland planes lose out though. |
Yes, that is possible, and can be added later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some code-style questions, but functional I see no issues. In fact, I can follow most of the logic :D Tnx for the detailed description, that really helps :)
PS: I think |
Default vehicles now behave as if they had a cargo translation table. This fixes default vehicles carrying seemingly random cargos, if NewGRF industry sets are present. This behavior is disabled, when a NewGRF touches any of the cargo-type or refitting properties. In that case it's up to the NewGRF to define its own cargo translation table.
This ensures that default vehicles can transport any NewGRF defined cargos, albeit with weird graphics and vehicle names. This also changes the refittability of default vehicles with default industries.
I removed the "backport request" label. I think this change is on the same "for new players" level as the STUN/TURN stuff. |
Motivation / Problem
When players use a NewGRF industry set with new cargoes, but no vehicle NewGRF, there are some effects:
This causes a lot of confusion amongst many new players, and a lot of annoyance for one NewGRF author.
Description
The PR detects whether default vehicles are used, or whether default vehicles are only trivially modified by NewGRF (stuff like names, but not cargoes or refittability).
If this is the case:
As a result:
When a NewGRF defines the default cargo type and/or refittability of a vehicle, this PR changes nothing.
Limitations
This PR changes the refittability of vehicles in vanilla, also when using only default vehicles and default industries/cargoes.
Detail rules
If arctic/tropic refrigerated cargoes are also excluded, they use the food wagon.
Again, this catches only cargoes without specialised vehicles.
Scenario: FIRS 4 'Basic Temperate'
Scenario: Vanilla, default vehicles, default cargoes
So, wrt. savegames this affects:
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.