Callbacks Module
Engine callback functions that query live game state via the HighBar V2 proxy. Each function sends a callback request over the Unix domain socket and returns the parsed result. All functions require an active NetworkStream connection to the proxy.
Functions and values
| Function or value |
Description
|
Full Usage:
getBuildOptions stream defId
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
defId : int
-
The unit-definition ID of the builder.
Returns: int array
An array of unit-definition IDs that this unit can build.
|
Queries the engine for the build options of a unit definition (what it can build).
|
Full Usage:
getBuildSpeed stream defId
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
defId : int
-
The unit-definition ID.
Returns: float32
Build speed value (higher means faster construction).
|
Queries the engine for the build speed of a unit definition.
|
Full Usage:
getCornersHeightMap stream
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
Returns: float32 list
Flat list of corner height values in row-major order.
|
Queries the engine for the corners heightmap as a flat list in row-major order. Returns (mapWidth+1) x (mapHeight+1) vertex-resolution height values suitable for constructing a MapGrid.
|
Full Usage:
getEconomyCurrent stream resourceId
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
resourceId : int
-
Resource index (0 = metal, 1 = energy).
Returns: float32
Current resource amount.
|
Queries the engine for the current stockpile of a resource.
|
Full Usage:
getEconomyIncome stream resourceId
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
resourceId : int
-
Resource index (0 = metal, 1 = energy).
Returns: float32
Income rate per frame.
|
Queries the engine for the per-frame income rate of a resource.
|
Full Usage:
getEconomyStorage stream resourceId
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
resourceId : int
-
Resource index (0 = metal, 1 = energy).
Returns: float32
Maximum storage capacity.
|
Queries the engine for the maximum storage capacity of a resource.
|
Full Usage:
getEconomyUsage stream resourceId
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
resourceId : int
-
Resource index (0 = metal, 1 = energy).
Returns: float32
Usage rate per frame.
|
Queries the engine for the per-frame usage rate of a resource.
|
Full Usage:
getGameStateSnapshot stream
Parameters:
NetworkStream
Returns: GameStateSnapshotResult
|
Issues one
Raises ProxyVersionMismatchException when the proxy rejects callback 15 with "Unknown callback id" — no legacy fallback. Raises InvalidOperationException with
a descriptive message on other failures (cap exceeded, proxy
error). The caller's prior Raises EngineDisconnectedException on connection loss (unchanged).
|
Full Usage:
getHeightMap stream
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
Returns: float32 list
Flat list of height values in row-major order.
|
Queries the engine for the full heightmap as a flat list in row-major order. The heightmap has dimensions (mapWidth) x (mapHeight) in heightmap squares.
|
Full Usage:
getLosMap stream
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
Returns: int list
Flat list of LOS values in row-major order.
|
Queries the engine for the line-of-sight map as a flat list in row-major order. Non-zero values indicate cells currently visible to our team.
|
Full Usage:
getMapHeight stream
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
Returns: int
Map height in heightmap squares.
|
Queries the engine for the map height in heightmap grid squares (1 square = 8 elmos).
|
Full Usage:
getMapWidth stream
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
Returns: int
Map width in heightmap squares.
|
Queries the engine for the map width in heightmap grid squares (1 square = 8 elmos).
|
Full Usage:
getMaxWeaponRange stream defId
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
defId : int
-
The unit-definition ID.
Returns: float32
Maximum weapon range in elmos.
|
Queries the engine for the maximum weapon range of a unit definition.
|
Full Usage:
getMetalSpots stream
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
Returns: (float32 * float32 * float32 * float32) array
An array of (x, y, z, metalValue) tuples in world coordinates.
|
Queries the engine for all metal extraction spots on the map. Each spot is returned as (x, y, z, value) where value indicates metal richness.
|
Full Usage:
getMyAllyTeam stream
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
Returns: int
The integer ally-team ID for this AI's alliance group.
|
Queries the engine for this AI's ally-team ID.
|
Full Usage:
getMyTeam stream
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
Returns: int
The integer team ID assigned to this AI.
|
Queries the engine for this AI's team ID.
|
Full Usage:
getRadarMap stream
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
Returns: int list
Flat list of radar coverage values in row-major order.
|
Queries the engine for the radar coverage map as a flat list in row-major order. Non-zero values indicate cells covered by our team's radar.
|
Full Usage:
getResourceMap stream
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
Returns: int list
Flat list of resource density values in row-major order.
|
Queries the engine for the resource distribution map as a flat list in row-major order. Higher values indicate richer metal deposits.
|
Full Usage:
getSlopeMap stream
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
Returns: float32 list
Flat list of slope values (0.0 = flat, 1.0 = vertical) in row-major order.
|
Queries the engine for the slope map as a flat list in row-major order. The slope map has dimensions (mapWidth/2) x (mapHeight/2), at half heightmap resolution.
|
Full Usage:
getStartPos stream teamId
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
teamId : int
-
The team ID to query the start position for.
Returns: float32 * float32 * float32
A tuple of (x, y, z) world coordinates in elmos.
|
Queries the engine for the start position of a given team.
|
Full Usage:
getUnitDef stream unitId
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
unitId : int
-
The engine-assigned unit ID.
Returns: int
The unit-definition ID that describes this unit's type.
|
Queries the engine for the unit-definition ID of a unit instance.
|
Full Usage:
getUnitDefCost stream defId
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
defId : int
-
The unit-definition ID.
Returns: float32
The total resource cost of the unit.
|
Queries the engine for the resource cost of a unit definition.
|
Full Usage:
getUnitDefName stream defId
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
defId : int
-
The unit-definition ID.
Returns: string
The string name of the unit definition.
|
Queries the engine for the internal name of a unit definition (e.g., "armcom").
|
Full Usage:
getUnitDefs stream maxCount
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
maxCount : int
-
Maximum number of unit-definition IDs to retrieve.
Returns: int array
An array of unit-definition IDs.
|
Queries the engine for all available unit-definition IDs.
|
Full Usage:
getUnitHealth stream unitId
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
unitId : int
-
The engine-assigned unit ID.
Returns: float32
Current health points as a float.
|
Queries the engine for the current health of a unit.
|
Full Usage:
getUnitMaxHealth stream unitId
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
unitId : int
-
The engine-assigned unit ID.
Returns: float32
Maximum health points as a float.
|
Queries the engine for the maximum health of a unit.
|
Full Usage:
getUnitPos stream unitId
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
unitId : int
-
The engine-assigned unit ID.
Returns: float32 * float32 * float32
A tuple of (x, y, z) world coordinates in elmos.
|
Queries the engine for the current world position of a unit.
|
FSBarV1_Archived