Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions addons/recorder/fnc_installPlayerTrackingClients.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ call GVAR(publishPlayerTrackingSettings);
// fall-through to the engine trait when the ACE variable was never set, so the
// recording shows the level the mod actually acted on.
//
// `medicDefault` / `engineerDefault` say whether that level is the unit's
// class level, i.e. the Eden attribute was left on "Default". It cannot be
// derived from the level: ACE's Eden attributes store nothing when the chosen
// level equals the class's, and ace_repair clears the engine "engineer" trait
// on every engineer class at InitPost, storing ACE_IsEngineer = true instead.
// Eden, the Assign modules and Zeus always store a number, so a boolean `true`
// on an engineer class is ACE's own class conversion.
//
// Traits ride inside the inventory snapshot: they are assigned with the
// loadout, change about as often, and the server's diff then carries them only
// when they change.
Expand Down Expand Up @@ -141,13 +149,16 @@ call GVAR(publishPlayerTrackingSettings);
if (_level isEqualType false) then {_level = parseNumber _level};
if (!(_level isEqualType 0)) then {_level = 0};
_ace set ["medic", _level];
_ace set ["medicDefault", isNil {_unit getVariable "ace_medical_medicClass"}];
};
if (OCAP_recorder_client_hasAceRepair) then {
// 0 none, 1 engineer, 2 advanced engineer. ACE writes `true` for 1.
private _stored = _unit getVariable "ACE_IsEngineer";
private _level = _unit getVariable ["ACE_IsEngineer", _unit getUnitTrait "engineer"];
if (_level isEqualType false) then {_level = parseNumber _level};
if (!(_level isEqualType 0)) then {_level = 0};
_ace set ["engineer", _level];
_ace set ["engineerDefault", isNil "_stored" || {_stored isEqualTo true && {getNumber (configOf _unit >> "engineer") > 0}}];
};
if (OCAP_recorder_client_hasAceExplosives) then {
_ace set ["eod", (_unit getVariable ["ACE_isEOD", _unit getUnitTrait "explosiveSpecialist"]) in [1, true]];
Expand Down
12 changes: 12 additions & 0 deletions docs/player-detail-tracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,18 @@ Recordings made before this change are converted by
through the mods' own stringtables and keeps it exactly as recorded when they have
no English for it.

## ACE training levels

`traits.ace` holds the medic (0-2) and engineer (0-2) level ACE acts on, read the
way `ace_medical_treatment_fnc_isMedic` and `ace_repair_fnc_isEngineer` read them.
Next to each, `medicDefault` / `engineerDefault` is `true` when that level is the
unit's class level, i.e. the Eden attribute was left on "Default". The level alone
cannot tell: ACE's Eden attributes store nothing when the chosen level equals the
class's, and `ace_repair` clears the engine `engineer` trait on every engineer
class at InitPost and stores `ACE_IsEngineer = true` instead. Eden, the Assign
modules and Zeus always store a number. "None" on a class without the trait stores
nothing either, so in game and in the recording it is the same as "Default".

## Snapshot diffs

A follow-up snapshot carries only what changed. Nested HashMaps are walked, and
Expand Down
Loading