I had an idea for a newGRF to simulate a train yard (see image), but never having made a newGRF before, I have a few questions on what things are possible in newGRF coding.
1.) Would you be able to have a newGRF reorder the wagons of a train while loading in a station? If in depot, it's [engine, grain, grain, livestock, livestock], would you be able to have it reorder itself to [engine, livestock, grain, grain, livestock] based on what cargo was loaded first to last?
2.) If an empty wagon is set to an invisible sprite, will it be empty in the depot, or are the sprites in the depot separate from trains on the rails?
Thanks for any advice you could give.
You cannot re-order the wagons of a train via NewGRF. That's a player action. You can choose to show different sprites depending on many different factors... not sure what you describe is possible... it might with some quite complicated shenengians on sprite control.
Sprites in depots can be different ones than used on the track (and often are for various reasons, e.g. offsets / placement). Yet: why would an empty wagon become invisible? I'd consider that highly confusing.