MIST teleportToPoint

From DCS World Wiki - Hoggitworld.com


mist.teleportToPoint

Added with: Mist 3.0
Description
Respawns/Clones/Teleports an group to a point and within a randomized radius of the point.
Syntax
string mist.teleportToPoint(table vars )
Valid Input Values:

vars tables have the following recognized fields( required entries in blue, optional in green):

 vars = 
 {
 groupName = string groupName, 
 point = table point, 
 action = string action,
 disperse = boolean disperse, 
 maxDisp = number maxDisp, 
 radius = number radius, 
 innerRadius = number innerRadius, 
 route = table route,
 newGroupName = string newGroupName, 
 anyTerrain = boolean anyTerrain,
 validTerrain = table validTerrain, 
 offsetRoute = boolean offsetRoute,
 offsetWP1 = boolean offsetWP1,
 initTasks = boolean initTasks,
 }

groupName is the name of the group the function will teleport

point is a vec3 coordinate that designates where the group will spawn

action is a string value which defines the what is done to the group. valid entries are:

'teleport' : Teleports the group in its current state (dead units will not respawn) 
'respawn' : respawns the group
'clone' : creates a copy of the group

disperse is an optional variable that if present each unit of the group will spawn at a random location.

maxDisp is an optional variable that defines how far each unit will be from each other.

radius is an optional variable that defines the max distance from the point that a group can spawn from

innerRadius is an optional variable that defines the minimum distance from the point that the group can spawn from

route is an optional variable that defines the route assigned to the group

newGroupName is an optional variable for the new group name that is to be spawned.

anyTerrain is an optional variable that if present will define any terrain type as valid.

validTerrain is an optional variable used to define specific terrain types you may wish to spawn objects over. Useful for spawning ground units on a runway or in water because by default these options are disabled.

offsetRoute is an optional variable that if present will offset the entire route of the group from the groups original position. Note all task information is kept. For example if used on a ship the assigned shape of the route will be kept, it will simply be offset to the new spawn point.

offsetWP1 is an optional variable that if present will offset the first waypoint of the route of the group from the groups original position. Note all task information is kept. For example if used on a ship, the original route will be kept, but the first waypoint will be in the new location. .

initTasks is an optional variable that will keep the tasks assigned at WP1, but will erase every other waypoint.

Return value:
string
Return example:
string of group's name
Usage Examples:
  local vars = {} 
  vars.gpName = ‘group1’ 
  vars.action = 'clone' 
  vars.point = vec3 
  vars.radius = 1000 
  vars.disperse = ‘disp’ 
  vars.maxDisp = 500 
  mist.teleportToPoint(vars) 
Notes:
As of mist 3.3 this function supports the use of static objects.

This function limits where groups of certain types can spawn. Ground groups can only spawn on the ground and roads. Ships can only spawn on water. And aircraft can be spawned anywhere. Note that for ground groups any part of the airbase like the runway, ramp, or taxiway is not a valid spawning location. This is done so ground units won't accidentally block AI aircraft paths when at an airbase.

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

Scripting Engine

MIST Root Page