Difference between revisions of "MIST groupToPoint"

From DCS World Wiki - Hoggitworld.com
m
 
(2 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
|vNum = Mist 2.0
 
|vNum = Mist 2.0
  
|desc= unction will set the task of the specified group to go a the point defined by a zones location. group can be either a group name or a group table. point can be a zoneTable or zoneName. form is the default formation name in as defined by the scripting engine. See mist.ground.buildWP or the Scripting Engine wiki for details. Heading is the final heading the group will be oriented in once it reaches its destination. speed is the speed in kilometers per hour that the group will travel at to reach its destination. dontUseRoads defines if the group will use a road to get to the point.   
+
|desc= This function will set the task of the specified group to go a the point defined by a zones location. 'group' can be either a group name or a group table. The destination point can be either a zoneTable structure or a zoneName. 'form' is the default formation name as defined by the scripting engine. (See mist.ground.buildWP or the Scripting Engine wiki for details). 'Heading' is the final heading the group will be oriented in once it reaches its destination. 'speed' is the speed in kilometers per hour that the group will travel at to reach its destination. 'ignoreRoads' controls whether the group will try to use roads to get to the point.   
  
 
|rtnType= nothing
 
|rtnType= nothing
Line 33: Line 33:
 
|optType4= boolean
 
|optType4= boolean
  
|optName4= useRoads
+
|optName4= ignoreRoads
  
 
|varExamples= group = 'myGroup'  
 
|varExamples= group = 'myGroup'  
Line 56: Line 56:
 
speed = any positive number. (Group limited by lowest max speed of vehicles in the group)
 
speed = any positive number. (Group limited by lowest max speed of vehicles in the group)
  
dontUseRoads = boolean (any value)  True if you don't want to force the group not use a road. Otherwise if the destination is further than 1.3* the radius of the destination zone the group will automatically seek out a road to go to the destination.  
+
ignoreRoads = boolean (any value)  True if you don't want the group to use roads. Otherwise if the destination is further than 1.3* the radius of the destination zone the group will automatically seek out a road to go to the destination.  
  
 
|rtnExamples= nothing
 
|rtnExamples= nothing
  
 
|example= <code>
 
|example= <code>
 
 
   mist.groupToPoint('myGroup', 'myZone', nil, 35, 30)
 
   mist.groupToPoint('myGroup', 'myZone', nil, 35, 30)
 
   mist.groupToPoint('myGroup2', 'myZone', 'cone', nil, nil, true)
 
   mist.groupToPoint('myGroup2', 'myZone', 'cone', nil, nil, true)
Line 67: Line 66:
  
 
|notes=  
 
|notes=  
 +
A zoneTable structure is a Lua table in the form:
 +
<nowiki>{
 +
  point = { x, y, z },
 +
  radius = </nowiki>''metres''<nowiki>
 +
}</nowiki>
 +
 +
The zoneTable.point is a standard DCS Vec3 structure.
  
 
|funcs= {{listOfMistGroupOrders}}
 
|funcs= {{listOfMistGroupOrders}}

Latest revision as of 02:20, 22 January 2023


mist.groupToPoint

Added with: Mist 2.0
Description
This function will set the task of the specified group to go a the point defined by a zones location. 'group' can be either a group name or a group table. The destination point can be either a zoneTable structure or a zoneName. 'form' is the default formation name as defined by the scripting engine. (See mist.ground.buildWP or the Scripting Engine wiki for details). 'Heading' is the final heading the group will be oriented in once it reaches its destination. 'speed' is the speed in kilometers per hour that the group will travel at to reach its destination. 'ignoreRoads' controls whether the group will try to use roads to get to the point.
Syntax
nothing mist.groupToPoint(table/string group/groupName ,table/string zoneTable/zoneName , string form ,number heading ,number speed ,boolean ignoreRoads )
Valid Input Values:
group = 'myGroup'

or group = Group.getByName('myGroup')

table = 'myZone' table = zoneTable

form =

 "Off Road" - moving off-road in Column formation 
 "On Road" - moving on road in Column formation 
 "Rank" - moving off road in Row formation 
 "Cone" - moving in Wedge formation 
 "Vee" - moving in Vee formation 
 "Diamond" - moving in Diamond formation 
 "EchelonL" - moving in Echelon Left formation 
 "EchelonR" - moving in Echelon Right formation  

heading = -360 to 360

speed = any positive number. (Group limited by lowest max speed of vehicles in the group)

ignoreRoads = boolean (any value) True if you don't want the group to use roads. Otherwise if the destination is further than 1.3* the radius of the destination zone the group will automatically seek out a road to go to the destination.

Return value:
nothing
Return example:
nothing
Usage Examples:
 mist.groupToPoint('myGroup', 'myZone', nil, 35, 30)
 mist.groupToPoint('myGroup2', 'myZone', 'cone', nil, nil, true)

Notes:
A zoneTable structure is a Lua table in the form:
{
  point = { x, y, z },
  radius = metres
}

The zoneTable.point is a standard DCS Vec3 structure.

Related Functions
General goRoute
Ground groupToPoint, groupToRandomZone, groupRandomDistSelf, groupToRandomPoint, buildWP(ground), patrol, patrolRoute
Fixed Wing buildWP(fixedWing)
Helicopter buildWP(helicopter)

Scripting Engine

MIST Root Page