Difference between revisions of "MIST getAvgPos"

From DCS World Wiki - Hoggitworld.com
 
(No difference)

Latest revision as of 22:53, 13 April 2018


mist.getAvgPos

Added with: Mist 2.0
Description
Returns a vec3 coordinate of the averaged position of defined between each unit passed by the table
Syntax
table mist.getAvgPos(table unitNames )
Valid Input Values:
unitNames =
{[1] = 'unit1', [2] = 'unit2'}
also acceptable is
 {'unit1', 'unit2', 'unit3'} 
Return value:
table
Return example:
vec3
Usage Examples:
Places a smoke marker on the average position of a group in order to avoid friendly fire incidents because some people can't help themselves. (Also see Tiger 1-1)

 do
   trigger.action.smoke(mist.getAvgPos(mist.makeUnitTable({'[g]myGroup'})), "Orange")
 end

Notes:
Related Functions
getGroupData, getCurrentGroupData, getGroupTable getGroupPoints, getGroupRoute, getLeadPos, getAvgPos, getPayload, getGroupPayload, randomizeGroupOrder, groupIsDead

Scripting Engine

MIST Root Page