SOFLAM Integration Core
Building a laser designator other mods can home in on Changed
A designator you carry, assemble on a tripod and operate as a gunner – publishing laser targets by code, so that missiles, turrets and aircraft from other mods can find them. These pages explain how such a system is built in Arma Reforger, and above all where it breaks once it runs on a dedicated server. If you build a mod that should work with it, start with Make your mod compatible.
How to read these pages
Every page is one problem that took a while to get right: what goes wrong with the obvious approach, the technique
that works instead, and a short example. The examples are excerpts from the real code of the SOFLAM Integration Core, shortened
and commented – class, method, attribute and action names are the real ones (GTG_SOFLAM_). They are not whole files.
Where a snippet is a pattern for your mod, its classes start with MyMod_, which stands for your own prefix.
These pages describe the published (stable) version of the Core, the one on the
Workshop. A few member names in the code are German
(GetLetzteMeldung, GTG_SendeZielAnlegen); they are quoted as they are, because that is what you have to type.
For other modders
Do you build a missile, an aircraft, a turret or a designator of your own? These pages tell you step by step what to do so that your mod works with the Core – with the real names, real prefab text from the mods that already do it, and the mistakes they made on the way.
Make your mod compatible
Start here: what do you want to build, the public surface of the Core, and which existing mod to copy.
1. Add the Core as a dependency
addon.gproj, the GUID, and what happens when the Core is missing.
2. Make a weapon follow the laser
Read the registry from your seeker, or attach the Core's seeker component.
3. Aircraft, vehicles and turrets
Code holder, cockpit dials, injector, seat names – as the AH-64 and AH-1Z mods build them.
4. Report your own designator
How a drone, a turret or any other device puts a laser point into the registry.
5. Optional integration
Work with or without the Core, without a hard dependency.
6. Testing and common errors
A dedicated-server checklist, and symptom → cause → fix with the real log lines.
How it is built
Target registry
Match by code, not by entity. A game system instead of a singleton, and an expiry for entries nobody removed.
The designator
Mark or only measure, follow a moving vehicle, and report rarely.
Who may send
A client that does not own the entity talks to nobody. A relay on the character fixes it.
The seeker side
How a missile or turret in another mod finds the point, and why mounts need several seekers.
Night and thermal vision
Per-viewer infrared visibility, optional mods without a compile dependency, and the camera-id trap.
The visible beam
A component that ticks only where the entity is owned, and why the beam must start at the lens.
A telescopic tripod
Legs that go down while the structure rises, numbers on the wire, and legs that follow a slope.
Assembling and the gunner seat
Two parts become one turret, why a freely spawned weapon arrives empty, and a door that is blocked on a hillside.
Dedicated-server pitfalls
The short list: things that look fine in Workbench and fail on a server.
Integrating aircraft
What went wrong on helicopters: weapon racks, mode keys, phantom explosions, the missile camera, and testing.
The shape of it
Three kinds of participant that only know each other through one registry. A designator measures and reports a point with a four-digit code. The registry stores the point. A seeker asks for the nearest point with its code. Nobody holds a reference to anybody else, which is why a designator from this mod can guide a missile from a different one.
In the code: GTG_SOFLAM_LaserDesignatorComponent measures and reports,
GTG_SOFLAM_Relay carries the message to the server when the player does not own the device,
GTG_SOFLAM_LaserTargetManager is the registry, and GTG_SOFLAM_LaserSeekerComponent (or your own seeker that reads
the registry) is the other end.
Rules that held up
| Rule | Why |
|---|---|
| Match by code, never by entity | The registry is the only coupling. Designator and seeker can come from different mods, different players, different vehicles. |
| Everything sent has an owner | A client that does not own the entity sends to the server and nothing arrives. No error, no log. See Who may send. |
| One writer per fact | Position is measured by one machine and broadcast. Every other machine derives what it needs from that. |
| Prefix every class | A name clash does not break one mod, it breaks the whole script module – for every player. The prefix is cheap insurance. |
| Measure, do not guess | Laser power limits, leg extension, offsets – all of them were run through by hand and confirmed on a server before they became numbers. |