The International Simutrans Forum

 

Author Topic: get obj_desc from the selected tool  (Read 1740 times)

0 Members and 1 Guest are viewing this topic.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1148
    • Simutrans-BLOG
  • Languages: ES
get obj_desc from the selected tool
« 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.
Code: [Select]
current_tool().get_obj_desc_x()
« Last Edit: March 04, 2018, 12:28:23 PM by Yona-TYT »

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4491
  • Languages: EN, DE, AT
Re: get obj_desc from the selected tool
« Reply #1 on: March 05, 2018, 08:24:19 AM »
What would you like to do with this information?

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1148
    • Simutrans-BLOG
  • Languages: ES
Re: get obj_desc from the selected tool
« Reply #2 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.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1148
    • Simutrans-BLOG
  • Languages: ES
Re: get obj_desc from the selected tool
« Reply #3 on: April 11, 2018, 01:34:53 PM »
I guess it's hard to implement? .  ???

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4491
  • Languages: EN, DE, AT
Re: get obj_desc from the selected tool
« Reply #4 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.