The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Yona-TYT on June 05, 2020, 12:08:21 AM

Title: I need convoy get_tile_length()
Post by: Yona-TYT on June 05, 2020, 12:08:21 AM
I need to know the number of stations that a convoy covers.

This easy to add.  ;)

api_convoy.ccregister_method(vm, &convoi_t::get_tile_length, "get_tile_length");
squirrel_types_scenario.awkexport_types["convoy_x::get_tile_length"] = "integer()"

Title: Re: I need convoy get_tile_length()
Post by: Yona-TYT on June 08, 2020, 04:06:50 PM
Currently I count the number of wagons / cars to determine if the size of the train is suitable for the station, the problem is that there are wagons that have a larger size, so using the same number of wagons (large ones) covers more spaces than stations compared to small wagons.

So I need "get_tile_length".
Title: Re: I need convoy get_tile_length()
Post by: prissi on June 09, 2020, 02:39:22 AM
Do a patch and then I can incorporate it, if it is straight forward.
Title: Re: I need convoy get_tile_length()
Post by: Yona-TYT on June 09, 2020, 03:26:19 AM
Quote from: prissi on June 09, 2020, 02:39:22 AMexport_types["convoy_x::get_tile_length"] = "integer()"
Ok, this works fine for me, I also added it to the AI.  :P
Title: Re: I need convoy get_tile_length()
Post by: Dwachs on June 09, 2020, 06:11:58 AM
looks good
Title: Re: I need convoy get_tile_length()
Post by: Yona-TYT on June 11, 2020, 03:26:44 AM
Was this incorporated?.
Title: Re: I need convoy get_tile_length()
Post by: prissi on June 11, 2020, 11:56:24 AM
I did just now for r 9124
Thank you.