Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
Script-KI - combined_connection
#1
Bekomme da den Fehler das cost_road_stop nicht existiert.

commbined_connection
Zitat:  /**
  * Does steps land-tile -> halt -> harbour -> water
  * Last route tile is cnode, check if station can be placed.
  * Check for harbour tiles, put corresponding nodes to open list.
  */
  function process_node_to_land_halt(cnode, halt)
  {
    // process all tiles of this halt
    foreach(tile in halt.get_tile_list()) {
      if (!tile.is_water()  &&  ship_connector_t.get_harbour_halt(tile)!=null) {
        local harbour_node = ab_node(tile, cnode, cnode.cost, cnode.dist, 0x0f, 0x0f)
        local d = 0
        if (tile.get_slope()) {
          // get direction from slope
          d = dir.backward(slope.to_dir(tile.get_slope()))
        }
        else {
          // flat dock, check all four neighbour tiles for water + harbour
          d = 1
        }
        do {
          local to = coord3d(tile.x, tile.y, tile.z) + dir.to_coord(d)
          if (world.is_coord_valid(to)) {
            local move  = cost_road_stop
            local dist  = estimate_distance(to)

            local cost  = cnode.cost + move
            local weight = cost + dist

            local node = ab_node(to, harbour_node, cost, dist, d, 0x0f)
            add_to_open(node, weight)
          }

          d = d*2
        } while (tile.get_slope()==0  &&  d<16)
      }
    }
  }

Sollte mit dem Code von GitHub reproduzierbar sein.
Script-KI für Simutrans r10894+ / Simutrans Nightly Builds
Zitieren


Nachrichten in diesem Thema
Script-KI - combined_connection - von Andarix - 02-05-2020, Saturday-12:30:52
RE: Script-KI - combined_connection - von Dwachs2 - 02-05-2020, Saturday-15:01:12
RE: Script-KI - combined_connection - von Andarix - 02-05-2020, Saturday-15:57:48

Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste