The International Simutrans Forum

Development => Scripting Scenarios and AI => Topic started by: Yona-TYT on December 20, 2022, 01:59:51 AM

Title: commad_x fails with human player but not with public service
Post by: Yona-TYT on December 20, 2022, 01:59:51 AM
The command only works using the "utility" player, but trying to use the "human" player then fails.

Script Test: script_test.zip
Savegame: test-comm-tunn.sve
local sc_tunn_name = "Rail_120_Tunnel"
local t_tunn = tile_x(92,18,0)
t_tunn.remove_object(player_x(1), mo_label)
local t = command_x(tool_build_tunnel)
t.set_flags(2)
t.work(player_x(0), t_tunn, sc_tunn_name)

Captura desde 2022-12-19 21-53-05.png
Title: Re: commad_x fails with human player but not with public service
Post by: Dwachs on December 20, 2022, 07:32:34 AM
Could it be that the tunnel object is not available for building due to timeline constraints?
Title: Re: commad_x fails with human player but not with public service
Post by: Yona-TYT on December 20, 2022, 01:11:17 PM
Quote from: Dwachs on December 20, 2022, 07:32:34 AMCould it be that the tunnel object is not available for building due to timeline constraints?
Time constraints don't affect commands (I bought it by building stations).

I've changed the names (tunnels, bridges and ways), and now everything works fine, thanks!