Difference between revisions of "DCS command setFrequency"

From DCS World Wiki - Hoggitworld.com
m (1 revision imported)
 
 
Line 12: Line 12:
 
|avail= All tasks types
 
|avail= All tasks types
  
|desc= Changes the broadcasting frequency the AI will be using.
+
|desc= 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.  
  
  
Line 22: Line 24:
 
     frequency = number,  
 
     frequency = number,  
 
     modulation = enum radio.modulation,  
 
     modulation = enum radio.modulation,  
 +
    power = number,
 
   }  
 
   }  
 
  }
 
  }
Line 30: Line 33:
  
 
modulation: Enum of radio modulation. AM or FM (0 or 1)
 
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''':
 
'''Optional Parameters''':
 
|enum= {{DCS_enum_radio_modulation}}
 
|enum= {{DCS_enum_radio_modulation}}
 
|exam=
 
|exam=
 
+
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=  
 
|notes=  
  

Latest revision as of 21:49, 12 January 2024


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, Evasion Of ARM, Formation Interval