FlightControl-Master / MOOSE

Mission Object Oriented Scripting Environment (MOOSE) for lua mission scripting design in DCS World
http://flightcontrol-master.github.io/MOOSE/
GNU General Public License v3.0
292 stars 94 forks source link

ADD SetFrequencyForUnit for CONTROLLABLE #2095

Closed docbrownd closed 6 months ago

docbrownd commented 6 months ago

Hi, recently i would like to set frequency to many ship in same group. I try CONTROLLABLE:CommandSetFrequency but nothing works. After reading Hoggit doc, it seem that we need to used SetFrequencyForUnit command.

Possible to add it on Moose ?

Something like :

function CONTROLLABLE:CommandSetFrequencyForUnit(Frequency,Modulation, UnitID, Delay)
  local CommandSetFrequencyForUnit={
    id='SetFrequencyForUnit',
    params={
        frequency=Frequency*1000000,
        modulation=Modulation or radio.modulation.AM,
        unitId=UnitID or self:GetID(),
    },
  }
  if Delay and Delay>0 then
    SCHEDULER:New(nil,self.CommandSetFrequencyForUnit,{self,Frequency,Modulation, UnitID},Delay)
  else
    self:SetCommand(CommandSetFrequencyForUnit)
  end
  return self
end
Applevangelist commented 6 months ago

CommandSetFrequencyForUnit is described in the Wiki as for Airplanes and Helicopters ....

docbrownd commented 6 months ago

CommandSetFrequencyForUnit is described in the Wiki as for Airplanes and Helicopters ....

ya i know, but works also for ship... i think it's for indivudual unit in group. where CommandSetFrequency is for unit alone

Applevangelist commented 6 months ago

will be in the next iteration as CONTROLLABLE:CommandSetFrequencyForUnit(Frequency,Modulation,Power,UnitID,Delay)