Page tree
Skip to end of metadata
Go to start of metadata


Introduced in

Version:1.30

Description

Description:Returns the cost of a field in a Cost Map (a map that stores the accessibility of a given place) for a given position.

Syntax

Syntax:cost [position,type]
Parameters:
  • position: Position2D - Position to evaluate.
  • type: Number - 0: cost for vehicle, 1: cost for unit.
Return Value:String - Cost type for position. Can be:
  • "Normal" (1,1)
  • "AvoidBush" (1,1)
  • "AvoidTree" (3,3)
  • "Avoid" (3,3)
  • "Water" (inaccessible)
  • "SpaceRoad" (inaccessible)
  • "Road" (.5,.5)
  • "SpaceBush" (1,2)
  • "SpaceHardBush" (1.5,10)
  • "SpaceTree" (inaccessible)
  • "Space" (inaccessible)
  • "RoadForced" (.5,.5)

Note: Cost values for normal and stealth modes are listed in brackets. Keep in mind that only the name is returned.

Examples

Examples:
_cost = cost [getPos player, 1]

Additional Information

See also: nearestCostPosition, exportCostMap
Multiplayer: 
Problems: 

Notes