Add-ons
Extra features for Comms Array, and how to make your own. Everything for developers: Developers.
Official add-ons
Comms Array's own. Signed by the hub, installed from the Add-ons tab in Comms Array with one click. Updates arrive the same way.
Verified add-ons
Made by other people, who publish them on the hub themselves. We checked them and they seem legit; that is not an endorsement, and Comms Array doesn't support them. Signed by the hub so you get exactly what was published.
Unverified add-ons
Published on the hub by their makers; nobody at Comms Array has checked them. The app asks you to confirm you trust whoever made one before it installs, and it starts with no permissions until you tick them.
None yet.
Add-ons from other people
Someone may hand you an add-on as a .zip. In Comms Array, signed in (free, with Discord),
open Add-ons →
Advanced: install an add-on from a file. We haven't checked these, and the app marks them
"your own · unreviewed". Each add-on runs in its own process and starts with no permissions: on the Add-ons
tab you tick exactly what it may do (read live game state, get game events, press game actions, add pad widgets...).
Those ticks cover what it gets from Comms Array. An add-on is still a program on your PC: what it does
outside Comms Array (your files, the internet) isn't something Comms Array can limit, so only install add-ons
from people you trust.
Make your own
What an add-on is
A small Python package that Comms Array runs in its own process. It talks to Comms Array through a
small API and gets only what the player allows: it can add widgets to the phone/tablet pad, answer requests
from those widgets, react to game events (you got downed, a missile warning), read live game state, press game
actions, or use another add-on's functions. It's packed as a .zip:
manifest.json
ca_hello/__init__.py
ca_hello/pad_hello.js (optional: the pad side)
name: lowercase letters, digits, underscore. Used in URLs.package: the folder name. Must not clash with anything Comms Array already has.- Every file except
manifest.jsonlives inside the package folder. "api": 1plus"permissions": what your add-on asks for. The player ticks what they allow; anything else is refused. The full list, anddepends/providesfor add-ons that work together, is in the add-on API reference.- Every key in
manifest.jsonis checked: a key Comms Array doesn't know, or a value of the wrong type, and the zip is refused. A typo never passes silently.
Versions
This is add-on API v1 ("api": 1), and it only grows: new permissions and calls get added,
nothing you use is renamed or removed. Anything that would break your add-on would be a new version, v2. When you
use something added later, set "api_version" (for example "1.1"; the reference says
which version each feature arrived in), so an older Comms Array tells the player to update instead of your
add-on failing.
Add-ons in the older format (without "api": 1, loaded inside Comms Array) no longer load. Comms
Array lists one that's still installed as "made for an older Comms Array"; its author needs to move it to v1.
Physical controls
Building your own panel (buttons, toggle switches, rotary encoders, LEDs on a Teensy, an Arduino or
anything that plugs into the PC)? Your add-on talks to the device; Comms Array gives it what a pad button
has: the game's actions (api.button), toggle switches that never drift out of step with the game
(api.set), LEDs that follow the game's lamps (api.lamp) and the pad's own action
picker for your setup screen (CA.pickAction). Comms Array never opens your device itself.
Everything, including the rules a hardware add-on follows:
Hardware add-ons in the reference.
Example: manifest.json
{"name": "hello", "package": "ca_hello", "version": "2.0.0", "title": "Hello (example)",
"description": "A tap counter for the pad that also counts your deaths. A starting point for your own add-on.",
"author": "you", "api": 1, "permissions": ["pad.widgets", "events.game"], "widgets": ["hello_counter"],
"pad_js": "pad_hello.js"}
Example: ca_hello/__init__.py
create(api) returns your add-on object. Everything is optional: async start() / stop(), on_state(state), on_event(ev), on_journal(ev), async handle_pad(device, body), async handle_call(fn, caller, body), device_gone(device_id). Ask Comms Array for things with await api.state(), api.press(action), api.call(addon, fn, body)...; show a status with api.set_status({...}).
"""Example Comms Array add-on: a pad button that counts taps, plus a death counter from game events.
It runs in its own process. `api` is all it gets from Comms Array, and only what the user allowed in manifest.json's
"permissions" (here: pad.widgets for the button, events.game for the deaths).
"""
class Hello:
def __init__(self, api):
self.api = api
self.taps = 0
self.deaths = 0
async def handle_pad(self, device: dict, body: dict):
"""Your pad widget's POST /api/pad/mod/hello. Return (json, http status)."""
if body.get("op") == "tap":
self.taps += 1
self.api.set_status({"taps": self.taps, "deaths": self.deaths}) # shown on the pad and the PC
return {"taps": self.taps}, 200
def on_event(self, ev: dict): # every game event (needs events.game)
if ev["type"] == "player.dead":
self.deaths += 1
def create(api):
return Hello(api)
Example: ca_hello/pad_hello.js
Each of your widgets runs in its own sandboxed frame on the pad: it can draw, but it can't reach the pad page, the network or anything stored on the device. Register widgets with CA.widget(type, {add, settings, tile, panels}): tile(root, w, {editing}) draws one (return {update(state)} for live values), add puts it in the pad's Add widget list, settings lists fields the pad shows in edit mode, panels are full-screen pages (CA.openPanel(name), draw with CA.sheet(html, wire), leave with CA.close()). Talk to your add-on with await CA.call(body). Also: CA.toast, CA.buzz, CA.share / CA.onShare (between your frames), CA.onState, CA.pad, CA.esc.
// The "hello_counter" widget. It runs in its own sandboxed frame on the pad (see docs/addon-api.md): it draws, and talks
// to this add-on on the PC with CA.call. It can't reach the pad page, the network or anything stored on the device.
CA.widget("hello_counter", {
add: { label: "Tap counter", desc: "Example add-on", size: [1, 1], props: () => ({ label: "Taps" }) },
settings: [{ key: "label", type: "text", label: "Label", max: 40 }],
tile(root, w, { editing }) {
root.innerHTML = `<div class="w b"><span>${CA.esc(w.label)}</span><span class="sub">0</span></div>`;
if (editing) return;
const tile = root.firstChild;
tile.onclick = async () => {
const r = await CA.call({ op: "tap" }); // POSTs to this add-on on the PC
tile.querySelector(".sub").textContent = r.taps ?? "?";
};
},
});
Game events for on_event
Each event is {"type": ..., "data": {...}, "ts": ...}. Each game's list is on Game events.
Trying it and sharing it
- While you build it: sign in first (free, with Discord), zip it and install it from the Add-ons tab (Advanced). Installing a new version restarts your add-on; Comms Array keeps running. Its log lines show up in Comms Array's log with its name.
- What you can import: Python's standard library (including
ctypes,sqlite3,zipfile,csv) andaiohttp. You can't install extra packages into the app; copy pure-Python code into your package if you need it. - Sharing: zip it (manifest at the top) and hand it out. People install it from the Advanced section of the Add-ons tab, then tick the permissions it needs. Tell them what it does and why it asks for each one.
- Questions? Ask in the Discord.