Skip to content

SMX API

Hey Sky edited this page Nov 29, 2026 · 1 revision

SMX API (for other mods)

🇬🇧 English · 🇩🇪 Deutsche Version

Source: SkyMap-X-DEV → Scripts/Game/Helper/SMX_API.c. Requires SkyMap-X as a dependency of your addon. For chat messages see the Chat API.

1. What it is

SMX_API is the public static query interface of SkyMap-X: who am I (tablet ID, chat address, name, group), what state is my tablet in, where am I, which devices and trackers does my client know. It is read-only except for one function: SetZeusShowAllBFT() (server). All calls are static, no instance needed.

Where What
Client Everything under Local tablet, Position, Known devices, Trackers
Server GetChatAddressForPlayer(), GetTabletIdForPlayer(), SetZeusShowAllBFT()
Both Zeus / BFT queries
SMX_TabletInfo info = SMX_API.GetLocalTabletInfo();
if (info && info.m_bPoweredOn)
	Print("I am " + info.m_sChatAddress + " at " + info.m_sGrid);

2. SMX_TabletInfo

Snapshot of the local tablet and its carrier (returned by GetLocalTabletInfo()).

Field Content
m_iTabletId Tablet ID assigned by the server from the Bohemia identity (stable across restarts), -1 = not assigned yet
m_sChatAddress Chat address T<ID>, empty until an ID exists
m_sDeviceName / m_sDeviceGroup Device name and group from the tablet settings (e.g. SkyKing Cam / A3-2B)
m_bPoweredOn Tablet is on (TabMode not OFF)
m_sTabMode Display form: OFFtab, ONtab, HANDtab, BIGtab, MINITab, PAPERMap, GMmode
m_sMode Mode: Off, On, GPS, Chat, Settings, Feeds
m_sFactionKey Faction key of the player (e.g. US), empty if unknown
m_vPosition / m_sGrid World position of the carrier and grid square (6 digits, see FormatGrid)
m_iPlayerId Reforger player ID of the carrier

3. Local tablet (client)

Call Returns
bool HasLocalTablet() true if a SkyMap-X tablet exists on this client (also switched off)
bool IsLocalTabletOn() true if the local tablet is switched on
int GetLocalTabletId() Tablet ID of the local player, -1 until the server assigned one
string GetLocalChatAddress() Chat address T<ID>, empty until an ID exists
SMX_TabletInfo GetLocalTabletInfo() Everything above in one object, null if this client has no tablet

4. Position (client)

Call Returns
bool GetLocalPosition(out vector worldPos) World position of the local player (controlled entity), false if none exists
string GetLocalGrid(int digits = 3) Grid square of the local player, e.g. 123 456; empty if no position. digits per axis: 3 = 100 m square, 4 = 10 m, 5 = 1 m
string FormatGrid(vector worldPos, int digits = 3) World position → grid EEE NNN (east, north) from the meters of the world coordinate, without map offset. Matches the in-game grid only if the map has no grid offset. digits 1–5

5. Known devices (client)

Devices this client knows: switched-on tablets of teammates it may see, plus cameras and trackers.

Call Returns
array<SMX_Device> GetKnownDevices() All known devices (copy of the list)
SMX_Device FindDevice(int deviceId) Device with this ID (SMX_DeviceID.id), else null
array<SMX_Device> FindDevicesByType(ESMX_DeviceType type) All known devices of a type (TABLET, CAM, TRACKER)
SMX_Device FindTabletOfPlayer(int playerId) Switched-on tablet of a player (Reforger player ID), else null
bool GetDevicePosition(SMX_Device device, out vector worldPos) Tablets = carrier, cameras / trackers = the device entity. false if unknown (e.g. entity not streamed)
int GetDeviceListRevision() Counter that rises on every change of the device list — cheap change detection instead of comparing the list

6. Trackers / BFT (client)

Call Returns
array<SMX_BFT_MapMarkerTracker> GetVisibleTrackers() All BFT tracker markers this client sees (player tablets, vehicles, AI, SMT). The server filters by faction / sub-channel via stream rules, so this is only what the player may see on the map
array<SMX_BFT_MapMarkerTracker> FindTrackersInRadius(vector worldPos, float radiusM) Visible trackers within a horizontal radius (meters)
SMX_BFT_MapMarkerTracker FindTrackerOfPlayer(int playerId) Visible tracker of a player (carrier's player ID), else null. Player trackers only

7. Zeus / BFT (server + client)

How a Zeus sees BFT markers is set by the server config (bftShowZeus: own faction, bftShowAllZeus: all factions, see Server & Admin Guide). On top of that, "sees all markers" can be switched per Zeus at runtime.

Call Where Description
void SetZeusShowAllBFT(int playerId, bool enabled) Server (no-op on clients) Enables / disables the "all markers of all factions" override for one player. Applied immediately — the player's marker stream is recalculated, also while the editor is open. Replicated to all clients.
bool IsZeusShowAllBFTOverride(int playerId) Server + client true if this player was enabled via SetZeusShowAllBFT.
bool IsZeusShowAllBFT(int playerId) Server + client true if the player sees all markers as Zeus: config bftShowAllZeus or individual override.
bool IsZeusBFTAllowed(int playerId) Server + client true if the player sees BFT markers as Zeus at all (own faction or all): bftShowZeus or IsZeusShowAllBFT.
bool IsLocalZeusSeeingBFT() Client true if the local player has the full editor open and may see BFT markers.

Rules:

  • Only applies while the player has the full Zeus editor open (limited editors do not count).
  • Independent of the config: with bftShowZeus: false and bftShowAllZeus: false the enabled Zeus still sees everything, nobody else gets more.
  • Not persistent: removed when the player disconnects and after a server restart. Set it again after the player has joined (e.g. on OnPlayerRegistered).
  • Resolution per Zeus: individual override or bftShowAllZeus → all markers; else bftShowZeus → own faction only; else normal rules.
// Server: give a specific Zeus the full picture
SMX_API.SetZeusShowAllBFT(playerId, true);
...
SMX_API.SetZeusShowAllBFT(playerId, false);   // back to the server config

8. Server

Call Returns
string GetChatAddressForPlayer(int playerId) Chat address T<ID> of a player; assigns the ID on first call. Empty if not possible or not on the server
int GetTabletIdForPlayer(int playerId) Tablet ID of a player (assigned on first call), -1 if not possible or not on the server

The tablet ID is derived from the player's Bohemia account and survives restarts, renames and group changes (see Screen Mirror & Tablet ID).

Clone this wiki locally