horus-DCS Posted May 6, 2024 Posted May 6, 2024 Hi editors, I wanna set some trigger actions based on their current alarm state. I know how to set it to a group, but then how to get it from a group? Thanks in advance.
TEMPEST.114 Posted May 6, 2024 Posted May 6, 2024 (edited) 2 hours ago, horus-DCS said: Hi editors, I wanna set some trigger actions based on their current alarm state. I know how to set it to a group, but then how to get it from a group? Thanks in advance. https://wiki.hoggitworld.com/view/DCS_option_alarmState https://wiki.hoggitworld.com/view/DCS_enum_AI https://wiki.hoggitworld.com/view/Category:Tasks https://wiki.hoggitworld.com/view/DCS_func_setOption https://wiki.hoggitworld.com/view/DCS_option_roe If you use the controller singleton you should be able to interrogate a group to iterate through it's current TASKS to find one with the option for ROE and compare it to the enums from the AI table. This is a snippet from the IADScript that creates an new task to change the groups task based on the ROE local task = iadGroup:getTask() if timer.getTime() > (task.count * (task.int * math.random(5))) + (task.startTime - math.random(10)) then -- if its time to blink task.count = task.count + 1 if task.type == 'engage' then -- alternates between fire and search if radar is on when blink order given if iadGroup.ROE == 'fireAtWill' then iadGroup:search() elseif iadGroup.ROE == 'search' then iadGroup:shoot() end else -- otherwise toggles on/off if iadGroup.ROE == 'dark' then iadGroup:search() elseif iadGroup.ROE == 'search' then iadGroup:goDark() end end end else -- setting the task local task = {} if iadGroup.ROE == 'fireAtWill' or iadGroup.ROE == 'search' then task.type = 'engage' task.radarAction = 'fireAtWill' else task.type = 'off' task.radarAction = 'search' end task.duration = length -- how long task is performed task.startTime = timer.getTime() task.action = 'blink' task.int = 5 task.count = 1 task.taskFor = length + timer.getTime() iadGroup:setTask(task) Hope that helps. Edited May 6, 2024 by TEMPEST.114
Recommended Posts