The International Simutrans Forum

Development => Scripting Scenarios and AI => Topic started by: Yona-TYT on March 04, 2018, 12:01:30 PM

Title: get obj_desc from the selected tool
Post by: Yona-TYT on March 04, 2018, 12:01:30 PM


This is to get more information about the selected tool, since the "tool_id" is not enough in some cases, such as differentiating road prices for example.

current_tool().get_obj_desc_x()


(http://files.simutrans.com/index.php/apps/gallery/preview/1048?width=1300&height=1300&c=c1c2420670fbb9b701c70dd36cc5210a&requesttoken=acJNPUhRb%2B7gj86EholtE6JbwJ%2BE5Wi6nKuUxPYQGxw%3D%3ADo8YcQxhP4%2BS2L3izu0kIYkMpvDlshHM8ebwgpBGSmw%3D)
Title: Re: get obj_desc from the selected tool
Post by: Dwachs on March 05, 2018, 08:24:19 AM
What would you like to do with this information?
Title: Re: get obj_desc from the selected tool
Post by: Yona-TYT on March 05, 2018, 11:54:02 AM
In the tutorial, it is to be more specific with the tool that needs to be used ... for example, to obtain the name of the object, to know if the station is of passengers or merchandise, to know the maximum speed of the road ... of this way you have more control of the tools when restricting an action.
Title: Re: get obj_desc from the selected tool
Post by: Yona-TYT on April 11, 2018, 01:34:53 PM
I guess it's hard to implement? .  ???
Title: Re: get obj_desc from the selected tool
Post by: Dwachs on April 11, 2018, 08:12:23 PM
yes, exactly. There is no interface in the program to get these desc-objects from the tool. Each tool does this slightly differently.