74DELTA Posted October 11, 2024 Posted October 11, 2024 HI all you Mist/Moose Gurus! With something so easy I hate to admit that I have been struggling but it's time to reach out and ask for help. I am making a weekend mission for my peeps and the current problem is to dynamically modify the F10/Radio menu as units are spawned and killed. I am more of a Moose guy but this is shaping up using Mist. I have both languages loaded in this *.MIZ so open to any solution and of course if there is a better way to do this I am all ears. Scenario is this; Summary Request Enemy unit spawns and this creates a Radio (F10) SubMenu Item under "Other>Active Missions", as a new line of text, no functions or commands, basic. When the target is killed the radio menu text is removed. Status I have been successful using Mist to create my global submenu under "Other" as "Active Missions", and to create the submenu and text under that as units spawn to the map, but cannot find a way to have them removed when the unit is killed. Currently when an enemy is spawned, I can generate the following, as an example; F10>Other>Active Missions>Strike at Saipan>BMP Spotted at Saipan!. I Cannot seem to remove it once the unit is dead. I can get it to remove the top level (Active Missions) and down, but that is no bueno. Technical I create the main submenu under "Other" like so; subR = missionCommands.addSubMenu('Active Missions') When a unit spawns, I create the following Submenu and text string under the submenu like so; subN1 = missionCommands.addSubMenu('Strike at Saipan', subR) subNN2 = missionCommands.addSubMenu('BTR80 Spotted near Saipan', subN1) Problem Abstract; I've used Moose, DCS ME and Mist to try and remove the "Strike at Saipan" level menu item and below when the unit is killed and there is no joy. Examples; Radio Item Remove missionCommands.removeSubMenu('Strike at Saipan', subR) missionCommands.removeItem('Strike at Saipan', subR) MENU_MISSION:Remove('Strike at Saipan', 'BTR80 Spotted near Saipan') And others variations of similar strings of code. Thanks for any guidance on this.
kira_mikamy Posted October 12, 2024 Posted October 12, 2024 ive not a direct answer to that specific situation involving mist, cause i didnt use that for so long. if you manage to use only moose to make the menu should probably look like that: MAIN_MENU = MENU_COALITION:New(coalition.side.BLUE, "ACTIVE MISSION") --after the spawn of unit use: MISSION_MENU = MENU_COALITION:New(coalition.side.BLUE, "STRIKE AT SAIPAN", MAIN_MENU) MISSION_LIST = MENU_COALITION:New(coalition.side.BLUE, "BTR80 Spotted near Saipan'", MISSION_MENU ) --when the unit is dead (i assume with a event dead?) or whatelse you using to check if theres or not the unit: MAIN_MENU:RemoveSubMenus() and you only have the "Active Misson" main menu without nothing inside it
74DELTA Posted October 12, 2024 Author Posted October 12, 2024 Thank you for the suggestion, still no Joy. appreciate your input though.
kira_mikamy Posted October 12, 2024 Posted October 12, 2024 1 minuto fa, 74DELTA ha scritto: Thank you for the suggestion, still no Joy. appreciate your input though. ive test it and it remove the submenus when triggered, probably there something incorrect in some group naming or so
74DELTA Posted October 16, 2024 Author Posted October 16, 2024 (edited) It's working now. operational code below if anyone is interested. thanks. Mission Trigger to set main root menu sub under Other, "Active Missions" subR = missionCommands.addSubMenu('Active Missions') Using the "Perform Command">"Run Script" on the asset when it spawns to create a mission entry under the Active Missions submenu subN1 = missionCommands.addSubMenu('Strike at Saipan', subR) subNN2 = missionCommands.addSubMenu('BTR80 Spotted near Saipan', subN1) On unit death using a ME trigger, missionCommands.removeItem(subN1) works as intended. Edited October 16, 2024 by 74DELTA typo
Recommended Posts