Jump to content

EDITOR ADD COMMAND SUB MENU


Recommended Posts

Hi guys, help, I created a training mission and I created the radio menu to activate the various training sessions.
the problem is that even if the flags that are activated are repetitive, they are activated only once! It's a script problem, I can't make it repetitive .... I have already done all the necessary tests in the editor so I will turn the script to you and please help me ....

 

 

local M1 = missionCommands.addSubMenu("A2G", nil)

local M2 = missionCommands.addSubMenu("CONVOGLIO", M1)
local M3 = missionCommands.addSubMenu("GROUND EST", M1)
local M4 = missionCommands.addSubMenu("JTAC POLIGONO", M1)
missionCommands.addCommand("ON", M2,function() trigger.action.setUserFlag(1, true) end, nil)
missionCommands.addCommand("0FF", M2,function() trigger.action.setUserFlag(2, true) end, nil)
missionCommands.addCommand("ON", M3,function() trigger.action.setUserFlag(3, true) end, nil)
missionCommands.addCommand("OFF", M3,function() trigger.action.setUserFlag(4, true) end, nil)
missionCommands.addCommand("ON", M4,function() trigger.action.setUserFlag(15, true) end, nil)
missionCommands.addCommand("0FF", M4,function() trigger.action.setUserFlag(16, true) end, nil)

Link to comment
Share on other sites

I'm pretty sure you don't want to make the trigger REPETITIVE. I think you want SWITCHED CONDITION.

 

You may also want your ACTIONS for any "ON" or "OFF " commands to set the triggering Flag back to False. In the example above, your "M2 ON" command should set Flag 1 to false in the Mission Editor actions. Similarly, "M2 OFF" should set Flag 2 to false in the actions.

 

Feel free to upload your mission file, and I can take a look.

i7-7700K @ 4.9Ghz | 16Gb DDR4 @ 3200Mhz | MSI Z270 Gaming M7 | MSI GeForce GTX 1080ti Gaming X | Win 10 Home | Thrustmaster Warthog | MFG Crosswind pedals | Oculus Rift S

Link to comment
Share on other sites

  • Recently Browsing   0 members

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