dcsext.ai.Waypoint

Waypoint - a single stop along a dcsext.ai.Route followed by a DCS unit group.

Contents

  1. Description
  2. Methods
    1. waypoint:createGround(point, speed, formation, name)
    2. waypoint:createNaval(point, speed, depth, name)
    3. waypoint:createLandingTakeoff(airbase, wtype, speed)
    4. waypoint:setPoint(vec2, wptype, action)
    5. waypoint:setAlt(alt, alttype)
    6. waypoint:setSpeed(spd)
    7. waypoint:setETA(time)
    8. waypoint:addTask(task, tasktype, idx)
    9. waypoint:removeTask(idx)
    10. waypoint:get()
  3. Metamethods
    1. waypoint:__init(point, wtype, action, speed, name)
  4. Tables
    1. waypoint.wpType
    2. waypoint.wpAction

Description

Helps in constructing a DCS mission task, see “DCS task mission” on the Hoggit Wiki.

Methods

waypoint:createGround(point, speed, formation, name)

Class method to create a ground group compatible waypoint. The waypoint altitude is taken from the terrain height at the given point.

Parameters

point
a Vec2
speed
number in meters per second
formation
(optional) one of AI.Task.VehicleFormation, defaults to AI.Task.VehicleFormation.ON_ROAD
name
(optional) name of waypoint

Returns

  • dcsext.ai.Waypoint the new ground group waypoint

waypoint:createNaval(point, speed, depth, name)

Class method to create a naval group compatible waypoint.

Parameters

point
a Vec2
speed
number in meters per second
depth
depth in meters, the waypoint altitude is set to its negated absolute value so the waypoint sits below sea level
name
(optional) name of waypoint

Returns

  • dcsext.ai.Waypoint the new naval group waypoint

waypoint:createLandingTakeoff(airbase, wtype, speed)

Class method to create a landing or takeoff waypoint linked to the given airbase.

Parameters

airbase
a DCS Airbase instance
wtype
one of Waypoint.wpType, required to specify the takeoff type or landing; also used as the waypoint name
speed
(optional) speed in meters per second

Returns

  • dcsext.ai.Waypoint the new landing or takeoff waypoint

waypoint:setPoint(vec2, wptype, action)

Set the waypoint location.

Parameters

vec2
a Vec2 point
wptype
one of Waypoint.wpType, defaults to TURNING_POINT
action
(optional) one of Waypoint.wpAction otherwise an appropriate value will be chosen based on wtype, falling back to TURNING_POINT when no mapping exists

waypoint:setAlt(alt, alttype)

Set the altitude of the waypoint.

Parameters

alt
altitude in meters to set for the waypoint
alttype
(optional) one of AI.Task.AltitudeType, defaults to BARO

waypoint:setSpeed(spd)

Set the speed of the waypoint. Locks the speed and releases any ETA override set with setETA().

Parameters

spd
speed in meters per second

waypoint:setETA(time)

Set ETA, this will override the speed and make the group go at the speed necessary to reach the waypoint at the given time.

Parameters

time
time in seconds since the mission started

waypoint:addTask(task, tasktype, idx)

Add a new task to the waypoint task list.

Parameters

task
task table as generated by createTaskTbl, e.g. by the dcsext.ai.tasks helpers
tasktype
one of the values defined in dcsext.enum.TASKTYPE
idx
(optional) integer position to insert the task at, later tasks shift down; appends to the end of the list when omitted

waypoint:removeTask(idx)

Remove a task from the waypoint task list.

Parameters

idx
(optional) integer position of the task to remove, removes the last task when omitted

Returns

  • the removed wrapped task table, see dcsext.ai.exec.wrapTask, or nil when idx is out of range

waypoint:get()

Get a raw DCS compatible representation of the waypoint, suitable for use as a route point in a DCS mission task.

Returns

  • t table holding the waypoint attributes merged with the point coordinates and any wrapped tasks

Metamethods

waypoint:__init(point, wtype, action, speed, name)

Constructor.

Parameters

point
Vec2|Vec3 if Vec3 the altitude component will be used to set the altitude of the waypoint
wtype
one of Waypoint.wpType
action
(optional) one of Waypoint.wpAction otherwise an appropriate value will be chosen based on wtype
speed
(optional) speed in meters per second
name
(optional) name of the waypoint

Tables

waypoint.wpType

Waypoint types. Maps symbolic names onto AI.Task.WaypointType values. Use TURNING_POINT for ships and ground groups.

Parameters

[TURNING_POINT]
[TAKEOFF]
[TAKEOFF_PARKING]
[TAKEOFF_PARKING_HOT]
[TAKEOFF_GROUND]
[TAKEOFF_GROUND_HOT]
[LAND]
[LAND_REARM]

waypoint.wpAction

Waypoint actions. Maps symbolic names onto AI.Task.WaypointType and AI.Task.TurnMethod values. Use TURNING_POINT for ships and ground groups.

Parameters

[TURNING_POINT]
[FLY_OVER_POINT]
[FROM_PARKING]
[FROM_PARKING_HOT]
[FROM_GROUND]
[FROM_GROUND_HOT]
[FROM_RUNWAY]
[LANDING]
[LANDING_REARM]