The International Simutrans Forum

Development => Scripting Scenarios and AI => Topic started by: Yona-TYT on December 16, 2018, 01:49:49 PM

Title: I need to know if Convoy is changing the schedule
Post by: Yona-TYT 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?.
Title: Re: I need to know if Convoy is changing the schedule
Post by: Yona-TYT on December 19, 2018, 01:13:44 AM
I'm thinking of something like: convoy_x.is_editing_schedule() or convoy_x.is_editing_line() .

For example, if the schedule window is open, then the function would return a "true".
(https://www.mediafire.com/convkey/ca97/og87hc478xt2k3e6g.jpg)

Title: Re: I need to know if Convoy is changing the schedule
Post by: Dwachs on December 19, 2018, 02:32:13 PM
Why do you wnat this? just curiosity.

This should be a simple change.
Title: Re: I need to know if Convoy is changing the schedule
Post by: Yona-TYT on December 19, 2018, 05:40:08 PM
Quote from: Dwachs on December 19, 2018, 02:32:13 PMWhy 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.
Title: Re: I need to know if Convoy is changing the schedule
Post by: Yona-TYT 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!.
Title: Re: I need to know if Convoy is changing the schedule
Post by: prissi 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.
Title: Re: I need to know if Convoy is changing the schedule
Post by: Yona-TYT on February 06, 2019, 11:14:48 PM
Quote from: prissi on February 05, 2019, 06:26:26 AMEditing 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)?
Title: Re: I need to know if Convoy is changing the schedule
Post by: prissi 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.
Title: Re: I need to know if Convoy is changing the schedule
Post by: Yona-TYT on April 08, 2019, 06:46:16 PM
Quote from: prissi on February 05, 2019, 06:26:26 AMBut editing an individual schedule will set the convoi to the schedule editing state, which can be queried.
This seems fine to me, this can work for me.  8)
Title: Re: I need to know if Convoy is changing the schedule
Post by: Dwachs on April 28, 2019, 02:33:46 PM
in r8755, see http://dwachs.github.io/simutrans-sqapi-doc/classconvoy__x.html#ac5809c2f199c422445b7232e6449ef61
Title: Re: I need to know if Convoy is changing the schedule
Post by: Yona-TYT on April 28, 2019, 02:43:24 PM
Thank you !!, I will be very happy to continue with my project.
Title: Re: I need to know if Convoy is changing the schedule
Post by: Yona-TYT on May 05, 2019, 12:57:59 AM
Quote from: Dwachs on April 28, 2019, 02:33:46 PMin r8755, see http://dwachs.github.io/simutrans-sqapi-doc/classconvoy__x.html#ac5809c2f199c422445b7232e6449ef61

I have tried the new function, but I am afraid it does not work with vehicles in the depot, will it be possible to operate this?.  :-[

Regards !.   ;)
Title: Re: I need to know if Convoy is changing the schedule
Post by: prissi on May 09, 2019, 01:21:30 PM
Never, because vehicles in depot have their final schedule assigned whenever they leave the depot. Until then their schedule belongs to the depot.
Title: Re: I need to know if Convoy is changing the schedule
Post by: Yona-TYT on May 09, 2019, 02:19:14 PM
 ::'(
Title: Re: I need to know if Convoy is changing the schedule
Post by: Yona-TYT on May 10, 2019, 12:14:59 AM
I was thinking about a solution to the problem of the "schedule" list, and something happened to me.

By clicking on the  [schedule]  button this should be maintained pressed (sunk), once the "schedule" window is closed, the button should return to normal, no? (maybe it is an error), what I need is to know when that window is active "true" when closing the window it becomes "false", is that possible?.

(https://scontent-mia3-2.xx.fbcdn.net/v/t1.0-9/fr/cp0/e15/q65/59977575_2177602372316902_6212417709716537344_n.jpg?_nc_cat=109&efg=eyJpIjoiYiJ9&_nc_eui2=AeGG7XpGGRG1q25n1b4z7TW__JJl1QqgyA8m8vi_lLUrvsZ6nPpYQcDWwXa7vEvWabMUeU0GSG8tcJZftxUhQkF3PhW8r8eVriauiLR69VXuJA&_nc_ht=scontent-mia3-2.xx&oh=2d83c9abffa817f04cbbc523a89890c5&oe=5D6E78CE)
Title: Re: I need to know if Convoy is changing the schedule
Post by: prissi on May 11, 2019, 02:46:14 PM
Not so easily, you need to know the memory address of the schedule to check, if that window is open.
Title: Re: I need to know if Convoy is changing the schedule
Post by: Yona-TYT on May 11, 2019, 07:25:36 PM
Quote from: prissi on May 11, 2019, 02:46:14 PMNot so easily, you need to know the memory address of the schedule to check, if that window is open.
I see.  :-[



Additionally it would be good that the button is held down (depressed) until the player Windows that close the schedule, although this is already off topic.