Author Topic: command_x does not work with bridges.  (Read 749 times)

0 Members and 1 Guest are viewing this topic.

Offline Yona-TYT

command_x does not work with bridges.
« on: May 31, 2017, 04:10:34 AM »
I am using this code:
Code: [Select]
                local t = command_x(tool_build_bridge)             
                local err = t.work(player_x(0), square_x(brdg1.x, brdg1.y).get_ground_tile(), square_x(brdg2.x, brdg2.y).get_ground_tile(), "road_070_bridge")

Offline Yona-TYT

Re: command_x does not work with bridges.
« Reply #1 on: June 03, 2017, 04:04:56 PM »
 ???

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4277
  • Total likes: 195
  • Helpful: 149
  • Languages: EN, DE, AT
Re: command_x does not work with bridges.
« Reply #2 on: June 12, 2017, 06:20:16 AM »
Please have a look here:

https://github.com/aburch/simutrans/blob/master/simutrans/ai/sqai/astar.nut

(line 309). Maybe you should call 't.set_flags(2)' before calling work.
Parsley, sage, rosemary, and maggikraut.

Offline Yona-TYT

Re: command_x does not work with bridges.
« Reply #3 on: June 13, 2017, 12:07:45 PM »
Does it work with tunnels too?

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4277
  • Total likes: 195
  • Helpful: 149
  • Languages: EN, DE, AT
Re: command_x does not work with bridges.
« Reply #4 on: July 02, 2017, 11:24:19 AM »
I have never tested it.
Parsley, sage, rosemary, and maggikraut.

Offline Yona-TYT

Re: command_x does not work with bridges.
« Reply #5 on: July 05, 2017, 01:55:14 AM »
I have never tested it.
It works fine, the problem now is that I can not lower the ground  :-[ --> http://forum.simutrans.com/index.php?topic=17194.msg163811#msg163811