[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- A new [tt]bool no_load[/tt] on [tt]schedule_entry_t[/tt].
- In [tt]convoi_t::hat_gehalten()[/tt] the loading phase is skipped when the current
entry has the flag (mirroring the existing convoy-wide [tt]no_load[/tt]); unloading is
unchanged, and [tt]loading_limit[/tt] is forced to 0 so the convoy does not wait for a
load that will never come. - The checkbox reuses the existing [tt]"no load"[/tt] text, which already translates
to "Unload only" in English ([tt]text/en.tab[/tt]) and is localised in every
language, so no new translation string is needed.
CompatibilitySavegame 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.
TestedAdded 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- Un nuevo [tt]bool no_load[/tt] en [tt]schedule_entry_t[/tt].
- En [tt]convoi_t::hat_gehalten()[/tt] se salta la fase de carga cuando la entrada
actual tiene el flag (espejando el [tt]no_load[/tt] de convoy que ya existe); la
descarga no cambia, y se fuerza [tt]loading_limit[/tt] a 0 para que el convoy no espere
una carga que nunca va a llegar. - El checkbox reutiliza la cadena existente [tt]"no load"[/tt], que ya se traduce como
"Unload only" en inglés ([tt]text/en.tab[/tt]) y está localizada en todos los
idiomas, así que no hace falta ninguna traducción nueva.
CompatibilidadSe 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.
ProbadoAñ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.