Skip to content

SMX Chat API

Hey Sky edited this page Nov 12, 2026 · 3 revisions

SMX Chat API (for other mods)

🇬🇧 English · 🇩🇪 Deutsche Version

Source: SkyMap-X-DEV → Scripts/Game/Helper/SMX_ChatAPI.c. Requires SkyMap-X as a dependency of your addon.

1. What it is

A small read-only API so other mods can read the SkyMap-X tablet chat: all messages of the current session, with sender and text.

Every message is an SMX_ChatData:

Field Content
sender Chat ID of the sender tablet: T<tablet ID>, e.g. T123456789 (set by the server)
senderName Name the sender used (player / device name)
receiver Chat ID of the receiving tablet
message Message text
timestamp HH:MM:SS

Chat ID: a conversation is exactly between two tablets. The ID is T<tablet ID>. The tablet ID is derived by the server from the player's Bohemia account and survives restarts, renames and group changes (see Screen Mirror & Tablet ID §4). Older versions used Device ID [Info]; that text is now only the label in the contact list. (WIP branch tablet-spiegelung-2026-11.)

2. Calls

Call Where Returns
SMX_ChatAPI.GetSessionMessages() Client array<ref SMX_ChatData>: all messages of this session that this client sent or received (history loaded from files is not included).
SMX_ChatAPI.GetOnMessage() Client ScriptInvoker, fires on every new message of this client. Handler: void Fn(SMX_ChatData data)
SMX_ChatAPI.GetOnServerMessage() Server / host ScriptInvoker, fires for all chat messages of all players. Handler: void Fn(SMX_ChatData data)

A client only knows conversations it takes part in. For truly all messages of a session use the server hook. It fires after rate limit and length trimming (500 chars) were applied. Calls return null while the managers do not exist yet.

3. Example

// Server-side mod: log every chat message
SMX_ChatAPI.GetOnServerMessage().Insert(OnChat);

void OnChat(SMX_ChatData d)
{
	Print(d.timestamp + " " + d.senderName + " -> " + d.receiver + ": " + d.message);
}

Clone this wiki locally