News:

Simutrans Forum Archive
A complete record of the old Simutrans Forum.

commad_x fails with human player but not with public service

Started by Yona-TYT, December 20, 2022, 01:59:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT

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

Dwachs

Could it be that the tunnel object is not available for building due to timeline constraints?
Parsley, sage, rosemary, and maggikraut.

Yona-TYT

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!