ArmaAchilles / Achilles

Achilles is a gameplay modification for Arma 3. It expands the Zeus real-time editor with many new additions as well as provides bug fixes.
Other
75 stars 54 forks source link

Make Achilles support BIS_fnc_setCuratorAttributes #484

Open Bummeri opened 5 years ago

Bummeri commented 5 years ago

Arma 3 Version: stable CBA Version: stable Achilles Version: stable

Mods:

- CBA_A3
- Achilles

Description: BIS_fnc_setCuratorAttributes can normally be used to remove some functions from zeus interactions with Units/Vehicles/Groups/Waypoints.

Achilles however does not respect this.

[_zeusCuratorModule, "object",["unitPos"]] call BIS_fnc_setCuratorAttributes;

Running the above should result to this interface on units: 20190507232412_1

Not this: 20190507232145_1

CreepPork commented 5 years ago

Achilles doesn't respect the variables because it forces them to %ALL, therefore ignoring any other inputs. https://github.com/ArmaAchilles/Achilles/blob/676e895e4a8467435479a7f7266123f03d073e64/%40AresModAchillesExpansion/addons/functions_f_achilles/functions/init/fn_onCuratorStart.sqf#L64-L69

CreepPork commented 5 years ago

I'm not certain how to resolve the issue, to be honest. I think that for mission makers it would be really good if they could limit Achilles (Liberation for example) (keybinds should be limited too) but then for other types of missions? I think that a CBA setting would be the best approach because it gives you the flexibility to choose and the mission make can force to override the server settings.

Bummeri commented 5 years ago

At the moment I remove the options I do not want to be used by script:

    if ("achilles_ui_f" in activatedAddons) then //we need to hide stuff from achilles if its on.
    {
        [{isNull findDisplay 312 || {!isnull findDisplay -1}}, Bum_fnc_handleAchillesMod] call CBA_fnc_waitUntilAndExecute;
    };
Bum_fnc_handleAchillesMod = {

    if (isNull findDisplay 312) exitWith {};

    private _bum_fnc_hideCtrls = {
        params ["_ControlClassesToHide"];
        private _allCtrls = allControls findDisplay -1;

        {
            if (ctrlClassName _x in _ControlClassesToHide) then
            {

                _x ctrlShow false;
            };
        } forEach _allCtrls;
    };

    private _bum_fnc_restartAchillesHandle = {
        [{isNull findDisplay 312 || {!isnull findDisplay -1}}, Bum_fnc_handleAchillesMod] call CBA_fnc_waitUntilAndExecute;
    };

    switch (findDisplay -1 getVariable "BIS_fnc_initDisplay_configClass") do
    {
        case "RscDisplayAttributesGroup":
        {
            [["ButtonBehaviour","ButtonSide","RespawnPosition2","Skill2"]] call _bum_fnc_hideCtrls;
        };
        case "RscDisplayAttributesVehicle":
        {
            [["ButtonCargo","ButtonAmmo","ButtonDamage","ButtonSensors","ButtonFlag", "Skill2", "RespawnPosition2", "Rank", "Damage", "Fuel", "Ammo", "Lock2", "RespawnVehicle2", "Exec2", "ButtonBehaviour"]] call _bum_fnc_hideCtrls;
        };
        case "RscDisplayAttributesMan":
        {
            [["ButtonBehaviour","RespawnPosition2","Skill2", "Exec2", "ButtonCargo", "ButtonFlag", "Rank2", "Damage2", "Ammo"]] call _bum_fnc_hideCtrls;
        };
    };
    [{isnull findDisplay -1}, _bum_fnc_restartAchillesHandle] call CBA_fnc_waitUntilAndExecute;
};

And it is less than ideal. So any solution would be great!

CreepPork commented 5 years ago

Currently, it is possible to hide all the attribute panels and show specifics using the BIS_fnc_setCuratorAttributes function. You would need to execute it after Achilles has initialized. For the attribute panels, you would need to provide the Achilles used RscAttribute names as the majority of them have been replaced you would need to use something like unitPos2.

You can find the names here:

Bummeri commented 5 years ago

Is there a variable I can check that tells me Achilles has initialized?

Is there a way to remove the extra buttons from between the "ok" and "cancel" buttons?

CreepPork commented 5 years ago

I haven't tested if the function supports removing the attribute buttons, I presume not, but when Achilles is initialized you can try to use this !isNil "ares_category_list".

That's we use for our ZGM missions: https://github.com/ArmaAchilles/ZGM_Achilles_Collection/blob/f1bf9a68018a8acfd54d535e2cbbd351d37d542f/src/ZGM-17_Achilles_Blufor.Altis/initPlayerLocal.sqf#L24