Jump to content
Sign in to follow this  
dfear

Comms and Custom menues

Recommended Posts

Have you got any other examples of Comms module loveliness Mr Centipede ?

As of right now, not yet :D

Share this post


Link to post
Share on other sites

Nope..... still not getting this latest BIS_fnc_arrayPush to work at all.

Have you got the complete mission for me to look at please?

Share this post


Link to post
Share on other sites

Back from holidays.. BIS_fnc_arrayPush needs Functions module to be loaded.

Probably the best way to safely edit a previously created comms menu!

Share this post


Link to post
Share on other sites

Welcome back !

If you come up with other Command menu loveliness let us know :)

Share this post


Link to post
Share on other sites

Hey guy's,

just playing around with the communication menu and i have to say it really is a greate feature.

One thing i really would love to know:

If i create/add the command menu to a specific player will the command menu used/shown by this player only?

I mean in MP if i have several player groups will the new commands i added to the menu only shown by the sepcific player where i had added/created it?

Thanks for any info.

Share this post


Link to post
Share on other sites
Here's something I did,

waituntil {!isnil "bis_fnc_init"};

HCS_menu = [
["HCS",false],
["Split Unit (%SELECTED_UNIT_ID)",[2],"",-5,[["expression","nul=[player,(groupSelectedUnits player)] execVM 'cent_HCS2

\cent_HCS2_split.sqf'"]],"1","1"],
["Rejoin Group (%SELECTED_UNIT_ID)",[3],"",-5,[["expression","nul=[player,(hcSelected player)] execVM 'cent_HCS2

\cent_HCS2_joinCM.sqf'"]],"1","1"]
];

waituntil {!isnil "BIS_MENU_GroupCommunication"};
[bIS_MENU_GroupCommunication, ["HCS",[0],"#USER:HCS_menu",-5,[["expression",""]],"1","1"]] call [b]BIS_fnc_arrayPush;[/b]
if (true) exitWith {};

I use the bolded function to add my custom made HCS_menu into the BIS comms menu.

Thank you dfear and kremator for this piece of code

There is another method to add a new menu to an existing Communication menu without the function module :)

sleep 2;
If (isNil "BIS_MENU_GroupCommunication") then {
BIS_MENU_GroupCommunication = [
	[localize "STR_SOM_COMMUNICATIONS", false]
];
};

waituntil {!isnil "BIS_MENU_GroupCommunication"};
CUSTOM_menu = [
["Menu",false],
["Item 1",[2],"",-5,[["expression","hint 'Hello!'"]],"1","1"],
["Item 2",[3],"",-5,[["expression","[] execVM 'myScript.sqf'"]],"1","0"]
];

_count = count BIS_MENU_GroupCommunication;
BIS_MENU_GroupCommunication set [_count, ["Test",[0],"#USER:CUSTOM_menu",-5,[["expression",""]],"1","1"]];

For the shortcut [0] you can also use _count :)

Shortcut 1 is ESC. So you should use (_count + 1) instead of only _count if you want to start with 1 as shortcut.

@SNKMAN: Did you try it in MP? I would say its global so every player will have the same communication.

But maybe if you change the BIS_MENU_GroupCommunication only local and don't public that variable maybe you can change it for only one player :)

Does the SOM module use a variable which displays if the SOM initialised?

Share this post


Link to post
Share on other sites

I have a question, the script below works fine:

CUSTOM_menu = [
["Support Menu",false],
["Fixed-Wing",[2],"",-5,[["expression","nul=[] execVM 'support\fixed_support.sqf'"]],"1","1"],
["Airborne Infantry",[3],"",-5,[["expression","nul=[] execVM 'support\para_support.sqf'"]],"1","1"],
["Close Air Support",[4],"",-5,[["expression","nul=[] execVM 'support\rotor_support.sqf'"]],"1","1"],
["Transport Support",[5],"",-5,[["expression","nul=[] execVM 'support\trans_support.sqf'"]],"1","1"],
["Infantry Support",[6],"",-5,[["expression","nul=[] execVM 'support\inf_support.sqf'"]],"1","1"]
];

BIS_MENU_GroupCommunication = [
[localize "STR_SOM_COMMUNICATIONS", false],
["Support Menu",[2],"#USER:CUSTOM_menu",-5,[["expression",""]],"1","1"]
];

if (true) exitWith {};

But when I add the line in red it no longer works, does anyone know why? Im assuming it has to do with "" or ' ' but I cannot figure it out. Any help would be appreciated.

CUSTOM_menu = [
["Support Menu",false],
["Fixed-Wing",[2],"",-5,[["expression","nul=[] execVM 'support\fixed_support.sqf'"]],"1","1"],
["Airborne Infantry",[3],"",-5,[["expression","nul=[] execVM 'support\para_support.sqf'"]],"1","1"],
["Close Air Support",[4],"",-5,[["expression","nul=[] execVM 'support\rotor_support.sqf'"]],"1","1"],
["Transport Support",[5],"",-5,[["expression","nul=[] execVM 'support\trans_support.sqf'"]],"1","1"],
["Infantry Support",[6],"",-5,[["expression","nul=[] execVM 'support\inf_support.sqf'"]],"1","1"],
       [color="Red"]["Missile Support",[7],"",-5,[["expression","nul=[laserTarget player, getpos missilestart,""Bo_GBU12_LGB"",300]execVM 'support\missile_support.sqf'"]],"1","1"][/color]
];

BIS_MENU_GroupCommunication = [
[localize "STR_SOM_COMMUNICATIONS", false],
["Support Menu",[2],"#USER:CUSTOM_menu",-5,[["expression",""]],"1","1"]
];


if (true) exitWith {};

THE SCRIPT ABOVE HAS BEEN FIXED.

Edited by cobra4v320

Share this post


Link to post
Share on other sites

Is there also a way to create a submenu after you click on one of the menu options? Can we delete a menu option after it has been used a certain amount of times?

---------- Post added at 02:55 AM ---------- Previous post was at 01:52 AM ----------

I figured out the submenus here is what I have:

waituntil {!isnil "bis_fnc_init"};

[] call BIS_fnc_commsMenuCreate;

FixedWing_SUBMENU =
[
["Fixed-Wing Menu",false],
["Fixed-Wing (Station)", [2], "", -5, [["expression", "player sidechat ""this is Fixed (Station)"" "]], "1", "1"],
["Fixed-Wing (CAS)", [3], "", -5, [["expression", "player sidechat "" this is Fixed (CAS)"" "]], "1", "1"],
["Fixed-Wing (RTB)", [4], "", -5, [["expression", "player sidechat "" this is Fixed (RTB)"" "]], "1", "1"]
];

RotorWing_SUBMENU =
[
["Rotor-Wing Menu",false],
["Rotor-Wing (Station)", [2], "", -5, [["expression", "player sidechat ""this is Rotor (Station)"" "]], "1", "1"],
["Rotor-Wing (CAS)", [3], "", -5, [["expression", "player sidechat "" this is Rotor (CAS)"" "]], "1", "1"],
["Rotor-Wing (RTB)", [4], "", -5, [["expression", "player sidechat "" this is Rotor (RTB)"" "]], "1", "1"]
];

Support_MAINMENU = 
[	
 	["Support Menu",false],
["Infantry (Air Assault)", [2], "", -5, [["expression", "player sidechat ""this is Infantry (Air Assualt)"" "]], "1", "1"],
["Infantry (Airborne)", [3], "", -5, [["expression", "player sidechat ""this is Infantry (Airborne)"" "]], "1", "1"],
["Fixed-Wing Support", [4], "#USER:FixedWing_SUBMENU", -5, [["expression", "player sidechat ""this is Fixed-Wing (submenu)"" "]], "1", "1"],
["Rotor-Wing Support", [5], "#USER:RotorWing_SUBMENU", -5, [["expression", "player sidechat ""this is Rotor-Wing (submenu)"" "]], "1", "1"]
];

waituntil {!isnil "BIS_MENU_GroupCommunication"};
[bIS_MENU_GroupCommunication, ["Support Menu",[0],"#USER:Support_MAINMENU",-5,[["expression",""]],"1","1"]] call BIS_fnc_arrayPush;
showCommandingMenu "#USER:Support_MAINMENU";

Edited by cobra4v320

Share this post


Link to post
Share on other sites
One thing i really would love to know:

If i create/add the command menu to a specific player will the command menu used/shown by this player only?

I mean in MP if i have several player groups will the new commands i added to the menu only shown by the sepcific player where i had added/created it?

Would like to know the exact same thing. Does anyone have any experience with this or can point me in the right direction?

Share this post


Link to post
Share on other sites

Hi all,

cool thread. I read up on the issue recently and found this very informative wiki page: http://community.bistudio.com/wiki/showCommandingMenu

But there are still some questions left. For example this argument..

// isActive - Boolean 1 or 0 for yes or no - if item is not active, it appears gray.

...sets the menu item to inactive from the beginning.

I´d guess then there should be some way to activate it later on, but that´s not mentioned anywhere...

Is there any way at all to change/delete/manipulate menu items during the game?

Any ideas?

Thanks in advance,

bbq

------------------------------

edit

@ Clayman and SNKMAN:

I did this with something like

if (player == player1) then {add player specific menu options};

of course I´ve named all playable units accordingly. Tested on dedicated server without problems so far.

Edited by CptBBQ

Share this post


Link to post
Share on other sites

Thanks for the info. :)

To (de)activate a menu item you can use something like this (from the example on the biki page):

// Deactivate first item
BIS_MENU_GroupCommunication set [1, ["First", [0], "", -5, [["expression", "player sidechat ""First"" "]], "1", "0"]];

// Activate second item
BIS_MENU_GroupCommunication set [2, ["Second", [2], "", -5, [["expression", "player sidechat ""Second"" "]], "1", "1"]];

Just change the isActive / isVisible to "1" or "0".

Share this post


Link to post
Share on other sites

Thanks, Clayman!

Will give it a try as soon as I´m home from work.

Share this post


Link to post
Share on other sites

But when I add the line in red it no longer works, does anyone know why? Im assuming it has to do with "" or ' ' but I cannot figure it out. Any help would be appreciated.

THE SCRIPT ABOVE HAS BEEN FIXED.

I have same problem, I ADD NEW new line, but it not work,how can I fix it?

Share this post


Link to post
Share on other sites

I want the option to cancel objectives during the mission using the menu, the below menu and scripting works fine. I just need to find out how to remove the menu item after it has been used. For example if I have to cancel objective one and call the script how do I then tell the menu to remove that line in the communications menu?

waituntil {!isnil "bis_fnc_init"};

[] call BIS_fnc_commsMenuCreate;

Mission_MAINMENU =
[
["Mission Menu",true],
["Cancel Objective Destroy BM-21 Rockets", [2], "", -5, [["expression", "execVM 'mission_menu\objectives\obj1_canceled.sqf'"]], "1", "1"],
["Cancel Objective Destroy Ammo Trucks", [3], "", -5, [["expression", "execVM 'mission_menu\objectives\obj2_canceled.sqf'"]], "1", "1"],
["Cancel Objective Destroy Communications", [4], "", -5, [["expression", "execVM 'mission_menu\objectives\obj3_canceled.sqf'"]], "1", "1"]
];


waituntil {!isnil "BIS_MENU_GroupCommunication"};
[bIS_MENU_GroupCommunication, ["Mission Menu",[0],"#USER:Mission_MAINMENU",-5,[["expression",""]],"1","1"]] call BIS_fnc_arrayPush;


I have been trying this to remove the menu item after it has been used and it is not working. Its not putting out any errors either.

mission_menu\objectives\obj1_canceled.sqf

"tskobj1" objStatus "DONE"; 
tskobj1 setTaskState "CANCELED"; 
_nul = [objNull, ObjNull, tskobj1, "CANCELED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf"; 

BIS_MENU_GroupCommunication set [2, ["Cancel Objective Destroy BM-21 Rockets", [0], "", -5, [["expression", ""]], "0", "0"]];

saveGame;

if (true) exitwith {};

Edited by cobra4v320

Share this post


Link to post
Share on other sites

The only work around that I can come up with is this. There has to be a way to delete or turnoff something in the communications menu.

[color="Red"]if (taskcompleted tskobj1) exitwith {hint "Objective is already complete."};[/color]

"tskobj1" objStatus "DONE"; 
tskobj1 setTaskState "CANCELED"; 
_nul = [objNull, ObjNull, tskobj1, "CANCELED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf"; 

saveGame;

if (true) exitwith {};

Edited by cobra4v320

Share this post


Link to post
Share on other sites

I found a way to make it grayed out but there still has to be an easier way to do this.

"tskobj1" objStatus "DONE"; 
tskobj1 setTaskState "CANCELED"; 
_nul = [objNull, ObjNull, tskobj1, "CANCELED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf"; 

saveGame;


Mission_MAINMENU =
[
["Mission Menu",false],

if (taskcompleted tskobj1) then {["Cancel Objective Destroy BM-21 Rockets", [2], "", -5, [["expression", ""]], "1", "0"]} else {["Cancel Objective Destroy BM-21 Rockets", [2], "", -5, [["expression", "execVM 'mission_menu\objectives\obj1_canceled.sqf'"]], "1", "1"]},

if (taskcompleted tskobj2) then {["Cancel Objective Destroy Ammo Trucks", [3], "", -5, [["expression", ""]], "1", "0"]} else {["Cancel Objective Destroy Ammo Trucks", [3], "", -5, [["expression", "execVM 'mission_menu\objectives\obj2_canceled.sqf'"]], "1", "1"]},

if (taskcompleted tskobj3) then {["Cancel Objective Destroy Communications", [4], "", -5, [["expression", ""]], "1", "0"]} else {["Cancel Objective Destroy Communications", [4], "", -5, [["expression", "execVM 'mission_menu\objectives\obj3_canceled.sqf'"]], "1", "1"]}
];

if (true) exitwith {};

Edited by cobra4v320

Share this post


Link to post
Share on other sites

does any body know how to add menus to the custom menu. option 0-9.

OK Never mind, i found my answer. its the sound menu.

Edited by Linrox

Share this post


Link to post
Share on other sites
does any body know how to add menus to the custom menu. option 0-9.

OK Never mind, i found my answer. its the sound menu.

Now that you have found your answer, would it be possible to share it with the rest of us? I am not able to find the answer myself, and I would be happy to learn what you have found out! :)

Share this post


Link to post
Share on other sites

I doubt he has the answer I've never seen one. No sound menu!

Share this post


Link to post
Share on other sites
I doubt he has the answer I've never seen one. No sound menu!

He's talking about the MP custom sounds, that are (automatically) displayed under this menu.

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  

×