Difference between revisions of "MIST hex neighbor"

From DCS World Wiki - Hoggitworld.com
(Created page with "{{Mission Scripting |fName= mist.hex.neighbor| |vNum = Mist 4.6 |desc= Returns the neighboring hex in a given direction. Direction must be a number 1 through 6 |rtnType=...")
 
(No difference)

Latest revision as of 02:04, 1 September 2026


mist.hex.neighbor

Added with: Mist 4.6
Description
Returns the neighboring hex in a given direction.

Direction must be a number 1 through 6

Syntax
table mist.hex.neighbor(table qrs ,number direction )
Valid Input Values:
Return value:
table
Return example:
Usage Examples:
The following will iterate the 6 neighbors of a given hexagon at the center of the map.
  local hex = {q = 0, r = 0, s = 1}
  
  for i = 1, 6 do
      local n = mist.hex.neighbor(hex, i)
      -- do whatever you want with this information

  end
Notes:
Related Functions
to, getRadius, setRadius, add, subtract,scale, rotate_left, rotate_right, neighbor, getNeighborCount, diagonalNeighbor, length, distance, round, lerp, cubeScale, cubeRing, cubeSpiral, lineDraw, cubeToAxial, axialToCube, pointToHex, makeVek2, makeVec3, makeVec3GL, hash, hashToHex, draw

Scripting Engine

MIST Root Page