DCS command setFrequency

From DCS World Wiki - Hoggitworld.com


Task: SetFrequency Added with: 1.2.4
Hierarchy: Scripting Root > Tasks > Command > SetFrequency
Tasking Type: Command
For: Airplanes, Helicopters, Ground Vehicles
Available Under: All tasks types
Description: Changes the broadcasting frequency the AI will be using.

The mission editor UI generally displays frequency values in megahertz (MHz) while this command uses hertz for the value. To convert what the radio frequency would typically display in the aircraft simply multiply that value by 1000000.

Format: This task needs to be in the following format.
SetFrequency = { 
  id = 'SetFrequency', 
  params = { 
    frequency = number, 
    modulation = enum radio.modulation, 
    power = number, 
  } 
}

Required parameters:

frequency: Frequency value in Hz.

modulation: Enum of radio modulation. AM or FM (0 or 1)

power: Power of the radio in watts. 10 is a good default.

Optional Parameters:

Enumerators: Template:DCS enum radio modulation
Examples: The following will set the frequency of someGroup to 131 Mhz AM.
 local freq = {
    id = "SetFrequency",
    params = {
       power = 10,
       modulation = 0,
       frequency = 131000000,
    }
  }
  Group.getByName("someGroup"):getController():setCommand(freq)
Notes: See article Mission Editor: AI Tasking for more information on how AI tasking is handled within DCS.
Task List: Task Wrappers: mission, ComboTask, ControlledTask, WrappedAction


Tasks: AttackGroup, AttackUnit, Bombing, Strafing, CarpetBombing, AttackMapObject, BombingRunway, orbit, refueling, land, follow, followBigFormation, escort, Embarking, fireAtPoint, hold, FAC_AttackGroup, EmbarkToTransport, DisembarkFromTransport, CargoTransportation, goToWaypoint, groundEscort, RecoveryTanker

En-route Tasks: engageTargets, engageTargetsInZone, engageGroup, engageUnit, awacs, tanker, ewr, FAC_engageGroup, FAC

Commands: script, setCallsign, setFrequency, setFrequencyForUnit, switchWaypoint, stopRoute, switchAction, setInvisible, setImmortal, setUnlimitedFuel, activateBeacon, deactivateBeacon, activateICLS, deactivateICLS, eplrs, start, transmitMessage, stopTransmission, smoke_on_off, ActivateLink4, deactivateLink4, activateACLS, deactivateACLS, LoadingShip

Options: ROE, Reaction To Threat, Radar Using, Flare Using, Formation, RTB On Bingo, silence, Disperse on Attack, Alarm State, RTB on Out of Ammo, ECM Using, Prohibit AA, Prohibit Jettison, Prohibit Afterburner, Prohibit AG, Missile Attack Range, Prohibit WP Pass Report, Engage Air Weapons, Option Radio Usage Contact, Option Radio Usage Engage, Option Radio Usage Kill, AC Engagement Range Restriction, jett tanks if empty, forced attack, Altitude Restriction for AAA Min, restrict targets, Altitude Restriction for AAA Max, Prefer Vertical