News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Get coordinates when constructing roads/ways.

Started by Yona-TYT, March 22, 2017, 03:45:54 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT


I'm trying to mark the edges of the roads at the time of building, but the problem is that I do not get a practical way to get the start and end coordinates.

I have tried using the "is_work_allowed_here" function, but it is impossible to know if the roads was built or not.

Dwachs

I am not sure whether I understood right: You want to mark the start and end tiles after a player has built a way in the tutorial?
Parsley, sage, rosemary, and maggikraut.

Yona-TYT

#2
Quote from: Dwachs on March 22, 2017, 07:28:48 AM
I am not sure whether I understood right: You want to mark the start and end tiles after a player has built a way in the tutorial?
Yes, but it is difficult to determine, for example when clicking there is no way to differentiate whether it was built or not.

An_dz

You probably can check after the click if there's a way on that tile now.

Yona-TYT

#4
Quote from: An_dz on March 22, 2017, 03:27:45 PMYou probably can check after the click if there's a way on that tile now.
I'm trying to mark the edges automatically when building paths, but I can only get start and end coordinates with "is_work_allowed_here", this means that the coordinates are obtained before the road is built. This gives problems when you click without building anything.
You can try the attached sctipt.

Tutorial-test2.zip