Jump to content

Recommended Posts

Posted (edited)

Hi,

Can I set a default F10 command?

When I create a mission, I use missionCommands.addCommandForGroup or addSubMenu to add my own commands.

I want to set a default command which will always be present regardless of the mission I fly without the need to add it specifically to the mission itself.

Can this be done? Is there anywhere I can add this command so that it will always be available? 

 

 

Edited by karpiyon
Posted

Since addCommand needs a callback (i.e. something specific) I don't think you can do it on a global basis unless you install a mod, or modify the central mission lua script.

 

So yes, it can be done, but it would be specific to your install, will probably need re-doing on every update, and may break the integrity check.

Posted

Thanks,

That is good enough.

Is there anywhere I can see an example of how to do this? Which file exactly to alter, where and how to add the command.

e.g.

Add a default menu item which will always call myTestFunction().

 

Thanks

 

 

 

 

 

Posted

You can try and patch any lua script that you know loads - e.g. autextec.lua or missionscripting.lua. I don't recommend it, and you must also ensure that myTestFunction also loads - meaning it'll have to be implemented or required in the same file that you patch.

 

Posted (edited)

Any idea how I do that?

I need to add to and existing F10 menu item or create a new one.

I tried to add it in: ...DCS World\Scripts\UI\RadioCommandDialogPanel\RadioCommandDialogsPanel.lua as shown below, replacing the item with my own but that does not work.

It corrupts the radio menus completely and no menu is displayed.


 

    janjanMenuItem = {
        name = _('JanJan menu'),
        items = {
            [1] = {name = _("Phrases"),
            command = sendMessage.new("janjan")
            }    
        }
    }
        
    menus = {},
    menuOther = { --Misson command menu
        name = _('Other'),
        submenu = {
            name  = _('Other'),
            --items = {} <= replacing this 
            items = {janjanMenuItem}
        }
    },

 

Any suggestion how to do it?

If this is not the way, perhaps I can manually add :missionCommands.addSubMenu but the question is where do I plant it to be loaded for all missions.

 

 

Edited by karpiyon
  • Recently Browsing   0 members

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