The International Simutrans Forum

Development => Patches & Projects => Topic started by: victor_18993 on July 12, 2026, 04:28:14 PM

Title: New feature: download-only mode
Post by: victor_18993 on July 12, 2026, 04:28:14 PM
[EN]

LINK POST (https://forum.simutrans.com/index.php?topic=20717.0)

Coming back to this old thread: rather than the full load/unload-per-wagon and route
whitelist system, I implemented only the narrow piece that was said to be acceptable
here - a per-stop "no load" flag in the schedule (the stop still unloads, it
just does not pick anything up):

Quote"'Nur Aufladen' wird es im Fahrplan sicher nicht geben, nur 'Nicht aufladen'."

So this is exactly the "Nicht Beladen" stop, nothing more - no "load only", no
per-wagon control, no whitelist, and the goods pathfinder is untouched.

How it works

Compatibility
Savegame is bumped ([tt]SIM_SAVE_MINOR[/tt]) and the field is guarded by the version,
so old saves load with the flag off. The schedule text serialisation
([tt]sscanf/sprintf_schedule[/tt], used to apply schedules to convoys and over the
network) is extended from 5 to an optional 6th value in a backward-compatible way, so
old-format strings still parse.

Tested
Added an automated regression test ([tt]test_transport_freight_no_load[/tt]): a pickup
stop flagged "no load" is served by a convoy and the freight is verified to stay put
(nothing loaded, departed or delivered). Full suite passes (202/202); with the guard
removed the new test fails as expected, so it really covers the behaviour.

Patch attached. If you would rather have a different label or place the checkbox
elsewhere in the schedule window, just say so.

[ES]

Retomo este hilo antiguo: en lugar del sistema completo de carga/descarga por vagón y
whitelist de rutas, implementé solo la pieza acotada que aquí se dio por aceptable - un
flag "no load" por parada en el horario (la parada sigue descargando; solo que
no recoge nada):

Quote"'Nur Aufladen' wird es im Fahrplan sicher nicht geben, nur 'Nicht aufladen'."

Es exactamente la parada "Nicht Beladen", nada más - sin "solo cargar", sin control por
vagón, sin whitelist, y sin tocar el pathfinder de mercancías.

Cómo funciona

Compatibilidad
Se sube la versión de savegame ([tt]SIM_SAVE_MINOR[/tt]) y el campo va protegido por la
versión, así que las partidas viejas cargan con el flag desactivado. El serializado de
texto del horario ([tt]sscanf/sprintf_schedule[/tt], que se usa para aplicar horarios a
los convoyes y por la red) se extiende de 5 a un 6º valor opcional de forma
retrocompatible, así que las cadenas en formato viejo siguen parseando.

Probado
Añadí un test de regresión automatizado ([tt]test_transport_freight_no_load[/tt]): una
parada de recogida marcada "no load" es servida por un convoy y se comprueba que la
mercancía se queda (no se carga, ni sale, ni se entrega). La suite completa pasa
(202/202); quitando la guarda, el test nuevo falla como se espera, así que cubre de
verdad el comportamiento.

Parche adjunto. Si prefieres otra etiqueta o colocar el checkbox en otro sitio de la
ventana de horario, dilo.