Phantom_Mark Posted March 24, 2020 Posted March 24, 2020 Is it possible to change the ROE and Alarm state globally for a Coalition ?
Mano Posted March 24, 2020 Posted March 24, 2020 I think it's possible via moose scripting. On dcs editor I managed to do that on groups Inviato dal mio CPH1877 utilizzando Tapatalk [sIGPIC][/sIGPIC]
Phantom_Mark Posted March 24, 2020 Author Posted March 24, 2020 I think it's possible via moose scripting. On dcs editor I managed to do that on groups Inviato dal mio CPH1877 utilizzando Tapatalk Yup, got the groups thing covered nicely thanks.......trying to extract as much as possible out of the base editor without using scripts like MOOSE etc for the moment, in the hope it makes the missions more resilient to updates...
patpatpowercat Posted September 13, 2020 Posted September 13, 2020 Anyone figure out how to do this? I am fine with scripting it, just don't know how. I imagine it has to do with something like OptionID. My goal is to have both coalitions set to return fire until a trigger is fired, and then set coalitions to open fire. Thanks, any help is appreciated.
Catweedle Posted September 14, 2020 Posted September 14, 2020 (edited) Here's an example to give you an idea. --[[ AI.Option.Ground.Val.ROE OPEN_FIRE = 2 RETURN_FIRE = 3 WEAPON_HOLD = 4 --]] function changeROE_openFire([color="blue"]coalitionSide[/color]) local groups = 0 for _, group in pairs(coalition.getGroups(coalitionSide)) do if group:isExist() then groups = groups + 1 local group_name = group:getName() group:getController():setOption(0, 2) --open fire end end trigger.action.outText("[ROE CHANGE] 'OPEN FIRE' activated for "..groups.." groups!",10) end function changeROE_holdFire([color="blue"]coalitionSide[/color]) local groups = 0 for _, group in pairs(coalition.getGroups(coalitionSide)) do if group:isExist() then groups = groups + 1 local group_name = group:getName() group:getController():setOption(0, 4) --hold fire end end trigger.action.outText("[ROE CHANGE] 'WEAPON HOLD' activated for "..groups.." groups!",10) end coalitionSide can be 0 (neutral), 1 (red) or 2 (blue). Edited September 14, 2020 by Catweedle Addendum: uses the standard DCS API
patpatpowercat Posted September 15, 2020 Posted September 15, 2020 Thanks Catweedle. However I am still having some trouble. I put what you gave me in a simple trigger that fires after 10 seconds and is just do script, but nothing happens, nor do I have any out text. I changed it to be function changeROE_holdFire(1) local groups = 0 for _, group in pairs(coalition.getGroups(1)) do if group:isExist() then groups = groups + 1 local group_name = group:getName() group:getController():setOption(0, 4) --hold fire end end trigger.action.outText("[ROE CHANGE] 'WEAPON HOLD' activated for "..groups.." groups!",10) end This should give me RED coalition changing to weapons hold. Additionally, when I check the dcs.log file, it doesn't have anything for me to see if something has gone wrong.
Catweedle Posted September 15, 2020 Posted September 15, 2020 Thanks Catweedle. However I am still having some trouble. I put what you gave me in a simple trigger that fires after 10 seconds and is just do script, but nothing happens, nor do I have any out text. You have to define/load the functions in a DO SCRIPT/DO SCRIPT FILE trigger action and subsequently call the function/-s with the desired argument (0, 1 or 2) in another DO SCRIPT / DO SCRIPT FILE to execute the code in their function bodies. ROE-change of course also works without encapsulating the ROE-change in functions -- that's what you tried, but you have to remove the function definition, i.e. top and bottom line in your example. I have attached a simple mission that defines the functions within the ME (vs. loading a script file) and makes them callable via F10-Other-radio (see SWITCHED CONDITION triggers in the mission).change_roe_test.miz
Catweedle Posted September 15, 2020 Posted September 15, 2020 By the way, you could also achieve this simple task with TRIGGERED ACTION's on single units or groups and trigger them via AI TASK PUSH/SET in trigger actions. (Learning) Scripting will give you much more possibilities on the long run, though.
patpatpowercat Posted September 15, 2020 Posted September 15, 2020 Thanks this is exactly what I was trying to do! I have done it with just the editor before, but it's tedious with so many groups.
Recommended Posts