Jump to content
Sign in to follow this  
nark0t1k

How disable Commanding Menu?

Recommended Posts

Hi i'm looking how to disable Commanding AI Menu in Arma 3

I'm looking to a script or maybe a setting to be change on each client to disable this !

I allready find a way to empty it but not delete the functions

I'm talking about this

SubuJj7.png

All advice are welcome !

Share this post


Link to post
Share on other sites

I would recommend a KeyDown displayEH, and override the inputAction of the command menu, I'm just not sure which inputAction brings up that menu.

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

https://community.bistudio.com/wiki/inputAction/actions

It may be "forceCommandingMode", but I'm not entirely sure.

You may have to override the display itself, and again, not too sure on that. I know AGM (a mod) has a disable feature in it, haven't looked into how they have done it.

Share this post


Link to post
Share on other sites

Thanks for reply

forceCommandingMode Seem to be only the ² not all commanding menu :/

forceCommandingMode => "~" From https://community.bistudio.com/wiki/inputAction/actions/bindings

I work on a similar version of Altis Life with keyhandle but i actually use key to use skills

Then i already use keybinding for case 2,3,4,5 from now but that open commanding menu and play my script same time

Something like that

case 2: {

[cursorTarget] spawn myfunction;

};

Work with this commanding menu but was really great if i find a way to disable this totally and let me use these key

Share this post


Link to post
Share on other sites

You need this:https://community.bistudio.com/wiki/displayAddEventHandler

"Returning true in EH code will override default engine handling for keyboard events. "

So if you override the keys by calling your function by a display eh and returning true, theoretically the menu shouldn't open. I haven't tried it with this menu, but usually it works as you'd expect.

Share this post


Link to post
Share on other sites

Ok

in Init.sqf

(findDisplay 46) displayAddEventHandler ["KeyDown", "_this call life_fnc_keyHandler"];

I use "File: fn_keyHandler.sqf"

i use something like this??

switch (_code) do

{

case 1:

{

if(vehicle player != player && alive vehicle player) then

{

if((vehicle player) in life_vehicles) then

{

[vehicle player] call life_fnc_openInventory;

};

};

_handled = true;

};

};

Share this post


Link to post
Share on other sites

1. You'll need to wait until display is active (!isNull (findDisplay 46)), or player is not null, THEN you can add ehs.

2. you have to return true for the eh: (findDisplay 46) displayAddEventHandler ["KeyDown", {_this spawn life_fnc_keyHandler; true}];

* I wrote spawn instead of call since I really don't know what you are doing inside your script.

But you need to check it, I am not sure it is possible that it overrides ALL keypresses, which sucks.

Sorry, I cannot test it right now.

Edited by zapat

Share this post


Link to post
Share on other sites

No problem guys thanks for advice

If anybody have other advice :D

Share this post


Link to post
Share on other sites

How about something like this?

[color=#FF8040]
[color=#FF0000]0[/color] [color=#191970][b]spawn[/b][/color]
[color=#8B3E2F][b]{[/b][/color]
  [color=#191970][b]waitUntil[/b][/color] [color=#8B3E2F][b]{[/b][/color][color=#8B3E2F][b]![/b][/color][color=#191970][b]isNull[/b][/color] [color=#8B3E2F][b]([/b][/color][color=#191970][b]findDisplay[/b][/color] [color=#FF0000]46[/color][color=#8B3E2F][b])[/b][/color][color=#8B3E2F][b]}[/b][/color][color=#8B3E2F][b];[/b][/color]
  [color=#8B3E2F][b]([/b][/color][color=#191970][b]findDisplay[/b][/color] [color=#FF0000]46[/color][color=#8B3E2F][b])[/b][/color] [color=#191970][b]displayAddEventHandler[/b][/color] [color=#8B3E2F][b][[/b][/color][color=#7A7A7A]"KeyDown"[/color][color=#8B3E2F][b],[/b][/color]
  [color=#8B3E2F][b]{[/b][/color]
      [color=#191970][b]if[/b][/color] [color=#8B3E2F][b]([/b][/color][color=#8B3E2F][b]([/b][/color][color=#000000]_this[/color] [color=#191970][b]select[/b][/color] [color=#FF0000]1[/color][color=#8B3E2F][b])[/b][/color] [color=#8B3E2F][b]>[/b][/color][color=#8B3E2F][b]=[/b][/color] [color=#FF0000]2[/color] [color=#8B3E2F][b]&[/b][/color][color=#8B3E2F][b]&[/b][/color] [color=#8B3E2F][b]([/b][/color][color=#000000]_this[/color] [color=#191970][b]select[/b][/color] [color=#FF0000]1[/color][color=#8B3E2F][b])[/b][/color] [color=#8B3E2F][b]<[/b][/color][color=#8B3E2F][b]=[/b][/color] [color=#FF0000]11[/color][color=#8B3E2F][b])[/b][/color] [color=#191970][b]then[/b][/color] [color=#8B3E2F][b]{[/b][/color][color=#000000]_this[/color] [color=#191970][b]spawn[/b][/color] MyHandlerFnc[color=#8B3E2F][b];[/b][/color] [color=#000000]true[/color][color=#8B3E2F][b]}[/b][/color] [color=#191970][b]else[/b][/color] [color=#8B3E2F][b]{[/b][/color][color=#000000]false[/color][color=#8B3E2F][b]}[/b][/color]
  [color=#8B3E2F][b]}[/b][/color][color=#8B3E2F][b]][/b][/color][color=#8B3E2F][b];[/b][/color]
[color=#8B3E2F][b]}[/b][/color][color=#8B3E2F][b];[/b][/color][/color]

Made with KK's SQF to BBCode Converter

Edit: tested, works.

Edited by zapat

Share this post


Link to post
Share on other sites

Thanks !

I will work with this :)

What different between

0 spawn {};

and

[] spawn {};

Share this post


Link to post
Share on other sites

Nothing. You just pass something empty. 0 is one less character. :-)

Share this post


Link to post
Share on other sites
Nothing. You just pass something empty. 0 is one less character. :-)

if you wanted to be super sneaky you could just pass nothing to the script tho

Share this post


Link to post
Share on other sites
if you wanted to be super sneaky you could just pass nothing to the script tho

Depending on where he runs the script, you might get an error if you don't pass at least an empty array.

Share this post


Link to post
Share on other sites

Doesn't spawn require something to be passed to it?

As far as I remember I got an error with a naked spawn. Call can be naked though. At least this is what I remember.:-)

Share this post


Link to post
Share on other sites
Doesn't spawn require something to be passed to it?

As far as I remember I got an error with a naked spawn. Call can be naked though. At least this is what I remember.:-)

You are probably right. I just know I got an error the other day when I tried to send nothing through a spawn.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×