Jump to content

F10 Radio menu with Submenus


Adamastor

Recommended Posts

Hi to all.

I’m doing my 1st steps on scripting. I already used MIST and CTLD and respawn units.

Now I’m trying to so a F10 Radio menu with Submenus.

The idea is to open and close units in a target range but is more than 10 target ranges, so, I must separate in groups:

 

F.1 - TR 1 / 2 / 3

F.2 - TR 4 / 5 / 6

F.3 - TR 7 / 8 / 9

F.4 - TR 10/ 11 / 12

 

What I would like to see if F.1 - TR 1 / 2 / 3  is selected:

F.1 - TR 1

F.2 - TR 2

F.2 - TR 3

 

Then, after (ex) F.1 - TR 1 is selected menu disappear from screen and activate the units on that Target Range

 

Then, if F10 menu is selected again I would like to have:

 

 

F.1 - TR 1 / 2 / 3

F.2 - TR 4 / 5 / 6

F.3 - TR 7 / 8 / 9

F.4 - TR 10/ 11 / 12

F5. Close TR 1

 

And if F.5 is selected it “”kills”” all those units in TR 1 and if is selected again the respawn script do the job.

 

I found the addsubmenu script that may do what I need, but have no idea where to put it in ME or if it goes to the actual LUA file from mission (or both)

 

Thanks.

Link to comment
Share on other sites

Put it in your LUA file:

 

local someParam = math.random( 1, 5 )

function newSubMenuPlane (param)
     trigger.action.outText('Function triggered from sub menu, param value is: '..param, 10)
end

local newSubMenu = missionCommands.addSubMenu('__New Submenu Choice')
local iStatus = missionCommands.addCommand('_Choice 1', newSubMenu, newSubMenuPlane, someParam)

 

This is just a basic example, it will add an F10 submenu (__New Submenu Choice), which will have one choice (_Choice 1) - add as many you need.

When clicked on _Choice 1 in comm menu, it will call newSubMenuPlane function, and will pass the parameter value (ignore/leave blank/remove it if you don't need to pass any parameters)

 

Some documentation here: https://wiki.hoggitworld.com/view/DCS_func_addCommand

 

Hope it helps

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...