The International Simutrans Forum

 

Author Topic: I need convoy get_tile_length()  (Read 258 times)

0 Members and 1 Guest are viewing this topic.

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1455
    • Simutrans-BLOG
  • Languages: ES
I need convoy get_tile_length()
« 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.cc
Code: [Select]
register_method(vm, &convoi_t::get_tile_length, "get_tile_length");squirrel_types_scenario.awk
Code: [Select]
export_types["convoy_x::get_tile_length"] = "integer()"

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1455
    • Simutrans-BLOG
  • Languages: ES
Re: I need convoy get_tile_length()
« Reply #1 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".

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10001
  • Languages: De,EN,JP
Re: I need convoy get_tile_length()
« Reply #2 on: June 09, 2020, 02:39:22 AM »
Do a patch and then I can incorporate it, if it is straight forward.

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1455
    • Simutrans-BLOG
  • Languages: ES
Re: I need convoy get_tile_length()
« Reply #3 on: June 09, 2020, 03:26:19 AM »
export_types["convoy_x::get_tile_length"] = "integer()"
Ok, this works fine for me, I also added it to the AI.  :P

Online Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4709
  • Languages: EN, DE, AT
Re: I need convoy get_tile_length()
« Reply #4 on: June 09, 2020, 06:11:58 AM »
looks good

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1455
    • Simutrans-BLOG
  • Languages: ES
Re: I need convoy get_tile_length()
« Reply #5 on: June 11, 2020, 03:26:44 AM »
Was this incorporated?.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10001
  • Languages: De,EN,JP
Re: I need convoy get_tile_length()
« Reply #6 on: June 11, 2020, 11:56:24 AM »
I did just now for r 9124
Thank you.