Author Topic: Get coordinates when constructing roads/ways.  (Read 304 times)

0 Members and 1 Guest are viewing this topic.

Offline Yona-TYT

Get coordinates when constructing roads/ways.
« on: March 22, 2017, 03:45:54 AM »

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.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4150
  • Total likes: 140
  • Helpful: 147
  • Languages: EN, DE, AT
Re: Get coordinates when constructing roads/ways.
« Reply #1 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?
Parsley, sage, rosemary, and maggikraut.

Offline Yona-TYT

Re: Get coordinates when constructing roads/ways.
« Reply #2 on: March 22, 2017, 02:06:44 PM »
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.
« Last Edit: March 22, 2017, 02:17:42 PM by Yona-TYT »

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2533
  • Total likes: 272
  • Helpful: 89
  • D'oh
    • by An_dz
  • Languages: PT, EN, (it, de)
Re: Get coordinates when constructing roads/ways.
« Reply #3 on: March 22, 2017, 03:27:45 PM »
You probably can check after the click if there's a way on that tile now.

Offline Yona-TYT

Re: Get coordinates when constructing roads/ways.
« Reply #4 on: March 23, 2017, 03:21:19 AM »
You 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
« Last Edit: March 23, 2017, 05:10:24 AM by Yona-TYT »