[2.0.38] changing train schedule at current stop does not work
Posted: Wed Mar 05, 2025 3:41 am
WIth 2.0.38:
Scenario:
Train sits at a station (just arrived)
Schedule was cleaned (all records removed)
Re-adding a new stop at index 1
This works:
The green bar extends left to right, then the train waits for any change in schedule.
this does not:
So the inactivity timer never triggers.
Using a debugger, the train itself reports state == 1 (no_schedule).
Scenario:
Train sits at a station (just arrived)
Schedule was cleaned (all records removed)
Re-adding a new stop at index 1
This works:
Code: Select all
train_schedule.add_record {
station = stop.entity.backer_name,
rail_direction = stop.entity.connected_rail_direction,
temporary = false,
allows_unloading = true,
}
local record_position = { schedule_index = 1 }
train_schedule.add_wait_condition(record_position, 1, 'inactivity')
train_schedule.change_wait_condition(record_position, 1, {
type = 'inactivity',
ticks = 300,
})
this does not:
Code: Select all
train_schedule.add_record {
station = stop.entity.backer_name,
rail_direction = stop.entity.connected_rail_direction,
temporary = false,
allows_unloading = true,
wait_conditions = {
{
type = 'inactivity',
ticks = 300,
}
}
}
Using a debugger, the train itself reports state == 1 (no_schedule).