MIST randomizeNumTable

From DCS World Wiki - Hoggitworld.com
Revision as of 23:09, 13 April 2018 by Grimes (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


mist.randomizeNumTable

Added with: Mist 3.5
Description
Returns a table of numbers (1 to size) in a randomized order of the specified size. The optional variables define which numbers will not be randomized within the table. The lowerLimit and upperLimit variables respectively define the low and upper limits on which numbers can be randomized. The exclude table is a table of numbers, in no particular order, that will not be randomized.
Syntax
table mist.randomizeNumTable(table vars )
Valid Input Values:

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

 vars = 
 {
 size = number size,
 exclude = table exclude, 
 upperLimit = number upperLimit, 
 lowerLimit = number lowerLimit,
 }

size is the size of the table to create

exclude is an optional variable that is a table of numbers that defines which numbers will be ignored.

upperLimit is an optional variable that defines numbers above the given value will not be randomized

lowerLimit is an optional variable that defines numbers below the given value will not be randomized

Return value:
table
Return example:
{1, 2, 6, 8, 5, 4, 3, 7, 9, 10}
Usage Examples:
 mist.randomizeNumTable({size = 10, lowerLimit = 3, upperLimit = 8})
Notes:
Function used within mist.spawnRandomizedGroup and mist.randomizeGroupOrder.
Related Functions
makeUnitTable, getRandPointInCircle, getRandomPointInZone, getRandomPointInPoly, isTerrainValid, terrainHeightDiff, getUnitsInZones, getUnitsInMovingZones, pointInPolygon, getUnitsInPolygon, getDeadMapObjsInZones, getDeadMapObjsInPolygonZone, getUnitsLOS, random, randomizeNumTable, getAvgPoint, getQFE, getWindBearingAndVel, getPathLength, getPathInSegments, getPointAtDistanceOnPath, projectPoint, getGroupsByAttribute, , getUnitsByAttribute, mapValue,

Scripting Engine

MIST Root Page