Difference between revisions of "DCS command setFrequencyForUnit"

From DCS World Wiki - Hoggitworld.com
(Created page with " {{Template:DCS_tasking |tName= SetFrequencyForUnit |vNum= 2.5 |type= Command |for= Airplanes, Helicopters |avail= All tasks types |desc= Changes...")
 
(No difference)

Latest revision as of 21:56, 12 January 2024


Task: SetFrequencyForUnit Added with: 2.5
Hierarchy: Scripting Root > Tasks > Command > SetFrequencyForUnit
Tasking Type: Command
For: Airplanes, Helicopters
Available Under: All tasks types
Description: Changes the broadcasting frequency that a specific AI unit 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 = 'SetFrequencyForUnit', 
  params = { 
    frequency = number, 
    modulation = enum radio.modulation, 
    power = number, 
    unitId = 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.

unitId = number,

Optional Parameters:

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

Could also be called via using the setFrequency command on a Unit controller.

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