Difference between revisions of "MIST groupToRandomZone"

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

Latest revision as of 23:04, 13 April 2018


mist.groupToRandomZone

Added with: Mist 2.0
Description
Function will set the task of the specified group to go a random zone as defined by zone. group can be either a group name or a group table. zone accepts a zone name, zone table, or table of zone names. If multiple zone names are given the function will randomly pick a zone to go to and pick at random a point in that zone as the final destination. 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.
Syntax
nothing mist.groupToRandomZone(table/string groupTable/groupName ,table/table/string zoneNames/zoneObject/zoneName , string formation ,number heading ,number speed ,boolean useRoads )
Valid Input Values:
Group Entries
 group = string of group name 'myGroup'
 or
 group = Group Object  Group.getByName('myGroup')

Zone Entries

 zone= table of zone name strings {'zone1', 'zone2', 'zone3'}
 zone = string of a zone name 'zone1'
 zone = zone table {point = vec3, radius = number}
 formation= string ground formations
 heading= number in degrees 0 to 360
 speed= number in kilometers per hour
 roadUsing = boolean. If false and the group is 1.3 * radius outside the center of the zone, the group will go to the nearest road
    and follow it to the nearest on road point of the new random point in the zone.
Return value:
nothing
Return example:
nothing
Usage Examples:
Sends the group 'myGroup2' to a random location in myZone1 or myZone2. The group will use the formation cone when off road and if the group spawns outside of the zone that is picked, it will use a road to travel to the nearest point of their destination.

do
  mist.groupToRandomZone('myGroup2', {'myZone1', 'myZone2'}, 'cone', nil, nil, true)
end

All three of these entires do the same thing

  mist.groupToRandomZone(Group.getByName('group1'), trigger.misc.getZone('zone1')) 
  mist.groupToRandomZone(Group.getByName('group1'), 'zone1') 
  mist.groupToRandomZone('group1', {'zone1'})
Notes:
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