A complete adapter
This registers, captures, and can be versioned and diffed immediately. Everything else in these docs is detail on top of it.lua/autorun/server/myaddon_vetra.lua
snapshot declared. From the server console, this prints the same:
transform, materialize, properties and remove is step 6.
The seven decisions
1. Pick an adapter id
vendor.domain: lowercase, exactly one dot, [a-z0-9_] on each side, at most 48
characters. No hyphens.
The vendor half is a namespace you own. Two authors both shipping spawns is a collision;
acme.spawns and zeta.spawns is not. The vetra vendor is reserved.
2. Register from the hook
That is the whole integration point, and it works whether your addon loads before or after Blueprints. See Registry.3. Implement Collect
Return every object in your domain, on this map, as plain data.
- Plain numbers, strings and booleans only. No
Vector, noAngle, noEntity, no functions. A Version is JSON on disk. - All of them or none. An object quietly left out reads, in the next diff, as an object
somebody deleted. If you cannot answer,
error(): Blueprints names you and fails the capture, which is recoverable in one operation. transformis optional. Plenty of configuration has no position. If you omit it, the transform you are given back isniltoo, so guard for it.
4. Choose your identity guarantee
5. Declare a dependency, if you have one
6. Add capabilities, one at a time
snapshot is required. Each of the others is a promise about every record you emit, and
costs functions that are checked at registration:
Under-declaring is free. Over-declaring produces a migration that half works and a restore
that half destroys. See Capabilities.
7. Test it
Collect and PrepareMaterialize: it checks your records, their
identity and their determinism, and writes nothing. The second exercises every capability you
declared on a fixture it builds through your own Materialize and removes again. It never
targets an object that was already there, but your adapter’s writes are real, so run it on a
development server.
Neither can restart the server for you. If you declared persistent, restart and check your
ids come back. See Testing your adapter.
Next
Adapter anatomy
Every field and function in one place.
Worked example
A complete adapter with all five capabilities, shipped with Blueprints.
Compatibility checklist
The things that go wrong. Read before shipping.
API reference
Exact signatures.