MapQuery Module
Elmo-coordinate query functions for MapGrid data. All functions accept world-space elmo coordinates and handle the conversion to grid indices internally.
Functions and values
| Function or value |
Description
|
Full Usage:
elmoToGrid x z
Parameters:
int
-
X coordinate in elmos.
z : int
-
Z coordinate in elmos.
Returns: int * int
A tuple (gridX, gridZ) of heightmap grid indices.
|
Converts elmo (world) coordinates to heightmap grid indices by dividing by 8.
|
Full Usage:
gridToElmo x z
Parameters:
int
-
X grid index.
z : int
-
Z grid index.
Returns: int * int
A tuple (elmoX, elmoZ) of world coordinates.
|
Converts heightmap grid indices to elmo (world) coordinates by multiplying by 8.
|
|
|
Full Usage:
heightSubRegion grid x1 z1 x2 z2
Parameters:
MapGrid
-
The map grid containing height data.
x1 : int
-
Left edge X coordinate in elmos.
z1 : int
-
Top edge Z coordinate in elmos.
x2 : int
-
Right edge X coordinate in elmos.
z2 : int
-
Bottom edge Z coordinate in elmos.
Returns: Result<float32[,], string>
Ok subRegion as a 2D float32 array, or Error message if the region has zero or negative size.
|
Extracts a rectangular sub-region of the heightmap defined by elmo coordinate bounds. Coordinates are clamped to the valid grid range.
|
Full Usage:
metalSpotsFromResourceMap grid
Parameters:
MapGrid
Returns: (float32 * float32 * float32 * float32) array
|
Scans
worldX and worldZ are the cluster's centroid in elmos (heightmap cells * 8).
worldY is the height at the centroid as read from
|
Full Usage:
nearestMetalSpot spots (position, arg2, arg2)
Parameters:
(float32 * float32 * float32 * float32) array
position : float32
arg2 : float32
arg3 : float32
Returns: (float32 * float32 * float32 * float32) option
A list of (gridX, gridZ, resourceValue) tuples sorted by value descending.
|
Finds all cells in a rectangular region where the resource value exceeds the given threshold. Results are sorted by resource value in descending order (richest first).
|
Full Usage:
resourceHotspots grid x1 z1 x2 z2 threshold
Parameters:
MapGrid
x1 : int
z1 : int
x2 : int
z2 : int
threshold : int
Returns: (int * int * int) list
|
|
|
|
|
Queries the terrain classification at the given elmo coordinates.
|
FSBarV1_Archived