The International Simutrans Forum

 

Author Topic: get cost of the signals  (Read 1632 times)

0 Members and 1 Guest are viewing this topic.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1171
    • Simutrans-BLOG
  • Languages: ES
get cost of the signals
« on: February 26, 2018, 06:51:56 PM »
I need to use "get_cost ()" in the list of available signals.
Code: [Select]
    local sign_list = sign_desc_x.get_available_signs(wt_road)
    local sign_cost = 0
    foreach(sign in sign_list) {
        if(sign.is_private_way()){
          sign_cost = sign.get_cost()
            }
    }

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1171
    • Simutrans-BLOG
  • Languages: ES
Re: get cost of the signals
« Reply #1 on: February 26, 2018, 07:19:36 PM »
Excuse the double post.

I also need to get the cost of text label, since these may vary depending on the pakset;). ;)

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4530
  • Languages: EN, DE, AT
Re: get cost of the signals
« Reply #2 on: February 27, 2018, 07:07:48 AM »
Apparently I got the base class of sign_desc_x wrong

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4530
  • Languages: EN, DE, AT
Re: get cost of the signals
« Reply #3 on: March 02, 2018, 02:15:37 PM »
should be fixed in r8391