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

Use Arma 3 Communication Menu for ACE-less gameplay #23

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

Use Arma 3 Communication Menu for ACE-less gameplay #23

freghar opened this issue Mar 10, 2021 · 2 comments

Comments

@freghar
Copy link
Owner

freghar commented Mar 10, 2021

@freghar
Copy link
Owner Author

freghar commented Mar 30, 2021

Don't use the submenu = argument, because it only allows for a static array-based submenu.

Instead, use a custom function in

class CfgCommunicationMenu {
    class a3aa_blabla {
        ...
        expression = "[_target,_pos] call a3aa_some_fnc_root_level_item";  //(_target=CursorTarget,_pos=CursorPos)
        ...
        enable = "1";
        removeAfterExpressionCall = 0;
    };
    ...

and have the function refresh the new info in a global variable, ie.

a3aa_some_var = [
    ["Some group 1", [0], "", -5, [["expression", format ["player assign group %1", _grp1] ]], "1", "1"],
    ["Some group 2", [0], "", -5, [["expression", format ["player assign group %1", _grp2] ]], "1", "1"]
];

and then manually call

showCommandingMenu "#USER:a3aa_some_var";

and (if you need to) wait for completion like

waituntil { commandingMenu != "#USER:a3aa_some_var" };

See also functions_f/Conversations/fn_kbMenu.sqf.

Remember to add the root menu item via

[player, "a3aa_some_fnc_root_level_item", nil, nil, ""] call BIS_fnc_addCommMenuItem;

TODO: Perhaps have a root "A3AA" item (because of maximum of 10 Supports menu items) that would have a function with some global array of sub-menu items, to which various arma-additions addons would add items (join group, etc.) whenever enabled.

@freghar
Copy link
Owner Author

freghar commented Nov 6, 2021

Alternatively, avoid all this BS and just use journal diary entries and

<execute expression="sqf code here">blabla</execute>
OR
<executeClose expression="sqf code here">blabla</execute>

https://community.bistudio.com/wiki/createDiaryRecord

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

No branches or pull requests

1 participant