For other modders
Make your mod compatible with the SOFLAM Core New
The Core is a laser-target registry plus a SOFLAM and a tripod. Your mod can use it in three ways: read the registry (a guided weapon), set a code and fire (an aircraft or turret), or put a laser point into it (your own designator). This section says what to do in each case, in the order you will meet the problems.
GTG_SOFLAM_* are names from the Core. MyMod_* in a snippet stands for your prefix – give every class of your mod one. Snippets are shortened excerpts. Log lines are quoted exactly as the code prints them (German), with a translation.What do you want to build?
| I want to ... | What you do | Page |
|---|---|---|
| Make a missile, bomb or shell follow a SOFLAM laser | Give it a four-digit code and read the registry from its seeker (or attach the Core's seeker component). | 2. Make a weapon follow the laser |
| Let the crew of an aircraft or vehicle set a code and fire guided weapons | A code holder on the turret, four dial actions in the cockpit, an injector that copies the code onto each missile, the right seat name. | 3. Aircraft, vehicles and turrets |
| Mark targets from something that is not a SOFLAM (drone, turret) | Either put the Core's designator component on it, or report to the registry yourself through your own relay. | 4. Report your own designator |
| Make my mod work with or without the Core | A small bridge addon that depends on both (a pattern; the published mods depend on the Core directly). | 5. Optional integration |
| Find out why nothing happens on my server | Checklist, then symptom → cause → fix. | 6. Testing and common errors |
Whatever you build, do step 1 first: the Core has to be a dependency of your addon.
What the Core does, and what you build yourself
The Core is the meeting point. It holds the laser points and brings them to every machine. It does not know your aircraft, your missile or your cockpit. Every aircraft mod that exists today built the parts around it itself:
| The Core gives you | You build |
|---|---|
The registry of laser points, filled on every machine (GTG_SOFLAM_LaserTargetManager). | The seeker that reads it, in your missile (the AH-64 and AH-1Z mods each wrote their own). |
| A SOFLAM that publishes points: handheld, or assembled on a tripod and used as a gunner. | The code holder and the four code dials on your aircraft; the Core's dial action only works on a device that carries a designator. |
| Input actions and default keys for designating, ranging, tracking, vision modes and laser power. | The injector that copies the code onto a missile when it is fired. |
| The relay that gets messages to the server when the player does not own the device (inside the designator). | The HUD marker for laser spots, the seat check, flight profiles and cockpit screens. |
| Night/thermal vision, the IR gate and the visible beam as components you can add to any device with an optic. | For a designator that is not the Core's: your own relay (step 4 shows how). |
The public surface
These are the names that foreign code in the existing mods really uses or that the Core documents as stable (the registry's methods are named a promise in the Core's design notes). Everything else in the Core is internal and may change.
| Class or name | Role | What foreign code does with it | Seen in |
|---|---|---|---|
GTG_SOFLAM_LaserTargetManager (a GameSystem) | The registry | GetInstance() and check for null every time. Read: GetTargetsByCode, GetAllTargets, GetClosestTargetByCode, GetTarget, GetTargetCount. Publish: CreateTarget, UpdateTarget, RemoveTarget. | AH-64, AH-1Z |
GTG_SOFLAM_LaserTarget | One registry entry | GetPosition(), GetCode(), GetCreatorId(), GetLetzteMeldung() (time of the last report). | same |
GTG_SOFLAM_LaserSeekerComponent | Seeker you can attach to a missile or turret | SetLaserCode, SetSearchActive, IsLaserTargetFound, GetLaserTargetPosition, GetDirectionToLaserTarget, GetSeekerAngles, static FindSeekerById; override the protected SelectTarget / AcceptTarget. | no checked mod attaches it |
GTG_SOFLAM_LaserDesignatorComponent | The designator on a device | SetLaserActive, IsLaserActive, SetLaserCode, GetLaserCode, SetActionsEnabled, GetCreatorId, SetCameraEntity, GetLaserPower / SetLaserPower; static FindOn(entity). A subclass may override the protected ComputeTargetPosition. | the Core's own prefabs; its test emitters in the AH-64 / AH-1Z mods only publish through the registry |
GTG_SOFLAM_SoflamDesignatorComponent | The designator class that sits on the SOFLAM prefabs (five-ray beam bundle) | Never search for it by its own class; use GTG_SOFLAM_LaserDesignatorComponent.FindOn(entity), which finds both. | Core |
GTG_SOFLAM_Relay and the GTG_SOFLAM_Sende* methods on SCR_CharacterControllerComponent | The route to the server | Used by the designator. It resolves a RplId to a GTG_SOFLAM_LaserDesignatorComponent and nothing else, so a device without that component needs its own relay. | Core |
GTG_SOFLAM_LaserCodeDigitAction | One code wheel (user action) | Put four on a device that carries a designator, with m_iDigitIndex 0..3. Digits run 1..8. | Core prefabs |
GTG_SOFLAM_NVState | “Can this viewer see infrared?” | CanLocalPlayerSeeIR(); set SetTemporaryNVState(true) while the player looks through your night-vision optic. | Core |
GTG_SOFLAM_VisionModeComponent, enum GTG_SOFLAM_EVisionMode | Normal / night vision / thermal on any device with an optic | Add it to the device; call SetInputEnabled(true) when the player starts looking through, false when they stop. | Core prefabs |
GTG_SOFLAM_BeamComponent, GTG_SOFLAM_LightEntity, prefab GTG_SOFLAM_IRLaserLight.et | The visible IR beam | Add the beam component next to a designator and set m_sBeamLightPrefab. | Core prefabs |
GTG_SOFLAM_SoflamSightsComponent | The optic of the SOFLAM; knows when you look through it (IsAiming()) | Inherit the SOFLAM prefab rather than rebuilding it. | Core |
GTG_SOFLAM_IsAimingCondition | Condition for the control-hint display | Reference it from your own AvailableActions.conf. | AH-64 |
Prefabs PEQ1_SOFLAM.et {F2A55A212EBAF03F}, PEQ1_SOFLAM_Mounted.et {6A48B5E000005012} | The carried and the turret-mounted SOFLAM | Inherit them (test emitters in the AH-64 / AH-1Z mods) or list them in an arsenal catalogue. | AH-64, AH-1Z |
Input actions GTG_SOFLAM_DesignatorAction (T), _RangefindAction (Y), _TrackingAction (U), _VisionModeAction (J), _ToggleNvThermalAction (mouse:button2), _GainUpAction / _GainDownAction (LSHIFT + wheel), _LaserPowerUpAction / _LaserPowerDownAction (H + wheel) | Keys of the SOFLAM | Keep the attribute defaults of the designator and vision components and your device gets these keys. Do not define actions with these names yourself. | Core |
GTG_SOFLAM_LaserSeekerComponent, but none of the Core's prefabs and none of the mods checked for this page attaches it – they all read the registry directly. Both ways are described on the page about guided weapons; the registry route is the one that is proven in play.Which existing mod to copy
| Mod | Pattern it shows | Depends on the Core |
|---|---|---|
| Sage's AH-1Z – SOFLAM Integration (Workshop) | Aircraft: code holder, four cockpit dials, injector, seeker, HUD markers. The cleanest aircraft template. | Yes (direct, in addon.gproj) |
| AH-64 SOFLAME Integration (Workshop) | The same, plus cockpit screens and flight profiles. More than you need for the Core part. | Yes |
Five rules for foreign code
- List the Core as a dependency, and only one copy of it (step 1).
- Ask for the registry every time and check for null:
GTG_SOFLAM_LaserTargetManager.GetInstance()returns null when no world is loaded. Do not keep it in a field. - Skip entries at the zero vector.
CreateTargetstores no position, so a point that was created but never reported sits at0 0 0. - Prefix everything you add, including RPC methods and input actions. A name clash takes down the whole script module for every player.
- Test on a real dedicated server with a separate client. Most faults in this area are invisible in Workbench (checklist).