ArcBasicDocs
2DPathfindingArcBasic extension

PathGridCost

Sets how costly a grid cell is to cross.

PathGridCost ( grid,x,y,cost# )

Parameters

grid
the grid's handle.
x
the cell's column, counting from 0.
y
the cell's row, counting from 0.
cost#
how costly the cell is, more than 0.

Description

Sets how costly a cell is to cross. Every cell starts at 1; a cell costing 3, such as mud or deep water, counts as three ordinary cells, so paths go round it when a way round is shorter than 3 cells, and through it when it isn't. Costs below 1, such as 0.5 for a road, make cells cheaper than normal.

See also