The International Simutrans Forum

Development => Scripting Scenarios and AI => Topic started by: Yona-TYT on June 25, 2017, 04:54:33 PM

Title: [command_x] Building slopes does not work
Post by: Yona-TYT on June 25, 2017, 04:54:33 PM

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)
Title: Re: [command_x] Building slopes does not work
Post by: Yona-TYT on July 10, 2017, 02:36:00 AM
This works for me.  :P
Code: [Select]
                    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")
Title: Re: [command_x] Building slopes does not work
Post by: Dwachs on July 10, 2017, 05:37:20 PM
you do not need the call 'command_x(tool_setslope)'. It is enough to call
Code: [Select]
                    local er_slpe = command_x.set_slope(player_x(1), slope1, slope.all_down_slope)