MIST unitToWP

From DCS World Wiki - Hoggitworld.com
Revision as of 06:24, 12 April 2018 by Grimes (talk | contribs) (Created page with "{{Mission Scripting |fName= mist.utils.unitToWP| |vNum = Mist 4.1 |desc= This function takes a unit object or unit name and returns it's current position as a WP table {x,...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


mist.utils.unitToWP

Added with: Mist 4.1
Description
This function takes a unit object or unit name and returns it's current position as a WP table {x, y, alt, alt_type, speed}. alt_type will always be "BARO". Speed is the current units velocity.
Syntax
WP mist.utils.unitToWP(Unit/string unit/unitName )
Valid Input Values:
any unit object or unit name
Return value:
WP
Return example:
{x, y, alt, alt_type, speed}
Usage Examples:

do

local WP = mist.utils.unitToWP('myUnit')
local altMethodWP = mist.utils.unitToWP(Unit.getByName('myUnit'))

end

Notes:
Related Functions
makeVec2, makeVec3, zoneToVec3, makeVec3GL, vecToWP, unitToWP

Scripting Engine

MIST Root Page