Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Vehicles in the depot seem to ignore "is_in_depot ()"

Started by Yona-TYT, January 30, 2021, 01:48:24 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


In the tutorial scenario I found a problem when counting vehicles outside the depot, something seems to have broken when the schedule window was updated.,20444.msg194610/topicseen.html#msg194610

It seems to be related to "is_work_allowed_here (pl, tool_id, pos)", since this happens when said function returns a message while editing the schedule.

This is how I count the vehicles:function checks_all_convoys()
    local cov_list = world.get_convoy_list()
    local cov_nr = 0
    foreach(cov in cov_list) {
        if (!cov.is_in_depot())
    return cov_nr

To recreate use my attached test script and follow the steps below:

  • Build a depot and route a vehicle, make an intentional click on something that is not "way / track" to display the text "Message test".
  • Close the vehicle window and you will see that the vehicle is counted as if it left from the depot.
Note: I have left a vehicle counter in the scenario window right in the results.


This has nothing to do with the script. Thanks for your report.
Parsley, sage, rosemary, and maggikraut.