Difference between revisions of "MIST teleportToPoint"

From DCS World Wiki - Hoggitworld.com
 
(One intermediate revision by the same user not shown)
Line 50: Line 50:
 
|o6N= newGroupName
 
|o6N= newGroupName
  
|o7T= table
+
|o7T= boolean
|o7N= validTerrain
+
|o7N= anyTerrain
  
|o8T=
+
|o8T= table
 +
|o8N= validTerrain
 +
 
 +
|o9T= boolean
 +
|o9N= offsetRoute
 +
 
 +
|o10T= boolean
 +
|o10N= offsetWP1
 +
 
 +
|o11T= boolean
 +
|o11N= initTasks
 +
 
 +
|o12N=
  
 
|r1D= is the name of the group the function will teleport
 
|r1D= is the name of the group the function will teleport
Line 73: Line 85:
 
|o5D=  is an optional variable that defines the route assigned to the group
 
|o5D=  is an optional variable that defines the route assigned to the group
 
|o6D= is an optional variable for the new group name that is to be spawned.
 
|o6D= is an optional variable for the new group name that is to be spawned.
|o7D=  is an optional variable that defines the type of terrain that is checked, if not provided mist will assume any terrain type for aircraft and only ground for ground units.  
+
|o7D=  is an optional variable that if present will define any terrain type as valid.
 +
|o8D= 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.
 +
|o9D= 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. 
 +
|o10D= 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. .
 +
|o11D=  is an optional variable that will keep the tasks assigned at WP1, but will erase every other waypoint.  
  
 
}}
 
}}

Latest revision as of 10:17, 7 July 2021


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