DCS func setAltitude

From DCS World Wiki - Hoggitworld.com
Revision as of 07:09, 17 March 2022 by Grimes (talk | contribs) (Created page with "{{Template:dcs_funcs |fName= setAltitude |vNum= 2.7.11 |par1= Controller |par2= |desc= Sets the controlled aircraft group to the specified altit...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Scripting Root

Envrioment: Mission Scripting
Function: setAltitude Added with: 2.7.11
Member Of: Controller
Syntax: function Controller.setAltitude(Class self , number altitude , boolean keep, string altType)
Description: Sets the controlled aircraft group to the specified altitude in meters.

Optional boolean keep when set to true will maintain that altitude on passing waypoints. If no present or false the aircraft will return to the altitude as defined by their route.

Optional string altType will specify the altitude type used. If nil the altitude type of the current waypoint will be used. Accepted values are the altitude enumerator:

AI.Task.AltitudeType,

"RADIO" = "RADIO"
"BARO"  = "BARO"


Return Value: function
Return Example: none
Examples: The following will set the aircraft to fly at 100m AGL through their route:
   Group.getByName("IAMTHEGREATEST"):getController:setAltitude(100, true, "BARO")
Related Functions: Controller: setTask, resetTask, pushTask, popTask, hasTask, setCommand, setOption, setOnOff, setAltitude, setSpeed, knowTarget, isTargetDetected, getDetectedTargets
Notes: