The International Simutrans Forum

Development => Scripting Scenarios and AI => Topic started by: Yona-TYT on May 31, 2017, 04:10:34 AM

Title: command_x does not work with bridges.
Post by: Yona-TYT on May 31, 2017, 04:10:34 AM
I am using this code:
                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")

Title: Re: command_x does not work with bridges.
Post by: Yona-TYT on June 03, 2017, 04:04:56 PM
 ???
Title: Re: command_x does not work with bridges.
Post by: Dwachs 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.
Title: Re: command_x does not work with bridges.
Post by: Yona-TYT on June 13, 2017, 12:07:45 PM
Does it work with tunnels too?
Title: Re: command_x does not work with bridges.
Post by: Dwachs on July 02, 2017, 11:24:19 AM
I have never tested it.
Title: Re: command_x does not work with bridges.
Post by: Yona-TYT on July 05, 2017, 01:55:14 AM
Quote from: Dwachs on July 02, 2017, 11:24:19 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 (http://forum.simutrans.com/index.php?topic=17194.msg163811#msg163811)