The International Simutrans Forum

 

Author Topic: I need to know if Convoy is changing the schedule  (Read 520 times)

0 Members and 1 Guest are viewing this topic.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1171
    • Simutrans-BLOG
  • Languages: ES
I need to know if Convoy is changing the schedule
« on: December 16, 2018, 01:49:49 PM »
I need a Boolean function that lets me know if the player is changing the route of the convoy, is this possible?.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1171
    • Simutrans-BLOG
  • Languages: ES
Re: I need to know if Convoy is changing the schedule
« Reply #1 on: December 19, 2018, 01:13:44 AM »
I'm thinking of something like:
Code: [Select]
convoy_x.is_editing_schedule() or
Code: [Select]
convoy_x.is_editing_line() .

For example, if the schedule window is open, then the function would return a "true".



Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4530
  • Languages: EN, DE, AT
Re: I need to know if Convoy is changing the schedule
« Reply #2 on: December 19, 2018, 02:32:13 PM »
Why do you wnat this? just curiosity.

This should be a simple change.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1171
    • Simutrans-BLOG
  • Languages: ES
Re: I need to know if Convoy is changing the schedule
« Reply #3 on: December 19, 2018, 05:40:08 PM »
Why do you wnat this? just curiosity. This should be a simple change.



This is for the tutorial. You see, I have a list with the coordinates of the stops, the player can only click on one stop once and then move on to the next and successively until the routing list is completed, the problem is when the player closes the sale " schedule "before completing the list, then there are problems, because you will not be able to select the stops that had already been selected ... it is necessary to know if we are editing the vehicle route or not to restart the count of the stops.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1171
    • Simutrans-BLOG
  • Languages: ES
Re: I need to know if Convoy is changing the schedule
« Reply #4 on: February 03, 2019, 10:23:53 PM »
Hi how are you ?.

It is to remind you about this function, I hope to correct the problem in the tutorial scenario.

regards!.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9353
  • Languages: De,EN,JP
Re: I need to know if Convoy is changing the schedule
« Reply #5 on: February 05, 2019, 06:26:26 AM »
Editing a line may be non-trivial, since convois drive on while a line is changed. But editing an individual schedule will set the convoi to the schedule editing state, which can be queried.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1171
    • Simutrans-BLOG
  • Languages: ES
Re: I need to know if Convoy is changing the schedule
« Reply #6 on: February 06, 2019, 11:14:48 PM »
Editing a line may be non-trivial, since convois drive on while a line is changed. But editing an individual schedule will set the convoi to the schedule editing state, which can be queried.
And what about the vehicles that are on the deposit, is there any way to know if the route is being edited (when the schedule window is open)?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9353
  • Languages: De,EN,JP
Re: I need to know if Convoy is changing the schedule
« Reply #7 on: February 07, 2019, 06:38:48 AM »
Their state is in depot, hence there is again no very simple way knowing. The actual schedule is 100% determined at leaving the depot, as is the kind of goods to transport. Hence the routing is only updated when leaving the depot.