Difference between revisions of "MIST teleportGroup"

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

Latest revision as of 23:06, 13 April 2018


mist.teleportGroup

Added with: Mist 3.0
Description
teleports a group by the name groupName back to its initial location as set in the mission editor. Teleports the group in its current condition. Destroyed vehicles will stay dead
Syntax
string mist.teleportGroup(string groupName , boolean/number task/taskDelay )
Valid Input Values:
groupName= name of the group that is to be teleported

task= Optional variable that will re-assign the groups original route. If task is not provided group will remain stationary or RTB if an aircraft. Function returns a mission editor formatted table of the group.

taskDelay= If this variable is a number it will re-assign the groups original route after the specified time in seconds

Return value:
string
Return example:
string of group's name
Usage Examples:
The following code will teleport a group back to its original location if less than 25% of the group remains.

 if Group.getByName('groupName') then
   local myGroup = Group.getByName('groupName')
   if myGroup:getSize() < (myGroup:getInitialSize() * .25) then
     mist.teleportGroup('groupName')
     trigger.action.outText('Chronosphere Activated', 20)
   end
 end

Notes:
Calls teleportToPoint to do all of the "heavy lifting".

As of mist 3.3 this function supports the use of static objects.

Related Functions
dynAdd, dynAddStatic, groupTableCheck, getNextUnitId, getNextGroupId, respawnGroup, respawnInZone, cloneGroup, cloneInZone, teleportGroup, teleportInZone, teleportToPoint, spawnRandomizedGroup

Scripting Engine

MIST Root Page