Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Selection of multiple sets of units/groups #503

Open
freghar opened this issue Jan 10, 2021 · 2 comments
Open

Feature Request: Selection of multiple sets of units/groups #503

freghar opened this issue Jan 10, 2021 · 2 comments
Labels
feature Adds a new feature

Comments

@freghar
Copy link

freghar commented Jan 10, 2021

Is your feature request related to a problem?
When using Achilles, I had this custom module:

[
    "AI Behaviour",
    "[U] Reveal enemies",
    {
        private _revealed = [_this select 1];
        if (objNull in _revealed) then {
            _revealed = ["to-be-revealed units"] call Achilles_fnc_SelectUnits;
        };
        if (isNil "_revealed") exitWith {};
        private _informed_units = ["groups to be informed"] call Achilles_fnc_SelectUnits;
        if (isNil "_informed_units") exitWith {};
        private _informed = [];
        { _informed pushBackUnique group _x } forEach (_informed_units select { alive _x });
        [
            [_revealed, _informed],
            {
                params ["_revealed", "_informed"];
                {
                    private _toinform = _x;
                    {
                        _toinform reveal _x;
                    } forEach _revealed;
                } forEach _informed;
            }
        ] remoteExec ["call"];  /* reveal has local effect, see wiki */
    }
] call Ares_fnc_RegisterCustomModule;

The Achilles_fnc_SelectUnits worked by letting the user select units/groups, pressing Return to submit - this has been largely replaced by ZEN's CBA keybind that can bring up a context menu for multiple units/groups, but this lacks the ability to distinguish multiple sets of units/groups.

In my case, I need two selections - units/groups to be revealed and units/groups that the first set should be revealed to.

And I figured there are probably other use cases for these selections (ie. suppressive fire from multiple units onto multiple units) that it might be worth solving in ZEN directly, somehow.

Solution you'd like:
The Achilles method is intuitive enough to use and fairly state-less, with Curator messages telling the user what the selections is for and audio feedback confirming the selection, it's fast to use in a chaotic situation.

If the Return keypress is an issue for blocking on the function call (due to KeyDown / KeyUp having different context), then an API similar to ZEN's fnc_selectPosition.sqf would be probably reasonable, even if that would break up the code a bit.

Alternatives you've considered:
On the group level, since ZEN/curatorSelected preserves selection ordering, I could designate that the first selected group has special meaning or something like that, but that doesn't have much flexibility.

@Radiumio Radiumio added the feature Adds a new feature label Jan 10, 2021
@Kexanone
Copy link
Member

Kexanone commented Jan 13, 2021

ZEN_editor_fnc_getSelection that will be introduced with #501 will be the replacement for Achilles_fnc_SelectUnits.

Edit: It returns the last selection before the module gets placed, so it can't be used for getting multiple selections.

@freghar
Copy link
Author

freghar commented Jan 24, 2021

In the end, I implemented this in my repo as freghar/arma-additions@017a7af for both scheduled and unscheduled envs - not creating a PR here as it uses the Achilles way of selecting units (place module on ground, play some sound, select units, confirm via Return or cancel via Escape, play another sound depending on that) instead of what's proposed in #501, which seems like a different approach to this according to the video (an automatic way to apply the module function on multiple objects, individually).

Still leaving this open in case anybody wants to implement something similar in ZEN (perhaps using a different approach that is more ZEN-like).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Adds a new feature
Projects
None yet
Development

No branches or pull requests

3 participants