News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

[command] Initialization error when the way is from the public service.

Started by Yona-TYT, June 15, 2020, 09:23:00 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT

If for example you try to build a bridge with a human player and there are public service tracks on both ends, command_x fails.
    local t = command_x(tool_build_bridge)
    t.set_flags(2)       
    local err = t.work(player_x(0), coord3d(126,193,-1), coord3d(126,195,-1), "ClassicRoad")


Dwachs

This error is thrown only if the initialization step fails. Here, it means that the bridge-object parameter is wrong (or the bridge is not available due to timeline restrictions, which is the case for ClassicRoad).
Parsley, sage, rosemary, and maggikraut.

Yona-TYT

Quote from: Dwachs on June 15, 2020, 03:34:14 PMThis error is thrown only if the initialization step fails. Here, it means that the bridge-object parameter is wrong (or the bridge is not available due to timeline restrictions, which is the case for ClassicRoad).
Yes, that was the problem, thanks!. 8)

Dwachs

you could also use the build_bridge command. It will give more useful error messages
Parsley, sage, rosemary, and maggikraut.