Jump to content

Recommended Posts

Posted

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.

 

 

Posted (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 by TEMPEST.114
  • Recently Browsing   0 members

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