Added Runtime variables to MM Refs

2026-05-25 03:15:46 -03:00
parent 50dde488e7
commit 78e9b7d820

@@ -318,6 +318,164 @@ Returns the stable ARMATAK UUID used for a unit, vehicle, or object. Use it when
private _uid = [player] call armatak_fnc_extract_uuid;
```
## Runtime Variables
Runtime variables let mission scripts tune how ARMATAK publishes specific entities without changing addon code. Use `setVariable` on the entity that owns the behavior, or `missionNamespace setVariable` for global router state.
When the value must be visible across machines, use the public flag:
```sqf
_entity setVariable ["armatak_variable_name", _value, true];
missionNamespace setVariable ["armatak_variable_name", _value, true];
```
For server-side router behavior, set these on the server or publish them with the third `setVariable` argument set to `true`.
| Variable | Scope | Type | Safe to write? | Description |
| --- | --- | --- | --- | --- |
| `armatak_disable_sensor_data` | Routed entity | Boolean | Yes | Disables additional sensor-detected contact publishing for that entity. |
| `armatak_current_side` | Unit/vehicle | Side | Yes | Overrides the side ARMATAK uses when deriving affiliation for a marker. |
| `armatak_uas_fov` | UAV | Number | Yes | Horizontal camera FOV in degrees used by UAS CoT and MAVLink camera data. |
| `armatak_uas_vfov` | UAV | Number | Yes | Vertical camera FOV in degrees. Defaults to `armatak_uas_fov * 0.5625`. |
| `armatak_uas_max_range` | UAV | Number | Yes | Max range in meters used when projecting the UAS sensor point. |
| `armatak_uas_controller_uid` | UAV | String | Advanced | Fallback controller UID used when no live UAV controller is found. |
| `armatak_uas_armed` | UAV | Boolean | Advanced | Armed state mirrored to UAS Tool. Usually managed by ARMATAK and UAS Tool callbacks. |
| `armatak_uas_home_atl` | UAV | Position ATL | Advanced | Home/RTL point used by UAS Tool commands. Usually initialized automatically. |
| `armatak_uas_home_geo` | UAV | `[lat, lon, alt]` | Advanced | Geographic home point reported to UAS Tool. Keep in sync with `armatak_uas_home_atl` if writing it. |
| `armatak_uas_spi_asl` | UAV | Position ASL | Read/debug | Last sensor point of interest in ASL, written by camera extraction. |
| `armatak_uas_spi_geo` | UAV | `[lat, lon, hae]` | Read/debug | Last sensor point of interest in TAK coordinates, written by camera extraction. |
| `armatak_uav_mavlink_broadcasting` | UAV | Boolean | Read/debug | True while the client-side MAVLink broadcaster owns this UAV. The server router uses it to avoid duplicate UAS CoT. |
| `_atak_uid` | Entity | String | Advanced | Stable UID used by ARMATAK for CoT identity. Prefer `armatak_fnc_extract_uuid` unless you deliberately need a custom fixed UID. |
| `armatak_server_syncedUnits` | `missionNamespace` | Array of objects | Yes | Current server-side router entity list. Useful for dynamic mission routing. |
| `armatak_tcp_socket_is_running` | `missionNamespace` | Boolean | Read/debug | True while the TCP router is considered running. Prefer router modules and `armatak_fnc_stop_tcp_socket` for control. |
| `armatak_registered_cots` | `missionNamespace` | Array | Internal | Registry used by `armatak_fnc_register_cot` and `armatak_fnc_delete_registered_cots`. Use the functions instead of editing directly. |
| `armatak_server_clientClaimedEuds` | `missionNamespace` | Array of UIDs | Internal | Tracks EUDs claimed by client-side connection logic to avoid duplicate server EUD CoTs. |
| `armatak_uas_mission_items` | UAV | Array | Internal | Route items received from UAS Tool mission upload. Managed by MAVLink callbacks. |
### `armatak_disable_sensor_data`
Set this variable on a routed entity to stop ARMATAK from publishing additional sensor-detected contacts for that entity. The entity itself can still be routed normally; only the extra contacts produced by `getSensorTargets` are suppressed.
This is useful for scripted mission targets such as convoy vehicles where you want TAK to show only the vehicle marker, not every crewman or passenger detected by that vehicle.
```sqf
_convoyVehicle setVariable ["armatak_disable_sensor_data", true, true];
```
Clear or set it to `false` if you want the entity to publish sensor contacts again.
```sqf
_convoyVehicle setVariable ["armatak_disable_sensor_data", false, true];
```
### `armatak_current_side`
Overrides the side ARMATAK uses when it derives a CoT affiliation from an object. This is useful for scripted captures, undercover units, spawned targets, or cases where the engine side does not match what TAK should display.
```sqf
// Force a civilian-looking object to publish as hostile.
_target setVariable ["armatak_current_side", east, true];
// Restore normal side-derived behavior.
_target setVariable ["armatak_current_side", nil, true];
```
### UAS camera tuning
Use these variables on UAVs when the default camera model is too generic for the platform:
```sqf
uav1 setVariable ["armatak_uas_fov", 45, true];
uav1 setVariable ["armatak_uas_vfov", 25, true];
uav1 setVariable ["armatak_uas_max_range", 8000, true];
```
`armatak_uas_fov` and `armatak_uas_vfov` affect the camera/video metadata sent to TAK and UAS Tool. `armatak_uas_max_range` limits how far ARMATAK projects the sensor point when the camera is not looking directly at terrain.
For a temporary exact camera solution, prefer `armatak_fnc_set_uas_camera_override` instead of setting `armatak_uas_spi_asl` or `armatak_uas_spi_geo` manually.
```sqf
private _spiAsl = getPosASL target1;
private _spiGeo = (getPosATL target1) call armatak_client_fnc_convertClientLocation;
[uav1, [120, -25, 45, 1800, _spiAsl, _spiGeo]] call armatak_fnc_set_uas_camera_override;
```
### UAS home and armed state
ARMATAK initializes `armatak_uas_home_atl` and `armatak_uas_home_geo` automatically when a UAV starts broadcasting. UAS Tool can also update home through supported MAVLink commands.
Mission scripts can pre-seed or override home if needed:
```sqf
private _homeAtl = getMarkerPos "uav_home";
_homeAtl set [2, 75];
private _homeGeo = _homeAtl call armatak_client_fnc_convertClientLocation;
uav1 setVariable ["armatak_uas_home_atl", _homeAtl, true];
uav1 setVariable ["armatak_uas_home_geo", _homeGeo, true];
```
`armatak_uas_armed` is normally managed by ARMATAK when UAS Tool sends arm/disarm commands. If a mission script force-starts a UAV and you want UAS Tool to see it as armed:
```sqf
uav1 engineOn true;
uav1 setVariable ["armatak_uas_armed", true, true];
```
### Dynamic router entity list
`armatak_server_syncedUnits` is the server-side router list used by the CoT router loop. You can update it from mission scripts when entities are spawned, deleted, captured, or moved between mission systems.
```sqf
private _routed = missionNamespace getVariable ["armatak_server_syncedUnits", []];
_routed pushBackUnique _newVehicle;
missionNamespace setVariable ["armatak_server_syncedUnits", _routed, true];
```
To remove an entity:
```sqf
private _routed = missionNamespace getVariable ["armatak_server_syncedUnits", []];
_routed = _routed - [_oldVehicle];
missionNamespace setVariable ["armatak_server_syncedUnits", _routed, true];
```
For periodic dynamic missions, rebuild the list from your mission state and remove null/dead objects before publishing it:
```sqf
private _entities = playableUnits + (missionNamespace getVariable ["myMission_routedVehicles", []]);
_entities = _entities arrayIntersect _entities;
_entities = _entities select {!isNull _x && {alive _x}};
missionNamespace setVariable ["armatak_server_syncedUnits", _entities, true];
```
### Stable custom CoT identity
ARMATAK stores each entity UUID in `_atak_uid`. Most scripts should read it through `armatak_fnc_extract_uuid`:
```sqf
private _uid = [uav1] call armatak_fnc_extract_uuid;
```
Only set `_atak_uid` yourself when you intentionally need a deterministic TAK identity across respawns or recreated objects:
```sqf
_newVehicle setVariable ["_atak_uid", "mission-convoy-vehicle-01", true];
```
Do this before the entity is first published. Reusing the same UID for two live entities will make TAK clients treat them as the same object.
### Variables to avoid editing directly
Do not directly edit `armatak_registered_cots`; use:
```sqf
[_scope, _uid, _cotType, _lat, _lon, _hae] call armatak_fnc_register_cot;
[_scope] call armatak_fnc_delete_registered_cots;
```
Avoid direct writes to `armatak_uas_mission_items`, `armatak_server_clientClaimedEuds`, `armatak_uas_spi_asl`, and `armatak_uas_spi_geo` unless you are debugging ARMATAK internals. Those values are maintained by the router, camera extractor, or MAVLink callbacks.
## 3DEN Attributes for Mission Makers
ARMATAK adds these editor attributes: