I'm stuck in underground constructions, I need to build slopes to join both sides of the tunnel.
(http://files.simutrans.com/index.php/apps/files_sharing/ajax/publicpreview.php?x=1022&y=200&a=true&file=slope_comm_x.png&t=m6yPgF0elqLt6dw&scalingup=0)
This works for me. :P
local tun1 = coord3d(92,17,-1)
local tun2 = coord3d(92,16,-1)
local tun3 = coord3d(92,16,-2)
local tun4 = coord3d(92,15,-2)
local tun5 = coord3d(92,15,-3)
local tun6 = coord3d(92,3,-3)
local slope1 = coord3d(92,17,0)
local slope2 = coord3d(92,16,-1)
local slope3 = coord3d(92,15,-2)
local t_slope = command_x(tool_setslope)
local er_slpe = t_slope.set_slope(player_x(1), slope1, slope.all_down_slope)
local t_tun = command_x(tool_build_tunnel)
local er_tun = t_tun.work(player_x(1), tun1, tun2, "Rail_120_Tunnel")
er_slpe = t_slope.set_slope(player_x(1), slope2, slope.all_down_slope)
er_tun = t_tun.work(player_x(1), tun3, tun4, "Rail_120_Tunnel")
er_slpe = t_slope.set_slope(player_x(1), slope3, slope.all_down_slope)
er_tun = t_tun.work(player_x(1), tun5, tun6, "Rail_120_Tunnel")
you do not need the call 'command_x(tool_setslope)'. It is enough to call
local er_slpe = command_x.set_slope(player_x(1), slope1, slope.all_down_slope)