Alles anzeigenTPF2 exe has this string:
Codestruct transport::Path __cdecl vehicle_util::common::`anonymous-namespace'::FindPathUnified<class vehicle_util::common::FindPathToDepot::<lambda_2db12c1f012abbc47ef40621f9a91d50>>(const struct vehicle_util::MovePathUtilContext &,class std::bitset<16>,const class std::vector<struct std::pair<struct transport::EdgeId,bool>,class std::allocator<struct std::pair<struct transport::EdgeId,bool> > > &,class vehicle_util::common::FindPathToDepot::<lambda_2db12c1f012abbc47ef40621f9a91d50>,float *)
This function is fired by the command processor, the one processing sendCommands -> sendToDepot
vehicle_util::MovePathUtilContext = Storage to pointers to all systems and ressources
class std::bitset<16> = Transport Modes
So the find depot is not very likely to be accessible by any api system functionality.
The transport vehicle depot id is only valid when the vehicle is heading to a depot. (and the flag sellOnArrival)
Thank you! I suspected as much.
The only way via script would be to manually try to find all possible paths to determine if there is an appropriate depot (and also find the best one). Unfortunately, above my skill level. And also not sure if it's worth the effort.
I'm working around it by sending an existing vehicle to depot and looking for success, then capture that depot id. It's working, but causes the vehicle to be emptied, which can/does have a bad impact on profitability.
In an updated version of my script I'm caching the depot id (and stop id) to save on this, but this also requires some error checking code to see if it works i.e. the depot still exists, and is viable - if the vehicle remains in depot after sending to a line, that's an indication that the depot is no good for a line, and I can then re-check (by sending an existing vehicle to depot) for a new depot.
I've managed to send a request to UrbanGames (got a response!) to expand the API to avail some function to ease the depot-finding, or at least expose the clone vehicle function (which would be sufficient for my use case, "api.cmd.makeCloneVehicle" as an example). Let's see how that goes, I gather they are very busy with the upcoming update, not to mention the likely massive trove of other requests...