Kamron Posted October 13, 2018 Posted October 13, 2018 Hello everyboby I start the scripted missions, I want to use a radio command to destroy all the red planes in the air. I use MIST but I have not found this function. If anyone could help me ... thank you in advance
feefifofum Posted October 13, 2018 Posted October 13, 2018 getcoalition will return the faction of the selected group or unit. If there aren't a ton of planes and you know how many will be airborne and their names, you can simply use group.getByName('whatever'):destroy() If you don't know or things are dynamically spawned you'll need to build a table by getting the coalition and aircraft type then running a loop to destroy all objects in the table. If you want them to visibly explode vs. just being removed from the sim, then this should work trigger.action.explosion(Unit.getByName('whatever'):getPosition().p, 200) THE GEORGIAN WAR - OFFICIAL F-15C DLC
Kamron Posted October 13, 2018 Author Posted October 13, 2018 Concretely it is a mission training. I have two separate groups of 4 aircraft each. Currently I have a trigger (Clear all enemies) with two actions: group.getByName ('group1'): destroy () and group.getByName ('group2'): destroy (). It works if both groups are still in the air. but if one of the two groups does not exist anymore I have an error message of the script ...
feefifofum Posted October 13, 2018 Posted October 13, 2018 Gotcha...you can disable that popup with a line of code, that's probably the best option. Run this at mission start. :thumbup: https://wiki.hoggitworld.com/view/DCS_func_setErrorMessageBoxEnabled THE GEORGIAN WAR - OFFICIAL F-15C DLC
Kamron Posted October 13, 2018 Author Posted October 13, 2018 Thank you for this solution! Sorry as I do not master at all, all the functions of MIST, I do not understand how to write the code of this function What variable should I put? Can you get me the code to go on the editor please?
Kamron Posted October 13, 2018 Author Posted October 13, 2018 I find it sorry : env.setErrorMessageBoxEnabled(false)
Recommended Posts